Product recommendation model training method, device, electronic device and storage medium
By generating implicit vectors in the user and product collection and training the recommended model based on the optimization objective function, the problem of explicit and implicit feedback data processing is solved, and the recommendation accuracy and ease of use of model training is improved, and it is suitable for a wide range of personalities Recommended scenarios.
Patent Information
- Application Number
- CN202111566779.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-20
- Publication Date
- 2024-12-17
- Estimated Expiration
- 2041-12-20
AI Technical Summary
Existing recommendation systems are difficult to apply at the same time when processing explicit and implicit feedback data, with low accuracy and difficult model training, which cannot meet the personalized needs of users.
By selecting users and products from the user set and product set, using the product recommendation model to be trained to generate demand hidden vectors and attribute hidden vectors, and training based on implicit or explicit optimization objective functions, the shortcomings of the existing technology are overcome. .
It realizes that the recommendation accuracy can be effectively improved in both explicit and implicit feedback scenarios, provides users with more accurate personalized recommendation results, simplifies the model training process, and expands the scope of application.
Smart Images

Figure CN114282101B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence technology, and further to deep learning technology, and in particular to a training method, device, electronic device and storage medium for a product recommendation model. Background Art
[0002] Recommender System technology refers to the personalized recommendation technology that recommends products that suit the user's preferences to the user in the online recommendation application scenario. In today's Internet era, in order to make full use of a large number of online service resources and improve user experience and satisfaction, many online recommendation systems are widely used in online shopping platforms, video and music media websites and other scenarios.
[0003] For intelligent recommendation system technology, the following four solutions are currently commonly used:
[0004] (1) Non-personalized method. Non-personalized recommendation technology recommends the same products to all users, such as the most popular products, the latest products, the products with the highest ratings, etc. This method is a non-personalized recommendation method. On the one hand, it cannot meet the personalized needs of different users. On the other hand, the selected products will not change in a short period of time, and it cannot continuously recommend different products to users.
[0005] (2) Personalized recommendation method based on point estimation. This method treats the historical interaction records between users and products as positive samples, usually recorded as a score of 1, while products without interaction records are recorded as a score of 0. On this basis, the personalized recommendation method based on point estimation uses a set of rating prediction methods to predict the ratings of each user on different products. In the case of implicit feedback data, negative samples do not mean that the user does not like the product, but it is very likely that the user does not know the product yet and therefore has no interaction record. Therefore, the ratings obtained by rating prediction are unclear and have low accuracy.
[0006] (3) Personalized recommendation technology based on pairwise comparison. This method randomly selects a part of partial order pairs consisting of a positive sample and a negative sample for each user, and then maximizes the likelihood function that all partial order pairs are true to solve the ratings of each user on different products. This method requires a strong independence assumption in the modeling process, that is, each partial order pair compared must be independent of each other, otherwise the objective function cannot be solved. However, this strong independence assumption is difficult to guarantee in real scenarios.
[0007] (4) Personalized recommendation technology based on list order. This method organizes the user's ratings on different data into a list in order of size, and then maximizes the likelihood function that this list order is true to solve the ratings of each user on different products. This method requires the order of the entire list, but there are only two possible ratings in implicit feedback, namely 1 and 0, and the number of levels in most explicit feedback is also very small. Therefore, the resulting list will have a lot of products with the same rating level. How to sort these products is a difficult problem to solve. The commonly used solution is to randomly sample the sorting order multiple times, but this may make model training difficult. Summary of the invention
[0008] The present invention provides a method, device, electronic device and storage medium for training a product recommendation model.
[0009] In a first aspect, the present application provides a method for training a product recommendation model, the method comprising:
[0010] Selecting a user and a product from the user set and the product set as the current user and the current product respectively; wherein the user set and the product set include N users and M products respectively; N and M are both natural numbers greater than 1;
[0011] The training vector corresponding to the current user and the training vector corresponding to the current product are respectively input into the product recommendation model to be trained, and the demand latent vector of the current user and the attribute latent vector of the current product are obtained through the product recommendation model to be trained; the above operation of extracting the current user and the current product is repeatedly performed until the demand latent vector of each user and the attribute latent vector of each product are obtained;
[0012] The product recommendation model to be sequentially trained is trained based on the latent demand vectors of each user, the latent attribute vectors of each product, and a pre-constructed optimization objective function; wherein the optimization objective function includes: an implicit optimization objective function and an explicit optimization objective function.
[0013] In a second aspect, the present application provides a training device for a product recommendation model, the device comprising: a selection module, a calculation module and a training module; wherein:
[0014] The selection module is used to select a user and a product from the user set and the product set as the current user and the current product respectively; wherein the user set and the product set include N users and M products respectively; N and M are both natural numbers greater than 1;
[0015] The calculation module is used to input the training vector corresponding to the current user and the training vector corresponding to the current product into the product recommendation model to be trained, respectively, and obtain the demand latent vector of the current user and the attribute latent vector of the current product through the product recommendation model to be trained; repeatedly perform the above-mentioned operation of extracting the current user and the current product until the demand latent vector of each user and the attribute latent vector of each product are obtained;
[0016] The training module is used to train the product recommendation model to be trained in sequence based on the latent vector of each user's demand, the latent vector of each product's attribute and a pre-constructed optimization objective function; wherein the optimization objective function includes: an implicit optimization objective function and an explicit optimization objective function.
[0017] In a third aspect, an embodiment of the present application provides an electronic device, including:
[0018] one or more processors;
[0019] a memory for storing one or more programs,
[0020] When the one or more programs are executed by the one or more processors, the one or more processors implement the training method of the product recommendation model described in any embodiment of the present application.
[0021] In a fourth aspect, an embodiment of the present application provides a storage medium on which a computer program is stored, which, when executed by a processor, implements the training method of the product recommendation model described in any embodiment of the present application.
[0022] In a fifth aspect, a computer program product is provided, which, when executed by a computer device, implements the training method of the product recommendation model described in any embodiment of the present application.
[0023] The technology according to the present application solves the technical problems that the recommendation scheme in the prior art cannot be applied to application scenarios of explicit feedback and implicit feedback at the same time, and has low accuracy and difficulty in model training. The technical solution provided by the present application can be applied to application scenarios of explicit feedback and implicit feedback at the same time, and can effectively improve the recommendation accuracy and provide users with more accurate recommendation results.
[0024] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0026] Figure 1 It is a first flow chart of the training method of the product recommendation model provided in the embodiment of the present application;
[0027] Figure 2 It is a second flow chart of the training method of the product recommendation model provided in the embodiment of the present application;
[0028] Figure 3 It is a structural diagram of a product recommendation model provided in an embodiment of the present application;
[0029] Figure 4 It is a third flow chart of the training method of the product recommendation model provided in the embodiment of the present application;
[0030] Figure 5 is a schematic diagram of a partial order modeling method under implicit feedback provided in an embodiment of the present application;
[0031] Figure 6 is a schematic diagram of a partial order modeling method under explicit feedback provided in an embodiment of the present application;
[0032] Figure 7 It is a structural schematic diagram of a training device for a product recommendation model provided in an embodiment of the present application;
[0033] Figure 8 It is a block diagram of an electronic device used to implement the training method of the product recommendation model of the embodiment of the present application. DETAILED DESCRIPTION
[0034] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0035] Embodiment 1
[0036] Figure 1 This is a first flow chart of the method for training a product recommendation model provided in an embodiment of the present application. The method can be executed by a training device or electronic device for a product recommendation model. The device or electronic device can be implemented by software and / or hardware. The device or electronic device can be integrated in any intelligent device with network communication function. Figure 1 As shown, the training method of the product recommendation model may include the following steps:
[0037] S101. Select a user and a product from a user set and a product from a product set as a current user and a current product respectively; wherein the user set and the product set include N users and M products respectively; and both N and M are natural numbers greater than 1.
[0038] In this step, the electronic device can select a user and a product from the user set and the product set as the current user and the current product respectively; wherein the user set and the product set include N users and M products respectively; N and M are both natural numbers greater than 1. Preferably, before this step, the electronic device can also first obtain the original interaction records of each user and each product; then determine the partial order relationship of each user for each product based on the interaction records of each user for each current product; wherein the partial order relationship includes: implicit partial order relationship and prior partial order relationship; then store the partial order relationship of each user for each product in a pre-constructed matrix; based on the matrix, perform the operation of selecting a user and a product from the user set and the product set as the current user and the current product respectively.
[0039] S102. Input the training vector corresponding to the current user and the training vector corresponding to the current product into the product recommendation model to be trained respectively, and obtain the current user's demand latent vector and the current product's attribute latent vector through the product recommendation model to be trained; repeat the above operation of extracting the current user and the current product until the demand latent vector of each user and the attribute latent vector of each product are obtained.
[0040] In this step, the electronic device can input the training vector corresponding to the current user and the training vector corresponding to the current product into the product recommendation model to be trained, respectively, and obtain the current user's demand latent vector and the current product's attribute latent vector through the product recommendation model to be trained; repeat the above operation of extracting the current user and the current product until the demand latent vector of each user and the attribute latent vector of each product are obtained. Specifically, the electronic device can first input the training vector corresponding to the current user into the user parsing network in the product recommendation model to be trained, and obtain the current user's demand latent vector through the user parsing network; at the same time, input the training vector corresponding to the current product into the product parsing network in the product recommendation model to be trained, and obtain the attribute latent vector of the current product through the product parsing network.
[0041] S103, based on the demand latent vector of each user, the attribute latent vector of each product and the pre-built optimization objective function, the product recommendation model to be trained sequentially is trained; wherein the optimization objective function includes: an implicit optimization objective function and an explicit optimization objective function.
[0042] In this step, the electronic device can train the product recommendation model to be trained in sequence based on the demand latent vectors of each user and the attribute latent vectors of each product and the pre-constructed optimization objective function; wherein the optimization objective function includes: an implicit optimization objective function and an explicit optimization objective function. Specifically, if the feedback data of each user for each product is implicit feedback data, the electronic device can train the product recommendation model to be trained in sequence based on the demand latent vectors of each user and the attribute latent vectors of each product and the implicit optimization objective function; if the feedback data of each user for each product is explicit feedback data, the electronic device can train the product recommendation model to be trained in sequence based on the demand latent vectors of each user and the attribute latent vectors of each product and the explicit optimization objective function.
[0043] The training method of the product recommendation model proposed in the embodiment of the present application is to first select a user and a product as the current user and the current product in the user set and the product set respectively; then input the training vector corresponding to the current user and the training vector corresponding to the current product into the product recommendation model to be trained respectively, and obtain the demand latent vector of the current user and the attribute latent vector of the current product through the product recommendation model to be trained; repeat the above operation of extracting the current user and the current product until the demand latent vector of each user and the attribute latent vector of each product are obtained; then train the product recommendation model to be trained in sequence based on the demand latent vector of each user and the attribute latent vector of each product and the pre-constructed optimization objective function; wherein the optimization objective function includes: implicit optimization objective function and explicit optimization objective function. In other words, the present application can train the product recommendation model based on the user set and the product set, efficiently model and analyze the real needs and preferences of users in implicit feedback, and solve the problem that the negative samples in the explicit feedback and implicit feedback are unclear and the partial order relationship of user preferences is difficult to establish. However, in the existing training method of the product recommendation model, it is not possible to apply the application scenarios of explicit feedback and implicit feedback at the same time, and the accuracy is low and the model training is difficult. Because the present application adopts the technical means of constructing implicit optimization objective functions and explicit optimization objective functions for the application scenarios of explicit feedback and implicit feedback respectively, and training the product recommendation model based on the user set and the product set, it overcomes the technical problems that the recommendation schemes of the prior art cannot be applied to the application scenarios of explicit feedback and implicit feedback at the same time, and have low accuracy and difficulty in model training. The technical solution provided by the present application can be applied to the application scenarios of explicit feedback and implicit feedback at the same time, and can effectively improve the recommendation accuracy and provide users with more accurate recommendation results; moreover, the technical solution of the embodiments of the present application is simple and convenient to implement, easy to popularize, and has a wider scope of application.
[0044] Embodiment 2
[0045] Figure 21 is a second flow chart of the training method of the product recommendation model provided in the embodiment of the present application. Based on the above technical solution, it is further optimized and expanded, and can be combined with the above optional implementation methods. Figure 2 As shown, the training method of the product recommendation model may include the following steps:
[0046] S201. Select a user and a product from a user set and a product from a product set as a current user and a current product respectively; wherein the user set and the product set include N users and M products respectively; and both N and M are natural numbers greater than 1.
[0047] In the specific embodiment of the present application, To represent the user's learning record matrix, where N is the number of users and M is the number of courses. In implicit feedback, if user i has an interaction record with product l, then record R il =1; otherwise, R il = 0. Therefore, the learning record matrix is a 0-1 matrix. For each user i, the set of products with a score of 1 is denoted as P i , the product set with a score of 0 is recorded as O i In explicit feedback, assuming that there are T levels of ratings, let R il = t, indicating that user i’s rating level for product l is t; t = 0, indicating that user i has no interaction with product l. For each user i, the set of products with a rating of t is denoted as O it , the product set with a score less than t is recorded as
[0048] This application maps the high-dimensional sparse R matrix into two low-dimensional matrices, which are denoted as Among them, U represents the user's needs, and V represents the attributes of the product; the predicted rating record matrix X is U T The matrix product of and V. The i-th column of the matrix U represents the latent vector of user i’s needs, and the lth column of matrix V represents the attribute latent vector of product l; the final recommendation result is given according to the predicted score, and products with high predicted scores are recommended first.
[0049] S202: Input the training vector corresponding to the current user into the user parsing network in the product recommendation model to be trained, and obtain the demand latent vector of the current user through the user parsing network.
[0050] S203. Input the training vector corresponding to the current product into the product parsing network in the product recommendation model to be trained, and obtain the attribute latent vector of the current product through the product parsing network; repeat the above operation of extracting the current user and the current product until the demand latent vector of each user and the attribute latent vector of each product are obtained.
[0051] In a specific embodiment of the present application, the product recommendation model to be trained may include two networks, namely a user analysis network and a product analysis network; the training vector corresponding to the current user is input into the user analysis network; the current user's demand latent vector can be obtained through the user analysis network; the training vector corresponding to the current product is input into the product analysis network, and the attribute latent vector of the current product is obtained through the product analysis network.
[0052] Figure 3 Schematic diagram of the product recommendation model provided in the embodiment of the present application. Figure 3 As shown in the figure, the product recommendation model can include two neural network components, namely the user parsing network and the product parsing network. Each parsing network consists of n layers of fully connected networks (Multi-layer Perception Network). Each layer of the network processes the data transmitted from the previous layer of the network and transmits it to the next layer of the network. The input of the first layer of the network is the user or product rating vector. Specifically, each layer of the network h t There are two parameters, namely the weight coefficient matrix W t and the bias vector b t , taking the user resolution network as an example: h1=f1(W1R i* +b1);h t =f t (W t h t-1 +b t ), t∈[2,n-1]; u i =f n (W n h n-1 +b n );where f t is the activation function of the t-th layer of the neural network. Common activation functions include Sigmoid function, tanh function, etc. In addition to the fully connected network described above, other networks can also be used to obtain latent vector representations of users and products. The final score is composed of the two latent vectors u obtained by the user analysis network and the product analysis network. i and v l The product of is,
[0053] S204. Based on the latent demand vectors of each user, the latent attribute vectors of each product, and the pre-built optimization objective function, the product recommendation model to be sequentially trained is trained; wherein the optimization objective function includes: an implicit optimization objective function and an explicit optimization objective function.
[0054] In this step, the electronic device can train the product recommendation model to be trained in sequence based on the demand latent vectors of each user and the attribute latent vectors of each product and the pre-built optimization objective function; wherein the optimization objective function includes: an implicit optimization objective function and an explicit optimization objective function. Specifically, if the feedback data of each user for each product is implicit feedback data, the electronic device can use the training method corresponding to the implicit feedback data to train the product recommendation model to be trained in sequence. The specific process is: first, for each user, divide the product set into a product set with interaction records and a product set without interaction records; then calculate the product of each user's demand latent vector and the attribute latent vector of each product in the product set with interaction records, as well as the product of each user's demand latent vector and the attribute latent vector of each product in the product set without interaction records; then, based on the product of each user's demand latent vector and the attribute latent vector of each product in the product set with interaction records, as well as the product of each user's demand latent vector and the attribute latent vector of each product in the product set without interaction records, calculate the implicit optimization objective function value corresponding to the user set and the product set through the implicit optimization objective function; then, based on the implicit optimization objective function value corresponding to the user set and the product set, train the product recommendation model for sequential training. More specifically, in implicit feedback, the Bayesian posterior probability to be established in this application is as follows:
[0055]
[0056] in, is a partial order relation of all users, > i is a random variable representing the partial order of user i, and Θ is the parameter to be learned in the scoring modeling part. i O i |Θ) This probability indicates that a positive sample j is better than a set of negative samples O i The probability of partial order relationship is calculated. Note that this probability is equivalent to the probability that this positive sample ranks first in the list consisting of this positive sample and all negative samples, and the order between negative samples does not need to be considered, so there is no problem of the same score ranking in the solution (4) of the prior art. Therefore, the list order probability modeling method in the personalized recommendation technology based on the list order can be adopted, and the formula is as follows:
[0057]
[0058] Among them, p s,1 (d) represents the probability that product d ranks first, s l is the rating of product l. From this, we can get the probabilistic modeling form under implicit feedback:
[0059]
[0060] Then the optimization objective function of the problem can be given as follows:
[0061]
[0062] In the case of implicit feedback, the final optimization objective function is:
[0063]
[0064] The stochastic gradient descent method can be used to solve it. The specific gradient derivation formula is as follows:
[0065]
[0066]
[0067] If the feedback data of each user for each product is explicit feedback data, the electronic device can adopt the training method corresponding to the explicit feedback data to train the product recommendation model for sequential training. The specific process is: first, for each user, the product set is divided into a product set with a score level equal to a predetermined level and a product set with a score level less than a predetermined level; then, the product of each user's demand latent vector and the attribute latent vector of each product in the product set with a score level equal to the predetermined level, and the product of each user's demand latent vector and the attribute latent vector of each product in the product set with a score level less than the predetermined level are calculated; then, based on the product of each user's demand latent vector and the attribute latent vector of each product in the product set with a score level equal to the predetermined level, and the product of each user's demand latent vector and the attribute latent vector of each product in the product set with a score level less than the predetermined level, the explicit optimization objective function value corresponding to the user set and the product set is calculated through the explicit optimization objective function; then, based on the explicit optimization objective function value corresponding to the user set and the product set, the product recommendation model for sequential training is trained. More specifically, in explicit feedback, it is also necessary to model the probability that the positive sample is greater than the negative sample set. The difference is that the positive samples of explicit feedback are divided into different levels. Therefore, when modeling a partial order, samples of level t are only compared with the set of products less than level t. Therefore, the Bayesian posterior probability to be established in this application is as follows:
[0068]
[0069] Similarly, we can get the form of probability modeling under explicit feedback:
[0070]
[0071] Then the optimization objective function of the problem can be given as follows:
[0072]
[0073] Similarly, in the case of explicit feedback, the final optimization objective function is:
[0074]
[0075] The training method of the product recommendation model proposed in the embodiment of the present application is to first select a user and a product as the current user and the current product in the user set and the product set respectively; then input the training vector corresponding to the current user and the training vector corresponding to the current product into the product recommendation model to be trained respectively, and obtain the demand latent vector of the current user and the attribute latent vector of the current product through the product recommendation model to be trained; repeat the above operation of extracting the current user and the current product until the demand latent vector of each user and the attribute latent vector of each product are obtained; then train the product recommendation model to be trained in sequence based on the demand latent vector of each user and the attribute latent vector of each product and the pre-constructed optimization objective function; wherein the optimization objective function includes: implicit optimization objective function and explicit optimization objective function. In other words, the present application can train the product recommendation model based on the user set and the product set, efficiently model and analyze the real needs and preferences of users in implicit feedback, and solve the problem that the negative samples in the explicit feedback and implicit feedback are unclear and the partial order relationship of user preferences is difficult to establish. However, in the existing training method of the product recommendation model, it is not possible to apply the application scenarios of explicit feedback and implicit feedback at the same time, and the accuracy is low and the model training is difficult. Because the present application adopts the technical means of constructing implicit optimization objective functions and explicit optimization objective functions for the application scenarios of explicit feedback and implicit feedback respectively, and training the product recommendation model based on the user set and the product set, it overcomes the technical problems that the recommendation schemes of the prior art cannot be applied to the application scenarios of explicit feedback and implicit feedback at the same time, and have low accuracy and difficulty in model training. The technical solution provided by the present application can be applied to the application scenarios of explicit feedback and implicit feedback at the same time, and can effectively improve the recommendation accuracy and provide users with more accurate recommendation results; moreover, the technical solution of the embodiments of the present application is simple and convenient to implement, easy to popularize, and has a wider scope of application.
[0076] Embodiment 3
[0077] Figure 43 is a schematic diagram of the third process of the training method of the product recommendation model provided in the embodiment of the present application. Based on the above technical solution, it is further optimized and expanded, and can be combined with the above optional implementation methods. Figure 4 As shown, the training method of the product recommendation model may include the following steps:
[0078] S401. Select a user and a product from a user set and a product from a product set as a current user and a current product respectively; wherein the user set and the product set include N users and M products respectively; and both N and M are natural numbers greater than 1.
[0079] S402: Input the training vector corresponding to the current user into the user parsing network in the product recommendation model to be trained, and obtain the demand latent vector of the current user through the user parsing network.
[0080] S403. Input the training vector corresponding to the current product into the product parsing network in the product recommendation model to be trained, and obtain the attribute latent vector of the current product through the product parsing network; repeat the above operation of extracting the current user and the current product until the demand latent vector of each user and the attribute latent vector of each product are obtained.
[0081] S404, based on the demand latent vector of each user, the attribute latent vector of each product and the pre-built optimization objective function, the product recommendation model to be sequentially trained is trained; wherein the optimization objective function includes: an implicit optimization objective function and an explicit optimization objective function.
[0082] S405: Input the prediction vector corresponding to the target user and the prediction vector corresponding to each product into the trained product recommendation model, and output the predicted score of each product for the target user through the trained product recommendation model.
[0083] S406: Based on the predicted scores of the products for the target user, the top N products ranked by the predicted scores or products with predicted scores greater than a predetermined score are recommended to the target user.
[0084] In a specific embodiment of the present application, considering that the scoring process of each user can be approximately considered to be independent of each other and not affected by other users, the present application first assumes that the scoring results of each user are independent. Then for each user, it can be considered that his preference for positive samples is better than negative samples. Therefore, the present application compares each positive sample of the user with a part of a randomly selected set of negative samples, and considers that each positive sample is independently greater than the set of negative samples. Then the likelihood probability values of these comparisons can be maximized to solve the problem. Since the assumption of the present application solves the independence problem by relaxing the independence requirement, compared with the solution (2) in the prior art, the present application can achieve better results in practical applications.
[0085] Figure 5 Schematic diagram of the partial order modeling method under implicit feedback provided in the embodiment of the present application. Figure 5 As shown, the user set may include user 1, user 2, and user 3; the product set may include: product A, product B, product C, and product D; among them, user 1 has interaction records with product A and product C; user 1 has no interaction records with product B and product D; user 2 has interaction records with product B and product D; user 2 has no interaction records with product A and product C; user 3 has interaction records with product B; user 3 has no interaction records with product A, product C, and product D. Based on the original interaction records, the partial order relationship modeling can be expressed as: user 1: A>{B, D}; C>{B, D}. User 2: B>{A, C}; D>{A, C}. User 3: B>{A, C, D}.
[0086] Figure 6 Schematic diagram of the partial order modeling method under explicit feedback provided in the embodiment of the present application. Figure 6 As shown, the user set may include user 1, user 2, and user 3; the product set may include: product A, product B, product C, and product D; wherein user 1's ratings for product A, product B, product C, and product D are 3, 2, 4, and 3, respectively; user 1's ratings for product A, product B, and product C are 5, 4, and 1, respectively; and user 3's ratings for product B and product D are 5 and 4, respectively. Based on the original interaction record, the partial order relationship modeling can be expressed as: user 1: C>{A, B, D}; A>{B}; D>{B}. User 2: A>{B, C, D}; B>{C, D}. User 3: B>{A, C, D}; D>{A, C}.
[0087] The training method of the product recommendation model proposed in the embodiment of the present application is to first select a user and a product as the current user and the current product in the user set and the product set respectively; then input the training vector corresponding to the current user and the training vector corresponding to the current product into the product recommendation model to be trained respectively, and obtain the demand latent vector of the current user and the attribute latent vector of the current product through the product recommendation model to be trained; repeat the above operation of extracting the current user and the current product until the demand latent vector of each user and the attribute latent vector of each product are obtained; then train the product recommendation model to be trained in sequence based on the demand latent vector of each user and the attribute latent vector of each product and the pre-constructed optimization objective function; wherein the optimization objective function includes: implicit optimization objective function and explicit optimization objective function. In other words, the present application can train the product recommendation model based on the user set and the product set, efficiently model and analyze the real needs and preferences of users in implicit feedback, and solve the problem that the negative samples in the explicit feedback and implicit feedback are unclear and the partial order relationship of user preferences is difficult to establish. However, in the existing training method of the product recommendation model, it is not possible to apply the application scenarios of explicit feedback and implicit feedback at the same time, and the accuracy is low and the model training is difficult. Because the present application adopts the technical means of constructing implicit optimization objective functions and explicit optimization objective functions for the application scenarios of explicit feedback and implicit feedback respectively, and training the product recommendation model based on the user set and the product set, it overcomes the technical problems that the recommendation schemes of the prior art cannot be applied to the application scenarios of explicit feedback and implicit feedback at the same time, and have low accuracy and difficulty in model training. The technical solution provided by the present application can be applied to the application scenarios of explicit feedback and implicit feedback at the same time, and can effectively improve the recommendation accuracy and provide users with more accurate recommendation results; moreover, the technical solution of the embodiments of the present application is simple and convenient to implement, easy to popularize, and has a wider scope of application.
[0088] Embodiment 4
[0089] Figure 7 Schematic diagram of the structure of the training device of the product recommendation model provided in the embodiment of the present application. Figure 7 As shown, the device 700 includes: a selection module 701, a calculation module 702 and a training module 703; wherein,
[0090] The selection module 701 is used to select a user and a product from the user set and the product set as the current user and the current product respectively; wherein the user set and the product set include N users and M products respectively; N and M are both natural numbers greater than 1;
[0091] The calculation module 702 is used to input the training vector corresponding to the current user and the training vector corresponding to the current product into the product recommendation model to be trained, respectively, and obtain the demand latent vector of the current user and the attribute latent vector of the current product through the product recommendation model to be trained; repeatedly perform the above-mentioned operation of extracting the current user and the current product until the demand latent vector of each user and the attribute latent vector of each product are obtained;
[0092] The training module 703 is used to train the product recommendation model to be trained based on the demand latent vector of each user, the attribute latent vector of each product and the pre-constructed optimization objective function; wherein the optimization objective function includes: an implicit optimization objective function and an explicit optimization objective function.
[0093] Furthermore, the calculation module 702 is specifically used to input the training vector corresponding to the current user into the user analysis network in the product recommendation model to be trained, and obtain the demand latent vector of the current user through the user analysis network; input the training vector corresponding to the current product into the product analysis network in the product recommendation model to be trained, and obtain the attribute latent vector of the current product through the product analysis network.
[0094] Furthermore, the training module 703 is specifically used to train the product recommendation model to be sequentially trained based on the demand latent vector of each user, the attribute latent vector of each product and the implicit optimization objective function if the feedback data of each user for each product is implicit feedback data; and to train the product recommendation model to be sequentially trained based on the demand latent vector of each user, the attribute latent vector of each product and the explicit optimization objective function if the feedback data of each user for each product is explicit feedback data.
[0095] Furthermore, the training module 703 is specifically used to divide the product set into a product set with interaction records and a product set without interaction records for each user; calculate the product of each user's demand latent vector and the attribute latent vector of each product in the product set with interaction records, and the product of each user's demand latent vector and the attribute latent vector of each product in the product set without interaction records; based on the product of each user's demand latent vector and the attribute latent vector of each product in the product set with interaction records, and the product of each user's demand latent vector and the attribute latent vector of each product in the product set without interaction records, calculate the implicit optimization objective function values corresponding to the user set and the product set through the implicit optimization objective function; train the product recommendation model for sequential training based on the implicit optimization objective function values corresponding to the user set and the product set.
[0096] Furthermore, the training module 703 is specifically used to divide the product set into a product set with a score level equal to a predetermined level and a product set with a score level less than the predetermined level for each user; calculate the product of each user's demand latent vector and the attribute latent vector of each product in the product set with a score level equal to the predetermined level, and the product of each user's demand latent vector and the attribute latent vector of each product in the product set with a score level less than the predetermined level; based on the product of each user's demand latent vector and the attribute latent vector of each product in the product set with a score level equal to the predetermined level, and the product of each user's demand latent vector and the attribute latent vector of each product in the product set with a score level less than the predetermined level, calculate the explicit optimization objective function values corresponding to the user set and the product set through the explicit optimization objective function; and train the product recommendation model for sequential training based on the explicit optimization objective function values corresponding to the user set and the product set.
[0097] Furthermore, the device also includes: a construction module 704 (not shown in the figure), which is used to obtain the original interaction records of each user and each product; based on the interaction records of each user and each current product, determine the partial order relationship of each user for each product; wherein the partial order relationship includes: implicit partial order relationship and prior partial order relationship; store the partial order relationship of each user for each product in a pre-constructed matrix; based on the matrix, perform the operation of selecting a user and a product from the user set and the product set as the current user and the current product respectively.
[0098] Furthermore, the device also includes: a prediction module 705 (not shown in the figure), which is used to input the prediction vector corresponding to the target user into the trained product recommendation model, and output the predicted score of each product for the target user through the trained product recommendation model; based on the predicted score of each product for the target user, the top N products ranked by the predicted score or products with a predicted score greater than a predetermined score are recommended to the target user.
[0099] The training device for the product recommendation model can execute the method provided in any embodiment of the present application, and has the functional modules and beneficial effects corresponding to the execution method. For technical details not described in detail in this embodiment, please refer to the training method for the product recommendation model provided in any embodiment of the present application.
[0100] In the technical solution disclosed herein, the acquisition, storage and application of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0101] Embodiment 5
[0102] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
[0103] Figure 8 A schematic block diagram of an example electronic device 800 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0104] like Figure 8 As shown, the device 800 includes a computing unit 801, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 802 or a computer program loaded from a storage unit 808 into a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the device 800 can also be stored. The computing unit 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0105] A number of components in the device 800 are connected to the I / O interface 805, including: an input unit 806, such as a keyboard, a mouse, etc.; an output unit 807, such as various types of displays, speakers, etc.; a storage unit 808, such as a disk, an optical disk, etc.; and a communication unit 809, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 809 allows the device 800 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0106] The computing unit 801 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 801 performs the various methods and processes described above, such as the training method of the product recommendation model. For example, in some embodiments, the training method of the product recommendation model may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 808. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 800 via the ROM 802 and / or the communication unit 809. When the computer program is loaded into the RAM 803 and executed by the computing unit 801, one or more steps of the training method of the product recommendation model described above may be performed. Alternatively, in other embodiments, the computing unit 801 may be configured to perform the training method of the product recommendation model in any other appropriate manner (e.g., by means of firmware).
[0107] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0108] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0109] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0110] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0111] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0112] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.
[0113] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0114] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A method for training a product recommendation model, the method comprising: Selecting a user and a product from the user set and the product set as the current user and the current product respectively; wherein the user set and the product set include N users and M products respectively; N and M are both natural numbers greater than 1; The training vector corresponding to the current user and the training vector corresponding to the current product are respectively input into the product recommendation model to be trained, and the demand latent vector of the current user and the attribute latent vector of the current product are obtained through the product recommendation model to be trained; the above operation of extracting the current user and the current product is repeatedly performed until the demand latent vector of each user and the attribute latent vector of each product are obtained; Based on the latent vectors of the needs of each user and the latent vectors of the attributes of each product and the pre-built optimization objective function, the product recommendation model to be sequentially trained is trained; wherein the optimization objective function includes: an implicit optimization objective function and an explicit optimization objective function; The product recommendation model to be trained is trained based on the latent vector of each user's needs, the latent vector of each product's attributes, and a pre-built optimization objective function, including: If the feedback data of each user for each product is implicit feedback data, the product of each user's demand latent vector and each product's attribute latent vector is calculated, and the product recommendation model to be trained is trained based on the product of each user's demand latent vector and each product's attribute latent vector and the implicit optimization objective function; If the feedback data of each user for each product is explicit feedback data, then the product of each user's demand latent vector and each product's attribute latent vector is calculated, and the product recommendation model to be trained is trained based on the product of each user's demand latent vector and each product's attribute latent vector and the explicit optimization objective function.
2. The method according to claim 1, wherein: The step of inputting the training vector corresponding to the current user and the training vector corresponding to the current product into the product recommendation model to be trained respectively, and obtaining the demand latent vector of the current user and the attribute latent vector of the current product through the product recommendation model to be trained, comprises: Inputting the training vector corresponding to the current user into the user parsing network in the product recommendation model to be trained, and obtaining the demand latent vector of the current user through the user parsing network; The training vector corresponding to the current product is input into the product parsing network in the product recommendation model to be trained, and the attribute latent vector of the current product is obtained through the product parsing network.
3. The method according to claim 1, wherein: If the feedback data of each user for each product is implicit feedback data, the product of each user's demand latent vector and each product's attribute latent vector is calculated, and based on the product of each user's demand latent vector and each product's attribute latent vector and the implicit optimization objective function, the product recommendation model to be trained is trained, including: For each user, dividing the product set into a product set with interaction records and a product set without interaction records; Calculate the product of each user's demand latent vector and the attribute latent vector of each product in the product set with interaction records, and the product of each user's demand latent vector and the attribute latent vector of each product in the product set without interaction records; Based on the product of the demand latent vector of each user and the attribute latent vector of each product in the product set with interaction records, and the product of the demand latent vector of each user and the attribute latent vector of each product in the product set without interaction records, the implicit optimization objective function values corresponding to the user set and the product set are calculated through the implicit optimization objective function; The product recommendation model to be sequentially trained is trained based on the implicit optimization objective function values corresponding to the user set and the product set.
4. The method according to claim 1, wherein: If the feedback data of each user for each product is explicit feedback data, the product of each user's demand latent vector and each product's attribute latent vector is calculated, and based on the product of each user's demand latent vector and each product's attribute latent vector and the explicit optimization objective function, the product recommendation model to be trained is trained, including: For each user, the product set is divided into a product set with a score level equal to a predetermined level and a product set with a score level less than the predetermined level; Calculate the product of each user's demand latent vector and the attribute latent vector of each product in the product set whose score level is equal to the predetermined level, and the product of each user's demand latent vector and the attribute latent vector of each product in the product set whose score level is less than the predetermined level; Based on the product of the demand latent vector of each user and the attribute latent vector of each product in the product set whose score level is equal to the predetermined level, and the product of the demand latent vector of each user and the attribute latent vector of each product in the product set whose score level is less than the predetermined level, the explicit optimization objective function values corresponding to the user set and the product set are calculated by the explicit optimization objective function; The product recommendation model to be sequentially trained is trained based on the explicit optimization objective function values corresponding to the user set and the product set.
5. The method according to claim 1, before selecting a user and a product from the user set and the product set as the current user and the current product respectively, the method further comprises: Obtain the original interaction records between each user and each product; Based on the interaction records of each user with each current product, determine the partial order relationship of each user with respect to each product; wherein the partial order relationship includes: implicit partial order relationship and prior partial order relationship; The partial order relationship between each user and each product is stored in a pre-constructed matrix; and based on the matrix, the operation of selecting a user and a product from the user set and the product set as the current user and the current product respectively is performed.
6. The method according to claim 1, after training the product recommendation model to be sequentially trained based on the demand latent vectors of each user and the attribute latent vectors of each product and the pre-built optimization objective function, the method further comprises: Inputting the prediction vector corresponding to the target user and the prediction vector corresponding to each product into the trained product recommendation model, and outputting the predicted score of each product for the target user through the trained product recommendation model; Based on the predicted scores of the products for the target user, the top N products ranked by predicted scores or products with predicted scores greater than a predetermined score are recommended to the target user.
7. A training device for a product recommendation model, the device comprising: Selection module, calculation module and training module; among them, The selection module is used to select a user and a product from the user set and the product set as the current user and the current product respectively; wherein the user set and the product set include N users and M products respectively; N and M are both natural numbers greater than 1; The calculation module is used to input the training vector corresponding to the current user and the training vector corresponding to the current product into the product recommendation model to be trained, respectively, and obtain the demand latent vector of the current user and the attribute latent vector of the current product through the product recommendation model to be trained; repeatedly perform the above-mentioned operation of extracting the current user and the current product until the demand latent vector of each user and the attribute latent vector of each product are obtained; The training module is used to train the product recommendation model to be trained based on the demand latent vector of each user, the attribute latent vector of each product and the pre-constructed optimization objective function; wherein the optimization objective function includes: an implicit optimization objective function and an explicit optimization objective function; wherein the training module is specifically used to calculate the product of the demand latent vector of each user and the attribute latent vector of each product if the feedback data of each user for each product is implicit feedback data, and train the product recommendation model to be trained based on the product of the demand latent vector of each user and the attribute latent vector of each product and the implicit optimization objective function; if the feedback data of each user for each product is explicit feedback data, calculate the product of the demand latent vector of each user and the attribute latent vector of each product, and train the product recommendation model to be trained based on the product of the demand latent vector of each user and the attribute latent vector of each product and the explicit optimization objective function.
8. According to the device of claim 7, the computing module is specifically used to input the training vector corresponding to the current user into the user parsing network in the product recommendation model to be trained, and obtain the latent vector of the current user's needs through the user parsing network; input the training vector corresponding to the current product into the product parsing network in the product recommendation model to be trained, and obtain the latent vector of the attributes of the current product through the product parsing network.
9. According to the device of claim 8, the training module is specifically used to divide the product set into a product set with interaction records and a product set without interaction records for each user; calculate the product of each user's demand latent vector and the attribute latent vector of each product in the product set with interaction records, and the product of each user's demand latent vector and the attribute latent vector of each product in the product set without interaction records; based on the product of each user's demand latent vector and the attribute latent vector of each product in the product set with interaction records, and the product of each user's demand latent vector and the attribute latent vector of each product in the product set without interaction records, calculate the implicit optimization objective function values corresponding to the user set and the product set through the implicit optimization objective function; train the product recommendation model for sequential training based on the implicit optimization objective function values corresponding to the user set and the product set.
10. According to the device of claim 8, the training module is specifically used to divide the product set into a product set with a score level equal to a predetermined level and a product set with a score level less than the predetermined level for each user; calculate the product of each user's demand latent vector and the attribute latent vector of each product in the product set with a score level equal to the predetermined level, and the product of each user's demand latent vector and the attribute latent vector of each product in the product set with a score level less than the predetermined level; based on the product of each user's demand latent vector and the attribute latent vector of each product in the product set with a score level equal to the predetermined level, and the product of each user's demand latent vector and the attribute latent vector of each product in the product set with a score level less than the predetermined level, calculate the explicit optimization objective function values corresponding to the user set and the product set through the explicit optimization objective function; train the product recommendation model for sequential training based on the explicit optimization objective function values corresponding to the user set and the product set.
11. The device according to claim 7, further comprising: Build a module to obtain the original interaction records between each user and each product; Based on the interaction records of each user with each current product, determine the partial order relationship of each user for each product; wherein the partial order relationship includes: implicit partial order relationship and prior partial order relationship; store the partial order relationship of each user for each product in a pre-constructed matrix; based on the matrix, perform the operation of selecting a user and a product from the user set and the product set as the current user and the current product respectively.
12. The device according to claim 7, further comprising: The prediction module is used to input the prediction vector corresponding to the target user and the prediction vector corresponding to each product into the trained product recommendation model, and output the predicted score of each product for the target user through the trained product recommendation model; based on the predicted score of each product for the target user, the top N products ranked by the predicted score or the products with a predicted score greater than a predetermined score are recommended to the target user.
13. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 6.
14. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-6.
15. A computer program product, comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Recommendation result generation method and device
CN108090093A
Recommendation method for interested commodities of user
CN109934681A
KR20200142871A
