Hyperbolic graph neural network recommendation method fusing comment scores
By constructing a hyperbolic graph neural network and integrating review rating data, the embedding distortion problem of graph neural networks when processing non-Euclidean structured data is solved, higher-quality user and item representation is achieved, and the accuracy and reliability of the recommendation system are improved.
Patent Information
- Application Number
- CN202510818089.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-18
- Publication Date
- 2025-10-03
AI Technical Summary
Existing graph neural networks have difficulties processing data with non-Euclidean structures. The embedding method cannot provide maximum expressive power or meaningful geometric representation, resulting in a decrease in the accuracy and reliability of recommendation results, especially when facing new users or new items. It is difficult to make accurate recommendations.
A hyperbolic graph neural network method that integrates review ratings is adopted. By introducing the BERT-Whitening algorithm and the hyperbolic embedding algorithm, a user-item review perception graph and a user-item graph are constructed. Embedding representation learning is performed in hyperbolic space, and a cross-view comparison loss function and a rating prediction loss function are constructed to optimize the hyperbolic graph neural network to improve recommendation accuracy.
By integrating review text and rating matrices, we can comprehensively capture user preferences and project features, improve the model's expressiveness and generalization capabilities for complex graph structures, enhance the accuracy and reliability of the recommendation system, and more accurately predict user ratings for projects.
Smart Images

Figure CN120744223A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of data mining and recommendation systems, and in particular to a hyperbolic graph neural network recommendation method integrating review scores. Background Art
[0002] With the rapid development of the internet and the explosive growth of data, accurately extracting the content users truly need from massive amounts of information has become crucial. Recommendation algorithms have emerged to address this need. Based on users' past behavior and clear preferences, they accurately predict items or content they might be interested in, effectively filtering information and providing personalized services.
[0003] In the field of recommendation algorithms, traditional methods such as collaborative filtering and content recommendation once held a prominent position. Collaborative filtering analyzes similarities between users to identify other users with similar tastes. Based on the preferences of these similar users, it then accurately recommends new items to the current user. Content recommendation, on the other hand, focuses on analyzing item features, such as text content and tags, to match relevant items to the user. In recent years, with the rapid development of natural language processing technology, text-based recommendation methods have emerged. These methods leverage textual information such as item reviews, summaries, and abstracts, leveraging advanced neural network technology to deeply mine semantic information within documents and enrich model data. Compared to single rating data, textual information inherently contains richer details, which not only provides more convincing explanations for recommendation results but also effectively alleviates data sparsity issues and improves the performance of recommendation systems. The rise of deep learning has injected new vitality into recommendation algorithms. Against this backdrop, recommendation systems based on graph neural networks (GNNs) have emerged. GNNs cleverly model the interactions between users and items as graph structures. By learning the underlying high-level features of these complex relationships, they significantly improve the accuracy and interpretability of recommendations. The emergence of this technology marks an important step forward for recommendation algorithms in processing complex data and exploring deep-seated user needs, leading a new trend in recommendation system technology.
[0004] While traditional collaborative filtering and content recommendation methods played an important role in the early days, they have gradually revealed numerous limitations in the face of today's complex and ever-changing user needs and massive amounts of data. Firstly, these traditional methods are limited in their ability to uncover deeper user interests, often confined to superficial preference analysis, making it difficult to accurately capture users' underlying and complex interests. Secondly, with the explosive growth of users and items, rating data between users and items has become increasingly sparse, resulting in a significant decline in the accuracy of recommendation models based on rating data when predicting user ratings for new items. The so-called "cold start" problem is particularly challenging for new users or items, and traditional methods often struggle to make accurate recommendations due to a lack of sufficient historical data. Furthermore, traditional neural network models struggle to model complex user behavior. They struggle to learn high-level user information and cannot fully understand the complex patterns and regularities behind user behavior. While the recent rise of graph neural networks has addressed the problem of modeling user-item interactions to some extent, they are not perfect.
[0005] Graph neural networks are based on Euclidean embeddings, which makes it difficult to capture non-Euclidean structures in data. Non-Euclidean structures are common in the real world, such as interpersonal relationships in social networks and entity associations in knowledge graphs. These complex relationships cannot be well expressed in Euclidean space. Moreover, Euclidean embeddings cannot provide maximum expressive power or meaningful geometric representations, leading to embedding distortion, which in turn affects the accuracy and reliability of recommendation results. Summary of the Invention
[0006] The present invention provides a hyperbolic graph neural network recommendation method that integrates review scores to overcome the difficulties in capturing the non-Euclidean structure of data in Euclidean space, the inability of the embedding method to provide maximized expressive power or meaningful geometric representation, resulting in embedding distortion, which in turn affects the accuracy and reliability of the recommendation results.
[0007] In order to achieve the above object, the technical solution of the present invention is:
[0008] A hyperbolic graph neural network recommendation method integrating review ratings includes:
[0009] S1: Obtain a review dataset, which includes user, project, rating, and review data, namely, user ID, project ID, user rating of the project, and user review of the project;
[0010] S2: Introducing the BERT-Whitening algorithm, using the BERT-Whitening algorithm to convert review data into review vectors, using graph theory methods to construct a user-item review perception graph based on users, items, ratings, and review vectors; using graph theory methods to construct a user-item graph based on users, items, and ratings;
[0011] S3: Introduce the hyperbolic embedding algorithm into the graph neural network to obtain the hyperbolic graph neural network. Input the user-item graph and the user-item review perception graph into the hyperbolic graph neural network for learning, and obtain the embedding representation of the user-item review perception graph and the user-item graph.
[0012] S4: Based on the embedding representation of user-item review perception graph and user-item graph, we construct cross-view contrast loss functions for users and items respectively.
[0013] S5: Map the user-item review perception graph and the user-item graph, make rating predictions based on the mapping results, and construct a loss function for rating prediction;
[0014] S6: Optimize the hyperbolic graph neural network based on the two cross-view loss functions and the loss function for rating prediction to obtain a prediction model. Input the user and item into the prediction model and output the user's predicted rating for the item.
[0015] Furthermore, we introduce the hyperbolic embedding algorithm into the graph neural network to obtain the hyperbolic graph neural network, which includes:
[0016] The graph neural network includes l layers of graph convolutional layers. In each layer of graph convolutional layer, hyperbolic embedding is introduced to replace the Euclidean space with the hyperbolic space. The input data is mapped into the hyperbolic space to obtain the hyperbolic graph convolutional layer. The mapping formulas are shown in (1) and (2).
[0017]
[0018] Among them, Exp O (·) and Log O (·) are the exponential map and logarithmic map in the Poincare sphere model, O is the origin, s is the eigenvector in Euclidean space, and y is the embedding vector in hyperbolic space.
[0019] Furthermore, the user-item graph is input into the hyperbolic graph neural network for learning to obtain the embedded representation of the user-item graph, including:
[0020] Construct the update formula of the user-item graph embedding in the l-th layer of hyperbolic graph convolutional layer, as shown in formulas (3) and (4),
[0021]
[0022] in, and represents the embedding representation of users and items in the hyperbolic graph neural network layer l of the user-item graph, N(i) represents the neighbor set of user i, N(j) represents the neighbor set of item j, d i and d j are the sum of the neighbor rating weights of user i and item j, r ij is the rating representation of user i and item j, and Represent the vectors of user i and item j in the l-1 layer of the user-item graph respectively;
[0023] The embedding representations obtained by each layer of hyperbolic graph convolution layer are weighted summed to obtain the final embedding representation of the user-item graph, as shown in formulas (5) and (6).
[0024]
[0025] Among them, α l is the weight of the lth layer, and They represent the final embedding representations of users and items in the user-item graph, respectively.
[0026] Furthermore, the user-item review perception graph is input into the hyperbolic graph neural network for learning to obtain the embedded representation of the user-item review perception graph, including:
[0027] S33. Considering the hyperbolic distance and hyperbolic attention mechanism, define user i, item j and the comment information e between them. ij Message passing in hyperbolic space, as shown in formulas (7) and (8),
[0028]
[0029] in, represents the message transmission between user i and project j, and Represent the vectors of user i and item j in the l-1 layer of the user-item comment perception graph, Exp O represents the exponential map in the Poincare sphere model, O is the origin, W j , W i , W e is a trainable weight matrix; Represents the comment information between user i and item j in the l-1th layer;
[0030] S34, construct the embedding data of the user-item comment perception graph in the lth layer according to the message passing between user i and item j in the hyperbolic space, as shown in formulas (9) and (10),
[0031]
[0032] in, represents the embedding representation of users and items in the hyperbolic graph neural network layer l of the user-item review perception graph, N(i) represents the neighbor set of node i, N(j) represents the neighbor set of node j, β ij represents the joint weight of ratings and reviews, D i , D j is the weighted degree, used to balance active nodes, β ij 、D i and D j As shown in formulas (11) and (12),
[0033]
[0034] D i =∑ j β ij ,D j =∑ i β ij (12)
[0035] Among them, W r Represents the scoring weight vector, W β is a learnable parameter, Softplus(x)=ln(1+e x ), used to ensure that the weights are non-negative, r ij is the user's rating of the project, e ij is the comment information between user i and item j.
[0036] S35. Perform weighted summation on the embedding representations obtained by each layer of hyperbolic graph convolution layer to obtain the final embedding representation of the user-item review perception graph, as shown in formulas (13) and (14).
[0037]
[0038] in, and Represents the final embedding representations of users and items learned by the hyperbolic graph convolutional neural network in the user-item review perception graph.
[0039] Furthermore, based on the embedding representations of the user-item review perception graph and the user-item graph, we construct cross-view contrast loss functions for users and items, respectively, including:
[0040] S41. Construct the user's cross-view contrast loss function based on the embedding representation of the user-item review perception graph and the user-item graph, as shown in formula (15).
[0041]
[0042] Among them, γ ij is the scoring weight, reflecting the user's preference for the project, δ ij is the comment weight, reflecting the importance of the comment semantics, D i , D j For weighted degree, use Poincare sphere distance As a similarity measure, represents the similarity between the embedding representation of user i in the user-item graph and the embedding representation of user i in the user-item review perception graph, represents the similarity between the embedding representation of user i in the user-item graph and the embedding representation of user k in the user-item review perception graph, as shown in formula (16),
[0043]
[0044] Where θ is the scaling factor, is the Poincare sphere distance, represents the hyperbolic distance between the user embedding representation in the user-item graph and the user embedding representation in the user-item review perception graph, as shown in formula (17),
[0045]
[0046] S42. Construct a cross-view contrast loss function for the project based on the embedding representation of the user-item review perception map and the user-item map, as shown in formula (18).
[0047]
[0048] in, represents the similarity between the embedding representation of item j in the user-item graph and the embedding representation of item j in the user-item review perception graph.
[0049] Furthermore, the user-item review perception graph and the user-item graph are mapped, and rating prediction is performed based on the mapping results. The loss function for rating prediction is constructed, including:
[0050] S51, map the final embedding representation of the user-item graph and the final embedding representation of the user-item review perception graph back to the Euclidean space through logarithmic mapping, as shown in formulas (19) and (20),
[0051]
[0052] and They represent the user vector representation of the user-item graph in the Euclidean space, the user vector representation of the user-item review perception graph, the item vector representation of the user-item graph, and the item vector representation of the user-item review perception graph;
[0053] S52, calculate the rating prediction of users and items, as shown in formulas (21) and (22),
[0054]
[0055] Among them, z i represents the vector representation of user i learned in the user-item graph and user-item review perception graph, z i represents the vector representation of item j learned in the user-item graph and the user-item review perception graph, represents the inner product operation;
[0056] S53, concatenate the vector representations of the user and the item and input them into MLP for prediction to obtain the final rating prediction, as shown in formulas (23) and (24).
[0057] h0=[z i ||z j ] (twenty three)
[0058] h l =σ(W l h l-1 +b l ) (l=1,2,…L-1) (24)
[0059] In formula (23), h0 represents the initialization input of MLP;
[0060] In formula (24), h l represents the rating prediction of the lth layer, W l The weight of layer l, b l is the bias of the lth layer;
[0061] After processing by the l-layer fully connected network, the final rating prediction is obtained, as shown in formula (25),
[0062]
[0063] Among them, σ is the activation function, is the final rating prediction, b L is the bias of the Lth layer of MLP;
[0064] S53. Use the mean square error as the loss function for the final score prediction, as shown in formula (26),
[0065]
[0066] Furthermore, the hyperbolic graph neural network is optimized based on two cross-view loss functions and a loss function for score prediction to obtain a prediction model, including:
[0067] S61. Construct a total loss function based on the two cross-view loss functions and the score prediction loss function, as shown in formula (27):
[0068]
[0069] Among them, θ and δ are task balance coefficients;
[0070] S62. Use the Adam optimizer to optimize the hyperbolic graph neural network based on the total loss function to obtain a prediction model.
[0071] Beneficial effects: The present invention provides a hyperbolic graph neural network recommendation method integrating review scores, which has the following advantages:
[0072] 1. By integrating review text and rating matrices, we construct two complementary graph structures: the user-item graph and the user-item review perception graph. These graphs comprehensively capture the nuances of user preferences and the multidimensional attributes of item features. By jointly learning the representations of these two graphs, we can reveal the complex interactions between users and items in different contexts, providing a more in-depth and precise feature representation for recommendation systems.
[0073] 2. Hyperbolic embedding representation learning is performed on the user-item graph and the user-item review perception graph, respectively. This can improve the model's adaptability to the global properties of interactive data, alleviate data distortion issues, enhance the model's ability to express complex graph structures, improve the generalization ability of user-item interaction data, and enhance the accuracy and reliability of recommendation results.
[0074] 3. Constructing a cross-view contrastive learning loss function can enhance the discriminability of user and item representations and improve the accuracy of the recommendation system. Contrastive learning encourages the model to learn to distinguish between relevant and irrelevant user-item pairs, thereby extracting higher quality user and item representations in the hyperbolic graph space. BRIEF DESCRIPTION OF THE DRAWINGS
[0075] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following is a brief introduction to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0076] Figure 1A flowchart of a hyperbolic graph neural network recommendation method integrating review scores provided by the present invention;
[0077] Figure 2 This is the overall architecture diagram of the algorithm;
[0078] Figure 3 Learn schematic diagrams for user-item graphs;
[0079] Figure 4 Learning a schematic for user-item review perception graph;
[0080] Figure 5 Schematic diagram of cross-view comparative learning. DETAILED DESCRIPTION
[0081] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0082] This embodiment provides a hyperbolic graph neural network recommendation method that integrates review scores, such as Figure 1 Shown, including:
[0083] S1: Obtain a review dataset, which includes user, project, rating, and review data, namely, user ID, project ID, user rating of the project, and user review of the project;
[0084] S2: Introducing the BERT-Whitening algorithm, using the BERT-Whitening algorithm to convert review data into review vectors, using graph theory methods to construct a user-item review perception graph based on users, items, ratings, and review vectors; using graph theory methods to construct a user-item graph based on users, items, and ratings;
[0085] S3: Introduce the hyperbolic embedding algorithm into the graph neural network to obtain the hyperbolic graph neural network. Input the user-item graph and the user-item review perception graph into the hyperbolic graph neural network for learning, and obtain the embedding representation of the user-item review perception graph and the user-item graph.
[0086] S4: Based on the embedding representation of user-item review perception graph and user-item graph, we construct cross-view contrast loss functions for users and items respectively.
[0087] S5: Map the user-item review perception graph and the user-item graph, make rating predictions based on the mapping results, and construct a loss function for rating prediction;
[0088] S6: Optimize the hyperbolic graph neural network based on the two cross-view loss functions and the loss function for rating prediction to obtain a prediction model. Input the user and item into the prediction model and output the user's predicted rating for the item.
[0089] Specifically, if Figure 2 As shown, first, a review dataset is obtained, which includes users, items, ratings, and review data. Ratings are represented in the form of a rating matrix, and reviews are represented in the form of review feature encoding. Obtaining the review dataset can provide data support for the prediction model and enhance the accuracy of the prediction model.
[0090] Secondly, we introduce the BERT-Whitening algorithm, which converts review data into review vectors. Graph theory methods are used to construct a user-item review perception graph based on users, items, ratings, and review vectors. We also use graph theory methods to construct a user-item graph based on users, items, and ratings. By integrating review text with the rating matrix, we construct two complementary graph structures: the user-item graph and the user-item review perception graph. These structures comprehensively capture the nuances of user preferences and the multidimensional attributes of item features. By jointly learning the representations of these two graphs, we can reveal the complex interactions between users and items in different contexts, providing a more in-depth and precise feature representation for the recommendation system.
[0091] Thirdly, a hyperbolic embedding algorithm is introduced into the graph neural network to obtain a hyperbolic graph neural network. The user-item graph and the user-item review perception graph are respectively input into the hyperbolic graph neural network for learning, and the embedding representations of the user-item review perception graph and the user-item graph are obtained. Learning the hyperbolic embedding representation of the user-item graph and the user-item review perception graph respectively can improve the model's adaptability to the global properties of interactive data, alleviate data distortion problems, enhance the model's ability to express complex graph structures, and improve the generalization ability of user-item interaction data.
[0092] Based on the embedded representations of the user-item review perceptual graph and the user-item graph, cross-view contrastive loss functions are constructed for users and items, respectively. The user-item review perceptual graph and the user-item graph are mapped, and rating predictions are made based on the mapping results. A loss function for rating prediction is constructed. By constructing a cross-view contrastive learning loss function, the discriminability of user and item representations can be enhanced, improving the accuracy of the recommendation system. Contrastive learning constructs positive and negative sample pairs, prompting the model to learn to distinguish between relevant and irrelevant user-item pairs, thereby refining higher-quality user and item representations in the hyperbolic graph space.
[0093] Finally, the hyperbolic graph neural network is optimized based on two cross-view loss functions and the loss function of rating prediction to obtain a prediction model. Users and items are input into the prediction model, and the predicted rating of the user for the item is output.
[0094] In a specific embodiment, a review dataset is obtained, wherein the review dataset includes user, project, rating, and review data, namely, user ID, project ID, user rating of the project, and user review of the project. The scheme is:
[0095] A 5-core dataset from the Amazon review dataset (each user or item has at least 5 review information) was selected, including "Digital Music", "Toys and Games", "Clothing" and "CDs and Vinyl". The ratings of the dataset are integers from 1 to 5. Each dataset is randomly divided into a training set, a validation set and a test set, which are 80%, 10% and 10% respectively. The rating is the rating matrix and the review is the review feature encoding. The training set is used to train the hyperbolic graph neural network, the validation set is used for parameter adjustment, and the test set is used to evaluate the performance of the prediction model.
[0096] In this solution, obtaining the review dataset can provide data support for the prediction model and enhance the accuracy of the prediction model.
[0097] In a specific embodiment, the BERT-Whitening algorithm is introduced to convert review data into review vectors using the BERT-Whitening algorithm. A graph theory method is used to construct a user-item review perception graph based on users, items, ratings, and review vectors. The scheme for constructing a user-item graph based on users, items, and rating data using the graph theory method is as follows:
[0098] S21. Initialize all input parameters, including node embedding vectors and edge features, and define two matrices U and V, representing the entity sets of users and items respectively;
[0099] S22, build user-item review perception graph, such as Figure 2 As shown in T, the specific steps are as follows:
[0100] 1. Introduce the BERT-Whitening algorithm to convert comment data into comment vectors. The comment vector between user i and item j after processing is e ij ;
[0101] 2. Construct the user-item review perception graph T. Based on the graph theory method, users and items are abstracted as nodes of the graph, and the rating and review interactions between users and items are used as edges to build connections; U T and V TRepresenting the matrix embeddings of users and items, using and Represents user i and item j, and the user's rating of the item As edge features, we can distinguish the semantic information carried by different scores;
[0102] S23, construction and user-project diagram, e.g. Figure 2 As shown in G in the figure, the specific steps are as follows:
[0103] Using graph theory, users and items are abstracted as nodes of the graph, and the rating interactions between users and items are used as edges to build connections. G and V G Represents a collection of entities of users and projects. In this framework, we use and Represents the specific entities of users and projects, and uses edges to represent the user's rating behavior on projects. Users and items constitute two non-overlapping vertex sets of the graph, while edges connect vertices from different sets, reflecting the interactive relationship between users and items.
[0104] In this solution, graph theory methods are used to construct a user-item graph based on user, item, and rating data. By integrating review text with the rating matrix, two complementary graph structures are constructed: the user-item graph and the user-item review perception graph. These structures comprehensively capture the subtle differences in user preferences and the multidimensional attributes of item features. By jointly learning the representations of these two graphs, the complex interactions between users and items in different contexts can be revealed, providing a more in-depth and accurate feature representation for the recommendation system.
[0105] In a specific embodiment, a hyperbolic embedding algorithm is introduced into a graph neural network to obtain a hyperbolic graph neural network. The user-item graph and the user-item review perception graph are respectively input into the hyperbolic graph neural network for learning. The solution for obtaining the embedded representation of the user-item review perception graph and the user-item graph is:
[0106] The graph neural network includes l layers of graph convolutional layers. In each layer of graph convolutional layer, hyperbolic embedding is introduced to replace the Euclidean space with the hyperbolic space. The input data is mapped into the hyperbolic space to obtain the hyperbolic graph convolutional layer. The mapping formulas are shown in (28) and (29).
[0107]
[0108] Among them, Exp O (·) and Log O (·) are the exponential map and logarithmic map in the Poincare sphere model, O is the origin, s is the eigenvector in Euclidean space, and y is the embedding vector in hyperbolic space;
[0109] The user-item graph is input into the hyperbolic graph neural network for learning to obtain the embedded representation of the user-item graph, such as Figure 3 The specific steps are as follows:
[0110] Construct the update formula for the user-item graph embedding in the l-th layer of hyperbolic graph convolutional layer, as shown in formulas (30) and (31),
[0111]
[0112] in, and represents the embedding representation of users and items in the hyperbolic graph neural network layer l of the user-item graph, N(i) represents the neighbor set of user i, N(j) represents the neighbor set of item j, d i and d j are the sum of the neighbor rating weights of user i and item j, r ij is the rating representation of user i and item j, and Represent the vectors of user i and item j in the l-1 layer of the user-item graph respectively;
[0113] The embedding representations obtained by each layer of hyperbolic graph convolution layer are weighted summed to obtain the final embedding representation of the user-item graph, as shown in formulas (32) and (33).
[0114]
[0115] Among them, α l is the weight of the lth layer, and Represent the final embedding representations of users and items in the user-item graph respectively;
[0116] like Figure 4 As shown in Figure 1, the user-item review perception graph is input into the hyperbolic graph neural network for learning to obtain the embedded representation of the user-item review perception graph. The specific steps are as follows:
[0117] S33. Each interaction between a user and an item contains two key features: rating and comment semantics. Compared with simple numerical evaluations, text evaluations have significant advantages due to their fine-grained semantic information. The detailed information contained in the comment semantics can reveal the user's preferences and the characteristics of the item, which is crucial for learning accurate user and item embedding representations. By analyzing these fine-grained semantic information, the model can have a deeper understanding of the relationship between users and items; detailed comment semantics helps the model identify the accuracy of users' preferences for items. This fine measurement can be further used to adjust the mutual influence weights between users and items, thereby optimizing the accuracy and personalization of the recommendation system; in hyperbolic space, message passing needs to consider hyperbolic distance and hyperbolic attention mechanism. Under the conditions of considering hyperbolic distance and hyperbolic attention mechanism, define user i, item j and the comment vector e between them ij Message passing in hyperbolic space, as shown in formulas (34) and (35),
[0118]
[0119] in, represents the message transmission between user i and project j, and Represent the vectors of user i and item j in the l-1 layer of the user-item comment perception graph, Exp O represents the exponential map in the Poincare sphere model, O is the origin, W j , W i , W e is a trainable weight matrix; Represents the comment information between user i and item j in the l-1th layer;
[0120] S34. Construct the embedding data of the user-item comment perception graph in the lth layer according to the message passing between user i and item j in the (l-1)th layer in the hyperbolic space, as shown in formulas (36) and (37).
[0121]
[0122] in, represents the embedding representation of users and items in the hyperbolic graph neural network layer l of the user-item review perception graph, N(i) represents the neighbor set of user i, N(j) represents the neighbor set of item j, β ij represents the joint weight of ratings and reviews, D i , D j is the weighted degree, used to balance active nodes, β ij 、D i and D j As shown in formulas (38) and (39),
[0123]
[0124] D i =∑ j β ij ,D j =∑ i β ij (39)
[0125] Among them, W r Represents the scoring weight vector, W β is a learnable parameter, Softplus(x)=ln(1+e x ), used to ensure that the weights are non-negative, r ij is the user's rating of the project, e ij is the comment vector between user i and item j;
[0126] S35. Perform weighted summation on the embedding representations obtained by each layer of hyperbolic graph convolutional layer to obtain the final embedding representation of the user-item review perception graph, as shown in formulas (40) and (41).
[0127]
[0128] in, and Represents the final embedding representations of users and items learned by the hyperbolic graph convolutional neural network in the user-item review perception graph.
[0129] In this scheme, each hyperbolic graph convolution layer in the hyperbolic graph neural network processes the embedded representation output by the previous hyperbolic graph convolution layer;
[0130] In the context of graph-structured data, users and items are considered nodes. Specifically, the process involves systematically aggregating the messages collected by each node, aiming to refine the embedding vectors of users and items by aggregating information from the node's neighborhood. This step is crucial for capturing the complex relationships between nodes and improving the quality of the embedding vector within the framework of graph neural networks. The hyperbolic embeddings of user i and item j can be updated by aggregating information from neighboring nodes and normalized to avoid the embedding norm being too large after aggregation and exceeding the Poincare sphere.
[0131] Hyperbolic space is a special continuous geometric space, whose notable feature is that any small area exhibits negative curvature, and this negative curvature remains constant over a wide range of space. Because hyperbolic space has the characteristic of exponentially increasing volume with dimension, it has become an optimal space for representing power-law distributed data structures (such as tree structures), and can accurately and efficiently capture the inherent hierarchical relationships and complex distribution trends of the data. In this solution, the graph neural network method is used to introduce hyperbolic embedding, which can improve the model's adaptability to the global properties of interactive data, alleviate data distortion problems, enhance the model's ability to express complex graph structures, and improve the generalization ability of user-item interaction data.
[0132] In a specific embodiment, the scheme for constructing the cross-view contrast loss function for users and items based on the embedding representation of the user-item review perception graph and the user-item graph is:
[0133] S41. Construct the user's cross-view contrast loss function based on the embedding representation of the user-item review perception graph and the user-item graph, as shown in formula (42).
[0134]
[0135] Among them, γ ij is the scoring weight, reflecting the user's preference for the project, δ ij is the comment weight, reflecting the importance of the comment semantics, D i , D j For weighted degree, use Poincare sphere distance As a similarity measure, represents the similarity between the embedding representation of user i in the user-item graph and the embedding representation of user i in the user-item review perception graph, Relative to It is a positive sample, represents the similarity between the embedding representation of user i in the user-item graph and the embedding representation of user k in the user-item review perception graph, Relative to is a negative sample, as shown in formula (43),
[0136]
[0137] Where θ is the scaling factor, is the Poincare sphere distance, represents the hyperbolic distance between the user embedding representation in the user-item graph and the user embedding representation in the user-item review perception graph, as shown in formula (44),
[0138]
[0139] S42. Construct a cross-view contrast loss function for the project based on the embedding representation of the user-item review perception map and the user-item map, as shown in formula (45).
[0140]
[0141] in, represents the similarity between the embedding representation of item j in the user-item graph and the embedding representation of item j in the user-item review perception graph.
[0142] In this scheme, constructing a cross-view contrast loss function can enhance the discriminability of user and item representations and improve the accuracy of the recommendation system, such as Figure 5 As shown in the figure, contrastive learning encourages the model to learn to distinguish between relevant and irrelevant user-item pairs by constructing positive and negative sample pairs. The higher the similarity of positive samples, the higher the correlation between users and items, thereby extracting higher quality user and item representations in the hyperbolic graph space.
[0143] In a specific embodiment, the user-item review perception graph and the user-item graph are mapped, rating prediction is performed based on the mapping result, and a loss function for rating prediction is constructed as follows:
[0144] S51. Map the final embedding representation of the user-item graph and the final embedding representation of the user-item review perception graph back to the Euclidean space through logarithmic mapping, as shown in formulas (46) and (47).
[0145]
[0146] and They represent the user vector representation of the user-item graph in Euclidean space, the user vector representation of the user-item review perception graph, the item vector representation of the user-item graph, and the item vector representation of the user-item review perception graph respectively;
[0147] S52, calculate the rating prediction of users and items, as shown in formulas (48) and (49),
[0148]
[0149]
[0150] Among them, z i represents the vector representation of user i learned in the user-item graph and user-item review perception graph, z j represents the vector representation of item j learned in the user-item graph and the user-item review perception graph, represents the inner product operation;
[0151] S53, concatenate the vector representations of the user and the item and input them into MLP for prediction to obtain the final rating prediction, as shown in formulas (50) and (51).
[0152] h0=[z i ||z j ] (50)
[0153] h l =σ(W l h l-1 +b l ) (l=1,2,…L-1) (51)
[0154] In formula (50), h0 represents the initialization input of MLP;
[0155] In formula (51), h l represents the rating prediction of the lth layer, W l The weight of layer l, b l is the bias of the lth layer;
[0156] After processing by the l-layer fully connected network, the final rating prediction is obtained, as shown in formula (52),
[0157]
[0158] Among them, σ is the activation function, is the final rating prediction, b L is the bias of the Lth layer of MLP;
[0159] S54. Use the mean square error as the loss function for the final score prediction, as shown in formula (53),
[0160]
[0161] In this solution, mapping the two perception maps back to Euclidean space makes it easier to use the loss function to optimize the model and reduce the computational complexity.
[0162] In a specific embodiment, the hyperbolic graph neural network is optimized based on two cross-view loss functions and a loss function for score prediction to obtain a prediction model:
[0163] S61. Construct a total loss function based on the two cross-view loss functions and the loss function of score prediction, as shown in formula (54).
[0164]
[0165] Among them, θ and δ are task balance coefficients;
[0166] S62. Use the Adam optimizer to optimize the hyperbolic graph neural network based on the total loss function to obtain a prediction model. The specific steps include:
[0167] 1. Select the hyperparameters of the Adam optimizer and use the validation set to verify the performance. The Adam hyperparameters with the best performance on the validation set are selected to optimize the hyperbolic graph neural network.
[0168] 2. Use the Adam optimizer to update the weight parameter W and bias parameter b of the hyperbolic graph neural network. The Adam optimizer combines the advantages of momentum and adaptive learning rate to effectively adjust parameters, allowing the recommendation model to better fit the training data and improve the accuracy of recommendations.
[0169] 3. Use the Adam optimizer to optimize the hyperbolic parameters in the hyperbolic contrast loss function and use the Adam optimizer to update the mapping parameters in Euclidean space. Similar to conventional Adam optimization, the training set data is calculated during training, the gradient is obtained, and the Adam update rule is applied to adjust the parameters. The value of , as shown in formulas (55) and (56),
[0170]
[0171] Where, express The gradient of the loss, express Gradient of the loss.
[0172] The efficiency of the Adam optimizer in Euclidean space and the properties of exponential mapping in hyperbolic space enable the model to effectively learn embedded representations in hyperbolic space and achieve good performance on recommendation tasks.
[0173] In order to verify the effectiveness of the present invention, a 5-core dataset from the Amazon review dataset was selected to verify the MSE results of different methods. The dataset is shown in Table 1.
[0174] Table 1
[0175] Dataset User (U) Project (V) Comment density Digital Music 5,541 3,568 64,706 0.330% Toys and Games 19,412 11,924 167,597 0.072% Clothing 39,387 23,033 278,677 0.031% CDs and Vinyl 75,258 64,443 1,097,592 0.023% Yelp 8,423 3,742 88,647 0.281%
[0176] LG and LT represent the number of graph neural network layers for user-item graph representation learning and review perception graph representation learning, respectively. After comparative verification, LG=2, LT=2 in the Digital_Music, Toys_and_Games dataset, LG=2, LT=3 in the Clothing, CDs_and_Vinyl dataset, and LG=3, LT=3 in the Yelp dataset have the best results. The MSE results of different methods on the five datasets are shown in Table 2.
[0177] Table 2
[0178]
[0179] As can be seen from the above table, the recommendation method proposed in this invention has the lowest MSE value on all five datasets, which indicates that the method performs better than other methods on these datasets.
[0180] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A hyperbolic graph neural network recommendation method integrating review scores, characterized in that: include: S1: Obtain a review dataset, which includes user, project, rating, and review data, namely, user ID, project ID, user rating of the project, and user review of the project; S2: Introducing the BERT-Whitening algorithm, using the BERT-Whitening algorithm to convert review data into review vectors, using graph theory methods to construct a user-item review perception graph based on users, items, ratings, and review vectors; using graph theory methods to construct a user-item graph based on users, items, and ratings; S3: Introduce the hyperbolic embedding algorithm into the graph neural network to obtain the hyperbolic graph neural network. Input the user-item graph and the user-item review perception graph into the hyperbolic graph neural network for learning, and obtain the embedding representation of the user-item review perception graph and the user-item graph. S4: Based on the embedding representation of user-item review perception graph and user-item graph, we construct cross-view contrast loss functions for users and items respectively. S5: Map the user-item review perception graph and the user-item graph, make rating predictions based on the mapping results, and construct a loss function for rating prediction; S6: Optimize the hyperbolic graph neural network based on the two cross-view loss functions and the loss function for rating prediction to obtain a prediction model. Input the user and item into the prediction model and output the user's predicted rating for the item.
2. A hyperbolic graph neural network recommendation method integrating review scores according to claim 1, characterized in that: By introducing the hyperbolic embedding algorithm into the graph neural network, we obtain the hyperbolic graph neural network, which includes: The graph neural network includes l layers of graph convolutional layers. In each layer of graph convolutional layer, hyperbolic embedding is introduced to replace the Euclidean space with the hyperbolic space. The input data is mapped into the hyperbolic space to obtain the hyperbolic graph convolutional layer. The mapping formulas are shown in (1) and (2). Among them, Exp O (·) and Log O (·) are the exponential map and logarithmic map in the Poincare sphere model, O is the origin, s is the eigenvector in Euclidean space, and y is the embedding vector in hyperbolic space.
3. The hyperbolic graph neural network recommendation method integrating review scores according to claim 2 is characterized in that: The user-item graph is fed into a hyperbolic graph neural network for learning to obtain an embedded representation of the user-item graph, including: Construct the update formula of the user-item graph embedding in the l-th layer of hyperbolic graph convolutional layer, as shown in formulas (3) and (4), in, and represents the embedding representation of users and items in the hyperbolic graph neural network layer l of the user-item graph, N(i) represents the neighbor set of user i, N(j) represents the neighbor set of item j, d i and d j are the sum of the neighbor rating weights of user i and item j, r ij is the rating representation of user i and item j, and Represent the vectors of user i and item j in the l-1 layer of the user-item graph respectively; The embedding representations obtained by each layer of hyperbolic graph convolution layer are weighted summed to obtain the final embedding representation of the user-item graph, as shown in formulas (5) and (6). Among them, α l is the weight of the lth layer, and They represent the final embedding representations of users and items in the user-item graph, respectively.
4. The hyperbolic graph neural network recommendation method integrating review scores according to claim 3 is characterized in that: The user-item review perception graph is input into the hyperbolic graph neural network for learning to obtain the embedded representation of the user-item review perception graph, including: S33. Considering the hyperbolic distance and hyperbolic attention mechanism, define user i, item j and the comment vector e between them. ij Message passing in hyperbolic space, as shown in formulas (7) and (8), in, represents the message transmission between user i and project j, and Represent the vectors of user i and item j in the l-1 layer of the user-item comment perception graph, Exp O represents the exponential map in the Poincare sphere model, O is the origin, W j , W i , W e is a trainable weight matrix; Represents the comment information between user i and item j in the l-1th layer; S34, construct the embedding data of the user-item comment perception graph in the lth layer according to the message passing between user i and item j in the hyperbolic space, as shown in formulas (9) and (10), in, represents the embedding representation of users and items in the hyperbolic graph neural network layer l of the user-item review perception graph, N(i) represents the neighbor set of user i, N(j) represents the neighbor set of item j, β ij represents the joint weight of ratings and reviews, D i , D j is the weighted degree, used to balance active nodes, β ij 、D i and D j As shown in formulas (11) and (12), D i =∑ j b ij ,D j =∑ i b ij (12) Among them, W r Represents the scoring weight vector, W β is a learnable parameter, Softplus(x)=ln(1+e x ), used to ensure that the weights are non-negative, r ij is the user's rating of the project, e ij is the comment vector between user i and item j; S35. Perform weighted summation on the embedding representations obtained by each layer of hyperbolic graph convolution layer to obtain the final embedding representation of the user-item review perception graph, as shown in formulas (13) and (14). in, and Represents the final embedding representations of users and items learned by the hyperbolic graph convolutional neural network in the user-item review perception graph.
5. The hyperbolic graph neural network recommendation method integrating review scores according to claim 4 is characterized in that: Based on the embedding representation of the user-item review perception graph and the user-item graph, we construct the cross-view contrast loss functions for users and items respectively, including: S41. Construct the user's cross-view contrast loss function based on the embedding representation of the user-item review perception graph and the user-item graph, as shown in formula (15). Among them, γ ij is the scoring weight, reflecting the user's preference for the project, δ ij is the comment weight, reflecting the importance of the comment semantics, D i , D j For weighted degree, use Poincare sphere distance As a similarity measure, represents the similarity between the embedding representation of user i in the user-item graph and the embedding representation of user i in the user-item review perception graph, represents the similarity between the embedding representation of user i in the user-item graph and the embedding representation of user k in the user-item review perception graph, as shown in formula (16), Where θ is the scaling factor, is the Poincare sphere distance, represents the hyperbolic distance between the user embedding representation in the user-item graph and the user embedding representation in the user-item review perception graph, as shown in formula (17), S42. Construct a cross-view contrast loss function for the project based on the embedding representation of the user-item review perception map and the user-item map, as shown in formula (18). in, represents the similarity between the embedding representation of item j in the user-item graph and the embedding representation of item j in the user-item review perception graph.
6. The hyperbolic graph neural network recommendation method integrating review scores according to claim 5 is characterized in that: Map the user-item review perception graph and the user-item graph, make rating predictions based on the mapping results, and construct a loss function for rating prediction including: S51, map the final embedding representation of the user-item graph and the final embedding representation of the user-item review perception graph back to the Euclidean space through logarithmic mapping, as shown in formulas (19) and (20), and They represent the user vector representation of the user-item graph in Euclidean space, the user vector representation of the user-item review perception graph, the item vector representation of the user-item graph, and the item vector representation of the user-item review perception graph; S52, calculate the rating prediction of users and items, as shown in formulas (21) and (22), Among them, z i represents the vector representation of user i learned in the user-item graph and user-item review perception graph, z j represents the vector representation of item j learned in the user-item graph and the user-item review perception graph, represents the inner product operation; S53, concatenate the vector representations of the user and the item and input them into MLP for prediction to obtain the final rating prediction, as shown in formulas (23) and (24). h0=[z i ||with j ] (23) h l =σ(W l h l-1 +b l ) (l=1,2,…L-1) (24) In formula (23), h0 represents the initialization input of MLP; In formula (24), h l represents the rating prediction of the lth layer, W l The weight of layer l, b l is the bias of the lth layer; After processing by the l-layer fully connected network, the final rating prediction is obtained, as shown in formula (25), Among them, σ is the activation function, is the final rating prediction, b L is the bias of the Lth layer of MLP; S53. Use the mean square error as the loss function for the final score prediction, as shown in formula (26), 7. The hyperbolic graph neural network recommendation method integrating review scores according to claim 6 is characterized in that: The hyperbolic graph neural network is optimized based on two cross-view loss functions and a loss function for score prediction to obtain a prediction model, including: S61. Construct a total loss function based on the two cross-view loss functions and the score prediction loss function, as shown in formula (27): Among them, θ and δ are task balance coefficients; S62. Use the Adam optimizer to optimize the hyperbolic graph neural network based on the total loss function to obtain a prediction model.
