An Explainable Recommendation Method Based on Joint Rating Prediction and Reason Generation

By combining rating prediction and reason generation methods with matrix factorization and attention mechanisms, an explanatory vocabulary of user item interaction history data is generated, which solves the balance problem between accuracy and interpretability in recommendation systems and improves the accuracy and interpretability of recommendations.

CN116070025BActive Publication Date: 2026-03-10CHONGQING UNIV OF POSTS & TELECOMM
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-14
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

Existing recommender systems struggle to balance accuracy and interpretability. Traditional models tend to prioritize accuracy while neglecting interpretability, making it difficult to control the quality of the generated recommendation explanations.

Method used

We employ a joint rating prediction and reason generation approach, using techniques such as matrix factorization, attention mechanisms, and multilayer perceptrons to generate an explanatory vocabulary of user item interaction history data. We then use encoders and decoders to generate recommended explanations, and train the rating prediction and explanation generation models together.

Benefits of technology

It improves the accuracy of recommendations and the quality of explanations, making the generated recommendations more aligned with user interests and more persuasive, thus enhancing system transparency and user trust.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116070025B_ABST
    Figure CN116070025B_ABST
Patent Text Reader

Abstract

This invention belongs to the field of recommender systems, specifically relating to an explainable recommendation method based on joint rating prediction and reason generation. The method includes: constructing an explainable recommendation model based on joint rating prediction and reason generation; a rating prediction module containing free embeddings of user items obtained from historical user interactions; an attention-based aspect extraction module extracting aspect terms from user and item comment sets respectively and embedding them into the same space; inputting these terms into a multilayer perceptron; and combining the two parts in the prediction layer to perform rating prediction, recommendation, and generate recommendation explanations. This invention simultaneously considers rating data and comment data from historical user interactions and maps them to the same space for better rating prediction, improving recommendation accuracy. Furthermore, the explanation generation process considers the advantages of generative and template-based methods, with the template guiding the generation process, making the template adaptable to the given features and improving the quality of the explanation.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the field of recommendation system, and particularly relates to an interpretable recommendation method based on joint rating prediction and reason generation. BACKGROUND

[0002] With the rapid development of Internet technology in recent years, the problem of information overload is becoming increasingly serious. A recommendation system solves the problem of information overload by finding items that a user may be interested in from a large set of products. It helps users complete information filtering by analyzing user historical behavior, and it can discover the user's potential interest preferences.

[0003] Nowadays, recommendation systems have been applied to various aspects of our lives, and have given rise to many new recommendation technologies. The accuracy of recommendation algorithms has also been improved, greatly improving the recommendation effect. Traditional recommendation systems often lack explanations for the recommended results. Interpretable recommendation refers to giving explanations for the recommended items while recommending them to users. By providing explanations for the recommendations, the transparency of the system and the trust and user experience of users can be increased, helping users make choices more quickly and accurately.

[0004] Current research on recommendation based on reviews can be divided into two categories: accuracy-oriented modeling and interpretability modeling. Embedding-based recommendation models have shown the most advanced performance in precision modeling. The first category of research mainly uses content embedding in user and item reviews and combines content embedding with collaborative filtering to enhance the embedding representation ability of users and items. The second category considers providing explanatory text to users when recommending items, which makes it easier to persuade users. This type of model draws on the success of language generation technology based on encoder-decoder, but still has several problems: (1) Most recommendation models tend to focus on the accuracy of recommendations, while ignoring the effectiveness and persuasiveness of the recommended results. (2) Current methods of generating recommendations are either limited to predefined sentence templates, which limit the expressiveness of sentences, or choose free-style sentence generation, which makes it difficult to control the quality of sentences. SUMMARY

[0005] To solve the above technical problems, the present application provides an interpretable recommendation method based on joint rating prediction and reason generation, comprising the following steps:

[0006] S1: Obtain user-item interaction history data, divide the obtained user-item interaction history data into data sets to generate a training data set and a test data set, and preprocess the user-item interaction history data in the training data set to generate an explanation vocabulary table;

[0007] The user-item interaction history data includes user rating data and review data for items.

[0008] S2: Establish a joint score prediction and explanation generation model;

[0009] The joint score prediction and explanation generation model comprises a preference score prediction module and an explanation production module;

[0010] The preference score prediction module comprises a matrix decomposition layer, an aspect extraction layer based on an attention mechanism, and a prediction layer;

[0011] The explanation production module comprises an encoder and a decoder;

[0012] S3: Input the training data set into the joint score prediction and explanation generation model for model training, calculate the loss of the joint score prediction and explanation generation model by a loss function until convergence, and obtain the trained joint score prediction and explanation generation model;

[0013] S4: Input the test data set into the trained joint score prediction and explanation generation model to obtain the score prediction of the target user project, select the project with the highest score to recommend to the user, and generate the corresponding recommendation explanation;

[0014] S41: Input the test data set into the preference score prediction module, and the score data of the user to the project in the test data set is input into the matrix decomposition layer to obtain the free embedding representation of the user and the project, and the free embedding representation of the user and the project is input into the MLP to obtain the encoding vector of the latent feature space;

[0015] S42: Input the test data set into the preference score prediction module, and the comment data of the user project in the test data set is input into the aspect extraction layer based on the attention mechanism to extract the aspect representation of the comment sentence, and then the average pooling operation is performed to obtain the representation of the user and the project, respectively, and the MLP is used to obtain the encoding vector of the aspect feature space;

[0016] S43: The encoding vector of the latent feature space and the encoding vector of the aspect feature space are input into the prediction layer for score prediction to obtain the score of the user to the project, and the project with the highest score is selected to recommend to the user;

[0017] S44: The score of the user to the project is used as the sentiment judgment of the explanation sentence, which is input into the explanation generation module through the encoder, the decoder uses the MLP multilayer perceptron to initialize the information to obtain the initialization vector, the decoder uses the combination of two GRUs to generate the final hidden state, generates the probability of the explanation word in the vocabulary according to the initialization vector and the final hidden state, and takes the word with the maximum probability as the generated recommendation explanation.

[0018] The present application simultaneously considers the score data and comment data in the user historical interaction, maps them to the same space for better score prediction, improves the accuracy of recommendation, and considers the advantages of generative and template in the explanation generation process. BRIEF DESCRIPTION OF DRAWINGS

[0019] Figure 1 The overall flowchart of the present application. DETAILED DESCRIPTION

[0020] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.

[0021] An interpretable recommendation method based on joint score prediction and reason generation, as shown in Figure 1 , comprises:

[0022] S1: obtaining user-item interaction history data, dividing the obtained user-item interaction history data into data sets, generating a training data set and a test data set, and preprocessing the user-item interaction history data in the training data set to generate an explanation vocabulary table;

[0023] The user-item interaction history data comprises score data and comment data of the user on the item.

[0024] S2: establishing a joint score prediction and explanation generation model;

[0025] The joint score prediction and explanation generation model comprises a preference score prediction module and an explanation production module.

[0026] The preference score prediction module comprises a matrix decomposition layer, an aspect extraction layer based on an attention mechanism, and a prediction layer.

[0027] The explanation production module comprises an encoder and a decoder.

[0028] S3: inputting the training data set into the joint score prediction and explanation generation model for model training, calculating the loss of the joint score prediction and explanation generation model through a loss function until convergence, and obtaining the trained joint score prediction and explanation generation model.

[0029] S4: input the test data set into the trained joint rating prediction and explanation generation model to obtain a rating prediction of a target user-item, select the item with the highest rating to recommend to the user, and generate a corresponding recommendation explanation;

[0030] S41: input the test data set into the preference rating prediction module, and the rating data of the user-item in the test data set passes through the matrix decomposition layer to obtain free embedding representations of the user and the item, and the free embedding representations of the user and the item pass through the MLP to obtain the encoding vector of the latent feature space;

[0031] S42: input the test data set into the preference rating prediction module, and the review data of the user-item in the test data set passes through the aspect extraction layer based on the attention mechanism to extract the aspect representation of the review sentence, and then the average pooling operation is performed to obtain the representation of the user and the item, respectively, and the MLP is used to obtain the encoding vector of the aspect feature space;

[0032] S43: the encoding vector of the latent feature space and the encoding vector of the aspect feature space pass through the prediction layer for rating prediction to obtain the rating of the user to the item, and the item with the highest rating is selected to recommend to the user;

[0033] S44: the rating of the user to the item is used as the sentiment judgment of the explanation sentence, and the user-item pair is input into the explanation generation module through the encoder, the decoder is initialized by the initialization vector obtained by the MLP multilayer perceptron, the decoder generates the final hidden state by combining two GRUs using the gating unit, generates the probability of the explanation word in the vocabulary table according to the initialization vector and the final hidden state, and takes the word with the maximum probability as the generated recommendation explanation.

[0034] The user-item interaction history data in the training data set is preprocessed, including:

[0035] S11: delete all stop words and punctuation marks of the rating data of the user-item in the training data set;

[0036] S12: generate the explanation vocabulary table by using the Word2vec model in the gensim toolkit for the processed rating data of the user-item.

[0037] The loss of the joint rating prediction and explanation generation model is calculated by the loss function until convergence, and the trained joint rating prediction and explanation generation model is obtained, including:

[0038]

[0039] wherein, the loss function of the joint rating prediction and explanation generation model, the loss coefficient of the aspect extraction layer based on the attention mechanism, loss function of the aspect extraction layer based on attention mechanism loss coefficient of the loss function of reconstructing sentence embedding, loss function of reconstructing sentence embedding, r w representing using sentence embedding vector reconstructed by aspect matrix, w sentence embedding vector based on attention mechanism, w sentence embedding vector reconstructed by aspect matrix, normalization regularization loss coefficient, normalization regularization loss function of the aspect extraction layer based on attention mechanism, r loss coefficient of the preference score prediction module, loss function of the preference score prediction module, x represents a user-item pair in the training set, r u,i represents the actual rating of user u to item i in the training data set, represents the predicted rating of user u to item i in the prediction data set, loss coefficient of the explanation generation module, loss function of the explanation generation module, a represents a user-item pair, represents the factual explanation of user u and item i in the explanation vocabulary, p(y t ) represents the probability of predicting the word y t predicted, λ n represents the weight of global parameters, ||Θ|| represents global parameters.

[0040] The rating data of users to items in the test data set is processed by the matrix decomposition layer to obtain the free embedding representation of users and items, including:

[0041] First, set two free embedding matrices and represent the representation of users and items in the latent feature space, and obtain the free embedding representation of users and items

[0042] The free embedding representation of users and items is processed by the MLP in the latent feature space to obtain the encoding vector in the latent feature space, including:

[0043] The overall representation is processed by the MLP in the latent feature space:

[0044]

[0045] through the activation function of each layer in the MLP in the latent feature space:

[0046]

[0047] where MLP represents a multi-layer perceptron, Relu(.) represents an activation function, respectively represent the free embedding representation of user u and item i, W l , b l respectively represent the weight and bias of the l-th layer of the MLP in the latent feature space, represents the encoding vector of the final output of the MLP in the latent feature space.

[0048] The aspect representation of the review sentence of the user-item review data is extracted through the aspect attention layer based on the aspect representation, including:

[0049] S421: The review data of users and items in the test set is input into the word embedding matrix to obtain the word embedding vector of each word;

[0050] S422: The word embedding vector is selected by using the attention mechanism to capture the most relevant information about the aspect of the sentence, and the embedding of the sentence is obtained;

[0051] S423: The obtained sentence embedding is calculated through an activation function to obtain a weight vector of K aspect embeddings, where each component represents the probability that the sentence belongs to the aspect;

[0052] S424: The reconstruction of the sentence embedding vector is realized through the linear combination of the weight vector of the aspect embedding, and finally the aspect representation of the review sentence is obtained.

[0053] The aspect representation of the review sentence of the user-item review data is extracted through the aspect attention layer based on the aspect representation, and its processing process is represented by the formula:

[0054] s=[w0,w1,W2,w3……w T ]

[0055]

[0056]

[0057] d i =(e wt ) T .M d .y s

[0058]

[0059]

[0060]

[0061]

[0062] where T denotes the length of the review sentence, e wt denotes the one-hot encoded vector of each word in the review sentence, is used to map the global context embedding and word embedding, y s denotes the global context information of the sentence, denotes the weight vector of K aspect embeddings, z w is reduced from d dimensions to K dimensions, and then normalized by softmax, denotes the aspect matrix, r w denotes the sentence embedding vector reconstructed by the matrix.

[0063] The user and item representations are obtained by average pooling operations, including:

[0064]

[0065]

[0066]

[0067]

[0068] where, denotes the representation vector of the review dataset after the average pooling operation, denotes the average pooling operation on the sentence embedding vectors in the review dataset, R u denotes the user review dataset, R i denotes the item review dataset.

[0069] The user and item representations are obtained by MLP to get the encoding vector of the aspect feature space, including:

[0070] The overall representation is processed by the MLP in the aspect feature space:

[0071]

[0072] Each layer in the MLP in the aspect feature space is processed by the activation function:

[0073]

[0074] where MLP denotes the multi-layer perceptron, Relu(.) denotes the activation function, φ u ,φ i ​respectively represent aspect feature vectors of user u and item i, respectively represent weights and biases of the MLP's l-th layer in the aspect feature space, represents the final output of the MLP in the aspect feature space.

[0075] The encoding vectors of the latent feature space and the aspect feature space are scored by the prediction layer to obtain the rating of the user to the item, including:

[0076]

[0077] wherein, represents the predicted rating of the user u to the item i, represents the encoding vector in the aspect feature space, represents the encoding vector in the latent feature space, W R represents the weight of the prediction layer, b u represents the user bias, b i represents the item bias, and μ represents the global bias.

[0078] The rating of the user to the item is taken as the sentiment judgment of the explanation statement, and the user-item pair is input into the explanation generation module as the initial state and encoded by the encoder, including:

[0079]

[0080] wherein, h0 represents the initial vector obtained by encoding the encoder, tanh(.) represents an activation function, e u ,e i , respectively represent one-hot encoding of the user and the item, e u,i represents a representation vector of sentiment polarity, represents the weight of the encoder, represents the bias of the encoder.

[0081] The decoder uses a gating unit to combine two GRUs to generate the final hidden state, including:

[0082]

[0083] wherein, h t represents the final hidden state, k represents a proportion coefficient for adjusting the output of the context GRU and the feature GRU, w c represents the first weight of the gating unit, w β represents the second weight of the gating unit, represents the output of the context GRU, represents how much past information is retained by the context GRU, candidate hidden state of the context GRU, weights of the context GRU, f t-1 word representation generated at the previous time step, how much the context GRU controls to forget the past information, h t-1 hidden state at the previous time step, bias of the context GRU, output of the feature GRU, how much the feature GRU controls to retain the past information, candidate hidden state of the feature GRU tanh(.) represents an activation function, weights of the feature GRU, bias of the feature GRU, x f features extracted from the user reviews, how much the feature GRU controls to forget the past information, represents the Hadamard product of matrices.

[0084] generate the probability of the explanation word in the vocabulary according to the initialization vector and the final hidden state, including:

[0085]

[0086] where, as a distribution probability on the vocabulary, W v v represent the weights and bias of the explanation generation module, respectively, y <t words generated before time t, y t word predicted at the current time step, softmax(.) represents an activation function, h0 represents the initialization state of the decoder, h t final hidden state.

[0087] Although the embodiments of the present application have been shown and described, it can be understood by those skilled in the art that various changes, modifications, substitutions and variations can be made to the embodiments without departing from the principles and spirit of the present application, and the scope of the present application is defined by the appended claims and their equivalents.​

Claims

1. An interpretable recommendation method based on joint-score prediction and reason generation, characterized in that, The method comprises the following steps: S1: obtaining user-item interaction history data, dividing the obtained user-item interaction history data into data sets to generate a training data set and a test data set, preprocessing the user-item interaction history data in the training data set, and generating an explanation vocabulary; The user-item interaction history data comprises user rating data and comment data of items; S2: establishing a joint rating prediction and explanation generation model; The joint rating prediction and explanation generation model comprises a preference rating prediction module and an explanation production module; The preference rating prediction module comprises a matrix decomposition layer, an aspect extraction layer based on an attention mechanism, and a prediction layer; The explanation production module comprises an encoder and a decoder; S3: inputting the training data set into the joint rating prediction and explanation generation model for model training, calculating the loss of the joint rating prediction and explanation generation model by a loss function until convergence, and obtaining a trained joint rating prediction and explanation generation model; S4: inputting the test data set into the trained joint rating prediction and explanation generation model to obtain a rating prediction of a target user-item, selecting an item with the highest rating to recommend to the user, and generating a corresponding recommendation explanation; S41: inputting the test data set into the preference rating prediction module, and obtaining free embedding representations of users and items by the matrix decomposition layer based on the rating data of the users and items in the test data set; S42: inputting the test data set into the preference rating prediction module, extracting aspect representations of comment sentences by the aspect extraction layer based on the attention mechanism based on the comment data of the users and items in the test data set, respectively obtaining user and item representations by average pooling operation, and obtaining encoding vectors of aspect feature spaces by MLP; S43: performing rating prediction by the prediction layer based on the encoding vectors of the latent feature spaces and the encoding vectors of the aspect feature spaces to obtain the rating of the user to the item, and selecting the item with the highest rating to recommend to the user; S44: inputting the rating of the user to the item as an emotional judgment of an explanation sentence into the explanation production module, inputting the user-item pair into the encoder, initializing a vector by a multilayer perceptron (MLP) of the decoder, generating a final hidden state by a combination of two gated recurrent units (GRUs) of the decoder, generating a probability of an explanation word in the vocabulary based on the initialized vector and the final hidden state, and taking the word with the largest probability as the generated recommendation explanation.

2. The interpretable recommendation method based on joint score prediction and reason generation according to claim 1, characterized in that, The preprocessing of the user-item interaction history data in the training data set comprises the following steps: S11: deleting all stop words and punctuation marks of the rating data of the user to the item in the training data set; S12: generating an explanation vocabulary by a Word2vec model in a gensim toolkit based on the processed rating data of the user to the item.

3. The interpretable recommendation method based on joint score prediction and reason generation of claim 1, wherein, The calculation of the loss of the joint rating prediction and explanation generation model by the loss function until convergence to obtain the trained joint rating prediction and explanation generation model comprises the following steps: wherein, represents a loss function of the joint score prediction and explanation generation model, represents a loss coefficient of the aspect extraction layer based on attention mechanism, represents a loss function of the aspect extraction layer based on attention mechanism represents a loss coefficient of the loss function of reconstructing sentence embeddings, represents the loss function of reconstructing sentence embeddings, r w represents the use of aspect matrix reconstructed sentence embedding vector, z w represents the sentence embedding vector based on attention mechanism, z ′ w represents the sentence embedding vector based on aspect matrix reconstruction, represents a regularization loss coefficient, represents a regularization loss function of the aspect extraction layer based on attention mechanism, represents a loss coefficient of the preference score prediction module, represents a loss function of the preference score prediction module, represents a user-item pair in the training set, r u,i represents the actual rating of the user u to the item i in the training data set, represents the predicted rating of the user u to the item i in the prediction data set, represents a loss coefficient of the explanation generation module, represents a loss function of the explanation generation module, a represents a user-item pair, represents the factual explanation of the user u and the item i in the explanation vocabulary, p(y t ) represents the probability of predicting the word y t , represents the weight of global parameters, and ||Θ|| represents global parameters.

4. The interpretable recommendation method based on joint score prediction and reason generation of claim 1, wherein, The free embedding representation of the user and the item is obtained by processing the encoding vector of the latent feature space in the MLP, including: where MLP denotes a multi-layer perceptron, Relu(.) denotes an activation function, respectively denote the free-embedding representations of user u and item i, l , b l respectively denote the weights and biases of the l-th layer of the MLP in the latent feature space, denotes the encoding vector of the final output of the MLP in the latent feature space.

5. The interpretable recommendation method based on joint scoring prediction and reason generation of claim 1, wherein, The review data of the user and the item is extracted by the aspect attention layer to obtain the aspect representation of the review sentence, including: S421: The review data of the user and the item in the test set is input into the word embedding matrix to obtain the word embedding vector of each word; S422: The word embedding vector is selected by the attention mechanism to capture the most relevant information about the aspect of the sentence, and the embedding of the sentence is obtained; S423: The obtained sentence embedding is calculated by an activation function to obtain a weight vector of K aspect embeddings, where each component represents the probability that the sentence belongs to the aspect; S424: The reconstruction of the sentence embedding vector is realized by the linear combination of the weight vector of the aspect embedding, and the aspect representation of the review sentence is finally obtained.

6. The interpretable recommendation method based on joint score prediction and reason generation of claim 1, wherein, The representation of the user and the item is obtained by the MLP to obtain the encoding vector of the aspect feature space, including: where MLP denotes a multi-layer perceptron, Relu(.) denotes an activation function, φ u ,φ i denote aspect feature vectors for user u and item i, respectively, l φ denote the weights and biases of the l-th layer of the MLP in the aspect feature space, respectively, denotes the encoding vector of the final output of the MLP in the aspect feature space.

7. The interpretable recommendation method based on joint scoring prediction and reason generation of claim 1, wherein, The encoding vector of the latent feature space and the encoding vector of the aspect feature space are scored by the prediction layer to obtain the rating of the user to the item, including: where, represents the preference prediction score of user u for item i, represents the encoding vector in the aspect feature space, represents the encoding vector in the latent feature space, W R represents the weight of the prediction layer, b u represents the user bias, b i represents the item bias, μ represents the global bias.

8. The interpretable recommendation method based on joint score prediction and reason generation of claim 1, wherein, The rating of the user to the item is used as the sentiment judgment of the explanation sentence, and the user and the item are input into the explanation generation module as the initial state to be encoded by the encoder, including: wherein h0 represents an initialization vector obtained by encoding the encoder, tanh(.) represents an activation function, e u i , respectively represent the one-hot encoding of the user, item, e u,i represents a representation vector of the sentiment polarity, represents the weight of the encoder, represents the bias of the encoder.​ 9. The interpretable recommendation method based on joint scoring prediction and reason generation of claim 1, wherein, The decoder uses a gating unit to combine two GRUs to generate the final hidden state, including: where h t denotes the final hidden state, k denotes a scaling factor that adjusts the outputs of the contextual GRU and the feature GRU, w c denotes the first weight of the gating unit, w β denotes the second weight of the gating unit, denotes the output of the contextual GRU, denotes how much past information the contextual GRU controls to retain, denotes the candidate hidden state of the contextual GRU, denotes the weight of the contextual GRU, f t-1 denotes the word representation generated at the previous time step, denotes how much past information the contextual GRU controls to forget, h t-1 denotes the hidden state at the previous time step, denotes the bias of the contextual GRU, denotes the output of the feature GRU, denotes how much past information the feature GRU controls to retain, denotes the candidate hidden state of the feature GRU tanh(.) denotes the activation function, denotes the weight of the feature GRU, denotes the bias of the feature GRU, x f denotes the features extracted from the user reviews, denotes how much past information the feature GRU controls to forget, and denotes the Hadamard product of matrices.

10. The interpretable recommendation method based on joint scoring prediction and reason generation of claim 1, wherein, The probability of the explanation word in the vocabulary is generated according to the initialization vector and the final hidden state, including: wherein, W is considered as a distribution probability on the vocabulary, v b v respectively represent the weight and bias of the interpretation generation module, y <t represents the word generated before time t, y t represents the word predicted at the current time, softmax(.) represents an activation function, h0represents the initialization state of the decoder, h t represents the final hidden state.

Citation Information

Patent Citations

  • Commodity recommendation method combining attention network and user emotion

    CN111222332A

  • Behavioral based score

    US20140074688A1