A graph convolution recommendation method based on adaptive framework and related device
By adopting the graph convolution method of the adaptive framework in the recommendation method, selecting appropriate search methods to aggregate the embedding vectors based on the interaction between users and items and the number of neighbors of nodes, it solves the problem that the existing recommendation methods cannot effectively utilize collaborative information, and improves the accuracy and generalization ability of recommendations.
Patent Information
- Application Number
- CN202210176989.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-24
- Publication Date
- 2025-04-22
- Estimated Expiration
- 2042-02-24
AI Technical Summary
The existing recommendation methods lack explicit encoding of collaborative information, which makes the recommendation model unable to learn Embedding vectors containing hidden information, which in turn affects the recommendation effect.
The graph convolution recommendation method based on the adaptive framework is adopted. By constructing graph structure data of the interaction relationship between users and items, the preset number of neighbor nodes of each graph node is obtained, and the neighbor nodes are searched based on the numerical value, and the target embedding vector is aggregated to train the recommendation model.
By distinguishing the number of preset neighbor nodes of graph nodes and using appropriate search methods, the recommendation model can learn the advantages of different graph nodes embedding vectors, improve the recommendation accuracy and generalization effect, and thus improve the recommendation accuracy.
Smart Images

Figure CN114548296B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of electronics and communications, and in particular to a graph convolution recommendation method based on an adaptive framework and related devices. Background Art
[0002] At present, the existing recommendation methods generally encode the features of the user side and the item side (for example, the products purchased by the user, the stores visited, the keywords searched, the classification and tags of the products, etc.) into embedding vectors, and then perform combined mining to generate a recommendation list for the user, which can enhance the generalization ability of the recommendation model and improve the accuracy of the recommendation model. However, since the existing recommendation methods lack the explicit encoding process of important collaborative information, and the collaborative information is hidden in the user-item interaction data and contains the behavioral similarities between users or items, the existing recommendation methods cannot learn the Embedding vector containing hidden information. More specifically, the existing recommendation methods mainly encode the ID or attribute to obtain the Embedding vector, and then define the reconstruction loss function based on the user-item collaborative interaction information and perform decoding, wherein the user-item collaborative interaction information is only used at the decoding end and not at the encoding end. This will result in the recommendation model learning that the embedding vectors of users or items do not contain enough information. In order to better recommend items that users may be interested in, the model can only rely on complex collaborative interaction functions to make up for the shortcomings of suboptimal embedding vectors in result recommendations, which leads to increasingly complex recommendation models and poor recommendation effects.
[0003] Therefore the prior art still needs to be improved and enhanced. Summary of the invention
[0004] The technical problem to be solved by the present application is to provide a graph convolution recommendation method and related devices based on an adaptive framework in view of the deficiencies in the prior art.
[0005] In order to solve the above technical problems, the first aspect of the embodiment of the present application provides a graph convolution recommendation method based on an adaptive framework, wherein the method comprises:
[0006] Construct graph structure data of the interaction relationship between users and items based on the user historical interaction dataset;
[0007] Obtaining the number of neighbor nodes of a preset order for each graph node in the graph structure data;
[0008] When the number of neighbor nodes of a graph node of a preset order is greater than or equal to a preset threshold, the neighbor nodes of the graph node are searched in a breadth-first manner and aggregated to obtain a target embedding vector corresponding to the graph node;
[0009] When the number of neighbor nodes of a preset order of a graph node is less than a preset threshold, the neighbor nodes of the graph node are searched in a depth-first manner and aggregated to obtain a target embedding vector corresponding to the graph node, wherein the number of propagation layers corresponding to the graph node searched in a depth-first manner is greater than the number of propagation layers corresponding to the graph node searched in a breadth-first manner;
[0010] The recommendation model is trained based on the target embedding vector of each graph node, and the interaction probability between the recommended user and each candidate item is determined based on the trained recommendation model.
[0011] The graph convolution recommendation method based on the adaptive framework, wherein the step of searching the neighbor nodes of the graph node in a breadth-first manner and aggregating to obtain the target embedding vector corresponding to the graph node specifically includes:
[0012] Search all neighbor nodes corresponding to the first propagation layer number of the graph node;
[0013] Randomly sample some neighbor nodes from the neighbor nodes included in the first-order propagation layer, and aggregate the embedding vectors of the sampled part of the neighbor nodes to obtain a first reference embedding vector;
[0014] Randomly sample some neighbor nodes from the neighbor nodes included in the second-order propagation layer number, and aggregate the embedding vectors of the selected part of the neighbor nodes to obtain a second reference embedding vector, and so on until the first propagation layer number to obtain the Nth reference embedding vector corresponding to the first propagation layer number;
[0015] The target embedding vector of the graph node is determined according to all the acquired reference embedding vectors.
[0016] The graph convolution recommendation method based on the adaptive framework, wherein the target embedding vector corresponding to the graph node is:
[0017]
[0018]
[0019] Among them, e u represents the target embedding vector, α l represents the importance coefficient of the l-th order propagation layer, represents the embedding vector of the graph node u of the l-th order propagation layer, represents the embedding vector of the graph node u of the l+1th order propagation layer, represents the embedding vector of the neighbor node i of the graph node u in the l-th order propagation layer, N i Represents the neighbor nodes of the first-order propagation layer of graph node u, |N u | represents the number of neighbor nodes in the first-order propagation layer of graph node u, |N i| represents the number of neighbor nodes in the first-order propagation layer of graph node i.
[0020] The graph convolution recommendation method based on the adaptive framework, wherein when the number of neighbor nodes of a preset order of a graph node is less than a preset threshold, obtaining the neighbor nodes of the graph node and aggregating them to obtain the target embedding vector corresponding to the graph node specifically includes:
[0021] When the number of neighbor nodes of a preset order of a graph node is less than a preset threshold, searching for all neighbor nodes corresponding to a second propagation layer number of the graph node, wherein the second propagation layer number is greater than the first propagation layer number;
[0022] Aggregate the searched neighbor nodes to obtain the candidate embedding vector of the target node corresponding to the graph node, and aggregate the searched neighbor nodes of even layers to obtain the residual embedding vector;
[0023] A target embedding vector corresponding to the graph node is determined based on the candidate embedding vector and the residual embedding vector.
[0024] The graph convolution recommendation method based on the adaptive framework, wherein the target embedding vector is:
[0025]
[0026]
[0027]
[0028] Among them, e u represents the target embedding vector, α l represents the importance coefficient of the l-th order propagation layer, represents the candidate embedding vector of the graph node u of the l-th order propagation layer, represents the candidate embedding vector of the graph node u of the l+1th order propagation layer, represents the candidate embedding vector of the neighbor node i of the graph node u in the l-th order propagation layer, represents the residual embedding vector of the graph node u of the l-th order propagation layer, N i Represents the neighbor nodes of the first-order propagation layer of graph node u, |N u | represents the number of neighbor nodes in the first-order propagation layer of graph node u, |N i | represents the number of neighbor nodes in the first-order propagation layer of graph node i.
[0029] The graph convolution recommendation method based on the adaptive framework, wherein the training of the recommendation model based on the target embedding vector of each graph node specifically includes:
[0030] For each user graph node of the graph structure data, extract the target embedding vector of the user graph node and the target embedding vector of each item graph node;
[0031] The inner product of the target embedding vector of the user graph node and the target embedding vector of each item node is calculated to obtain the predicted interaction score of each user graph node and each item node, and the recommendation model is trained based on the obtained predicted interaction score.
[0032] In the graph convolution recommendation method based on the adaptive framework, the step of determining the interaction probability between the user to be recommended and each candidate item based on the trained recommendation model specifically includes:
[0033] Obtaining a user to be recommended and a set of candidate items corresponding to the user to be recommended;
[0034] The user to be recommended and the candidate item set are input into the trained recommendation model, the interaction probability between the user and each candidate item is input into the recommendation model, and a recommended item list corresponding to the user to be recommended is determined based on the interaction probability of each candidate item.
[0035] A second aspect of an embodiment of the present application provides a graph convolution recommendation system based on an adaptive framework, the recommendation system comprising:
[0036] A construction module is used to construct graph structure data of the interaction relationship between users and items based on the user historical interaction dataset;
[0037] An acquisition module, used to acquire the number of neighbor nodes of a preset order of each graph node in the graph structure data;
[0038] A first search module is used to search the neighbor nodes of the graph node in a breadth-first manner and aggregate them to obtain a target embedding vector corresponding to the graph node when the number of neighbor nodes of a preset order of the graph node is greater than or equal to a preset threshold;
[0039] A second search module is used for searching the neighbor nodes of the graph node in a depth-first manner and aggregating them to obtain a target embedding vector corresponding to the graph node when the number of neighbor nodes of a preset order of the graph node is less than a preset threshold, wherein the number of propagation layers corresponding to the graph node searched in the depth-first manner is greater than the number of propagation layers corresponding to the graph node searched in the breadth-first manner;
[0040] The recommendation module is used to train the recommendation model based on the target embedding vector of each graph node, and determine the interaction probability between the user to be recommended and each candidate item based on the trained recommendation model.
[0041] A third aspect of an embodiment of the present application provides a computer-readable storage medium, which stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps in any of the above-described graph convolutional recommendation methods based on an adaptive framework.
[0042] A fourth aspect of the embodiments of the present application provides a terminal device, comprising: a processor, a memory, and a communication bus; the memory stores a computer-readable program that can be executed by the processor;
[0043] The communication bus realizes the connection and communication between the processor and the memory;
[0044] When the processor executes the computer-readable program, the steps in any of the above-described graph convolutional recommendation methods based on an adaptive framework are implemented.
[0045] Beneficial effect: Compared with the prior art, the present application provides a graph convolution recommendation method based on an adaptive framework, the method comprising: constructing graph structure data of the interaction relationship between users and items based on a user historical interaction data set; obtaining the number of preset-order neighbor nodes of each graph node in the graph structure data; when the number of preset-order neighbor nodes of a graph node is greater than or equal to a preset threshold, searching the neighbor nodes of the graph node in a breadth-first manner and aggregating them to obtain a target embedding vector corresponding to the graph node; when the number of preset-order neighbor nodes of a graph node is less than a preset threshold, searching the neighbor nodes of the graph node in a depth-first manner and aggregating them to obtain a target embedding vector corresponding to the graph node; training a recommendation model based on the target embedding vector of each graph node, and determining the interaction probability between the user to be recommended and each candidate item based on the trained recommendation model. The present application distinguishes graph nodes by a preset number of neighbor nodes, and performs a breadth-first search for neighbor nodes for nodes with a degree greater than the preset number of neighbor nodes, and performs a depth-first search for neighbor nodes for nodes with a low degree less than the preset number of neighbor nodes, so that the recommendation model can learn the dominant embedding vectors of different graph nodes, improve the accuracy of the recommendation model's recommendations and improve the generalization effect of the model, thereby improving the accuracy of recommendations. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without inventive work.
[0047] Figure 1 A flowchart of the graph convolution recommendation method based on an adaptive framework provided in this application.
[0048] Figure 2 Schematic diagram of neighbor nodes of different graph nodes when the aggregation level in graph structure data is 2. Figure 3 A schematic diagram of adaptive neighbor nodes in the graph convolution recommendation method based on an adaptive framework provided in this application.
[0049] Figure 4 A schematic diagram of determining neighbor nodes by resampling in the graph convolution recommendation method based on an adaptive framework provided in this application.
[0050] Figure 5 A schematic diagram of residual aggregation in the graph convolutional recommendation method based on an adaptive framework provided in this application.
[0051] Figure 6 Structural principle diagram of the graph convolutional recommendation system based on the adaptive framework provided in this application.
[0052] Figure 7 This is a schematic diagram of the structure of the terminal device provided in this application. DETAILED DESCRIPTION
[0053] The present application provides a graph convolution recommendation method based on an adaptive framework and a related device. In order to make the purpose, technical solution and effect of the present application clearer and more specific, the present application is further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described here are only used to explain the present application and are not used to limit the present application.
[0054] It will be understood by those skilled in the art that, unless expressly stated, the singular forms "one", "said", and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present application refers to the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof. It should be understood that when we refer to an element as being "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may be an intermediate element. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein includes all or any unit and all combinations of one or more associated listed items.
[0055] It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as those generally understood by those skilled in the art to which this application belongs. It should also be understood that terms such as those defined in general dictionaries should be understood to have meanings consistent with those in the context of the prior art, and will not be interpreted with idealized or overly formal meanings unless specifically defined as here.
[0056] It should be understood that the sequence numbers and sizes of the steps in this embodiment do not mean the order of execution. The execution order of each process is determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present application.
[0057] After research, the inventors found that the current existing recommendation methods generally encode the features of the user side and the item side (for example, the items purchased by the user, the stores visited, the keywords searched, the classification and tags of the items, etc.) into an embedding vector, and then perform combined mining to generate a recommendation list for the user, which can enhance the generalization ability of the recommendation model and improve the accuracy of the recommendation model. However, since the existing recommendation methods lack an explicit encoding process for important collaborative information, and the collaborative information is hidden in the user-item interaction data and contains the behavioral similarities between users or items, the existing recommendation methods cannot learn the Embedding vector containing hidden information. More specifically, the existing recommendation methods mainly encode the ID or attribute to obtain the Embedding vector, and then define the reconstruction loss function based on the user-item collaborative interaction information and perform decoding, wherein the user-item collaborative interaction information is only used at the decoding end and not the encoding end. This will result in the recommendation model learning that the embedding vectors of users or items do not contain enough information. In order to better recommend items that users may be interested in, the model can only rely on complex collaborative interaction functions to make up for the shortcomings of suboptimal embedding vectors in result recommendations, which leads to increasingly complex recommendation models and poor recommendation effects.
[0058] In order to solve the above problems, graph neural networks are applied to recommendation methods. In the recommendation method using graph neural networks, users and items are regarded as points. When users and items have interactive behaviors (such as purchase, collection, click, etc.), an edge can be connected between users and items to form a bipartite graph of the "user-item" interactive relationship. Then, the neighbor node information is aggregated to the target node through the graph convolutional neural network, and the embedding containing the collaborative interaction information is learned at the encoding end to complete the end-to-end learning mode. In this way, the ID-like features of users or items can be turned into graph nodes through the graph neural network, and high-order neighbor information can be learned through information transmission between graph nodes, which makes up for the shortcoming that the existing recommendation method cannot learn the interactive information at the encoding end. In addition, the graph neural network can not only use the information of the current user and item itself, but also integrate the collaborative interaction information of users and items, which greatly enriches the available information, helps the model learn more complex interactive information, and improves the recommendation accuracy of the model.
[0059] Existing graph convolution recommendation methods based on bipartite graphs generally model and learn the embedding vector representation of the target node based on the entire data set. When aggregating information on the target node, the neighbor nodes of the candidate domain are all neighbor nodes of the target node. However, in existing graph convolution recommendation methods based on bipartite graphs, high-degree nodes play a dominant role in representation learning, which will cause the recommendation model to be unable to distinguish the huge difference in interactive information between high-degree nodes and low-degree nodes, resulting in long-tail problems and poor generalization, thereby affecting the recommendation accuracy of the recommendation method.
[0060] Based on this, in an embodiment of the present application, a graph structure data of the interaction relationship between users and items is constructed based on a user historical interaction data set; the preset order neighbor node number of each graph node in the graph structure data is obtained; when the preset order neighbor node number of a graph node is greater than or equal to a preset threshold, the neighbor nodes of the graph node are searched in a breadth-first manner and aggregated to obtain the target embedding vector corresponding to the graph node; when the preset order neighbor node number of a graph node is less than a preset threshold, the neighbor nodes of the graph node are searched in a depth-first manner and aggregated to obtain the target embedding vector corresponding to the graph node; the recommendation model is trained based on the target embedding vector of each graph node, and the interaction probability between the user to be recommended and each candidate item is determined based on the trained recommendation model. The present application distinguishes graph nodes by the preset order neighbor node number, and performs a breadth-first search for neighbor nodes for high-degree nodes greater than the preset order neighbor node number, and performs a depth-first search for neighbor nodes for low-degree nodes less than the preset order neighbor node number, so that the recommendation model can learn the dominant embedding vectors of different graph nodes, improve the recommendation accuracy of the recommendation model, and improve the generalization effect of the model, thereby improving the recommendation accuracy.
[0061] The application content is further explained below through the description of embodiments in conjunction with the accompanying drawings.
[0062] This embodiment provides a graph convolution recommendation method based on an adaptive framework, such as Figure 1 As shown, the method includes:
[0063] S10. Construct graph structure data of the interaction relationship between users and items based on the user historical interaction dataset.
[0064] Specifically, the user history interaction dataset is a user-item interaction dataset, such as Movielens-20M movie dataset, Book-Crossing book dataset, Last.FM music dataset, etc. The graph structure data is a bipartite graph of the "user-item" interaction relationship constructed based on whether the user interacts with the item. The users and items in the user history interaction dataset are graph nodes of the graph structure data, and the interaction relationship between the user and the item is the edge of the graph structure data. When there is an edge between the user and the item, it means that the user and the item have interacted. Conversely, when there is no edge between the user and the item, it means that the user and the item have not interacted. In addition, after constructing the bipartite graph of the "user-item" interaction relationship, the "user-user" and "item-item" subgraph information can be constructed through the interaction relationship in the bipartite graph of the "user-item" interaction relationship, and the "user-user" and "item-item" subgraph information can be supplemented to the information aggregation of the bipartite graph, which can avoid the problem of less interaction information of the long-tail nodes in the bipartite graph, thereby improving the recommendation accuracy of the recommendation model obtained by training, thereby improving the recommendation accuracy of the recommendation method.
[0065] S20. Obtain the number of preset-order neighbor nodes of each graph node in the graph structure data.
[0066] Specifically, the preset number of neighbor nodes is the total number of all neighbor nodes included in the preset number of propagation layers, where the preset number of propagation layers is a pre-set number of aggregation layers experienced by the aggregated neighbor nodes. For example, when the preset number of propagation layers is 2, the preset number of neighbor nodes is the total number of neighbor nodes included in the first-order propagation layer and the second-order propagation layer. In graph structure data, since the neighbor nodes corresponding to different graph nodes under the same preset number of propagation layers may be different, for example, when the preset number of propagation layers is 2, Figure 2 The number of neighbor nodes corresponding to the graph node u1 in is 11. Figure 2 The neighbor node of graph node u2 is 3.
[0067] S30. When the number of neighbor nodes of a graph node of a preset order is greater than or equal to a preset threshold, the neighbor nodes of the graph node are searched in a breadth-first manner and aggregated to obtain a target embedding vector corresponding to the graph node.
[0068] Specifically, the preset threshold is pre-set and is used as a basis for determining whether a beam graph node is a high-degree node or a low-degree node, wherein when the number of preset-order neighbor nodes of a graph node is greater than or equal to the preset threshold, it indicates that the graph node is a high-degree node, and conversely, when the number of preset-order neighbor nodes of a graph node is less than the preset threshold, it indicates that the graph node is a low-degree node. This is because in the graph structure data, since the neighbor nodes corresponding to different graph nodes at the same preset-order propagation layer may be different, the preset-order neighbor nodes corresponding to some graph nodes in the graph structure data may be greater than or equal to the preset threshold, while some preset-order neighbor nodes may be less than the preset threshold, and thus the graph nodes in the graph structure data may be divided into high-degree nodes and low-degree nodes by setting the preset threshold. For example, assuming that the preset-order propagation layer is 2, and the preset threshold is 8, Figure 2 The number of preset-order neighbor nodes k1 corresponding to the graph node u1 in is 11. Figure 2 The number of preset-order neighbor nodes k2 of the graph node u2 is 3, the number of preset-order neighbor nodes corresponding to the graph node u1 is 11>8, the graph node u1 is a high-degree node, the number of preset-order neighbor nodes corresponding to the graph node u2 is 3<8, and the graph node u2 is a low-degree node.
[0069] In addition, this embodiment divides the graph nodes into high-degree nodes and low-degree nodes by a preset threshold, and then subsequently uses different search and aggregation methods for high-degree nodes and low-degree nodes, so that each graph node can receive a preset number of neighbor node information, for example, Figure 3 As shown in the figure, the number of neighbor nodes k searched by graph node u1 and graph node u2 is 11. This can avoid the problem that low-degree nodes can receive less propagation information due to the small number of neighbor nodes they can receive, thereby solving the problem of poor recommendation effect due to insufficient embedding information of low-degree nodes.
[0070] In a typical implementation, the preset threshold can be determined based on the preset number of neighbor nodes required by the graph node when aggregating neighborhood information, wherein the preset number of neighbor nodes is greater than the required number of neighbor nodes, for example, the preset number of neighbor nodes is twice the required number of neighbor nodes, that is, when the preset number of neighbor nodes is greater than or equal to twice the required number of neighbor nodes, the graph node is a high-degree node, conversely, when the preset number of neighbor nodes is less than twice the required number of neighbor nodes, the graph node is a low-degree node.
[0071] When the number of neighbor nodes of a graph node at a preset order is greater than or equal to a preset threshold, it means that the graph node can obtain the neighbor nodes required by the graph node by searching a small number of propagation layers. However, the neighbor nodes in the same propagation layer have a high similarity, which makes the graph node aggregate more neighbor nodes with high similarity, which not only wastes computing resources, but also does not improve the performance of the recommendation model. Therefore, for graph nodes whose number of neighbor nodes of a preset order is greater than or equal to the preset threshold, this embodiment searches for neighbor nodes in a breadth-first manner, and then resamples the neighbor nodes in each order of propagation layers to select neighbor nodes. In this way, without increasing computing resources, it is possible to mine the more distant neighbor information of the graph node and reduce the aggregation of neighbor nodes with high similarity, thereby improving the model performance of the recommendation model.
[0072] In a specific implementation, searching the neighbor nodes of the graph node in a breadth-first manner and aggregating to obtain the target embedding vector corresponding to the graph node specifically includes:
[0073] Search all neighbor nodes corresponding to the first propagation layer number of the graph node;
[0074] Randomly sample some neighbor nodes from the neighbor nodes included in the first-order propagation layer, and aggregate the embedding vectors of the sampled neighbor nodes to obtain a first reference embedding vector;
[0075] Randomly sample some neighbor nodes from the neighbor nodes included in the second-order propagation layer number, and aggregate the embedding vectors of the selected part of the neighbor nodes to obtain a second reference embedding vector, and so on until the first propagation layer number to obtain the Nth reference embedding vector corresponding to the first propagation layer number;
[0076] The target embedding vector of the graph node is determined according to all the acquired reference embedding vectors.
[0077] Specifically, the first propagation layer number is the maximum propagation layer number of neighbor nodes required by the graph node when aggregating neighborhood information, that is, when the graph node aggregates neighborhood information, it needs to receive neighbor nodes from the first order to the highest order. In addition, in order to enable graph nodes greater than or equal to the preset threshold to obtain sufficient neighbor nodes, the total number of all neighbor nodes corresponding to the first propagation layer number is greater than the number of neighbor nodes required by the graph node when aggregating neighborhood information, wherein the total number of all neighbor nodes corresponding to the first propagation layer number is equal to the sum of the number of neighbor nodes included in all propagation layers from the first-order propagation layer number, the second-order propagation layer number to the first propagation layer number. In a typical implementation of this embodiment, the first propagation layer number is 3. When the first propagation layer number is 3, the recommendation model can have a better recommendation effect. Of course, in practical applications, the first propagation layer number can be determined according to actual conditions, for example, 2, 4, etc.
[0078] The partial neighbor nodes sampled by the first-order propagation layer, the partial neighbor nodes sampled by the second-order propagation layer, until the total number of partial neighbor nodes sampled by the first propagation layer is equal to the number of neighbor nodes required by the graph node when aggregating neighborhood information, wherein the number of partial neighbor nodes sampled by each order propagation layer is less than the required number of neighbor nodes. For example, the number of neighbor nodes required by the graph node when aggregating neighborhood information is k, the partial neighbor nodes sampled by the first-order propagation layer is s1, the partial neighbor nodes sampled by the second-order propagation layer is s2, ..., the partial neighbor nodes sampled by the first propagation layer is sl, then s1+s2+...+sl=k, wherein s1, s2, ..., sl are all less than k and greater than 0.
[0079] In one implementation, among the neighbor nodes included in each order of propagation layers, some neighbor nodes are randomly selected, and the embedding vectors of the selected neighbor nodes are aggregated with the embedding vectors of the graph nodes. The number of selected neighbor nodes corresponding to each order of propagation layers can be preset, or can be determined based on the comparison value between the number of neighbor nodes included in each order of propagation layers and the total number of neighbor nodes included in all orders of propagation layers and the required number of neighbor nodes. In addition, in practical applications, since there may be neighbor nodes of the same type among the neighbor nodes included in each order of propagation layers, when randomly selecting some neighbor nodes, they can be randomly selected according to the type of the neighbor nodes, that is, some neighbor nodes are randomly selected from the neighbor nodes included in each type. For example, Figure 4 The graph node u1 shown corresponds to the first-order propagation layer including neighbor nodes i1, i2, i3 and i4, where i1 and i2 are of the same type, i3 and i4 are of the same type, then one neighbor node can be selected from i1 and i2, and one neighbor node can be selected from i3 and i4.
[0080] For example: Figure 4 For the graph node u1 shown in the figure, the first-order propagation layers include i1, i2, i3 and i4, i1 and i2 are item nodes of the same type, and nodes i3 and i4 are item nodes of the same type. When aggregating neighbor nodes in the first-order propagation layer, first randomly sample some first-order nodes i1 and i3 of the graph node u1 as neighbor nodes of the graph node u1 to perform information aggregation and propagation to obtain the first embedding vector; when aggregating neighbor node information for the second time, mark the nodes sampled in the first information aggregation, select some neighbor nodes from the neighbor nodes included in the second-order propagation layer of the graph node u1 for aggregation to obtain the second embedding vector, and then generate the target embedding vector of the graph node u1 through sumpooling, where the number of neighbor nodes sampled for the first time is The number of neighbor nodes sampled for the second time is So And 2k must be smaller than the total number of second-order neighbor nodes S2 of the graph node u1, and k is the number of neighbor nodes required by the graph node u1 when aggregating neighborhood information.
[0081] In a specific implementation, e i and e u are the initial embedding vectors of item graph node i and user graph node u respectively. For each "user (u)-item (i)" interaction relationship pair in the graph structure data, the information paradigm transmitted from the item to the user is:
[0082] m i→u =f(e i ,e u ,p ui )
[0083] Among them, p ui Controls the attenuation coefficient of propagation on the edge (u, i), and its expression is:
[0084]
[0085] Among them, N u and N i They represent the number of first-order neighbors of the target node when u and i are the target nodes respectively.
[0086] The information propagation between each layer can be expressed as follows:
[0087]
[0088]
[0089] in, Represents the embedding vector representation of the current layer graph node u, Represents the embedding vector representation of the next layer of graph node u.
[0090] Therefore, the target embedding vectors of the graph nodes, which are item graph nodes and user graph nodes, are respectively:
[0091]
[0092]
[0093] Among them, e u represents the target embedding vector of the user graph node, α l represents the importance coefficient of the l-th order propagation layer, represents the embedding vector of user graph node u in the l-th order propagation layer, e irepresents the target embedding vector of the item graph node, α l represents the importance coefficient of the l-th order propagation layer, represents the embedding vector of the item graph node u in the l-th order propagation layer. In addition, it is worth noting that the neighbor nodes of the user graph node are the item graph nodes, and the neighbor nodes of the item graph node are the user graph nodes.
[0094] S40: When the number of neighbor nodes of a graph node of a preset order is less than a preset threshold, the neighbor nodes of the graph node are searched in a depth-first manner and aggregated to obtain a target embedding vector corresponding to the graph node.
[0095] Specifically, when the number of preset-order neighbor nodes of a graph node is less than a preset threshold, it means that the graph node is a low-degree node. In other words, the number of neighbor nodes that the graph node can search for at each order of propagation layer is small. At this time, in order to avoid the low-degree nodes being able to receive less propagation information, which results in insufficient embedded vector information of the low-degree nodes, the present embodiment searches the neighbor nodes of the graph node in a depth-first manner, and uses a depth-first manner to search along the interactive edges between the graph nodes to a higher order depth until the number of searched neighbor nodes is equal to the preset number, and then stops the search. The number of search layers is the number of layers of high-order neighborhood node information of the low-degree nodes, so that the low-degree nodes can search for sufficient neighbor nodes so that they can receive sufficient propagation information.
[0096] For the graph convolution aggregation method, when there are too many high-order neighborhood layers that need to be aggregated, an over-smooth problem will occur. The over-smooth problem means that during the training process of the graph neural network, as the number of network layers increases and the number of iterations increases, the hidden layer representation of each node in the same connection will tend to converge to the same value (that is, the same position in space), and the embedding information of each node will tend to the same value, making it impossible to distinguish nodes of different categories.
[0097] Based on this, in one implementation, a residual embedding vector is introduced, and on the basis of first-order aggregation of the target node, the sum path of even-order neighbors is added to realize the residual aggregation operation, for example, Figure 5 As shown, the solid arrow is the first-order aggregation path, and the dotted arrow is the residual aggregation path. In this way, by increasing the residual aggregation, the role of high-order neighborhood information in the representation learning of the target node can be enhanced, so that the target node can learn more complete neighborhood information in the representation learning process, and make up for the loss of the graph convolution method in the process of high-order neighbor information transmission. Correspondingly, when the number of preset-order neighbor nodes of a graph node is less than a preset threshold, obtaining the neighbor nodes of the graph node and aggregating them to obtain the target embedding vector corresponding to the graph node specifically includes:
[0098] When the number of neighbor nodes of a preset order of a graph node is less than a preset threshold, searching for all neighbor nodes corresponding to a second propagation layer number of the graph node, wherein the second propagation layer number is greater than the first propagation layer number;
[0099] Aggregate the searched neighbor nodes to obtain the candidate embedding vector of the target node corresponding to the graph node, and aggregate the searched neighbor nodes of even layers to obtain the residual embedding vector;
[0100] A target embedding vector corresponding to the graph node is determined based on the candidate embedding vector and the residual embedding vector.
[0101] Specifically, the second number of propagation layers is the maximum number of propagation layers of neighbor nodes required by the graph node when aggregating neighborhood information, that is, when the graph node aggregates neighborhood information, it needs to receive neighbor nodes from the first order to the highest order. Among them, the total number of all neighbor nodes corresponding to the second number of propagation layers can be greater than or equal to the number of neighbor nodes required by the graph node when aggregating neighborhood information, so that low-degree nodes can obtain a preset number of neighbor nodes, wherein the preset number is the number of neighbor nodes required when aggregating neighborhood information; wherein, the total number of all neighbor nodes corresponding to the first number of propagation layers is equal to the sum of the number of neighbor nodes contained in all propagation layers from the first-order propagation layer number to the second-order propagation layer number up to the first propagation layer number.
[0102] In addition, the inventors have found that when the number of second propagation layers corresponding to low-degree nodes reaches a certain level, the increase in the number of second propagation layers will reduce the recommendation of low-degree nodes. This is because although the number of second propagation layers increases, the recommendation model can enhance the generalization of low-degree node learning and explore more items that the target node may be interested in, but the excessive number of exploration layers will also increase the noise, affecting the stability of the recommendation effect. Therefore, while enabling low-degree nodes to search for sufficient neighbor nodes, it is also necessary to limit the number of second propagation layers to ensure the recommendation effect of the recommendation model on low-degree nodes. In a typical implementation, the number of second propagation layers is 6. When the number of second propagation layers is 6, the recommendation model can have a better recommendation effect. Of course, in actual applications, when the number of second propagation layers is 6, the number of neighbor nodes searched can be less than or equal to the preset number, or greater than the preset number. When it is greater than the preset number, the searched neighbor nodes can also be selected and aggregated by resampling to aggregate the preset number of neighbor nodes.
[0103] In one implementation of this embodiment, e i and e u are the initial embedding vectors of item graph node i and user graph node u respectively. The residual embedding vectors corresponding to item graph node and user graph node are expressed as:
[0104]
[0105]
[0106] Correspondingly, the target embedding vectors corresponding to the item graph nodes and user graph nodes are expressed as:
[0107]
[0108]
[0109] Among them, α l is the importance coefficient of each layer, which is an adjustable hyperparameter. In practical applications,
[0110] S50: training a recommendation model based on the target embedding vector of each graph node, and determining the interaction probability between the user to be recommended and each candidate item based on the trained recommendation model.
[0111] Specifically, when training the recommendation model based on the target embedding vector of each graph node, the internal machine can be used to determine the predicted score of each user graph node corresponding to the item graph node, and then the recommendation model is trained based on the prediction. In one implementation, the training of the recommendation model based on the target embedding vector of each graph node specifically includes:
[0112] For each user graph node of the graph structure data, extract the target embedding vector of the user graph node and the target embedding vector of each item graph node;
[0113] The inner product of the target embedding vector of the user graph node and the target embedding vector of each item node is calculated to obtain the predicted interaction score of each user graph node and each item node, and the recommendation model is trained based on the obtained predicted interaction score.
[0114] Specifically, the calculation formula for the predicted interaction score can be: in, is the transpose of the target embedding vector of the user graph node, e i is the target embedding vector of the item graph node. After obtaining the predicted interaction score, the BPR loss function can be used to train the model. The expression of the BPR loss function is:
[0115]
[0116] Among them, N u is the neighbor node of the neighbor node of the target node, is the positive sample score, is the score of the negative sample of unobserved data, λ is the regularization coefficient, ||E(0) || 2 is the regularization term.
[0117] In an implementation of this embodiment, determining the interaction probability between the user to be recommended and each candidate item based on the trained recommendation model specifically includes:
[0118] Obtaining a user to be recommended and a set of candidate items corresponding to the user to be recommended;
[0119] The user to be recommended and the candidate item set are input into the trained recommendation model, the interaction probability between the user and each candidate item is input into the recommendation model, and a recommended item list corresponding to the user to be recommended is determined based on the interaction probability of each candidate item.
[0120] Specifically, the recommended item list is included in the candidate item set, that is, each recommended item in the recommended item list is included in the candidate item set. The interaction probability is the probability that the user to be recommended selects the candidate item, wherein the higher the interaction probability, the higher the probability that the user to be recommended selects the candidate item, and conversely, the lower the interaction probability, the lower the probability that the user to be recommended selects the candidate item. Therefore, after obtaining the interaction probability corresponding to each candidate item, each interaction probability can be compared with a preset probability threshold to select the candidate item with an interaction probability greater than the preset probability threshold and add it to the recommended item list, so as to obtain the recommended item list corresponding to the user to be recommended.
[0121] In summary, this embodiment provides a graph convolution recommendation method based on an adaptive framework, the method comprising: constructing graph structure data of the interaction relationship between users and items based on a user historical interaction data set; obtaining the preset order neighbor node number of each graph node in the graph structure data; when the preset order neighbor node number of the graph node is greater than or equal to the preset threshold, using a breadth-first method to search the neighbor nodes of the graph node and aggregate to obtain the target embedding vector corresponding to the graph node; when the preset order neighbor node number of the graph node is less than the preset threshold, using a depth-first method to search the neighbor nodes of the graph node and aggregate to obtain the target embedding vector corresponding to the graph node; training the recommendation model based on the target embedding vector of each graph node, and determining the interaction probability between the user to be recommended and each candidate item based on the trained recommendation model. The present application distinguishes graph nodes by the preset order neighbor node number, and performs a breadth-first search for neighbor nodes for high-degree nodes greater than the preset order neighbor node number, and performs a depth-first search for neighbor nodes for low-degree nodes less than the preset order neighbor node number, so that the recommendation model can learn the dominant embedding vectors of different graph nodes, improve the recommendation accuracy of the recommendation model, and improve the generalization effect of the model, thereby improving the recommendation accuracy.
[0122] Based on the above-mentioned graph convolution recommendation method based on an adaptive framework, this embodiment provides a graph convolution recommendation system based on an adaptive framework, such as Figure 6 As shown, the recommendation system includes:
[0123] A construction module 100 is used to construct graph structure data of the interaction relationship between users and items based on the user historical interaction data set;
[0124] An acquisition module 200 is used to acquire the number of neighbor nodes of a preset order of each graph node in the graph structure data;
[0125] A first search module 300 is used to search the neighbor nodes of the graph node in a breadth-first manner and aggregate them to obtain a target embedding vector corresponding to the graph node when the number of neighbor nodes of a preset order of the graph node is greater than or equal to a preset threshold;
[0126] A second search module 400 is used for searching the neighbor nodes of the graph node in a depth-first manner and aggregating them to obtain a target embedding vector corresponding to the graph node when the number of neighbor nodes of a preset order of the graph node is less than a preset threshold, wherein the number of propagation layers corresponding to the graph node searched in the depth-first manner is greater than the number of propagation layers corresponding to the graph node searched in the breadth-first manner;
[0127] The recommendation module 500 is used to train the recommendation model based on the target embedding vector of each graph node, and determine the interaction probability between the user to be recommended and each candidate item based on the trained recommendation model.
[0128] Based on the above-mentioned graph convolution recommendation method based on an adaptive framework, this embodiment provides a computer-readable storage medium, which stores one or more programs. The one or more programs can be executed by one or more processors to implement the steps in the graph convolution recommendation method based on an adaptive framework as described in the above embodiment.
[0129] Based on the above-mentioned graph convolution recommendation method based on the adaptive framework, the present application also provides a terminal device, such as Figure 7 As shown, it includes at least one processor (processor) 20; display screen 21; and memory (memory) 22, and may also include a communications interface (Communications Interface) 23 and a bus 24. Among them, the processor 20, the display screen 21, the memory 22 and the communication interface 23 can communicate with each other through the bus 24. The display screen 21 is configured to display a preset user guide interface in the initial setting mode. The communication interface 23 can transmit information. The processor 20 can call the logic instructions in the memory 22 to execute the method in the above embodiment.
[0130] In addition, the logic instructions in the memory 22 can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product.
[0131] The memory 22 is a computer-readable storage medium that can be configured to store software programs, computer executable programs, such as program instructions or modules corresponding to the methods in the embodiments of the present disclosure. The processor 20 executes functional applications and data processing by running the software programs, instructions or modules stored in the memory 22, that is, implementing the methods in the above embodiments.
[0132] The memory 22 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required for a function; the data storage area may store data created according to the use of the terminal device, etc. In addition, the memory 22 may include a high-speed random access memory and may also include a non-volatile memory. For example, a variety of media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, may also be a transient storage medium.
[0133] In addition, the specific process of loading and executing the multiple instruction processors in the above-mentioned storage medium and the terminal device has been described in detail in the above-mentioned method, and will not be described one by one here.
[0134] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A graph convolution recommendation method based on an adaptive framework, characterized in that: The method includes: Construct graph structure data of the interaction relationship between users and items based on the user historical interaction dataset; Obtaining the number of neighbor nodes of a preset order for each graph node in the graph structure data; When the number of neighbor nodes of a graph node of a preset order is greater than or equal to a preset threshold, the neighbor nodes of the graph node are searched in a breadth-first manner and aggregated to obtain a target embedding vector corresponding to the graph node; When the number of neighbor nodes of a preset order of a graph node is less than a preset threshold, the neighbor nodes of the graph node are searched in a depth-first manner and aggregated to obtain a target embedding vector corresponding to the graph node, wherein the number of propagation layers corresponding to the graph node searched in a depth-first manner is greater than the number of propagation layers corresponding to the graph node searched in a breadth-first manner; The recommendation model is trained based on the target embedding vector of each graph node, and the interaction probability between the recommended user and each candidate item is determined based on the trained recommendation model.
2. The graph convolution recommendation method based on the adaptive framework according to claim 1, characterized in that: The step of searching the neighbor nodes of the graph node in a breadth-first manner and aggregating the neighbor nodes to obtain the target embedding vector corresponding to the graph node specifically includes: Search all neighbor nodes corresponding to the first propagation layer number of the graph node; Randomly sample some neighbor nodes from the neighbor nodes included in the first-order propagation layer, and aggregate the embedding vectors of the sampled neighbor nodes to obtain a first reference embedding vector; Randomly sample some neighbor nodes from the neighbor nodes included in the second-order propagation layer number, and aggregate the embedding vectors of the selected part of the neighbor nodes to obtain a second reference embedding vector, and so on until the first propagation layer number to obtain the Nth reference embedding vector corresponding to the first propagation layer number; The target embedding vector of the graph node is determined according to all the acquired reference embedding vectors.
3. The graph convolution recommendation method based on the adaptive framework according to claim 2, characterized in that: The target embedding vector corresponding to the graph node is: Among them, e u represents the target embedding vector, α l represents the importance coefficient of the l-th order propagation layer, represents the embedding vector of the graph node u of the l-th order propagation layer, represents the embedding vector of the graph node u of the l+1th order propagation layer, represents the embedding vector of the neighbor node i of the graph node u in the l-th order propagation layer, N i Represents the neighbor nodes of the first-order propagation layer of graph node u, |N u | represents the number of neighbor nodes in the first-order propagation layer of graph node u, |N i | represents the number of neighbor nodes in the first-order propagation layer of graph node i.
4. According to the graph convolution recommendation method based on the adaptive framework according to claim 1, it is characterized in that: When the number of neighbor nodes of the preset order of the graph node is less than a preset threshold, acquiring the neighbor nodes of the graph node and aggregating them to obtain the target embedding vector corresponding to the graph node specifically includes: When the number of neighbor nodes of a preset order of a graph node is less than a preset threshold, searching for all neighbor nodes corresponding to a second propagation layer number of the graph node, wherein the second propagation layer number is greater than the first propagation layer number; Aggregate the searched neighbor nodes to obtain the candidate embedding vector of the target node corresponding to the graph node, and aggregate the searched neighbor nodes of even layers to obtain the residual embedding vector; A target embedding vector corresponding to the graph node is determined based on the candidate embedding vector and the residual embedding vector.
5. The graph convolution recommendation method based on the adaptive framework according to claim 4, characterized in that: The target embedding vector is: Among them, e u represents the target embedding vector, α l represents the importance coefficient of the l-th order propagation layer, represents the candidate embedding vector of the graph node u of the l-th order propagation layer, represents the candidate embedding vector of the graph node u of the l+1th order propagation layer, represents the candidate embedding vector of the neighbor node i of the graph node u in the l-th order propagation layer, represents the residual embedding vector of the graph node u of the l-th order propagation layer, N i Represents the neighbor nodes of the first-order propagation layer of graph node u, |N u | represents the number of neighbor nodes in the first-order propagation layer of graph node u, |N i | represents the number of neighbor nodes in the first-order propagation layer of graph node i.
6. The graph convolution recommendation method based on an adaptive framework according to claim 1, characterized in that: The training of the recommendation model based on the target embedding vector of each graph node specifically includes: For each user graph node of the graph structure data, extract the target embedding vector of the user graph node and the target embedding vector of each item graph node; The inner product of the target embedding vector of the user graph node and the target embedding vector of each item node is calculated to obtain the predicted interaction score of each user graph node and each item node, and the recommendation model is trained based on the obtained predicted interaction score.
7. The graph convolution recommendation method based on an adaptive framework according to claim 1, characterized in that: The determining the interaction probability between the to-be-recommended user and each candidate item based on the trained recommendation model specifically includes: Obtaining a user to be recommended and a set of candidate items corresponding to the user to be recommended; The user to be recommended and the candidate item set are input into the trained recommendation model, the interaction probability between the user and each candidate item is input into the recommendation model, and a recommended item list corresponding to the user to be recommended is determined based on the interaction probability of each candidate item.
8. A graph convolutional recommendation system based on an adaptive framework, characterized in that: The recommendation system comprises: A construction module is used to construct graph structure data of the interaction relationship between users and items based on the user historical interaction dataset; An acquisition module, used to acquire the number of neighbor nodes of a preset order of each graph node in the graph structure data; A first search module is used to search the neighbor nodes of the graph node in a breadth-first manner and aggregate them to obtain a target embedding vector corresponding to the graph node when the number of neighbor nodes of a preset order of the graph node is greater than or equal to a preset threshold; A second search module is used for searching the neighbor nodes of the graph node in a depth-first manner and aggregating them to obtain a target embedding vector corresponding to the graph node when the number of neighbor nodes of a preset order of the graph node is less than a preset threshold, wherein the number of propagation layers corresponding to the graph node searched in the depth-first manner is greater than the number of propagation layers corresponding to the graph node searched in the breadth-first manner; The recommendation module is used to train the recommendation model based on the target embedding vector of each graph node, and determine the interaction probability between the user to be recommended and each candidate item based on the trained recommendation model.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps in the graph convolution recommendation method based on an adaptive framework as described in any one of claims 1-7.
10. A terminal device, characterized in that: include: Processor, memory and communication bus; The memory stores a computer-readable program executable by the processor; The communication bus realizes the connection and communication between the processor and the memory; When the processor executes the computer-readable program, the steps in the graph convolution recommendation method based on the adaptive framework as described in any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Construction method of universal embedding framework of multi-semantic heterogeneous graph
CN112989842A
Neighborhood exploration method based on heterogeneous graph neural network
CN112990431A