Conversation recommendation method and system based on subjective conversation scene
By combining the semantic coding and embedding processing of historical dialogue data, external comment data and knowledge graph, and combining the analysis and inference of inference decision trees, the accuracy and personalization of dialogue recommendation systems in the existing technology in subjective dialogue scenarios is solved. The problem has achieved more accurate and personalized recommendation results.
Patent Information
- Application Number
- CN202411284613.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-13
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2044-09-13
AI Technical Summary
When facing subjective dialogue scenarios, existing dialogue recommendation systems are difficult to fully capture and understand the complex information expressed by users, resulting in insufficient accuracy and personalization of recommendation results.
By collecting historical dialogue data, external comment data and external knowledge graphs, semantic coding and embedding processing are performed, and systematic analysis and inference of user preference information are carried out in combination with the inference decision tree to generate more accurate recommendation results.
It significantly improves the ability to understand potential preference intentions in user expression, improves the accuracy and personalization of recommendation results, and can better adapt to dynamic changes in conversations.
Smart Images

Figure CN119474291A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of artificial intelligence and natural language processing, and more specifically, to a conversation recommendation method and system based on subjective conversation scenarios. Background Art
[0002] With the rapid development of artificial intelligence and natural language processing technologies, the application of intelligent systems is becoming more and more extensive. Among them, the dialogue recommendation system, as an important field, has gradually attracted widespread attention. In the field of movies, the core function of the dialogue recommendation system is to accurately capture and deeply understand the needs, interests and preferences of users through multiple rounds of interaction with users, so as to generate personalized movie recommendation content. Unlike traditional recommendation systems, dialogue recommendation systems not only rely on users' historical behavior data, but also can dynamically analyze and infer users' implicit needs and feedback in real-time conversations. Even when the user's expression is vague, the system can clarify the user's intention through step-by-step guidance and ultimately provide the most appropriate movie recommendation.
[0003] At present, the research on conversational recommendation mainly focuses on processing queries with explicit labels, which usually contain clearly defined entities or attributes, which are convenient for the system to quickly identify and match. However, in the subjective conversation scenarios of actual applications, users' expressions are accompanied by personal emotions and preferences, resulting in the problem of not clearly indicating specific entities or attributes. At the same time, due to users' unfamiliarity with certain fields, it is difficult to accurately describe their needs in words, or they only have vague concepts, resulting in unclear expressions. Therefore, conversational recommendation systems that rely on direct matching of entities or attributes to infer user preferences have obvious limitations when facing subjective conversation scenarios. Due to the ambiguity and implicitness of user expressions, these systems find it difficult to fully capture and understand the complex information contained in the conversation, resulting in insufficient accuracy and personalization of recommendation results. This deficiency obviously makes it difficult to meet users' needs for personalized and intelligent recommendations in actual interactions. Summary of the invention
[0004] In order to overcome the defect of low accuracy of dialogue recommendation results described in the above-mentioned prior art, the present invention provides a dialogue recommendation method and system based on subjective dialogue scenarios.
[0005] In order to solve the above technical problems, the technical solution of the present invention is as follows:
[0006] A conversation recommendation method based on subjective conversation scenarios comprises the following steps:
[0007] Collect historical conversation datasets, external comment datasets, and external knowledge graphs, perform semantic relationship expansion on the external knowledge graphs, and obtain an expanded word set;
[0008] The historical conversation dataset, the external comment dataset, the external knowledge graph, and the extended word set are respectively semantically encoded and then embedded to obtain corresponding embedding representations;
[0009] All embedded representations are fused and input into the inference decision tree to obtain the predicted entity;
[0010] Adding the predicted entity to the inference decision tree, extracting the inference branches and historical sentences involving the predicted entity, and performing semantic coding and embedding processing to obtain the inference embedding matrix and the historical sentence embedding matrix;
[0011] All embedding representations as well as the reasoning embedding matrix and the historical sentence embedding matrix are input into the decoder to obtain the recommended response result.
[0012] Furthermore, the present invention also proposes a conversation recommendation system based on subjective conversation scenarios, which applies the conversation recommendation method based on subjective conversation scenarios described in the present invention. The system includes:
[0013] Data collection module, used to collect historical conversation datasets, external comment datasets, and external knowledge graphs;
[0014] The data enhancement module is used to expand the semantic relationship of the collected external knowledge graph to obtain an extended word set;
[0015] An encoding module, used to perform semantic encoding and embedding processing on the historical conversation dataset, external comment dataset, external knowledge graph and extended word set to obtain corresponding embedding representations;
[0016] An inference decision module is used to fuse all embedded representations and input them into an inference decision tree to obtain a predicted entity; and to add the predicted entity to the inference decision tree, extract the inference branches and historical sentences related to the predicted entity, and then perform semantic coding and embedding processing to obtain an inference embedding matrix and a historical sentence embedding matrix;
[0017] The decoding module is used to input all the embedding representations as well as the reasoning embedding matrix and the historical sentence embedding matrix into a decoder to obtain a recommended reply result.
[0018] Furthermore, the present invention also proposes a device, including a memory and a processor, wherein the memory stores computer-readable instructions, wherein when the computer-readable instructions are executed by the processor, the processor executes all or part of the steps of the conversation recommendation method based on subjective conversation scenarios as described in the present invention.
[0019] Furthermore, the present invention also proposes a storage medium on which computer-readable instructions are stored, wherein the computer-readable instructions, when executed by a processor, implement all or part of the steps of the conversation recommendation method based on subjective conversation scenarios as described in the present invention.
[0020] Compared with the prior art, the technical solution of the present invention has the following beneficial effects:
[0021] The present invention integrates historical conversation datasets, external comment datasets, and external knowledge graphs, as well as semantic relationship expansion word sets based on external knowledge graphs, and combines rich subjective and objective background knowledge to transform the user's vague or implicit expressions in the conversation into clear preference information, greatly improving the ability to understand the potential preference intentions in the user's expression, and further improving the accuracy and personalization of the recommendation results;
[0022] The present invention also adopts an inference decision tree to systematically analyze the user's preference information, uses an inference strategy tree to flexibly adapt to the dynamic changes of the conversation, and effectively infers the preference strategy, thereby achieving more accurate recommendations. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 The flowchart of the conversation recommendation method based on subjective conversation scenarios according to one embodiment of the present invention is shown.
[0024] Figure 2 The diagram is a diagram of an inference decision tree according to an embodiment of the present invention.
[0025] Figure 3 The figure is an architecture diagram of a conversation recommendation system based on subjective conversation scenarios according to one embodiment of the present invention. DETAILED DESCRIPTION
[0026] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are merely examples of devices and methods consistent with some aspects of the present invention as detailed in the appended claims.
[0027] The terms used in the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The singular forms "a", "the" and "the" used in the present invention and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0028] It should be understood that although the terms first, second, third, etc. may be used in the present invention to describe various information, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present invention, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0029] The present invention is described in detail below with reference to the accompanying drawings and specific embodiments.
[0030] Example 1
[0031] This embodiment proposes a conversation recommendation method based on subjective conversation scenarios, such as Figure 1 As shown, it is a flowchart of the conversation recommendation method of this embodiment.
[0032] The conversation recommendation method based on subjective conversation scenarios proposed in this embodiment includes the following steps:
[0033] S1. Collect historical conversation datasets, external comment datasets, and external knowledge graphs, and perform semantic relationship expansion on the external knowledge graphs to obtain an expanded word set;
[0034] S2, semantically encode the historical conversation dataset, external comment dataset, external knowledge graph and extended word set respectively, and then perform embedding processing to obtain corresponding embedding representations;
[0035] S3, fuse all embedded representations and input them into the inference decision tree to obtain the predicted entity;
[0036] S4, adding the predicted entity to the inference decision tree, extracting the inference branches and historical sentences involving the predicted entity, and performing semantic coding and embedding processing to obtain the inference embedding matrix and the historical sentence embedding matrix;
[0037] S5. Input all embedding representations, the reasoning embedding matrix, and the historical sentence embedding matrix into the decoder to obtain the recommended reply result.
[0038] In this embodiment, by integrating historical conversation datasets, external comment datasets, and external knowledge graphs, as well as semantic relationship expansion word sets based on external knowledge graphs, and combining rich subjective and objective background knowledge, the user's vague or implicit expressions in the conversation are converted into clear preference information, which greatly improves the ability to understand the potential preference intentions in the user's expressions, and further improves the accuracy and personalization of the recommendation results.
[0039] This embodiment also uses an inference decision tree to systematically analyze the user's preference information, and uses an inference strategy tree to flexibly adapt to the dynamic changes of the conversation and effectively infer the preference strategy, thereby achieving more accurate recommendations.
[0040] Exemplarily, the dialogue recommendation method proposed in this embodiment is applicable to a dialogue recommendation system in the field of movies.
[0041] It should be noted that traditional movie recommendation systems usually rely on explicit tags or keywords to guide user choices. This tag and keyword-based recommendation method is relatively effective when dealing with clear needs. For example, when a user explicitly enters "action movie" or "science fiction movie", the system can quickly match related movies and provide recommendations. However, this method has significant limitations when dealing with users' subjective expressions. When users express their viewing needs, they often use emotional or subjective language rather than clear tags or keywords. For example, when a user enters "I feel very stressed recently, can you recommend a movie?", mainstream dialogue recommendation systems usually query a set of predefined attribute tags based on the keyword "stress". However, this keyword-based processing method often fails to accurately capture the user's real needs. In fact, what users may really expect is a movie that can relax them and relieve stress. This movie may be more in line with emotional attributes such as "humor" or "relaxation".
[0042] This embodiment constructs an inference strategy tree around the hierarchical structure of the dialogue node for predictive recommendation. Among them, the recommendation type node in the inference strategy tree organizes the recommended content according to the specific needs of the user, ensuring that the direction of the recommendation is consistent with the user's initial intention. Subsequently, the sub-type node further refines the recommended content and divides it into more targeted categories, such as "comedy" or "warm plot". This level of subdivision allows the system to more accurately capture the user's preference for a certain type.
[0043] On this basis, the emotional trait node deeply explores the emotional characteristics of each sub-type of movies, such as "humorous" or "touching", so that the system not only pays attention to the type of movie, but also considers the emotional experience conveyed by the movie. In addition, the user feedback node captures the user's instant feedback in each round of dialogue and integrates this feedback into the recommendation strategy for dynamic adjustment. For example, the system can learn from feedback that "users prefer humorous elements" and strengthen the weight of such elements in subsequent recommendations.
[0044] The dynamic and hierarchical structure of the inference decision tree in this embodiment enables the system to respond to the user's changing preferences and emotional state in real time, ensuring that the recommended content is always highly consistent with the user's current needs. In the analysis process at each level, the inference strategy tree not only considers the user's explicit needs, but also refines the recommendation strategy through iterative adjustments to emotional characteristics and user feedback. This refined processing significantly improves the accuracy of the recommendation results and achieves better results in user satisfaction.
[0045] In an optional embodiment, in step S1, during the process of semantic relationship expansion of the external knowledge graph, ConceptNet is used to obtain and expand synonyms, antonyms and other semantic relationships of words from the external knowledge graph to construct a more extensive and sophisticated extended word set.
[0046] In an optional embodiment, in step S2, the historical conversation dataset is semantically encoded and then embedded, including the following steps:
[0047] For the historical conversation data set H = {D1, D2, ..., D N Each round of dialogue D i , generate corresponding common sense knowledge C through the COMET model i =COMET(D i ), where N is the number of conversation rounds in the historical conversation dataset;
[0048] Each round of dialogue D i and corresponding common sense knowledge C i After integration, we get the enhanced dialogue representation set E = {E1, E2, ..., E N}, where E i =f(D i ,C i );
[0049] The dialogue representation set E is input into the multi-layer Transformer architecture and the multi-head attention mechanism is applied for embedding processing to obtain the information-enhanced context embedding representation χ c ; Its expression is:
[0050] n l (E) = MHA (n l-1 (E),n l-1 (E),n l-1 (E)
[0051] χ c =n L (E) = MHA (n L-1 (E),n L-1 (E),n L-1(E)
[0052] Among them, MHA(·) represents the multi-head attention mechanism; n l (E) represents the output embedding representation of the lth layer Transformer, where L is the total number of layers in the multi-layer Transformer architecture.
[0053] In this embodiment, the common sense knowledge generated by the COMET (Commonsense Transformers) model can provide additional background information, thereby better understanding the user's potential intentions.
[0054] On this basis, by integrating the conversation content with the generated common sense knowledge, an enhanced conversation representation set E is constructed to form a richer and more accurate conversation representation.
[0055] Furthermore, a multi-head attention mechanism is applied in the multi-layer Transformer architecture for embedding processing, which enables the Transformer architecture to focus on different aspects and details of the input content, thereby capturing deeper semantic information.
[0056] In an optional embodiment, in step S2, the external review dataset is semantically encoded and then embedded, including the following steps:
[0057] The external review dataset is divided into sentences to obtain a review set R = {S1, S2, ..., S t}; where t is the number of divided external comment sentences;
[0058] Through the Sentence-BERT model, each sentence S j Perform semantic encoding and generate the corresponding embedding vector V j =S-BERT(S j ), wherein j=1,2,...,t, S-BERT(·) represents the Sentence-BERT model; each of the embedding vectors represents the semantic features of each sentence;
[0059] Use the Approximate Nearest Neighbor (ANN) method to find the N sentences most similar to the dialogue representation E from the comment set R. Its expression is:
[0060]
[0061] The sentence The multi-head attention mechanism is applied to the multi-layer Transformer architecture for embedding processing to obtain the comment feature embedding χr ; Its expression is:
[0062]
[0063] in, Represents the output embedding representation of the L-th layer Transformer.
[0064] This embodiment uses an external review dataset as a reliable supplementary knowledge source that reflects real user experience and emotions, so as to further enrich the system's understanding of subjective information.
[0065] Optionally, the external review dataset is obtained from the IMDb platform.
[0066] In an optional embodiment, the external knowledge graph is semantically encoded and then embedded, including the following steps:
[0067] According to the given context and relationship information, relevant entities are extracted from the external knowledge graph, and semantically encoded through a relational graph convolutional network (R-GCN) to obtain an entity embedding representation;
[0068] The entity embedding representation of the final layer output of the relational graph convolutional network is K As the entity feature embedding χ e ; Its expression is:
[0069]
[0070] Among them, RGCN(·) represents the semantic encoding operation of the relational graph convolutional network; represents the entity feature set extracted from the external knowledge graph, and A is the total number of entities extracted; Represents the a-th entity e output by the K-th layer graph convolutional network a The entity embedding representation of , K is the total number of layers of the relational graph convolutional network.
[0071] In this embodiment, objective information is enhanced by combining with external knowledge graphs.
[0072] Exemplarily, the external knowledge graph adopts the DBpedia knowledge base to enrich and expand the relevant information of the entity dimension.
[0073] In this embodiment, the entity embedding representation of the final layer output in the relational graph convolutional network , contains all the context and relationship information processed by the previous layers, so the entity embedding representation output by the final layer is selected as the entity feature embedding χ of the entitye .
[0074] In an optional embodiment, the extended word set is semantically encoded and then embedded, comprising the following steps:
[0075] The words in the extended word set are semantically encoded through a graph convolutional network (GCN) to obtain a word embedding representation; its expression is:
[0076]
[0077] Among them, w d Represents the word embedding representation of word w in the d-th layer graph convolutional network; is a normalized adjacency matrix used to capture the semantic relationship between words; M d Represents the weight matrix in the d-th layer graph convolutional network learned through the training process;
[0078] The word embedding representation w is output by the final layer of the graph convolutional network D Embedded as word feature w ; Its expression is:
[0079]
[0080] Among them, GCN(·) represents the semantic encoding operation of graph convolutional network; represents the word embedding representation set of M words from the expanded word set, Represents the mth word w m The word embedding representation output by the D-th layer graph convolutional network contains all context and relationship information.
[0081] In an optional embodiment, in step S3, all embedded representations are fused using a method of maximizing mutual information; the expression is:
[0082]
[0083] Where I(·) represents mutual information; An embedding representation of background information, which contains the conversation context or background features; The embedding representation of the core information contains the main features of the dialogue input; maxE p (·) means optimizing the estimate of mutual information by maximizing the expected value of the input;
[0084] χ c ,x r ,x e ,x wRespectively represent context feature embedding, comment feature embedding, entity feature embedding and word feature embedding obtained after semantic encoding and embedding processing of the historical conversation dataset, external comment dataset, external knowledge graph and extended word set; represents the multi-dimensional fusion embedding obtained by concatenating the core information and background information embeddings; ⊕ represents the vector concatenation operation; P multi It means that the concatenated embedding is layer-normalized and further processed by the Tanh activation function to obtain the final multi-dimensional fusion result.
[0085] In this embodiment, by maximizing the mutual information I between embeddings of different dimensions, it is ensured that the information of each dimension can maintain its original semantic characteristics during the fusion process, while enhancing the model's comprehensive understanding of user input, providing a more robust and accurate recommendation basis when dealing with complex dialogue scenarios.
[0086] Further, in an optional embodiment, in step S3, the inference decision tree uses an adaptive path optimization algorithm to make a decision prediction entity; wherein:
[0087] After a round of dialogue is completed, the fused embedding representation P multi , dynamically calibrate the attention weight λ of each path, re-evaluate the effectiveness of each path, and recalculate the comprehensive representation Its expression is:
[0088]
[0089]
[0090]
[0091] Among them, p represents the final representation of each reasoning branch in the inference decision tree, Attn(·) represents the attention mechanism; M s 、M r 、M c is the training parameter; P is the branch embedding matrix, which is used to r 、M c Interactions, which capture and characterize the relationships between branches of reasoning;
[0092] According to the recalculated comprehensive representation A weighting mechanism is applied to filter and output the generated prediction entities.
[0093] It should be noted that in the inference decision tree of this embodiment, a pseudo node is initialized as the root node. The pseudo node does not correspond to any specific entity in the conversation, but exists as a structural placeholder. For example, Figure 2, which is a diagram of the architecture of the inference decision tree of this embodiment.
[0094] In this embodiment, the structure of the inference strategy tree and the related recommendation paths are dynamically updated through an adaptive mechanism to gradually optimize the recommendations based on the user's feedback during the conversation. For example, when a user expresses a preference or aversion to certain elements, the model can adjust the weights of the related paths accordingly.
[0095] Specifically, as the conversation progresses, the structure of the inference strategy tree will adapt accordingly. After each round of conversation, the system will re-evaluate the validity of each path and recalculate the comprehensive representation. and their corresponding attention weights. Through this re-evaluation process, the system is able to identify and prioritize the paths that are most likely to meet the user's needs, ensuring that these paths are highlighted during reasoning.
[0096] Furthermore, according to the recalculated comprehensive representation Applying a weighted mechanism to screen the generated predicted entities can give priority to those recommended entities that are highly consistent with the user's current preferences and emotional traits and use them as the final recommendation results.
[0097] Further optionally, this embodiment may also monitor the user's response to these recommended entities and feed it back to the inference strategy tree, so as to further optimize the recommendation strategy in subsequent conversations.
[0098] In an optional embodiment, in step S4, the predicted entity is added to the inference decision tree, and after the inference branches and historical sentences involving the predicted entity are extracted, semantic encoding and embedding processing are performed through the relational graph convolutional network and Transformer architecture respectively to obtain the inference embedding matrix T and the historical sentence embedding matrix H, and use them as important inputs of the decoder network.
[0099] In an optional embodiment, in step S5, inputting all embedding representations and the reasoning embedding matrix and the historical sentence embedding matrix into a decoder to obtain a recommended reply result includes the following steps:
[0100] All embedding representations, the reasoning embedding matrix T and the historical sentence embedding matrix H are input into the decoder, and the output of each layer of the decoder is connected to the fully connected feedforward network to generate a response Y that conforms to the context semantics and output it as the recommended reply result; its expression is:
[0101] Θ q =Decoder(Θ q-1 ,x e ,x w ,x c χ r ,T,H)
[0102] Y = FFN(ReLU([Θ Q ; χ]M1+b1)M2+b2)
[0103] Among them, Θ Q represents the response of the decoder output at the final layer, Q is the total number of decoder layers; Decoder(·) represents the decoder network; χ c ,x r ,x e ,x w Respectively represent the context feature embedding, comment feature embedding, entity feature embedding and word feature embedding obtained after semantic encoding and embedding processing of the historical conversation dataset, external comment dataset, external knowledge graph and extended word set; FFN(·) represents a fully connected feedforward network; χ is a feature embedding set; M1 and M2 are trainable weight matrices, and b1 and b2 are corresponding bias terms.
[0104] In this embodiment, in order to effectively complete the dialogue task and generate responses that are highly relevant to the expected questions and entities, this embodiment inputs a set of feature embeddings into the decoder network, including entity feature embeddings χ e , word feature embedding χ w , contextual feature embedding χ c , and the review feature embedding χ r During decoding, the decoder uses these embedded representations and the embedding matrices T and H in the inference strategy tree to generate more accurate responses. The output of the decoder network is then processed by a fully connected feedforward network (FFN) to obtain contextually consistent and semantically accurate responses.
[0105] Furthermore, in an optional embodiment, the generation process of the response Y is optimized using cross entropy loss.
[0106] Among them, the dialogue loss function L c The expression is:
[0107]
[0108] Q(y i |{y 1:i-1})=Q w (y i |Y)+Q k (y i |Y,K)+Q c (y i |Y,C)
[0109] Where N is the number of dialogue rounds, y i represents the i-th sentence in the conversation; Q(yi |{y 1:i-1}) indicates generating the next word y i The probability of {y 1:i-1} represents the currently generated word subsequence; Q w (·), Q k (·) and Q c (·) represent the probability functions corresponding to word features, entity features and context features respectively; K represents the enhanced entity set, and C represents the enhanced context information.
[0110] In this embodiment, the user's vague or implicit expressions in the conversation are converted into clear preference information through information enhancement technology, and the problem of difficulty in handling user implicit or vague expressions in the conversation recommendation method is solved by introducing a multi-level strategy framework and an inference strategy tree, which significantly improves the accuracy of the recommendation results and user satisfaction, and overcomes the limitations of the existing technology in handling complex conversation scenarios.
[0111] Example 2
[0112] This embodiment applies the conversation recommendation method based on subjective conversation scenarios proposed in Embodiment 1, and evaluates the performance of the present invention through a series of comprehensive experiments.
[0113] This example conducts comparative analysis on two real datasets and benchmarks it against six state-of-the-art methods. Through these comparative experiments, we deeply explore its superiority and effectiveness in handling complex dialogue scenarios, and further verify its performance and potential in practical applications.
[0114] Specifically, the datasets are derived from the widely used real-world datasets ReDial and TG-ReDial. The ReDial dataset was collected through Amazon Mechanical Turk and focuses on movie recommendation dialogues. It contains 10,006 dialogues, each involving more than four different movies, totaling 64,362 unique movie entities. The TG-ReDial dataset is semi-automatically annotated and contains 10,000 dialogues involving 33,834 movies, each organized around a topic path.
[0115] In order to adapt these datasets to subjective recommendation scenarios, this embodiment uses the GPT-4 generative model to enhance 70% of the existing dialogues, generating dialogues containing subjective expression versions while keeping the movie entities unchanged. In addition, emotional features are introduced through the RoBERTa model to increase the subjectivity of the dialogues. Subsequently, the revised dialogues were manually evaluated to ensure their quality and consistency. The processed datasets are named ReDial-S and TG-ReDial-S.
[0116] This embodiment evaluates the recommendation task and the dialogue task separately. In the evaluation of the recommendation task, different levels of recall (Recall at N, R@N, where N = 1, 10, 50) are used as performance measurement indicators to evaluate whether the recommendation results contain the true answer. In the evaluation of the dialogue task, both automated evaluation and manual evaluation methods are combined. Automated evaluation indicators include Dist n-gram (n = 2, 3) and perplexity (PPL), which are used to measure the fluency and diversity of the language.
[0117] In addition, this embodiment also invited three annotators to manually evaluate the response quality from three aspects: coherence, relevance, and information content, to ensure a comprehensive and detailed analysis of the performance in the recommendation task and dialogue task, providing strong support for further verifying the effectiveness and practicality of the present invention.
[0118] In the configuration of the baseline model, this embodiment strictly follows the original parameters specified in their respective literature. When configuring the model, this embodiment sets the embedding dimension of the recommendation task to 300 and the embedding dimension of the dialogue task to 128. The embedding layer depth for both GCN and R-GCN is set to 1. The word length of the selected comment sentences is set to 20 and initialized using Word2Vec with a normalization factor of 1. Other parameters remain at the default settings and are fine-tuned as needed during the experiment. During training, the batch size is set to 64 and the learning rate is set to 0.01. The experimental results are shown in Table 1 below.
[0119] Table 1 Performance measurement results
[0120]
[0121] As shown in the table above, this example uses Recall@N (N=1,,10,50) as the evaluation metric in the recommendation task. The results show that this example comprehensively surpasses all baseline models on the evaluated datasets, highlighting its excellent effect in the conversational recommendation system in subjective scenarios.
[0122] The results also show that incorporating more comprehensive external knowledge significantly improves the performance of the model. For example, the KGSF and CRFR models show better results in understanding subjective input due to rich background knowledge by integrating additional knowledge graphs. This further emphasizes the importance of effectively utilizing external knowledge to cope with the complexity of subjective dialogue scenarios.
[0123] In addition, models that use tree structures for entity reasoning (such as CR-Walker and TREA) also outperform other methods, and the present invention achieves the highest performance with its nonlinear structure and multi-type node reasoning mechanism. This performance further verifies the leading position and innovative advantages of the present invention in subjective recommendation tasks, and fully demonstrates the application potential of the present invention in complex dialogue scenarios.
[0124] The automated evaluation results shown in the table show that the present invention outperforms other baseline methods in terms of Dist-2, Dist-3, and PPL indicators. At the same time, the manual evaluation results in the table also show that the present invention surpasses all baseline models in terms of coherence, relevance, and information content. These results show that the present invention has higher relevance when generating dialogue content. By effectively integrating external knowledge, the present invention enriches the background information, thereby gaining a deeper understanding of the user's subjective intentions and ensuring a high degree of consistency with the generation module. This integration makes the generated responses more accurate and fluent, further improving the overall performance of the dialogue system. .
[0125] Example 3
[0126] This embodiment proposes a conversation recommendation system based on subjective conversation scenarios, which applies the conversation recommendation method based on subjective conversation scenarios proposed in Embodiment 1. Figure 3 , which is an architecture diagram of the conversation recommendation system based on subjective conversation scenarios of this embodiment.
[0127] The conversation recommendation system based on subjective conversation scenarios proposed in this embodiment includes:
[0128] Data collection module, used to collect historical conversation datasets, external comment datasets, and external knowledge graphs;
[0129] The data enhancement module is used to expand the semantic relationship of the collected external knowledge graph to obtain an extended word set;
[0130] An encoding module, used to perform semantic encoding and embedding processing on the historical conversation dataset, external comment dataset, external knowledge graph and extended word set to obtain corresponding embedding representations;
[0131] An inference decision module is used to fuse all embedded representations and input them into an inference decision tree to obtain a predicted entity; and to add the predicted entity to the inference decision tree, extract the inference branches and historical sentences related to the predicted entity, and then perform semantic coding and embedding processing to obtain an inference embedding matrix and a historical sentence embedding matrix;
[0132] The decoding module is used to input all the embedding representations as well as the reasoning embedding matrix and the historical sentence embedding matrix into a decoder to obtain a recommended reply result.
[0133] It can be understood that the system of this embodiment corresponds to the method of the above-mentioned embodiment 1, and the options in the above-mentioned embodiment 1 are also applicable to this embodiment, so they will not be described repeatedly here.
[0134] Example 4
[0135] This embodiment proposes a computer device, including a memory and a processor, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the processor executes all or part of the steps of the conversation recommendation method based on subjective conversation scenarios proposed in Example 1.
[0136] Example 5
[0137] This embodiment proposes a storage medium on which computer-readable instructions are stored, wherein the computer-readable instructions, when executed by a processor, implement all or part of the steps of the conversation recommendation method based on subjective conversation scenarios proposed in Embodiment 1.
[0138] Exemplarily, the storage medium includes, but is not limited to, a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.
[0139] Exemplarily, the instructions, programs, code sets or instruction sets may be implemented using conventional programming languages.
[0140] Exemplarily, the processor includes but is not limited to a smart phone, a personal computer, a server, a network device, etc., and is used to execute all or part of the steps of the conversation recommendation method based on subjective conversation scenarios described in Example 1.
[0141] Each embodiment of the present invention is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. The device embodiment described above is merely exemplary, in which the modules described as separate components may or may not be physically separated, and the functions of each module can be implemented in the same or one or more software and / or hardware when implementing the scheme of the present invention. It is also possible to select some or all of the modules according to actual needs to achieve the purpose of the scheme of this embodiment.
[0142] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the present invention, and are not intended to limit the embodiments of the present invention. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the embodiments here. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the claims of the present invention.
Claims
1. A conversation recommendation method based on subjective conversation scenarios, characterized in that: The following steps are involved: Collect historical conversation datasets, external comment datasets, and external knowledge graphs, perform semantic relationship expansion on the external knowledge graphs, and obtain an expanded word set; The historical conversation dataset, the external comment dataset, the external knowledge graph, and the extended word set are respectively semantically encoded and then embedded to obtain corresponding embedding representations; All embedded representations are fused and input into the inference decision tree to obtain the predicted entity; Adding the predicted entity to the inference decision tree, extracting the inference branches and historical sentences involving the predicted entity, and performing semantic coding and embedding processing to obtain the inference embedding matrix and the historical sentence embedding matrix; All embedding representations as well as the reasoning embedding matrix and the historical sentence embedding matrix are input into the decoder to obtain the recommended response result.
2. The method for recommending a conversation according to claim 1, characterized in that: The historical conversation dataset is semantically encoded and then embedded, including the following steps: For the historical conversation dataset H = {D1, D2, ..., D N Each round of dialogue D i , generate corresponding common sense knowledge C through the COMET model i =COMET(D i ), where N is the number of conversation rounds in the historical conversation dataset; Each round of dialogue D i and corresponding common sense knowledge C i After integration, we get the enhanced dialogue representation set E = {E1, E2, ..., E N }, where E i =f(D i ,C i ); The dialogue representation set E is input into the multi-layer Transformer architecture and the multi-head attention mechanism is applied for embedding processing to obtain the information-enhanced context embedding representation χ c ; Its expression is: n l (E)=MHA(n l-1 (Is l-1 (Is l-1 (IS)) χ c =n L (E)=MHA(n L-1 (Is L-1 (Is L-1 (IS)) Among them, MHA(·) represents the multi-head attention mechanism; n l (E) represents the output embedding representation of the lth layer Transformer, where L is the total number of layers in the multi-layer Transformer architecture.
3. The method for recommending a conversation according to claim 2, wherein: The external review dataset is semantically encoded and then embedded, including the following steps: The external review dataset is divided into sentences to obtain a review set R = {S1, S2, ..., S t }; where t is the number of divided external comment sentences; Through the Sentence-BERT model, each sentence S j Perform semantic encoding and generate the corresponding embedding vector V j =S-BERT(S j ), where j = 1, 2, ..., t; S-BERT(·) represents the Sentence-BERT model; Use the approximate nearest neighbor retrieval method to find the N sentences most similar to the dialogue representation E from the comment set R The sentence The multi-head attention mechanism is applied to the multi-layer Transformer architecture for embedding processing to obtain the comment feature embedding χ r ; Its expression is: in, Represents the output embedding representation of the L-th layer Transformer.
4. The method for recommending a conversation according to claim 1, wherein: The external knowledge graph is semantically encoded and then embedded, including the following steps: According to the given context and relationship information, relevant entities are extracted from the external knowledge graph, and semantically encoded through a relational graph convolutional network to obtain an entity embedding representation; The entity embedding representation of the final layer output of the relational graph convolutional network is K As the entity feature embedding χ e ; Its expression is: Among them, RGCN(·) represents the semantic encoding operation of the relational graph convolutional network; represents the entity feature set extracted from the external knowledge graph, and A is the total number of entities extracted; Represents the a-th entity e output by the K-th layer graph convolutional network a The entity embedding representation of , K is the total number of layers of the relational graph convolutional network.
5. The method for recommending a conversation according to claim 1, characterized in that: The extended word set is semantically encoded and then embedded, comprising the following steps: The words in the extended word set are semantically encoded through a graph convolutional network to obtain a word embedding representation; its expression is: Among them, w d Represents the word embedding representation of word w in the d-th layer graph convolutional network; is a normalized adjacency matrix used to capture the semantic relationship between words; M d Represents the weight matrix in the d-th layer graph convolutional network learned through the training process; The word embedding representation w is output by the final layer of the graph convolutional network D Embedded as word feature w ; Its expression is: Among them, GCN(·) represents the semantic encoding operation of graph convolutional network; represents the word embedding representation set of M words from the expanded word set, Represents the mth word w m Word embedding representation at the output of the D-th layer graph convolutional network.
6. The method for recommending conversations according to any one of claims 1 to 5, characterized in that: The method further comprises the following steps: All embedded representations are fused using the method of maximizing mutual information; its expression is: Where I(·) represents mutual information; An embedding representation of background information, which contains the conversation context or background features; The embedding representation of the core information contains the main features of the dialogue input; max E p (·) represents optimizing the mutual information estimation by maximizing the expected value of the input; χ c ,x r ,x e ,x w Respectively represent context feature embedding, comment feature embedding, entity feature embedding and word feature embedding obtained after semantic encoding and embedding processing of the historical conversation dataset, external comment dataset, external knowledge graph and extended word set; It represents the multi-dimensional fused embedding obtained by concatenating the core information and background information embeddings; Represents vector concatenation operation; P multi It means that the concatenated embedding is layer-normalized and further processed by the Tanh activation function to obtain the final multi-dimensional fusion result.
7. The method for recommending a conversation according to claim 6, wherein: The inference decision tree uses an adaptive path optimization algorithm to make decision prediction entities; wherein: After a round of dialogue is completed, the fused embedding representation P multi , dynamically calibrate the attention weight λ of each path, re-evaluate the effectiveness of each path, and recalculate the comprehensive representation Its expression is: Among them, p represents the final representation of each reasoning branch in the reasoning decision tree, Attn(·) represents the attention mechanism; M s 、M r 、M c is the training parameter; P is the branch embedding matrix, which is used to r 、M c Interaction, captures and characterizes the relationship between reasoning branches; i represents the target branch of attention allocation, and j represents all other branches; According to the recalculated comprehensive representation A weighting mechanism is applied to filter and output the generated prediction entities.
8. The method for recommending conversations according to any one of claims 1 to 5, characterized in that: The step of inputting all embedding representations, the reasoning embedding matrix, and the historical sentence embedding matrix into a decoder to obtain a recommended reply result comprises the following steps: All embedding representations, the reasoning embedding matrix T and the historical sentence embedding matrix H are input into the decoder, and the output of the final layer of the decoder is connected to the fully connected feedforward network to generate a response Y that conforms to the context semantics and output it as the recommended reply result; its expression is: I q =Decoder(Θ q-1 ,x e ,x w ,x c x r (T,H) Y=FFN(ReLU([Θ Q ;χ]M1+b1)M2+b2) Among them, Θ Q represents the response of the decoder output at the final layer, Q is the total number of decoder layers; Decoder(·) represents the decoder network; χ c ,x r ,x e ,x w Respectively represent the context feature embedding, comment feature embedding, entity feature embedding and word feature embedding obtained after semantic encoding and embedding processing of the historical conversation dataset, external comment dataset, external knowledge graph and extended word set; FFN(·) represents a fully connected feedforward network; χ is a feature embedding set; M1 and M2 are trainable weight matrices, and b1 and b2 are corresponding bias terms.
9. The method for recommending a conversation according to claim 8, characterized in that: The method further comprises the following steps: optimizing the generation process of the response Y by using the cross entropy loss; wherein the dialogue loss function L c The expression is: Q(and i |{and 1:i-1 })=Q w (and i |Y)+Q k (and i |Y,K)+Q c (and i |Y,C) Where N is the number of dialogue rounds, y i represents the i-th sentence in the conversation; Q(y i |{y 1:i-1 }) indicates generating the next word y i The probability of {y 1:i-1 } represents the currently generated word subsequence; Q w (·), Q k (·) and Q c (·) represent the probability functions corresponding to word features, entity features and context features respectively; K represents the enhanced entity set, and C represents the enhanced context information.
10. A conversation recommendation system based on subjective conversation scenarios, applying the conversation recommendation method according to any one of claims 1 to 9, characterized in that: include: Data collection module, used to collect historical conversation datasets, external comment datasets, and external knowledge graphs; The data enhancement module is used to expand the semantic relationship of the collected external knowledge graph to obtain an extended word set; An encoding module, used to perform semantic encoding and embedding processing on the historical conversation dataset, external comment dataset, external knowledge graph and extended word set to obtain corresponding embedding representations; An inference decision module is used to fuse all embedded representations and input them into an inference decision tree to obtain a predicted entity; and to add the predicted entity to the inference decision tree, extract the inference branches and historical sentences related to the predicted entity, and then perform semantic coding and embedding processing to obtain an inference embedding matrix and a historical sentence embedding matrix; The decoding module is used to input all the embedding representations as well as the reasoning embedding matrix and the historical sentence embedding matrix into a decoder to obtain a recommended reply result.
Citation Information
Patent Citations
Feedback type dialogue intention obtaining method based on trigger rule
CN113590780A
Dialogue recommendation method and system based on multi-granularity emotion
CN115630145A
Natural language understanding
US11386890B1