A recommendation method for introducing item category information in graph neural networks
By introducing item category information into the graph neural network, using the potential factor module and category weighted aggregation module, the problem that user intentions and product categories interaction information in the prior art are not mined, and a more personalized recommendation effect is achieved.
Patent Information
- Application Number
- CN202210964936.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-12
- Publication Date
- 2025-08-05
- Estimated Expiration
- 2042-08-12
AI Technical Summary
In the existing graph neural network and knowledge graph recommendation methods, the interactive information between user intention and product categories cannot be effectively mined, resulting in the inability to effectively reflect the user intention’s preference for different types of items during the recommendation process.
Item category information is introduced into the graph neural network, and through the potential factor module, category information module and category weighted aggregation module, the item prior knowledge vector and knowledge graph are used to construct user-item interaction graphs to realize item classification and personalized recommendations.
It improves the interpretability and personalized recommendation effect of the recommendation model, and can more accurately predict the user's possibility of purchasing items.
Smart Images

Figure CN115293851B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of computer technology, and in particular relates to a recommendation method for introducing item category information into a graph neural network. Background Art
[0002] With the rapid development of internet-related industries, people's lives have entered an information-based and intelligent era. Various online platforms have provided great convenience for people's lives. When using online platforms, users are generally only interested in information about a few specific items. Being faced with a large amount of irrelevant information can lead to a poor user experience. To address the difficulty of choosing from the information explosion and provide users with the data they are interested in in a short period of time, recommendation methods have become increasingly popular across various platforms.
[0003] Traditional recommendation methods typically employ two approaches: content-based recommendations and collaborative filtering. The fundamental difference between these approaches lies in whether or not they utilize auxiliary user or item information, such as user profiles, item categories, brands, and prices. With advances in computer technology, deep learning-based recommendation methods have gradually become mainstream.
[0004] Graph neural networks, a new type of neural network model specifically designed to process graph data structures, can flexibly model scenario data that is more closely aligned with human social life. Knowledge graphs are large-scale data networks that represent entities and their relationships in the world using a graph structure. Entities represent objects or concepts in various application scenarios, while relationships represent connections between entities. Therefore, knowledge graphs can structuredly represent all scenario information in the objective world. Through embedded representations and relational reasoning, they provide prior knowledge for other deep learning tasks, thereby improving the accuracy and effectiveness of the entire task.
[0005] However, in existing graph neural network and knowledge graph recommendation methods, the knowledge graph-assisted user-product interaction recommendation system is unable to mine the interactive information between user intentions and product categories, and lacks the connection between items and user intentions from the perspective of item category information, resulting in the inability to effectively reflect user intentions and preferences for different types of items in the recommendation. Summary of the Invention
[0006] In order to overcome the shortcomings of the above-mentioned prior art, the purpose of the present invention is to provide a recommendation method that introduces item category information into a graph neural network. Introducing item category information into the recommendation scenario not only meets the needs of the actual recommendation scenario, but also improves the interpretability of the model.
[0007] In order to achieve the above object, the technical solution adopted by the present invention is:
[0008] A recommendation method for introducing item category information into a graph neural network includes the following steps:
[0009] Step 1: Determine input data
[0010] The input data is a user-item interaction graph that represents the interactive relationship between users, items, and auxiliary information. The user-item interaction graph includes relational data and a knowledge graph. The relational data represents the interactive behavior between users and items. The knowledge graph represents the relationship between items and their auxiliary information. The interactive behavior refers to the user's implicit feedback on the item. The auxiliary information refers to a series of feature descriptions related to the item.
[0011] Step 2: Constructing the latent factor module
[0012] The latent factor module is used to model the user's intention to select a product. Users always choose items for some intention, and the vector representation of users and items in this module is obtained;
[0013] Step 3: Build category information module
[0014] The category information module is used to obtain category information of the item, and the category information module uses the item prior knowledge vector as the feature information of the item;
[0015] Step 4: Build a category-weighted aggregation module
[0016] The category weighted aggregation module is used to perform weighted aggregation on the knowledge graph and the item prior knowledge vector to obtain the vector representation of users and items in the module;
[0017] Step 5: Build a rating prediction module
[0018] The rating prediction module is used to integrate the vector representations of users and items obtained by the latent factor module and the category weighted aggregation module, and then perform vector calculations, ultimately learning a function based on a given set of interactive behaviors and a knowledge graph that can predict how likely a user is to purchase or select an item.
[0019] Compared to existing technologies, this paper addresses the problem that existing interactive product recommendation systems fail to exploit the interaction between user intent and product categories, resulting in the recommendation process failing to effectively reflect the correspondence between user intent and item preferences. By proposing a method for item recommendation based on graph neural networks, this method leverages prior knowledge of items to achieve item classification through clustering. Furthermore, through weighted aggregation of node information within the graph neural network, this method achieves more personalized item recommendations. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1This is the overall module structure diagram of the method of the present invention.
[0021] Figure 2 This is a structural framework diagram of the method of the present invention.
[0022] Figure 3 An example diagram for calculating personalized weighted browsing history vectors.
[0023] Figure 4 Schematic diagram of the calculation process of the weighted aggregation module. DETAILED DESCRIPTION
[0024] The embodiments of the present invention are described in detail below with reference to the accompanying drawings and examples.
[0025] like Figure 1 The figure shows the overall modular structure of the method described in this invention, which includes four modules: a latent factor module, a category information module, a category weighted aggregation module, and a rating prediction module. The knowledge graph and item information are aggregated through the latent factor module, the category information module, and the category weighted aggregation module to generate an aggregated result vector containing different information. The rating prediction module then generates user-item ratings, and finally recommends items to the user based on the ranking of the ratings.
[0026] like Figure 2 As shown, the implementation process of the method of the present invention is as follows:
[0027] (1) Data description
[0028] The user-item interaction graph serves as the input data of the method of the present invention. The user-item interaction graph represents the interactive relationship between users, items, and auxiliary information, and includes two parts: relationship data and knowledge graph.
[0029] In this invention, relational data represents the interaction between users and items. Interactions are implicit feedback from users to items, such as browsing, purchasing, liking, collecting, forwarding, etc. In relational data, U represents the user set, I represents the item set, u represents the user, and i represents the item selected by user u. The set of interaction behaviors O between users and items is + ={(u, i)|u∈U, i∈I}, which is the user's implicit feedback.
[0030] The knowledge graph represents the relationship between items and their auxiliary information. V represents the entity set, R represents the relationship set (i.e., the set of relationships r between items and their auxiliary information), h represents the item, and t represents the item's auxiliary information. Auxiliary information refers to a series of feature descriptions related to the item. When v represents an entity in the entity set, then v can be either h or r. The knowledge graph can be represented as G = {(h, r, t) | h, t∈V, r∈R}. For example, if the subject matter of a book is fiction, h represents the book, r represents the subject matter, and t represents the novel.
[0031] The latent factor module and the category weighted aggregation module use the interaction information of user items to build their own models. The final task is to + And learning a function on the knowledge graph G can predict how likely a user is to purchase or select an item.
[0032] (2) Latent Factor Module
[0033] In the latent factor module, each user will choose an item for a certain intention. This intention is the user's preference for the item. Therefore, the user's intention to choose the item is taken as the corresponding latent factor p, which is called the user's latent factor p for choosing the item. All latent factors p constitute the latent factor set P. According to the latent factor set P, the user and item pairs (u, i) are divided into {(u, p, i)|p∈P}, thus reorganizing the original heterogeneous graph. Each latent factor p will be matched with the relationship in the knowledge graph, and the attention mechanism is used to construct the vector e of the latent factor p. p :
[0034]
[0035] Where: e r represents the ID embedding vector of relation r, and α(r, p) represents the importance score between the latent factor p and the item relationship in the knowledge graph. The calculation formula is:
[0036]
[0037] Where: w rp represents a trainable weight matrix corresponding to a specific relation r and a specific latent factor p in the knowledge graph. r′ represents the other relations in the knowledge graph corresponding to the user's selected item. The attention score is not unique to a single user; it is assigned to any user who possesses the combination of this relation and latent factor.
[0038] In the latent factor module, since users may purchase products for various reasons, in order to better distinguish the differences between these intentions, the independence of the latent factors needs to be improved. Different latent factors should be independent of each other. Independent latent factors can provide different information describing a user's behavior, guiding the learned latent factor embedding vectors to be as independent as possible. The smaller the distance correlation coefficient between two latent factors, the more independent the two latent factors are. ING Indicates the independence between potential factors, and the calculation formula is as follows:
[0039]
[0040]
[0041] Where: e p and e p′ is the vector of latent factor p and latent factor p′, dCor(e p , e p′ ) represents the distance coefficient between the latent factor p and the latent factor p′; dCov(e p , e p′ ) means e p With e p′ The distance covariance of dVar(e p ) means e p The distance variance, dVar(e p′ ) means e p′ The distance variance.
[0042] L ING is an item in the overall loss function. The present invention expects the independence of the latent factors to be as strong as possible, that is, the value calculated by the above formula is expected to be as small as possible. By continuously training the neural network, the network will automatically make L iNG The value becomes smaller and smaller.
[0043] In the latent factor module, vector representations of users and items can be obtained through relationship path aggregation or knowledge graph aggregation.
[0044] When performing relationship path aggregation, collaborative filtering is used. u = {(p, i)|(u, p, i)∈C} represents the latent factor history and the first-order correlation of user u, and C represents the latent factor history. Then, the latent factor information is integrated from all historical interaction items to generate the representation of user u in the latent factor module:
[0045]
[0046] Where: is the embedding vector after aggregating the latent factor history of user u, that is, the vector representation of users and items in the latent factor module; represents the ID embedding vector of item i in the latent factor module; ⊙ represents the Hadamard product. The attention score β(u, p) is used to distinguish the importance of each latent factor p, and its calculation formula is:
[0047]
[0048] Where: Represents the ID embedding vector of user u.
[0049] When aggregating knowledge graphs, use N i = {(r, v)|(i, r, v)∈G} represents the attributes of item i and its first-order link entity nodes, and takes into account the relational context of the aggregation function, that is, each entity has different semantics in different relations. This produces a vector representation of item i:
[0050]
[0051] Where: represents the item embedding vector after aggregating the first-layer adjacency information of item i on the knowledge graph, that is, the vector representation of users and items in the latent factor module; The ID embedding vector representing entity v.
[0052] (3) Category information module
[0053] In the category information module, the most important thing is to obtain the item category information and provide the corresponding category data for the subsequent module operation. Since there is no relevant description of item data and features in the user-item interaction graph, the present invention uses the item prior knowledge vector as the feature information of the item. In addition, the data set does not require any information about the item label. The present invention uses a clustering method to aggregate to obtain the item prior knowledge vector. Clustering obtains several clusters, each cluster represents a class of similar items, that is, each cluster corresponds to an item category, and the cluster center vector of each cluster is the item prior knowledge vector, which represents the common characteristics of a class of items; the number of each cluster is a pseudo-label, which is used to mark and distinguish different clusters. Through clustering, the corresponding pseudo-label is attached to the item. This pseudo-label serves as an additional information guide to enrich the user representation in the graph neural network recommendation scenario.
[0054] (4) Category weighted aggregation module
[0055] The main function of the category weighted aggregation module is to use the item category information in the category information module to perform selective weighted information aggregation based on different users' preferences for items. The user-item interaction matrix is defined as follows:
[0056]
[0057] A fg Indicates that there is an interaction between the f-th user and the g-th item, that is, the f-th user selected the g-th item;
[0058] Integrate the item category information into the interaction matrix to obtain the modified adjacency matrix A ic ,
[0059] A ic =Personalized Weighting(A) (9)
[0060] Where Personalized Weighting is an operation function that performs normalization operations based on the number of items.
[0061] like Figure 3 The figure shows a specific example of the process of calculating the personalized weighted browsing record vector. If there are items i1, i2, i3, i4 in the item library, and user u1 browses items i1, i2, i3, then the vector in the adjacency matrix is represented as (1, 1, 1, 0). Clustering in the category information module shows that i1 and i2 are first-category items, i3 is second-category items, and i4 is third-category items. For user u1, there are only two categories of items browsed, and the number of first-category items is 2, and the number of second-category items is 1, so the weight of the first-category items is The weight of the second category of items is The vectors in the adjacency matrix are represented as After normalization, the final personalized weighted browsing record vector is
[0062] The calculation process of the weighted aggregation module is as follows Figure 4 As shown. According to formula (9), the adjacency matrix A is obtained ic After that, it is aggregated to obtain the user vector. The aggregation process is expressed as the following formula:
[0063]
[0064] Where: Represents the vector representation of the user in the category weighted aggregation module. The aggregation of item vectors can be expressed as follows:
[0065]
[0066] Where: represents the item embedding vector after the first layer of adjacency information aggregation in the category weighted aggregation module, represents the ID embedding vector of entity v, e rThe ID embedding vector representing the relation r.
[0067] (5) Rating prediction module
[0068] After the above modules, k layers can be iterated to obtain the vector representation of the k-th layer propagation process of each user and item in the latent factor module and the category weighted aggregation module. They are: latent factor module user vector Latent factor module item vector Category-weighted aggregation module user vector and category-weighted aggregation module item vector
[0069] All vector dimensions are 64-dimensional. In the rating prediction module, the user vector e of this layer can be obtained by performing add operations on them respectively. u and item vector e i :
[0070]
[0071]
[0072] After the add operation, the user and item vectors can still be propagated multiple times, resulting in multiple layers of user vectors e u and item vector e i In order to make the embedding vector contain richer information, it is necessary to perform add operations on the user vectors and item vectors generated by each layer:
[0073] e u =e u (0) +…+e u (k) (14)
[0074] e i =e i (0) +…+e i (k) (15)
[0075] Where: e u represents the final user vector; e i Represents the final item vector. The final score can be obtained by multiplying the two vectors:
[0076] y ui =e u T e i (16)
[0077] The loss function used in the method of the present invention is as follows:
[0078]
[0079] Where: represents the parameters that the neural network of the present invention can automatically learn, e r Represents the ID embedding vector of relation r, e p L represents the vector of potential factors p; λ1 represents the parameter controlling the independence loss; λ2 represents the regularization parameter. BPR The loss function is as follows:
[0080]
[0081] In the formula: O={(u,i,j)|(u,i)∈O + , (u, j)∈O -} represents the final user vector training set; O + represents the positive sample (the observed sample); O - represents a negative sample (unobserved sample); σ represents the sigmoid function, i represents an item, j represents another item, y ui and y uj Indicates the ratings of the same user u on items i and j;
[0082] Finally, based on the user-item rating y ui Sorting is performed to obtain a list of items recommended to the user.
[0083] A specific example of the present invention is as follows.
[0084] The following is the relationship data of user-item interaction behavior. The number list after the user name is the number of items that the user has visited.
[0085] Zhang San: 1 14 15 16 17 18 19 20 21 22
[0086] Li Si: 2 26 27 28 29 30 31 32 33 34
[0087] Wang Mei: 3 49 50 51 52 53 54 55 56
[0088] …
[0089] The knowledge graph of items and their auxiliary information is shown below. Each row consists of three numbers. The first number represents the item number, for example, item number 40 represents the video "The Battle of Shangganling," item number 44 represents the video "My Father and Mother," and so on. The last number represents the number of the item's auxiliary information, for example, item number 41 represents a war film, item number 45 represents an art film, and so on. The numbers in the middle represent the relationship between the item and its auxiliary information, for example, 0 represents a "is a" relationship, 1 represents a "director is" relationship, 2 represents a "release date is" relationship, and so on. 40 0 41 44 0 45 5 1 6 49 0 50 53 0 54 25 2 26 57 0 58 52 1 6 73 0 62 41 10 42 64 0 65
[0101] …
[0102] The above data is input into the module of the present invention for training. After training, if "Zhang San" is input again, the present invention will output a list of new items recommended to the user Zhang San, such as items No. 308, 309, and 310.
Claims
1. A recommendation method that introduces item category information into a graph neural network, characterized in that: The steps include: Step 1: Determine input data The input data is a user-item interaction graph that represents the interactive relationship between users, items, and auxiliary information. The user-item interaction graph includes relational data and a knowledge graph. The relational data represents the interactive behavior between users and items. The knowledge graph represents the relationship between items and their auxiliary information. The interactive behavior refers to the user's implicit feedback on the item, including browsing, purchasing, liking, collecting, and forwarding. In the relational data, the interactive behavior set O between users and items is + = {(u, i) | u∈U, i∈I}, where U represents the user set, I represents the item set, u represents the user, and i represents the item selected by user u; the auxiliary information refers to a series of feature descriptions related to the item; the knowledge graph is represented as G = {(h, r, t) | h, t∈V, r∈R}, where V represents the entity set, one of which is the item h or the item's auxiliary information t; R represents the set of relationships r between items and their auxiliary information; Step 2: Constructing the latent factor module The latent factor module is used to model the user's intention to select a product. Users always choose items for some intention, and the vector representation of users and items in this module is obtained; In the latent factor module, the user's intention to select an item is taken as the corresponding latent factor p. According to the set P of all latent factors p, the user and item pairs (u, i) are divided to form {(u, p, i)|p∈P}. Each latent factor p is matched with the relationship in the knowledge graph, and the attention mechanism is used to construct the vector e of the latent factor p. p : Where: e r represents the ID embedding vector of relation r, and α(r, p) represents the importance score between the latent factor p and the item relationship in the knowledge graph. The calculation formula is: Where: w rp Represents a trainable weight matrix that corresponds to a specific relationship r and a specific latent factor p in the knowledge graph. r′ represents the other relationships in the knowledge graph corresponding to the item selected by the user. Step 3: Build category information module The category information module is used to obtain category information of the item, and the category information module uses the item prior knowledge vector as the feature information of the item; Step 4: Build a category-weighted aggregation module The category weighted aggregation module is used to perform weighted aggregation on the knowledge graph and the item prior knowledge vector to obtain the vector representation of users and items in the module; Step 5: Build a rating prediction module The rating prediction module is used to integrate the vector representations of users and items obtained by the latent factor module and the category weighted aggregation module, and then perform vector calculations, ultimately learning a function based on a given set of interactive behaviors and a knowledge graph that can predict how likely a user is to purchase or select an item.
2. The recommendation method for introducing item category information into a graph neural network according to claim 1, characterized in that: In the latent factor module, the smaller the distance correlation coefficient between two latent factors, the more independent the two latent factors are. The independence between the latent factors is expressed as L ING The calculation formula is as follows: Where: e p and e p′ is the vector of latent factor p and latent factor p′, dCOr(e p , e p′ ) represents the distance coefficient between the latent factor p and the latent factor p′; dVov(e p , e p′ ) means e p With e p′ The distance covariance of dVar(e p ) means e p The distance variance, dVar(e p′ ) means e p′ The distance variance.
3. The recommendation method for introducing item category information into a graph neural network according to claim 1, characterized in that: In the latent factor module, vector representations of users and items are obtained through relationship path aggregation or knowledge graph aggregation; When performing relationship path aggregation, collaborative filtering is used to u ={(p, i)|(u, p, i)∈C} represents the latent factor history and the first-order correlation of user u, C represents the latent factor history, and the latent factor information is integrated from all historical interaction items to generate the vector representation of user u in the latent factor module: Where: is the embedding vector after aggregating the latent factor history of user u, that is, the vector representation of users and items in the latent factor module; represents the ID embedding vector of item i in the latent factor module; ⊙ represents the Hadamard product, and the attention score β(u, p) is used to distinguish the importance of each latent factor p, which is calculated as follows: Where: represents the ID embedding vector of user u; When aggregating knowledge graphs, use N i ={(r, v)|(i, r, v)∈G} represents the attributes of item i and its first-order link entity nodes, and considers the relational context of the aggregation function, thereby generating a vector representation of item i: Where: represents the item embedding vector after aggregating the first-layer adjacency information of item i on the knowledge graph, that is, the vector representation of users and items in the latent factor module; The ID embedding vector representing entity v.
4. The method for recommending item category information in a graph neural network according to claim 1, characterized in that: The category information module uses a clustering method to aggregate and obtain an item prior knowledge vector, and clustering to obtain several clusters. Each cluster represents a class of similar items, that is, each cluster corresponds to an item category. The cluster centroid vector of each cluster is the item prior knowledge vector, which represents the common characteristics of a class of items; the number of each cluster is a pseudo-label, which is used to mark and distinguish different clusters.
5. The recommendation method for introducing item category information into a graph neural network according to claim 1, characterized in that: The category weighted aggregation module defines the user-item interaction matrix as follows: A fg Indicates that there is an interaction between the f-th user and the g-th item, that is, the f-th user selected the g-th item; Integrate the item category information into the interaction matrix to obtain the modified adjacency matrix A ic : A ic =Personalized Weighting(A) Where Personalized Weighting is an operation function that performs normalization operations based on the number of items; Using the adjacency matrix A ic Perform aggregation to obtain the user vector. The aggregation process is expressed as the following formula: Represents the vector representation of users in the category weighted aggregation module; The aggregation of item vectors is expressed as follows: Where: represents the item embedding vector after the first layer of adjacency information aggregation in the category weighted aggregation module, represents the ID embedding vector of entity v, e r The ID embedding vector representing the relation r.
6. The method for recommending item category information in a graph neural network according to claim 1, characterized in that: After the above modules are iteratively executed k layers, the vector representations of the k-th layer propagation process of the respective users and items in the latent factor module and the category weighted aggregation module are obtained, which are the latent factor module user vectors Latent factor module item vector Category-weighted aggregation module user vector and category-weighted aggregation module item vector All vector dimensions are 64-dimensional. In the rating prediction module, the user vector e of the corresponding layer can be obtained by performing add operations on them respectively. u and item vector e i : After the add operation, the user and item vectors can still be propagated multiple times, resulting in multiple layers of user vectors e u and item vector e i ; Perform add operations on the user vectors and item vectors generated by each layer: And u =and u (0) +…+and u (k) And i =and i (0) +…+and i (k) Where: e u represents the final user vector; e i Represents the final item vector, and the two vectors are multiplied to get the final score: y ui =e u T yes i The following loss function is used: Where: Represents the parameters that the neural network can automatically learn, e r represents the ID embedding vector of relation r; λ1 represents the parameter for controlling independence loss; λ2 represents the regularization parameter; L BPR The loss function is as follows: In the formula: O={(u,i,j)|(u,i)∈O + , (u, j)∈O - } represents the final user vector training set; O + represents the positive sample, that is, the observed sample; O - represents negative samples, i.e., unobserved samples; σ represents the sigmoid function, y ui and y uj Indicates the ratings of item i and item j by the same user u; Finally, based on the user-item rating y ui Sorting is performed to obtain a list of items recommended to the user.