A dialogue recommendation method based on topic enhancement
By employing a topic-based augmentation approach, leveraging ConceptNet to expand the knowledge base and cross-attention to capture topic semantics, and combining multi-dimensional information learning and self-supervised feedback, the problem of insufficient topic learning and neglect of user feedback in dialogue recommendation systems is solved, resulting in more accurate recommendations and natural dialogue generation.
Patent Information
- Application Number
- CN202411355868.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-27
- Publication Date
- 2026-01-16
- Estimated Expiration
- 2044-09-27
AI Technical Summary
Existing dialogue recommendation systems suffer from problems such as insufficient topic learning, inadequate understanding of user intent, and noise caused by ignoring user feedback in topic prediction, item recommendation, and sentence generation, which affect recommendation performance.
We adopt a topic-based augmentation approach, expand the topic knowledge base with ConceptNet, capture topic semantic relationships using cross-attention and graph convolutional neural networks, and design a Transformer-structured dialogue generation module by combining multi-angle topic information learning and self-supervised feedback mechanisms, thus integrating topic information and knowledge-enhanced dialogue components.
The accuracy of the topic prediction and recommendation modules was improved, enabling a more natural and fluid dialogue recommendation process. The ability to acquire user preferences and process feedback was enhanced, thereby improving the system's recommendation performance.
Smart Images

Figure CN118886510B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of dialogue recommendation, and in particular to a dialogue recommendation method based on topic enhancement. BACKGROUND
[0002] In recent years, with the rapid development of the field of artificial intelligence, the dialogue recommendation system (CRS) has become a new research topic, which learns the user's preferences through real-time dialogue with the user to provide high-quality recommendations.
[0003] The CRS in the prior art has the following three problems:
[0004] Firstly, the topic not only plays an important role in topic prediction tasks, but also contains certain user intentions in the recommendation process, which is different from other non-entity semantic information. However, the current dialogue recommendation method only uses topic and other semantic information in the topic prediction module, so that the learning of the topic is not sufficient, and the topic preferences are not obtained, so that the next topic cannot be accurately predicted and the dialogue cannot be guided.
[0005] Secondly, the topic information expressed by the user intention and the dialogue theme is not fully understood in the item recommendation module, and the topic is not learned, so that the user's preference information for a certain attribute cannot be accurately obtained. The preference acquisition is not accurate enough.
[0006] Thirdly, in the dialogue recommendation, the user feedback has a great influence on the acquisition of user preferences, and a good user feedback mechanism can enhance the performance of dialogue recommendation. If we ignore the user's refusal feedback in a dialogue, the learned data will have certain noise when learning the topic sequence, and there will be a certain deviation from the user's intention understood by natural language. Therefore, a new user feedback method needs to be designed for the topic in this field, and the positively accepted topic and the negatively refused topic are learned at the same time, so as to obtain more accurate user preferences.
[0007] Therefore, a dialogue recommendation method based on topic enhancement is needed to obtain better performance in topic prediction, item recommendation and sentence generation. SUMMARY
[0008] The main purpose of the present application is to provide a dialogue recommendation method based on topic enhancement to solve the problem that the dialogue recommendation method in the prior art is more accurate in topic prediction, item recommendation and sentence generation.
[0009] To achieve the above purpose, the present application provides a dialogue recommendation method based on topic enhancement, which specifically comprises the following steps:
[0010] S1, for the topic prediction task, a knowledge-based topic prediction module is designed, ConceptNet is taken as an external knowledge base of the topic to expand the topic, and the current user topic preference is used to guide the generation of the final topic preference through cross attention.
[0011] S2, for the item prediction task, a multi-angle topic information learning-based item recommendation module is designed, the topic information obtained in the topic prediction is introduced into the item prediction task as a data source, and the user preference is obtained through a gating mechanism and the original data.
[0012] S3, for the dialogue generation task, a topic-enhanced dialogue generation module based on the Transformer structure is designed, and the topic information and knowledge-enhanced dialogue components are fused.
[0013] Further, step S1 specifically comprises the following steps:
[0014] S1.1, extract the topic-related triples from ConceptNet, in order to encode the topic-oriented knowledge graph KG, adopt a graph convolutional neural network GCN to capture the semantic relationship between topics, and in each update, the GCN receives information from the one-hop neighborhood of the graph and performs the following aggregation operation:
[0015] (1);
[0016] wherein, is the representation of the node, represents the number of nodes, represents the node representation dimension, is the learnable matrix of the layer, is the adjacency matrix of the graph, D is the diagonal matrix, represents the activation function.
[0017] S1.2, the topic vocabulary information and the current dialogue text in each round of dialogue are spliced into the topic vocabulary sequence and the current dialogue text sequence respectively, and are input into the bidirectional encoder representation model respectively in each dialogue, to obtain the representation of each round of dialogue and , as shown in the following formula:
[0018] (2);
[0019] (3);
[0020] where, , is the number of topic vocabulary information in the input , is the feature embedding dimension, is the feature matrix, is the embedding of the dialogue text obtained via , is the embedding of the topic vocabulary obtained via .
[0021] Further, step S1 further comprises the following steps:
[0022] S1.3, the knowledge-enhanced topic information after introducing cross attention is represented as :
[0023] (4);
[0024] where, represents the defined multi-head self-attention function, represents the embedding representation of the topic vocabulary knowledge enhancement.
[0025] S1.4, in order to learn the final user topic preference information, the , and are fused, the connection , and is obtained through a multi-layer perception and function to get the final topic prediction probability :
[0026] (5);
[0027] where, represents the topic feature representation, represents the multi-layer perception model.
[0028] S1.5, in order to learn the parameters, the cross entropy loss is set as:
[0029]
[0030] (6);
[0031] where, is the session, is the topic, is the number of sessions, is the number of topics for each session, is the label of whether the prediction is successful, taking value 0 or 1, is the predicted topic , is the probability of the predicted topic , is the regularization term,
[0032] Further, step S2 specifically comprises the following steps:
[0033] S2.1, inputting the dialogue text sequence and the topic vocabulary sequence into the model respectively to obtain coarse-grained and fine-grained preference representations, i.e. sentence-level user preference and word-level user preference , and the formulas are as follows:
[0034] (7);
[0035] (8);
[0036] wherein, represents a bidirectional encoder representation model.
[0037] S2.2, inputting the historical interaction sequence into a sequence recommendation model based on a self-attention mechanism to obtain the user interaction preference representation :
[0038] (9).
[0039] S2.3, fusing the two dialogue content embeddings through a gate mechanism to obtain the partial user preference in the current dialogue content :
[0040] (10);
[0041] (11);
[0042] wherein, represents a trade-off parameter, represents a weight parameter, represents a sigmoid function.
[0043] S2.4, combining and to obtain the complete user preference embedding :
[0044] (12).
[0045] Further, step S2 further comprises the following steps:
[0046] S2.5, encode the obtained negative topic feedback information of the user to obtain user feedback embedding :
[0047] (13).
[0048] wherein, is the i-th negative topic.
[0049] S2.6, separate the negative feedback information of the user from the current positive feedback information using a similarity calculation formula, and obtain feedback loss :
[0050] (14).
[0051] wherein, is a cosine similarity function, is a batch size, is a loss hyperparameter.
[0052] S2.7, according to the user preference learned by formula (12), calculate the probability of recommending an item from the item set to the user U :
[0053] (15).
[0054] wherein, is the learned embedding of the item , and is an activation function.
[0055] S2.8, in order to learn all the parameters of the item recommendation module, the cross-entropy loss is set as:
[0056] (16).
[0057] Further, step S3 comprises the following steps:
[0058] S3.1, introduce an encoder to encode the current dialogue, then feed the learned user preference representation into the decoder as cross-attention signals, and the text representation after the self-attention layer and the cross-attention layer is:
[0059] (17).
[0060] (18);
[0061] wherein, is the embedding matrix from the (n-1)-th layer decoder, is the embedding representation after the self-attention layer, is the user preference embedding is the embedding representation after the cross-attention layer.
[0062] S3.2, a two-layer cross-attention mechanism is designed to introduce knowledge-enhanced topic information and historical sentences, and an embedding matrix fusing multiple information is obtained :
[0063] (19);
[0064] (20);
[0065] (21);
[0066] wherein, is the variant of the historical sentence before the current predicted sentence combined with the recommended item or the topic, is the feedforward neural network.
[0067] S3.3, a sentence containing a topic item or a movie item is generated, given a predicted sequence , the next word prediction probability is calculated as:
[0068] (22);
[0069] wherein, is the decoder output as input, the maximum generation probability of the next word on the vocabulary table, represents the copying probability implemented on the current preference and the knowledge graph KG following the standard copying mechanism, is the user preference perception, is the knowledge graph DBpedia used.
[0070] S3.4, the parameters of the dialogue module are learned using the cross-entropy loss, and the cross-entropy loss is as follows:
[0071] (23);
[0072] wherein, is the sentence in each dialogue.
[0073] The present application has the following beneficial effects:
[0074] The application introduces specific semantic unit topic information, uses topic information from the aspects of topic independent sequence, text sequence, etc. in combination with self-supervised tasks, knowledge graphs and cross attention mechanisms, and fuses the topic information with dialogue content and item entities, fully learns the representation of various information, improves the accuracy of the topic prediction module and the recommendation module, simultaneously integrates knowledge enhanced topic information, user preferences and historical sentences containing topic words into the dialogue generation module, so that the system can actively and effectively guide the recommended scheme, the three modules interact with each other, and realize the recommendation process based on fluent natural language. BRIEF DESCRIPTION OF DRAWINGS
[0075] In order to more clearly illustrate the technical solutions in the specific embodiments or the prior art, the drawings needed to be used in the specific embodiments or the prior art description will be briefly introduced. Obviously, the drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor. In the drawings:
[0076] Figure 1 A flowchart of a dialogue recommendation method based on topic enhancement is shown.
[0077] Figure 2 A graph of the ablation experiment results of the topic prediction module based on knowledge is shown.
[0078] Figure 3 A graph of the ablation experiment results of the item recommendation module based on multi-angle topic information learning is shown. DETAILED DESCRIPTION
[0079] The technical solutions of the present application will be described in detail below with reference to the drawings. Obviously, the described embodiments are some embodiments of the present application, not all embodiments. 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.
[0080] As shown in a dialogue recommendation method based on topic enhancement, the method specifically comprises the following steps: Figure 1
[0081] S1, for the topic prediction task, a topic prediction module based on knowledge is designed, ConceptNet is used as an external knowledge base of the topic to expand the topic, and cross attention is used to guide the generation of the final topic preference by using the current user topic preference.
[0082] S2, for the project prediction task, a project recommendation module based on multi-angle topic information learning is designed, topic information obtained in topic prediction is introduced into the project prediction task as a data source, and a gating mechanism is used to fuse the original data to obtain user preferences.
[0083] S3, for the dialogue generation task, a dialogue generation module based on topic enhancement is designed based on the Transformer structure, and the dialogue component is enhanced by fusing topic information and knowledge, so that the dialogue recommendation process is more natural and smooth.
[0084] In the present application, a dialogue recommendation method based on topic enhancement is proposed, and a dialogue recommendation system TE-CRS based on topic enhancement is constructed by the method, and the present application takes the topic as the research center, fully utilizes the topic semantic unit from the angles of topic independent sequence and text sequence, enhances the topic information, fully excavates the role of the topic in the dialogue recommendation, and finally successfully recommends in combination with the dialogue context. TE-CRS is mainly divided into three modules, namely a topic prediction module based on knowledge, a project recommendation module based on multi-angle topic information learning and a dialogue generation module based on topic enhancement, and the topic information representation with knowledge obtained by the topic prediction module based on knowledge is input into the dialogue generation module based on topic enhancement , the predicted topic and the user preference obtained by the project recommendation module are input into the dialogue generation module based on topic enhancement, and then the dialogue recommendation task is realized.
[0085] Among them, for the topic prediction module based on knowledge, TE-CRS introduces ConceptNet common sense graph as an external knowledge base of the topic to expand the topic, and uses the current user topic as a query matrix Query to generate the current topic representation by using cross attention, which reduces the noise problem caused by external knowledge to a certain extent. Then, the learned user's current dialogue text level representation is fused to obtain the overall topic preference to predict the next topic.
[0086] For the project recommendation module based on multi-angle topic information learning, TE-CRS introduces the topic information obtained in topic prediction as a data source into the project recommendation task, and effectively fuses the current dialogue text embedding representation and user interaction record representation through a gating mechanism, so as to obtain more accurate user preferences and improve the recommendation accuracy. Secondly, TE-CRS designs a self-supervised module in this task to solve the user feedback problem, obtains the user's rejection activity from the data as the user's topic negative feedback information, combines the above-mentioned natural language learned positive feedback information to learn the internal correlation between them, and to a certain extent, eliminate the noise existing in the user preferences.
[0087] For the dialogue generation module based on topic enhancement, the TE-CRS integrates the topic into the Transformer encoder-decoder architecture, and at the same time, introduces the user preference information fused with the topic and the topic information enhanced by knowledge through two cross-attention layers, better guides, and realizes a more interesting and effective dialogue process.
[0088] Specifically, for the knowledge-based topic prediction module, first, knowledge-enhanced topic representation learning is performed: the TE-CRS introduces the common sense knowledge graph ConceptNet as the external knowledge of the topic, and supplements the learning of the topic. Then, through the cross-attention mechanism, the user topic learned by the current language training model is used as the query matrix Query to generate the final knowledge-enhanced topic representation, which to some extent reduces the noise problem brought by external knowledge, and makes the learned topic more accurate. At the same time, the learned knowledge-enhanced topic information, pre-trained topic representation and text information obtained by pre-training learning are fused, and finally the next topic prediction is realized.
[0089] Step S1 specifically includes the following steps:
[0090] S1.1, knowledge-enhanced topic learning: the TE-CRS identifies the topic semantic units in the dialogue, and uses the KG to enhance the representation of the topic semantic units. The TE-CRS uses ConceptNet as a knowledge graph KG facing the topic vocabulary. This knowledge graph stores common sense as triples , wherein is a word, is a word relationship. The TE-CRS extracts topic-related triples from ConceptNet for the topic vocabulary appearing in the text. In order to encode the knowledge graph KG facing the topic vocabulary, the graph convolutional neural network GCN is used to capture the semantic relationship between topics, and at each update, the GCN receives information from the one-hop neighborhood of the graph and performs the following aggregation operation:
[0091] (1);
[0092] , wherein is the representation of the node, represents the number of nodes, represents the node representation dimension, is the learnable matrix of the layer, is the adjacency matrix of the graph, D is the diagonal matrix, represents the activation function. By stacking multiple convolutions, node information can be propagated with graph structure. When the algorithm ends, the TE-CRS can obtain the topic vocabulary sequence knowledge-enhanced dimensional representation Here, TE-CRS has no merging relationship information, because the number of relationships is large, and many relationships have no direct help for topic prediction, and even produce a lot of noise that cannot be eliminated.
[0093] S1.2, topic prediction of fusion multi-class topic preference: In addition to the above external knowledge learning, TE-CRS also performs representation learning on text information. The topic vocabulary information in each round of dialogue and the current dialogue text are spliced into topic vocabulary sequence and current dialogue text sequence respectively, and and are input into the bidirectional encoder representation model respectively to obtain the representation of each round of dialogue and , as shown in the following formula:
[0094] (2);
[0095] (3);
[0096] wherein, , is the number of topic vocabulary information in the input , h is the feature embedding dimension, is the feature matrix, is the embedding obtained by the dialogue text via , and is the embedding obtained by the topic vocabulary via .
[0097] In addition, for the input topic vocabulary, TE-CRS is modified, and TE-CRS adds the user's feedback information, that is, if the user refuses the topic vocabulary recommended in the last round when asking or answering questions, then TE-CRS will remove the refused topic vocabulary when predicting the next round, so as to reduce the influence of the user's preference on the user's preference.
[0098] Next, given the above learned dialogue text, historical topic information representation, etc., how to generate a set of topic words in dialogue recommendation is studied. Therefore, this module and the project recommendation module can be regarded as the same nature, and the key point of both is to learn a good representation of user preferences (different from traditional recommendation systems, assuming that there is no previous interaction record available, only dialogue data can be used to infer user preferences). First, TE-CRS collects all topic words appearing in the current dialogue (the initial topic is greeting), and through the graph convolutional neural network in step S1.1, the topic word embedding matrix is obtained . Specifically, step S1 further includes the following steps:
[0099] S1.3, since the knowledge graph is extracted from the existing knowledge base, it may contain some noise nodes and cannot accurately express the user's preferences; and because the goal of TE-CRS is to use relevant knowledge information to enhance the current user interest representation, TE-CRS proposes a knowledge-aware cross-attention layer. TE-CRS uses the embedding representation obtained by the current topic sequence as a query to process the topic representation after knowledge enhancement. Formally, the knowledge-enhanced topic information representation after introducing cross-attention is :
[0100] (4);
[0101] wherein, represents the defined multi-head self-attention function, represents the topic word knowledge-enhanced embedding representation.
[0102] S1.4, in order to learn the final user topic preference information, the , and are fused, the is used to connect , and , and the final topic prediction probability is obtained through the multi-layer perception and function:
[0103] (5);
[0104] wherein, represents the topic feature representation, represents the multi-layer perception model. TE-CRS selects the high-ranked topic as the guide word for the next sentence according to the topic ranking.
[0105] S1.5, in order to learn the parameters, the cross-entropy loss Set to:
[0106]
[0107] (6);
[0108] in, It's a conversation. It's a topic of conversation. It's the number of sessions. It refers to the number of topics in each session. The label indicating whether the prediction was successful can be either 0 or 1. It's a topic of prediction. The probability, yes Regular terms, It is the natural logarithm with base e.
[0109] Specifically, the purpose of the project recommendation module based on multi-angle topic information learning is to predict the projects that users like based on the context of the dialogue. For topic-guided recommendations, the relationship between topic vocabulary and text should be made fuller. Therefore, a project recommendation module based on multi-angle topic information learning was designed in this step. This module is divided into two parts: (1) a topic-based multi-information learning and fusion module, and (2) a project recommendation module that integrates topic feedback self-supervised learning.
[0110] Step S2 specifically includes the following steps:
[0111] In S2.1, within the topic-based multi-information learning and fusion module, TE-CRS will learn from the dialogue text, topic vocabulary sequences, and user interaction records. TE-CRS will then learn from the dialogue text sequences... and topic vocabulary sequence Enter them separately The model obtains coarse-grained and fine-grained preference representations, namely sentence-level user preferences. and word-level user preferences The formula is as follows:
[0112] (7);
[0113] (8);
[0114] in, This represents the bidirectional encoder representation model.
[0115] S2.2, the historical interaction sequence Input a sequence recommendation model based on self-attention mechanism The user's interaction preference representation is obtained from this. :
[0116] (9).
[0117] S2.3, fuse two dialogue content embeddings by gate mechanism to obtain part of user preference in current dialogue content :
[0118] (10);
[0119] (11);
[0120] wherein, represents a trade-off parameter, represents a weight parameter, represents a sigmoid function.
[0121] S2.4, combine and to obtain complete user preference embedding :
[0122] (12).
[0123] Specifically, step S2 further comprises the following steps:
[0124] For the project recommendation module of the fusion topic feedback self-supervised learning, TE-CRS is affected by contrastive learning from the loss function, and a topic-based self-supervised module is designed to learn more accurate user information, and combined with complete user preference embedding , train the loss of the project recommendation module, and finally realize project recommendation.
[0125] S2.5, unlike the traditional recommendation in the past, such as the user feedback obtained by various clicks, TE-CRS obtains the negative semantic in the text from the user dialogue, based on which TE-CRS can extract the negative topic feedback of the user, and through the collected topic of the user's refusal, the preference of the user can be cleaned to a certain extent, and the user feedback embedding is obtained by encoding the obtained negative topic feedback information of the user :
[0126] (13);
[0127] wherein, is the jth refused topic.
[0128] S2.6, separate the negative feedback information of the user from the current positive feedback information using a similarity calculation formula, and obtain a feedback loss :
[0129] (14);
[0130] where, is the cosine similarity function, is the batch size, is the loss hyper-parameter.
[0131] S2.7, the probability of recommending an item from the item set to the user U is calculated according to the user preference learned by formula (12) :
[0132] (15);
[0133] where, is the learned embedding of the item is the activation function, and the item set recommended to the user can be obtained by sorting the probability.
[0134] S2.8, in order to learn all the parameters of the item recommendation module, the cross-entropy loss is set to:
[0135] (16);
[0136] According to the previous work, TE-CRS adopts the Transformer model to develop an encoder-decoder framework for dialogue tasks, and designs multiple cross-attention layers to introduce user preference information and knowledge-enhanced topic information, and sends the topic vocabulary or recommended items and text into the decoder, so as to generate natural language with guiding effect.
[0137] Specifically, step S3 includes the following steps:
[0138] S3.1, an encoder is introduced to encode the current dialogue, and then the learned user preference representation is fed back to the decoder as a cross-attention signal. The text representation after the self-attention layer and the cross-attention layer is:
[0139] (17);
[0140] (18);
[0141] where, is the embedding matrix from the (n−1) layer decoder, is the embedding representation after the self-attention layer, is the user preference embedding The embedding representation enhanced by the cross-attention layer.
[0142] S3.2, a two-layer cross-attention mechanism is designed to enhance the topic information with knowledge (to make the vocabulary of the topic more fluent in sentence generation, increase the connection between the words in the sentence, and improve the fluency of the sentence) and historical sentences are introduced to obtain an embedding matrix that integrates multiple information :
[0143] (19);
[0144] (20);
[0145] (21);
[0146] wherein, is the variant of the historical sentence before the current predicted sentence combined with the recommended item or topic, is a feedforward neural network. In the non-recommendation scenario is the historical sentence is connected with the predicted topic The embedding representation obtained by the encoder is connected (separated by a separator seq in the middle). In the recommendation scenario is the historical sentence is connected with the predicted movie The embedding representation obtained by the encoder is connected (separated by seq in the middle).
[0147] For the dialogue module, the main difference between TE-CRS and KGSF is that this method connects the topic or recommended item with the dialogue, and integrates the knowledge-enhanced topic representation into the decoder to enhance the fluency and explainability of the sentence.
[0148] S3.3, since the response generated by TE-CRS should contain recommended movie items and topics. Next, a sentence containing a topic item or a movie item is generated. To generate a sentence containing a topic item or a movie item, given the predicted sequence , the next word prediction probability is calculated as:
[0149] (22);
[0150] wherein, is the maximum generation probability of the next word generated on the vocabulary table by taking the decoder output as input, represents the copying probability implemented in the standard copying mechanism on the current preference and knowledge graph KG, is the user preference perception, DBpedia is used as the knowledge graph.
[0151] S3.4, the parameters of the dialogue module are learned using cross-entropy loss, which is as follows:
[0152] (23);
[0153] wherein, is the sentence in each dialogue.
[0154] Embodiment one
[0155] The TE-CRS is evaluated using the TG-Redial dataset, which is constructed by relevant data in a certain movie website, and it contains 1482 users, 10000 dialogues, 129392 sentences and 33834 movies, with an average of 7.9 topics per dialogue. The dataset is guided by extracting the topic clues in ConceptNet as the direction of the dialogue to make the dialogue more natural from chatting to recommendation. In addition, the dataset contains the profiles and viewing history of different roles, and different roles participate in multiple dialogues, which can better study personalized tasks. The TE-CRS divides the dataset into training set, validation set and test set according to 8:1:1. For all dialogues, starting from the first sentence, the model generates reply sentences and recommended items step by step, and then evaluates the three sub-tasks, i.e. topic prediction, item recommendation and dialogue generation. In this embodiment, the TE-CRS will be evaluated through the three sub-tasks, i.e. topic prediction, item recommendation and dialogue generation. Therefore, in this embodiment, not only the TE-CRS is compared with the CRS method, but also representative topic prediction, item recommendation and dialogue methods are selected as the baseline. The following explains the model: TextCNN: based on the CNN model, according to the context information, the text features are extracted as user embedding.
[0156] Transformer: can process sequence data, in this experiment, text generation without recommendation information is performed.
[0157] SASRec: uses the Transformer structure to encode the user interaction history, and does not use dialogue data.
[0158] MGCG: it is a CRS method based on multiple types of GRU (with special GRU to encode user profiles).
[0159] ReDial: a method specially proposed for CRS, which consists of a dialogue generation module based on HRED, a recommendation module based on an auto-encoder and a sentiment analysis module.
[0160] KBRD: is an early CRS method that introduces a knowledge graph, which enhances the semantics of contextual words or entities to improve recommendation quality.
[0161] KGSF: This method enhances the semantic representation of items and words through DBpedia and ConceptNet, and uses mutual information maximization to align the semantic space.
[0162] TG-Redial: First introduced topic guidance, through topic prediction to generate the next sentence.
[0163] RevCove: It proposes a recommendation method that uses reviews to enhance the quality of dialogue recommendations, where reviews are selected by a sentiment-aware and retrieval module and used to enhance the recommendation module and dialogue generation module.
[0164] UniMINDn / s: It proposes a unified multi-task dialogue recommendation framework that unifies multiple sub-tasks into the same seq2seq paradigm and combines prompt learning, enabling the final model to have multi-task learning capabilities. The suffix n and s represent natural language-based prompts and special token-based prompts.
[0165] BERT: A language model that directly feeds historical sentences into encoding.
[0166] Among these baselines, TextCNN and SASRec are recommendation methods represented by R, Transformer is a better text generation method represented by N, BERT is a pre-trained language model represented by P, and the rest are special methods in the CRS field represented by C.
[0167] In the experiments of this embodiment, TE-CRS uses different indicators to evaluate the three tasks. For the recommendation task, the and are used as evaluation indicators to rank the recommended movie items.
[0168] Among them, MRR@k represents the reciprocal sum of the position of the benchmark instance in the ranking result, and the average value is the final result , the formula is as follows:
[0169] ;
[0170] , indicates that the benchmark instance is ranked in the ranking result, is the total number of recommended results.
[0171] For measuring the ranking quality and recommendation accuracy of the recommendation system in the top recommendation results. When the benchmark fact appears in the top of the ranking results, the index will be higher, The calculation formula is as follows:
[0172] ;
[0173] ;
[0174] ;
[0175] wherein represents the score of the th position represents the result under the optimal condition, is the discounted cumulative gain, is the set obtained by sorting the original recall set R according to the manual annotation score in the original data set from large to small, is the normalized discounted cumulative gain.
[0176] For the topic prediction task, Hit@k (k = 1, 10, 50) is used for evaluation. If the benchmark fact is in the top k of the ranking results, the counter is incremented by 1, and if it is not in the top k, the counter remains unchanged. The evaluation result of this index is the counter divided by the total number of calculations, which can measure the hit rate of the successful topic predicted by TE-CRS in the top k in the topic prediction task.
[0177] For the dialogue generation task, it is divided into automatic evaluation and manual evaluation. For automatic evaluation, Distinct-n (n = 2, 3, 4) diversity index is used to measure the diversity of sentences.
[0178] wherein, is defined as the proportion of different n-grams in a sentence, i.e. n continuous words. The calculation formula is as follows:
[0179] ;
[0180] wherein, represents the number of all in the text, represents the number of non-repeated in the text.
[0181] For manual evaluation, TE-CRS invites three people (by inviting three people to improve fairness and credibility as much as possible) to score the generated candidate sentences in two aspects, namely fluency and informativeness. The score range is 0 to 2. The final score is the average score of the three people.
[0182] For this embodiment, Pytorch3 deep learning framework and CRS Lab dialogue recommendation system open source toolkit are used to implement TE-CRS. For the embedding dimension of the knowledge graph and the length of the input text of the language model, 128 and 256 are set respectively. TE-CRS uses the Adam optimizer for parameter learning. Different modules use different parameters for training, and the project recommendation module, the topic prediction module, and the generation module have a batch size and a learning rate of (8, 1e-5), (128, 0.001), and (128, 0.001) respectively.
[0183] In this embodiment, a series of experiments are conducted to verify the effectiveness of the TE-CRS model proposed by the application for the topic prediction task. The results are shown in Tables 1 and 2.
[0184] As shown in Tables 1 and 2, it can be seen that the performance of BERT and TG-Redial on this task is generally higher than that of MGCG (a dialogue recommendation model that fuses multiple dialogue types), and the reason is that both methods use the BERT model to learn the topic sequence and the dialogue text, indicating that the pre-trained language model is more suitable for capturing the semantic information of the topic, thereby achieving topic prediction.
[0185] Table 1 Experimental results of the topic prediction task in the Hit@k index, k = 1, 10, 50
[0186]
[0187] Table 2 Experimental results of the topic prediction task in the MRR@k and NDCG@k indexes, k = 1, 10, 50
[0188]
[0189] As can be seen from Tables 1 and 2, TE-CRS also achieves good results compared with TG-Redial, with an increase of 2%, 4.5%, and 3.9% in the Hit@50, MRR@50, and NDCG@50 indexes. Because TG-Redial creates topics in the dataset according to common sense knowledge graphs as clues, and TE-CRS uses KG topic information for enhancement, which is equivalent to supplementing certain clue knowledge, thereby improving the performance of the topic prediction task. At the same time, TE-CRS uses a cross-attention mechanism for guidance, which prevents noise input to a certain extent.
[0190] Therefore, from the above experimental results, it can be concluded that fully utilizing and learning topic information from different angles helps to improve the performance of the topic prediction task.
[0191] Next, in order to verify the effectiveness of each part of the TE-CRS topic prediction module, ablation experiments were conducted on the TG-Redial dataset, and the results are shown in FIG. 6. Figure 2
[0192] Figure 2 The red broken line in the middle is the overall effect of TE-CRS, and the green and blue lines represent the experimental results of removing the cross-attention module and the knowledge graph module, respectively, both of which are below the red line. Figure 2 From the figure, it can be seen that both modules of TE-CRS help improve the final result, and the topic prediction index will decrease if either component is removed. Specifically, on the TG-Redial dataset, the two ablation modules TE-CRS w / o CA and TE-CRS w / o KG decreased by 0.8% and 3% respectively compared to the original model in NDCG@50. The results on this dataset show that the effective use of multi-angle topic information helps improve the performance of topic prediction in the dialogue recommendation system. If the external knowledge enhancement and cross-attention debiasing process in the topic prediction module are removed, the recommendation performance of TE-CRS on both datasets will decrease, verifying the importance of using semantic units in the dialogue information from different angles in TE-CRS.
[0193] In order to better show the factors that affect the quality of the project recommendation module, the overall evaluation of the module is shown in Table 3.
[0194] First, from Table 3, it can be found that the evaluation results of the traditional recommendation method are lower than those of the dialogue recommendation method. This is because the traditional recommendation method only uses various attribute information of the item and does not integrate dialogue and recommendation like the dialogue recommendation method, while learning entities, non-entities and other information, and the topic prediction module and the project recommendation module interact with each other, thereby obtaining better results.
[0195] Table 3 Experimental results of project recommendation task
[0196]
[0197] Secondly, for the dialogue recommendation method, it can be found that the method using more data input types has higher effect than the method using less data input types, for example, KGSF (dialogue recommendation model based on semantic fusion) is higher than TG-Redial (dialogue recommendation model based on topic guidance), and the experimental results of RevCove (dialogue recommendation model based on reviews) are higher than TG-Redial and KGSF. The former is because TG-Redial simply uses text statements and item sequence information in the recommendation module, while KGSF combines entity-oriented information through knowledge graph. The latter is because RevCove adds external reviews to enhance the description of the item, which helps to better capture user preferences. In addition, UniMIND (multi-objective dialogue recommendation model based on unified multi-task learning framework) is better than the above three methods, because it combines prompt learning to learn text, topic, target and other knowledge through seq2seq, which shows that multi-angle information helps to enhance data representation.
[0198] Finally, TE-CRS is superior to all baselines because TE-CRS introduces topic information, uses gate mechanism to fuse multiple types of data to learn user preferences, including dialogue text, item sequence and other information, which combines the advantages of the above baselines, and uses topic feedback for noise reduction, and compared with UniMIND, it more accurately obtains user preference information and improves the quality of recommendation.
[0199] In the project recommendation module studied in the present application, TE-CRS introduces topic data, learns topic data from different angles and uses gate mechanism to fuse with other data, and at the same time creates a self-supervised module to feedback the topic. In order to study the influence of each part on the overall method, this part removes the gate mechanism, self-supervision and topic embedding module respectively, that is, TE-CRS w / o GATE, TE-CRS w / o SSUP and TE-CRS w / o Topic in Table 3.
[0200] Next, in order to verify the effectiveness of each part of the TE-CRS project recommendation module, ablation experiments are carried out on the TG-Redial dataset, and the results are shown in Table 4. Figure 3
[0201] From Figure 3 It can be seen that the three modules of TE-CRS all have a positive effect on the improvement of the recommended indicators. The blue column is the overall effect of the TE-CRS item recommendation module, and the orange, green and red columns represent the experimental results of removing the gate mechanism, self-supervision module and topic embedding module, which are all lower than the TE-CRS method without deleting the module. At the same time, from Table 3, it can be seen that on the TG-Redial dataset, the three ablation experiments TE-CRS w / o GATE, TE-CRS w / o SSUP and TE-CRS w / o Topic decreased by 0.8%, 1.2% and 10.1% respectively in the NDCG@50 indicator compared with the original model, among which the topic embedding effect is the largest, proving the necessity of fully understanding the special meaning of the word topic and the positive effect of introducing the topic on the recommendation module.
[0202] In summary, the results on the dataset show that the effective use of topic information from multiple angles, such as topic feedback, also helps to improve the performance of item recommendation in the dialogue recommendation system. If the gate mechanism, self-supervision module and topic embedding module in the item recommendation module are removed, the recommendation performance of TE-CRS on the dataset will decrease, especially the topic embedding has the greatest impact, which verifies the importance of learning various semantic units in the dialogue information from different angles to obtain user preferences and fuse them in the TE-CRS item recommendation module.
[0203] Table 4 shows the automatic evaluation results of the dialogue generation task of TE-CRS and the baseline model.
[0204] It can be seen that among the five baselines, Redial performs the worst on the dataset, the main reason being that Redial (dialogue recommendation model based on collaborative denoising) uses HRED for response generation, which is not suitable for encoding long sentences, and a large part of the dataset is long sentences with more information. Secondly, KBRD (knowledge-based dialogue recommendation model) and TG-Redial (topic-guided dialogue recommendation model) have a certain improvement over the other three baselines, as they use knowledge graph information and topics to guide text generation, but lack certain user interest perception, resulting in a disappointing performance on the dataset. In addition, although KGSF (semantic fusion-oriented dialogue recommendation model) uses various knowledge perception to improve dialogue performance, it does not use topic guidance, so to some extent, the dialogue generation performance of TE-CRS is lower. Finally, the results of the TE-CRS proposed by the present application are higher than all the baselines in the Dist-2 / 3 / 4 evaluation indicators, indicating that TE-CRS, based on the Transformer encoder-decoder, adds knowledge-enhanced topics, user preferences and topic guidance, can fully utilize the structural characteristics of the encoder-decoder, effectively utilize various semantic information in the context information, and generate fluent and informative responses.
[0205] Table 4 Experimental results of automatic evaluation of the dialogue generation task
[0206]
[0207] Table 5 shows the results of manual evaluation of the dialogue generation task. It can be seen that the informativeness of KBRD and KGSF is higher than the first two baselines, because both of these methods use KG data to enhance the informativeness of the text. At the same time, the TG-Redial method is higher than other baselines, because this method uses predicted topics and items to improve the quality of text generation. Finally, TE-CRS is also higher than all baselines in manual evaluation, indicating that the topic and user preference information introduced through cross-attention after KG enhancement can improve the fluency and informativeness of the generated sentences.
[0208] Table 5 Experimental results of manual evaluation of the dialogue generation task
[0209]
[0210] Of course, the above description is not a limitation on the present application, and the present application is not limited to the above examples. Changes, modifications, additions or substitutions made by those skilled in the art within the scope of the present application should also be within the scope of the present application.
Claims
1. A method for enhancing a dialogue recommendation based on a topic, characterized by, Specifically comprising the following steps: S1, for the topic prediction task, a knowledge-based topic prediction module is designed, ConceptNet is taken as an external knowledge base of the topic to expand the topic, and the current user topic preference is used to guide the generation of the final topic preference through cross attention; S2, for the item prediction task, a multi-angle topic information learning-based item recommendation module is designed, the topic information obtained in the topic prediction is introduced into the item prediction task as a data source, and a gating mechanism is used to fuse the original data to obtain the user preference; S3, for the dialogue generation task, a topic-enhanced dialogue generation module based on the Transformer structure is designed, and a dialogue component enhanced by topic information and knowledge is fused; Step S2 specifically comprises the following steps: S2.1, input the dialogue text sequence and topic vocabulary sequence into the model respectively and obtain coarse-grained and fine-grained preference representations, respectively, the user preference at the sentence level and the user preference at the word level , the formula is as follows: (7); (8); wherein, represent a bidirectional encoder representation model; S2.2, obtaining the interaction preference representation of the user from the historical interaction sequence inputting a sequence recommendation model based on a self-attention mechanism obtaining the interaction preference representation of the user from the historical interaction sequence : (9); S2.3, fuse the two dialogue content embeddings by a gating mechanism to obtain partial user preferences in the current dialogue content : (10); (11); wherein, represents a trade-off parameter, represents a weight parameter, represents a sigmoid function; S2.4, combining the user preference embedding with the user profile embedding with the complete user preference embedding : (12); Step S2 further comprises the following steps: S2.5, encode the obtained negative topic feedback information of the user to obtain user feedback embedding : (13); wherein is the th rejected topic; S2.6, separate the user's negative feedback information from the current positive feedback information using a similarity calculation formula, and obtain feedback loss : (14); wherein, is a cosine similarity function, is a batch size, is a loss hyperparameter; S2.7, the probability of recommending an item from the item set to user U is calculated according to the user preference learned from formula (12) : (15); wherein, is a project learning embedding, is an activation function; S2.8, to learn all the parameters of the item recommendation module, the cross-entropy loss is set to: (16)。 2.The method of claim 1, wherein, Step S1 specifically comprises the following steps: S1.1, extract the topic-related triples from ConceptNet, in order to encode the topic-oriented lexical knowledge graph KG, a graph convolutional neural network GCN is used to capture the semantic relationship between topics, and in each update, GCN receives information from one-hop neighborhood in the graph and performs the following aggregation operation: (1); wherein, is a representation of a node, represents the number of nodes, represents the dimension of the node representation, is the i-th layer's learnable matrix, is the adjacency matrix of the graph, D is the diagonal degree matrix, denotes an activation function; S1.2, the topic vocabulary information in each round of conversation is concatenated into a topic vocabulary sequence and the current dialogue text respectively, and the current dialogue text sequence is obtained, as shown in the following formula: and are input into a bidirectional encoder representation model respectively, to obtain the representation of each round of conversation and , as shown in the following formula: (2); (3); wherein, , is the number of topic vocabulary information in the input , is the feature embedding dimension, is the feature matrix, is the embedding obtained from the dialogue text via , is the embedding obtained from the topic vocabulary via . 3.The method of claim 2, wherein, Step S1 further comprises the following steps: S1.3, introduce cross attention over the knowledge-infused topic information representation : (4); wherein, denotes a defined multi-head self-attention function, denotes a topic vocabulary knowledge-enhanced embedding representation; S1.4, In order to learn the final user topic preference information, , and To merge, use connect , and And through multilayer perceptron and The function yields the predicted probability of the final topic. : (5); wherein, representing topic feature representations, representing a multi-layer perceptron model; S1.5, to learn the parameters, the cross-entropy loss is set to: (6); where, is the conversation, is the topic, is the number of conversations, is the number of topics per conversation, is the label of whether the prediction is successful, taking values 0 or 1, is the predicted topic probability, is the regularization term, is the natural logarithm with base e. 4.The method of claim 1, wherein, Step S3 comprises the following steps: S3.1, an encoder is introduced to encode the current dialogue, and then the learned user preference representation is fed back to the decoder as a cross-attention signal, and the text representation after the self-attention layer and the cross-attention layer is as follows: (17); (18); wherein, is an embedding matrix from the (n - 1)th layer decoder, is an embedding representation after the self-attention layer, is a user preference embedding is an embedding representation after the cross-attention layer enhancement; S3.2, a two-layer cross-attention mechanism is designed to introduce knowledge-enhanced topic information and historical sentences to obtain an embedding matrix that integrates multiple types of information : (19); (20); (21); wherein, is a variant of the history statement before the current predicted statement combined with the recommended item or topic, is a feedforward neural network; S3.3, generating a sentence containing a topic item or a movie item, given a predicted sequence next word vocabulary prediction probability is computed as: (22); wherein, is the decoder output as input, generates the maximum generation probability of the next word on the vocabulary, denotes the copying probability implemented following the standard copying mechanism on the current preference and the knowledge graph KG, is the user preference perception, is the used knowledge graph DBpedia; S3.4, the cross-entropy loss is used to learn the parameters of the dialogue module, and the cross-entropy loss is as follows: (23); wherein, is the sentence in each dialogue.
Citation Information
Patent Citations
Knowledge enhancement dialogue recommendation method based on multi-level attention mechanism
CN114065047A
Conversational recommendation method and system based on user preferences
CN114840763A