Fine-grained score graph recommendation method based on comment emotion weighting mechanism

By combining sentiment analysis and graph neural networks, continuously weighted scores are generated and fine-grained modeling is performed, which solves the problems of coarse score expression and lack of integration of sentiment information in existing recommendation technologies, and achieves more accurate understanding of user preferences and improved recommendation accuracy.

CN121479449APending Publication Date: 2026-02-06CHONGQING UNIV OF POSTS & TELECOMM
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511624735.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-07
Publication Date
2026-02-06

AI Technical Summary

Technical Problem

Existing recommendation technologies suffer from coarse rating signal representation, failing to reflect subtle differences in user sentiment. Comment sentiment information is not directly used for rating correction and graph structure optimization. Graph recommendation models lack unified modeling of comment sentiment and ratings, making it difficult to achieve fine-grained understanding of user preferences and interaction modeling.

Method used

By converting comment texts into sentiment scores through sentiment analysis, and fusing them with the original scores to generate continuous weighted scores, a hierarchical attention mechanism is used to model the comment sets of users and items, constructing a user-item heterogeneous graph, and using graph neural networks for message passing and aggregation to predict users' preference scores for target items.

Benefits of technology

It improves the accuracy of fine-grained user preference modeling, interprets recommendation results through sentiment weighting and hierarchical attention mechanisms, breaks through the limitations of traditional discrete scoring, and can express continuous changes in preference intensity, thereby improving recommendation accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121479449A_ABST
    Figure CN121479449A_ABST
Patent Text Reader

Abstract

The invention discloses a comment emotion weighting mechanism-based fine-grained score graph recommendation method, which comprises the following steps of: taking users and items as graph nodes, taking continuous scores as edge weights, taking comment semantic features as edge features, carrying out message transmission and aggregation through a graph convolutional network, and realizing score prediction in combination with multi-source representation fusion. A large language model is used for analyzing comment emotion to generate an emotion score, the emotion score and an original score of a user are subjected to dynamic weighted fusion, an emotion weighted score is generated, rough expression of traditional discrete scores is broken through, user preferences are described more finely, and the problem that the score is inconsistent with the comment emotion is relieved. Meanwhile, in order to fully mine multi-layer preference information in comments, a three-layer attention mechanism is introduced by research, and semantic information is extracted and aggregated layer by layer from a word level, a sentence level and a comment level. Experimental results of comparing three data sets in Amazon show that compared with an optimal comparison method, the mean square error of the recommendation method is increased by about 2.87%, 2.08% and 2.17%.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of text data mining and analysis, specifically involving intelligent recommendation technology and graph neural network technology, and in particular a fine-grained graph recommendation method that integrates comment sentiment analysis and rating data. Background Technology

[0002] With the development of the internet, user-generated content is becoming increasingly abundant on various platforms, and user ratings and reviews have become the core data source for recommendation systems. Traditional rating-based recommendation methods predict preferences by analyzing user rating records, which has improved recommendation effectiveness to some extent, but still has limitations.

[0003] Ratings, as a form of discrete feedback, typically only reflect a user's overall satisfaction with an item, failing to capture more nuanced emotional attitudes and preferences. Compared to single ratings, review texts contain rich details and emotional information, and are widely used to alleviate data sparsity and cold-start problems. By performing sentiment analysis and fine-grained parsing of reviews, recommender systems can more accurately understand users' actual needs, thereby improving recommendation quality. Modern recommender models typically consist of user-item embedding learning modules and user-item interaction modeling modules. Especially in review-based recommender systems, Natural Language Processing (NLP) techniques are used for deep parsing of review content, generating user or item embeddings by aggregating review text, thus enhancing the model's expressive power.

[0004] Despite initial progress in review-based recommendation, existing methods still face several challenges in utilizing reviews. On one hand, most methods simply aggregate reviews as overall semantic features; for example, DeepCoNN extracts embeddings by connecting user history reviews and using convolutional neural networks (CNNs), but neglects the personalized emotional details hidden within each review. On the other hand, existing review-based recommendation models largely rely on behavioral data for interaction modeling, but are limited by rating sparsity and behavioral noise, resulting in insufficient user representation learning. To address these issues, graph neural network-based recommendation methods can effectively model the complex interaction relationships between users and items, rating-based recommendation methods can improve the expressive power of rating signals, and the development of review sentiment analysis technology, especially the introduction of large language models, provides recommendation systems with more detailed and semantically rich modeling possibilities.

[0005] However, existing recommendation technologies still have the following problems: (1) rating signals are usually treated as discrete labels, which are coarse and cannot reflect the subtle differences in user emotions; (2) comment sentiment information is mostly used as auxiliary features and is not directly used for rating correction and graph structure optimization; (3) graph recommendation models lack a unified model for the fusion mechanism of comment sentiment and rating, making it difficult to achieve true fine-grained understanding of user preferences and interaction modeling. Summary of the Invention

[0006] In view of this, the purpose of this invention is to provide a fine-grained rating graph recommendation method based on a comment sentiment weighting mechanism. The method aims to transform comment text into sentiment scores through sentiment analysis, and then merge these scores with the original scores to generate continuous, fine-grained sentiment-weighted scores. Combined with graph structure recommendation methods, this improves the fine-grainedness and accuracy of user-item preference modeling.

[0007] To achieve the above objectives, the present invention provides the following technical solution: A fine-grained rating graph recommendation method based on a sentiment-weighted mechanism for reviews is provided, including the following steps: Step S1: Use a sentiment analysis model to process user comments on the project and generate a sentiment score; Step S2: The sentiment score is weighted and fused with the user's original rating of the project to generate a continuous sentiment weighted score; Step S3: Use a hierarchical attention mechanism to model the comment sets of users and projects, and generate global semantic representations of users and projects respectively; Step S4: Construct a user-item heterogeneous graph, including a set of nodes and a set of edges. The set of nodes includes all users and items, and the set of edges is generated by interaction ratings, representing the interaction relationships between users and items. Each edge is associated with sentiment-weighted ratings and edge features. Step S5: Based on the user-item heterogeneous graph, use graph neural networks for message passing and aggregation, predict user preference ratings for target items, minimize the error of the predicted ratings using a loss function, and generate recommendations.

[0008] Furthermore, in step S1, the sentiment analysis model used is a large language model; the large language model classifies the comment text into predefined sentiment categories and maps these categories into discrete numerical scores as the sentiment score.

[0009] Furthermore, the sentiment analysis employs the OpenNLU-v1 large language model to analyze user reviews of the item. Each comment Classified into one of five sentiment levels, the system integrates user sentiment with original user ratings, quantifies user sentiment characteristics, and obtains a sentiment rating matrix. .

[0010] Furthermore, in step S2, the sentiment score is weighted and fused with the user's original score for the project. This weighted fusion is achieved through the following method: [The original score matrix is ​​then used for...] With sentiment rating matrix By combining these methods, the rating matrix can be corrected and updated, generating a continuously corrected rating matrix. To balance the impact of rating data and comment text on users' genuine emotional expression, a dynamic weighting mechanism is established that integrates user emotional scores and original user ratings. The continuously corrected rating matrix... Emotion-weighted rating The composition and specific implementation method are as follows:

[0011] in, Sentiment-weighted score; Original rating; Sentiment rating; : Weighting coefficients, and ∈[0,1]; Representing the One user, Representing the One project.

[0012] Furthermore, the hierarchical attention mechanism employed in step S3 includes: (1) Sentence-level attention layer: Collect comments from each user or project to form a set, and further divide the comment set into several sentences, each represented by a word sequence. Use a bidirectional recurrent neural network to perform context modeling on the word sequence to obtain sentence-level semantic representation vectors; (2) Comment-level attention layer: capture the importance of different sentences in the overall semantics of the comment, and fuse the weights of the sentence-level semantic representation vector to obtain the comment-level semantic representation vector; (3) User-level / project-level attention layer: The comment-level semantic representation vector is weighted and aggregated to obtain the user-level / project-level semantic representation vector.

[0013] Furthermore, in step S4, the edge feature construction step includes: incorporating user-item interaction comments. Input the BERT model, extract the [CLS] vector, and perform a Whitening operation to obtain the interactive semantic representation. The interaction-level semantic representation is concatenated with the user-level and item-level semantic representations, and the edge features are obtained after linear transformation. .

[0014]

[0015]

[0016] The interactive-level semantic representation is obtained by encoding a single user-item comment text through a pre-trained language model, and the user global semantic representation and the item global semantic representation are obtained by modeling all historical comments of users and items through a hierarchical attention mechanism. in, For learnable mapping matrix, This represents a vector concatenation operation. , These are user-level and project-level semantic representation vectors.

[0017] Furthermore, the feature is that, in step S5, the message passing process of the graph neural network is dynamically controlled by the weights of the edges; The message calculation method from the project node to the user node is as follows:

[0018] The message calculation method for transmission from the user node to the project node is as follows:

[0019] in, :Attention No. Layer from project To users The message being delivered; :Attention No. Layer from user To the project The message being delivered; : Rating-driven weighted function; Edge weight coefficient; Sentiment-weighted score; , Learnable transformation matrix; : The semantic representation vector of the comment text; , Projects and user nodes in the 1st... Layer embedding; The propagation layer number of the graph neural network, and It is a positive integer; Representing the One user, Representing the One project.

[0020] Furthermore, the scoring-driven weighting function, used to calculate the continuous weights of the edges, has the following specific form:

[0021] The semantic representation vector of the comment text is used to characterize the detailed information of local interactions and integrate the global preference features of users and projects. Its specific form is as follows:

[0022] in, ; Learnable parameters used to control the linear scaling of the score before transformation; Learnable bias, used to adjust the baseline of the overall weights; The function ensures that the weight values ​​are within the interval (0, 1); Learnable mapping matrix; Interactive semantic representation vector; , User-level and project-level semantic representation vectors.

[0023] Furthermore, in step 5, when predicting the user's preference rating for the target item, the structural representation learned from the graph neural network and the semantic representation learned from the comments are integrated, specifically implemented in the following way:

[0024]

[0025]

[0026]

[0027] ,

[0028] in, Model prediction score; , : The fused semantic representation vectors of users and projects; : Semantic representation vector of user comments; , : A graph structure representation vector of user and project nodes; , Users and project nodes at the 1st Layer embedding; :Attention No. Layer from project To users The message being delivered; :Attention No. Layer from user To the project The message being delivered; The propagation layer number of the graph neural network, and It is a positive integer; Representing the One user, Representing the One project; This represents a vector concatenation operation, resulting in a merged vector. It includes users' or projects' structural preferences and the subjective emotions expressed in the text.

[0029] Furthermore, the loss function used is the mean squared error loss, which is used to calculate the difference between the model's predicted score and the sentiment-weighted score:

[0030] in, The loss to be minimized during training, which measures the magnitude of the error between the model's predicted value and the true value; : The observed set of user-project interactions; Model-predicted rating, i.e., the user rating predicted by the model. For the project The scoring results; Sentiment-weighted rating is a continuous rating obtained by weighting the original rating with the sentiment rating.

[0031] The present invention also provides a computer-readable storage medium having a computer program stored thereon. When the program is executed by one or more processors, the processors are able to implement the fine-grained rating map recommendation method based on the comment sentiment weighting mechanism described above. The storage medium includes, but is not limited to, read-only memory (ROM), random access memory (RAM), disk, optical disk, flash memory, and other media capable of storing program code.

[0032] The beneficial effects of this invention are as follows: (1) The sentiment weighting mechanism and hierarchical attention mechanism provide a retrospective basis for the recommendation results, which can explain the positive or negative emotions that the recommendation is based on, and which historical comments played a key role. When the user rating is inconsistent with the sentiment of the comments, such as giving a high score but writing a bad review, the sentiment weighting mechanism can play a smoothing and correcting role, making the preference model more consistent with the user's true intention.

[0033] (2) It breaks through the limitations of traditional discrete ratings and can express continuous changes in preference intensity. By introducing continuous sentiment-weighted ratings as a more accurate supervision signal and constructing a weighted graph structure with fine granularity, it can more accurately capture users' true preferences. Experiments on the Amazon public dataset show that the MSE index of this method is significantly better than that of existing mainstream models in the rating prediction task, and the recommendation accuracy is high.

[0034] (3) The present invention provides a fine-grained rating graph recommendation method based on the sentiment weighting mechanism of comments. It introduces sentiment analysis results in a coordinated manner from the two levels of rating generation mechanism and graph construction logic, thereby enhancing the expressive power of the supervision signal and the interpretability of the model of the recommendation system.

[0035] Other advantages, objectives, and features of the invention will be set forth in part in the description which follows, and in part will be apparent to those skilled in the art from the following examination, or may be learned from practice of the invention. The objectives and other advantages of the invention can be realized and obtained through the following description. Attached Figure Description

[0036] To make the objectives, technical solutions, and advantages of the present invention clearer, the preferred embodiments of the present invention will be described in detail below with reference to the accompanying drawings, wherein: Figure 1 This is a structural diagram of a fine-grained rating graph recommendation method (FGSW-GRec model) based on a sentiment-weighted comment mechanism. Detailed Implementation

[0037] The following specific examples illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. Unless otherwise specified, the following embodiments and features can be combined with each other.

[0038] The accompanying drawings are for illustrative purposes only and are schematic diagrams, not actual pictures. They should not be construed as limiting the invention. To better illustrate the embodiments of the invention, some parts in the drawings may be omitted, enlarged, or reduced, and do not represent the actual product dimensions. It is understandable to those skilled in the art that some well-known structures and their descriptions may be omitted in the drawings.

[0039] In the accompanying drawings of the embodiments of the present invention, the same or similar reference numerals correspond to the same or similar components. In the description of the present invention, it should be understood that if terms such as "upper," "lower," "left," "right," "front," and "rear" indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings, they are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, the terms used to describe positional relationships in the drawings are only for illustrative purposes and should not be construed as limiting the present invention. For those skilled in the art, the specific meaning of the above terms can be understood according to the specific circumstances.

[0040] For ease of understanding, the preferred embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0041] like Figure 1 As shown, a fine-grained rating graph recommendation method based on a sentiment-weighted mechanism for reviews includes the following steps: S1: Use a sentiment analysis model to process user comments on the project and generate sentiment scores; S2: The sentiment score is weighted and fused with the user's original rating of the project to generate a continuous sentiment weighted score; S3: A hierarchical attention mechanism is used to model the comment sets of users and projects, generating global semantic representations of users and projects respectively; S4: Construct a user-project heterogeneous graph, including a set of nodes and a set of edges. The set of nodes includes all users and projects, and the set of edges is generated by interaction ratings, representing the interaction relationships between users and projects. Each edge is associated with sentiment-weighted ratings and edge features. S5: Based on the user-item heterogeneous graph, a graph neural network is used for message passing and aggregation to predict the user's preference rating for the target item. A loss function is used to minimize the error of the predicted rating to generate recommendations.

[0042] Step 1: Use OpenNLU-v1 to process user comments on the project and generate a sentiment rating matrix. .

[0043] Given user Collections, Projects Set, original rating matrix and a collection of comment texts Using Alibaba's open-source large language model OpenNLU-v1, we analyzed the set of user comments on the project. Each comment The emotion category is classified into one of five levels, mapping the emotion category to discrete emotion scores. By integrating user sentiment with original user ratings, and quantifying user sentiment characteristics, a sentiment rating matrix is ​​obtained. .

[0044] Table 1 Emotional Level Rating Mapping

[0045] Step 2: Analyze the sentiment rating matrix Compared with the original rating matrix of users for the project Weighted fusion is performed to generate a continuous sentiment-weighted score matrix. .

[0046] To balance the impact of rating data and comment text on users' genuine emotional expression, we integrate user sentiment scores with original user ratings, using a sentiment-weighted coefficient. By integrating raw scores and sentiment scores, the raw score matrix is... With sentiment rating matrix By combining these methods, the rating matrix can be corrected and updated, generating a continuously corrected rating matrix. The continuously corrected rating matrix Emotion-weighted rating The composition and specific implementation method are as follows:

[0047] in, Weighted scoring based on emotional factors; This is the original score; Rate the sentiment; These are weighting coefficients, and ∈[0,1], used to balance the importance of raw scores and sentiment analysis scores; Representing the One user, Representing the One project.

[0048] Step 3: Model the comment sets of users and projects using a hierarchical attention mechanism to generate global semantic representations of users respectively. and project global semantic representation .

[0049] This study employs a hierarchical attention mechanism combined with a pre-trained language model to encode comments, fully mining the multi-layered semantic information contained within the comment text. By modeling word-level, sentence-level, and comment-level semantic features, global semantic representations of users and items are obtained respectively. Furthermore, by combining interactive comment information, edge feature representations are generated, providing high-quality input for subsequent graph models.

[0050] (1) Sentence-level attention layer: collecting information from each user The comments form a collection Each comment It is further divided into several sentences, each sentence consisting of a sequence of words. Representation. A bidirectional GRU is used to model the context of word sequences, resulting in sentence-level semantic representation vectors. :

[0051] (2) Comment-level attention layer: The importance of different sentences in the overall semantics of the comment is captured through the attention mechanism, and the sentence-level semantic representation vector is generated. The weight is defined as :

[0052] Comment-level semantic representation vector for:

[0053] in, is a learnable weight matrix, representing a linear transformation matrix used to map sentence vectors to the attention space; for The transpose of the matrix; Let be the semantic representation of the s-th sentence; Let be the index variable for summation, representing all sentences in the same comment. (3) User (Project) Level Attention Layer: A user (project) typically corresponds to multiple historical comments, but different comments contribute differently to the overall user (project) preference. Therefore, a comment-level attention layer is introduced to address the comment-level semantic representation vector. Perform weighted aggregation to obtain user (project) level semantic representation vectors. ( ).

[0054]

[0055]

[0056] in, Let c be the attention weight of the comment. The comment vectors are mapped to the attention space using a learnable matrix; for ; Let c be the semantic representation of the comment. For users, For the project.

[0057] Step 4: Construct a user-project heterogeneity graph.

[0058] Based on this, a user-project heterogeneity graph is constructed. The node set includes all users. and all projects edge set Generated by interactive ratings, representing the user's interaction with the project.

[0059] Each node (user / item) is initialized as a free embedding vector:

[0060] Each edge is associated with two types of key information: ① continuous score Calculated through an emotion-weighted mechanism; ② Edge features Generated by BERT-Whitening, it includes the user global semantic representation and the item global semantic representation, capturing the user's fine-grained preference features for items.

[0061] User interactions and comments with the project Input the BERT model, extract the [CLS] vector, and perform a Whitening operation to obtain the interactive semantic representation. The interaction-level semantic representation is concatenated with the user-level and item-level semantic representations, and the edge features are obtained after linear transformation. .

[0062]

[0063]

[0064] The interactive-level semantic representation is obtained by encoding a single user-item comment text through a pre-trained language model, and the user global semantic representation and the item global semantic representation are obtained by modeling all historical comments of users and items through a hierarchical attention mechanism. in, It is a learnable mapping matrix; This represents a vector concatenation operation; , These are user-level and project-level semantic representation vectors.

[0065] Step 5: Based on the user-item heterogeneous graph, use graph neural networks for message passing and aggregation, predict user preference ratings for target items, and use a loss function to minimize the error of the predicted ratings to generate recommendations.

[0066] (1) Message passing and aggregation: In the graph neural network, the first step is to pass messages and aggregate them. Within the layer, sentiment-weighted messages are transmitted by user nodes receiving messages from their adjacent project nodes or by project nodes receiving messages from their user nodes.

[0067] Specifically, the message calculation method from the project node to the user node is as follows:

[0068] The message calculation method from the user node to the project node is as follows:

[0069] in, :Attention No. Layer from project To users The message being delivered; :Attention No. Layer from user To the project The message being delivered; : Rating-driven weighted function; Edge weight coefficient; Sentiment-weighted score; , Learnable transformation matrix; Edge features; , Projects and user nodes in the 1st... Layer embedding; The propagation layer number of the graph neural network, and It is a positive integer; Representing the One user, Representing the One project.

[0070] This continuous weighting mechanism enables message delivery to be adaptively adjusted according to the rating intensity, effectively characterizing the interaction intensity under different emotional weights and overcoming the information loss problem of traditional discrete rating models.

[0071] The above-mentioned score-driven weighting function is used to calculate the continuous weights of edges, and its specific form is as follows:

[0072] in, These are learnable parameters used to control the linear scaling of the score before transformation; This is a learnable bias, used to adjust the baseline of the overall weights; The function ensures that the weight values ​​are within the interval (0, 1).

[0073] (2) Message Aggregation: User nodes and project nodes aggregate weighted messages from their adjacent nodes. User nodes Project Nodes In attention The layer is updated as follows:

[0074]

[0075] Finally, stacking After layer propagation, the final representations of user nodes and project nodes are obtained:

[0076] These representations will be used in the subsequent score prediction process.

[0077] in, , This indicates that the user and project node are at the [number]th [time]. Layer embedding; Indicates attention Layer from project To users The message being delivered; Indicates attention Layer from user To the project The message being delivered; The propagation layer number of the graph neural network, and It is a positive integer; Representing the One user, Representing the One project; This represents a vector concatenation operation, resulting in a merged vector. It includes users' or projects' structural preferences and the subjective emotions expressed in the text.

[0078] (3) Predicting ratings: When predicting user preference ratings for target items, the structural representations learned from graph neural networks and semantic representations learned from reviews are integrated, specifically implemented in the following way:

[0079]

[0080]

[0081] in, Score the model predictions; , This is the merged user and project representation vector; , Vectors representing the semantics of users and projects; , A graph structure representation vector for users and project nodes; This represents a vector concatenation operation, resulting in a merged vector. It includes users' or projects' structural preferences and the subjective emotions expressed in the text.

[0082] Since we are using a weighted, continuously generated score matrix Therefore, this invention uses the mean squared error loss function for training, so that the model's predicted score is as close as possible to the sentiment-weighted score.

[0083]

[0084] in, The loss to be minimized during training measures the magnitude of the error between the model's predicted values ​​and the true values. For the observed set of user-project interactions; The model predicts a score, that is, the user score predicted by the model. For the project The scoring results; Sentiment-weighted scoring, which is a continuous score obtained by weighting the original score and the sentiment score, optimizes the performance of the entire recommendation model.

[0085] The present invention also provides a read-only memory (ROM) storing a computer program, which can implement the above-mentioned fine-grained rating map recommendation method based on the sentiment weighting mechanism of comments.

[0086] This invention selects three recommendation system datasets containing reviews and ratings from Amazon's public datasets: Digital Music, Toys and Games, and Office Products, to evaluate the performance of the proposed fine-grained rating graph recommendation method (FGSW-GRec model) based on a review sentiment weighting mechanism. Each dataset contains user ratings (1–5 stars) for products and review text. All three datasets belong to Amazon 5-core, where 5-code represents a user or item with at least 5 reviews. Each dataset is randomly divided into training, validation, and test sets, with proportions of 80%, 10%, and 10%, respectively. Statistical information for the corresponding datasets is summarized in Table 2.

[0087] Table 2: Dataset Related Information

[0088] Three representative baseline models were selected for comparison: ① DeepCoNN: a comment modeling method based on dual-channel CNN; ② NARRE: an improvement on DeepCoNN that uses an attention mechanism to estimate the usefulness of different comments; ③ SGDN: a self-supervised segregation network model based on comments.

[0089] To ensure the fairness and rigor of comparisons under different task settings, the following two comparison and evaluation mechanisms were set up in the experiment: (1) Main evaluation setting: The proposed model and all baseline models are trained and tested on the sentiment-weighted scoring matrix to evaluate the performance of each model in the fine-grained sentiment-driven preference prediction task.

[0090] (2) Comparative evaluation setting: The model in this paper is also trained and tested on the original rating matrix and compared with the results of the baseline model using the original rating to evaluate the generality of the proposed structure in traditional recommendation tasks.

[0091] Performance was evaluated using mean squared error (MSE). Each experiment was repeated five times, and the mean and standard deviation of the MSE were calculated using the following formula:

[0092] in, For the test set of interaction pairs, Score the model predictions. Weighted score based on emotional factors.

[0093] Table 3. Performance comparison of different models in predicting scores on three datasets (main evaluation mechanism)

[0094] Table 4. Performance comparison of different models in training and prediction under the original scores (with auxiliary control mechanism)

[0095] As can be seen from the results in Tables 3 and 4, the fine-grained rating graph recommendation method (FGSW-GRec model) based on the sentiment-weighted mechanism proposed in this invention significantly outperforms the three existing baseline models on all three datasets. Specifically, it achieves the highest accuracy in the rating prediction task under the main evaluation mechanism, improving accuracy by approximately 2.87%, 2.08%, and 2.17% compared to the best baseline model on the three datasets. This demonstrates that the graph structure modeling mechanism introduced in this invention has a stronger ability to model user-item relationships.

[0096] Meanwhile, the auxiliary experimental results under the original ratings show that even without relying on the sentiment weighting mechanism, the fine-grained rating graph recommendation method (FGSW-GRec model) based on the comment sentiment weighting mechanism still maintains its leading position, indicating that the design of this graph structure model itself has good generalization ability. After adopting sentiment weighting, the performance is further improved, proving that the fine-grained comment sentiment weighting mechanism can effectively enhance the model's ability to capture user subjective preferences and is a crucial factor in improving the accuracy of graph recommendation.

[0097] The experimental results above demonstrate that the fine-grained rating graph recommendation method (FGSW-GRec model) based on a sentiment-weighted mechanism proposed in this paper significantly improves the rating prediction accuracy under the main evaluation mechanism compared to several existing strong baselines. Furthermore, the key roles of sentiment weighting, hierarchical attention mechanism, and weighted graph structure in improving model performance are further verified through the design of auxiliary control mechanisms and ablation experiments.

[0098] In summary, this invention provides a fine-grained rating graph recommendation method (FGSW-GRec model) based on a comment sentiment weighting mechanism. It integrates a sentiment-enhanced rating mechanism, hierarchical attention-based comment representation learning, and a fine-grained weighted graph structure built based on continuous ratings. Through graph neural networks, it achieves dynamic learning of user and item representations and rating prediction, solving the problems of insufficient granularity and lack of sentiment understanding in traditional rating recommendation systems when dealing with users' true preference expressions.

[0099] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A fine-grained rating graph recommendation method based on a sentiment-weighted comment mechanism, characterized in that, Includes the following steps: S1: Use a sentiment analysis model to process user comments on the project and generate sentiment scores; S2: The sentiment score is weighted and fused with the user's original rating of the project to generate a continuous sentiment weighted score; S3: A hierarchical attention mechanism is used to model the comment sets of users and projects, generating global semantic representations of users and projects respectively; S4: Construct a user-project heterogeneous graph, including a set of nodes and a set of edges. The set of nodes includes all users and projects, and the set of edges is generated by interaction ratings, representing the interaction relationships between users and projects. Each edge is associated with sentiment-weighted ratings and edge features. S5: Based on the user-item heterogeneous graph, a graph neural network is used for message passing and aggregation to predict the user's preference rating for the target item. A loss function is used to minimize the error of the predicted rating to generate recommendations.

2. The method according to claim 1, characterized in that, In step S1, the sentiment analysis model used is a large language model; the large language model classifies the comment text into predefined sentiment categories and maps the category to discrete numerical scores as the sentiment score.

3. The fine-grained rating graph recommendation method based on comment sentiment weighting mechanism according to claim 1, characterized in that, In step S2, weighted fusion is achieved in the following way: the original scoring matrix is... With sentiment rating matrix By combining these methods, the rating matrix can be corrected and updated, generating a continuously corrected rating matrix. The continuously corrected scoring matrix Emotion-weighted rating The composition and specific implementation method are as follows: in, Sentiment-weighted score; Original rating; Sentiment rating; : Weighting coefficients, and ∈[0,1]; :user, :project.

4. The fine-grained rating graph recommendation method based on comment sentiment weighting mechanism according to claim 1, characterized in that, In step S3, the hierarchical attention mechanism employed includes: (1) Sentence-level attention layer: Collect comments from each user or project to form a set, and further divide the comment set into several sentences, each represented by a word sequence. Use a bidirectional recurrent neural network to perform context modeling on the word sequence to obtain sentence-level semantic representation vectors; (2) Comment-level attention layer: capture the importance of different sentences in the overall semantics of the comment, and fuse the weights of the sentence-level semantic representation vector to obtain the comment-level semantic representation vector; (3) User-level / project-level attention layer: The comment-level semantic representation vector is weighted and aggregated to obtain the user-level / project-level semantic representation vector.

5. The fine-grained rating graph recommendation method based on comment sentiment weighting mechanism according to claim 1, characterized in that, In step S4, the edge feature construction steps include: User interactions and comments with the project Input the BERT model, extract the [CLS] vector, and perform a Whitening operation to obtain the interactive semantic representation. The interaction-level semantic representation is concatenated with the user-level and item-level semantic representations, and the edge features are obtained after linear transformation. ; The interactive-level semantic representation is obtained by encoding a single user-item comment text through a pre-trained language model, and the user global semantic representation and the item global semantic representation are obtained by modeling all historical comments of users and items through a hierarchical attention mechanism. in, For learnable mapping matrix, This represents a vector concatenation operation. , These are user-level and project-level semantic representation vectors.

6. The fine-grained rating graph recommendation method based on comment sentiment weighting mechanism according to claim 1, characterized in that, In step S5, the message passing process of the graph neural network is dynamically controlled by the weights of the edges; The message calculation method from the project node to the user node is as follows: The message calculation method from the user node to the project node is as follows: in: :Attention No. Layer from project To users The message being delivered; :Attention No. Layer from user To the project The message being delivered; : Rating-driven weighted function; Edge-level weight coefficients; Sentiment-weighted score; , Learnable transformation matrix; : The semantic representation vector of the comment text; , Projects and user nodes in the 1st... Layer embedding; The propagation layer number of the graph neural network, and It is a positive integer; Representing the One user, Representing the One project.

7. The fine-grained rating graph recommendation method based on comment sentiment weighting mechanism according to claim 6, characterized in that, The scoring-driven weighting function is used to calculate the continuous weights of the edges, and its specific form is as follows: The semantic representation vector of the comment text is used to characterize the detailed information of local interactions and integrate the global preference features of users and projects. Its specific form is as follows: in, Edge weight coefficient: Represents the weight of the edge in message propagation; Learnable parameters used to control the linear scaling of the score before transformation; Learnable bias, used to adjust the baseline of the overall weights; The function ensures that the weight values ​​are within the interval (0, 1); Learnable mapping matrix; Interactive semantic representation vector; , User-level and project-level semantic representation vectors.

8. The fine-grained rating graph recommendation method based on comment sentiment weighting mechanism according to claim 1, characterized in that, In step 5, when predicting the user's preference rating for the target item, the structural representation learned from the graph neural network and the semantic representation learned from the comments are integrated, specifically implemented in the following way: , , in, Model prediction score; , : The fused semantic representation vectors of users and projects; : Semantic representation vector of user comments; , : A graph structure representation vector of user and project nodes; , Users and project nodes at the 1st Layer embedding; :Attention No. Layer from project To users The message being delivered; :Attention No. Layer from user To the project The message being delivered; The propagation layer number of the graph neural network, and It is a positive integer; Representing the One user, Representing the One project; This represents a vector concatenation operation, resulting in a merged vector. It includes users' or projects' structural preferences and the subjective emotions expressed in the text.

9. The fine-grained rating graph recommendation method based on comment sentiment weighting mechanism according to claim 1, characterized in that, The loss function used is mean squared error loss, which is used to calculate the difference between the model's predicted score and the sentiment-weighted score. in: The loss to be minimized during training, which measures the magnitude of the error between the model's predicted value and the true value; : The observed set of user-project interactions; Model-predicted rating, i.e., the user rating predicted by the model. For the project The scoring results; Sentiment-weighted rating is a continuous rating obtained by weighting the original rating with the sentiment rating.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the fine-grained rating graph recommendation method based on the sentiment-weighted mechanism of comments as described in any one of claims 1 to 9.