A training method of a recommendation model, a recommendation model, and a commodity recommendation method
By introducing multiple interest representation vectors for users and designing an Euclidean distance regularization method, the problem of unmet user interest diversity in existing recommendation systems is solved, achieving more accurate and diversified product recommendations.
Patent Information
- Application Number
- CN202310055941.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2022-12-06
- Filing Date
- 2023-01-18
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2043-01-18
AI Technical Summary
Existing recommendation systems tend to satisfy users' primary interests while ignoring their potential interests when recommending products, resulting in poor recommendation model performance and failing to effectively handle the diversity of user interests and the strength of relationships between interests.
By introducing multiple interest representation vectors to users, a complex preference relationship between users and products is established. The model is trained using preference scoring functions and Euclidean distance regularization methods. Keywords: technology application phrases; technology field: mapping rules and Euclidean distance methods for recommender systems; technology application phrases; technology application phrases; technology application phrases; technology application phrases; technology application phrases; technology application phrases; technology application phrases; technology application: training methods for recommender models, recommender models, and product recommendation methods.
It improves the accuracy and diversity of recommendations in the recommendation system, enabling it to recommend products that better match users' diverse interests.
Smart Images

Figure CN116308618B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the recommendation technical field, in particular to the recall technical field in the recommendation technical field, more particularly to a recommendation model training method, a recommendation model and a commodity recommendation method. BACKGROUND
[0002] With the rapid development of the Internet, network information has been seriously overloaded, and in the vast amount of network information, the recommendation system (RS) for recommending things that users may be interested in has become an important module in the Internet platform such as e-commerce and social media. It speculates the user's interest preference from the user's historical browsing record, and provides the user with related recommendation information that the user may be interested in to help the user quickly find the product to be purchased or the content to be browsed. However, in actual application, the record of the user's interest preference usually exists as implicit feedback, and such implicit feedback record only contains the user's indirect interest preference (such as clicking, collecting, forwarding, etc.), and cannot directly reflect the user's main interest preference, thereby posing a great challenge to the recommendation method of the recommendation system, and thus triggering a series of related researches.
[0003] In the past few decades, researchers have conducted a large number of researches on the recommendation system and related recommendation methods, but most of the algorithms about the recommendation system follow the One-Class Collaborative Filtering (OCCF) paradigm, which usually assumes that the user is not interested in the unobserved sample and marks it as a negative sample for learning. However, there may be samples that the user is interested in among the unobserved samples, so the algorithm based on this assumption will reduce the performance of the recommendation system. Moreover, in the early research on the recommendation system, most of the research on the recommendation system focused on the algorithm based on matrix factorization (MF), for example, documents [1] and [2] proposed an algorithm based on matrix factorization, which realizes the recommendation of user preferences through the inner product between the embedding of the specific user and the embedding of the item. Although this method was generally recognized at that time and improved the recommendation effect of the recommendation system to a certain extent, it was found in the later research on the recommendation system (for example, the research mentioned in document [3]) that the inner product metric used in the algorithm based on matrix factorization violates the triangle inequality and may lead to a suboptimal topological embedding space, thereby reducing the performance of the recommendation system. In order to solve this problem, document [3] proposes to introduce metric learning into the recommendation system, proposes a Collaborative Metric Learning (CML) framework, and achieves good recommendation effect.
[0004] Therefore, in the latest research of recommendation system, more and more methods based on collaborative metric learning represented by literature [4] and literature [5] are proposed, which aims to realize more accurate recommendation prediction of recommendation system. However, these methods do not consider the diversity of user interest and the strong and weak relationship between each interest of the user (for example, a user's favorite movie is a comedy movie, followed by a science fiction movie, and finally a horror movie) in the actual application process, which leads to the fact that the number of goods corresponding to each interest of the user collected by most existing research technologies based on collaborative metric learning is extremely unbalanced (the number of goods corresponding to the main interest of the user is much larger than the number of goods corresponding to the secondary interest of the user). In this case, the recommendation model constructed by most existing research technologies based on collaborative metric learning by using the preference data of the user will appear recommendation deviation, that is, this recommendation model tends to meet the main interest of the user when recommending the goods that the user may be interested in, and ignores the potential interest of the user, so that the constructed recommendation model is not good.
[0005] LIST OF REFERENCES
[0006] [1] Zhang, Q. and Ren, F. Prior-based bayesian pairwise ranking for one-class collaborative filtering. Neurocomputing, 440:365-374, 2021.
[0007] [2] Chen, J., Lian, D., and Zheng, K. Improving one-class collaborative filtering via ranking-based implicit regularizer. In AAAI, pp. 37-44, 2019.
[0008] [3] Hsieh, C.-K., Yang, L., Cui, Y., Lin, T.-Y., Belongie, S., and Estrin, D. Collaborative metric learning. In WWW, pp. 193-201, 2017.
[0009] [4] Tran, V., Salha-Galvan, G., Hennequin, R., and Moussallam, M. Hierarchical latent relation modeling for collaborative metric learning. In RecSys, pp. 302-309, 2021.
[0010] [5] Tran, V.-A., Hennequin, R., Royo-Letelier, J., and Moussallam, M. Improving collaborative metric learning with efficient negative sampling. In SIGIR, pp. 1201-1204, 2019. SUMMARY
[0011] Therefore, the purpose of the present application is to overcome the defects of the prior art described above, and to provide a recommendation model training method, a recommendation model and a commodity recommendation method.
[0012] The purpose of the present application is achieved by the following technical solutions:
[0013] According to a first aspect of the present application, a recommendation model training method is provided, the method comprising the following steps: S1, obtaining a training set, the training set comprising a plurality of commodity interaction history records of a plurality of users; S2, training the recommendation model using the commodity interaction history records obtained in step S1 for multiple rounds until convergence, and performing the following steps in each round of training: S21, obtaining a plurality of interest representation vectors corresponding to each user based on the commodity interaction history records of the user, and obtaining an attribute representation vector corresponding to each commodity based on the attributes of each commodity involved in the training set; S22, mapping all interest representation vectors of all users and attribute representation vectors of all commodities to a metric space based on a predetermined mapping rule, to obtain all interest mapping vectors corresponding to each user and attribute mapping vectors corresponding to each commodity; S23, sequentially calculating the distance between the attribute mapping vector of each commodity and all interest mapping vectors of each user based on a predetermined calculation rule, and determining the minimum distance between the attribute mapping vector of each commodity and all interest mapping vectors of each user; S24, calculating a preference loss based on the minimum distance between the attribute mapping vector of each commodity and all interest mapping vectors of each user obtained in step S23; S25, updating the parameters of the recommendation model based on the loss obtained in step S24.
[0014] In some embodiments of the present application, the preset mapping rule includes an interest representation vector mapping rule and an attribute representation vector mapping rule, wherein the interest representation vector mapping rule is:
[0015]
[0016] wherein U represents a set containing all users, u i represents an i-th user in U, {1, 2, …, C} represents a set containing C interest representation vectors, c represents a c-th interest representation vector in {1, 2, …, C}, represents an interest mapping vector of a c-th interest representation vector in the set of interest representation vectors of the user u i in the metric space, and R d represents a real number field of d dimensions, d represents an embedding dimension of each interest representation vector, P c T represents a learnable transformation weight parameter corresponding to a c-th interest representation vector in the set of interest representation vectors, and P c T ∈R M×d , R M×d represents a real number field of Mxd dimensions, represents one-hot encoding of the user u i , and R M represents a real number field of M dimensions;
[0017] The attribute representation vector mapping rule is:
[0018]
[0019] wherein I represents a set containing all goods, v j represents a j-th good in I, represents one-hot encoding of an attribute representation vector corresponding to v j , and R N represents a real number field of N dimensions, Q T represents a learnable transformation weight parameter, and Q T ∈R N×d , R N×d represents a real number field of Nx d dimensions, represents an attribute mapping vector of an attribute representation vector corresponding to the good v j in the metric space.
[0020] In some embodiments of the present application, the preset calculation rule is:
[0021]
[0022] wherein I denotes a set containing all items, U denotes a set containing all users, u i denotes the i-th user in U, v j denotes the j-th item in I, denotes the c-th interest representation vector in the set of interest representation vectors of the user u i , and denotes the attribute mapping vector of the corresponding attribute representation vector of the item v j in the metric space, {1, 2, …, C} denotes a set containing C interest representation vectors, c denotes the c-th interest representation vector in {1, 2, …, C}, s(u i , v j ) denotes the minimum distance between the attribute mapping vector of the corresponding attribute representation vector of the item v j and all interest mapping vectors of the user u i .
[0023] In some embodiments of the present application, in the step S23, further comprising: calculating the average distance between all interest mapping vectors of each user based on all interest mapping vectors of each user, respectively; in the step S24, further comprising: calculating the regularization loss based on the average distance between all interest mapping vectors of each user; in the step S25, updating the parameters of the recommendation model based on the preference loss and the regularization loss obtained in the step S24.
[0024] In some embodiments of the present application, in the step S23, the average distance between all interest mapping vectors of each user is calculated in the following manner:
[0025]
[0026] wherein {1, 2, …, C} denotes a set containing C interest representation vectors, c1 and c2 respectively denote the c1-th and c2-th interest representation vectors in {1, 2, …, C}, u i denotes the i-th user, denotes the c1-th interest representation vector in the set of interest representation vectors of the user u i , and denotes the c2-th interest representation vector in the set of interest representation vectors of the user u i , and denotes the average distance between all interest mapping vectors of the user u i .
[0027] In some embodiments of the present application, in the step S24, the preference loss is calculated in the following manner:
[0028]
[0029] wherein U represents a set containing all users, u i represents the i-th user in U, v j + represents the j-th item among all items that have interacted with the user u i represents the k-th item among all items that have not interacted with the user, s(u i ,v j + represents the attribute mapping vector of the item v j + corresponding to the user u i corresponding to all interest mapping vectors, and λ represents a preset parameter, represents the attribute mapping vector of the item corresponding to the user u i corresponding to all interest mapping vectors, and λ represents a preset parameter, represents the number of all items that have interacted with the user u i represents the number of all items that have not interacted with the user u i , and M represents the number of all users, and g represents a metric space.
[0030] In some embodiments of the present application, in the step S24, the regularization loss is further calculated in the following manner:
[0031]
[0032] wherein U represents a set containing all users, u i represents the i-th user in U, δ1 and δ2 respectively represent preset threshold parameters, represents the average distance between all interest mapping vectors of the user u i , and M represents the number of all users.
[0033] According to a second aspect of the present application, a recommendation model trained based on the method of the first aspect of the present application is provided for recommending a user with a product of interest according to a plurality of product interaction history records of the user, the model comprising: a representation processing module configured to obtain a plurality of interest representation vectors corresponding to the user according to a plurality of product interaction history records of the user, and obtain an attribute representation vector corresponding to each product not interacted with the user according to attributes of different products not interacted with the user; a vector mapping module configured to map all interest representation vectors of the user and all attribute representation vectors of the products not interacted with the user corresponding to the user to a metric space based on a preset mapping rule, to obtain all interest mapping vectors of the user and attribute mapping vectors corresponding to each product not interacted with the user; a similarity distance calculation module configured to calculate distances between each interest mapping vector of the user and attribute mapping vectors of the products not interacted with the user according to a preset calculation rule, and determine a minimum distance between the attribute mapping vectors of the products not interacted with the user and all interest mapping vectors of the user; and a product recommendation module configured to sort all products not interacted with the user according to the minimum distances between the attribute mapping vectors of the products not interacted with the user and all interest mapping vectors of the user from small to large to obtain a product recommendation list of the user.
[0034] In some embodiments of the present application, the representation processing module is an affine transformation network, a multi-layer perception network or a fully connected neural network.
[0035] According to a third aspect of the present application, a product recommendation method is provided, the method comprising the following steps: T1, obtaining product interaction history records of a user; T2, based on the product interaction history records of the user obtained in step T1, using the model according to the second aspect of the present application to recommend products of interest to the user.
[0036] Compared with the prior art, the present application has the following advantages:
[0037] 1. In the training process, the present application introduces a plurality of interest representation vectors representing different interest hobbies of the user, so that the recommendation model can pay attention to all potential products meeting the interests of the user, establish a complex preference relationship between the interests of the user and the products, and promote the diversity of the recommendation results of the recommendation system.
[0038] 2. In the training process, the present application constructs a product preference score function matching the interest hobbies of the user, so that the recommendation model can accurately measure the similarity between the interests of the user and the products, and improve the recommendation accuracy of the recommendation system.
[0039] 3. The regularization method for limiting the Euclidean distance of the multiple interest representation vectors of the user in the metric space is designed in the training process, so as to ensure that the multiple interest representation vectors of the user can represent different interests of the user, improve the generalization of the recommendation model, and further promote the diversity of the recommendation result of the recommendation system. BRIEF DESCRIPTION OF DRAWINGS
[0040] The embodiments of the present application will be further described below with reference to the drawings, in which:
[0041] Figure 1 The flow chart of the training method of the recommendation model according to the embodiment of the present application is shown in the figure.
[0042] Figure 2 The framework structure of the recommendation model according to the embodiment of the present application is shown in the figure. DETAILED DESCRIPTION
[0043] In order to make the purpose, technical scheme and advantages of the present application clearer, the present application will be further described in detail below through specific embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application, and are not used to limit the present application.
[0044] As mentioned in the background, the prior art method based on collaborative metric learning tends to meet the main interests of the user and ignores the potential interests of the user when recommending the user the goods that the user may be interested in, so that the constructed recommendation model is not good. The inventors found through research that most of the prior art rarely considers the case that the user's interests are diverse (especially the case that the number of goods corresponding to different interests of the user is extremely unbalanced), and the main reason for this problem is that most of the prior art mainly represents the multiple interests of the user through a single user interest representation, which can easily cause the potential interests of the user to be ignored by the recommendation system, and thus the recommendation system cannot accurately recommend the goods that can meet the potential interests of the user to the user. In other words, only through a single user interest representation, the diverse interest preferences of the user cannot be met, and it is difficult to establish a complex preference relationship between the user interests (the user interests refer to the user's preferences for goods) and the goods, which leads to the recommendation bias of the constructed recommendation model, affecting the recommendation effect of the recommendation system. In view of these defects in the prior art, the present application provides a training scheme of a recommendation model based on collaborative metric learning, which trains the model by introducing multiple interest representation vectors representing different interest preferences of the user, and constructs a good preference score function matching the different interest preferences of the user in the training process and designs a regularization method limiting the Euclidean distance of the multiple interest representation vectors of the user in the metric space, overcoming the difficulty of establishing a complex preference relationship between the user interests and the goods in the prior art, thereby improving the recommendation accuracy of the recommendation system and promoting the diversity of the recommendation results of the recommendation system. In order to better understand the present application, the present application will be described in detail below from the aspects of training data set, model training process, system and application in combination with the drawings and embodiments.
[0045] I. Training data set
[0046] In order to solve the problem that a single user interest representation in the prior art cannot meet the diverse interest preferences of the user and it is difficult to establish a complex preference relationship between the user interests and the goods, the present application introduces multiple interest representation vectors to represent the diverse interest preferences of the user (including main interests and secondary interests), and trains the recommendation model by introducing corresponding attribute representation vectors for each good, wherein a preference score function is designed to calculate the similarity of different goods in different interest preferences of the user, thereby establishing a complex preference relationship between the user and the goods. The trained recommendation model can not only pay attention to the main interests of the user, but also pay attention to the secondary interests of the user, so as to more accurately recommend the goods that the user is interested in under the consideration of the diverse interest preferences of the user.
[0047] According to one embodiment of the present application, the training data set adopted by the present application includes four commonly used benchmark data sets in the field of recommendation system, which are two movie data sets MovieLens-1M and MovieLens-10M, one article data set CiteULike, and one game data set Steam-200k, and each data set contains historical interaction records between users and multiple commodities in the field thereof. It should be noted that the training data set adopted in the present application can be selected according to the actual scene, as long as the training data set can provide sufficient historical interaction records between users and multiple commodities, and the number of samples corresponding to the main interest and the secondary interest of the user is relatively balanced, and the present application is not limited specifically.
[0048] II. Model training process
[0049] As mentioned in the first section, the data set adopted by the present application is completely different from the data set in the prior art, and the present application fully considers the main interest and the secondary interest of the user and trains the model based on the collaborative measurement method, so that the model can not only pay attention to the main interest of the user, but also pay attention to the secondary interest of the user, thereby realizing more accurate commodity recommendation. The present application adopts the training set containing the historical records of the main interest and the secondary interest of the user to train the recommendation model for multiple rounds until convergence, wherein, as shown in Figure 1 A1, obtaining a plurality of interest representation vectors corresponding to each user based on the commodity interaction history records of the user, and obtaining an attribute representation vector corresponding to each commodity based on the attributes of each commodity involved in the training set; A2, mapping all interest representation vectors of all users and all attribute representation vectors of all commodities to a measurement space based on a preset mapping rule, to obtain all interest mapping vectors corresponding to each user and attribute mapping vectors corresponding to each commodity; A3, calculating the distance between the attribute mapping vector of each commodity and all interest mapping vectors of each user based on a preset calculation rule, and determining the minimum distance between the attribute mapping vector of each commodity and all interest mapping vectors of each user; A4, calculating the preference loss based on the minimum distance between the attribute mapping vector of each commodity and all interest mapping vectors of each user obtained in step A3; A5, updating the parameters of the recommendation model based on the loss obtained in step A4.
[0050] According to one embodiment of the present application, still referring to Figure 1In the training process, the application further comprises: A3', based on all interest mapping vectors of each user, respectively calculating the average distance between all interest mapping vectors of each user; A4', based on the average distance between all interest mapping vectors of each user, calculating a regularization loss; in step A5, updating the parameters of the recommendation model based on the preference loss and the regularization loss obtained in steps A4 and A4'. It should be noted that in the application, the distance between the attribute mapping vector of the commodity and the interest mapping vector of the user is calculated to cooperatively measure the similarity between the user interest and the commodity (i.e. measure the preference degree of the user to the commodity). The smaller the distance between the attribute mapping vector of the commodity and the interest mapping vector of the user, the higher the similarity between the user interest and the commodity, and the higher the similarity indicates that the user likes the commodity more. Since the interest mapping vector of the user has multiple, both the main interest of the user and the secondary interest of the user are contained, by calculating the distance between the attribute mapping vector of the commodity and all interest mapping vectors of the user and selecting the minimum distance, it can be judged which interest the commodity corresponds to, so that different interests of the user can be fully considered.
[0051] In order to better understand the application, each step in the training process is described in detail below through the drawings and specific embodiments.
[0052] In step A1, the application uses an affine transformation network to obtain a plurality of interest representation vectors corresponding to each user based on the commodity interaction history record of the user, and obtains an attribute representation vector corresponding to each commodity based on the attributes of each commodity involved in the training set. It should be noted that the application is not limited to obtaining the representation vectors of user interest and commodity through the affine transformation network, but other neural network structures can also be used to achieve the same function, such as multilayer perceptron network, fully connected neural network, etc. Since the representation vectors are obtained based on the affine transformation network or other neural networks (such as multilayer perceptron network, fully connected neural network, etc.), it is known to those skilled in the art, and therefore will not be described in detail here.
[0053] In step A2, the preset mapping rule used by the application includes an interest representation vector mapping rule and an attribute representation vector mapping rule. According to an embodiment of the application, the interest representation vector mapping rule is to map all interest representation vectors of all users to a metric space in the following way:
[0054]
[0055] Wherein, U represents a set containing all users, u i represents the i-th user in U, {1,2…,C} represents a set containing C interest representation vectors, c represents the c-th interest representation vector in {1,2…,C}, Represents user u i The interest mapping vector of the cth interest representation vector in the metric space in the interest representation vector set, and R d represents the d-dimensional real number field, d represents the embedding dimension of each interest representation vector, P c T represents the learnable transformation weight parameter corresponding to the cth interest representation vector in the interest representation vector set, and P c T ∈R M×d , R M×d represents the real number field of M×d dimensions, Represents user u i One-hot encoding, and R M represents the M-dimensional field of real numbers.
[0056] According to one embodiment of the present invention, the attribute representation vector mapping rule is to map the attribute representation vectors of all commodities to the metric space in the following search transformation manner:
[0057]
[0058] Among them, I represents the set of all commodities, v j represents the jth item in I, Indicates v j The corresponding attribute representation vector is one-hot encoded, and R N represents the N-dimensional real number field, Q T represents the learnable transformation weight parameter, and Q T ∈R N×d , R N×d represents the N×d-dimensional real number field, Indicates product v j The attribute mapping vector of the corresponding attribute representation vector in the metric space.
[0059] Through the above-mentioned preset mapping rules (interest representation vector mapping rules and attribute representation vector mapping rules), all interest representation vectors of all users and attribute representation vectors of all products can be mapped to the same metric space, so as to calculate the similarity between user interests and products in the metric space, thereby measuring the degree of preference of users for products with different interests. In this way, products with different interests of users can be met, that is, the diverse interests and hobbies of users are fully taken into account.
[0060] In step A3, the preset calculation rule used by the present application refers to calculating the distance between the attribute mapping vector of each commodity and all the interest mapping vectors of each user by using the commodity preference score function and determining the minimum distance between the attribute mapping vector of each commodity and all the interest mapping vectors of each user:
[0061]
[0062] wherein I represents a set containing all commodities, U represents a set containing all users, u i represents the i-th user in U, v j represents the j-th commodity in I, represents the c-th interest mapping vector in the interest representation vector set of the user u i , represents the attribute mapping vector of the corresponding attribute representation vector of the commodity v j in the metric space, {1, 2, …, C} represents a set containing C interest representation vectors, c represents the c-th interest representation vector in {1, 2, …, C}, and s(u i , v j ) represents the minimum distance between the attribute mapping vector of the corresponding attribute representation vector of the commodity v j and all the interest mapping vectors of the user u i . It should be noted that the distance between the attribute mapping vector of the commodity and all the interest mapping vectors of the user is calculated in order to measure the similarity between the commodity and the user's interest, wherein the minimum distance between the attribute mapping vector of the commodity and all the interest mapping vectors of the user represents the highest similarity between the commodity and the interest of the user (the interest is the interest corresponding to the interest mapping vector with the smallest distance from the attribute mapping vector of the commodity), that is, the commodity is the commodity most suitable for the interest of the user. Conversely, the lower the similarity between the commodity and the user's interest.
[0063] After obtaining the similarity between the user's interest and the commodity, for the commodity that the user is interested in, the similarity between the commodity and the user should be as high as possible, that is, the distance between the attribute mapping vector of the commodity and the interest mapping vector of the user should be as small as possible; and for the commodity that the user is not interested in or has not interacted with, the similarity between the commodity and the user should be as small as possible, that is, the distance between the attribute mapping vector of the commodity and the interest mapping vector of the user should be as large as possible. In order to realize the distance constraint relationship, according to an embodiment of the present application, the present application constrains the above relationship in the Euclidean metric space as follows:
[0064]
[0065] where U denotes a set containing all users, u i denotes the i-th user in U, denotes the set of all items interacted by user u i , denotes the set of all items not interacted by user u i , j + denotes the j-th item in the set of all items interacted by user u i , denotes the k-th item in the set of all items not interacted by user u i , denotes the set of all interest mapping vectors corresponding to the attributes of item v i , j + denotes the minimum distance between the attribute mapping vector of item v j + and the corresponding all interest mapping vectors of user u i , denotes the attribute mapping vector of item v , i
[0066] In step A4, the present application calculates the preference loss in the following manner:
[0067]
[0068] where U denotes a set containing all users, u i denotes the i-th user in U, denotes the j-th item in the set of all items interacted by user u i , denotes the k-th item in the set of all items not interacted by user u i , j + denotes the attribute mapping vector of item v , i denotes the minimum distance between the attribute mapping vector of item v , i and the corresponding all interest mapping vectors of user u i , denotes the number of all items interacted by user u i , denotes the number of all items not interacted by user u i M represents the number of all users, and g represents a metric space.
[0069] It should be noted that the present application updates the parameters of the recommendation model by the preference loss, so as to pull the distance between the user and the goods of interest to the user, and push the goods of no interest or no interaction away from the user, thereby improving the recommendation effect of the recommendation model for recommending the goods of interest to the user. In addition, the present application provides multiple interest representation vectors for each user to represent different interests of the user, so that the recommendation model can pay attention to the goods corresponding to different interests by using the different interest representation vectors of the user, so that even the secondary interest with a small amount of data can also obtain a good recommendation effect by the recommendation model trained by the present application.
[0070] In step A3', the average distance between all interest mapping vectors of each user is calculated based on all interest mapping vectors of each user. Since in actual application, the different interest representation vectors of the user may not necessarily be completely different, which means that there may be a high similarity between the different interest representation vectors of the user, in order to better represent the interest diversity of the user, the present application introduces the average distance between the different interest representation vectors of the user to represent the diversity of the interest of the user on the basis of the above embodiment. According to an embodiment of the present application, the average distance between all interest mapping vectors of each user is calculated in the following manner:
[0071]
[0072] Wherein, {1,2…,C} represents a set containing C interest representation vectors, c1 and c2 represent the c1th and c2th interest representation vectors in {1,2…,C} respectively, u i represents the i-th user, represents the c1th interest representation vector in the interest representation vector set of the user u i represents the c2th interest representation vector in the interest representation vector set of the user u i represents the average distance between all interest mapping vectors of the user u i
[0073] In step A4', the regularization loss is calculated based on the average distance between all interest mapping vectors of each user. Since the average distance between all interest mapping vectors of a user is used to measure the diversity of the user's interests, if it is too large or too small, the generalization of the recommendation model will be reduced. Specifically, if it is too small, it will cause the multiple interest representation vectors representing the user's different interest preferences to degenerate into a single interest representation vector, thereby reducing the recommendation performance. If it is too large, when there are some observation noise or extremely rare interests far away from the user's normal interests in the training data, the trained recommendation model will be more likely to overfit such data, thereby reducing the recommendation performance. Therefore, in order to better limit the average distance between all interest mapping vectors of a user within a reasonable range, the present application proposes to use the regularization loss to optimize this problem. According to an embodiment of the present application, the regularization loss is calculated as follows:
[0074]
[0075] wherein U represents a set containing all users, u i represents the i-th user in U, δ1 and δ2 respectively represent preset threshold parameters, represents the average distance between all interest mapping vectors of the user u i , and M represents the number of all users. According to an embodiment of the present application, the present application sets δ1 to 0.05 and sets δ2 to 0.35. Such a setting can make the recommendation model have good generalization. It should be noted that the values of δ1 and δ2 in the present application can be set according to the actual scene, and the present application does not make specific limitations on them.
[0076] In step A5, the present application updates the parameters of the recommendation model based on the preference loss and the regularization loss obtained in steps A4 and A4'.
[0077] III. System and application
[0078] As can be seen from the foregoing description, the recommendation model trained by the method in the present application can recommend all goods that the user may be interested in to the user. According to an embodiment of the present application, as shown in FIG. 2, the recommendation model trained by the method in the present application can recommend all goods that the user may be interested in to the user. Figure 2As shown, the recommendation model trained by the method in the application comprises: a representation processing module, configured to acquire a plurality of interest representation vectors corresponding to a user according to a plurality of historical records of commodity interaction of the user, and acquire an attribute representation vector corresponding to each commodity not interacted with the user according to attributes of different commodities not interacted with the user; a vector mapping module, configured to map all interest representation vectors of the user and all attribute representation vectors of commodities not interacted with the user corresponding to the user to a metric space based on a preset mapping rule, to obtain all interest mapping vectors of the user and attribute mapping vectors corresponding to each commodity not interacted with the user; a similarity distance calculation module, configured to calculate distances between each interest mapping vector of the user and attribute mapping vectors of commodities not interacted with the user according to a preset calculation rule, and determine a minimum distance between the attribute mapping vectors of commodities not interacted with the user and all interest mapping vectors of the user; and a commodity recommendation module, configured to sort all commodities not interacted with the user according to the minimum distances between the attribute mapping vectors of the commodities and all interest mapping vectors of the user from small to large to obtain a commodity recommendation list of the user.
[0079] In the case of obtaining the above recommendation model, only the historical record of commodity interaction of the user is needed to realize recommendation of commodities corresponding to different interests of the user to the user.
[0080] Compared with the prior art, the application has the following advantages:
[0081] 1. In the training process, the application introduces a plurality of interest representation vectors representing different interests of the user, so that the recommendation model can pay attention to all potential commodities meeting the interests of the user, establish a complex preference relationship between the interests of the user and the commodities, and promote the diversity of the recommendation result of the recommendation system.
[0082] 2. In the training process, the application constructs a commodity preference score function matching the interests of the user, so that the recommendation model can accurately measure the similarity between the interests of the user and the commodities, and improve the recommendation accuracy of the recommendation system.
[0083] 3. In the training process, the application designs a regularization method limiting the Euclidean distance of the plurality of interest representation vectors of the user in the metric space, to ensure that the plurality of interest representation vectors of the user can represent different interests of the user, improve the generalization of the recommendation model, and further promote the diversity of the recommendation result of the recommendation system.
[0084] It is to be understood that even though various steps of the method are described in a particular order, the method can be performed in a different order, or some of the steps can be performed concurrently, or even changed, so long as the desired function is performed.
[0085] The present application can be a system, a method, and / or a computer program product. The computer program product can include a computer readable storage medium (or media) having computer readable program instructions thereon for causing a processor to carry out aspects of the present application.
[0086] The computer readable storage medium can be a tangible device that can retain and store instructions for use by an instruction execution device. The computer readable storage medium can be, for example, but is not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. A non-exhaustive list of more specific examples of the computer readable storage medium includes the following: a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanically encoded device such as punch-cards or raised structures in a groove having instructions recorded thereon, and any suitable combination of the foregoing. A computer readable storage medium, as used herein, is not to be construed as being transitory signals per se, such as radio waves or other freely propagating electromagnetic waves.
[0087] Embodiments of the application have been described above, and the description is not exhaustive, and does not limit the scope of the disclosed embodiments. Many modifications and variations of the described embodiments will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The description is intended to cover any alternatives, modifications, and equivalents of the described embodiments. The terms used herein are intended to be interpreted in the broadest possible manner, consistent with the principles of the present application, and the use of a term in the detailed description or claims should not be interpreted as excluding that term from any other claims.
Claims
1. A training method for a recommendation model, characterized in that: The method comprises the following steps: S1. Obtain a training set, where the training set includes multiple product interaction history records of multiple users; S2. Use the product interaction history records obtained in step S1 to train the recommendation model for multiple rounds until convergence. Perform the following steps in each round of training: S21. Obtain multiple interest representation vectors corresponding to each user based on the product interaction history of the user, and obtain an attribute representation vector corresponding to each product involved in the training set based on the attributes of the product; S22. Map all interest representation vectors of all users and all attribute representation vectors of all products to the metric space based on a preset mapping rule to obtain all interest mapping vectors corresponding to each user and attribute mapping vectors corresponding to each product; S23. Calculate the distance between the attribute mapping vector of each product and all interest mapping vectors of each user in sequence based on a preset calculation rule and determine the minimum distance between the attribute mapping vector of each product and all interest mapping vectors of each user; S24. Calculate the preference loss based on the minimum distance between the attribute mapping vector of each product obtained in step S23 and all interest mapping vectors of each user; S25. Update the parameters of the recommendation model based on the loss obtained in step S24.
2. The method according to claim 1, characterized in that The preset mapping rules include interest representation vector mapping rules and attribute representation vector mapping rules, wherein the interest representation vector mapping rules are: Among them, U represents the set of all users, u i represents the i-th user in U, {1, 2..., C} represents a set of C interest representation vectors, c represents the c-th interest representation vector in {1, 2..., C}, Represents user u i The interest mapping vector of the cth interest representation vector in the metric space in the interest representation vector set, and R d represents the d-dimensional real number field, d represents the embedding dimension of each interest representation vector, represents the learnable transformation weight parameter corresponding to the cth interest representation vector in the interest representation vector set, and R M×d represents the real number field of M×d dimensions, Represents user u i One-hot encoding, and RM represents the M-dimensional real number field; The attribute representation vector mapping rule is: Among them, I represents the set of all commodities, v j represents the jth item in I, Indicates v j The corresponding attribute representation vector is one-hot encoded, and R N represents the N-dimensional real number field, represents the learnable transformation weight parameters, and R N×d represents the N×d-dimensional real number field, Indicates product v j The attribute mapping vector of the corresponding attribute representation vector in the metric space.
3. The method according to claim 2, characterized in that The preset calculation rules are: Among them, I represents the set of all commodities, U represents the set of all users, and u i represents the i-th user in U, v j represents the jth item in I, Represents user u i The interest mapping vector of the cth interest representation vector in the metric space in the interest representation vector set, Indicates product v j The corresponding attribute representation vector is the attribute mapping vector in the metric space, {1, 2..., C} represents a set containing C interest representation vectors, c represents the cth interest representation vector in {1, 2..., C}, s(u i , v j ) indicates product v j The corresponding attribute mapping vector and user u i The minimum distance among all corresponding interest map vectors.
4. The method according to claim 3, characterized in that In the step S23, the method further includes: calculating the average distance between all interest mapping vectors of each user based on all interest mapping vectors of each user; In the step S24, the method further includes: calculating a regularization loss based on the average distance between all interest mapping vectors of each user; In step S25 , the parameters of the recommendation model are updated based on the preference loss and regularization loss obtained in step S24 .
5. The method according to claim 4, characterized in that In step S23, the average distance between all interest mapping vectors of each user is calculated as follows: Among them, {1, 2..., C} represents a set of C interest representation vectors, c1 and c2 represent the c1th and c2th interest representation vectors in {1, 2..., C} respectively, and u i represents the i-th user, Represents user u i The interest mapping vector of the c1th interest representation vector in the metric space in the interest representation vector set, Represents user u i The interest mapping vector of the c2th interest representation vector in the metric space in the interest representation vector set, Represents user u i The average distance between all interest map vectors.
6. The method according to claim 5, characterized in that In step S24, the preference loss is calculated as follows: Among them, U represents the set of all users, u i represents the i-th user in U, Indicates that the user u i The jth item among all the items that have been interacted with, represents the kth item among all items that have not been interacted with by the user. Indicates product The corresponding attribute mapping vector and user u i The minimum distance among all corresponding interest mapping vectors, Indicates product The corresponding attribute mapping vector and user u i The minimum distance among all the corresponding interest mapping vectors, λ represents the preset parameter, Indicates that the user u i The number of all items that have been interacted with, Indicates that the user u is not i The number of all interacted items, M represents the number of all users, and g represents the metric space.
7. The method according to claim 6, characterized in that In the step S24, the regularization loss is calculated as follows: Among them, U represents the set of all users, u i represents the i-th user in U, δ1 and δ2 represent the preset threshold parameters, Represents user u i is the average distance between all interest mapping vectors, and M represents the number of all users.
8. A recommendation model trained using the method according to any one of claims 1 to 7, for recommending products of interest to a user based on the user's multiple product interaction history records, characterized in that: The model includes: a representation processing module, configured to obtain multiple interest representation vectors corresponding to the user based on the user's multiple product interaction history records, and to obtain an attribute representation vector corresponding to each product that the user has not interacted with based on the attributes of different products that the user has not interacted with; A vector mapping module is used to map all interest representation vectors of the user and the attribute representation vectors of all products corresponding to the user that have not been interacted with by the user to the metric space based on a preset mapping rule, so as to obtain all interest mapping vectors corresponding to the user and the attribute mapping vector corresponding to each product that has not been interacted with by the user; A similarity distance calculation module is used to sequentially calculate the distance between each user's interest mapping vector and each attribute mapping vector of a product that has not been interacted with by the user according to a preset calculation rule, and determine the minimum distance between each attribute mapping vector of a product that has not been interacted with by the user and all interest mapping vectors of the user; The product recommendation module is used to sort all the user's products that have not been interacted with by the user from small to large according to the minimum distance between their corresponding attribute mapping vectors and all the user's interest mapping vectors to obtain the user's product recommendation list.
9. The model according to claim 8, characterized in that The representation processing module is an affine transformation network, a multi-layer perceptron network or a fully connected neural network.
10. A product recommendation method, characterized in that: The method comprises the following steps: T1. Obtain the user's product interaction history; T2. Based on the user's product interaction history obtained in step T1, recommend products of interest to the user using the model described in any one of claims 8-9.
11. A computer-readable storage medium, characterized in that A computer program is stored thereon, and the computer program can be executed by a processor to implement the steps of any one of the methods of claims 1 to 7 and 10.
12. An electronic device, characterized in that: include: one or more processors; A storage device for storing one or more programs, which, when executed by the one or more processors, enables the electronic device to implement the steps of the method as claimed in any one of claims 1 to 7 and 10.
Citation Information
Patent Citations
Recommendation method and device, computer equipment and storage medium
CN110795625A
Personalized recommendation method based on knowledge graph representation learning
CN111523029A