Personalized recommendation method and system based on auxiliary comments and cross attention
By constructing a set of user and item auxiliary comments and introducing a cross-attention mechanism, the problems of comment sparsity and heterogeneity in recommendation systems are solved, thereby improving the accuracy and stability of personalized recommendations.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHONGQING UNIV OF POSTS & TELECOMM
- Filing Date
- 2026-02-12
- Publication Date
- 2026-06-02
AI Technical Summary
Existing recommendation systems rely excessively on target reviews in scenarios with sparse reviews, neglecting item reviews. The selection criteria for auxiliary reviews are limited to homogeneous preferences, failing to effectively handle the heterogeneity of heterogeneous reviews and lacking personalized modeling capabilities.
By constructing a set of user and item auxiliary comments, introducing a cross-attention mechanism, and using heterogeneous preference adjustment and gating mechanisms to fuse comment features, personalized recommendations are generated.
Improve recommendation accuracy, expand the scope of information utilization, enhance model stability and generalization ability, and strengthen personalized modeling capabilities in scenarios with sparse comments.
Smart Images

Figure CN122132623A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of intelligent recommendation technology, and relates to a personalized recommendation method and system based on auxiliary comments and cross-attention. Background Technology
[0002] In the field of recommender systems, leveraging user review text to mine user preferences and item features has become an important research direction for improving personalized recommendation performance. However, in practical applications, review data itself suffers from severe sparsity, meaning that many users or items have a very limited number of reviews. This makes it difficult for models to fully learn their features, thus limiting further improvements in recommendation accuracy.
[0003] To alleviate comment sparsity, introducing auxiliary comments—that is, extracting information from other users' comments on similar items—has become an effective approach. However, current recommendation algorithms based on auxiliary comments still have significant shortcomings: First, there is a lack of support from item reviews. Existing methods mainly focus on using other users' reviews to assist in target user modeling, while neglecting the support from item reviews. For example, in Chinese patent CN112231577A, although semantic vectors of user review text and item description text are integrated, the item descriptions are usually static metadata rather than dynamic and diverse item reviews from other users. This neglect of item-side auxiliary information makes the recommendation process overly reliant on users' historical behavior, making it difficult to capture the diverse characteristics of items, potentially leading to homogenized recommendation results and weakening users' ability to discover new content.
[0004] Second, the selection criteria for supplementary reviews are too limited. Current methods typically define supplementary reviews as those from shared purchase history that give the same rating. This approach is essentially based on the assumption of "homogeneous preference," completely ignoring the potential value of "heterogeneous preference" (i.e., reviews with different ratings but valuable content). For example, a negative review of the same item might point out a defect in a certain function, which could be a key concern for the target user. Selecting only reviews with the same rating severely limits the scope of usable information and data diversity.
[0005] Third, existing methods fail to differentiate and handle the different natures of auxiliary and target comments. While both target and auxiliary comments are user feedback, they can differ significantly in ratings, sentiment, and perspectives. Current methods do not adequately consider this heterogeneity. For example, CN112182156A and CN113836392A employ convolutional neural networks and BERT-based attention mechanisms, respectively, to extract features from individual comments or sets of comment texts. However, their attention mechanisms are primarily designed to measure the importance of the comment itself or general user / item preferences, rather than specifically to measure the relevance between an external auxiliary comment and a particular target user-item pair. Simply treating heterogeneous auxiliary and target comments equally fails to achieve effective information alignment and filtering.
[0006] In summary, existing technologies fail to provide a solution that can simultaneously introduce auxiliary information from both the user and item ends, fully utilize heterogeneous preference comments, and perform precise information filtering and fusion for specific recommendation tasks. Therefore, designing a novel recommendation method that can deeply mine and intelligently integrate the value of auxiliary comments to fundamentally alleviate the performance bottleneck caused by comment sparsity has become a pressing technical problem in this field. Summary of the Invention
[0007] In view of this, the present invention aims to solve the problems of existing review-based recommendation methods, such as over-reliance on target reviews in scenarios with sparse review data, limited utilization of auxiliary reviews, preference differences between different rated reviews and lack of effective alignment mechanisms, and lack of personalized modeling for specific user and specific item combinations. The present invention provides a personalized recommendation method and system based on auxiliary reviews and cross-attention, so as to make full use of multi-source review information without being limited by rating similarity, thereby improving the accuracy of rating prediction.
[0008] To achieve the above objectives, the present invention provides the following technical solution: On the one hand, this invention provides a personalized recommendation method based on auxiliary comments and cross-attention, including: Obtain the target user's target rating for the target item and the corresponding target review text, resulting in a user set, an item set, a rating set, and a review set; The comment text is preprocessed and features are extracted. User feature representations and item feature representations are constructed based on the comment features. Rating prediction is then performed based on the user feature representations and item feature representations. The method further includes: Based on shared purchase history, a set of user auxiliary reviews is constructed for each target user, and a set of item auxiliary reviews is constructed for each target item. The auxiliary reviews are not required to have similar ratings. Based on the difference between the target rating and the corresponding rating of the auxiliary comment text, the preference similarity is calculated, and the intermediate feature representation of the auxiliary comment text is adjusted using the preference similarity to reduce the impact of preference differences between different ratings and comments on feature fusion. By introducing the identifier embedding of the target item into the user network and the identifier embedding of the target user into the item network, attention weights are generated, thereby forming a personalized cross-attention mechanism. Based on the attention weights, the target comment features and auxiliary comment features are weighted and fused, and the target comment features and auxiliary comment features are fused through a gating mechanism, wherein the gating mechanism is related to the number of comments; Based on the fused user feature representation and item feature representation, the predicted rating of the target user for the target item is output.
[0009] Furthermore, the user-assisted comments include comments on the same item from users other than the target user, and the item-assisted comments include comments from the target user on items other than the target item.
[0010] Furthermore, the comment feature extraction employs word embedding technology to map words in the comment text into low-dimensional vector representations, constructing an embedding matrix; a filter of a specified size is used to perform convolution operations on the embedding matrix to extract local semantic features of words, and multiple filters are used to enhance feature expression capabilities.
[0011] Furthermore, the heterogeneous preference adjustment calculates preference similarity based on the difference between the target rating and the corresponding rating of the auxiliary comment text, and uses the preference similarity to adjust the intermediate feature representation of the auxiliary comment text. Calculated using the preference similarity function:
[0012] in, Indicates user For items Real ratings This represents auxiliary comment features adjusted for heterogeneous preferences. and These are the maximum and minimum rated score values allowed by the system.
[0013] Furthermore, the personalized cross-attention mechanism includes: The personalized word attention layer is used to generate personalized word-level attention vectors based on the identifier embedding vector of the target item or the identifier embedding vector of the target user, and to use the vectors to calculate the attention weights of each word feature in the auxiliary comment text, so as to aggregate and obtain the text representation of the auxiliary comment text. The personalized comment attention layer is used to generate a personalized comment-level attention vector based on the target item's identifier embedding vector or the target user's identifier embedding vector when multiple auxiliary comment texts exist. The attention weights of the features of each auxiliary comment text are calculated using this vector, and then aggregated to obtain the feature vector extracted by the auxiliary comment encoder.
[0014] Furthermore, the model training employs a loss function:
[0015] in, This represents all users and items in the training set. Indicates user For items Real ratings Indicates user For items Predicted score Represents the reduced-dimensional vector of user comments. Represents the reduced-dimensional vector of a user's auxiliary comments. The comment vector representing the item is a reduced-dimensional vector. A reduced-dimensional vector representing the auxiliary comments for an item. Parameters that indicate the degree of control over constraints.
[0016] Furthermore, the formula for calculating the predicted score is as follows:
[0017] in, This represents the predicted rating of the target user for the target item. Represents a linear transformation matrix. Indicates user bias, Indicates deviation of items, This represents the global bias in LFM.
[0018] On the other hand, the present invention also provides a personalized recommendation system based on auxiliary comments and cross-attention, comprising: The data acquisition module is used to acquire user, item, rating, and review data; The auxiliary review building module is used to build user-side auxiliary review sets and item-side auxiliary review sets based on co-purchase history. The comment encoding module is used to extract features from the target comment and auxiliary comments; The preference adjustment module is used to perform heterogeneous preference adjustment on auxiliary comment features; A personalized cross-attention module is used to generate attention weights in the user and item network; The feature fusion module is used to fuse target comment features and auxiliary comment features through a gating mechanism; The rating prediction module is used to output predicted ratings based on the fused user and item features.
[0019] Furthermore, the personalized cross-attention module generates attention weights related to user-item combinations by introducing target item identifier embeddings and target user identifier embeddings.
[0020] Finally, the present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that the processor executes the program using the aforementioned personalized recommendation method based on auxiliary comments and cross-attention.
[0021] Compared with the prior art, the beneficial effects of the present invention are as follows: (1) The present invention constructs an auxiliary review set based on the shared purchase history, which breaks through the limitation of relying only on similar reviews with ratings, expands the range of available review information, and thus improves the feature expression ability of the model in the scenario of sparse reviews.
[0022] (2) This invention uses a heterogeneous preference adjustment mechanism to align different rating comments, which reduces the impact of semantic conflicts on model performance and improves the stability of multi-source comment fusion.
[0023] (3) This invention introduces the embedding of each other's identifiers at both the user and item levels to construct a personalized cross-attention mechanism, enabling the model to characterize the differences in the importance of comment information under different user-item combinations and improve personalized modeling capabilities.
[0024] (4) This invention uses a gating fusion mechanism related to the number of comments to adaptively adjust the fusion ratio of target comments and auxiliary comments, so that the model can still maintain a good prediction effect in scenarios with large differences in the number of comments.
[0025] (5) This invention enhances the structural correlation between target comment features and auxiliary comment features by introducing a loss function that includes a consistency constraint term, thereby improving the model’s generalization ability.
[0026] 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
[0027] 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 the architecture of the AuxiliaryReview-Based Personalized Cross-Attention Recommendation (ARPCA) algorithm proposed in this invention; Figure 2 This is a schematic diagram of the personalized cross-attention mechanism of the present invention; Figure 3 The effect of embedding dimension on different datasets; where (a) is the MSE on the OP and DM datasets; and (b) is the MSE on the TI and VG datasets. Figure 4 Parameters for controlling the degree of constraint on different datasets The impact; where (a) is the MSE on the OP and DM datasets; and (b) is the MSE on the TI and VG datasets. Detailed Implementation
[0028] 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.
[0029] 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.
[0030] Figure 1 This paper illustrates the architecture of the Auxiliary Review-Based Personalized Cross-Attention Recommendation (ARPCA) algorithm proposed in this invention. The model consists of two parallel sub-networks, a user network and an item network, as well as a prediction module. The processes of the user network and the item network are similar; the user network will be used as an example for detailed explanation below.
[0031] S1: Input Data Preparation and Selection of Supporting Comments First, the system needs to obtain a dataset containing a set of users U, a set of items I, a set of ratings R, and a set of comments D.
[0032] For a specific target user u and a target item i to be rated and predicted, perform the following steps to prepare the input data: (1) For target user u∈U and target item i∈I, obtain user u's rating of item i. and comment text ,Will Record this as a user's target comment.
[0033] (2) Selection of User-Assisted Comments: Obtain all comment texts from users other than the target user regarding the same item i. Randomly select one comment from these comments as the user-assisted comment for user u in this prediction, denoted as . Its corresponding rating is .
[0034] (3) Item review acquisition: Acquire all historical comment texts posted by user u on items other than item i, and record them as item reviews. This constitutes a collection of item reviews. .
[0035] (4) Selection of auxiliary comments for item i: Obtain all comments from the target user on items other than the target item. Randomly select one comment as an auxiliary comment for item i, denoted as . Its corresponding rating is .
[0036] Thus, for a prediction task The model received four sets of comments: user-targeted comments. User-assisted comments Item reviews And item auxiliary comments .
[0037] S2: Auxiliary Comment Encoding Design an auxiliary comment encoder to learn the representation of each auxiliary comment and extract personalized features from them. The encoder consists of a word embedding layer, a convolutional layer, a personalized word attention layer, a heterogeneous preference adjustment layer, and a personalized comment attention layer. For example, Figure 2 As shown, the personalized word attention layer, consisting of the user network word attention layer and the item network word attention layer, and the personalized comment attention layer, consisting of the user network comment attention layer and the item network comment attention layer, constitute a two-layer personalized cross-attention mechanism.
[0038] S201: Word Embeddings and Convolutional Layers By employing pre-trained word embedding techniques (such as using a pre-trained Word2Vector model), each word in the user's auxiliary comment is converted into a real-valued vector to obtain a word embedding matrix. , Indicates the first comment One word, .
[0039] Subsequently, feature extraction is performed using convolutional layers. A convolutional layer of size [size missing] is used. Filter Perform convolution operation on the input, with the number of filters set to... . No. Each filter in Feature representation extracted from above for: ;in, This represents the convolution operation. This represents the deviation term. Each column in the array is denoted as Corresponding user For items In the auxiliary comments, the first Semantic feature representation of each word.
[0040] S202: Personalized Word Attention Layer The personalized cross-attention mechanism, consisting of word attention and comment attention, handles the different properties of auxiliary comments and target comments.
[0041] The personalized cross-attention mechanism introduces target item ID embedding into the user network to align keywords in auxiliary comments with target item attributes; and introduces target user ID embedding into the item network to filter auxiliary comments that are irrelevant to user preferences.
[0042] First, obtain the ID embedding vector of the target item i. Personalized word-level attention vectors for item i are generated using a multilayer perceptron (MLP). :
[0043] in, This represents the weight matrix of the MLP. This indicates the bias term.
[0044] Then, the attention mechanism is applied:
[0045]
[0046] in, Represents the attention harmony matrix. Indicates user For items In the auxiliary comments, the first The representation of a word.
[0047] Finally, the feature vectors corresponding to all words are aggregated to obtain the data from the user. For items The characteristics of auxiliary comments are represented as follows:
[0048] S203: Heterogeneous Preference Adjustment Layer Since the ratings of auxiliary comments and target comments are not necessarily identical, the heterogeneous preference adjustment layer adjusts the features of auxiliary comments to unify the semantic space.
[0049] First, calculate preference similarity based on rating differences. :
[0050] in, Indicates user For items Real ratings and These are the maximum and minimum rated score values allowed by the system.
[0051] Then, the initially represented auxiliary comment features are represented. Similarity with preferences Multiplying them together yields the adjusted auxiliary comment feature representation. :
[0052] in, This represents the element-wise product operation.
[0053] S204: Personalized Comment Attention Layer In practical applications, considering the varying importance of comments and the need to capture user preferences and personality traits, a personalized comment attention layer is introduced.
[0054] First, a personalized comment attention vector is generated for item i using MLP. :
[0055] in, This represents the weight matrix of the MLP. This indicates the bias term.
[0056] Then, calculate the user. For items auxiliary comments weight :
[0057]
[0058] in, Represents the attention harmony matrix. This represents the feature representation after adjustment by the heterogeneous preference adjustment layer.
[0059] Finally, the weights of all comments are aggregated to obtain the user's score. The final auxiliary comment feature representation :
[0060] For the user network, the processing flow is symmetrical to that of the item network, but there is a key difference: in its auxiliary comment encoder, when generating personalized attention vectors (including word-level and comment-level), the ID embedding vector of the target user u is used, rather than the item ID embedding. By using different ID embeddings in the two networks, a personalized cross-attention mechanism is established.
[0061] S3: Target Comment Feature Extraction Meanwhile, the comment encoder in the user network targets the comment. Process the data to extract the feature representation of the target comment. The specific structure, parameters, and implementation of the comment encoder are consistent with the comment encoder used in the URPAA algorithm cited in the background of this invention (e.g., including word embedding layers, convolutional layers, and personalized attention layers). Similarly, the comment encoder in the item network processes the set of item comments to obtain feature representations of the item comments.
[0062] S4: Feature Combination The feature combination layer aims to combine text features learned from the target comment and the auxiliary comment.
[0063] First, the user target comment feature vector and auxiliary comment feature vector Dimensionality reduction is performed separately:
[0064] in, It is a reduced-dimensional vector of user comments. This represents the activation function. This represents the user review dimensionality reduction weight matrix. This represents the bias term. Similarly, the dimensionality-reduced vector of user-assisted comments can be obtained.
[0065] Then, a threshold is used to moderate heterogeneous preferences from auxiliary evaluations:
[0066]
[0067] Where g represents the gating value, This indicates the final characteristics of user reviews. Represents the gate weight matrix. This is a parameter associated with the number of user / item reviews. express The One element, This indicates the number of user / item reviews. Similarly, this paper can derive the final item review characteristics from the item website. .
[0068] S5: Rating Prediction In order to integrate the final user review features from the user network The final item review features of the item network By fusing the two, the final latent interaction features can be calculated. To obtain a complete representation:
[0069] in, Indicates splicing.
[0070] Then, The data is input into a prediction module for score prediction. In a preferred embodiment of the invention, the prediction module employs a neuralized latent factor model (LFM).
[0071] Ultimately, the predicted score is obtained. :
[0072] in, Represents a linear transformation matrix. Indicates user bias, Indicates deviation of items, This represents the global bias in LFM.
[0073] S6: Model Training The training objective of the model is to minimize the error between the predicted rating and the actual rating. This invention uses a loss function L for training, with the mean squared error (MSE) as the principal term of L, and adds a compatibility constraint to ensure the compatibility of features learned from the target review and the auxiliary review.
[0074] The loss function L is:
[0075] in, Indicates user For items Real ratings Indicates user For items Predicted score Represents the reduced-dimensional vector of user comments. Represents the reduced-dimensional vector of a user's auxiliary comments. The comment vector representing the item is a reduced-dimensional vector. A reduced-dimensional vector representing the auxiliary comments for an item. Parameters that indicate the degree of control over constraints.
[0076] Since the supplementary comments are selected from multiple similar comments, they exhibit a certain degree of heterogeneity. and The characteristics they carry may be incompatible. Therefore, making and Appropriate similarity is key to making the two as compatible as possible. Similarly, and The same process should be performed.
[0077] During training, the Adam optimizer is used to minimize the loss function L. To prevent overfitting, Dropout is applied before the fully connected layers and attention layers of the model, with a dropout rate set to 0.5.
[0078] Examples of the ARPCA algorithm proposed in this invention are shown in Table 1: Table 1
[0079] S7: Experimental Results Verification To verify the effectiveness of this invention, comparative experiments, ablation experiments, and parameter analysis were conducted on multiple real datasets. The key experimental results are as follows: The datasets and evaluation metrics are as follows: The ARPCA method of this invention is compared with six other methods—PMF, DeepCoNN, NARRE, PARL, and ARPCNN—on four publicly available Amazon datasets: Office Products (OP), Digital Music (DM), Tools Improvement (TI), and Video Games (VG). As shown in Table 2, the four datasets differ in data density and size. OP and DM are smaller in size but relatively dense, while TI and VG are larger in size but relatively less dense.
[0080] Table 2
[0081] The mean squared error (MSE) was used as the primary metric to evaluate the performance of all models. The MSE values are as follows: Total number of ratings:
[0082] (1) Comparison of mean squared error (MSE) results: As shown in Table 3, ARPCA's MSE is significantly lower than that of PMF, DeepCoNN, NARRE and other comparative algorithms on all four datasets, with its advantage being more obvious on the TI and VG datasets with higher sparsity.
[0083] Table 3
[0084] (2) Ablation experiment analysis: To illustrate the different impacts of each part of the model on performance improvement, five variants of ARPCA (ARPCA-I to ARPCA-V) were constructed and experiments were conducted.
[0085] ①ARPCA-I: The structure consists of two parallel CNNs and a latent factor model. It does not employ personalized word-level or comment-level attention mechanisms, nor does it use user-assisted networks.
[0086] ②ARPCA-II: Based on ARPCA-I, it adds a word-level attention mechanism.
[0087] ③ARPCA-III: Based on ARPCA-II, it adds a comment-level attention mechanism.
[0088] ④ARPCA-IV: Based on ARPCA-III, the commonly used two-layer attention mechanism is improved into a personalized asymmetric attention mechanism.
[0089] ⑤ARPCA-V: Based on ARPCA-IV, it adds an auxiliary comment encoder that does not apply a personalized cross-attention mechanism.
[0090] The five variants of ARPCA showed a continuous downward trend in MSE across four datasets, indicating a gradual improvement in rating prediction performance. From ARPCA-I using only CNN, to the sequential addition of word-level attention mechanisms (ARPCA-II), comment-level attention mechanisms (ARPCA-III), personalized attention mechanisms (ARPCA-IV), and auxiliary comment encoders (ARPCA-V), each module was optimized layer by layer: word-level attention highlighted keywords, comment-level attention enhanced informative comments, personalized attention adapted to user needs, and the auxiliary comment encoder significantly alleviated comment sparsity and enriched the understanding of user preferences and product features.
[0091] Ultimately, ARPCA, building upon ARPCA-V, introduced a personalized cross-attention mechanism, achieving optimal performance. This mechanism further explored the potential relationship between auxiliary and target comments, fully utilizing comment data and validating its necessity. Among the modules, the auxiliary comment encoder and the personalized cross-attention mechanism contributed the most to the performance improvement, demonstrating the overall effectiveness of the ARPCA design.
[0092] Table 4
[0093] (3) Parameter influence analysis: Based on the MSE values obtained from four datasets in this embodiment, the word embedding dimensions and parameters are analyzed. Impact on ARPCA performance.
[0094] ①Word embedding dimension: such as Figure 3 As shown, across the four datasets, the MSE generally increases with the increase of the word embedding dimension. When the dimension is set to 300, the model reaches or approaches its optimal performance on most datasets.
[0095] ②Constraint parameters :like Figure 4 As shown, parameters This is used to balance compatibility constraints between target comment features and auxiliary comment features. Experiments have shown that when The model achieves optimal performance when set to a small positive value (e.g., 0.01). Both excessively large and excessively small values will lead to performance degradation, which verifies the necessity of appropriately constraining feature compatibility.
[0096] It should be noted that in S2: the auxiliary comment encoder of this invention, the comment encoder can adopt a structure based on pre-trained models such as BERT; the auxiliary comments can be randomly selected from the comments of "other users on the target item", or selected after filtering based on the similarity between users or items, or selected from the comments of "target users on other items"; the weight calculation in the personalized cross-attention mechanism can adopt different implementation methods such as additive attention and scaled dot product attention.
[0097] In S4: Feature Fusion, the gated addition operation in the feature combination layer can be replaced by a fusion strategy such as splicing followed by a fully connected layer.
[0098] 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 personalized recommendation method based on auxiliary comments and cross-attention, characterized in that, include: Obtain the target user's target rating for the target item and the corresponding target review text, resulting in a user set, an item set, a rating set, and a review set; The comment text is preprocessed and features are extracted. User feature representations and item feature representations are constructed based on the comment features. Rating prediction is then performed based on the user feature representations and item feature representations. The method further includes: Based on shared purchase history, a set of user auxiliary reviews is constructed for each target user, and a set of item auxiliary reviews is constructed for each target item. The auxiliary reviews are not required to have similar ratings. Based on the difference between the target rating and the corresponding rating of the auxiliary comment text, the preference similarity is calculated, and the intermediate feature representation of the auxiliary comment text is adjusted using the preference similarity to reduce the impact of preference differences between different ratings and comments on feature fusion. By introducing the identifier embedding of the target item into the user network and the identifier embedding of the target user into the item network, attention weights are generated, thereby forming a personalized cross-attention mechanism. Based on the attention weights, the target comment features and auxiliary comment features are weighted and fused, and the target comment features and auxiliary comment features are fused through a gating mechanism, wherein the gating mechanism is related to the number of comments; Based on the fused user feature representation and item feature representation, the predicted rating of the target user for the target item is output.
2. The method according to claim 1, characterized in that, The user-assisted comments include comments on the same item from users other than the target user, and the item-assisted comments include comments from the target user on items other than the target item.
3. The method according to claim 1, characterized in that, The comment feature extraction employs word embedding technology to map words in the comment text into low-dimensional vector representations, constructing an embedding matrix; a filter of a specified size is used to perform convolution operations on the embedding matrix to extract local semantic features of words, and multiple filters are used to enhance feature expression capabilities.
4. The method according to claim 1, characterized in that, The preference similarity Calculated using the preference similarity function: in, Indicates user For items Real ratings and These are the maximum and minimum rated score values allowed by the system.
5. The method according to claim 1, characterized in that, The personalized cross-attention mechanism includes: The personalized word attention layer is used to generate personalized word-level attention vectors based on the identifier embedding vector of the target item or the identifier embedding vector of the target user, and to use the vectors to calculate the attention weights of each word feature in the auxiliary comment text, so as to aggregate and obtain the text representation of the auxiliary comment text. The personalized comment attention layer is used to generate a personalized comment-level attention vector based on the target item's identifier embedding vector or the target user's identifier embedding vector when multiple auxiliary comment texts exist. The attention weights of the features of each auxiliary comment text are calculated using this vector, and then aggregated to obtain the feature vector extracted by the auxiliary comment encoder.
6. The method according to claim 1, characterized in that, The model training uses the following loss function: in, This represents all users and items in the training set. Indicates user For items The actual rating given Indicates user For items Predicted score Represents the reduced-dimensional vector of user comments. Represents the reduced-dimensional vector of a user's auxiliary comments. The comment vector representing the item is a reduced-dimensional vector. A reduced-dimensional vector representing the auxiliary comments for an item. Parameters that indicate the degree of control over constraints.
7. The method according to claim 1, characterized in that, The formula for calculating the predicted score is as follows: in, This represents the predicted rating of the target user for the target item. Represents a linear transformation matrix. Indicates user bias, Indicates deviation of items, This represents the global bias in LFM.
8. A personalized recommendation system based on auxiliary comments and cross-attention, characterized in that, include: The data acquisition module is used to acquire user, item, rating, and review data; The auxiliary review building module is used to build user-side auxiliary review sets and item-side auxiliary review sets based on co-purchase history. The comment encoding module is used to extract features from the target comment and auxiliary comments; The preference adjustment module is used to perform heterogeneous preference adjustment on auxiliary comment features; A personalized cross-attention module is used to generate attention weights in the user and item network; The feature fusion module is used to fuse target comment features and auxiliary comment features through a gating mechanism; The rating prediction module is used to output predicted ratings based on the fused user and item features.
9. The system according to claim 8, characterized in that, The personalized cross-attention module generates attention weights related to user-item combinations by introducing target item identifier embedding and target user identifier embedding.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the personalized recommendation method based on auxiliary comments and cross-attention as described in any one of claims 1-7.