Item recommendation method based on network graph

By constructing a target network graph and training a scoring model, combined with a multiple relationship graph between users and items, the problem of insufficient data mining in existing recommendation algorithms is solved, more accurate item recommendations are achieved, and the user experience is improved.

CN117216383BActive Publication Date: 2025-09-09UNIV OF ELECTRONICS SCI & TECH OF CHINA +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311100927.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-29
Publication Date
2025-09-09
Estimated Expiration
2043-08-29

AI Technical Summary

Technical Problem

Existing recommendation algorithms based on graph neural networks do not fully mine data when mining the interaction between users and items, resulting in poor recommendation results and recommended items that do not meet user interests.

Method used

By constructing a target network diagram, including an interaction relationship diagram, a user relationship diagram, and an item relationship diagram, the target scoring model is trained. By combining user association information and data of items to be used, the user's scoring attributes for each item to be recommended are generated, and the target recommended items are determined based on the scoring attributes.

Benefits of technology

The precision and accuracy of the recommendation model are improved, making the recommended items more in line with user interests and enhancing the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117216383B_ABST
    Figure CN117216383B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for recommending items based on a network graph. The method comprises: obtaining data on items to be used corresponding to the user for whom recommended items are to be determined; inputting the user's associated information and the data on items to be used into a pre-trained target scoring model to obtain the user's scoring attributes for each of the items to be recommended; and determining, from the items to be recommended, a target recommended item corresponding to the user. This method solves the problem in the prior art of recommending items by mining the interactive relationship between users and items, which results in poor and inappropriate recommendations. While improving the recommendation effect, it also ensures that the items recommended to the user are of interest, thereby improving the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to an item recommendation method based on a network graph. Background Art

[0002] Currently, recommendation algorithms are commonly used in various business scenarios to match users with items of interest. Existing recommendation algorithms are typically based on graph neural networks, mining the interactions between users and items (such as clicks, transactions, etc.) to identify and recommend items that users are most likely to be interested in.

[0003] However, this recommendation method has the problem of insufficient data mining, which leads to poor recommendation results and the problem that the recommended items are not of interest to the user. Summary of the Invention

[0004] The present invention provides an item recommendation method based on a network graph to improve the recommendation effect, so that the items recommended to users are of interest to the users, thereby achieving the technical effect of improving user experience.

[0005] According to one aspect of the present invention, a method for recommending items based on a network graph is provided, the method comprising:

[0006] Acquire data of items to be used corresponding to the user for whom recommended items are to be determined; wherein the data of items to be used includes a plurality of items to be recommended;

[0007] Inputting the user's association information and the data of the items to be used into a pre-trained target scoring model to obtain the user's scoring attributes for each of the items to be recommended; wherein the target scoring model is trained based on a target network graph; the target network graph includes an interaction relationship graph representing the interaction relationship between users and items, a user relationship graph representing the similarity relationship between users, and an item relationship graph representing the similarity relationship between items;

[0008] Based on all the scoring attributes, a target recommended item corresponding to the user is determined from the items to be recommended.

[0009] The technical solution of the embodiment of the present invention obtains the data of items to be used corresponding to the user of the item to be recommended; the data of items to be used includes multiple items to be recommended; the user's associated information and the data of items to be used are input into a pre-trained target scoring model to obtain the user's scoring attributes for each item to be recommended; the target scoring model is trained based on the target network graph; the target network graph includes an interaction relationship graph representing the interaction relationship between users and items, a user relationship graph representing the similarity relationship between users, and an item relationship graph representing the similarity relationship between items; based on all the scoring attributes, the target recommended item corresponding to the user is determined from the items to be recommended, which solves the problem of the existing technology. During the operation, item recommendations were made by mining the interaction relationship between users and items, which resulted in poor recommendation effects and inappropriate recommendations. This was achieved by fully mining the interaction relationship between users and items, the similarity relationship between users, and the similarity relationship between items based on the interaction relationship graph, user relationship graph, and item relationship graph, training a target scoring model to improve the model accuracy. After the user's associated information and the data of the items to be used were input into the pre-trained target scoring model, the model output the user's scoring attributes for each item to be recommended. While improving the scoring accuracy, it also determines the target recommended items that the user is interested in based on the scoring attributes, achieving the technical effect of improving user experience.

[0010] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present invention, nor is it intended to limit the scope of the present invention. Other features of the present invention will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0012] Figure 1 is a flowchart of a method for recommending items based on a network graph according to the first embodiment of the present invention;

[0013] Figure 2 is a flowchart of a method for recommending items based on a network graph according to a second embodiment of the present invention;

[0014] Figure 3 This is a schematic diagram of a recommended method provided according to the second embodiment of the present invention;

[0015] Figure 4 This is a flowchart of a method for recommending items based on a network graph according to the third embodiment of the present invention. DETAILED DESCRIPTION

[0016] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.

[0017] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0018] Example 1

[0019] Figure 1 This is a flowchart of a method for recommending items based on a network graph according to the first embodiment of the present invention. This embodiment is applicable to the case of recommending items to users. The method can be performed by an item recommendation device based on a network graph. The item recommendation device based on a network graph can be implemented in the form of hardware and / or software. The item recommendation device based on a network graph can be configured in a computing device. Figure 1 As shown, the method includes:

[0020] S110: Acquire data of items to be used corresponding to the user for whom recommended items are to be determined.

[0021] The user can be a user for whom an item is to be recommended. The number of users can be one or more. The method of recommending items to each user is the same. The item data to be used includes multiple items to be recommended. For example, the items to be recommended can be books.

[0022] In practical applications, item data can be obtained from the user-item interaction dataset as preparatory data for recommending items to the user to whom the recommendation is to be made, i.e., the item data to be used. For example, the interaction dataset may include transaction information, click-through information, and review information between the interacting user and the interacted item. The user of the item to be recommended may also be included among the interacting users. Alternatively, the user to whom the recommendation is to be made can be selected from the user-item interaction dataset, and the item data in the interaction dataset can be used as the item data to be used corresponding to the user to whom the recommendation is to be made. Alternatively, item data that meets preset selection criteria can be selected from the interaction dataset as the item data to be used.

[0023] S120: Input the user's associated information and the data of the items to be used into a pre-trained target rating model to obtain the user's rating attributes for each item to be recommended.

[0024] The associated information may include user IDs, reading habits, interest tags, and data on items with which interactions occur. The target scoring model is trained based on a target network graph, which includes an interaction graph representing interactions between users and items, a user graph representing similarity relationships between users, and an item graph representing similarity relationships between items. The target scoring model includes a graph attention network module based on the user graph and the item graph, and a graph convolutional neural network module based on the interaction graph. The interaction graph includes a first node and a first edge formed by connecting the first node. The first node represents an item or user, and the weight of the first edge is determined based on the user's interaction information with the item. The user graph includes a second node and a second edge formed by connecting the second node. The second node represents a user, and the weight of the second edge is determined based on the interaction information between the two users belonging to the second node and the corresponding item. The item graph includes a third node and a third edge formed by connecting the third node. The third node represents an item, and the weight of the third edge is determined based on the interaction information between the same user and the two items belonging to the third node and the corresponding item. The interaction information may be rating information. For example, a higher rating information indicates a higher degree of user preference for the item.

[0025] In this embodiment, the user's associated information and the data of the items to be used can be input into a pre-trained target scoring model. The user vector of the user is determined based on the graph attention network module in the target scoring model. The item vector of each item to be recommended is determined based on the graph attention network module in the target scoring model. The user vector of the user and the item vector of each item to be recommended are determined based on the graph convolutional neural network module in the target scoring model. The two user vectors corresponding to the determined user are fused, such as concatenated, to obtain a target user vector corresponding to the user. The two item vectors corresponding to the same item to be recommended are fused to obtain a target item vector corresponding to the item to be recommended. Based on the target user vector and the target item vectors corresponding to all items to be recommended, the user's rating attribute for each item to be recommended is determined. For example, the inner product of the target vectors of the user and the item is performed to obtain the user's rating value for the item as the rating attribute.

[0026] It should be noted that in the technical solution of this application, the acquisition of data and information is obtained with the knowledge and permission of the user, and the acquisition, storage, use, and processing of data and information are in compliance with the relevant provisions of national laws and regulations.

[0027] S130: Determine a target recommended item corresponding to the user from the items to be recommended based on all the scoring attributes.

[0028] In this embodiment, there are multiple ways to determine the target recommended items corresponding to the user from the items to be recommended based on all the scoring attributes. For example, all the scoring attributes can be compared with a preset scoring threshold, and the recommended items corresponding to those with scores higher than the preset scoring threshold are used as the target recommended items corresponding to the user. Alternatively, all the scoring attributes can be sorted using a sorting algorithm to generate a recommendation list of items recommended to the user. Exemplarily, a heap sorting algorithm can be used to find the Top-K book list and recommend it to the user. For example, heap sorting is performed by constructing a max-heap. If a task is performed with a recommendation list length of K, a max-heap of size K is constructed, and the items to be recommended are represented by nodes. According to the characteristics of the max-heap, the score of the parent node is greater than the scores of the left and right child nodes. Finally, a max-heap with only K nodes that meets the requirements can be obtained. Then, the root node of the max-heap is moved to the last node position, and the remaining K-1 nodes are reconstructed into a max-heap. Then, the top element of the heap is moved to the last element position, and the remaining K-2 nodes are reconstructed into a max-heap. In this way, a descending score list can be obtained. This list is also the final recommendation list, which contains the target recommended items.

[0029] The technical solution of this embodiment obtains the data of items to be used corresponding to the user of the item to be recommended; the data of items to be used includes multiple items to be recommended; the user's association information and the data of items to be used are input into a pre-trained target scoring model to obtain the user's scoring attributes for each item to be recommended; the target scoring model is trained based on the target network graph; the target network graph includes an interaction relationship graph representing the interaction relationship between users and items, a user relationship graph representing the similarity relationship between users, and an item relationship graph representing the similarity relationship between items; based on all the scoring attributes, the target recommended item corresponding to the user is determined from the items to be recommended, which solves the problem of the existing technology. In the process of recommending items by mining the interaction relationship between users and items, which leads to poor recommendation effects and inappropriate recommendations, we have fully mined the interaction relationship between users and items, the similarity relationship between users and between items based on the interaction relationship graph, user relationship graph and item relationship graph, trained a target scoring model, and improved the model accuracy. After the user's related information and the data of the items to be used are input into the pre-trained target scoring model, the model outputs the user's scoring attributes for each item to be recommended. While improving the scoring accuracy, it also determines the target recommended items that the user is interested in based on the scoring attributes, thereby achieving the technical effect of improving user experience.

[0030] Example 2

[0031] Figure 2 This is a flowchart of a network graph-based item recommendation method according to Example 2 of the present invention. Based on the previous example, a target scoring model can also be pre-trained. For detailed implementation details, please refer to the technical solution of this example. Technical terms that are identical or corresponding to those in the previous example are not repeated here.

[0032] like Figure 2 As shown, the method specifically includes the following steps:

[0033] S210: Obtain user information, item information, and original interaction information between the user and the item.

[0034] In this embodiment, user information, item information, and raw interaction information between users and items can be obtained from the user-item interaction dataset. The raw interaction information includes user ratings of items. For example, the interaction information may include user 1 rating book A as 1, user 1 rating book B as 2, user 2 rating book A as 3, user 3 rating book A as 2, and user 3 rating book C as 5.

[0035] S220: Correct the original interaction information to obtain target interaction information.

[0036] In practical applications, users may have potential rating habits. For example, some users tend to give high ratings, while others tend to give medium ratings. These different rating habits can lead to significant deviations in the predicted rating results. To improve the accuracy of the model's rating prediction, we can normalize the user's rating preferences and modify the original interaction information to obtain the target interaction information.

[0037] In this embodiment, the original interaction information is corrected to obtain the target interaction information, including: determining a rating correction parameter corresponding to the user based on the rating values ​​of all items evaluated by the same user; and correcting the rating value based on the rating correction parameter to obtain the target interaction information.

[0038] Specifically, for any review user, all items with which the review user has an interactive relationship can be counted, and the review user's ratings for these items can be combined to determine a correction parameter for the user's rating. For example, these ratings can be averaged, and the average used as the rating correction parameter for the user. Accordingly, a rating correction parameter corresponding to each user can be determined. Furthermore, each user's rating can be corrected using the corresponding rating correction parameter to obtain a corrected rating value. The target interaction information is determined based on the corrected rating value.

[0039] For example, for user i and the set N of all books that user i interacts with, user i gives a rating of r to the jth book. (i,j) , where j∈N. Calculate the average score E(r) corresponding to user i as the score correction parameter corresponding to user i:

[0040]

[0041] Furthermore, based on the average rating E(r) of user i, the rating value of each book evaluated by user i is modified to obtain a modified rating value. For example, the modified rating value r can be determined by taking the exponent of e based on the difference between the original rating value and the average rating. (i,j) :

[0042] S230: Generate an interaction relationship diagram based on the user information, item information, and target interaction information.

[0043] In this embodiment, each user and each item can be treated as a first node. Interactive nodes are connected by edges. For example, a user node is connected to the nodes of an item they have rated by an edge, which is referred to as a first link. The user's rating of the item serves as the weight of the edge between the two nodes. Accordingly, an interaction graph is generated using the first nodes and first links. This interaction graph can be a bipartite graph.

[0044] It should be noted that in order to improve data processing efficiency, after obtaining user information, item information, and the original interaction information between users and items, an original interaction graph is generated based on this information. The weights of the edges between user nodes and item nodes in the original interaction graph are represented by score values. For example, see Figure 3 , these scoring values ​​in the original interaction graph can be corrected according to the scoring processing module, the corrected scoring values ​​can replace the original scoring values ​​(ie, the original weights), the original interaction graph can be updated, and the updated original interaction graph can be used as the interaction relationship graph.

[0045] S240: Determine a user relationship diagram based on the interaction relationship diagram.

[0046] In this embodiment, users with similar preferences can be identified through a graph of user-item interactions. These users can be represented by second nodes, and the nodes of users with similar preferences can be connected by an edge, which serves as the second edge. The weight of the second edge can be determined based on the ratings of the same item by the users belonging to the two nodes. For example, the difference between the ratings can be used as the edge weight. A larger weight indicates a greater difference in the preferences of the two users, while a smaller weight indicates a greater similarity in the preferences of the two users. Accordingly, a user relationship graph can be generated using the second nodes and the second edge. The nodes in the user relationship graph are only the second nodes representing the users.

[0047] For example, see Figure 3 For user nodes i and j in the interaction relationship graph, when two users have books they have reviewed together, connect node i and node j with an edge, and the weight value of the edge is e (i,j) It can be expressed as e (i,j) =|r i -r j |. Among them, i and j represent user i and user j respectively, r i represents the rating of the shared book by user i, r j represents the rating of user j on the common book. The edge weight can reflect the similarity between two users in evaluating items. If the edge weight between two user nodes is small, it means that the two users have a high preference similarity. If the edge weight between two user nodes is large, it means that the two users have a small preference similarity.

[0048] S250: Determine an item relationship diagram based on the interaction relationship diagram.

[0049] In this embodiment, similar items can be found through a graph of user-item interactions, represented by third nodes. Similar item nodes can be connected by an edge, which is referred to as a third edge. The weight of the third edge can be determined based on the ratings of the items belonging to the two nodes by the same user. For example, the difference between the ratings can be used as the edge weight, with a larger weight representing a less similar item, and a smaller weight representing a more similar item. Accordingly, an item relationship graph can be generated using third nodes and third edges, where the only nodes in the item relationship graph are the third nodes representing the items.

[0050] For example, see Figure 3 For the book nodes i and j in the interaction relationship graph, when they are evaluated by the same user, the node i and the node j are connected, and the weight value of the connection is e (i,j) It can be expressed as e (i,j) =|r i -r j |. Among them, i and j represent book i and book j respectively, r i represents the user's rating of book i, r j represents the user's rating of book j. The edge weight can reflect the similarity between two books. If the edge weight between two book nodes is small, it means that the two books have a high similarity. If the edge weight between two book nodes is large, it means that the two books have a small similarity.

[0051] S260: Train the initial scoring model using the interaction relationship graph, the user relationship graph, and the item relationship graph to obtain a target scoring model.

[0052] In this embodiment, the interaction relationship graph, the user relationship graph, and the item relationship graph may be input into an initial scoring model, and the initial scoring model may be trained to obtain a target scoring model.

[0053] It should be noted that the above S240 to S250 can be executed sequentially or in parallel, and the specific execution order is not limited. The above order is only the order for explaining the technical solutions in each step, not the execution order of each step.

[0054] The technical solution of this embodiment obtains user information, item information, and raw interaction information between users and items, performs score correction processing on the raw interaction information, normalizes users' rating habits, and obtains target interaction information, thereby improving the accuracy of model score prediction. Furthermore, based on the user information, item information, and target interaction information, an interaction relationship graph is generated that reflects the relationship between users and items; a user relationship graph that reflects the relationship between users is determined based on the interaction relationship graph; and an item relationship graph that reflects the relationship between items is determined based on the interaction relationship graph. The interaction relationship graph, user relationship graph, and item relationship graph are used to fully mine information and train the initial scoring model to obtain the target scoring model, thereby improving model accuracy and, in turn, enhancing recommendation effectiveness.

[0055] Example 3

[0056] Figure 4 This is a flowchart of a network graph-based item recommendation method according to Example 2 of the present invention. Based on the previous example, step S260 is further refined. For detailed implementation details, please refer to the technical solution of this example. Technical terms that are identical or corresponding to those in the previous example are not repeated here.

[0057] like Figure 4 As shown, the method specifically includes the following steps:

[0058] S310: Input the interaction relationship graph, the user relationship graph, and the item relationship graph into the initial scoring model.

[0059] S320: Determine a target vector for each target node based on the interaction relationship graph, the user relationship graph, and the item relationship graph.

[0060] The target nodes include user nodes and item nodes. User nodes refer to nodes that represent users, and item nodes refer to nodes that represent items.

[0061] Based on the above technical solutions, it can be seen that there are user nodes and item nodes in the interaction relationship graph, user nodes in the user relationship graph, and item nodes in the item relationship graph. Figure 3 , the graph convolutional neural network module can be used to learn the user vectors of user nodes in the interaction graph and the item vectors of item nodes. The graph attention network module can be used to learn the item vectors of item nodes in the item graph and the user vectors of user nodes in the user graph. Furthermore, the user vector of the same user node in the interaction graph and the user graph can be concatenated to obtain the target vector of the user node. The item vector of the same item node in the interaction graph and the item graph can be concatenated to obtain the target vector of the item node. Accordingly, the target vector of each target node is obtained.

[0062] In this embodiment, based on the interaction relationship graph, the user relationship graph, and the item relationship graph, the target vector of each target node may be determined by: determining the first vector of each first node in the interaction relationship graph; determining the second vector of each second node in the user relationship graph; determining the third vector of each third node in the item relationship graph; determining the target vector corresponding to the user node based on the first vector and the second vector of the node to which the same user belongs; and determining the target vector corresponding to the item node based on the first vector and the third vector of the node to which the same item belongs.

[0063] For example, the vectors of the first node and the second node of the same user are concatenated to obtain the concatenated vector of the node as the target vector. For example, the first vector of user i in the interaction relationship graph is h ti , the second vector of user i in the user relationship graph is h ui , after splicing, the target vector of user i is e u The vectors of the first and third nodes of the same item are spliced ​​together to obtain the spliced ​​vector of the node as the target vector. For example, the first vector of item i in the interaction relationship diagram is h fi , the third vector of item i in the item relationship graph is h mi , the target vector of item i after splicing is e m .

[0064] In this embodiment, determining the first vector of each first node in the interaction relationship graph includes: determining a first neighbor node set corresponding to each first node in the interaction relationship graph; wherein the first neighbor node set includes at least one first neighbor node; for the first convolution layer calculation, determining the vector to be aggregated of the first node based on the initial vector of the first node, the initial vectors of each first neighbor node corresponding to the first node, the number of first neighbor nodes, and the number of neighbor nodes of the first neighbor node; for the convolution layer calculation located after the first convolution layer calculation, using the vectors to be aggregated of all first nodes in the previous convolution layer calculation as the initial vector of the first node in the current convolution layer calculation, and repeatedly performing the operation of determining the vector to be aggregated of the first node based on the initial vector of the first node, the initial vectors of each first neighbor node corresponding to the first node, the number of first neighbor nodes, and the number of neighbor nodes of the first neighbor node; and determining the first vector of the first node based on the vectors to be aggregated corresponding to the first node obtained by multiple convolution layer calculations.

[0065] It should be noted that the implementation method of determining the first vector of each first node is the same, and the description may be made by taking determining the first vector of any first node as an example.

[0066] In practical applications, we can search for the neighbor nodes of the first node in the interaction relationship graph to obtain the first neighbor node set corresponding to the first node. The first node may be a node representing a user or a node representing an item. For example, if the first node is a node representing a user, then the neighbor nodes of the first node are nodes representing an item; if the first node is a node representing an item, then the neighbor nodes of the first node are nodes representing a user. All the first nodes in the interaction relationship graph can be randomly initialized as vectors, and the randomly initialized user node vector can be expressed as (initial vector), the item node vector is represented as (initial vector). Furthermore, during the first convolutional layer calculation, the vector to be aggregated of the first node can be determined by the initial vector of the first node, the initial vectors of each first neighbor node corresponding to the first node, the number of first neighbor nodes, and the number of neighbor nodes of each first neighbor node. For example, the vector to be aggregated of the first node u representing the user is denoted as Denotes the initial vector of the neighbor nodes of the first node representing the item, N(u) represents the neighbor node set of user node u, |N(u)| represents the number of neighbor nodes in the neighbor node set, N(i) represents the neighbor node set of item node i, and N(i) represents the number of neighbor nodes in the neighbor node set. The vector to be aggregated of the first node representing the item is In each convolution layer calculation process after the first convolution layer calculation, the vector to be aggregated of the first node determined in the previous convolution layer calculation can be used as the initial vector of the first node in the current convolution layer calculation, and the operation of determining the vector to be aggregated of the first node based on the initial vector of the first node, the initial vectors of each first neighbor node corresponding to the first node, the number of first neighbor nodes, and the number of neighbor nodes of the first neighbor node is repeatedly performed. Accordingly, the vector to be aggregated corresponding to the first node obtained in multiple convolution layer calculations is obtained. For example, the formula for k+1 convolution layer calculations can be expressed as:

[0067] k is a natural number.

[0068] In this embodiment, the node vector update formula can be used to aggregate the information of the nodes in the previous layer and pass it to the nodes in the next layer to update the node vector representation, and finally obtain the updated vectors of the nodes in each layer. The message aggregation of the graph neural network is actually to transform the information of the nodes in each layer in the graph and pass it to the next layer. Through layer-by-layer transmission, the nodes in the last layer can have part of the node information of the nodes in the previous network layer, and thus obtain a richer information representation. That is, the information of the low-level nodes is transformed to update the vector representation of the high-level nodes, so that the high-level nodes have the information of the low-level neighboring nodes, and the vector representation of the nodes is enriched through continuous updating. Furthermore, the first vector of the first node can be obtained by aggregating the vectors of the first node calculated by K convolutional layers. For example, the first vector of the first node representing the user is The first vector representing the first node of the item is Among them, a k The influence coefficient for each layer of convolution calculation can be set to a k =1 / 1+K.

[0069] In this embodiment, determining the second vector of each second node in the user relationship graph includes: for each second node, determining a second neighbor node set corresponding to the second node based on the user relationship graph; determining the second vector of the second node based on the initial vector of the second node, the initial vector of each second neighbor node in the second neighbor node set, and the weight of the second edge between the second node and the second neighbor node.

[0070] In practical applications, the node vector of each second node in the user relationship graph is randomly initialized as the initial vector. By searching for nodes in the user relationship graph that have edges with the second node, these nodes that have edges with the second node are the neighbor nodes of the second node, and the second neighbor node set is obtained. Furthermore, the importance of the second neighbor node to the second node can be determined by the initial vector of the second node and the initial vector of the second neighbor node of the second node. The importance can reflect the contribution of the surrounding neighbor nodes to the central node. The larger the importance coefficient, the greater the influence of the neighbor node on the message aggregation of the central node in the message passing of the graph neural network. Specifically, the importance of the second neighbor node to the second node can be determined based on the initial vector of the second node and the initial vector of the second neighbor node of the second node. Exemplarily, for user i and the set of neighbor nodes N(i) with edges, the importance coefficient α of each neighbor node to the central user node can be calculated ij , node importance coefficient α ij :

[0071]

[0072] Among them, u i and u j are the initial vectors of user i and user j respectively, W represents the trainable weight matrix, || represents the vector concatenation operation, a is a fully connected neural network layer, and the implementation process can be expressed as follows: first, the initial vectors of user i and user j are concatenated after matrix transformation, then linearly transformed through a fully connected neural network layer, and the activation function LeakyReLU is used for nonlinear activation, and then the corresponding value is obtained by taking the exponent of e, and finally the importance coefficient of user node j (i.e., neighboring node) to the central user node i (i.e., the second node) is obtained by dividing the accumulated value with the value calculated by all neighboring node users.

[0073] Furthermore, the second vector of the second node can be determined based on all importances corresponding to the second node, the weight of the second edge between the second node and the second neighbor node, and the initial vector of the second neighbor node. For example, the importance coefficient α of user node j to the central user node i is determined. ij After that, the second vector h of the central node i can be calculated ui , such as the second vector of the central node is the product of the neighbor node vector, the node importance coefficient and the edge weight coefficient, and then calculate the cumulative sum, h ui It can be expressed as:

[0074]

[0075] In this embodiment, the third vector of each third node in the item relationship graph can be determined by randomly initializing the node vector of the third node in the item relationship graph to determine the initial vector; using a graph attention network to learn the item nodes (i.e., the third nodes) in the item relationship graph, and for item i and the set of neighboring nodes N(i) connected to it, the importance coefficient α of each neighboring node to the central item node can be calculated. ij The node importance coefficient can reflect the contribution of the surrounding neighboring nodes to the central node. The larger the importance coefficient, the greater the influence of the neighboring nodes on the message aggregation of the central node in the message transmission of the graph neural network.

[0076]

[0077] Among them, m i and m j Denote the initial vectors of item i and item j respectively, W represents the trainable weight matrix, || represents the vector concatenation operation, and a is a fully connected neural network layer. Determine the importance coefficient α of item node j to the central item node i ij After that, the third vector h of the central item node can be calculated mi :

[0078]

[0079] S330: Based on the predetermined first relationship graph and second relationship graph, the target vector, and the predetermined joint loss function, the model parameters in the initial scoring model are modified.

[0080] Among them, the first relationship graph and the second relationship graph are determined based on the cropping process of the interaction relationship graph. The implementation method of determining the first relationship graph and the second relationship graph is the same. Taking the cropping process of the interaction relationship graph to determine the first relationship graph as an example for introduction, its specific implementation method can be: for each first edge in the interaction relationship graph, based on the node degree of the two first nodes corresponding to the first edge, determine the edge importance parameter of the first edge; based on the edge importance parameter of the first edge and the edge importance parameter of the associated edge corresponding to the first node representing the user in the two first nodes, determine the retention attribute of the first edge, and the retention attribute is used to represent the probability of the edge being retained; determine the random value corresponding to the first edge based on the random number generation algorithm, and based on the random value corresponding to the first edge and the retention attribute, determine whether to crop the first edge to obtain the first relationship graph.

[0081] In practical applications, the method for determining whether to prune each first edge in an interaction graph is the same. The node degrees of the two first nodes connecting the first edge can be calculated. The node degree refers to the number of edges associated with each node. By averaging the node degrees of these two first nodes, the average value can be used as the edge importance parameter for the first edge. Furthermore, a first node representing a user can be determined from these two first nodes, and then all neighboring nodes of the first node representing the user can be found. The first edges between the first node representing the user and each of these neighboring nodes can be used as associated edges. The retained attributes of the first edge can be determined based on the edge importance parameter of the first edge and the edge importance parameters of each associated edge. For example, the quotient of the edge importance parameter of the first edge and the sum of the edge importance parameters of all associated edges can be used as the retained attribute. Furthermore, a random value corresponding to the first edge is determined based on a random number generation algorithm. The random value corresponding to the first edge is then compared with the retained attribute to determine whether to prune the first edge. For example, if the random value is greater than the retained attribute, the first edge is pruned. Accordingly, it can be determined whether each first connecting edge is to be clipped. If so, it is clipped; if not, it is retained, and a first relationship graph can be obtained.

[0082] For example, for any two connected nodes i and j in the interaction relationship graph, the node degree d is calculated. i and d j , get the edge importance parameter η of the edge between two nodesij , The edge importance parameter of an edge can reflect the importance of the edge in the graph. The larger the value, the more important the edge is to the entire graph. Accordingly, the edge importance parameter η of all edges in the interaction graph is calculated. ij Next, the edges in the interaction graph will be deleted (i.e., pruned) with a certain probability. The purpose of deleting the edges is to generate a first relationship graph and a second relationship graph that are different from the interaction graph, so as to obtain the vector representation of the node through comparative learning between the first relationship graph and the second relationship graph. In the process of deleting edges, considering that the edges cannot be deleted randomly, because some edges are more important, it is necessary to focus on deleting unimportant edges when deleting edges, while retaining important edges. Therefore, it is necessary to give a deletion probability to the deletion of edges, and the probability of deletion is related to the edge importance parameter η of the edge. ij For this, the probability p of each edge being retained when deleting the edge in the graph is given. ij , p ij The reserved attributes, For the edge between any two connected nodes i and j in the interaction graph, generate a random number r ij ∈[0,1], when r ij >p ij , delete the edge. Repeat this operation to determine whether to delete each edge in the interaction graph, and finally generate a sub-graph v1. In the same way as generating v1, another sub-graph v2 can be obtained. v1 and v2 can be used as the first and second graphs respectively.

[0083] In this embodiment, the joint loss function includes a first loss function, a second loss function and a regularization term; in the process of correcting the model parameters in the initial scoring model based on the predetermined first relationship graph and second relationship graph, the target vector and the predetermined joint loss function, the predicted score of the user to which the user node belongs to the item to which the item node belongs can be determined based on the target vector of the user node and the target vector of the item node; the predicted score is processed according to the first loss function to obtain a first loss value; the second loss value is determined based on the second loss function and the target vectors of the relationship nodes in the first relationship graph and the second relationship graph; the target loss value is determined based on the first loss value, the second loss value and the regularization term; and the model parameters in the initial scoring model are corrected based on the target loss value.

[0084] Among them, the relationship nodes correspond to the user nodes and the item nodes. Based on the above scheme, it can be seen that there are nodes in the first relationship graph and the second relationship graph that are consistent with the interaction relationship graph. Accordingly, the target vector corresponding to each node in the first relationship graph and the second relationship graph can be obtained.

[0085] In practical applications, the transpose of the target vector of the user node and the inner product of the target vector of the item node can be used as the predicted score of the user to which the user node belongs to the item to which the item node belongs. For example, calculate the predicted score of user i for book j The first loss function can be used to process the predicted score and output a first loss value. For example, the BPR loss function can be used to define the first loss function, which can be Among them, L is the loss, σ() is the sigmoid activation function, represents the predicted rating of item j that user i interacts with, represents the predicted rating of item k, which user i has not interacted with. A second loss function can be used to process the target vectors of the relationship nodes in the first and second relationship graphs, outputting a second loss value. Furthermore, the first loss value, the second loss value, and the regularization term can be added together, and the sum of these three can be used as the target loss value. The target loss value is used to correct the model parameters in the initial rating model, and the model parameters are continuously tuned to minimize the target loss value and achieve the optimal model.

[0086] In this embodiment, the second loss function includes a user loss function and an item loss function; based on the second loss function and the target vectors of the relationship nodes in the first relationship graph and the second relationship graph, the second loss value is determined, including: determining the sample nodes based on the relationship nodes in the first relationship graph and the relationship nodes in the second relationship graph; determining the third loss value based on the target vector of the sample nodes representing the user based on the user loss function in the second loss function; determining the fourth loss value based on the target vector of the sample nodes representing the item based on the item loss function in the second loss function; and determining the second loss value based on the third loss value and the fourth loss value.

[0087] The sample nodes include positive sample nodes and negative sample nodes; the positive sample nodes may represent the same relationship nodes in the first relationship graph and the second relationship graph, and the negative sample nodes may represent different relationship nodes in the first relationship graph and the second relationship graph.

[0088] In practical applications, the same node in the two sub-graphs (the first and second sub-graphs) can be considered a positive sample pair, and different nodes can be considered a negative sample pair, resulting in positive and negative sample nodes representing items, as well as positive and negative sample nodes representing users. The target vector of the sample node representing the user can be processed using the user loss function to obtain a third loss value. The target vector of the sample node representing the item can be processed using the item loss function to obtain a fourth loss value. The third and fourth loss values ​​are summed, and the sum is used as the second loss value.

[0089] For example, define the user loss function Define item loss function Wherein, value() represents a vector similarity measurement function, which can adopt the cosine similarity measurement function, and τ is a temperature coefficient, which can be set to τ = 0.1. 1 、x 2 Represent the target vectors of the nodes in the first relationship graph v1 and the second relationship graph v2 respectively, Representing positive sample nodes, Characterize the negative sample node. Through the user loss function and the item loss function, the contrast loss of the user and item nodes can be calculated respectively. The second loss function L ssl It can be expressed as: L ssl =L user +L movie .

[0090] On the basis of the above technical solution, a joint optimization loss function Loss is defined based on the first loss function and the second loss function. In order to alleviate the overfitting problem, an L2 regularization term is added at the end of the loss function, and the stochastic gradient descent method is used to optimize the model parameters.

[0091] S340. Taking the convergence of the joint loss function as the training goal, a target scoring model is obtained.

[0092] In this embodiment, the training error of the joint loss function, that is, the loss parameter, can be used as a condition for detecting whether the joint loss function has currently reached convergence, such as whether the training error is less than a preset error or whether the error change trend tends to be stable, or whether the current number of iterations is equal to the preset number. If the detection reaches the convergence condition, such as the training error of the joint loss function is less than the preset error or the error change tends to be stable, it indicates that the initial scoring model training is completed. At this time, the iterative training can be stopped to obtain the target scoring model. In actual applications, after determining the user of the recommended item, the target vector of the user node can be obtained through the target scoring model, and the inner product of the generated target vectors of the user and the item can be performed to obtain the user's rating value for the item. The target recommended item that is finally recommended to the user is generated according to the rating ranking to complete the Top-K recommendation task for the user's item.

[0093] The technical solution of this embodiment improves the richness of node vector representations by inputting the interaction relationship graph, user relationship graph, and item relationship graph into the initial scoring model. Based on the vector representation of each node in the interaction relationship graph, user relationship graph, and item relationship graph, a target vector is determined for each target node. The first and second relationship graphs are determined by cropping the interaction relationship graph. Furthermore, the model parameters in the initial scoring model are modified based on the first and second relationship graphs, the target vector, and a pre-set joint loss function. The convergence of the joint loss function is used as the training goal to obtain a target scoring model, ensuring that the model's predicted scores are consistent with the user, and thus that the recommended items are user-appropriate.

[0094] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in the present invention can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution of the present invention can be achieved. This is not limited herein.

[0095] The above specific embodiments do not limit the scope of protection of the present invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention are intended to be included within the scope of protection of the present invention.

Claims

1. A method for recommending items based on a network graph, characterized in that: include: Acquire data of items to be used corresponding to the user for whom recommended items are to be determined; wherein the data of items to be used includes a plurality of items to be recommended; Inputting the user's association information and the data of the items to be used into a pre-trained target scoring model to obtain the user's scoring attributes for each of the items to be recommended; wherein the target scoring model is trained based on a target network graph; the target network graph includes an interaction relationship graph representing the interaction relationship between users and items, a user relationship graph representing the similarity relationship between users, and an item relationship graph representing the similarity relationship between items; Based on all the scoring attributes, determining a target recommended item corresponding to the user from the items to be recommended; The method further includes: training to obtain the target scoring model, including: Obtaining user information, item information, and original interaction information between the user and the item, and modifying the original interaction information to obtain target interaction information; the original interaction information includes the user's rating of the item; generating the interaction relationship graph based on the user information, the item information, and the target interaction information; wherein the interaction relationship graph includes a first node and a first edge formed by connecting the first node, the first node representing an item or a user, and a weight on the first edge determined based on the user's rating information on the item; Determining the user relationship graph based on the interaction relationship graph; wherein the user relationship graph includes a second node and a second edge formed by connecting the second nodes, the second node represents a user, and the weight of the second edge is determined based on rating information of the same item by users belonging to two second nodes corresponding to the second edge; Determining the item relationship graph based on the interaction relationship graph; wherein the item relationship graph includes a third node and a third edge formed by connecting the third nodes, the third node represents an item, and the weight of the third edge is determined based on rating information of the same user on the items belonging to the two third nodes corresponding to the third edge; The initial scoring model is trained using the interaction relationship graph, the user relationship graph, and the item relationship graph to obtain the target scoring model.

2. The method according to claim 1, characterized in that The training of the initial scoring model using the interaction relationship graph, the user relationship graph, and the item relationship graph to obtain the target scoring model includes: Inputting the interaction relationship graph, the user relationship graph, and the item relationship graph into the initial scoring model, and determining a target vector for each target node based on the interaction relationship graph, the user relationship graph, and the item relationship graph; the target nodes include user nodes and item nodes; Based on a predetermined first relationship graph and a second relationship graph, the target vector, and a predetermined joint loss function, modifying model parameters in the initial scoring model; wherein the first relationship graph and the second relationship graph are determined based on cropping the interaction relationship graph; The convergence of the joint loss function is used as a training goal to obtain the target scoring model.

3. The method according to claim 2, characterized in that The determining of the target vector of each target node according to the interaction relationship graph, the user relationship graph, and the item relationship graph includes: Determining a first vector for each first node in the interaction relationship graph; Determine a second vector for each second node in the user relationship graph; Determining a third vector of each third node in the item relationship graph; Determine a target vector corresponding to the user node based on a first vector and a second vector of a node to which the same user belongs; Based on the first vector and the third vector of the node to which the same item belongs, a target vector corresponding to the item node is determined.

4. The method according to claim 3, characterized in that The determining of the first vector of each first node in the interaction relationship graph includes: Determine a first neighbor node set corresponding to each first node in the interaction relationship graph; wherein the first neighbor node set includes at least one first neighbor node; For the first convolutional layer calculation, determine the vector to be aggregated for the first node based on the initial vector of the first node, the initial vectors of each first neighbor node corresponding to the first node, the number of first neighbor nodes, and the number of neighbor nodes of the first neighbor node; For a convolution layer calculation subsequent to the first convolution layer calculation, using all the to-be-aggregated vectors of the first nodes in the previous convolution layer calculation as the initial vector of the first node in the current convolution layer calculation, and repeatedly performing an operation of determining the to-be-aggregated vector of the first node based on the initial vector of the first node, the initial vectors of each first neighboring node corresponding to the first node, the number of the first neighboring nodes, and the number of neighboring nodes of the first neighboring node; Based on the vectors to be aggregated corresponding to the first node obtained by multiple calculations of the convolutional layer, a first vector of the first node is determined.

5. The method according to claim 3, characterized in that The determining of the second vector of each second node in the user relationship graph includes: For each second node, determining a second neighbor node set corresponding to the second node based on the user relationship graph; A second vector of the second node is determined based on the initial vector of the second node, the initial vector of each second neighbor node in the second neighbor node set, and the weight of the second edge between the second node and the second neighbor node.

6. The method according to claim 5, characterized in that The determining the second vector of the second node based on the initial vector of the second node, the initial vector of each second neighbor node in the second neighbor node set, and the weight of the second edge between the second node and the second neighbor node includes: Determining, based on the initial vector of the second node and the initial vector of the second neighboring node of the second node, the importance of the second neighboring node to the second node; A second vector of the second node is determined based on all the importances corresponding to the second node, the weight of the second edge between the second node and the second neighboring node, and the initial vector of the second neighboring node.

7. The method according to claim 2, characterized in that The joint loss function includes a first loss function, a second loss function, and a regularization term; and the modifying of model parameters in the initial scoring model based on the predetermined first relationship graph and the second relationship graph, the target vector, and the predetermined joint loss function includes: Determining, based on the target vector of the user node and the target vector of the item node, a predicted score of the user to which the user node belongs to the item to which the item node belongs; processing the predicted score according to the first loss function to obtain a first loss value; Determining a second loss value based on the second loss function and target vectors of relationship nodes in the first relationship graph and the second relationship graph, wherein the relationship nodes correspond to the user nodes and the item nodes; Determining a target loss value based on the first loss value, the second loss value, and the regularization term; Model parameters in the initial scoring model are modified based on the target loss value.

8. The method according to claim 7, characterized in that The second loss function includes a user loss function and an item loss function; and determining a second loss value based on the second loss function and target vectors of relationship nodes in the first relationship graph and the second relationship graph includes: Determine sample nodes based on the relationship nodes in the first relationship graph and the relationship nodes in the second relationship graph; wherein the sample nodes include positive sample nodes and negative sample nodes; Determine a third loss value based on the target vector of the sample node representing the user by the user loss function in the second loss function; Determining a fourth loss value based on a target vector of a sample node representing an item by an item loss function in the second loss function; Based on the third loss value and the fourth loss value, a second loss value is determined.

9. The method according to claim 2, characterized in that Also includes: For each first edge in the interaction relationship graph, determining an edge importance parameter of the first edge based on the node degrees of two first nodes corresponding to the first edge; determining a retained attribute of the first edge based on the edge importance parameter of the first edge and the edge importance parameter of the associated edge corresponding to the first node representing the user among the two first nodes; A random value corresponding to the first edge is determined based on a random number generation algorithm, and whether to crop the first edge is determined based on the random value corresponding to the first edge and a retained attribute to obtain the first relationship graph.

Citation Information

Patent Citations

  • Recommendation method based on graph twin network

    CN111881342A

  • Article recommendation method and device based on graph neural network, and storage medium

    CN114722269A