Sample training method and commodity sorting method and device for commodity recommendation

CN116452292BActive Publication Date: 2026-10-30阿里巴巴(中国)网络技术有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310411611.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-13
Publication Date
2026-10-30
Estimated Expiration
2043-04-13

AI Technical Summary

Technical Problem

[0004]本申请提供一种用于商品推荐的样本训练方法,以解决如何对用户的特征以及商品标签的特征进行学习的技术问题,本申请还提供商品排序方法、与用于商品推荐的样本训练方法、商品排序方法对应的装置、电子设备以及计算机存储介质

Benefits of technology

[0064]本申请提供一种用于商品推荐的样本训练方法,包括:根据用于商品推荐的数据样本集,构建原始节点图,所述原始节点图中的节点包括用户节点、商品节点以及商品标签节点;其中,所述数据样本集包括多搜索场景下的数据样本集;对所述原始节点图中的节点的特征进行高斯分布表示处理,获得处理后的节点特征;在所述处理后的节点特征中采样,获得采样后的节点特征;采用所述采样后的节点特征与预设的损失函数,对采样后的用户特征与采样后的商品标签特征进行训练,获得用户目标特征与商品标签目标特征,所述用户目标特征与所述商品标签目标特征用于获得用户对商品标签的偏好程度。在本申请的用于商品推荐的样本训练方法中,由于构造了以用户、商品以及商品标签作为节点的原始节点图,实际上是将用户信息、商品信息以及商品标签信息三个维度的信息以及节点之间的相互关系作为样本进行后续训练,使得在训练过程中的样本更为全面,进而能够基于训练获得的用户目标特征与商品标签目标特征更准确地为获得用户对商品标签的偏好程度;同时,由于数据样本集包括多搜索场景下的数据样本集,进而使得训练后获得的用户目标特征与商品标签目标特征适用于多搜索场景下的商品推荐;进一步地,在构造了原始节点图之后,由于对原始节点图中的节点特征进行了高斯分布表示处理,获得处理后的节点特征,并在处理后的节点特征中进行采样,获得采样后的节点特征,进而使得采用后的节点特征的表示更加丰富,相当于对训练过程中的样本进行了扩充,进而能够更全面地进行训练过程以准确地捕捉用户与商品标签之间的联系,在训练过程完毕之后,基于获得的用户目标特征与商品标签目标特征能够准确地获得用户对各种商品标签的偏好程度,以后续提高商品推荐的准确性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116452292B_ABST
    Figure CN116452292B_ABST
Patent Text Reader

Abstract

The application provides a sample training method for commodity recommendation, a commodity sorting method, a device, an electronic device and a computer storage medium. In the sample training method for commodity recommendation, the original node graph is constructed, the information in three dimensions of user information, commodity information and commodity label information and the connection between nodes are actually used as samples, the training samples are more comprehensive, the data sample set includes data sample sets of multiple search scenes, the obtained user target features and commodity label target features are suitable for commodity recommendation in multiple search scenes, the node features in the original node graph are processed by Gaussian distribution representation, the processed node features are obtained, sampling is performed on the processed node features, the sampled node features are obtained, the representation of the sampled node features is more rich, and the connection between the user and the commodity label can be accurately captured by comprehensive training.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and specifically to sample training methods, product ranking methods, apparatus, electronic devices, and computer storage media for product recommendation. Background Technology

[0002] With the rapid development of e-commerce platforms, product recommendations have become increasingly important. In specific product recommendation scenarios, products can be recommended to users based on product tags. For example, when a user enters the search term "dress," product tags could include: French-style dress, solid color dress, and chiffon dress. When showing recommended dresses to the user, a group of dresses corresponding to the "French-style dress" category could be recommended as a batch. This method of recommending products is essentially a bundled recommendation based on product tags.

[0003] This bundled recommendation approach essentially relies on users' preferences for product tags. Existing methods for determining user preferences primarily rely on learning the distance between the vectors of user features and product tag features. Therefore, learning how to effectively learn both user and product tag features has become a pressing technical challenge. Summary of the Invention

[0004] This application provides a sample training method for product recommendation to solve the technical problem of how to learn the features of users and product tags. This application also provides a product ranking method, a corresponding device, electronic device, and computer storage medium for the sample training method and product ranking method for product recommendation.

[0005] This application provides a sample training method for product recommendation, comprising:

[0006] Based on the data sample set used for product recommendation, an original node graph is constructed. The nodes in the original node graph include user nodes, product nodes, and product tag nodes. The data sample set includes data sample sets from multiple search scenarios.

[0007] The features of the nodes in the original node graph are processed by Gaussian distribution representation to obtain the processed node features.

[0008] Sample the processed node features to obtain the sampled node features;

[0009] Using the sampled node features and a preset loss function, the sampled user features and sampled product tag features are trained to obtain user target features and product tag target features. The user target features and product tag target features are used to obtain the user's preference for product tags.

[0010] Optionally, the step of using the sampled node features and a preset loss function to train the sampled user features and sampled product tag features to obtain user target features and product tag target features includes:

[0011] Using the sampled node features and a preset first loss function, the sampled user features and sampled product tag features are trained to obtain initial user features and initial product tag features;

[0012] Using the sampled node features, the initial user features, the initial product tag features, and a preset second loss function, the initial user features and the initial product tag features are trained to obtain the target user features and the target product tag features.

[0013] Optionally, the step of training the sampled user features and sampled product tag features using the sampled node features and a preset first loss function includes:

[0014] Obtain the individual pattern vectors used to assign to the sampled nodes;

[0015] For user nodes and product tag nodes, an allocation matrix is ​​determined based on the sampled node features and the various pattern vectors to assign the sampled nodes.

[0016] Based on the sampled node features, the various pattern vectors, the allocation matrix, and the preset first loss function, the sampled user features and sampled product tag features are trained using a first contrastive learning method and an allocation learning method.

[0017] Optionally, determining the allocation matrix for assigning the sampled nodes based on the sampled node features and the respective pattern vectors includes:

[0018] Based on the sampled node features, a sampled node feature vector is obtained for vectorizing the sampled node features;

[0019] Based on the sampled node feature vectors and the various pattern vectors, the sampled nodes are assigned to the patterns corresponding to the various pattern vectors, and an allocation matrix for assigning the sampled nodes is determined.

[0020] Optionally, the step of assigning the sampled nodes to the patterns corresponding to the pattern vectors based on the sampled node feature vectors and the pattern vectors, and determining the allocation matrix for assigning the sampled nodes, includes:

[0021] Based on the sampled node feature vector and each pattern vector, a similarity vector is obtained to represent the similarity between the sampled node feature vector and the pattern vector.

[0022] Based on the similarity vector, the sampled nodes are assigned to the patterns corresponding to each pattern vector, and an allocation matrix for assigning the sampled nodes is determined.

[0023] Optionally, the step of training the sampled user features and sampled product tag features using a first contrastive learning method and an allocation learning method based on the sampled node features, the various pattern vectors, the allocation matrix, and a preset first loss function includes:

[0024] For user nodes and product tag nodes, the first contrastive learning method is used to train the sampled user features and sampled product tag features based on the sampled node features, the various pattern vectors and the preset first contrastive learning loss function, respectively.

[0025] For user nodes and product tag nodes, the sampled user features and sampled product tag features are trained using an allocation learning method based on the sampled node features, the allocation matrix, and the preset allocation loss function.

[0026] Optionally, the step of training the initial user features and the initial product tag features using the sampled node features, the initial user features, the initial product tag features, and a preset second loss function to obtain the target user features and the target product tag features includes:

[0027] Based on the user initial features and the product tag initial features, obtain the first user initial sub-feature and the first product tag initial sub-feature under the product tag view;

[0028] Based on the sampled product node features, the user initial features, and the product tag initial features, the second user initial sub-features and the second product tag initial sub-features under the product view are obtained;

[0029] Based on the first initial user sub-feature, the first initial product label sub-feature, the second initial user sub-feature, the second initial product label sub-feature, and a preset second loss function, the initial user features and the initial product label features are trained using a second contrastive learning method to obtain the target user features and the target product label features.

[0030] Optionally, the step of training the initial user features and the initial product tag features using a second contrastive learning method based on the first initial user sub-feature, the first initial product tag sub-feature, the second initial user features, the second initial product tag features, and a preset second loss function includes:

[0031] For a user node, the user initial features are trained using a second contrastive learning method based on the first user initial sub-features, the second user initial sub-features, and a preset second contrastive learning loss function;

[0032] For the product tag node, the initial features of the product tag are trained using a second contrastive learning method based on the first initial sub-features of the product tag, the second initial sub-features of the product tag, and a preset second contrastive learning loss function.

[0033] Optional, also includes:

[0034] Based on the first user initial sub-feature, the second user initial sub-feature, the first product tag initial sub-feature, the second product tag initial sub-feature, and a preset ranking loss function, the product tag initial features are trained using a ranking learning method.

[0035] Optionally, the step of performing Gaussian distribution representation processing on the features of the nodes in the original node graph to obtain processed node features includes:

[0036] Based on the original node features, a mean vector and a variance vector are obtained for Gaussian distribution representation of the original node feature vectors, and the mean vector and the variance vector are used as the processed node features.

[0037] Optionally, sampling from the processed node features to obtain sampled node features includes:

[0038] Based on the mean vector and the variance vector, the sampled node features are obtained by resampling.

[0039] Optionally, the step of obtaining sampled node features by resampling based on the mean vector and the variance vector includes:

[0040] Standard samples are obtained by sampling from samples that follow a standard Gaussian distribution.

[0041] Based on the standard sampled samples, the mean vector, and the variance vector, the sampled node features are obtained.

[0042] Optionally, constructing the original node graph based on the data sample set used for product recommendation includes:

[0043] The original node graph is constructed by using the data in the data sample set used for product recommendation as nodes and the relationships between the data in the data sample set used for product recommendation as edges.

[0044] This application provides a product sorting method, including:

[0045] Identify the requesting user and the candidate product tags to recommend to the requesting user;

[0046] Based on a pre-defined target feature library containing user target features and product tag target features, the system queries the target features of the requesting user corresponding to the requesting user and the target features of the candidate product tags corresponding to the candidate product tags; the user target features and the product tag target features are obtained based on a sample training method used for product recommendation.

[0047] Based on the target features of the requesting user and the target features of the candidate product tags, information on the requesting user's preference for candidate product tags is obtained;

[0048] Based on the preference level information, the products corresponding to the candidate product tags are sorted.

[0049] This application provides a sample training device for product recommendation, comprising:

[0050] The construction unit is used to construct an original node graph based on the data sample set used for product recommendation. The nodes in the original node graph include user nodes, product nodes, and product tag nodes. The data sample set includes data sample sets from multiple search scenarios.

[0051] The processing unit is used to perform Gaussian distribution representation processing on the features of the nodes in the original node graph to obtain the processed node features.

[0052] A sampling unit is used to sample from the processed node features to obtain the sampled node features;

[0053] The training unit is used to train the sampled user features and sampled product tag features using the sampled node features and a preset loss function to obtain user target features and product tag target features. The user target features and product tag target features are used to obtain the user's preference for product tags.

[0054] This application provides a product sorting device, comprising:

[0055] The determining unit is used to determine the requesting user and the candidate product tags to be recommended to the requesting user;

[0056] The query unit is used to query the target features of the requesting user corresponding to the requesting user and the target features of the candidate product tags corresponding to the candidate product tags, based on a preset target feature library that stores user target features and product tag target features; the user target features and the product tag target features are obtained based on a sample training method for product recommendation;

[0057] The preference information acquisition unit is used to obtain the preference information of the requesting user for the candidate product tags based on the target features of the requesting user and the target features of the candidate product tags;

[0058] The sorting unit is used to sort the products corresponding to the candidate product tags according to the preference information.

[0059] This application provides an electronic device, including:

[0060] processor;

[0061] The memory stores computer programs that are run by the processor, executing sample training methods and product ranking methods for product recommendation.

[0062] This application provides a computer storage medium storing a computer program that is executed by a processor to perform a sample training method and a product ranking method for product recommendation.

[0063] Compared with the prior art, the embodiments of this application have the following advantages:

[0064] This application provides a sample training method for product recommendation, comprising: constructing an original node graph based on a data sample set for product recommendation, wherein the nodes in the original node graph include user nodes, product nodes, and product tag nodes; wherein the data sample set includes a data sample set under multiple search scenarios; performing Gaussian distribution representation processing on the features of the nodes in the original node graph to obtain processed node features; sampling from the processed node features to obtain sampled node features; and using the sampled node features and a preset loss function to train the sampled user features and sampled product tag features to obtain user target features and product tag target features, wherein the user target features and product tag target features are used to obtain the user's preference for product tags. In the sample training method for product recommendation in this application, an original node graph with users, products, and product tags as nodes is constructed. This effectively uses information from three dimensions—user information, product information, and product tag information—as well as the relationships between nodes as samples for subsequent training. This makes the samples more comprehensive during training, enabling a more accurate assessment of user preferences for product tags based on the user target features and product tag target features obtained through training. Furthermore, since the data sample set includes data samples from multiple search scenarios, the user target features and product tag target features obtained after training are applicable to product recommendation in multiple search scenarios. Further, after constructing the original node graph, Gaussian distribution processing is applied to the node features to obtain processed node features. Sampling is then performed on these processed node features to obtain sampled node features, resulting in a richer representation of the adopted node features. This effectively expands the samples used in the training process, enabling a more comprehensive training process to accurately capture the relationship between users and product tags. After training, the user target features and product tag target features obtained can accurately determine user preferences for various product tags, thereby improving the accuracy of product recommendations. Attached Figure Description

[0065] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For those skilled in the art, other drawings can be obtained based on these drawings.

[0066] Figure 1 This is a schematic diagram illustrating the sample training method for product recommendation according to this application.

[0067] Figure 2A flowchart illustrating the sample training method for product recommendation provided in the first embodiment of this application;

[0068] Figure 3 This is a schematic diagram illustrating the Gaussian distribution representation of node features and the sampling to obtain the sampled node features.

[0069] Figure 4 A detailed diagram illustrating the training process;

[0070] Figure 5 This is a schematic diagram illustrating the principles of the first and second contrastive learning methods.

[0071] Figure 6 This is a framework diagram for the first comparative learning training.

[0072] Figure 7 A flowchart of the product sorting method provided in the second embodiment of this application;

[0073] Figure 8 A schematic diagram of a sample training device for product recommendation provided in the third embodiment of this application;

[0074] Figure 9 A schematic diagram of the commodity sorting device provided in the fourth embodiment of this application;

[0075] Figure 10 This is a schematic diagram of an electronic device provided in the fifth embodiment of this application. Detailed Implementation

[0076] Many specific details are set forth in the following description to provide a full understanding of this application. However, this application can be implemented in many other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of this application. Therefore, this application is not limited to the specific implementations disclosed below.

[0077] This application provides a sample training method, a product ranking method, an apparatus, an electronic device, and a computer storage medium for product recommendation. The following specific embodiments describe the sample training method, the product ranking method, the apparatus, the electronic device, and the computer storage medium for product recommendation.

[0078] The sample training method for product recommendation presented in this application can be applied to scenarios where samples are trained for product recommendation. For example, when recommending products to users, products can be recommended based on product tags. When recommending products to a user based on product tags, the recommendation can be based on the user's preference for those tags.

[0079] Specifically, the sample training method for product recommendation in this application can be used to train the representations of user features (which are actually feature vectors) and product tag features (vectors), thereby determining the final user target features representing the user and the product tag target features representing the product tags.

[0080] After determining the user's target features and the product tag target features, these features can be stored in a target feature library. When recommending products to a requesting user, the library searches for the user's target features corresponding to that user, and simultaneously searches for the candidate product tag target features. Based on the user's target features and the candidate product tag target features, the user's preference for the candidate product tags can be calculated, and the candidate product tags can then be ranked. Finally, based on the ranking of the candidate product tags, product recommendations can be made to the requesting user. A requesting user refers to the user who initiates the search request service.

[0081] The aforementioned product labels correspond to specific products. A single product can contain multiple product labels, and a single product label can correspond to multiple products. For example, when the product is a door lock, its product label can be mechanical, combination, or fingerprint; conversely, when the product label is combination, the corresponding product can be a door lock, or it could be a suitcase.

[0082] To facilitate understanding of the application scenarios of the sample training method for product recommendation in this application, the following scenario example is provided. For instance, when a user enters the search term "dress" in an ordering application, the application needs to select some products from a large number of dress products to be recommended based on the user's search term "dress," and then sort the selected products to recommend them to the user.

[0083] In the ordering app, the numerous dresses to be recommended contain a variety of product tags, such as price (high-priced, low-priced, and mid-priced dresses), style (French-style dresses, pastoral-style dresses, etc.), and material (chiffon dresses, pure cotton dresses, etc.).

[0084] When recommending dresses to users, it's necessary to first determine the user's preference for various product tags among the dresses to be recommended. For example, suppose the user prioritizes chiffon material, then high price, followed by French style, then mid-range price, and finally pure cotton. Therefore, dresses tagged with "chiffon" can be recommended first; then dresses tagged with "high price" can be recommended; next, dresses tagged with "French style" can be recommended; then dresses tagged with "mid-range price" can be recommended; and finally, dresses tagged with "pure cotton" can be recommended.

[0085] To better understand the sample training method used for product recommendation described above, please refer to... Figure 1 This is a schematic diagram of the sample training method for product recommendation in this application.

[0086] In this scenario, taking the execution of a sample training method for product recommendation on the server side as an example, the server side refers to the computing device used to provide data processing, storage, and other services to the user terminal. Generally, the server side can refer to a server or a server cluster. The user terminal is generally an electronic device that is easy for the user to operate directly.

[0087] In this application, specifically, please see Figure 1 The following process is executed on the server side: First, an original node graph is constructed based on the data sample set used for product recommendation; then, the features of the nodes in the original node graph are processed using Gaussian distribution representation to obtain processed node features; next, samples are taken from the processed node features to obtain sampled node features; finally, the sampled node features and a preset loss function are used to train the sampled user features and sampled product tag features to obtain user target features and product tag target features.

[0088] In response to a user's triggering of the search control for product searches, the ordering page of the terminal ordering application sends a request message to the server requesting a ranking of recommended products. Upon receiving this request message, the server determines the candidate product tags corresponding to the candidate products recommended to the user. Then, based on stored user target features and product tag target features, the server queries the target features corresponding to the requesting user (using the user ID and candidate product tag ID) and the target features corresponding to the candidate product tags. After retrieving the target features of the requesting user and the candidate product tags, the server obtains the requesting user's preference information for the candidate product tags. Based on this preference information, the server ranks the products associated with the candidate product tags and provides the ranked candidate product information (the candidate products being the products with the candidate product tags) to the terminal for viewing on the terminal ordering application's page.

[0089] When recommending products to this user, candidate product tags need to be pre-recalled. During the recall process, product tags that have been exposed to and are active with this user are recalled. Then, the target features of the recalled product tags are queried as the target features of the candidate product tags. Candidate product tags refer to: product tags corresponding to products in the product category that correspond to the user's current search term; candidate product tags are product tags that have been displayed when the user is exposed to them.

[0090] When obtaining information about the requesting user's preference for candidate product labels based on the requesting user's target features and the candidate product label's target features, the requesting user's preference for candidate product labels can be calculated based on the distance between the vectors corresponding to the requesting user's target features and the candidate product label's target features.

[0091] The above-mentioned Figure 1 This illustration depicts one application scenario of the sample training method for product recommendation according to this application. The embodiments of this application do not specifically limit the application scenario of the sample training method for product recommendation. The above-described application scenario is merely one embodiment of the sample training method for product recommendation provided in this application. The purpose of providing this application scenario embodiment is to facilitate understanding of the sample training method for product recommendation provided in this application, and not to limit the sample training method for product recommendation provided in this application. Other application scenarios of the sample training method for product recommendation in this application will not be described in detail.

[0092] First Embodiment

[0093] The first embodiment of this application provides a sample training method for product recommendation, which is described below in conjunction with... Figures 2 to 6 The following explanation is provided. The applicable scenarios for this sample training method for product recommendation can be found in the above-described scenario embodiments. For some examples of this embodiment, please refer to the above-described scenario embodiments.

[0094] Please refer to Figure 2 This is a flowchart of the sample training method for product recommendation provided in the first embodiment of this application.

[0095] The sample training method for product recommendation in this application includes the following steps.

[0096] Step S201: Construct the original node graph based on the data sample set used for product recommendation.

[0097] In this embodiment, the nodes in the original node graph include user nodes, product nodes, and product tag nodes; wherein, the data sample set includes data sample sets from multiple search scenarios.

[0098] In this embodiment, the ordering application may involve multiple search methods (i.e., multiple search scenarios), such as: searching by entering keywords, searching by selecting search information from a drop-down list displaying relevant search information, and searching by selecting search information from recommended search terms. In fact, each search method corresponds to a recommendation method. To improve the versatility of search recommendations, such as ensuring that the products ultimately recommended to the user are applicable to multiple search scenarios, data sample sets from multiple search scenarios are selected when choosing the data sample set. Actually, product recommendations are based on user behavior data. Therefore, this method essentially trains user behavior data (e.g., if a user clicks on a product, that product and its corresponding product tags are associated with that user) to obtain the user's preference for product tags, and then recommends products based on this preference. That is, in the field of product recommendation, product recommendations can be made to users based on their preference for product tags.

[0099] Before obtaining information about user preferences for product tags, it is first necessary to obtain the user's characteristics and the characteristics of the product tags. In order to fully consider the relationship between the user's characteristics and the characteristics of the product tags, the method of this embodiment is used to fully learn or train the user's feature representation and the product tag's feature representation.

[0100] In the method of this embodiment, the first step is to obtain a data sample set to be trained, which can be referred to as the data sample set in the method of this embodiment. The data sample set can be historical user data, historical product data, and historical product tag data in the ordering application.

[0101] In ordering applications, there is a large amount of historical product data and historical product tag data. This historical product data or historical product tag data can correspond to historical user data, and there can be correlations between them. That is, there are connections between historical user data and historical product data, historical product data and historical product tag data, and historical user data and historical product tag data. Based on historical user behavior data, the system obtains correlation data between users and products (including user data, product data, and information on the relationship between users and products) and correlation data between users and product tags (including user data, product tag data, and information on the relationship between users and product tags). Based on product-related data provided by merchants and a pre-set algorithm that obtains the correlation between products and product tags based on product data and product tag data, the system obtains correlation data between products and product tags (including product data, product tag data, and information on the relationship between products and product tags).

[0102] An original node graph can be constructed based on historical user data, historical product data, and historical product tag data. In this original node graph, historical user data serves as user nodes, historical product data as product nodes, and historical product tag data as product tag nodes. There are three types of nodes in this original node graph. If there is a relationship between nodes, an edge is established between them; otherwise, there is no connecting edge. User actions such as clicking, adding to favorites, or ordering products constitute edges between user nodes and product nodes. The attachment relationship between products and product tags constitutes edges between product nodes and product tag nodes. The user's demand for product tags during the search process constitutes edges between user nodes and product tag nodes. When constructing the original node graph, data from the data sample set used for product recommendation is used as nodes, and the relationships between data from the data sample set used for product recommendation are used as edges. By constructing an original node graph with users, products, and product tags as nodes, the information in the three dimensions of user information, product information, and product tag information, as well as the relationships between nodes, are used as samples for subsequent training. This makes the samples in the training process more comprehensive, and thus can more accurately obtain the user's preference for product tags based on the user target features and product tag target features obtained during training.

[0103] For example, in an ordering application, user A has viewed products 1 and 3, added products 2 and 4 to their favorites, and placed an order for products 5 and 6. Assuming the historical product list includes products 1 through 10, user A is connected to all products 1 through 6. When user A is considered a node, user A's node is connected to all nodes represented by products 1 through 6. However, assuming user A has no relationship with any of the products 7 through 10, user A's node is not connected to any of the nodes represented by products 7 through 10. Similarly, if product 1 corresponds to product tag 11 (e.g., product 1's attributes include product tag 11), then product 1 and product tag 11 are considered related. If product 1 does not correspond to product tag 15 (e.g., product 1's attributes do not include product tag 15), then product 1 and product tag 15 are considered unrelated.

[0104] In fact, the reason for finding the connections between historical user data, historical product data, and historical product tag data is to construct the edges between nodes when building the original node graph. In this embodiment, to improve data processing efficiency, the identifiers corresponding to historical data (such as ID: Identity Document) are used as nodes, and a correspondence is established between historical data and their corresponding identifiers.

[0105] The method in this embodiment mainly trains the feature representation of historical user data and the feature representation of historical product label data.

[0106] Step S202: Perform Gaussian distribution representation processing on the features of the nodes in the original node graph to obtain the processed node features.

[0107] One way to obtain processed node features by performing Gaussian distribution representation on the features of nodes in the original node graph is to obtain the mean vector and variance vector for performing Gaussian distribution representation on the original node feature vectors, and then use the mean vector and variance vector as the processed node features.

[0108] Step S203: Sample from the processed node features to obtain the sampled node features.

[0109] After obtaining the processed node features, sampling is performed on these processed node features to obtain sampled node features. In this embodiment, obtaining sampled node features by sampling on processed node features can be achieved through resampling. The specific resampling process is described as follows: sampling is performed on samples that follow a standard Gaussian distribution to obtain standard sampled samples; then, based on the standard sampled samples, the mean vector, and the variance vector, the sampled node features are obtained.

[0110] To better understand the process of steps S202 and S203 above, please refer to... Figure 3 This is a schematic diagram of performing Gaussian distribution representation on node features and sampling to obtain the sampled node features.

[0111] Taking historical user data as an example, when using historical user data as user nodes, the original user node features are processed using a Gaussian distribution to obtain the processed node features; the processed node features include a mean vector μ. u With variance vector σ u The Gaussian distribution represents the processed user node features as Gauss(μ) u, ,σ u ), Gauss is Gauss. Figure 3 Normal(0,1) in the diagram represents the standard normal distribution; U(User) represents the historical user data set; I(Item) represents the historical product data set; and B(Bundle) represents the historical product tag data set. Let T be the sampled node feature vector used to vectorize the sampled node features, where T represents the Tth sampling.

[0112] In this embodiment, after Gaussian distribution representation processing, the feature vector of each node can be represented by a multidimensional (e.g., 32-dimensional) Gaussian distribution. A fixed feature vector needs to be sampled from the distribution. Sampling T times will yield T feature vectors for T learning operations. Figure 3 The example provided uses a user node. During training, backpropagation is used. However, the sampling process itself is not differentiable; therefore, reparameterization (resampling) is employed. The node feature vector after sampling is represented by the following formula:

[0113]

[0114] Where ∈ is obtained by sampling from Normal(0,1), μ is the mean vector, and σ is the variance vector.

[0115] The reason for using steps S202 and S203 to obtain node features is that the historical data obtained from the subscription application has different frequencies. For example, some users are active users, while others are inactive; some products are popular, while others are unpopular; some product tags have more associated products, making them more widely applicable (e.g., price-based or material-based tags), while others have fewer associated products, making them less applicable (e.g., a "pants" tag only applies to pants). These different frequencies of historical data mean that using this data as nodes does not allow for sufficient learning or training of node features. Therefore, by representing node features using a Gaussian distribution and then sampling from it, the obtained sampled node features are richer, facilitating the subsequent learning or training process to fully learn the behavioral relationships between users and products, and between users and product tags.

[0116] In this embodiment, the actual process of learning or training the features of nodes involves learning to obtain a vectorized representation of the node features. During the learning process, similar or related node features are brought closer together, while dissimilar or unrelated node features are moved further apart.

[0117] Step S204: Using the sampled node features and a preset loss function, train the sampled user features and sampled product tag features to obtain user target features and product tag target features. The user target features and product tag target features are used to obtain the user's preference for product tags.

[0118] In this embodiment, the sampled node features and a preset loss function are used to train the sampled user features and sampled product tag features to obtain the user target features and product tag target features, as follows:

[0119] First, the sampled node features and the preset first loss function are used to train the sampled user features and sampled product tag features to obtain the initial user features and initial product tag features.

[0120] Then, the initial user features, initial product label features, and a preset second loss function are used to train the initial user features and initial product label features to obtain the target user features and target product label features.

[0121] To facilitate understanding of the training process, the following is provided: Figure 4 and combined Figure 4 The training process will be described in detail. Figure 4This is a detailed schematic diagram of the training process in this embodiment.

[0122] Specifically, please see Figure 4 , Figure 4 The left side describes the process of processing and sampling the node features in the original node graph using a Gaussian distribution. For details, please refer to the relevant descriptions of steps S202 to S203.

[0123] The middle part of the diagram contains two stages of the training process: the first contrastive learning process and the second contrastive learning process. In the first contrastive learning process, the first contrastive learning method and the assignment learning method are mainly used for training. In the second contrastive learning process, the second contrastive learning method and the ranking learning method are mainly used for training.

[0124] In the first contrastive learning process, the sampled node features and the preset first loss function are used to train the sampled user features and sampled product tag features. The training process is described as follows: First, obtain the pattern vectors used to assign the sampled nodes; then, for user nodes and product tag nodes, determine the assignment matrix for assigning the sampled nodes based on the sampled node features and the pattern vectors respectively; finally, based on the sampled node features, the pattern vectors, the assignment matrix, and the preset first loss function, the first contrastive learning method and the assignment learning method are used to train the sampled user features and sampled product tag features.

[0125] In fact, in this embodiment, the first loss function includes a first contrastive learning loss function and an assignment loss function. The reason for using the assignment loss function for training is that during the first contrastive learning process, the sampled nodes are assigned, and contrastive learning is performed based on the node features before assignment (i.e., the node features after sampling) and the node features after assignment. This process requires training using the assignment learning method simultaneously.

[0126] Please refer to Figure 4 In the first comparative learning process, comparative learning was performed separately for user nodes and product tag nodes. Taking user nodes as an example, the sampled user nodes were arranged into a matrix, namely the user matrix, denoted as U. This matrix has a size of M×D, meaning it is a D-dimensional matrix with M columns. Within this matrix are M user vectors (also D-dimensional), representing the features of the M sampled user nodes. The user vectors are essentially the sampled user node feature vectors.

[0127] When training on the features of M sampled user nodes, the allocation matrix for assigning the sampled nodes is determined based on the sampled node features and each pattern vector. This matrix can refer to:

[0128] Based on the sampled node feature vector (e u The sampled nodes are assigned to the corresponding patterns of each pattern vector, thus determining the allocation matrix for the sampled nodes. For user nodes, the allocation matrix (actually the user allocation matrix) is... Figure 4 Q is adopted in China U express.

[0129] Specifically, the allocation matrix, which assigns sampled nodes to patterns corresponding to each pattern vector based on the sampled node feature vector and each pattern vector, can be obtained as follows: First, a similarity vector representing the similarity between the sampled node feature vector and the pattern vector is obtained based on the sampled node feature vector and each pattern vector. Then, the sampled nodes are assigned to patterns corresponding to each pattern vector based on the similarity vector, thus determining the allocation matrix. It is understood that this method can be used to obtain the allocation matrix for both user nodes and product tag nodes. The above-mentioned allocation matrix, which assigns sampled nodes to patterns corresponding to each pattern vector based on the similarity vector, actually refers to solving the optimal transportation problem based on the similarity vector to obtain the allocation matrix.

[0130] Based on the sampled node feature vectors and each pattern vector, a similarity vector is obtained to represent the similarity between the sampled node feature vectors and the pattern vectors. This can be achieved by performing a dot product operation on the sampled node feature vectors and each pattern vector. Multiple similarity vectors can be combined to form a similarity matrix. For user nodes, the user similarity matrix uses Si... U express.

[0131] In this embodiment, each mode vector uses e p The representation is as follows: The user pattern matrix, composed of various pattern vectors (corresponding to the user's various pattern vectors), is represented using... Figure 4 C in U To express.

[0132] To facilitate understanding of the principles of the first and second contrastive learning approaches, the following methods are adopted: Figure 5 The following is a schematic diagram illustrating the principles of the first and second contrastive learning methods.

[0133] This section will explain first. Figure 5 The principle of the first contrastive learning method will be explained later when introducing the second contrastive learning process.

[0134] exist Figure 5 In the diagram, the middle column of vectors represents the sampled node feature vectors, and the right column of vectors represents the various pattern vectors; taking a user node as an example, this is equivalent to... Figure 5 There are eight sampled user node feature vectors and three user pattern vectors. Assuming that users can be divided into three categories based on their interest in product tags, the first three sampled user node feature vectors represent the first category, the next three the second, and the last two the third. In essence, the eight sampled user node feature vectors are assigned to the three user pattern vectors, which can be randomly initialized. The number of these three user pattern vectors is pre-selected; however, it's understandable that two or four could also be used.

[0135] When assigning these eight sampled user node feature vectors to three user pattern vectors, the learning process using the first contrastive learning method actually refers to... Figure 5 The double-headed arrow between the second and third columns illustrates the learning process. There are two types of double-headed arrows: With "→←"; The symbols "→" and "←" indicate that the sampled user node feature vectors are pushed further apart from dissimilar user pattern vectors during the learning process, while "→←" indicates that the sampled user node feature vectors are pulled closer to similar user pattern vectors during the learning process. This allows the eight sampled user node feature vectors to be distributed among three user pattern vectors. In this way, the sampled user node feature vectors can be adjusted using the first contrastive learning method, resulting in optimized user node feature vectors. It should be noted that since resampling is used in this embodiment, backpropagation is required to ultimately obtain better mean and variance vectors.

[0136] The sampled user features and sampled product tag features are trained using a first contrastive learning method and an assignment learning method, respectively. The specific process is as follows: For user nodes and product tag nodes, the sampled user features and sampled product tag features are trained using the first contrastive learning method based on the sampled node features, each pattern vector, and a preset first contrastive learning loss function. At the same time, for user nodes and product tag nodes, the sampled user features and sampled product tag features are trained using the assignment learning method based on the sampled node features, the assignment matrix, and a preset assignment loss function.

[0137] To better understand the training process described above, please refer to [link / reference needed]. Figure 4 Taking user nodes as an example, based on U and C UConstructing the first contrastive learning method Proto_CL(U, C) U Proto_CL, short for Prototypical Contrastive Learning, is based on U and Q. U Constructing an optimal transportation mode comparison (the optimal transportation mode comparison corresponds to the allocation learning method) Proto OT(U, Q) U Proto OT, short for Prototypical Optimal Transport, translates to optimal transport mode. Mode contrastive learning corresponds to the first contrastive learning loss function, and its value can be obtained based on this method. The optimal transport mode (optimal transport is actually for facilitating the even distribution of the sampled user node feature vectors to each user mode vector) corresponds to the allocation loss function, and its value can be obtained based on this. The first contrastive learning loss function... The first loss function is obtained by adding the assignment loss function to the first loss function. The convergence of the entire training process is determined based on the value of the first loss function, the value of the subsequent second contrastive learning loss function, and the value of the ranking learning loss function. The calculation formula is as follows:

[0138]

[0139] Among them, e u This is a current sampled user node feature vector, for example, it could be one of the eight sampled user node feature vectors mentioned above. The user pattern vector that is most similar to the current sampled user node feature vector. This refers to the user pattern vectors in the user pattern matrix other than the user pattern vector most similar to the current sampled user node feature vector. In fact, this formula uses user nodes as an example, setting a learnable pattern matrix for the user matrix, assigning all users to the nearest pattern by calculating the inner product distance between vectors, and then performing a contrastive learning task.

[0140] In fact, through Figure 5 It can be seen that the users represented by the sampled user node features exhibit clustering relationships; for example, multiple users may share similar interests, and these users can be considered as a single category. In traditional fine-grained contrastive learning paradigms, due to the lack of clustering (e.g., ... Figure 5 The learning methods in the two columns on the left will push the distance between samples that originally belonged to the same cluster.

[0141] In pattern contrastive learning, the dual-view features of the GNN (Graph Neural Network) layers are removed, and the pattern contrastive learning task is constructed in the input space of the nodes. This avoids the problem of insufficient batch data in the input space, and pattern contrastive learning avoids the aforementioned problem of widening the distance between samples in the same cluster. Training based on the pattern matrix in the full sample node space not only avoids the problem of insufficient data when allocating batch data, but also solves the problem of the pattern matrix not being updated in a timely manner due to clustering methods. In actual training, the sampled data is trained in batches. If training based on the pattern matrix using batch data, insufficient data will occur when allocating the batch data. For example, if two sampled user node feature vectors are used as batch data and assigned to three user pattern vectors, there will obviously be insufficient data. Furthermore, these two similar sampled user node feature vectors may be assigned to different user pattern vectors, thus widening the distance between samples in the same cluster.

[0142] Furthermore, pattern contrastive learning does not involve learning under different views of the same data, but rather learning between sampled data and pattern data. Taking user nodes as an example, during the learning process, only the distance between the sampled user node feature vector and the pattern vector that is dissimilar to the sampled user node feature vector is extrapolated.

[0143] In the first comparative learning process, an optimal transportation solution was introduced. First, a similarity vector was calculated between the sampled node feature vector and the pattern vector to impose an equal distribution constraint when assigning the sampled nodes to the patterns corresponding to each pattern vector, that is, to constrain users to be evenly distributed across each pattern.

[0144] The solution to the optimal transportation problem must avoid separate computations via backpropagation within the entire first contrastive learning training framework. For example... Figure 6 The diagram illustrates the framework for the first contrastive learning training. The first contrastive learning process ultimately constructs two learning tasks: the first contrastive learning method and the optimal transportation mode. The first contrastive learning is performed using the user matrix, user pattern matrix, and the first contrastive learning loss function. The optimal transportation mode is performed using the user matrix, allocation matrix, and allocation loss function. The solid arrows in the diagram point to the first contrastive learning and optimal transportation mode processes, while the dashed arrows pointing in the opposite direction indicate backpropagation. This backpropagation adjusts the user pattern matrix and user matrix based on the first contrastive learning loss function and the allocation loss function, thereby adjusting the parameters within these matrices.

[0145] Please continue to refer to Figure 5Suppose we take the middle column of vectors as the data vector in the first view. In traditional contrastive learning, we would augment the data to obtain the corresponding data vector in another view (which can be considered the second view). That is, the left column of vectors would become the data vector in the second view. Each data vector in each view corresponds to a sample vector.

[0146] By comparing the data vectors in the first view with those in the second view, the contrastive learning paradigm can be calculated. However, this contrastive learning has a drawback: a sample in the first view can only bring itself closer to the samples in the second view, while pushing itself further away from other samples in the second view. But there are potential cluster relationships among the samples corresponding to the middle column of vectors. Using the contrastive learning shown on the left violates the cluster relationship, that is, it should not push away other samples that belong to the same cluster as itself.

[0147] Therefore, in the first contrastive learning method of this embodiment, a pattern matrix is ​​used ( Figure 5 The diagram on the right side illustrates the learning process between the patterns corresponding to the pattern matrix and the samples corresponding to the middle column of vectors. Assuming there are eight samples corresponding to the middle column of vectors, based on the similarity between these eight samples, they can actually be represented by the three patterns corresponding to the three pattern vectors in the right column of vectors. Therefore, by learning from the patterns corresponding to the samples in the middle column of vectors and the patterns corresponding to the pattern vectors on the right, it avoids alienating other samples belonging to the same cluster.

[0148] To address the aforementioned issues, some existing pattern contrast learning methods employ two processes: clustering and contrast learning using patterns from the pattern matrix as patterns. However, these methods suffer from several problems: during clustering calculations (i.e., calculating how to assign samples corresponding to the middle column vectors to patterns corresponding to the right-hand pattern vectors), model updates (i.e., the pattern contrast learning process) must be stopped; conversely, clustering must stop during model updates. Furthermore, because clustering and model updates are separate processes, the cluster center vectors calculated in the clustering calculations become outdated, affecting the model update performance. Additionally, existing pattern contrast learning methods apply the pattern matrix to batch data streams, directly assigning batch data to patterns. This can lead to insufficient batch data, resulting in similar data being assigned to different patterns during the assignment process. In this application, the method is implemented based on the sampled full user (or product tag) feature vectors (full sample node space), thus avoiding the aforementioned shortcomings.

[0149] In this application, pattern contrastive learning consists of two parts. Initially, a pattern matrix is ​​randomly generated. Taking a user as an example, ... Figure 6 As shown, with the user matrix U and the user pattern matrix CU Then U and C U This can be viewed as matrices under two views in contrastive learning. The first contrastive learning loss function is constructed according to the contrastive learning paradigm (corresponding to Proto CL(U, C)). U On the other hand, since the pattern matrix is ​​a random matrix and does not have the representation of user interests, it can be based on U and C. U Obtain the similarity matrix S U Each user represented by U needs to be assigned to the user pattern matrix C. U For each of the represented modes, assume the allocation scheme is Q. U This involves the optimal transportation allocation problem, and the allocation scheme Q can be solved based on the similarity matrix and optimal transportation theory. U The solution process is iterative, thus yielding the optimal transportation loss function, namely: the allocation loss function (corresponding to Proto OT(U, Q)). U This process completes the assignment of users to patterns and the comparative learning calculation of the user matrix and the user pattern matrix (the comparative learning calculation of the user matrix and the user pattern matrix is ​​actually the comparative learning calculation between each user vector in the user matrix and each user pattern vector in the user pattern matrix).

[0150] like Figure 6 As shown by the dashed arrow in the diagram, the solution for optimal transportation is itself non-differentiable; therefore, the allocation loss function is backpropagated to S. U To optimize U and C U The first contrastive learning loss function can directly optimize U and C. U .

[0151] The above describes how to conduct the first comparative learning process using user nodes as an example. For product tag nodes, the first comparative learning process can be conducted in the same way, such as... Figure 4 Based on B and C B Constructing the first contrastive learning method Proto_CL(B, C) B Based on B and Q B Constructing the optimal transportation mode and comparing Proto_OT(B, Q) B Based on pattern contrastive learning, the first contrastive learning loss function can be determined. Based on the optimal transportation mode (the optimal transportation mode is actually to facilitate the average distribution of the feature vectors of each sampled product tag node to each product tag pattern vector), the allocation loss function can be determined. The first contrastive learning loss function and the allocation loss function are added together to obtain the preset first loss function. Of course, it can be understood that the first contrastive learning loss function, the allocation loss function and the preset first loss function in this part are all relative to the product tag node.

[0152] After obtaining the initial user features and the initial product tag features, a second comparative learning process is performed as described below.

[0153] In this embodiment, the training processes involved in the first contrastive learning method, the second contrastive learning method, the allocation learning method, and the subsequent ranking learning method are all simultaneous. The initial user features and initial product label features generated during the training process of the first contrastive learning method are provided to the second contrastive learning process. The initial user features can refer to vectors optimized from the mean and variance vectors corresponding to the user features; similarly, the initial product label features can refer to vectors optimized from the mean and variance vectors corresponding to the product label features.

[0154] Specifically, the second contrastive learning process actually uses the sampled node features, initial user features, initial product label features, and a preset second loss function to train the initial user features and initial product label features. The specific process is as follows:

[0155] First, based on the initial user features and the initial product tag features, obtain the first initial user sub-features and the first initial product tag features under the product tag view;

[0156] Then, based on the sampled product node features, user initial features, and product tag initial features, the second user initial sub-features and the second product tag initial sub-features under the product view are obtained;

[0157] Finally, based on the first initial user sub-features, the first initial product label sub-features, the second initial user sub-features, the second initial product label sub-features, and a preset second loss function, the initial user features and initial product label features are trained using a second contrastive learning method. Simultaneously, during the second contrastive learning process, the initial product label features are also trained using a ranking learning method based on the first initial user sub-features, the first initial product label sub-features, the second initial user sub-features, the second initial product label sub-features, and a preset ranking loss function.

[0158] Specifically, please refer to Figure 4 In the second contrastive learning approach, a bipartite graph of user-product tag interactions is first obtained. This bipartite graph of user-product tag interactions is then used... Figure 4 In the UB representation, the bipartite graph of user-product tag interaction is actually a node graph that only contains user nodes and product tag nodes. In this node graph, user nodes represent the initial characteristics of the user, and product tag nodes represent the initial characteristics of the product tag.

[0159] Based on the bipartite graph of user-product tag interaction, the first initial user sub-feature u is obtained under the product tag view (taking user nodes as an example, the product tag view can be considered as the bipartite graph of user-product tag interaction). B With the initial sub-feature b of the first product label B In fact, in this embodiment, the initial sub-feature can refer to the initial sub-feature vector.

[0160] Specifically, by using a bipartite graph of user interaction with product tags, the first initial user sub-feature u under the product tag view is obtained. B With the initial sub-feature b of the first product label B At that time, GNN (Graph Neural Networks) was used to extract the first user initial sub-feature u under the product label view. B With the initial sub-feature b of the first product label B In the subsequent process of obtaining the second user initial sub-feature and the second product label initial sub-feature under the product view, the feature extraction method of GNN is also used.

[0161] Based on the sampled product node features, user initial features, and product tag initial features, the second user initial sub-features and the second product tag initial sub-features under the product view are obtained. Specifically, this means: first, obtaining the user-product interaction bipartite graph; then, based on the user-product interaction bipartite graph, obtaining the second user initial sub-features and the first product initial sub-features; then, based on the mounting relationship between products and product tags, and then, based on the first product initial sub-features and the mounting relationship between products and product tags, obtaining the second product tag initial sub-features.

[0162] The user-product interaction bipartite diagram uses Figure 4 The UI in the diagram represents the interaction between the user and the product. The bipartite graph of the interaction between the user and the product is actually a node graph that only contains user nodes and product nodes. In this node graph, the user node represents the initial characteristics of the user, and the product node represents the sampled characteristics of the product node.

[0163] Based on the bipartite graph of user-product interaction, we can obtain the second initial user sub-feature u under the product view (taking user nodes as an example, the product view can be considered as the bipartite graph of user-product interaction). I With the first commodity's initial sub-feature i I .

[0164] The attachment relationship between products and product labels is adopted Figure 4 The BI in the image is used to represent the initial sub-features of the second product label. Figure 4 b I To express.

[0165] After obtaining the first initial user sub-feature, the first initial product label sub-feature, the second initial user sub-feature, and the second initial product label sub-feature, the user initial features and the product label initial features are trained using the second contrastive learning method based on the first initial user sub-feature, the first initial product label sub-feature, the second initial user sub-feature, the second initial product label sub-feature, and the preset second loss function to obtain the user target features and the product label target features. The specific process is as follows.

[0166] For user nodes, based on the first initial user sub-features, the second initial user sub-features, and the preset second contrastive learning loss function, the user initial features are trained using the second contrastive learning method to obtain the user target features.

[0167] For the product tag node, based on the first initial sub-feature of the product tag, the second initial sub-feature of the product tag, and the preset second contrastive learning loss function, the initial features of the product tag are trained using the second contrastive learning method to obtain the target features of the product tag.

[0168] In addition, the second contrastive learning process also includes a ranking learning process.

[0169] During the ranking learning process, the initial user features are trained using a ranking learning approach based on the first initial user sub-features, the second initial user sub-features, the first initial product label sub-features, the second initial product label sub-features, and a preset ranking loss function, to obtain a ranking model. The trained ranking model can then be used to recommend products to requesting users in subsequent processes. Based on the user's target features and the product label target features, it calculates the user's preference for candidate product labels and obtains the ranking information of the products corresponding to the candidate product labels.

[0170] like Figure 4 As shown, ranking learning refers to performing a dot product operation on the user features (first user initial sub-features and second user initial sub-features) under two views, performing a dot product operation on the product label features (first product label initial sub-features and second product label initial sub-features) under two views, and then summing them up to achieve the ranking training process.

[0171] In the ranking learning process, taking a user as an example, suppose the user is interested in product label b, and product label b is used as a positive sample product label. Based on the user's historical behavior data, product label b', which the user is not interested in, is selected as a negative sample product label. That is, there are two product labels: product label b and product label b'. Positive and negative sample pairs can be constructed through product label b and product label b'. In the ranking learning process, the user's features are associated with product label b, and the user's features are not associated with product label b'.

[0172] For details, please continue to refer to Figure 4 For user nodes, based on the first initial user sub-features, the second initial user sub-features, and a preset second contrastive learning loss function, the initial user features are trained using a second contrastive learning method, which can be as follows: Figure 4 The use of u in B with u I Training is performed using the second contrastive learning method, namely CL(u I u B Here, the contrastive learning is cross-view contrastive learning (cross-view contrastive learning refers to comparing and learning the same type of features under different views), which is called the second contrastive learning; similarly, for the product label node, based on the first initial sub-features of the product label, the second initial sub-features of the product label, and the preset second contrastive learning loss function, the initial features of the product label are trained using the second contrastive learning method, which can be as follows: Figure 4 The use of b in B With b I Training is conducted using the second contrastive learning method, namely CL(b). I b B In the second contrastive learning process, CL stands for CrossView Contrastive Learning.

[0173] To better understand the principles of the second contrastive learning, please refer to the relevant documentation. Figure 5 Taking user nodes as an example, Figure 5 During the first contrastive learning process, the middle column of vectors represents the sampled node feature vectors. During the second contrastive learning process, the middle column of vectors can also represent the initial sub-feature vectors u of each second user. I (Of course, it can also refer to the initial sub-feature vectors u of each first user) B Correspondingly, the left-hand column of vectors represents the initial sub-feature vectors u of each first user. B (Of course, it can also refer to the initial sub-feature vectors of each second user u) I It is understandable that... Figure 5In the second comparison learning process, the vector on the left and the vector in the middle are compared. One column represents the initial sub-feature vectors u of each first user. B The other column represents the initial sub-feature vectors u of each second user. I That's all.

[0174] In the second contrastive learning process, due to the first user's initial sub-feature vector u B With the second user's initial sub-feature vector u I It is constructed after the first contrastive learning process, and naturally the first user initial sub-feature vector u B With the second user's initial sub-feature vector u I In essence, these are clustered vectors. Naturally, during the second contrastive learning process, the first user's initial sub-feature vector and its dissimilar second user's initial sub-feature vector are pushed apart during the learning process; the first user's initial sub-feature vector and its similar second user's initial sub-feature vector are pulled closer to each other during the learning process. Similarly, for product tag nodes, the principle of the second contrastive learning can be understood by referring to the above process.

[0175] After obtaining the user target features and product label target features, these features are stored in a feature library. In fact, the final stored user target features and product label target features can also refer to user target feature vectors and product label target feature vectors.

[0176] In this embodiment, the convergence of the entire training process is determined based on the value of the first loss function (including the sum of the values ​​of the first contrastive learning loss function and the assignment loss function), the value of the second contrastive learning loss function, and the value of the ranking learning loss function. When the entire training process converges, the user features trained by the second contrastive learning method are used as the user target features, and the product tag features trained by the second contrastive learning method are used as the product tag target features.

[0177] This application provides a sample training method for product recommendation. In this method, an original node graph is constructed with users, products, and product tags as nodes. Essentially, the information from these three dimensions—user information, product information, and product tag information—along with the relationships between nodes, is used as samples for subsequent training. This results in more comprehensive samples during training, enabling a more accurate estimation of user preference for product tags based on the trained user target features and product tag target features. Furthermore, the user target feature vector and product tag target feature vector obtained after training can be directly used to calculate the user's preference for product tags. This method is used for product recommendation in multi-search scenarios. Furthermore, after constructing the original node graph, Gaussian distribution representation is applied to the node features in the original node graph to obtain processed node features. Sampling is then performed on these processed node features to obtain sampled node features, thus enriching the representation of the adopted node features. This is equivalent to expanding the samples during the training process, enabling a more comprehensive training process to accurately capture the relationship between users and product tags. After the training process is complete, based on the obtained user target features and product tag target features, the user's preference for various product tags can be accurately obtained, thereby improving the accuracy of product recommendations.

[0178] Second Embodiment

[0179] Corresponding to the sample training method for product recommendation provided in the first embodiment of this application, the second embodiment of this application also provides a product ranking method.

[0180] Please refer to Figure 7 This is a flowchart of the product sorting method provided in the second embodiment of this application.

[0181] The product sorting method of this application includes the following steps.

[0182] Step S701: Determine the requesting user and the candidate product labels to be recommended to the requesting user.

[0183] Step S702: Based on a preset target feature library that stores user target features and product tag target features, query the target features of the requesting user corresponding to the requesting user, and query the target features of the candidate product tags corresponding to the candidate product tags.

[0184] In this embodiment, the user target features and the product label target features are obtained based on the method of the first embodiment.

[0185] Step S703: Based on the target features of the requesting user and the target features of the candidate product labels, obtain information on the requesting user's preference for the candidate product labels.

[0186] Step S704: Sort the products corresponding to the candidate product tags according to the preference information.

[0187] Specifically, before recommending products to the requesting user, candidate product tags can be predetermined. There are various ways to determine candidate product tags; for example, some candidate product tags (such as price tags, style tags, material tags, etc.) can be pre-set. Alternatively, candidate product tags can be determined based on the requesting user's historical order data, such as directly using the product tags corresponding to products the user has previously ordered (or clicked on or favorited) as candidate product tags. In this embodiment, the product tags shown to the requesting user, and the product notes corresponding to products the requesting user has clicked / favorited / added to cart / ordered, are mainly used as candidate product tags.

[0188] After determining the requesting user and the candidate product label, since in the first embodiment, user target features representing the characteristics of various types of users and product label target features representing the characteristics of various types of product labels have been obtained, the requesting user target feature corresponding to the requesting user can be found in the user target features, and the candidate product label target feature corresponding to the candidate product label can be found in the product label target features.

[0189] After obtaining the target features of the requesting user and the target features of the candidate product labels, it is equivalent to representing the features of both the requesting user and the candidate product labels. Based on the target features of the requesting user and the target features of the candidate product labels, information on the requesting user's preference for the candidate product labels can be obtained.

[0190] Specifically, the target features of the requesting user and the target features of the candidate product labels can be represented by the target feature vector of the requesting user and the target feature vector of the candidate product labels, respectively. Therefore, when obtaining the information on the requesting user's preference for the candidate product labels, the target feature vector of the requesting user can be multiplied by the target feature vector of each candidate product label to obtain the information on the requesting user's preference for each candidate product label.

[0191] After obtaining the preference information, the products corresponding to the candidate product tags are sorted according to the preference level information, and then candidate products are recommended to the requesting user according to the sorting of the products corresponding to the candidate product tags.

[0192] Third Embodiment

[0193] Corresponding to the sample training method for product recommendation provided in the first embodiment of this application, the third embodiment of this application also provides a sample training device for product recommendation. Since the device embodiment is basically similar to the first embodiment, it is described simply; relevant details can be found in the description of the first embodiment. The device embodiments described below are merely illustrative.

[0194] Please refer to Figure 8 This is a schematic diagram of a sample training device for product recommendation provided in the third embodiment of this application.

[0195] The sample training device 800 for product recommendation includes:

[0196] The construction unit 801 is used to construct an original node graph based on the data sample set used for product recommendation. The nodes in the original node graph include user nodes, product nodes, and product tag nodes. The data sample set includes data sample sets from multiple search scenarios.

[0197] Processing unit 802 is used to perform Gaussian distribution representation processing on the features of the nodes in the original node graph to obtain the processed node features;

[0198] The sampling unit 803 is used to sample from the processed node features to obtain the sampled node features;

[0199] Training unit 804 is used to train the sampled user features and sampled product tag features using the sampled node features and a preset loss function to obtain user target features and product tag target features. The user target features and product tag target features are used to obtain the user's preference for product tags.

[0200] Optionally, the training unit is specifically used for:

[0201] Using the sampled node features and a preset first loss function, the sampled user features and sampled product tag features are trained to obtain initial user features and initial product tag features;

[0202] Using the sampled node features, the initial user features, the initial product tag features, and a preset second loss function, the initial user features and the initial product tag features are trained to obtain the target user features and the target product tag features.

[0203] Optionally, the training unit is specifically used for:

[0204] Obtain the individual pattern vectors used to assign to the sampled nodes;

[0205] For user nodes and product tag nodes, an allocation matrix is ​​determined based on the sampled node features and the various pattern vectors to assign the sampled nodes.

[0206] Based on the sampled node features, the various pattern vectors, the allocation matrix, and the preset first loss function, the sampled user features and sampled product tag features are trained using a first contrastive learning method and an allocation learning method.

[0207] Optionally, the training unit is specifically used for:

[0208] Based on the sampled node features, a sampled node feature vector is obtained for vectorizing the sampled node features;

[0209] Based on the sampled node feature vectors and the various pattern vectors, the sampled nodes are assigned to the patterns corresponding to the various pattern vectors, and an allocation matrix for assigning the sampled nodes is determined.

[0210] Optionally, the training unit is specifically used for:

[0211] Based on the sampled node feature vector and each pattern vector, a similarity vector is obtained to represent the similarity between the sampled node feature vector and the pattern vector.

[0212] Based on the similarity vector, the sampled nodes are assigned to the patterns corresponding to each pattern vector, and an allocation matrix for assigning the sampled nodes is determined.

[0213] Optionally, the training unit is specifically used for:

[0214] For user nodes and product tag nodes, the first contrastive learning method is used to train the sampled user features and sampled product tag features based on the sampled node features, the various pattern vectors and the preset first contrastive learning loss function, respectively.

[0215] For user nodes and product tag nodes, the sampled user features and sampled product tag features are trained using an allocation learning method based on the sampled node features, the allocation matrix, and the preset allocation loss function.

[0216] Optionally, the training unit is specifically used for:

[0217] Based on the user initial features and the product tag initial features, obtain the first user initial sub-feature and the first product tag initial sub-feature under the product tag view;

[0218] Based on the sampled product node features, the user initial features, and the product tag initial features, the second user initial sub-features and the second product tag initial sub-features under the product view are obtained;

[0219] Based on the first initial user sub-feature, the first initial product label sub-feature, the second initial user sub-feature, the second initial product label sub-feature, and a preset second loss function, the initial user features and the initial product label features are trained using a second contrastive learning method to obtain the target user features and the target product label features.

[0220] Optionally, the training unit is specifically used for:

[0221] For a user node, the user initial features are trained using a second contrastive learning method based on the first user initial sub-features, the second user initial sub-features, and a preset second contrastive learning loss function;

[0222] For the product tag node, the initial features of the product tag are trained using a second contrastive learning method based on the first initial sub-features of the product tag, the second initial sub-features of the product tag, and a preset second contrastive learning loss function.

[0223] Optionally, the training unit is further configured to:

[0224] Based on the first user initial sub-feature, the second user initial sub-feature, the first product tag initial sub-feature, the second product tag initial sub-feature, and a preset ranking loss function, the product tag initial features are trained using a ranking learning method.

[0225] Optionally, the processing unit is specifically used for:

[0226] Based on the original node features, a mean vector and a variance vector are obtained for Gaussian distribution representation of the original node feature vectors, and the mean vector and the variance vector are used as the processed node features.

[0227] Optionally, the sampling unit is specifically used for:

[0228] Based on the mean vector and the variance vector, the sampled node features are obtained by resampling.

[0229] Optionally, the sampling unit is specifically used for:

[0230] Standard samples are obtained by sampling from samples that follow a standard Gaussian distribution.

[0231] Based on the standard sample, the mean vector, and the variance vector, the sampled node features are obtained.

[0232] Optionally, the building unit is specifically used for:

[0233] The original node graph is constructed by using the data in the data sample set used for product recommendation as nodes and the relationships between the data in the data sample set used for product recommendation as edges.

[0234] Fourth embodiment

[0235] Corresponding to the product sorting method provided in the second embodiment of this application, the fourth embodiment of this application also provides a product sorting device. Since the device embodiment is basically similar to the second embodiment, the description is relatively simple; relevant details can be found in the description of the second embodiment. The device embodiments described below are merely illustrative.

[0236] Please refer to Figure 9 This is a schematic diagram of the commodity sorting device provided in the fourth embodiment of this application.

[0237] The product sorting device 900 includes:

[0238] The determining unit 901 is used to determine the requesting user and the candidate product tags to be recommended to the requesting user;

[0239] The query unit 902 is used to query the target features of the requesting user corresponding to the requesting user and the target features of the candidate product tags corresponding to the candidate product tags, based on a preset target feature library storing user target features and product tag target features; the user target features and the product tag target features are obtained based on the method of the first embodiment;

[0240] The preference information acquisition unit 903 is used to obtain the preference information of the requesting user for the candidate product tags based on the target features of the requesting user and the target features of the candidate product tags;

[0241] The sorting unit 904 is used to sort the products corresponding to the candidate product tags according to the preference information.

[0242] Fifth embodiment

[0243] Corresponding to the methods of the first and second embodiments of this application, the fifth embodiment of this application also provides an electronic device.

[0244] like Figure 10 As shown, Figure 10 This is a schematic diagram of an electronic device provided in the fifth embodiment of this application.

[0245] In this embodiment, an optional hardware structure of the electronic device 1000 may be as follows: Figure 10 As shown, it includes: at least one processor 1001, at least one memory 1002 and at least one communication bus 1005; the memory 1002 contains a program 1003 and data 1004.

[0246] Bus 1005 can be a communication device for transmitting data between components within electronic device 1000, such as an internal bus (e.g., CPU-memory bus, where the processor is the central processing unit, or CPU for short) or an external bus (e.g., a universal serial bus port or a peripheral component interconnection fast port).

[0247] Additionally, the electronic device also includes at least one network interface 1006 and at least one peripheral interface 1007. The network interface 1006 provides wired or wireless communication with an external network 1008 (e.g., the Internet, intranet, local area network, mobile communication network, etc.). In some embodiments, the network interface 1006 may include any number of network interface controllers (NICs), radio frequency (RF) modules, repeaters, transceivers, modems, routers, gateways, any combination of wired network adapters, wireless network adapters, Bluetooth adapters, infrared adapters, near field communication (NFC) adapters, cellular network chips, etc.

[0248] Peripheral interface 1007 is used to connect to peripherals, such as peripheral 1 in the figure. Figure 10 1009 in the middle), peripheral 2 ( Figure 10 1010 in the middle) and peripheral 3 ( Figure 10 (1011 in the original text). Peripherals are peripheral devices, which may include, but are not limited to, cursor control devices (such as mice, touchpads, or touchscreens), keyboards, displays (such as cathode ray tube displays, liquid crystal displays), displays or light-emitting diode displays, video input devices (such as cameras or input interfaces coupled to video files), etc.

[0249] The processor 1001 may be a CPU, an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of this application.

[0250] The memory 1002 may include high-speed RAM (Random Access Memory) memory, and may also include non-volatile memory, such as at least one disk storage device.

[0251] In this embodiment, the processor 1001 calls the program and data stored in the memory 1002 to execute the methods of the first and second embodiments of this application.

[0252] Sixth Embodiment

[0253] Corresponding to the methods of the first and second embodiments of this application, the sixth embodiment of this application also provides a computer storage medium storing a computer program that is executed by a processor to perform the methods of the first and second embodiments of this application.

[0254] Although this application discloses preferred embodiments as described above, it is not intended to limit this application. Any person skilled in the art can make possible changes and modifications without departing from the spirit and scope of this application. Therefore, the scope of protection of this application should be determined by the scope defined in the claims of this application.

[0255] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory. Memory may include non-persistent storage in computer-readable media, random access memory (RAM), and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0256] 1. Computer-readable media, including both permanent and non-permanent, removable and non-removable media, can store information using any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device. As defined in this article, computer-readable media do not include non-transitory computer-readable storage media, such as modulated data signals and carrier waves.

[0257] 2. Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0258] It should be noted that the embodiments of this application may involve the use of user data. In practical applications, user-specific personal data may be used in the scheme described herein within the scope permitted by applicable laws and regulations, provided that it complies with the applicable laws and regulations of the country (e.g., with the user's explicit consent, with the user being properly notified, etc.).

Claims

1. A sample training method for product recommendation, characterized in that, include: Based on the data sample set used for product recommendation, an original node graph is constructed. The nodes in the original node graph include user nodes, product nodes, and product tag nodes. The data sample set includes data sample sets from multiple search scenarios. The features of the nodes in the original node graph are processed by Gaussian distribution representation to obtain the processed node features. Sample the processed node features to obtain the sampled node features; Using the sampled node features and a preset loss function, the sampled user features and sampled product tag features are trained to obtain user target features and product tag target features. The user target features and product tag target features are used to obtain the user's preference for product tags.

2. The method according to claim 1, characterized in that, The process involves using the sampled node features and a preset loss function to train the sampled user features and sampled product tag features to obtain user target features and product tag target features, including: Using the sampled node features and a preset first loss function, the sampled user features and sampled product tag features are trained to obtain initial user features and initial product tag features; Using the sampled node features, the initial user features, the initial product tag features, and a preset second loss function, the initial user features and the initial product tag features are trained to obtain the target user features and the target product tag features.

3. The method according to claim 2, characterized in that, The step of training the sampled user features and sampled product tag features using the sampled node features and a preset first loss function includes: Obtain the individual pattern vectors used to assign to the sampled nodes; For user nodes and product tag nodes, an allocation matrix is ​​determined based on the sampled node features and the various pattern vectors to assign the sampled nodes. Based on the sampled node features, the various pattern vectors, the allocation matrix, and the preset first loss function, the sampled user features and sampled product tag features are trained using a first contrastive learning method and an allocation learning method.

4. The method according to claim 3, characterized in that, The step of determining the allocation matrix for assigning the sampled nodes based on the sampled node features and each pattern vector includes: Based on the sampled node features, a sampled node feature vector is obtained for vectorizing the sampled node features; Based on the sampled node feature vectors and the various pattern vectors, the sampled nodes are assigned to the patterns corresponding to the various pattern vectors, and an allocation matrix for assigning the sampled nodes is determined.

5. The method according to claim 4, characterized in that, The step of assigning the sampled nodes to the patterns corresponding to the pattern vectors based on the sampled node feature vectors and the pattern vectors, and determining the allocation matrix for assigning the sampled nodes, includes: Based on the sampled node feature vector and each pattern vector, a similarity vector is obtained to represent the similarity between the sampled node feature vector and the pattern vector. Based on the similarity vector, the sampled nodes are assigned to the patterns corresponding to each pattern vector, and an allocation matrix for assigning the sampled nodes is determined.

6. The method according to claim 5, characterized in that, The process of training the sampled user features and sampled product tag features using the sampled node features, the various pattern vectors, the allocation matrix, and a preset first loss function, employing a first contrastive learning method and an allocation learning method, includes: For user nodes and product tag nodes, the first contrastive learning method is used to train the sampled user features and sampled product tag features based on the sampled node features, the various pattern vectors and the preset first contrastive learning loss function, respectively. For user nodes and product tag nodes, the sampled user features and sampled product tag features are trained using an allocation learning method based on the sampled node features, the allocation matrix, and the preset allocation loss function.

7. The method according to claim 2, characterized in that, The step involves using the sampled node features, the initial user features, the initial product tag features, and a preset second loss function to train the initial user features and the initial product tag features to obtain the target user features and the target product tag features, including: Based on the user initial features and the product tag initial features, obtain the first user initial sub-feature and the first product tag initial sub-feature under the product tag view; Based on the sampled product node features, the user initial features, and the product tag initial features, the second user initial sub-features and the second product tag initial sub-features under the product view are obtained; Based on the first initial user sub-feature, the first initial product label sub-feature, the second initial user sub-feature, the second initial product label sub-feature, and a preset second loss function, the initial user features and the initial product label features are trained using a second contrastive learning method to obtain the target user features and the target product label features.

8. The method according to claim 7, characterized in that, The step of training the initial user features and the initial product label features using a second contrastive learning method based on the first initial user feature, the first initial product label feature, the second initial user feature, the second initial product label feature, and a preset second loss function includes: For a user node, the user initial features are trained using a second contrastive learning method based on the first user initial sub-features, the second user initial sub-features, and a preset second contrastive learning loss function; For the product tag node, the initial features of the product tag are trained using a second contrastive learning method based on the first initial sub-features of the product tag, the second initial sub-features of the product tag, and a preset second contrastive learning loss function.

9. The method according to claim 8, characterized in that, Also includes: Based on the first user initial sub-feature, the second user initial sub-feature, the first product tag initial sub-feature, the second product tag initial sub-feature, and a preset ranking loss function, the product tag initial features are trained using a ranking learning method.

10. The method according to claim 1, characterized in that, The step of performing Gaussian distribution representation processing on the features of the nodes in the original node graph to obtain the processed node features includes: Based on the original node features, a mean vector and a variance vector are obtained for Gaussian distribution representation of the original node feature vectors, and the mean vector and the variance vector are used as the processed node features.

11. The method according to claim 10, characterized in that, The step of sampling from the processed node features to obtain sampled node features includes: Based on the mean vector and the variance vector, the sampled node features are obtained by resampling.

12. The method according to claim 11, characterized in that, The step of obtaining sampled node features by resampling based on the mean vector and the variance vector includes: Standard samples are obtained by sampling from samples that follow a standard Gaussian distribution. Based on the standard sampled samples, the mean vector, and the variance vector, the sampled node features are obtained.

13. The method according to claim 1, characterized in that, The step of constructing the original node graph based on the data sample set used for product recommendation includes: The original node graph is constructed by using the data in the data sample set used for product recommendation as nodes and the relationships between the data in the data sample set used for product recommendation as edges.

14. A product sorting method, characterized in that, include: Identify the requesting user and the candidate product tags to recommend to the requesting user; Based on a preset target feature library containing user target features and product tag target features, query the target features of the requesting user corresponding to the requesting user, and query the target features of the candidate product tag corresponding to the candidate product tag. The user target features and the product label target features are obtained based on the method described in any one of claims 1-13; Based on the target features of the requesting user and the target features of the candidate product tags, information on the requesting user's preference for candidate product tags is obtained; Based on the preference level information, the products corresponding to the candidate product tags are sorted.

15. A sample training device for product recommendation, characterized in that, include: The construction unit is used to construct an original node graph based on the data sample set used for product recommendation. The nodes in the original node graph include user nodes, product nodes, and product tag nodes. The data sample set includes data sample sets from multiple search scenarios. The processing unit is used to perform Gaussian distribution representation processing on the features of the nodes in the original node graph to obtain the processed node features. A sampling unit is used to sample from the processed node features to obtain the sampled node features; The training unit is used to train the sampled user features and sampled product tag features using the sampled node features and a preset loss function to obtain user target features and product tag target features. The user target features and product tag target features are used to obtain the user's preference for product tags.

16. A commodity sorting device, characterized in that, include: The determining unit is used to determine the requesting user and the candidate product tags to recommend to the requesting user; The query unit is used to query the target features of the requesting user corresponding to the requesting user and the target features of the candidate product tags corresponding to the candidate product tags, based on a preset target feature library that stores user target features and product tag target features. The user target features and the product label target features are obtained based on the method described in any one of claims 1-13; The preference information acquisition unit is used to obtain the preference information of the requesting user for the candidate product tags based on the target features of the requesting user and the target features of the candidate product tags; The sorting unit is used to sort the products corresponding to the candidate product tags according to the preference information.

17. An electronic device, characterized in that, include: processor; A memory for storing a computer program that is executed by a processor to perform the method described in any one of claims 1-14.

18. A computer storage medium, characterized in that, The computer storage medium stores a computer program that is executed by a processor to perform the method described in any one of claims 1-14.