Recommendation model training method and device, recommendation method and device
By constructing subgraphs and training recommendation models, the over-smoothing problem in graph convolutional neural networks is solved, the accuracy and user stickiness of the recommendation system are improved, and the revenue of the recommendation platform is increased.
Patent Information
- Application Number
- CN202210103302.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-27
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2042-01-27
AI Technical Summary
Existing recommendation systems based on graph convolutional neural networks have an over-smoothing problem. It is difficult to improve the performance of the recommendation system by adding network layers, which affects the revenue and user experience of recommendation platforms and social platforms.
By obtaining the training sample set, constructing a bipartite graph, classifying based on node characteristics, constructing subgraphs, and training the preset neural network model, we can avoid over-smoothing problems and improve the robustness and credibility of the recommendation model.
It improves the accuracy and user stickiness of the recommendation model, increases the revenue of the recommendation platform, avoids erroneous training, and enhances the robustness and credibility of the model.
Smart Images

Figure CN114491263B
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a recommendation model training method. The present application also relates to a recommendation method, a recommendation model training device, a recommendation device, a computing device, and a computer-readable storage medium. Background Art
[0002] With the continuous development of computer technology and Internet technology, various network platforms have emerged one after another, among which recommendation platforms and social platforms are the most popular. The further optimization of recommendation platforms and social platforms is inseparable from the recommendation system. Therefore, improving the performance of the recommendation system is of great significance.
[0003] In recent years, with the rapid development of graph neural network technology, more and more researchers have combined this technology with recommendation systems. The data in the recommendation system is essentially a graph structure. Modeling the recommendation problem by constructing a user-item bipartite graph conforms to the law of the data itself. However, the existing recommendation system based on graph convolutional neural network has the problem of over-smoothing. It is difficult to improve the performance of the recommendation system by adding network layers, which restricts the accuracy of the recommendation system and affects the revenue and user experience of the recommendation platform and social platform. Summary of the invention
[0004] In view of this, an embodiment of the present application provides a recommendation model training method. The present application also relates to a recommendation method, a recommendation model training device, a recommendation device, a computing device, and a computer-readable storage medium to solve the technical defects existing in the prior art.
[0005] According to a first aspect of an embodiment of the present application, a recommendation model training method is provided, comprising:
[0006] Acquire a training sample set, wherein the training sample set includes a plurality of sample pairs, and the sample pairs include a plurality of samples having an associated relationship;
[0007] constructing a bipartite graph according to the plurality of sample pairs, and determining an initial node feature of each node in the bipartite graph based on sample information of each sample;
[0008] Classifying each node according to initial node features of each node in the bipartite graph, and constructing at least one subgraph based on the classification results;
[0009] According to the at least one subgraph, a preset neural network model is trained to obtain a trained recommendation model.
[0010] According to a second aspect of an embodiment of the present application, a recommendation method is provided, including:
[0011] Obtaining an object to be recommended and a target set, wherein the target set includes at least one target;
[0012] Input the to-be-recommended objects and target set into a trained recommendation model to obtain a recommendation value for each target, wherein the recommendation model is obtained by the recommendation model training method described above;
[0013] Arrange the recommendation values from large to small, and recommend the targets corresponding to the first K recommendation values to the object to be recommended, where K is a positive integer.
[0014] According to a third aspect of an embodiment of the present application, a recommendation model training device is provided, comprising:
[0015] A first acquisition module is configured to acquire a training sample set, wherein the training sample set includes a plurality of sample pairs, and the sample pairs include a plurality of samples having an associated relationship;
[0016] A construction module is configured to construct a bipartite graph according to the plurality of sample pairs, and determine an initial node feature of each node in the bipartite graph based on sample information of each sample;
[0017] A classification module is configured to classify each node according to the initial node features of each node in the bipartite graph, and construct at least one subgraph based on the classification result;
[0018] The training module is configured to train a preset neural network model according to the at least one subgraph to obtain a trained recommendation model.
[0019] According to a fourth aspect of an embodiment of the present application, a recommendation device is provided, including:
[0020] A second acquisition module is configured to include an object to be recommended and a target set, wherein the target set includes at least one target;
[0021] An input module is configured to input the to-be-recommended object and the target set into a trained recommendation model to obtain a recommendation value for each target, wherein the recommendation model is obtained by the recommendation model training method described above;
[0022] The recommendation module is configured to arrange the recommendation values from large to small, and recommend the targets corresponding to the top K recommendation values to the object to be recommended, where K is a positive integer.
[0023] According to a fifth aspect of an embodiment of the present application, a computing device is provided, comprising a memory, a processor, and computer instructions stored in the memory and executable on the processor, wherein the processor implements the steps of the recommendation model training method or the recommendation method when executing the computer instructions.
[0024] According to a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided, which stores computer instructions, and when the computer instructions are executed by a processor, the steps of the recommendation model training method or the recommendation method are implemented.
[0025] The recommendation model training method provided by the present application obtains a training sample set, wherein the training sample set includes multiple sample pairs, wherein the sample pairs include multiple samples with an associated relationship; a bipartite graph is constructed based on the multiple sample pairs, and the initial node features of each node in the bipartite graph are determined based on the sample information of each sample; each node is classified based on the initial node features of each node in the bipartite graph, and at least one subgraph is constructed based on the classification results; a preset neural network model is trained based on the at least one subgraph to obtain a trained recommendation model. An embodiment of the present application avoids the problem of over-smoothing by classifying each node according to the initial node features of each node in the bipartite graph, constructing at least one subgraph based on the classification results, and training the recommendation model based on the subgraph, thereby avoiding the problem of incorrect training of the recommendation model and improving the robustness and credibility of the recommendation model. It is widely used and can improve the accuracy of recommendations based on the recommendation model, improve user stickiness to a certain extent, and thus improve the revenue of the recommendation platform corresponding to the recommendation model. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 is a flow chart of a recommendation model training method provided by an embodiment of the present application;
[0027] Figure 2 It is a bipartite graph in the first recommendation model training method provided in one embodiment of the present application;
[0028] Figure 3 It is a bipartite graph in the second recommendation model training method provided in one embodiment of the present application;
[0029] Figure 4 It is a bipartite graph in the third recommendation model training method provided in an embodiment of the present application;
[0030] Figure 5 It is a bipartite graph in the fourth recommendation model training method provided in an embodiment of the present application;
[0031] Figure 6 It is a subgraph in a recommendation model training method provided in an embodiment of the present application;
[0032] Figure 7 It is a structural schematic diagram of a neural network model in a recommendation model training method provided in one embodiment of the present application;
[0033] Figure 8 is a flowchart of a recommended method provided by an embodiment of the present application;
[0034] Fig. 9 is a flow chart of another recommended method provided by an embodiment of the present application;
[0035] Fig.10 is a processing flow chart of a recommendation method applied to an item recommendation scenario provided by an embodiment of the present application;
[0036] Fig.11 It is a structural schematic diagram of a recommendation model training device provided by an embodiment of the present application;
[0037] Fig.12 is a structural schematic diagram of a recommended device provided in one embodiment of the present application;
[0038] Fig.13 It is a structural block diagram of a computing device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0039] Many specific details are described in the following description to facilitate a full understanding of the present application. However, the present application can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of the present application, so the present application is not limited by the specific implementation disclosed below.
[0040] The terms used in one or more embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of the present application. The singular forms of "a", "said" and "the" used in one or more embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of the present application refers to and includes any or all possible combinations of one or more associated listed items.
[0041] It should be understood that, although the terms first, second, etc. may be used to describe various information in one or more embodiments of the present application, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of the present application, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0042] First, a recommendation model training method according to one or more embodiments of the present application is briefly described.
[0043] With the continuous development of computer technology and Internet technology, various network platforms have emerged one after another, among which recommendation platforms and social platforms are the most popular. The further optimization of recommendation platforms and social platforms is inseparable from the recommendation system. Therefore, improving the performance of the recommendation system is of great significance.
[0044] In recent years, with the rapid development of graph neural network technology, more and more researchers have combined this technology with recommendation systems. The data in the recommendation system is essentially a graph structure. Modeling the recommendation problem by constructing a user-item bipartite graph conforms to the law of the data itself, such as fusing the bipartite graph formed by users and items with the social network between users to form a heterogeneous graph. If there are new users or items, new edges are generated on the heterogeneous graph to increase the correlation between nodes. First, a graph neural network is used to update the embedded features of users and items based on the heterogeneous graph, and then a bilinear decoder is used to obtain the possible distribution of each relationship, and finally a recommendation list is formed.
[0045] However, the above method has the problem of over-smoothing, and it is difficult to improve the performance of the recommendation system by adding network layers, which restricts the accuracy of the recommendation system and affects the revenue and user experience of the recommendation platform and social platform.
[0046] Therefore, the present application provides a recommendation model training method, obtaining a training sample set, wherein the training sample set includes multiple sample pairs, wherein the sample pairs include multiple samples with an associated relationship; constructing a bipartite graph based on the multiple sample pairs, and determining the initial node features of each node in the bipartite graph based on the sample information of each sample; classifying each node according to the initial node features of each node in the bipartite graph, and constructing at least one subgraph based on the classification results; and training a preset neural network model based on the at least one subgraph to obtain a trained recommendation model. An embodiment of the present application avoids the problem of over-smoothing by classifying each node according to the initial node features of each node in the bipartite graph, constructing at least one subgraph based on the classification results, and training the recommendation model based on the subgraph, thereby avoiding the problem of incorrect training of the recommendation model and improving the robustness and credibility of the recommendation model. It is widely used and can improve the accuracy of recommendations based on the recommendation model, improve user stickiness to a certain extent, and thus improve the revenue of the recommendation platform corresponding to the recommendation model.
[0047] In the present application, a recommendation model training method is provided. The present application also relates to a recommendation method, a recommendation model training device, a recommendation device, a computing device, and a computer-readable storage medium, which are described in detail one by one in the following embodiments.
[0048] Figure 1 A flowchart of a recommendation model training method provided according to an embodiment of the present application is shown, which specifically includes the following steps:
[0049] Step 102: Acquire a training sample set, where the training sample set includes a plurality of sample pairs, and the sample pairs include a plurality of samples having an associated relationship.
[0050] Specifically, a recommendation model refers to a quantitative relationship between things described in mathematical language or formulas for prediction. The recommendation model can be a prediction model, an evaluation model, other models for prediction, or an algorithm for predicting unknown data, and this application does not limit this. A training sample set refers to a set of samples used to train a recommendation model, wherein the training sample set includes multiple sample pairs, each sample pair includes multiple samples with associated relationships, and each sample corresponds to no less than one first sample and a second sample, and the first sample and the second sample are samples of different types, such as a sample pair includes a service recipient sample (a first sample) and two service provider samples (two second samples), the first sample is a sample corresponding to the object to be recommended, and the second sample is a sample corresponding to the recommended object (target).
[0051] Machine learning is the design and analysis of algorithms that allow computers to "learn" automatically. Machine learning algorithms are a type of algorithm that automatically analyzes data to obtain patterns and uses the patterns to predict unknown data. The main process of machine learning is: obtaining training sample sets, training recommendation models, and recommendation model application stages. Among them, the training sample sets are formed by collecting and organizing data from data sources; the training recommendation model is trained by inputting the training sample sets into the recommendation model to be trained, thereby obtaining a trained recommendation model; in the recommendation model application stage, the application data set, that is, the data set to be recommended, is input into the trained recommendation model, so that the recommendation model processes and outputs the application results, that is, the recommendation results.
[0052] For example, if a shopping website needs to recommend products that users are interested in, it can create a data set based on the shopping records and various personal data of a large number of users, and train a trained recommendation model based on a certain machine learning algorithm (recommendation model). When it is necessary to recommend a product to a user, the information of the user and the product is input into the trained model as an application data set, and the recommendation model will give the corresponding recommendation result, which is the recommended product.
[0053] In addition, the training sample set may be an interaction matrix of at least one first sample and at least one second sample, as shown in Table 1. Table 1 shows an interaction matrix provided by this embodiment, wherein A1, A2, A3 and A4 are 4 different first samples, B1, B2, B3, B4 and B5 are 5 different second samples, and 1 in the table indicates that two samples are associated, and 0 indicates that there is no association between the two samples. Therefore, according to the interaction matrix, 8 sample pairs are included, namely A1 and B2, A1 and B3, A2 and B3, A2 and B5, A3 and B1, A3 and B4, A4 and B1, and A4 and B3.
[0054] Table 1 Interaction matrix
[0055] B1 B2 B3 B4 B5 A1 0 1 1 0 0 A2 0 0 1 0 1 A3 1 0 0 1 0 A4 1 0 1 0 0
[0056] Step 104: construct a bipartite graph according to the plurality of sample pairs, and determine initial node features of each node in the bipartite graph based on sample information of each sample.
[0057] On the basis of obtaining the training sample set, it is further necessary to construct a bipartite graph according to multiple sample pairs, and determine the initial node features of each node in the bipartite graph based on the sample information of each sample.
[0058] Specifically, the bipartite graph represents the relationship between samples in each sample pair; sample information refers to the characteristic information of the sample, such as sample name, sample ID, sample account, etc., and also user name, item link, etc.
[0059] In practical applications, after obtaining a training sample set, a bipartite graph can be constructed based on multiple sample pairs in the training sample set: the samples in each sample pair are used as nodes of the bipartite graph, and the associations between samples are used as edges of the bipartite graph. Then, for any sample in each sample, the sample information of the sample is used as the initial node feature of the node corresponding to the sample.
[0060] Using the above example, the interaction matrix (training sample set) shown in Table 1 contains 8 sample pairs, namely A1 and B2, A1 and B3, A2 and B3, A2 and B5, A3 and B1, A3 and B4, A4 and B1, A4 and B3. A bipartite graph is constructed based on these 8 sample pairs, as shown in Figure 2 As stated, Figure 2The bipartite graph in the first recommendation model training method provided by an embodiment of the present application is shown: since there are nine different samples in the eight sample pairs, these nine samples are used as nodes of the bipartite graph, that is, there are nine different nodes in the bipartite graph: A1, A2, A3, A4, B1, B2, B3, B4 and B5, and then the association relationship between the samples in the eight sample pairs is used as the edge of the bipartite graph, so node A1 is connected to node B2 and node B3, node A2 is connected to node B3 and node B5, node A3 is connected to node B1 and node B4, and node A4 is connected to node B1 and node B3. Then, according to the sample information of samples A1, A2, A3, A4, B1, B2, B3, B4 and B5, they are used as the initial node features of nodes A1, A2, A3, A4, B1, B2, B3, B4 and B5 in the bipartite graph respectively.
[0061] It should be noted that, since a recommendation model training method provided in one embodiment can be implemented by relying on smart devices, such as computers, mobile terminals, etc., and adjacency matrices are generally used in smart devices to represent bipartite graphs, the constructed bipartite graph can also be in the form of an adjacency matrix. Figure 2 The corresponding adjacency matrix of the bipartite graph shown in is shown in Table 2.
[0062] Table 2 An adjacency matrix
[0063] A1 A2 A3 A4 B1 B2 B3 B4 B5 A1 0 0 0 0 0 1 1 0 0 A2 0 0 0 0 0 0 1 0 1 A3 0 0 0 0 1 0 0 1 0 A4 0 0 0 0 1 0 1 0 0 B1 0 0 1 1 0 0 0 0 0 B2 1 0 0 0 0 0 0 0 0 B3 1 1 0 1 0 0 0 0 0 B4 0 0 1 0 0 0 0 0 0 B5 0 1 0 0 0 0 0 0 0
[0064] In addition, the node corresponding to the first sample is the first sample node, and the node corresponding to the second sample is the second sample node.
[0065] Step 106: Classify each node in the bipartite graph according to the initial node features of each node, and construct at least one subgraph based on the classification results.
[0066] After constructing a bipartite graph and determining the initial node features of each node in the bipartite graph, further, each node is classified according to the initial node features of each node in the bipartite graph, and at least one subgraph is constructed based on the classification results.
[0067] In practical applications, after determining the initial node features of each node in the bipartite graph, each node can be directly classified based on the initial node features of each node; the topological information features of each node can be determined respectively according to the initial node features of each node in the bipartite graph; based on the topological information features of each node, each node is classified to obtain at least one type of node, and subgraphs are constructed based on each type of node. Among them, the topological information features can be calculated based on the initial node features of a node and the initial node features of the neighboring nodes of the node, can be calculated based on the initial node features of a node and the position information of the node in the bipartite graph, can be calculated based on the initial node features of a node, the initial node features of the neighboring nodes of the node, and the position information of the node in the bipartite graph, and this application does not limit this.
[0068] It should be noted that in order to ensure that each type of node in the constructed subgraph is connected, all first sample nodes in the bipartite graph can be classified according to the initial node features of each first sample node in the bipartite graph to obtain at least one type of first sample node. For any type of first sample node, a subgraph is constructed based on the first sample node of this type and all second sample nodes associated with the first sample node of this type. For example, the first sample node is a user node, and the second sample node is an item node. According to the initial node features of each user node in the bipartite graph, all user nodes in the bipartite graph are classified. For any type of user node, a subgraph is constructed based on the user node of this type and all item nodes associated with the user node. That is, the first sample node will only exist in a unique subgraph, while the second sample node will exist in different subgraphs.
[0069] Optionally, in order to improve the accuracy of classification, it is necessary to improve the representation ability of each node in the bipartite graph. Since the representation ability of the initial node features is weak, the location information features and neighbor node features of each node can be calculated based on the initial node features, and then the topological information features of each node can be calculated based on the location information features and neighbor node features. That is, according to the initial node features of each node in the bipartite graph, the specific implementation process of determining the topological information features of each node can be as follows:
[0070] According to the initial node features of each node in the bipartite graph, respectively determine the location information features and neighbor node features of each node;
[0071] For any node among the nodes, the topology information feature of the node is calculated according to the location information feature of the node and the features of the neighboring nodes.
[0072] Specifically, the location information feature refers to a feature determined based on the position of a node in a bipartite graph and the initial node feature; the neighbor node feature refers to a feature determined based on the initial node feature of a node and the initial node features of the neighbor nodes of the node.
[0073] In practical applications, after determining the initial node features of each node in the bipartite graph, for any node in the bipartite graph, the location information features of the node can be calculated based on the location information of the node in the bipartite graph or the location information of the node relative to other nodes, combined with the initial node features of the node; and the neighbor node features of the node are calculated based on the initial node features of the node and the neighbor nodes of the node. Then, according to the preset calculation rules, the location information features and neighbor node features of the node are calculated to obtain the topological information features of the node. After that, each node in the bipartite graph is traversed to obtain the topological information features of each node. In this way, the location information features and neighbor node features of the node are calculated first, and then the topological information features are calculated based on the location information features and neighbor node features, so that the topological information features can characterize the features of the node in a more fine-grained manner, so that the classification of nodes based on the topological information features is more accurate.
[0074] In addition, the location information features of each node can be calculated based on the initial node features of each node, and then the neighbor node features of each node can be calculated based on the initial node features of each node; the neighbor node features of each node can be calculated based on the initial node features of each node, and then the location information features of each node can be calculated based on the initial node features of each node; the location information features and location information features of each node can also be calculated simultaneously based on the initial node features of each node, and this application does not limit this.
[0075] In one or more optional embodiments of the present specification, the location information features of each node are determined respectively according to the initial node features of each node in the bipartite graph. The specific implementation process may be as follows:
[0076] Determining at least one reference node in the bipartite graph according to a preset reference rule;
[0077] According to the initial node features and the distance between the at least one reference node and a first node, the location information features of the first node are calculated, and the first node is any node among the nodes.
[0078] Specifically, the preset reference rule refers to the rule for setting reference nodes, such as setting nodes with a centrality greater than a preset value as reference nodes, such as setting anchor nodes as reference points, etc.; a reference node refers to a node whose location information characteristics can be measured by the distance between the nodes on the bipartite graph.
[0079] In practical applications, a reference node can be selected from all nodes in a bipartite graph based on a preset reference rule. There can be one or more reference nodes. Then the distance between the first node and each reference node is determined, and then each distance and the initial node feature of the first node are calculated according to a first preset calculation formula to obtain the position information feature of the first node. In this way, the accuracy of the position information feature can be improved, and then the accuracy of the topological information feature can be improved, thereby improving the classification efficiency.
[0080] See also Figure 3 , Figure 3 The bipartite graph in the second recommendation model training method provided by an embodiment of the present application is shown: wherein node v is the first node, nodes a1, a2 and a3 are three reference nodes determined according to a preset reference rule, and three dotted lines respectively represent the distances from node v to the three reference nodes. After determining the distances from node v to the three reference nodes, the first preset calculation formula is used for calculation, as shown in Formula 1, to obtain the location information feature of node v.
[0081]
[0082] In formula 1, represents a set of reference nodes, || represents a concatenation operation, represents the initial node feature of node v, represents the number of reference nodes; s(v,a) represents the weighting coefficient which is inversely proportional to the distance between node v and node a, Pos v Represents the location information feature of node v.
[0083] In one or more optional embodiments of the present specification, neighbor node features of each node are determined respectively according to the initial node features of each node in the bipartite graph. The specific implementation process may be as follows:
[0084] Determine at least one neighbor node of a second node, where the second node is any node among the nodes, and the neighbor node is a node connected to the second node;
[0085] The neighbor node characteristics of the second node are determined according to the initial node characteristics of the at least one neighbor node.
[0086] Specifically, a neighbor node refers to a node connected to the node.
[0087] In practical applications, any node in the bipartite graph, that is, the second node, can be selected, and then all neighbor nodes of the second node can be determined in the bipartite graph according to the connection relationship of the second node. Furthermore, according to the initial node features of each neighbor node, the second preset calculation formula is used to calculate and obtain the neighbor node features of the second node. In this way, the accuracy of the neighbor node features can be improved, and then the accuracy of the topological information features can be improved, and the classification efficiency can be improved.
[0088] In one or more optional embodiments of the present specification, if there are multiple neighbor nodes, the neighbor node characteristics of the second node are determined according to the initial node characteristics of the at least one neighbor node. The specific implementation process may be as follows:
[0089] Calculate the weighted sum of the initial node features of multiple neighbor nodes, and calculate the interaction features between every two neighbor nodes;
[0090] A neighbor node feature of the second node is determined according to the weighted sum and the interaction feature.
[0091] Specifically, the interaction feature refers to the feature composed of the interaction information between two nodes.
[0092] In practical applications, based on the initial node features of at least one neighbor node, the weighted sum of the initial node features of at least one neighbor node and the interaction features between every two neighbor nodes can be calculated, and further, the weighted sum and the interaction features are calculated according to preset rules to obtain the neighbor node features of the second node. In this way, the accuracy of the neighbor node features can be improved, and then the accuracy of the topological information features can be improved, and the classification efficiency can be improved.
[0093] See also Figure 4 , Figure 4 It is a bipartite graph in the third recommendation model training method provided by an embodiment of the present application: wherein node v is the second node, nodes n1, n2 and n3 are three neighbor nodes of node v, and three dotted arrows respectively represent the interaction features between neighbor nodes. After determining at least one neighbor node of the second node, according to the initial node features of each neighbor node, a weighted sum is obtained by calculating according to a third preset calculation formula, that is, calculating the weighted sum of the initial node features of at least one neighbor node, as shown in Formula 2.
[0094]
[0095] In formula 2, Represents the weighted sum of the initial node features of the neighboring nodes of node v; Represents the neighbor nodes of node v; represents the initial node feature of the i-th neighbor node, a iRepresents the weight of the initial node feature of the i-th neighbor node.
[0096] Preferably, the weighted sum is the mean of the initial node features of at least one neighboring node, that is, preferably the third preset calculation formula is as shown in Formula 3.
[0097]
[0098] In formula 3, Represents the mean of the initial node features of the neighboring nodes of node v; Indicates the number of neighbor nodes of node v; Represents the neighbor nodes of node v; Represents the initial node features of the i-th neighbor node.
[0099] At the same time, according to the initial node features of each neighbor node, calculation is performed according to the fourth preset calculation formula to obtain the interaction features between every two neighbor nodes. Preferably, the fourth preset calculation formula is shown in Formula 4.
[0100]
[0101] In formula 4, represents the interaction feature between at least one neighbor node, Represents the number of neighbor nodes of node v; Represents the number of neighbor node pairs of node v, that is, the number of pairwise combinations of neighbor nodes; Represents the initial node features of the i-th neighbor node; represents the initial node feature of the jth neighbor node; ⊙ represents and Multiplication, that is and The inner product of .
[0102] based on The table contains the interaction information of all neighbors in pairs. Simplifying formula 4, we can get formula 5, as follows:
[0103]
[0104] In formula 5, Represents the number of neighbor nodes of node v; Represents the number of neighbor node pairs of node v, that is, the number of pairwise combinations of neighbor nodes; Represents the initial node features of the i-th neighbor node; represents the initial node feature of the jth neighbor node; ⊙ represents and Multiplication, that is and The inner product of .
[0105] because is the number of neighbor node pairs of node v, which can be expressed by the degree d of node v. v To express it, as shown in Formula 6.
[0106]
[0107] In formula 6, is the number of neighbor node pairs of node v, d v Represents the degree of node v.
[0108] Furthermore, based on the weighted sum and the interaction feature, the fifth preset calculation formula is used to calculate and obtain the neighbor node feature of the second node. Preferably, the weighted sum and the interaction feature are concatenated to obtain the neighbor node feature of the second node, that is, preferably, the fifth preset calculation formula is as shown in Formula 7.
[0109]
[0110] In formula 7, Msg v Represents the neighbor node features of node v; Represents the interaction characteristics between at least one neighbor node; Represents the weighted sum of the initial node features of the neighboring nodes of node v.
[0111] That is, the second preset calculation formula is a combination of the third preset calculation formula, the fourth preset calculation formula and the fifth preset calculation formula.
[0112] On the basis of obtaining the location information features and neighbor node features of each node, for any node among the nodes, according to the location information features and neighbor node features of the node, the topological information features of the node are calculated according to the preset high-level activation function. Preferably, the preset high-level activation function can be a LeakyReLU function, as shown in Formula 8.
[0113] e v =LeakReLU(W(Msg v ||Pos v )+b) (Formula 8)
[0114] In formula 8, e v Represents the topological information characteristics of node v; Msg v Represents the neighbor node characteristics of node v; Pos v Represents the location information characteristics of node v, W and b are preset parameters.
[0115] After determining the topological information features of each node, each node can be classified based on the topological information features. The topological information features of each node can be input into a preset classification model for classification, that is, the final classification result is obtained through a two-layer fully connected feedforward neural network (multi-layer perceptron MLP), as shown in Formula 9.
[0116] y=MLP(e v ) (Formula 9)
[0117] Among them, MLP represents a multi-layer perceptron, and the dimension of the MLP output layer is consistent with the number of classification categories; e v represents the topological information feature of node v; y represents the output result, that is, the classification result of node v, and the category to which the node belongs is determined according to the size of each position of y.
[0118] It should be noted that, if the second node has only one neighbor node, a weighted sum of the initial node features of the at least one neighbor node is calculated, and the weighted sum is determined as the neighbor node feature of the second node.
[0119] In one or more optional embodiments of the present specification, the classification result is at least one node set, and the node set includes at least one node. At this time, at least one subgraph is constructed based on the classification result, and the specific implementation process can be as follows:
[0120] For any node set in the at least one node set, at least one node in the node set is connected according to the bipartite graph to obtain a subgraph.
[0121] Specifically, a node set refers to a collection of nodes of a certain type.
[0122] In practice, when the classification result is N node sets, N is a positive integer, the bipartite graph can be divided into N subgraphs, and according to the bipartite graph, at least one node of any node set is connected to obtain a subgraph. This can improve the efficiency of constructing subgraphs, thereby improving the efficiency of model training.
[0123] For example, the classification result is two node sets, the first node set contains nodes 1-3, and the second node set contains nodes 4-7. Then, according to the connection relationship of nodes 1-3 in the bipartite graph, a first subgraph composed of nodes 1-3 is constructed; according to the connection relationship of nodes 4-7 in the bipartite graph, a second subgraph composed of nodes 4-7 is constructed.
[0124] It should be noted that in order to ensure that the nodes of each class in the constructed subgraph are connected, all the first sample nodes in the bipartite graph can be classified according to the initial node features of each first sample node in the bipartite graph to obtain at least one class of first sample nodes. For any class of first sample nodes, a subgraph is constructed based on the first sample nodes of this class and all the second sample nodes associated with the first sample nodes of this class. That is, the first sample nodes on the bipartite graph are divided into C classes, and then the bipartite graph can be divided into C subgraphs G according to the node categories. c ,c∈{1,…,C}: to construct the subgraph G c For example, in the bipartite graph, the first sample node that does not belong to class C and the edges involved in the first sample node are all deleted, and the remaining part is regarded as the subgraph G c .
[0125] See also Figure 5 , Figure 5 is a bipartite graph in the fourth recommendation model training method provided in an embodiment of the present application, comprising two first sample nodes u1 and u2, and two second sample nodes i1 and i2. Assuming that the first sample nodes u1 and u2 are divided into two categories after classification, the adjacency matrix corresponding to the bipartite graph is shown in Table 3. Figure 6 , Figure 6 The subgraph in a recommendation model training method provided in an embodiment of the present application, that is, the subgraph constructed by taking the category where u1 is located as an example: the node (u2) and the related edges (i.e., the edges between u2 and i1, i2) that do not belong to the category where u1 is located in the bipartite graph can be deleted to obtain the corresponding subgraph. That is, the adjacency matrix shown in Table 3 is expressed as setting all the row and column elements associated with u2 in the adjacency matrix to zero, so that the adjacency matrix corresponding to the subgraph is obtained, as shown in Table 4. In this way, the process of constructing the subgraph can be simplified and the efficiency of subgraph construction can be improved.
[0126] Table 3 Another adjacency matrix
[0127] u1 u2 i1 i2 u1 0 0 1 1 u2 0 0 1 1 i1 1 1 0 0 i2 1 1 0 0
[0128] Table 4 Another adjacency matrix
[0129]
[0130] Step 108: According to the at least one subgraph, a preset neural network model is trained to obtain a trained recommendation model.
[0131] On the basis of constructing at least one subgraph, further, according to the at least one subgraph, a preset neural network model is trained to obtain a trained recommendation model.
[0132] In practical applications, any subgraph in at least one subgraph can be used as a training sample of a preset neural network model, and the connection relationship between nodes in the subgraph can be used as a label to iteratively train the neural network model. After the training is completed, a trained recommendation model is obtained.
[0133] Optionally, the preset neural network model is trained according to the at least one subgraph to obtain a trained recommendation model, and the specific implementation process may be as follows:
[0134] Inputting the at least one subgraph into the neural network model, determining a prediction result between a first sample node and a second sample node in each subgraph, wherein the first sample node is a node corresponding to a sample of a first type among the plurality of samples, and the second sample node is a node corresponding to a sample of a second type among the plurality of samples;
[0135] Calculate the loss value based on the prediction results of each subgraph and the connection relationship between the first sample node and the second sample node in each subgraph;
[0136] The parameters of the neural network model are adjusted based on the loss value, and the step of inputting the at least one subgraph into the neural network model is returned to be executed until a training stop condition is reached, thereby obtaining a trained recommendation model.
[0137] Specifically, label information refers to the labels carried by positive samples and negative samples for verifying the recommendation model; there are many loss functions for calculating loss values, such as cross entropy loss function, L1 norm loss function, maximum loss function, mean square error loss function, logarithmic loss function, etc. In this application, the choice of loss function for calculating loss values is not limited. Parameters refer to the parameters in the recommendation model, that is, the parameters of the neural network model.
[0138] In practical applications, a preset subgraph can be obtained from at least one subgraph, and then each subgraph can be input into the neural network model to obtain the prediction result of each subgraph, that is, to determine the prediction result between the first sample node and the second sample node in each subgraph. Then, for any subgraph in each subgraph, according to the connection relationship and prediction result between the first sample node and the second sample node in the subgraph, that is, according to the connection relationship and prediction result between the first sample node and the second sample node in the first subgraph, the connection relationship and prediction result between the first sample node and the second sample node in the second subgraph, and the connection relationship and prediction result between the first sample node and the second sample node in the Mth subgraph, M is the number of subgraphs, the loss value is calculated, such as the i-th sub-loss value can be calculated according to the connection relationship and prediction result between the first sample node and the second sample node in the i-th subgraph, i is any positive integer less than or equal to M; then according to each sub-loss value, the loss value is determined; and then the parameters of the neural network model are adjusted based on the loss value. Then, the at least one subgraph is input into the neural network model, and the neural network model is continuously trained until the training stop condition is reached to obtain a trained recommendation model. This can improve the accuracy of the loss value, and then when adjusting the parameters, the parameters can converge quickly, thereby improving the efficiency of model training.
[0139] In one or more implementations of this embodiment, the training stop condition for training the recommendation model is: the loss value may be less than the target value; the loss value may stop decreasing; or the number of iterations of the recommendation model reaches the target number of iterations.
[0140] In this embodiment, a target value is set in advance. When the loss value of the recommendation model is lower than the preset target value, or when the loss value stops decreasing, or when the number of iterations of the recommendation model reaches the target number of iterations, it means that the recommendation model reaches the recommendation standard or a certain recommendation level, that is, the training stop condition is reached, and therefore, the training of the recommendation model is stopped.
[0141] Optionally, in the case where the neural network model includes a message passing sub-model and a prediction sub-model, the at least one sub-graph is input into the neural network model to determine the prediction result between the first sample node and the second sample node in each sub-graph. The specific implementation process may be as follows:
[0142] Inputting a preset subgraph into the message passing submodel for information transmission to obtain target node features of each first sample node and each second sample node in the preset subgraph, wherein the preset subgraph is any subgraph;
[0143] The target node features of each first sample node and each second sample node in the preset subgraph are input into the prediction submodel for calculation to obtain the prediction result between the first sample node and the second sample node in the preset subgraph.
[0144] Specifically, information passing, also known as message passing, refers to the transmission of node features between nodes based on the subgraph graph structure.
[0145] In practical applications, the preset subgraph can be input into the message passing submodel of the neural network model for information transmission, and the node features of each first sample node and each second sample node in the preset subgraph can be updated, wherein each message transmission will aggregate the node features of neighboring nodes (i.e. other nodes directly connected to the node through edges), and obtain the target node features of each first sample node and each second sample node in the preset subgraph. Furthermore, the target node features of each first sample node and each second sample node are input into the prediction submodel of the neural network model to predict the prediction score of the first sample node for the second sample node, i.e. the prediction result. In this way, the accuracy of the recommendation model can be improved.
[0146] It should be noted that the message passing submodel may include one message passing layer or multiple message passing layers. That is, the message passing submodel includes at least one message passing layer; at this time, the preset subgraph is input into the message passing submodel for information transmission, and the target node features of each first sample node and each second sample node in the preset subgraph are obtained. The specific implementation process is:
[0147] Inputting the preset subgraph into the at least one message passing layer to perform at least one information passing, and obtaining the message passing characteristics of each information passing of each first sample node and each second sample node in the preset subgraph, wherein the number of information passing is the same as the number of the message passing layers;
[0148] For any node among the first sample nodes and the second sample nodes, a target node feature of the node is determined based on a message transmission feature of each information transmission of the node.
[0149] In practical applications, there are K message passing layers in the message passing submodel, where K is a positive integer. The preset subgraph can be input into the first message passing layer for message passing, and the first message passing feature of each information passing of each first sample node and each second sample node is obtained, and the preset subgraph is updated; then the updated preset subgraph is input into the second message passing layer for message passing, and the second message passing feature of each information passing of each first sample node and each second sample node is obtained, and the preset subgraph is updated; then the updated preset subgraph is input into the third message passing layer for message passing, and so on, until the updated preset subgraph is input into the last (Kth) message passing layer for message passing, and the Kth message passing feature is obtained. Then, for any node among each first sample node and each second sample node, the target node feature of the node is determined based on the first message passing feature to the Kth message passing feature of the node.
[0150] See also Figure 7 , Figure 7 A schematic diagram of the structure of a neural network model in a recommendation model training method provided by an embodiment of the present application is shown: the neural network model includes a message passing sub-model and a prediction sub-model composed of K message passing layers, and each message passing from the 1st layer to the kth layer aggregates the sub-graph s u Node features and subgraphs of neighboring nodes i1, i2, and i3 of node u Neighbor nodes of middle node v1 and Node features to subgraph Middle node v n Neighbor nodes and The node features of the neighboring nodes of each node are normalized and summed, where the node features of nodes v1 to v n Respectively, node v is in the subgraph To subgraph In the representation, node u is the first sample node and node v is the second sample node. Further, the subgraph s is obtained by message passing from the first layer to the kth layer. u Message passing characteristics of middle node u to Subgraph Message passing characteristics of midnode v1 to Subgraph Middle node v n Messaging characteristics to Then to to Calculate the weighted sum to get the message transmission characteristics of node v to Then according to the initial node features of node u and messaging features to Determine the target node features of node u, based on the initial node features of node v and messaging features to Determine the target node feature of node v. Then input the target node feature of node u and the target node feature of node v into the prediction sub-model for prediction to obtain the prediction result.
[0151] For example, subgraph G c The message passing characteristics of the first sample node and the message passing characteristics of the second sample node are obtained as shown in Formula 10.
[0152]
[0153]
[0154] In formula 10, Indicates that the first sample node u is in the subgraph G c The message transmission characteristics obtained after (k+1) times of message propagation; Indicates that the second sample node i is in the subgraph G c The message transmission characteristics obtained after k times of message propagation; is the Laplace regularization term, which reflects the influence of the second sample node and the first sample node; represents the number of second sample nodes associated with the first sample node u, Represents the number of first sample nodes associated with the second sample node i. In this way, the aggregation function shown in Formula 10 cancels the nonlinear activation compared to the traditional graph convolutional neural network model, uses a simpler weighted aggregation, and can simplify the calculation.
[0155] In addition, the second sample node may exist in multiple subgraphs, so the message transmission characteristics of the second sample node on different subgraphs can be summed to obtain the final message transmission characteristics of the second sample node i at the kth layer: here Represents the subgraph containing the first sample node i.
[0156] After obtaining the message passing characteristics of each node in each message passing layer, the target node characteristics of each first sample node and each second sample node can be obtained by weighted summation, as shown in Formula 11.
[0157]
[0158]
[0159] In formula 11, e u represents the target node feature of the first sample node u, α k is the coefficient corresponding to the k-th message passing layer; represents the message transmission characteristics of the first sample node u after k times of message propagation; e i represents the target node feature of the second sample node i; It represents the message transmission characteristics obtained by the second sample node i after k times of message propagation.
[0160] Generally speaking, nodes with closer distances have greater similarity. For example, if the first sample node a and the first sample node b both interact with the second sample node i, then the possibility that the first sample node a and the first sample node b are similar is relatively high. In order to reflect this relationship, the coefficient α in the above formula is k It is represented by 1 / (k+1), where k represents the number of layers corresponding to the current network layer. In this way, the closer the node is to a certain node, the larger the coefficient allocated to other nodes in the message propagation. In this way, the problem of introducing noise from non-similar nodes in the process of graph neural network message propagation is avoided.
[0161] After obtaining the target node features in the first sample node u and the second sample node i, the target node features of the first sample node u and the second sample node i are input into the prediction sub-model. The prediction sub-model uses the dot product to predict the prediction result of the first sample node u for the second sample node i: where y ui is the prediction result, e u represents the target node feature of the first sample node u, e i Represents the target node feature of the second sample node i.
[0162] Optionally, Bayesian personalized ranking is used as the loss function for training, which encourages predicting that the score of an observed item is higher than the score of its unobserved corresponding item. This is also a commonly used loss function in the recommendation field, as shown in Formula 12:
[0163]
[0164] In formula 12, represents the training set, that is, all subgraphs, Indicates that the first sample node in the set is associated with the second sample node. Indicates that the first sample node in the subgraph is not associated with the second sample node; λ is used to control the weight of L2 regularization to avoid overfitting; Θ represents the preset parameter.
[0165] The recommendation model training method provided by the present application obtains a training sample set, wherein the training sample set includes multiple sample pairs, wherein the sample pairs include multiple samples with an associated relationship; constructs a bipartite graph based on the multiple sample pairs, and determines the initial node features of each node in the bipartite graph based on the sample information of each sample; classifies each node according to the initial node features of each node in the bipartite graph, and constructs at least one subgraph based on the classification results; and trains a preset neural network model based on the at least one subgraph to obtain a trained recommendation model. An embodiment of the present application avoids the problem of over-smoothing by classifying each node according to the initial node features of each node in the bipartite graph, constructs at least one subgraph based on the classification results, and trains the recommendation model based on the subgraph, thereby avoiding the problem of incorrect training of the recommendation model and improving the robustness and credibility of the recommendation model. It is widely used and can improve the accuracy of recommendations based on the recommendation model, improve user stickiness to a certain extent, and thus improve the revenue of the recommendation platform corresponding to the recommendation model.
[0166] Figure 8 A flowchart of a recommendation method provided according to an embodiment of the present application is shown, which specifically includes the following steps:
[0167] Step 802: Obtain objects to be recommended and a target set, wherein the target set includes at least one target.
[0168] Specifically, the object to be recommended refers to the object that needs to be recommended, such as a user, a company, an organization, etc.; the target set includes all the targets that can be recommended, and the targets can be items, service providers, etc.
[0169] In actual applications, when it is detected that a certain object logs in or enters the recommendation platform, the object can be determined as a user to be recommended, and all the targets on the recommendation platform, that is, the target set, can be obtained. For example, when it is detected that a user logs in or enters the recommendation platform, the user can be determined as a user to be recommended, and all the items on the recommendation platform, that is, the target set, can be obtained.
[0170] Step 804: Input the to-be-recommended objects and target set into a trained recommendation model to obtain a recommendation value for each target, wherein the recommendation model is obtained by the above-mentioned recommendation model training method.
[0171] Specifically, the recommendation value refers to the result output by the recommendation model, such as the score assigned to each target based on the object to be recommended.
[0172] In practical applications, the recommended objects and target sets are input into the trained recommendation model to obtain the recommendation value of each target. For example, the recommendation model calculates the recommendation value of the recommended object u for the target i through the inner product: where eu Indicates the recommended objects u, e i represents target i, y ui Indicates recommended value.
[0173] Step 806: Arrange the recommendation values from large to small, and recommend the targets corresponding to the first K recommendation values to the object to be recommended, where K is a positive integer.
[0174] On the basis of obtaining the recommendation value of each target, the recommendation values are further arranged from large to small, and the targets corresponding to the first K recommendation values are recommended to the object to be recommended.
[0175] In practical applications, based on the recommendation values of each target, the top K targets with the largest recommendation values are recommended to the target to be recommended, where K is a positive integer. For example, the targets are arranged in descending order of recommendation value, and the top K targets are recommended to the target to be recommended: result = TopK(y ui ), where y ui Indicates the recommendation value, and result indicates the recommendation result. For another example, the targets are arranged in ascending order of the recommendation value, and the last N targets are recommended to the object to be recommended.
[0176] In addition, a target whose recommendation value is greater than a preset recommendation value may also be recommended to the object to be recommended.
[0177] The graph convolutional neural network recommendation model uses the message propagation mechanism on the user-item interaction bipartite graph to obtain high-order interaction information between users and items. This high-order information enhances the representation ability of nodes on the graph, thereby improving the recommendation effect. However, like graph convolutional neural network models in other fields, graph convolutional models in the recommendation field also have the problem of over-smoothing, that is, when more propagation layers are stacked, the embedded representations of the nodes will tend to be consistent, eventually leading to a decrease in model performance. Therefore, this application proposes a graph neural network modeling solution based on similarity subgraphs to address this problem. The core of this solution includes constructing similarity subgraphs based on node features on the graph and defining message propagation strategies on the subgraphs. See Fig. 9 , Fig. 9A flowchart of another recommendation method provided according to an embodiment of the present application is shown: first, a training sample set is obtained, and then a bipartite graph is constructed based on multiple sample pairs in the training sample set. Furthermore, the nodes in the bipartite graph are classified, and a subgraph is constructed based on the classification results. After the subgraph is constructed, the subgraph is input into the recommendation model, and the message passing characteristics (high-order information) of the node are obtained through information propagation on the subgraph, and the obtained message passing characteristics are fused to obtain the target node characteristics of the node. Then, a prediction is made based on the target node characteristics of the node, and the loss value is calculated to adjust the parameters, and iterative training continues. Finally, the recommended items are input into the trained recommendation model, that is, the user to be recommended and the item set are input into the recommended model to obtain the recommendation value of each item, and the top K items with the largest recommendation value are recommended to the user to be recommended.
[0178] In addition, for the node classification in the above process, the existing graph neural network model only uses the initial node features of the neighbors, while ignoring the node's location information features and the interaction features between neighbor nodes. Therefore, this embodiment uses the reference node to calculate the node's location information features, and introduces the location information features between neighbor nodes, effectively enhancing the node's representation capabilities.
[0179] The recommendation model training method provided in the present application obtains the object to be recommended and the target set, wherein the target set includes at least one target; the object to be recommended and the target set are input into the trained recommendation model to obtain the recommendation value of each target, wherein the recommendation model is obtained by the above-mentioned recommendation model training method; the recommendation values are arranged from large to small, and the targets corresponding to the first K recommendation values are recommended to the object to be recommended, where K is a positive integer. An embodiment of the present application classifies each node according to the initial node features of each node in the bipartite graph, constructs at least one subgraph based on the classification results, and trains the recommendation model based on the subgraph, thereby avoiding the problem of over-smoothing, thereby avoiding the wrong training of the recommendation model, and improving the robustness and credibility of the recommendation model. It is widely used and can improve the accuracy of recommendations based on the recommendation model, improve user stickiness to a certain extent, and thus improve the revenue of the recommendation platform corresponding to the recommendation model.
[0180] The above is a schematic scheme of a recommendation method of this embodiment. It should be noted that the technical scheme of the recommendation method and the technical scheme of the recommendation model training method described above are of the same concept, and the details not described in detail in the technical scheme of the recommendation method can be found in the description of the technical scheme of the recommendation model training method described above.
[0181] The following combination Fig.10 , taking the application of the recommendation method provided by this application in the item recommendation scenario as an example, the recommendation method is further explained. Fig.10A processing flow chart of a recommendation method applied to an item recommendation scenario provided by an embodiment of the present application is shown, which specifically includes the following steps:
[0182] Step 1002: Obtain a training sample set, where the training sample set includes a plurality of sample pairs, and the sample pairs include a plurality of samples having an associated relationship.
[0183] Step 1004: construct a bipartite graph based on multiple sample pairs.
[0184] Step 1006: Based on the sample information of each sample, determine the initial node feature of each node in the bipartite graph.
[0185] Step 1008: According to the initial node features of each node in the bipartite graph, the location information features and neighbor node features of each node are determined respectively.
[0186] Optionally, according to the initial node features of each node in the bipartite graph, the location information features of each node are determined respectively, including:
[0187] According to a preset reference rule, determining at least one reference node in the bipartite graph;
[0188] The location information feature of the first node is calculated according to the initial node feature and the distance between at least one reference node and the first node, where the first node is any node among the nodes.
[0189] Optionally, according to the initial node features of each node in the bipartite graph, the neighbor node features of each node are determined respectively, including:
[0190] Determine at least one neighbor node of the second node, where the second node is any node among the nodes, and the neighbor node is a node connected to the second node;
[0191] A neighbor node feature of the second node is determined based on an initial node feature of at least one neighbor node.
[0192] Optionally, there are multiple neighbor nodes;
[0193] Determining a neighbor node feature of a second node according to an initial node feature of at least one neighbor node includes:
[0194] Calculate the weighted sum of the initial node features of multiple neighbor nodes, and calculate the interaction features between every two neighbor nodes;
[0195] A neighbor node feature of the second node is determined according to the weighted sum and the interaction feature.
[0196] Step 1010: For any node among the nodes, the topology information feature of the node is calculated according to the location information feature of the node and the neighbor node feature.
[0197] Step 1012: Classify each node based on the topological information characteristics of each node.
[0198] Step 1014: construct at least one subgraph based on the classification result.
[0199] Optionally, the classification result is at least one node set, and the node set includes at least one node;
[0200] Based on the classification results, at least one subgraph is constructed, including:
[0201] For any node set in at least one node set, connect at least one node in the node set according to the bipartite graph to obtain a subgraph
[0202] Step 1016: Input at least one subgraph into the neural network model.
[0203] Step 1018: Input the preset subgraph into the message passing submodel of the neural network model for information transmission to obtain the target node features of each first sample node and each second sample node in the preset subgraph, where the preset subgraph is any subgraph in at least one subgraph.
[0204] The first sample node is a node corresponding to a sample of the first type among the multiple samples, and the second sample node is a node corresponding to a sample of the second type among the multiple samples.
[0205] Optionally, the message passing sub-model includes at least one message passing layer;
[0206] The preset subgraph is input into the message passing submodel for information transmission, and the target node features of each first sample node and each second sample node in the preset subgraph are obtained, including:
[0207] Inputting the preset subgraph into at least one message passing layer to perform at least one information passing, and obtaining the message passing characteristics of each information passing of each first sample node and each second sample node in the preset subgraph, wherein the number of information passing is the same as the number of message passing layers;
[0208] For any node among each of the first sample nodes and each of the second sample nodes, a target node feature of the node is determined based on a message transmission feature of each information transmission of the node.
[0209] Step 1020: Input the target node features of each first sample node and each second sample node in the preset subgraph into the prediction submodel for calculation to obtain the prediction result between the first sample node and the second sample node in the preset subgraph.
[0210] Step 1022: Calculate the loss value based on the prediction results of each subgraph and the connection relationship between the first sample node and the second sample node in each subgraph.
[0211] Step 1024: Adjust the parameters of the neural network model based on the loss value, return to the step of inputting at least one subgraph into the neural network model, until the training stop condition is reached, and obtain a trained recommendation model.
[0212] Step 1026: Obtain a user and item set to be recommended, where the item set includes at least one item;
[0213] Step 1028: Input the set of users and items to be recommended into the trained recommendation model to obtain the recommendation value of each item.
[0214] Step 1030: Arrange the recommendation values from large to small, and recommend the items corresponding to the first K recommendation values to the user to be recommended, where K is a positive integer.
[0215] The recommendation model training method provided by the present application obtains a training sample set, wherein the training sample set includes multiple sample pairs, wherein the sample pairs include multiple samples with an associated relationship; a bipartite graph is constructed based on the multiple sample pairs, and the initial node features of each node in the bipartite graph are determined based on the sample information of each sample; each node is classified based on the initial node features of each node in the bipartite graph, and at least one subgraph is constructed based on the classification results; a preset neural network model is trained based on the at least one subgraph to obtain a trained recommendation model. An embodiment of the present application avoids the problem of over-smoothing by classifying each node according to the initial node features of each node in the bipartite graph, constructing at least one subgraph based on the classification results, and training the recommendation model based on the subgraph, thereby avoiding the problem of incorrect training of the recommendation model and improving the robustness and credibility of the recommendation model. It is widely used and can improve the accuracy of recommendations based on the recommendation model, improve user stickiness to a certain extent, and thus improve the revenue of the recommendation platform corresponding to the recommendation model.
[0216] Corresponding to the above method embodiment, the present application also provides a recommendation model training device embodiment, Fig.11 FIG. 1 is a schematic diagram showing the structure of a recommendation model training device provided by an embodiment of the present application. Fig.11 As shown, the device comprises:
[0217] A first acquisition module 1102 is configured to acquire a training sample set, wherein the training sample set includes a plurality of sample pairs, and the sample pairs include a plurality of samples having an associated relationship;
[0218] A construction module 1104 is configured to construct a bipartite graph according to the plurality of sample pairs, and determine an initial node feature of each node in the bipartite graph based on sample information of each sample;
[0219] A classification module 1106 is configured to classify each node in the bipartite graph according to the initial node features of each node, and construct at least one subgraph based on the classification result;
[0220] The training module 1108 is configured to train a preset neural network model according to the at least one subgraph to obtain a trained recommendation model.
[0221] Optionally, the classification module 1106 is further configured to:
[0222] Determine the topological information features of each node according to the initial node features of each node in the bipartite graph;
[0223] Based on the topological information features of each node, each node is classified.
[0224] Optionally, the classification module 1106 is further configured to:
[0225] According to the initial node features of each node in the bipartite graph, respectively determine the location information features and neighbor node features of each node;
[0226] For any node among the nodes, the topology information feature of the node is calculated according to the location information feature of the node and the features of the neighboring nodes.
[0227] Optionally, the classification module 1106 is further configured to:
[0228] Determining at least one reference node in the bipartite graph according to a preset reference rule;
[0229] According to the initial node features and the distance between the at least one reference node and a first node, the location information features of the first node are calculated, and the first node is any node among the nodes.
[0230] Optionally, the classification module 1106 is further configured to:
[0231] Determine at least one neighbor node of a second node, where the second node is any node among the nodes, and the neighbor node is a node connected to the second node;
[0232] The neighbor node characteristics of the second node are determined according to the initial node characteristics of the at least one neighbor node.
[0233] Optionally, there are multiple neighbor nodes;
[0234] The classification module 1106 is further configured to:
[0235] Calculate the weighted sum of the initial node features of multiple neighbor nodes, and calculate the interaction features between every two neighbor nodes;
[0236] A neighbor node feature of the second node is determined according to the weighted sum and the interaction feature.
[0237] Optionally, the classification result is at least one node set, and the node set includes at least one node;
[0238] Optionally, the classification module 1106 is further configured to:
[0239] For any node set in the at least one node set, at least one node in the node set is connected according to the bipartite graph to obtain a subgraph.
[0240] Optionally, the training module 1108 is further configured to:
[0241] Inputting the at least one subgraph into the neural network model, determining a prediction result between a first sample node and a second sample node in each subgraph, wherein the first sample node is a node corresponding to a sample of a first type among the plurality of samples, and the second sample node is a node corresponding to a sample of a second type among the plurality of samples;
[0242] Calculate the loss value based on the prediction results of each subgraph and the connection relationship between the first sample node and the second sample node in each subgraph;
[0243] The parameters of the neural network model are adjusted based on the loss value, and the step of inputting the at least one subgraph into the neural network model is returned to be executed until a training stop condition is reached, thereby obtaining a trained recommendation model.
[0244] Optionally, the neural network model includes a message passing sub-model and a prediction sub-model;
[0245] The training module 1108 is further configured to:
[0246] Inputting a preset subgraph into the message passing submodel for information transmission to obtain target node features of each first sample node and each second sample node in the preset subgraph, wherein the preset subgraph is any subgraph;
[0247] The target node features of each first sample node and each second sample node in the preset subgraph are input into the prediction submodel for calculation to obtain the prediction result between the first sample node and the second sample node in the preset subgraph.
[0248] Optionally, the message passing submodel includes at least one message passing layer;
[0249] The training module 1108 is further configured to:
[0250] Inputting the preset subgraph into the at least one message passing layer to perform at least one information passing, and obtaining the message passing characteristics of each information passing of each first sample node and each second sample node in the preset subgraph, wherein the number of information passing is the same as the number of the message passing layers;
[0251] For any node among the first sample nodes and the second sample nodes, a target node feature of the node is determined based on a message transmission feature of each information transmission of the node.
[0252] The recommendation model training device provided by the present application obtains a training sample set, wherein the training sample set includes multiple sample pairs, wherein the sample pairs include multiple samples with an associated relationship; constructs a bipartite graph based on the multiple sample pairs, and determines the initial node features of each node in the bipartite graph based on the sample information of each sample; classifies each node according to the initial node features of each node in the bipartite graph, and constructs at least one subgraph based on the classification results; and trains a preset neural network model based on the at least one subgraph to obtain a trained recommendation model. An embodiment of the present application classifies each node according to the initial node features of each node in the bipartite graph, constructs at least one subgraph based on the classification results, and trains the recommendation model based on the subgraph, thereby avoiding the problem of over-smoothing, thereby avoiding the wrong training of the recommendation model, and improving the robustness and credibility of the recommendation model. It is widely used and can improve the accuracy of recommendations based on the recommendation model, improve user stickiness to a certain extent, and thus improve the revenue of the recommendation platform corresponding to the recommendation model.
[0253] The above is a schematic scheme of a recommendation model training device of this embodiment. It should be noted that the technical scheme of the recommendation model training device and the technical scheme of the recommendation model training method mentioned above belong to the same concept, and the details not described in detail in the technical scheme of the recommendation model training device can be referred to the description of the technical scheme of the recommendation model training method mentioned above.
[0254] Corresponding to the above method embodiments, the present application also provides a recommended device embodiment. Fig.12 FIG. 1 is a schematic diagram showing a structure of a recommended device provided by an embodiment of the present application. Fig.12 As shown, the device comprises:
[0255] The second acquisition module 1202 is configured to receive the object to be recommended and a target set, wherein the target set includes at least one target;
[0256] An input module 1204 is configured to input the to-be-recommended object and the target set into a trained recommendation model to obtain a recommendation value for each target, wherein the recommendation model is obtained by the recommendation model training method described above;
[0257] The recommendation module 1206 is configured to arrange the recommendation values from large to small, and recommend the targets corresponding to the top K recommendation values to the object to be recommended, where K is a positive integer.
[0258] The recommendation model training device provided by the present application obtains an object to be recommended and a target set, wherein the target set includes at least one target; the object to be recommended and the target set are input into a trained recommendation model to obtain a recommendation value for each target, wherein the recommendation model is obtained by the above-mentioned recommendation model training method; the recommendation values are arranged from large to small, and the targets corresponding to the first K recommendation values are recommended to the object to be recommended, where K is a positive integer. An embodiment of the present application classifies each node according to the initial node features of each node in the bipartite graph, constructs at least one subgraph based on the classification results, and trains the recommendation model based on the subgraph, thereby avoiding the problem of over-smoothing, thereby avoiding incorrect training of the recommendation model, and improving the robustness and credibility of the recommendation model. It is widely used and can improve the accuracy of recommendations based on the recommendation model, improve user stickiness to a certain extent, and thus improve the revenue of the recommendation platform corresponding to the recommendation model.
[0259] The above is a schematic scheme of a recommendation device of this embodiment. It should be noted that the technical scheme of the recommendation device and the technical scheme of the recommendation method described above are of the same concept, and the details not described in detail in the technical scheme of the recommendation device can be referred to the description of the technical scheme of the recommendation method described above.
[0260] Fig.13 The structure block diagram of a computing device 1300 provided according to an embodiment of the present application is shown. The components of the computing device 1300 include but are not limited to a memory 1310 and a processor 1320. The processor 1320 is connected to the memory 1310 via a bus 1330, and the database 1350 is used to store data.
[0261] The computing device 1300 also includes an access device 1340 that enables the computing device 1300 to communicate via one or more networks 1360. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 1340 may include one or more of any type of network interface (e.g., a network interface card (NIC)) of wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a world-wide interoperability for microwave access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, a near field communication (NFC) interface, and the like.
[0262] In one embodiment of the present application, the above components of the computing device 1300 and Fig.13 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Fig.13 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of the present application. Those skilled in the art may add or replace other components as needed.
[0263] Computing device 1300 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or PC. Computing device 1300 may also be a mobile or stationary server.
[0264] Among them, when the processor 1320 executes the computer instructions, it implements the steps of the recommendation model training method or the recommendation method.
[0265] The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the recommendation model training method or recommendation method mentioned above belong to the same concept, and the details not described in detail in the technical scheme of the computing device can be referred to the description of the technical scheme of the recommendation model training method or recommendation method mentioned above.
[0266] An embodiment of the present application also provides a computer-readable storage medium storing computer instructions, which, when executed by a processor, implement the steps of the recommendation model training method or recommendation method as described above.
[0267] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the recommendation model training method or recommendation method mentioned above belong to the same concept, and the details not described in detail in the technical scheme of the storage medium can be referred to the description of the technical scheme of the recommendation model training method or recommendation method mentioned above.
[0268] The above describes specific embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0269] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0270] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described action sequence, because according to the present application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0271] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0272] The preferred embodiments of the present application disclosed above are only used to help explain the present application. The optional embodiments do not describe all the details in detail, nor do they limit the invention to the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of the present application. The present application selects and specifically describes these embodiments in order to better explain the principles and practical applications of the present application, so that those skilled in the art can understand and use the present application well. The present application is only limited by the claims and their full scope and equivalents.
Claims
1. A recommendation model training method, characterized in that: include: Acquire a training sample set, wherein the training sample set includes a plurality of sample pairs, and the sample pairs include a plurality of samples having an associated relationship; constructing a bipartite graph according to the plurality of sample pairs, and determining an initial node feature of each node in the bipartite graph based on sample information of each sample; According to the initial node features of each node in the bipartite graph, respectively determine the location information features and neighbor node features of each node; For any node among the nodes, the topological information feature of the node is calculated according to the location information feature of the node and the features of the neighboring nodes; Classifying each node based on the topological information features of each node, and constructing at least one subgraph based on the classification results; Input a preset subgraph into at least one message passing layer of a message passing submodel in a preset neural network model to perform at least one information passing, and obtain the message passing characteristics of each information passing of each first sample node and each second sample node in the preset subgraph, wherein the preset subgraph is any subgraph, the number of information passing is the same as the number of the message passing layers, the neural network model includes the message passing submodel and the prediction submodel, the first sample node is a node corresponding to a sample of a first type among multiple samples, and the second sample node is a node corresponding to a sample of a second type among multiple samples; For any node among the first sample nodes and the second sample nodes, determining a target node feature of the node based on a message transmission feature of each information transmission of the node; Inputting the target node features of each first sample node and each second sample node in the preset subgraph into the prediction submodel for calculation, and obtaining the prediction result between the first sample node and the second sample node in the preset subgraph; Calculate the loss value based on the prediction results of each subgraph and the connection relationship between the first sample node and the second sample node in each subgraph; The parameters of the neural network model are adjusted based on the loss value, and the step of inputting the preset subgraph into at least one message passing layer of the message passing submodel in the preset neural network model for at least one information transmission is returned to execute until the training stop condition is reached to obtain a trained recommendation model.
2. The method according to claim 1, characterized in that: According to the initial node features of each node in the bipartite graph, the location information features of each node are determined respectively, including: Determining at least one reference node in the bipartite graph according to a preset reference rule; According to the initial node features and the distance between the at least one reference node and a first node, the location information features of the first node are calculated, and the first node is any node among the nodes.
3. The method according to claim 1, characterized in that: According to the initial node features of each node in the bipartite graph, the neighbor node features of each node are determined respectively, including: Determine at least one neighbor node of a second node, where the second node is any node among the nodes, and the neighbor node is a node connected to the second node; The neighbor node characteristics of the second node are determined according to the initial node characteristics of the at least one neighbor node.
4. The method according to claim 3, characterized in that: There are multiple neighbor nodes; Determining the neighbor node feature of the second node according to the initial node feature of the at least one neighbor node includes: Calculate the weighted sum of the initial node features of multiple neighbor nodes, and calculate the interaction features between every two neighbor nodes; A neighbor node feature of the second node is determined according to the weighted sum and the interaction feature.
5. The method according to claim 1, characterized in that: The classification result is at least one node set, and the node set includes at least one node; Based on the classification results, at least one subgraph is constructed, including: For any node set in the at least one node set, at least one node in the node set is connected according to the bipartite graph to obtain a subgraph.
6. A recommendation method, characterized in that: include: Obtaining an object to be recommended and a target set, wherein the target set includes at least one target; Inputting the to-be-recommended objects and target set into a trained recommendation model to obtain a recommendation value for each target, wherein the recommendation model is obtained by any one of the recommendation model training methods in claims 1 to 5 above; Arrange the recommendation values from large to small, and recommend the targets corresponding to the first K recommendation values to the object to be recommended, where K is a positive integer.
7. A recommendation model training device, characterized in that: include: A first acquisition module is configured to acquire a training sample set, wherein the training sample set includes a plurality of sample pairs, and the sample pairs include a plurality of samples having an associated relationship; A construction module is configured to construct a bipartite graph according to the plurality of sample pairs, and determine an initial node feature of each node in the bipartite graph based on sample information of each sample; A classification module is configured to determine the location information feature and the neighbor node feature of each node according to the initial node feature of each node in the bipartite graph; For any node among the nodes, the topological information feature of the node is calculated according to the location information feature of the node and the features of the neighboring nodes; Classifying each node based on the topological information features of each node, and constructing at least one subgraph based on the classification results; A training module is configured to input a preset subgraph into at least one message passing layer of a message passing submodel in a preset neural network model to perform at least one information passing, and obtain the message passing characteristics of each information passing of each first sample node and each second sample node in the preset subgraph, wherein the preset subgraph is any subgraph, the number of information passing is the same as the number of the message passing layers, the neural network model includes the message passing submodel and the prediction submodel, the first sample node is a node corresponding to a sample of a first type in a plurality of samples, and the second sample node is a node corresponding to a sample of a second type in a plurality of samples; for any node among the first sample nodes and the second sample nodes, based on the node The target node feature of the node is determined based on the message passing feature of each information transmission; the target node features of each first sample node and each second sample node in the preset subgraph are input into the prediction submodel for calculation to obtain the prediction result between the first sample node and the second sample node in the preset subgraph; the loss value is calculated based on the prediction result of each subgraph and the connection relationship between the first sample node and the second sample node in each subgraph; the parameters of the neural network model are adjusted based on the loss value, and the step of inputting the preset subgraph into at least one message passing layer of the message passing submodel in the preset neural network model for at least one information transmission is returned to execute until the training stop condition is reached to obtain a trained recommendation model.
8. A recommendation device, characterized in that: include: A second acquisition module is configured to include an object to be recommended and a target set, wherein the target set includes at least one target; An input module, configured to input the to-be-recommended object and target set into a trained recommendation model to obtain a recommendation value for each target, wherein the recommendation model is obtained by any one of the recommendation model training methods of claims 1 to 5 above; The recommendation module is configured to arrange the recommendation values from large to small, and recommend the targets corresponding to the top K recommendation values to the object to be recommended, where K is a positive integer.
9. A computing device comprising a memory, a processor, and computer instructions stored in the memory and executable on the processor, characterized in that: When the processor executes the computer instructions, the steps of the method described in any one of claims 1-5 or 6 are implemented.
10. A computer-readable storage medium storing computer instructions, characterized in that: When the computer instructions are executed by a processor, the steps of the method described in any one of claims 1 to 5 or 6 are implemented.
