A conversation recommendation method and system based on subjective conversation scenarios
By integrating historical data, external comments, and semantic processing of knowledge graphs, and combining inference decision trees to analyze user preferences, the accuracy and personalization issues of dialogue recommendation systems in subjective scenarios are solved, achieving more accurate recommendations.
Patent Information
- Application Number
- CN202411284613.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-13
- Publication Date
- 2025-09-09
- Estimated Expiration
- 2044-09-13
AI Technical Summary
Existing conversational recommendation systems have difficulty accurately understanding users' ambiguous or implicit expressions when faced with subjective conversational scenarios, resulting in insufficient accuracy and personalization of recommendation results.
By collecting historical conversation data, external comment data and external knowledge graphs, performing semantic relationship expansion and encoding embedding processing, and combining inference decision trees to systematically analyze preference information, personalized recommendations are generated.
It significantly improves the ability to understand the potential preference intentions expressed by users, improves the accuracy and personalization of recommendation results, and can respond to dynamic changes of users in real time.
Smart Images

Figure CN119474291B_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 increasingly widespread. Conversational recommendation systems, as a key area, have gradually attracted widespread attention. In the film industry, the core function of conversational recommendation systems is to accurately capture and deeply understand users' needs, interests, and preferences through multiple rounds of interaction with users, thereby generating personalized movie recommendations. Unlike traditional recommendation systems, conversational recommendation systems not only rely on historical user behavior data but also dynamically analyze and infer users' implicit needs and feedback during real-time conversations. Even when users express ambiguous ideas, the system can gradually guide them to clarify their intentions and ultimately provide the most appropriate movie recommendations.
[0003] Current research on conversational recommendation primarily focuses on processing queries with explicit labels. These queries typically contain clearly defined entities or attributes, facilitating rapid identification and matching by the system. However, in subjective conversational scenarios used in real-world applications, users' expressions are tinged with personal emotions and preferences, leading to the problem of not explicitly specifying specific entities or attributes. Furthermore, due to users' unfamiliarity with certain domains, they struggle to accurately describe their needs verbally, or they may 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 significant limitations when dealing with subjective conversational scenarios. Due to the ambiguity and implicitness of user expressions, these systems struggle to fully capture and understand the complex information contained in the conversation, resulting in insufficient accuracy and personalization in recommendation results. This deficiency clearly makes it difficult to meet users' demand for personalized, intelligent recommendations in real-world 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 solutions of the present invention are as follows:
[0006] A conversation recommendation method based on subjective conversation scenarios includes 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, external comment dataset, external knowledge graph, and extended word set are 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 statements related to the predicted entity, and performing semantic encoding and embedding processing to obtain the inference embedding matrix and the historical statement embedding matrix;
[0011] All embedding representations, the reasoning embedding matrix, and the historical sentence embedding matrix are input into the decoder to obtain the recommended response results.
[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 relationships of the collected external knowledge graph to obtain an expanded word set;
[0015] An encoding module is 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 configured 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 statements related to the predicted entity, and perform semantic encoding and embedding processing to obtain an inference embedding matrix and a historical statement embedding matrix.
[0017] The decoding module is used to input all the embedding representations, the reasoning embedding matrix, and the historical sentence embedding matrix into the decoder to obtain the recommended response result.
[0018] Furthermore, the present invention also proposes a device comprising 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 when the computer-readable instructions are executed by a processor, all or part of the steps of the conversation recommendation method based on subjective conversation scenarios as described in the present invention are implemented.
[0020] Compared with the prior art, the beneficial effects of the technical solution of the present invention are:
[0021] This method transforms users' vague or implicit expressions in conversations into explicit preference information by integrating historical conversation datasets, external review datasets, and external knowledge graphs, as well as an expanded word set based on semantic relationships in the external knowledge graph, combined with rich subjective and objective background knowledge. This significantly improves the ability to understand the potential preference intentions expressed by users, further enhancing the accuracy and personalization of 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 FIG. 1 is an architectural 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 illustrated in the accompanying drawings. In the following description, when referring to the drawings, like numbers in different figures represent like or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all possible embodiments consistent with the present invention. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present invention, as detailed in the appended claims.
[0027] The terms used in this invention are for the purpose of describing specific embodiments only and are not intended to limit the invention. The singular forms "a," "the," and "the" used in this invention and the appended claims are also intended to include plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" as used herein refers to and includes any or all possible combinations of one or more of the 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, such information should not be limited to these terms. These terms are merely used to distinguish information of the same type from one another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present invention. Depending on the context, the term "if" as used herein may be interpreted as "when," "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 FIG. 1 is a flowchart of the conversation recommendation method according to the present 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, 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. Add the predicted entity to the inference decision tree, extract the inference branches and historical statements related to the predicted entity, and perform semantic encoding and embedding processing to obtain the inference embedding matrix and the historical statement embedding matrix;
[0037] S5. All embedding representations, the reasoning embedding matrix, and the historical sentence embedding matrix are input into the decoder to obtain the recommended response 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, 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.
[0040] Exemplarily, the dialogue recommendation method proposed in this embodiment is applicable to a dialogue recommendation system in the film field.
[0041] It's important to note that traditional movie recommendation systems typically rely on explicit tags or keywords to guide user choices. This tag- and keyword-based recommendation approach is relatively effective when addressing explicit requirements. For example, when a user explicitly enters "action movie" or "science fiction movie," the system can quickly match relevant movies and provide recommendations. However, this approach has significant limitations when addressing user subjective expressions. When expressing their movie-watching needs, users often use emotional or subjective language rather than explicit tags or keywords. For example, when a user enters "I'm feeling very stressed lately. Can you recommend a movie?", mainstream conversational recommendation systems typically query a set of predefined attribute tags based on the keyword "stress." However, this keyword-based approach often fails to accurately capture the user's true needs. In reality, the user may actually be looking for a movie that will relax and relieve stress, which may be more aligned with emotional attributes such as "humorous" or "lighthearted."
[0042] This example constructs an inference strategy tree based on a hierarchical structure of dialog nodes for predictive recommendations. The recommendation type node in the inference strategy tree organizes recommendations based on the user's specific needs, ensuring that the recommendations align with the user's initial intent. Subtype nodes then further refine the recommendations into more targeted categories, such as "comedy" or "heartwarming drama." This hierarchical segmentation enables the system to more accurately capture user preferences for specific genres.
[0043] On this basis, the emotional trait node further explores the emotional characteristics of each sub-genre of movies, such as "humorous" or "touching," allowing the system to not only focus on the genre of the film but also consider the emotional experience conveyed by the film. Furthermore, the user feedback node captures real-time user feedback during each round of conversation and incorporates this feedback into the recommendation strategy, allowing for dynamic adjustments. For example, the system can learn from feedback that "users prefer humorous elements" and increase the weight of these elements in subsequent recommendations.
[0044] The dynamic and hierarchical structure of the inference decision tree in this embodiment enables the system to respond in real time to users' evolving preferences and emotional states, ensuring that recommendations are always highly aligned with their current needs. At each level of analysis, the inference strategy tree not only considers the user's explicit needs but also refines the recommendation strategy through iterative adjustments based on emotional characteristics and user feedback. This refined approach significantly improves the accuracy of recommendation results and achieves better 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, thereby constructing a more extensive and refined expanded word set.
[0046] In an optional embodiment, in step S2, semantic encoding and embedding processing are performed on the historical conversation dataset, including the following steps:
[0047] 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;
[0048] Each round of dialogue D i and the corresponding common sense knowledge C i By integrating, we can 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 l-th 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, semantic encoding and embedding processing are performed on the external review dataset, 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 review 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 ); where 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 that are most similar to the conversation 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, and is used 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 the Relational Graph Convolutional Network (R-GCN) to obtain entity embedding representation;
[0068] The entity embedding representation e is output by the final layer of the relational graph convolutional network K Embedded as the entity feature of the entity 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 external knowledge graphs.
[0072] Exemplarily, the external knowledge graph adopts the DBpedia knowledge base to enrich and expand 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 is It 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 semantic encoding of the expanded word set and then the embedding process includes the following steps:
[0075] The words in the expanded 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 output by the final layer of the graph convolutional network D Embedded as word features 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 includes the conversation context or background features; The embedding representation of the core information contains the main features of the dialogue input; maxE p (·) represents optimizing the mutual information estimate by maximizing the expected value of the input;
[0084] χ c ,χ r ,χ e ,χ wRespectively 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; represents the multi-dimensional fusion embedding obtained by splicing the core information and background information embeddings; ⊕ represents the vector splicing operation; P multi It means that the concatenated embedding is normalized layer by layer 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] Furthermore, 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 Interaction,captures and characterizes 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 an architectural diagram of the inference decision tree of this embodiment.
[0094] In this embodiment, the structure of the inference strategy tree and the associated recommendation paths are dynamically updated through an adaptive mechanism, enabling progressively optimized recommendations based on user feedback during conversations. For example, when a user expresses a preference or aversion for certain elements, the model can adjust the weights of the associated paths accordingly.
[0095] Specifically, as the dialogue turns progress, the structure of the inference strategy tree will adapt accordingly. After each round of dialogue, the system will re-evaluate the validity of each path and recalculate the comprehensive representation. 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 emphasized during reasoning.
[0096] Furthermore, according to the recalculated comprehensive representation Applying a weighted mechanism to screen the generated predicted entities can prioritize 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 into 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 extracting the inference branches and historical statements involving the predicted entity, 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 statement embedding matrix H, which are used as important inputs of the decoder network.
[0099] In an optional embodiment, in step S5, inputting all embedding representations, 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 contextual semantics and output it as the recommended reply result; its expression is:
[0101] Θ q =Decoder(Θ q-1 ,χ e ,χ w ,χ c χ r ,T,H)
[0102] Y=FFN(ReLU([Θ Q ;χ]M1+b1)M2+b2)
[0103] Among them, Θ Q represents the response output by the final decoder layer, Q is the total number of decoder layers; Decoder(·) represents the decoder network; χ c ,χ r ,χ e ,χ w where ∈ R, ∈ R, and ∈ R represent the context feature embedding, comment feature embedding, entity feature embedding, and word feature embedding obtained after semantic encoding and embedding of the historical conversation dataset, external comment dataset, external knowledge graph, and extended word set, respectively; FFN(·) represents a fully connected feedforward network; χ is the feature embedding set; M1 and M2 are trainable weight matrices, and b1 and b2 are the 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, a set of feature embeddings are input into the decoder network, including the entity feature embedding χ e , word feature embedding χ w , contextual feature embedding χ c , and review feature embedding χ r During decoding, the decoder utilizes these embedded representations along with 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 produce contextually accurate 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 the generation of 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 (·) represents 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, through information enhancement technology, the user's vague or implicit expressions in the conversation are converted into clear preference information. By introducing a multi-level strategy framework and reasoning strategy tree, the problem of difficulty in handling user implicit or vague expressions in the conversation recommendation method is solved, which significantly improves the accuracy of the recommendation results and user satisfaction, and overcomes the limitations of existing technologies in handling complex conversation scenarios.
[0111] Example 2
[0112] This embodiment applies the conversation recommendation method based on subjective conversation scenarios proposed in Example 1, and evaluates the performance of the present invention through a series of comprehensive experiments.
[0113] This example conducts comparative analysis on two real-world datasets and benchmarks it against six state-of-the-art methods. Through these comparative experiments, we delve into its superiority and effectiveness in handling complex conversational scenarios, further validating 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, collected via Amazon Mechanical Turk, focuses on movie recommendation conversations and contains 10,006 conversations, each involving at least four different movies, totaling 64,362 unique movie entities. The TG-ReDial dataset, semi-automatically annotated, contains 10,000 conversations involving 33,834 movies, each organized around a thematic path.
[0115] To adapt these datasets to subjective recommendation scenarios, this example leverages the GPT-4 generative model to augment 70% of the existing dialogues, generating versions that incorporate subjective expressions while preserving the movie entities. Furthermore, sentiment features are introduced using the RoBERTa model to enhance the subjectivity of the dialogues. The revised dialogues were then manually evaluated to ensure their quality and consistency. The resulting datasets are named ReDial-S and TG-ReDial-S.
[0116] This example evaluates the recommendation task and the conversation task separately. In the recommendation task, recall at N, R@N (where N = 1, 10, and 50) at different levels is used as a performance metric to assess whether the recommendation results contain the true answer. In the conversation task, both automated and manual evaluation methods are combined. Automated evaluation metrics include Dist n-grams (n = 2, 3) and perplexity level (PPL), which are used to measure language fluency and diversity.
[0117] In addition, this embodiment also invited three annotators to manually evaluate the response quality from the three aspects of 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 verification of 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 for the recommendation task. The results show that this example comprehensively outperforms all baseline models on the evaluated datasets, highlighting its superior performance in conversational recommendation systems in subjective scenarios.
[0122] The results also show that incorporating more comprehensive external knowledge significantly improves model performance. For example, the KGSF and CRFR models, by integrating additional knowledge graphs, demonstrate superior results in understanding subjective input due to their rich background knowledge. This further emphasizes the importance of effectively leveraging external knowledge to address the complexity of subjective dialogue scenarios.
[0123] Furthermore, models that use tree-structured entity reasoning (such as CR-Walker and TREA) also outperform other methods, while our method achieves the highest performance thanks to its nonlinear structure and multi-type node reasoning mechanism. This performance further validates our method's leading position and innovative advantages in subjective recommendation tasks, and fully demonstrates its potential for application in complex conversational scenarios.
[0124] The automated evaluation results presented in the table show that the present invention outperforms other baseline methods in terms of Dist-2, Dist-3, and PPL metrics. Furthermore, 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 demonstrate that the present invention has a higher relevance when generating dialogue content. By effectively integrating external knowledge, the present invention enriches background information, thereby gaining a deeper understanding of the user's subjective intent and ensuring high 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 Example 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 relationships of the collected external knowledge graph to obtain an expanded word set;
[0130] An encoding module is 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 configured 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 statements related to the predicted entity, and perform semantic encoding and embedding processing to obtain an inference embedding matrix and a historical statement embedding matrix.
[0132] The decoding module is used to input all the embedding representations, the reasoning embedding matrix, and the historical sentence embedding matrix into the decoder to obtain the recommended response 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 again here.
[0134] Example 4
[0135] This embodiment proposes a computer device including a memory and a processor, wherein the memory stores computer-readable instructions. 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 having computer-readable instructions stored thereon, 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 Example 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. The same or similar parts between the embodiments can be referred to each other. 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. For the relevant parts, refer to the partial description of the method embodiment. The device embodiment described above is merely exemplary. The modules described as separate components may or may not be physically separated. When implementing the scheme of the present invention, the functions of each module can be implemented in the same one or more software and / or hardware. 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 the purpose of clearly illustrating the present invention, and are not intended to limit the embodiments of the present invention. Those skilled in the art will appreciate that other variations or modifications can be made based on the above description. It is not necessary and impossible to enumerate all embodiments here. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention shall be included within the scope of protection 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, external comment dataset, external knowledge graph, and extended word set are 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 statements related to the predicted entity, and performing semantic encoding and embedding processing to obtain the inference embedding matrix and the historical statement embedding matrix; All embedding representations, the reasoning embedding matrix, and the historical sentence embedding matrix are input into the decoder to obtain the recommended response result; The method further comprises the following steps: All embedded representations are fused using the maximum mutual information method; its expression is: Where I(∙) represents mutual information; An embedding representation of background information, which includes the conversation context or background features; Represents the embedding representation of the core information, which contains the main features of the dialogue input; max Ep(∙) indicates optimizing the mutual information estimation by maximizing the expected value of the input; 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; It represents the multi-dimensional fusion embedding obtained by concatenating the core information and background information embeddings; Represents the vector concatenation operation; Pmulti represents the layer normalization of the concatenated embedding, which is further processed by the Tanh activation function to obtain the final multi-dimensional fusion result.
2. The conversation recommendation method 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 Each round of dialogue , generate corresponding common sense knowledge through the COMET model ; Where N is the number of conversation turns in the historical conversation dataset; Integrate each round of dialogue Di with the corresponding common sense knowledge Ci to obtain an enhanced dialogue representation set ,in ; 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. ; Its expression is: in, Represents a multi-head attention mechanism; represents the output embedding representation of the l-th layer Transformer, where L is the total number of layers in the multi-layer Transformer architecture.
3. The conversation recommendation method according to claim 2, characterized in that The external review dataset is semantically encoded and then embedded, including the following steps: Perform sentence segmentation on the external review dataset to obtain a review set ; Where t is the number of divided external review sentences; The Sentence-BERT model is used to semantically encode each sentence Sj and generate the corresponding embedding vector ; 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 input multi-layer Transformer architecture for embedding processing to obtain the comment feature embedding ; 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: Based on 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; Embed the entity representation output by the final layer of the relational graph convolutional network as the entity feature embedding of the entity ; 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 entity embedding representation of the a-th entity ea output by the K-th layer of the graph convolutional network, where K is the total number of layers of the graph convolutional network.
5. The conversation recommendation method according to claim 1, wherein: The expanded word set is semantically encoded and then embedded, comprising the following steps: The words in the expanded word set are semantically encoded through a graph convolutional network to obtain a word embedding representation; its expression is: in, 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; Represents the weight matrix in the d-th layer graph convolutional network learned through the training process; The word embedding representation of the final layer output of the graph convolutional network Embedded as word features ; 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 word embedding representation of the m-th word wm output by the D-th layer graph convolutional network.
6. The conversation recommendation method according to any one of claims 1 to 5, characterized in that: The inference decision tree uses an adaptive path optimization algorithm to make decision prediction entities; wherein: After a round of dialogue is completed, the attention weight λ of each path is dynamically calibrated according to the completed fusion embedding representation Pmulti, the effectiveness of each path is re-evaluated, and the comprehensive representation is recalculated. ; Its expression is: Where p represents the final representation of each inference branch in the inference decision tree, Attn(∙) represents the attention mechanism; Ms, Mr, and Mc are training parameters; P is the branch embedding matrix, which is used to capture and characterize the relationship between inference branches by interacting with the training parameters Mr and Mc; represents the target branch of attention allocation, Represents all other branches; According to the recalculated comprehensive representation , a weighted mechanism is applied to filter and output the generated prediction entities.
7. The conversation recommendation method 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 response result includes 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 contextual semantics and output it as the recommended reply result; its expression is: in, represents the response output by the final decoder layer, Q is the total number of decoder layers; Decoder(∙) represents the decoder network; Respectively represent the context feature embedding, comment feature embedding, entity feature embedding, and word feature embedding obtained by semantic encoding and embedding the historical conversation dataset, external comment dataset, external knowledge graph, and extended word set; FFN(∙) represents a fully connected feedforward network; is the feature embedding set; M1 and M2 are trainable weight matrices, and b1 and b2 are the corresponding bias terms.
8. The conversation recommendation method according to claim 7, characterized in that: The method further includes the following steps: optimizing the generation process of the response Y using a cross entropy loss; wherein the expression of the dialogue loss function Lc is: Where N is the number of dialogue turns, and yi represents the i-th statement in the dialogue; represents the probability of generating the next word yi, represents the currently generated word subsequence; Qw(∙), Qk(∙) and Qc(∙) 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.
9. A conversation recommendation system based on subjective conversation scenarios, applying the conversation recommendation method according to any one of claims 1 to 8, 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 relationships of the collected external knowledge graph to obtain an expanded word set; An encoding module is 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 configured 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 statements related to the predicted entity, and perform semantic encoding and embedding processing to obtain an inference embedding matrix and a historical statement embedding matrix. The decoding module is used to input all the embedding representations, the reasoning embedding matrix, and the historical sentence embedding matrix into the decoder to obtain the recommended response 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