Recommendation method, device, electronic device and storage medium
By constructing user social graphs and user project social graphs, obtaining interest and influence representations, and training project recommendation models, we solve the problem that existing recommendation methods fail to effectively consider social influence, and achieve more accurate user project recommendations.
Patent Information
- Application Number
- CN202110846408.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-26
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2041-07-26
AI Technical Summary
Existing recommendation methods fail to effectively consider the social influence in user behavior, resulting in inaccurate recommendations.
By constructing a user social graph and a user-item social graph, user interests and social influence representations are obtained, and combined with user-item interaction information, the item recommendation model is trained to generate more accurate user-item interaction prediction information.
With full consideration of social influence, the accuracy of user item recommendation is improved and recommendation results are provided that are closer to the user's real behavior.
Smart Images

Figure CN113761388B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a recommendation method, device, electronic equipment and storage medium. Background Art
[0002] Recommender systems are now used in many information service platforms. They aim to automatically recommend personalized item lists based on the user's historical behavior, such as products in e-commerce platforms, other users in social service platforms, etc.
[0003] However, the recommendation methods in the prior art often only consider the influence of homogeneity in social relationships on user information, that is, the behaviors of users with social connections are more similar than those of strangers. In real scenarios, user behaviors (such as purchases on e-commerce platforms) are often directly influenced by friends, which is called social influence. This has not been effectively modeled in previous social recommendation work, which leads to inaccurate modeling of users' real behaviors and inaccurate recommendations.
[0004] Therefore, how to deal with inaccurate recommendations has become a problem that needs to be solved urgently in the industry. Summary of the invention
[0005] The present invention provides a recommendation method, device, electronic device and storage medium, which are used to solve the problem of inaccurate recommendation in the prior art.
[0006] The present invention provides a recommendation method, comprising:
[0007] Inputting the user-project social data group into the trained project recommendation model to obtain interaction prediction information between each user and each project, wherein the user-project social data group includes at least one of user-user social information, user-project-user influence behavior information, and user-project interaction information, and the trained project recommendation model is trained based on the user-project social sample data group;
[0008] Generate item recommendation information for each user based on the interaction prediction information between each user and each item.
[0009] According to a recommendation method provided by the present invention, before inputting the user-project social data group into a trained project recommendation model, the method further includes:
[0010] Based on the user-user social sample information in the user-project social sample data group, a user social graph is constructed, and user interest embedding and propagation is performed according to the user social graph to obtain a target interest representation;
[0011] Based on the user-project-user influence behavior sample information in the user-project social sample data group, a user-project social graph is constructed, and social influence embedding and propagation are performed according to the user-project social graph to obtain a target social influence representation.
[0012] According to a recommendation method provided by the present invention, before inputting the user-project social data group into a trained project recommendation model, the method further includes:
[0013] Obtaining a plurality of user-item interaction sample information and first positive and negative sample labels corresponding to the user-item interaction sample information, and obtaining a plurality of user-item-user influence behavior sample information and second positive and negative sample labels corresponding to the user-item-user influence behavior sample information;
[0014] Taking each of the user-item interaction sample information and the first positive and negative sample labels as a first training sample, to obtain a plurality of first training samples;
[0015] Taking each of the user-item-user influence behavior sample information and the second positive and negative sample labels as a second training sample, to obtain a plurality of second training samples;
[0016] The preset item recommendation model is trained using the multiple first training samples and the multiple second training samples.
[0017] According to a recommendation method provided by the present invention, the method of training a preset item recommendation model using the plurality of first training samples and the plurality of second training samples comprises:
[0018] Determine user-item interaction prediction information of the first training sample based on the target interest representation and the target social influence representation, so as to optimize a first loss function of an item recommendation model according to the user-item interaction prediction information of the first training sample and the first positive and negative sample labels;
[0019] Optimizing a second loss function of the item recommendation model based on the second training sample;
[0020] The first loss function and the second loss function are optimized alternately, and when a preset optimization condition is met, the training is stopped to obtain a trained item recommendation model.
[0021] The present invention also provides a recommendation device, comprising: a processing module, for inputting a user-project social data group into a trained project recommendation model to obtain interaction prediction information between each user and each project, wherein the user-project social data group includes at least one of user-user social information, user-project-user influence behavior information, and user-project interaction information, and the trained project recommendation model is obtained by training based on the user-project social sample data group;
[0022] The recommendation module is used to generate project recommendation information for each user based on the interaction prediction information between each user and each project.
[0023] According to a recommendation device provided by the present invention, the device further comprises: an embedded propagation module;
[0024] The embedding propagation module is used to construct a user social graph based on the user-user social sample information in the user-project social sample data group, and perform user interest embedding propagation according to the user social graph to obtain a target interest representation;
[0025] Based on the user-project-user influence behavior sample information in the user-project social sample data group, a user-project social graph is constructed, and social influence embedding and propagation are performed according to the user-project social graph to obtain a target social influence representation.
[0026] According to a recommendation device provided by the present invention, the device further includes a training module;
[0027] The training module is used to obtain a plurality of user-item interaction sample information and first positive and negative sample labels corresponding to the user-item interaction sample information, and obtain a plurality of user-item-user influence behavior sample information and second positive and negative sample labels corresponding to the user-item-user influence behavior sample information;
[0028] Taking each of the user-item interaction sample information and the first positive and negative sample labels as a first training sample, to obtain a plurality of first training samples;
[0029] Taking each of the user-item-user influence behavior sample information and the second positive and negative sample labels as a second training sample, to obtain a plurality of second training samples;
[0030] The preset item recommendation model is trained using the multiple first training samples and the multiple second training samples.
[0031] According to a recommendation device provided by the present invention, the training module is further specifically used to determine the user-item interaction prediction information of the first training sample based on the target interest representation and the target social influence representation, so as to optimize the first loss function of the item recommendation model according to the user-item interaction prediction information of the first training sample and the first positive and negative sample labels;
[0032] Optimizing a second loss function of the item recommendation model based on the second training sample;
[0033] The first loss function and the second loss function are optimized alternately, and when a preset optimization condition is met, the training is stopped to obtain a trained item recommendation model.
[0034] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any of the above-mentioned recommendation methods when executing the program.
[0035] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of any of the above-mentioned recommendation methods are implemented.
[0036] The present invention provides a recommendation method, device, electronic device and storage medium, which fully consider the influence of social information on the user's project selection from three aspects: user-user social information, user-project-user influence behavior information, and user-project interaction information, and determine the interaction prediction information between each user and the project through a project recommendation model that can fully characterize user interests and social influences, so as to make project recommendations to users more accurately based on the interaction prediction information while fully considering the social influences. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0038] Figure 1 A schematic diagram of a recommended method flow chart provided in an embodiment of the present invention;
[0039] Figure 2 A user-project social relationship graph according to an embodiment of the present application;
[0040] Figure 3A schematic diagram of embedding and propagating user interests in a user social graph provided in an embodiment of the present application;
[0041] Figure 4 A schematic diagram of embedded propagation on a UIU social graph provided in an embodiment of the present application;
[0042] Figure 5 A schematic diagram of a comparative learning framework provided in an embodiment of the present application;
[0043] Figure 6 A recommendation flow chart with u and i as target users and projects provided in an embodiment of the present application;
[0044] Figure 7 A schematic diagram of the recommended device structure provided for the embodiments of the present application;
[0045] Figure 8 An example physical structure diagram of an electronic device is provided. DETAILED DESCRIPTION
[0046] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0047] Figure 1 Schematic diagram of the recommended method provided in the embodiment of the present invention, such as Figure 1 As shown, including:
[0048] Step 110, inputting the user-project social data group into the trained project recommendation model to obtain interaction prediction information between each user and each project, wherein the user-project social data group includes at least one of user-user social information, user-project-user influence behavior information, and user-project interaction information, and the trained project recommendation model is trained based on the user-project social sample data group;
[0049] The user-project social database described in the present application may be specifically obtained from the user's historical data, and may filter out user information and project information with too little interaction data in the historical data, for example, filter out user information and project information with less than 5 interactions.
[0050] The project information described in this application may be user product information, or a video link project on a social networking site, etc.
[0051] In the present application, user-user social information may specifically be data information used to characterize the social influence between users, user-project interaction information may refer to data information on the interactive relationship between users and projects, and user-project-user influence behavior information may specifically refer to data information on the social influence of users on other users on a specific project.
[0052] The trained project recommendation model described in this application can fully consider the impact of user interests and social influences on user project selection, thereby more accurately predicting the interaction prediction information between the user and each project. The interaction prediction information can be a floating-point score, which is used to characterize the possibility of the user interacting with the project.
[0053] Step 120: Generate item recommendation information for each user based on the interaction prediction information between each user and each item.
[0054] Specifically, since the interaction prediction information between each user and each item represents the possibility that the user may interact with the item, the embodiment of the present application can generate the K items with the largest interaction prediction information corresponding to each user as the item recommendation information for the user.
[0055] In the embodiments of the present application, the influence of social information on the user's project selection is fully considered from three aspects: user-user social information, user-project-user influence behavior information, and user-project interaction information. The interaction prediction information between each user and the project is determined through a project recommendation model that can fully characterize user interests and social influences. Based on the interaction prediction information, project recommendations can be made to users more accurately while fully considering social influences.
[0056] Optionally, before inputting the user-project social data group into the trained project recommendation model, the method further includes:
[0057] Based on the user-user social sample information in the user-project social sample data group, a user social graph is constructed, and user interest embedding and propagation is performed according to the user social graph to obtain a target interest representation;
[0058] Based on the user-project-user influence behavior sample information in the user-project social sample data group, a user-project social graph is constructed, and social influence embedding and propagation are performed according to the user-project social graph to obtain a target social influence representation.
[0059] Specifically, in the embodiment of the present application, in order to characterize the user-item interaction behavior and the user-user social relationship, a unified graph is first constructed based on the user-item interaction information Y, the user-user social information S, and the user-item-user influence behavior information B as input data. Figure 2 This is a user-project social relationship diagram of an embodiment of the present application, such as Figure 2 As shown, Figure 2 The nodes in the graph are users and items. The edges on the graph include interaction behaviors (u,i), where user u has interacted with item i; social relationships (u,u′), where user u has a social connection with u′; and social influence behaviors (u,u * ,i * ), where user u to his friend u * In Project I * Furthermore, we construct the user social graph and the user-project social graph, namely the user-user (U-USocial Graph) social graph and the user-project-user (UIU Social Graph) social graph, to respectively model user interests and social influence under homogeneity semantics.
[0060] More specifically, user behavior is influenced by both their own interests and social influences. To explicitly model these two influencing factors, a decoupled embedding layer is introduced here to assign embedding expressions to each factor. Specifically, two embedding matrices are constructed for all users: Here D is the dimension of the embedding vector, is the set of all users. I and S represent the two factors of user interest and social influence respectively. To ensure the consistency of the latent space, two embedding matrices are also constructed for the project. here is the set of all items. Therefore, the above embedding matrix can be used to convert the one-hot user and item encodings into embedding vectors.
[0061] Based on the two social graphs constructed above and the embedded vectors representing user interests and social influence introduced, the novel graph convolution operation designed here is used to learn embedded expressions, thereby capturing social homogeneity and social influence respectively. For heterogeneous social homogeneity modeling, an attention-based embedded expression propagation mechanism is used here to learn user interests under homogeneity semantics. For explicit modeling of social influence, message passing is performed here on the UIU path.
[0062] The user-user social graph contains implicit social relationships between users, that is, friends tend to have similar interests. However, in real scenarios, this homogeneity is often heterogeneous, that is, for a certain user, the level of similarity between his or her interests and different friends is also different. Considering this diverse homogeneity, the attention mechanism is used here when performing embedding propagation. For the target user u, the embedding propagation process is:
[0063]
[0064] in, is the friend set of user u. The superscript l refers to the number of layers of propagation. It refers to the attention weight corresponding to the homogeneity strength between user u′ and target user u, which is calculated as follows:
[0065]
[0066] Among them, <·, ·> refers to the inner product operation.
[0067] Figure 3 A schematic diagram of embedding and propagating user interests in a user social graph provided in an embodiment of the present application, such as Figure 3 As shown in the figure, through multi-layer embedding propagation, an embedding expression for representing user interests can be obtained, which encodes high-order social graph structure information.
[0068] Compared with social homogeneity modeling, social influence modeling has not been explicitly explored in many current algorithms. UIU's social graph provides this user behavior that expresses social influence, making it possible to explicitly model influence. Given a triple (u, i, u′), item i can be regarded as an information propagation path that controls how users u and u′ influence each other.
[0069] Therefore, a novel gated propagation rule is proposed in the embodiment of the present application to model this influence mechanism. The propagation is divided into two steps. The first step is to aggregate the influence of a specific friend u′ on the target user u through multiple different projects. For the propagation of the lth layer, this step is described as:
[0070]
[0071] in, Refers to the set of items involved in the social influence behavior between users u and u′. ⊙ is the element-by-element multiplication, W l is the linear parameter matrix, It is the attention weight corresponding to the influence strength of the above different projects.
[0072] Specifically, It expresses the influence strength between user u and u′ on project i. The first term in the above formula indicates that for each influence propagation path (u, i, u′), the relevant project representation is used as a control to select which social influence to propagate; the second term represents a jump connection to directly transmit information from the domain. After obtaining the explicit social influence of each friend, the attention-based approach is used to aggregate all influences from different friends.
[0073]
[0074] here Refers to the set of all users who have a social influence on user u. is the overall influence weight of friend u′. Specifically, the weight is calculated as follows:
[0075]
[0076] Figure 4 A schematic diagram of embedded propagation on a UIU social graph provided in an embodiment of the present application is shown in FIG. Figure 4 As shown in the figure, through multiple layers of embedding propagation, an embedding expression for characterizing social influence can be obtained, which encodes high-order social graph structure information.
[0077] After L times of embedding propagation through the aforementioned convolutional layers, we obtain L+1 sets of user and item embedding representations that model user interests and social influences, including the representations initialized at layer 0. By aggregating the representations of each layer through mean pooling operations and fusing classic collaborative signals, we obtain the target interest representation and target social influence representation, respectively:
[0078]
[0079]
[0080] The second term in the formula is a layer of embedding aggregation on the user-item interaction graph, representing a shallow collaborative signal; Refers to the set of items that user u has interacted with.
[0081] In an embodiment of the present application, based on the user social graph and the user project social graph, respectively, through multi-layer embedding propagation, an embedded expression representing social influence and user interest can be obtained, and collaborative information can be integrated to obtain a target interest representation and a target social influence representation, which can perform more accurate representation and ensure the accuracy of subsequent model training.
[0082] Optionally, before inputting the user-project social data group into the trained project recommendation model, the method further includes:
[0083] Obtaining a plurality of user-item interaction sample information and first positive and negative sample labels corresponding to the user-item interaction sample information, and obtaining a plurality of user-item-user influence behavior sample information and second positive and negative sample labels corresponding to the user-item-user influence behavior sample information;
[0084] Taking each of the user-item interaction sample information and the first positive and negative sample labels as a first training sample, to obtain a plurality of first training samples;
[0085] Taking each of the user-item-user influence behavior sample information and the second positive and negative sample labels as a second training sample, to obtain a plurality of second training samples;
[0086] The preset item recommendation model is trained using the multiple first training samples and the multiple second training samples.
[0087] Specifically, the first training sample and the second training sample in the embodiment of the present application both include observed training samples and randomly sampled training samples, and the observed training samples are generated based on historical data based on the user, which means that the interaction between the user and the project actually occurs, or the user actually receives social influence from other users in response to the selection of the project. Therefore, the observed first training sample corresponds to a first positive sample label, and the observed second training sample corresponds to a second positive sample label; the randomly generated first training sample corresponds to a first negative sample label, and the randomly generated second training sample corresponds to a second negative sample label.
[0088] The step of training the preset item recommendation model by using the plurality of first training samples and the plurality of second training samples includes:
[0089] Determine user-item interaction prediction information of the first training sample based on the target interest representation and the target social influence representation, so as to optimize a first loss function of an item recommendation model according to the user-item interaction prediction information of the first training sample and the first positive and negative sample labels;
[0090] Optimizing a second loss function of the item recommendation model based on the second training sample;
[0091] The first loss function and the second loss function are optimized alternately, and when a preset optimization condition is met, the training is stopped to obtain a trained item recommendation model.
[0092] Specifically, the second loss function in this application refers to a loss function that assists contrastive learning. In fact, in order to avoid modeling social influence as performing multi-layer convolution operations on the user-project social graph, which still lacks clear interpretability, contrastive learning is introduced here to assist model optimization in order to give influence representation more explicit and rich semantics.
[0093] Specifically, social influence data As positive samples, negative samples are randomly selected for each positive sample triple (u, u′, i), including two levels: project level and friend level. The two levels are used to learn and explain why the influence of user u on friend u′ is reflected in project i rather than other projects, and why user u influences friend u′ through project i rather than other users. Considering the multi-layer operation of convolution, the objective function that needs to be optimized for contrastive learning is,
[0094]
[0095]
[0096] in, and is a set of training samples for comparative learning at the project and friend levels, defined as follows:
[0097]
[0098]
[0099] Where N is the number of negative samples for each positive sample. j, v refer to negative items and negative friends respectively.
[0100] Figure 5 A schematic diagram of a comparative learning framework provided in an embodiment of the present application, such as Figure 5 As shown, for each triple (u, u′, i), use the function g l (u, u′, i) to predict whether it is an observed social influence behavior, defined as
[0101]
[0102] The matching score contains three parts. Specifically, the first item refers to the similarity between the interests of user u and user u′, the second item refers to the preference of user u for item i, and the third item refers to the preference of user u′ for item i.
[0103] Taking into account the representations of each layer together, as well as the two levels of items and friends, the final loss function is:
[0104]
[0105] By optimizing this objective function, the social influence representation will be endowed with rich and clear semantics.
[0106] In addition, the function g l The output of represents the strength of social influence between specific users u and u′ through a certain project i, so it is used as the embedding propagation of the user-project social graph to aggregate the weights of influence through different projects. The weight is calculated as follows:
[0107]
[0108] For any first training sample, the final representation vector obtained above can be used to calculate the size of the interaction probability:
[0109] s(u,i)=s I (u,i)+s S (u, i),
[0110]
[0111] The first term in the formula refers to the degree of match between user preferences and item attributes, which is mainly the modeling of user interests; the second term in the formula refers to the intensity of influence of a user by his local social circle through a specific item. The optimization function of the recommendation main task adopts the classic BPR method, which aims to assign a higher score to the observed user-item interaction than the observed interaction. The first loss function is,
[0112]
[0113] here is the first training sample set, which includes the observed first training sample interactions with positive labels and the randomly sampled first training samples with negative labels. Θ is the learnable parameter in the model, λ is the L2 regularization coefficient, and σ is the sigmoid function. By optimizing the model in two relatively independent latent spaces, the representation ability of the model will be significantly improved. In other words, the two main factors affecting user interaction behavior, user interest and social influence, are flexibly embedded in two sets of corresponding entity representations.
[0114] For the first loss function And the second loss function of auxiliary contrastive learning Here, we use alternating training to optimize the model and weigh the relative importance by adjusting the learning rates of each. Specifically, in each training round, we first use the data Batch-by-batch optimization Use the data after the end Batch-by-batch optimization When the preset training conditions are met, the training is terminated and finally a trained item recommendation model is obtained.
[0115] In an embodiment of the present application, the first loss function is trained based on the first training sample that can fully characterize the social influence and user interest, and the model is trained by alternating training in combination with the second loss function for auxiliary learning, which can effectively ensure the recommendation accuracy of the recommendation model.
[0116] Optionally, in an embodiment of the present application, user behavior data within a period of time, such as three months, is used to generate a customized Top-K recommendation list for each user. First, user-project interaction data, user-user social relationships, and user-project-user social influence data within the corresponding time need to be collected. First, user behavior data within the corresponding time is collected on the e-commerce social platform database, and users and projects with an interaction number of <5 (that is, commodities on these two platforms) are filtered out. The corresponding social influence data are sharing and group buying behaviors between users. Based on the above collected and filtered data, a user-project social graph and a user social graph are constructed. The relevant data expressed in the graph include:
[0117] User-item interaction data: {(u, i1), (u, i2), (u, i3), (u, i4), (u, i5)}, user-user social relationships: {(u, u′1), (u, u′2), (u, u′3), (u, u′4)},
[0118] User-item-user social influence data: {(u, u′1, i1), (u, u′4, i5), (u, u′3, i2), (u, u′3, i3)}.
[0119] First, initialize the user embedding matrix and the product embedding matrix. Then, according to the user-project social graph and the user social graph, perform user interest embedding propagation, social influence embedding propagation and aggregation. Then, fuse the representations of each layer and the collaborative signals to obtain the final target interest representation and target social influence representation. Finally, use the above representations to calculate the user-product score and the loss function of the recommendation task. And the loss function of contrastive learning The training negative samples required for loss function calculation are randomly sampled before the start of each training round.
[0120] The system running program is written based on Tensor Flow, and the optimization adopts its own gradient-based back propagation algorithm. The specific optimizer is the default Adam. The loss function is optimized in an alternating manner. When certain conditions are met, the training ends. At this time, the model parameters are determined, which can be used to predict the interaction probability of any user-item pair. Based on this, a list of K items with the highest probability can be generated for each user as a recommendation list.
[0121] Generally, the dimension D of the embedding vector can be selected between {32, 64, 100, 128}, the learning rate in training can be adjusted between {1e-3, 3e-4, 1e-4, 3e-5, 1e-5, 3e-6, 1e-6}, and the L2 regularization coefficient λ can be adjusted between {1e-2, 1e-3, 1e-4, 1e-5, 1e-6}. These hyperparameters need to be determined by grid search. The batch data specifications during training are set to 128 and 4096 respectively on the e-commerce social platform database, which is more appropriate. and The highest recommendation performance can be achieved when the ratio of the learning rate is 10:1.
[0122] Figure 6 The recommendation flow chart with u and i as target users and projects provided in the embodiment of the present application is as follows: Figure 6 shown.
[0123] The recommendation device provided by the present invention is described below. The recommendation device described below and the recommendation method described above can be referred to each other.
[0124] Figure 7 A schematic diagram of the recommended device structure provided in the embodiment of the present application, such as Figure 7 As shown, it includes: a processing module 710 and a recommendation module 720; wherein the processing module 710 is used to input the user-project social data group into a trained project recommendation model to obtain interaction prediction information between each user and each project, and the user-project social data group includes at least one of user-user social information, user-project-user influence behavior information, and user-project interaction information. The trained project recommendation model is trained based on the user-project social sample data group; wherein the recommendation module 720 is used to generate project recommendation information for each user based on the interaction prediction information between each user and each project.
[0125] Optionally, the device further comprises: an embedded propagation module;
[0126] The embedding propagation module is used to construct a user social graph based on the user-user social sample information in the user-project social sample data group, and perform user interest embedding propagation according to the user social graph to obtain a target interest representation;
[0127] Based on the user-project-user influence behavior sample information in the user-project social sample data group, a user-project social graph is constructed, and social influence embedding and propagation are performed according to the user-project social graph to obtain a target social influence representation.
[0128] Optionally, the device further comprises a training module;
[0129] The training module is used to obtain a plurality of user-item interaction sample information and first positive and negative sample labels corresponding to the user-item interaction sample information, and obtain a plurality of user-item-user influence behavior sample information and second positive and negative sample labels corresponding to the user-item-user influence behavior sample information;
[0130] Taking each of the user-item interaction sample information and the first positive and negative sample labels as a first training sample, to obtain a plurality of first training samples;
[0131] Taking each of the user-item-user influence behavior sample information and the second positive and negative sample labels as a second training sample, to obtain a plurality of second training samples;
[0132] The preset item recommendation model is trained using the multiple first training samples and the multiple second training samples.
[0133] Optionally, the training module is further configured to determine the user-item interaction prediction information of the first training sample based on the target interest representation and the target social influence representation, so as to optimize the first loss function of the item recommendation model according to the user-item interaction prediction information of the first training sample and the first positive and negative sample labels;
[0134] Optimizing a second loss function of the item recommendation model based on the second training sample;
[0135] The first loss function and the second loss function are optimized alternately, and when a preset optimization condition is met, the training is stopped to obtain a trained item recommendation model.
[0136] In the embodiments of the present application, the influence of social information on the user's project selection is fully considered from three aspects: user-user social information, user-project-user influence behavior information, and user-project interaction information. The interaction prediction information between each user and the project is determined through a project recommendation model that can fully characterize user interests and social influences. Based on the interaction prediction information, project recommendations can be made to users more accurately while fully considering social influences.
[0137] Figure 8 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 8 As shown, the electronic device may include: a processor 810, a communication interface 820, a memory 830 and a communication bus 840, wherein the processor 810, the communication interface 820 and the memory 830 communicate with each other through the communication bus 840. The processor 810 may call the logic instructions in the memory 830 to execute the recommendation method, which includes: inputting the user-project social data group into the trained project recommendation model to obtain the interaction prediction information between each user and each project, the user-project social data group includes at least one of user-user social information, user-project-user influence behavior information and user-project interaction information, and the trained project recommendation model is obtained by training based on the user-project social sample data group; and generating the project recommendation information for each user according to the interaction prediction information between each user and each project.
[0138] In addition, the logic instructions in the above-mentioned memory 830 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0139] On the other hand, the present invention also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the recommendation method provided by the above-mentioned methods, and the method includes: inputting a user-project social data group into a trained project recommendation model to obtain interaction prediction information between each user and each project, the user-project social data group includes at least one of user-user social information, user-project-user influence behavior information, and user-project interaction information, and the trained project recommendation model is trained based on the user-project social sample data group; and generating project recommendation information for each user based on the interaction prediction information between each user and each project.
[0140] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to perform the above-mentioned recommendation methods, the method comprising: inputting a user-project social data group into a trained project recommendation model to obtain interaction prediction information between each user and each project, the user-project social data group comprising at least one of user-user social information, user-project-user influence behavior information, and user-project interaction information, the trained project recommendation model being trained based on the user-project social sample data group; and generating project recommendation information for each user based on the interaction prediction information between each user and each project.
[0141] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0142] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0143] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A recommendation method, characterized in that: include: Inputting the user-project social data group into the trained project recommendation model to obtain interaction prediction information between each user and each project, wherein the user-project social data group includes at least one of user-user social information, user-project-user influence behavior information, and user-project interaction information, and the trained project recommendation model is trained based on the user-project social sample data group; Generate project recommendation information for each user based on the interaction prediction information between each user and each project; User-item interaction behaviors and user-user social relationships, specifically: Based on the user-item interaction information Y, user-user social information, and user-item-user influence behavior information B as input data, a unified graph is constructed. The edges on the graph include interaction behavior (u, i), where user u has interacted with item i; social relationship (u, u′), where user u has a social connection with u′; social influence behavior (u, u * ,i * ), user u to his friend u * In Project I * It has a social impact. Construct user social graphs and user-project social graphs, user-user social graphs and user-project-user social graphs to respectively model user interests and social influence under homogeneous semantics; Construct two embedding matrices for all users, D is the dimension of the embedding vector, is the set of all users; I and S represent the two factors of user interest and social influence respectively. Two embedding matrices are also constructed for the project. is the set of all items; use the above embedding matrix to convert the unique user and item encodings into embedding vectors; Based on the two constructed social graphs and the introduced embedding vectors representing user interests and social influence, social homogeneity and social influence are captured respectively; heterogeneous social homogeneity is modeled to learn user interests under homogeneous semantics; For the target user u, the embedding propagation process is: in, is the friend set of user u; the superscript l refers to the number of layers of propagation, It refers to the attention weight corresponding to the homogeneity strength between user u′ and target user u, which is calculated as: Among them, <·,·> refers to the inner product operation; Aggregate the influence of a specific friend u′ on the target user u through multiple different projects. For the propagation of the lth layer, this step is described as: in, Refers to the set of items involved in the social influence behavior between users u and u′; ⊙ is the element-by-element multiplication, W l is the linear parameter matrix, is the attention weight corresponding to the influence strength of the above different projects; Aggregate all influences from different friends in an attention-based way: in, Refers to the set of all users who have social influence on user u; is a friend ′ The overall influence weight of The weights are calculated as follows: Through multi-layer embedding propagation, an embedding expression for characterizing social influence is obtained, which encodes high-order social graph structure information; After embedding propagation through L convolutional layers, we obtain L+1 sets of user and item embedding representations that model user interests and social influences, including the representations initialized at layer 0. By aggregating the representations of each layer through mean pooling operations and fusing classic collaborative signals, we obtain the target interest representation and target social influence representation, respectively: The second term in the formula is a layer of embedding aggregation on the user-item interaction graph, representing a shallow collaborative signal; Refers to the set of items that user u has interacted with.
2. The recommendation method according to claim 1, characterized in that: Before inputting the user-project social data set into the trained project recommendation model, the method further includes: Obtaining a plurality of user-item interaction sample information and first positive and negative sample labels corresponding to the user-item interaction sample information, and obtaining a plurality of user-item-user influence behavior sample information and second positive and negative sample labels corresponding to the user-item-user influence behavior sample information; Taking each of the user-item interaction sample information and the first positive and negative sample labels as a first training sample, to obtain a plurality of first training samples; Taking each of the user-item-user influence behavior sample information and the second positive and negative sample labels as a second training sample, to obtain a plurality of second training samples; The preset item recommendation model is trained using the multiple first training samples and the multiple second training samples.
3. The recommendation method according to claim 2, characterized in that: The step of training the preset item recommendation model by using the plurality of first training samples and the plurality of second training samples includes: Determine user-item interaction prediction information of the first training sample based on the target interest representation and the target social influence representation, so as to optimize a first loss function of an item recommendation model according to the user-item interaction prediction information of the first training sample and the first positive and negative sample labels; Optimizing a second loss function of the item recommendation model based on the second training sample; The first loss function and the second loss function are optimized alternately, and when a preset optimization condition is met, the training is stopped to obtain a trained item recommendation model.
4. A recommendation device, characterized in that: include: A processing module, configured to input a user-project social data group into a trained project recommendation model to obtain interaction prediction information between each user and each project, wherein the user-project social data group includes at least one of user-user social information, user-project-user influence behavior information, and user-project interaction information, and the trained project recommendation model is trained based on the user-project social sample data group; A recommendation module, used to generate project recommendation information for each user based on the interaction prediction information between each user and each project; User-item interaction behaviors and user-user social relationships, specifically: Based on the user-item interaction information Y, user-user social information, and user-item-user influence behavior information B as input data, a unified graph is constructed. The edges on the graph include interaction behavior (u, i), where user u has interacted with item i; social relationship (u, u′), where user u has a social connection with u′; social influence behavior (u, u * ,i * ), user u to his friend u * In Project I * It has a social impact. Construct user social graphs and user-project social graphs, user-user social graphs and user-project-user social graphs to respectively model user interests and social influence under homogeneous semantics; Construct two embedding matrices for all users, D is the dimension of the embedding vector, is the set of all users; I and S represent the two factors of user interest and social influence respectively. Two embedding matrices are also constructed for the project. is the set of all items; use the above embedding matrix to convert the unique user and item encodings into embedding vectors; Based on the two constructed social graphs and the introduced embedding vectors representing user interests and social influence, social homogeneity and social influence are captured respectively; heterogeneous social homogeneity is modeled to learn user interests under homogeneous semantics; For the target user u, the embedding propagation process is: in, is the friend set of user u; the superscript l refers to the number of layers of propagation, It refers to the attention weight corresponding to the homogeneity strength between user u′ and target user u, which is calculated as: Among them, <·,·> refers to the inner product operation; Aggregate the influence of a specific friend u′ on the target user u through multiple different projects. For the propagation of the lth layer, this step is described as: in, Refers to the set of items involved in the social influence behavior between users u and u′; ⊙ is the element-by-element multiplication, W l is the linear parameter matrix, is the attention weight corresponding to the influence strength of the above different projects; Aggregate all influences from different friends in an attention-based way: in, Refers to the set of all users who have social influence on user u; is a friend ′ The overall influence weight of The weights are calculated as follows: Through multi-layer embedding propagation, an embedding expression for characterizing social influence is obtained, which encodes high-order social graph structure information; After embedding propagation through L convolutional layers, we obtain L+1 sets of user and item embedding representations that model user interests and social influences, including the representations initialized at layer 0. By aggregating the representations of each layer through mean pooling operations and fusing classic collaborative signals, we obtain the target interest representation and target social influence representation, respectively: The second term in the formula is a layer of embedding aggregation on the user-item interaction graph, representing a shallow collaborative signal; Refers to the set of items that user u has interacted with.
5. The recommendation device according to claim 4, characterized in that: The device also includes a training module; The training module is used to obtain a plurality of user-item interaction sample information and first positive and negative sample labels corresponding to the user-item interaction sample information, and obtain a plurality of user-item-user influence behavior sample information and second positive and negative sample labels corresponding to the user-item-user influence behavior sample information; Taking each of the user-item interaction sample information and the first positive and negative sample labels as a first training sample, to obtain a plurality of first training samples; Taking each of the user-item-user influence behavior sample information and the second positive and negative sample labels as a second training sample, to obtain a plurality of second training samples; The preset item recommendation model is trained using the multiple first training samples and the multiple second training samples.
6. The recommendation device according to claim 5, characterized in that: The training module is further specifically used to determine the user-item interaction prediction information of the first training sample based on the target interest representation and the target social influence representation, so as to optimize the first loss function of the item recommendation model according to the user-item interaction prediction information of the first training sample and the first positive and negative sample labels; Optimizing a second loss function of the item recommendation model based on the second training sample; The first loss function and the second loss function are optimized alternately, and when a preset optimization condition is met, the training is stopped to obtain a trained item recommendation model.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the recommendation method according to any one of claims 1 to 3 are implemented.
8. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the recommendation method according to any one of claims 1 to 3 are implemented.
Citation Information
Patent Citations
Social e-commerce website commodity recommendation method and device based on sharing behaviors
CN111144986A
Social e-commerce website commodity recommendation method and device based on multiple platforms
CN111177581A
Social recommendation method fusing global and local social interest influences
CN112507246A
Social network link prediction method based on perceptual neural network
CN112508085A
Knowledge social recommendation method, system and equipment based on graph neural network
CN113158071A
