An intelligent conversation method, device, apparatus and storage medium
By leveraging the multi-layered memory structure of the intelligent dialogue system, user input information is acquired and integrated, solving the problem of a single memory structure in intelligent dialogue, achieving personalized and coherent dialogue, and improving the user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-30
- Publication Date
- 2026-04-14
AI Technical Summary
Existing intelligent dialogue memory structures are too simplistic and struggle to fully record semantic information during conversations, resulting in limited ability to capture contextual information and impacting user interaction experience.
An intelligent dialogue system employs working memory, short-term memory, and long-term memory layers. By acquiring user input information, it determines whether certain conditions are met, extracts historical information from the short-term and long-term memory layers, generates integrated information, and generates response information based on the integrated information and preset response templates. The response information is then stored as key-value pairs to support real-time dialogue.
It improves the naturalness of the conversation and the user experience, enhances the coherence and consistency of the conversation, ensures that the conversation is more personalized and smooth, and improves user satisfaction with the response information.
Smart Images

Figure CN120892542B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent dialogue technology, and more specifically, to an intelligent dialogue method, apparatus, device, and storage medium. Background Technology
[0002] With the rapid development of artificial intelligence technology, intelligent dialogue has been widely applied in numerous fields. From the initial simple voice assistants to today's intelligent customer service and chatbots capable of complex dialogue interactions, it has brought many conveniences to people's lives and work. It plays a vital role in e-commerce, smart homes, healthcare, education, and other fields, becoming one of the key technologies driving the digital transformation and intelligent development of various industries.
[0003] However, existing intelligent dialogue memory structures are too simple and cannot fully record semantic information during the dialogue process. This results in a limited ability to capture contextual information, which may lead to misunderstandings and affect the user's interactive experience. Summary of the Invention
[0004] The problem addressed by this invention is how to improve the user's interactive experience.
[0005] To address the above problems, the present invention provides an intelligent dialogue method, apparatus, device, and storage medium.
[0006] In a first aspect, the present invention provides an intelligent dialogue method applied to an intelligent dialogue system, the intelligent dialogue system comprising a working memory layer, a short-term memory layer, and a long-term memory layer, the intelligent dialogue method comprising:
[0007] Get the user's current input information;
[0008] If the current input information satisfies at least one of the preset citation conditions, semantic association conditions, task continuation conditions, and predictive retrieval conditions, then it is determined that the current input information satisfies the historical retrieval conditions, and the corresponding historical information is extracted from the short-term memory layer and the long-term memory layer.
[0009] The current input information and the historical information are concatenated using context to generate integrated information;
[0010] Reply information is generated based on the integrated information and the matched preset reply template, and the current input information and the corresponding reply information are stored in the working memory layer in the form of key-value pairs.
[0011] Optionally, the method further includes:
[0012] Retrieve the historical dialogues stored in the short-term memory layer that correspond to the current input information;
[0013] Based on the matching results between the keywords in the current input information and the feature information of the historical dialogue, it is determined whether the citation condition is met;
[0014] Based on the similarity between the current input information and the historical dialogue, determine whether the semantic association condition is met;
[0015] Based on the comparison between the current input information and the unfinished dialogue tasks in the historical dialogue, determine whether the task continuation condition is met;
[0016] Based on the contextual relationship between the current input information and the historical dialogue, determine whether the predictive retrieval conditions are met.
[0017] Optionally, the integrated information includes current user intent, key entities, historical replies, and user preferences; generating reply information based on the integrated information and a matched preset reply template includes:
[0018] The preset reply template is determined based on the current user intent and the preset matching rules, wherein the matching rules include a one-to-one correspondence between the user intent and the preset reply template;
[0019] An initial response template is generated by filling in the preset response template based on the key entities;
[0020] Generate personalized replies based on the historical replies and the user preferences;
[0021] The reply information is generated by semantic fusion based on the initial reply template and the personalized reply.
[0022] Optionally, the method further includes:
[0023] The importance score is determined by multidimensional feature extraction based on the dialogue content of the current round, wherein the dialogue content of the current round includes the current input information and the corresponding response information;
[0024] When the importance score is greater than the preset improvement threshold, the dialogue content is saved to the short-term memory layer;
[0025] When the importance score is less than or equal to the boost threshold and greater than or equal to the preset forget threshold, the dialogue content is retained in the working memory layer, wherein the boost threshold is greater than the forget threshold;
[0026] When the importance score is less than the forgetting threshold, the dialogue content is removed from the working memory layer.
[0027] Optionally, the multidimensional features include semantic features, sentiment features, user features, information novelty features, and task-related features; the step of determining the corresponding importance score based on the dialogue content of the current round through multidimensional feature extraction includes:
[0028] Semantic features are extracted from the dialogue content using a trained semantic understanding model.
[0029] Based on the dialogue content, sentiment features are extracted using a trained sentiment analysis model.
[0030] User characteristics are extracted based on the dialogue content using natural language understanding technology;
[0031] The novelty features of the information are determined by cosine similarity based on the dialogue content and the historical information.
[0032] Based on the dialogue content, task-related features are extracted through text analysis.
[0033] The importance score is obtained based on the semantic features, the emotional features, the user features, the information novelty features, and the task association features, through a preset importance scoring relationship.
[0034] Optionally, the importance scoring relationship satisfies:
[0035] ;
[0036] Where A is the importance score, W S Let S be the weight coefficient of the semantic feature, and W be the semantic feature. E Let E be the weight coefficient of the emotional feature, and W be the emotional feature itself. U Let U be the weight coefficient of the user feature, and W be the user feature. I Let W be the weight coefficient of the information novelty feature, I be the information novelty feature, and W be the weight coefficient of the information novelty feature. T is the weight coefficient of the task-related feature, and T is the task-related feature.
[0037] Optionally, the method further includes:
[0038] Obtain the storage time and initial weight corresponding to the information stored in the working memory layer, the short-term memory layer, and the long-term memory layer;
[0039] The storage time and the initial weight are used to determine the time decay score of the stored information through the time decay relationship;
[0040] The stored information whose time decay score is less than a preset decay threshold is marked as forgotten information;
[0041] The time decay relationship satisfies:
[0042] ;
[0043] Wherein, B is the time decay score, C is the initial weight corresponding to the stored information, λ is the preset decay coefficient, t is the storage time corresponding to the stored information, and e is a natural constant.
[0044] Secondly, the present invention provides an intelligent dialogue device for use in an intelligent dialogue system, the intelligent dialogue system comprising a working memory layer, a short-term memory layer, and a long-term memory layer, the intelligent dialogue device comprising:
[0045] The acquisition module is used to acquire the user's current input information;
[0046] The judgment module is used to determine that the current input information meets the historical retrieval conditions when the current input information meets at least one of the preset reference conditions, semantic association conditions, task continuation conditions, and predictive retrieval conditions, and to extract the corresponding historical information from the short-term memory layer and the long-term memory layer.
[0047] The splicing module is used to splice the current input information and the historical information through context to generate integrated information;
[0048] The response module is used to generate response information based on the integrated information and the matched preset response template, and to store the current input information and the corresponding response information in the form of key-value pairs in the working memory layer.
[0049] Thirdly, the present invention provides an electronic device, including a memory and a processor;
[0050] The memory is used to store computer programs;
[0051] The processor is configured to implement the intelligent dialogue method as described in the first aspect when executing the computer program.
[0052] Fourthly, the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the intelligent dialogue method as described in the first aspect.
[0053] The beneficial effects of the intelligent dialogue method, apparatus, device, and storage medium of the present invention are as follows: By acquiring the user's current input information, it can respond to the user's needs in real time, ensuring the immediacy and interactivity of the dialogue. When the current input information meets at least one of the preset citation conditions, semantic association conditions, task continuation conditions, and predictive retrieval conditions, it is necessary to extract corresponding historical information from the short-term memory layer and the long-term memory layer. Through historical information, the user's historical interaction records and background information can be fully utilized to generate more personalized, coherent, and in-depth responses. This avoids the common intelligent dialogue memory structure being too simple and unable to fully record the semantic information in the dialogue process, improving the ability to capture context and greatly enhancing the naturalness of the dialogue and the user experience. Furthermore, by splicing the current input information and historical information through context to generate integrated information, it is possible to fully understand the user's intent and the dialogue context, thereby enabling the generation of response information to fully consider the context of the dialogue and avoiding misunderstandings or inaccurate answers caused by a lack of historical memory information. Reply information is generated based on integrated information and a pre-defined response template. The current input information and the corresponding response are stored as key-value pairs in the working memory layer. This provides immediate contextual support for subsequent conversations and allows for quick retrieval and referencing of previous dialogue content, further enhancing the coherence and consistency of the conversation. Reply information generated based on current and historical information effectively improves the interactive quality of intelligent dialogue, making conversations more natural, fluent, and personalized, thereby significantly increasing user satisfaction with the response information and enhancing the user experience. Attached Figure Description
[0054] Figure 1 This is a flowchart illustrating an intelligent dialogue method according to an embodiment of the present invention;
[0055] Figure 2 This is a schematic diagram of the structure of an intelligent dialogue device according to an embodiment of the present invention;
[0056] Figure 3 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present invention. Detailed Implementation
[0057] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Although some embodiments of the present invention are shown in the drawings, it should be understood that the present invention can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the present invention. It should be understood that the accompanying drawings and embodiments of the present invention are for illustrative purposes only and are not intended to limit the scope of protection of the present invention.
[0058] It should be understood that the various steps described in the method embodiments of the present invention may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present invention is not limited in this respect.
[0059] The term "comprising" and its variations as used herein are open-ended, meaning "including but not limited to"; the term "based on" means "at least partially based on"; the term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments"; and the term "optionally" means "optional embodiments". Definitions of other terms will be given in the following description. It should be noted that the concepts of "first," "second," etc., mentioned in this invention are used only to distinguish different devices, modules, or units, and are not intended to limit the order of functions performed by these devices, modules, or units or their interdependencies.
[0060] It should be noted that the terms "a" and "a plurality of" used in this invention are illustrative rather than restrictive. Those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0061] The names of the messages or information exchanged between the multiple devices in the embodiments of the present invention are for illustrative purposes only and are not intended to limit the scope of these messages or information.
[0062] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, data stored, data displayed, etc.) and signals involved in this application are all authorized by the user or fully authorized by all parties. The collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation portals are provided for users to choose to authorize or refuse.
[0063] This invention provides an intelligent dialogue method, apparatus, device, and storage medium.
[0064] like Figure 1 As shown in the figure, an intelligent dialogue method provided by an embodiment of the present invention is applied to an intelligent dialogue system, which includes a working memory layer, a short-term memory layer and a long-term memory layer.
[0065] Specifically, in an intelligent dialogue system, the working memory layer can use a key-value pair structure for information storage, implemented with a high-speed cache. Its capacity is limited, typically storing real-time information from the last 5-10 rounds of dialogue, such as the current query, entity information, search results, current dialogue round, user input results after semantic parsing and intent recognition, and system-generated responses. It undergoes light structuring to preserve the complete original information and allows for high-speed access to support real-time dialogue processing. Its main responsibility is processing real-time information from the current dialogue, such as recently entered user commands or questions, quickly extracting and integrating data directly related to the current topic to ensure the immediacy and coherence of the dialogue. The short-term memory layer can use a serialization structure, implemented through an in-memory database. Its capacity is moderate, storing accumulated information from the current session, including weighted dialogue history sequences, session-level user profiles, active topic lists, and queues of unfinished tasks. It undergoes moderate compression, reducing redundancy and retaining key content through redundancy merging, summary generation, and entity aggregation, serving the current session to maintain dialogue coherence and context. The first layer, text comprehension, stores dialogue content over a slightly longer timeframe, including contextual information and user sentiment, helping the system understand the stages of the dialogue and maintaining its logic and coherence over a certain period. The second layer, long-term memory, employs a knowledge graph structure implemented using a graph database. This large-capacity layer stores persistent knowledge across sessions, such as interaction patterns, knowledge graph nodes, long-term user preferences, and verified user facts. This knowledge is highly compressed and abstracted, transforming specific information into a knowledge graph representation. An incremental update strategy can be used to retain information across sessions, maintaining the continuity of user information and providing personalized and coherent services. It also stores a large amount of knowledge, historical dialogue records, and user preferences, providing rich background support for the dialogue. This allows the system to respond personally based on long-term user behavior and preferences, enhancing the intelligence and user experience of the dialogue. Through the synergistic effect of these three layers of memory, the system can process and utilize information at different time scales, achieving efficient, flexible, in-depth, and more natural and intelligent dialogue interaction.
[0066] The intelligent dialogue method includes:
[0067] S100: Obtain the user's current input information.
[0068] Specifically, acquiring the user's current input information is a fundamental step for effective interaction in intelligent dialogue systems. Current input information typically refers to text, voice commands, or other forms of input entered by the user in the dialogue interface. The system first needs to receive the user's input information through input devices (such as keyboards, microphones, etc.), and then convert it into a processable data format, such as converting speech signals into text content. During the acquisition of input information, preprocessing can be performed, including noise removal, spelling correction, and language and intent recognition, to ensure the accuracy and usability of the input information. Furthermore, the completeness and compliance of the input can be monitored in real time to avoid receiving invalid or harmful information. By efficiently and accurately acquiring the user's current input information, intelligent dialogue systems can provide a reliable data foundation for subsequent semantic understanding, dialogue generation, and response, thereby achieving smooth and natural interaction with the user.
[0069] S200, when the current input information satisfies at least one of the preset citation conditions, semantic association conditions, task continuation conditions, and predictive retrieval conditions, it is determined that the current input information satisfies the historical retrieval conditions, and the corresponding historical information is extracted from the short-term memory layer and the long-term memory layer.
[0070] Specifically, when a user's current input meets at least one of the preset citation conditions, semantic association conditions, task continuation conditions, and predictive retrieval conditions, the system determines that the input meets the historical retrieval conditions. The citation condition means that the user's current input explicitly mentions content from previous conversations, such as "the result you mentioned before." In this case, historical information related to "results" needs to be retrieved from short-term and long-term memory to respond to the user. The semantic association condition means that the current input is semantically closely related to historical conversations. For example, if the user continues to discuss a previously mentioned topic, semantic analysis can be used to determine whether to retrieve content mentioned in historical information to better understand the context. The task continuation condition means that the current input is a continuation of a previous task. For example, when a user completes multiple steps of a complex task, the system needs to retrieve information from previous steps to maintain task continuity. The predictive retrieval condition means that the system predicts the historical information the user might need based on the user's behavioral patterns or preferences and retrieves it accordingly. Once at least one of these conditions is met, it is determined that a history retrieval is required. The corresponding historical information is then extracted from the short-term memory layer (which stores recent conversation information) and the long-term memory layer (which stores broader knowledge and historical records) to enhance the coherence and accuracy of the conversation and provide users with a more intelligent and personalized interactive experience.
[0071] S300, the current input information and the historical information are concatenated through context to generate integrated information.
[0072] Specifically, the system concatenates the current input information with retrieved historical information, combining them in a pre-defined logical order to form a complete integrated information flow. This process considers the relevance, temporal order, and semantic coherence of the information to ensure that the integrated information accurately reflects the context of the dialogue and the user's intent. For example, if the user's current input is "How is that product we mentioned last time?", the system will retrieve relevant information about the previously mentioned product from its memory and concatenate it with the current input to generate integrated information such as "The user previously inquired about a certain product and now wants to know more about it." This approach allows for a better understanding of the user's intent, resulting in more accurate and natural dialogue responses, improving the fluency of the conversation and the user experience.
[0073] S400, generate reply information based on the integrated information and the matched preset reply template, and store the current input information and the corresponding reply information in the working memory layer in the form of key-value pairs.
[0074] Specifically, response information is generated based on integrated information (i.e., the integration of current input information and relevant historical information) and a matching preset response template. The integrated information provides comprehensive contextual support to the system through current and historical information, enabling it to understand the user's true intent and the coherence of the dialogue. The preset response templates are response frameworks pre-designed based on historical data and language models; these templates can be flexibly adjusted and filled according to different scenarios and intents. Key information from the integrated information is matched and replaced with placeholders in the corresponding preset templates to generate response information that fits the current dialogue scenario. After generating the response, the current input information and the corresponding response information are stored as key-value pairs in the working memory layer. The working memory layer is a short-term storage area in the system used to store immediate information in the current dialogue; it can quickly read and update information, ensuring the immediacy and coherence of the dialogue. By storing the current input and response information as key-value pairs, this information can be quickly retrieved and referenced in subsequent dialogues to better handle subsequent user input, while also providing a basis for possible backtracking and contextual association. This mechanism not only improves the fluency and accuracy of the dialogue but also enhances the system's interactivity and user experience.
[0075] In this embodiment, by acquiring the user's current input information, the system can respond to the user's needs in real time, ensuring the immediacy and interactivity of the dialogue. When the current input information meets at least one of the preset citation conditions, semantic association conditions, task continuation conditions, and predictive retrieval conditions, corresponding historical information needs to be extracted from the short-term memory layer and the long-term memory layer. This historical information fully utilizes the user's historical interaction records and background information, thereby generating more personalized, coherent, and in-depth responses. This avoids the limitations of conventional intelligent dialogue memory structures, which are often too simple to comprehensively record semantic information during the dialogue process, improving the ability to capture context and greatly enhancing the naturalness of the dialogue and the user experience. Furthermore, by concatenating the current input information and historical information with context to generate integrated information, the system can fully understand the user's intent and the dialogue flow, ensuring that the generated response information fully considers the context of the dialogue and avoids misunderstandings or inaccurate answers due to a lack of historical memory information. Reply information is generated based on the integrated information and a matched preset response template. The current input information and the corresponding response information are stored in the working memory layer as key-value pairs, providing immediate contextual support for subsequent dialogues and enabling quick retrieval and referencing of previous dialogue content, further enhancing the coherence and consistency of the dialogue. The response information generated based on the current input information and historical information can effectively improve the interaction quality of intelligent dialogue, making the dialogue more natural, fluent and personalized, thereby significantly improving user satisfaction with the response information and enhancing the user experience.
[0076] Optionally, the method further includes:
[0077] Retrieve the historical dialogues stored in the short-term memory layer that correspond to the current input information;
[0078] Based on the matching results between the keywords in the current input information and the feature information of the historical dialogue, it is determined whether the citation condition is met;
[0079] Based on the similarity between the current input information and the historical dialogue, determine whether the semantic association condition is met;
[0080] Based on the comparison between the current input information and the unfinished dialogue tasks in the historical dialogue, determine whether the task continuation condition is met;
[0081] Based on the contextual relationship between the current input information and the historical dialogue, determine whether the predictive retrieval conditions are met.
[0082] In this optional embodiment, in order to determine whether the current input information meets the historical retrieval conditions, it is necessary to obtain the historical dialogue corresponding to the current input information from the short-term memory layer, and to determine whether the citation conditions, semantic association conditions, task continuation conditions, and predictive retrieval conditions are met by analyzing and comparing the current input information and the historical dialogue.
[0083] When performing application condition judgment, it is necessary to match keywords in the current input information with feature information from historical dialogues. If the current input explicitly mentions specific content from previous dialogues (such as referencing a previously mentioned object, event, or information), then the referencing condition is considered met. For example, if the user's current input is "How was that restaurant you mentioned before?", keyword matching reveals that a certain restaurant was mentioned in historical dialogues, thus determining that the referencing condition is met.
[0084] When determining semantic association conditions, the similarity between the current input and historical dialogues needs to be calculated to determine whether the semantic association conditions are met. If the current input and historical dialogues have a high semantic relevance (e.g., they discuss the same topic or related issues), then the semantic association conditions are considered met. For example, if the historical dialogue discussed "travel plans," and the current input is "how to allocate a travel budget," the system will find that the two are related through semantic analysis, thus determining that the semantic association conditions are met.
[0085] When determining whether a task can continue, it's necessary to compare the current input with unfinished tasks in the historical dialogue. If the current input is related to a previously unfinished task (e.g., the user continues to ask about the next steps of a previously unfinished task), then the task continuation condition is considered met. For example, in a historical dialogue, a user might be asking about the purchase process for a product but hasn't completed it. The current input might be "What is the after-sales policy for that product?" Task comparison reveals a correlation between the two, thus determining that the task continuation condition is met.
[0086] When determining predictive retrieval criteria, the system needs to consider the context of the current input information and historical dialogues to determine whether the criteria are met. If the system predicts that the user may need information related to historical dialogues based on their input patterns or preferences, then the predictive retrieval criteria are considered met. For example, if a user has shown interest in a specific topic in multiple dialogues, the system predicts that the current input may be related to that topic, thus determining that the predictive retrieval criteria are met.
[0087] By judging the above series of historical retrieval conditions, the relationship between the current input information and the historical dialogue can be accurately identified, thereby deciding whether to extract the corresponding historical information from the short-term memory layer and the long-term memory layer, so as to enhance the coherence and accuracy of the dialogue and improve the user experience.
[0088] Optionally, the integrated information includes current user intent, key entities, historical replies, and user preferences; generating reply information based on the integrated information and a matched preset reply template includes:
[0089] The preset reply template is determined based on the current user intent and the preset matching rules, wherein the matching rules include a one-to-one correspondence between the user intent and the preset reply template;
[0090] An initial response template is generated by filling in the preset response template based on the key entities;
[0091] Generate personalized replies based on the historical replies and the user preferences;
[0092] The reply information is generated by semantic fusion based on the initial reply template and the personalized reply.
[0093] In this optional embodiment, the integrated information includes important elements such as the current user intent, key entities, historical responses, and user preferences. These elements collectively provide the foundation for generating accurate and personalized responses. First, a suitable preset response template is determined based on the current user intent and preset matching rules. Matching rules can include a one-to-one correspondence between user intents and preset response templates. The corresponding user intent is retrieved from the matching relationship using the current user intent, and the preset response template corresponding to the retrieved user intent is used as the response template for the current information. This allows for quick location of the most suitable response framework, i.e., the matched preset response template, based on the user's specific intent requirements. For example, if the user intent is to query the price of a product, a response template specifically for price queries will be matched. Next, the preset response template is populated with key entities from the integrated information to generate an initial response template. Key entities refer to words or phrases with significant semantic value in the user input, such as product names, dates, and locations. By populating the template with these key entities, a preliminary response framework highly relevant to the user's needs is generated, i.e., the initial response template. For example, if a user asks "the price of a mobile phone," the price query template will be populated with "the price of a mobile phone" as a key entity, generating an initial response template of "The price of a mobile phone is...". Then, a personalized response is generated based on historical responses and user preferences. Historical responses provide a record of the user's previous interactions with the system, while user preferences reflect the user's personalized needs in terms of conversation style, information preferences, etc. By analyzing this historical data and preference information, personalized response content that matches the user's habits and expectations is generated. For example, if the user prefers a concise response style, a more concise response will be generated. Finally, the initial response template and the personalized response are semantically fused to generate the final response information. Semantic fusion is a process of integrating information from different sources to ensure that the generated response is both accurate and meets the user's personalized needs. For example, combining the initial response template of "The price of a mobile phone is..." with the user's preferred concise style will ultimately generate the response information "The mobile phone costs 5999 yuan." Through these steps, accurate, personalized, and naturally fluent response information can be generated, significantly improving the user experience and the interaction quality of the dialogue system.
[0094] Optionally, the method further includes:
[0095] The importance score is determined by multidimensional feature extraction based on the dialogue content of the current round, wherein the dialogue content of the current round includes the current input information and the corresponding response information;
[0096] When the importance score is greater than the preset improvement threshold, the dialogue content is saved to the short-term memory layer;
[0097] When the importance score is less than or equal to the boost threshold and greater than or equal to the preset forget threshold, the dialogue content is retained in the working memory layer, wherein the boost threshold is greater than the forget threshold;
[0098] When the importance score is less than the forgetting threshold, the dialogue content is removed from the working memory layer.
[0099] In this optional embodiment, the importance score is determined based on the dialogue content of the current round (including the user's current input information and corresponding response information) through multi-dimensional feature extraction. Multi-dimensional feature extraction may involve multiple aspects such as the semantic importance of the dialogue content, the user's emotional expression, the contextual relevance of the dialogue, and the urgency of the task. For example, if the current dialogue content involves a key decision point of a critical task, or if the user exhibits a strong emotional response, these features may increase the importance score. When the importance score is greater than a preset increase threshold, it indicates that the dialogue content has high value and importance, and this content needs to be saved to the short-term memory layer. The short-term memory layer is used to store relatively important, recent dialogue information, which may be frequently referenced in subsequent dialogues, helping the system better understand and respond to user needs. When the importance score is less than or equal to the increase threshold, but greater than or equal to a preset forgetting threshold, it indicates that the dialogue content has some importance, but is insufficient to be promoted to the short-term memory layer. Therefore, this content is retained in the working memory layer. The working memory layer is mainly used to store immediate information of the current round of dialogue, which may be used in the short term but will not be retained for a long time. In this way, it is ensured that the information stored in the working memory layer always remains relevant and useful. Finally, when the importance score is less than the forgetting threshold, it indicates that the dialogue content is of low value and needs to be removed from the working memory layer. It should be noted that the promotion threshold is a standard used to determine whether dialogue content is important enough to need to be promoted from the working memory layer to the short-term memory layer. The forgetting threshold is set to avoid the system storing too much irrelevant information, thereby maintaining the system's efficiency and responsiveness. The promotion threshold is set higher than the forgetting threshold.
[0100] Optionally, the multidimensional features include semantic features, sentiment features, user features, information novelty features, and task-related features; the step of determining the corresponding importance score based on the dialogue content of the current round through multidimensional feature extraction includes:
[0101] Semantic features are extracted from the dialogue content using a trained semantic understanding model.
[0102] Based on the dialogue content, sentiment features are extracted using a trained sentiment analysis model.
[0103] User characteristics are extracted based on the dialogue content using natural language understanding technology;
[0104] The novelty features of the information are determined by cosine similarity based on the dialogue content and the historical information.
[0105] Based on the dialogue content, task-related features are extracted through text analysis.
[0106] The importance score is obtained based on the semantic features, the emotional features, the user features, the information novelty features, and the task association features, through a preset importance scoring relationship.
[0107] In this optional embodiment, in order to accurately assess the importance of the current round of dialogue content, it is necessary to make a comprehensive judgment through multi-dimensional feature extraction. These multi-dimensional features include semantic features, sentiment features, user features, information novelty features, and task relevance features.
[0108] Semantic feature extraction process: A trained semantic understanding model is used to analyze the dialogue content and extract semantic features. Semantic features reflect the core meaning and theme of the dialogue, helping to understand the user's intent and the essence of the conversation. For example, semantic analysis can determine whether a user is asking a specific question or expressing a certain viewpoint. The trained semantic understanding model is an artificial intelligence model trained on a large amount of data, specifically designed to understand and parse the semantic information of natural language text. It can map text input into semantic representations, thereby capturing the core meaning and contextual relationships of the text. Such models are typically based on deep learning techniques, such as recurrent neural networks, long short-term memory networks, and gated recurrent units. During training, the model learns from a large amount of text data, including sentence structure, lexical relationships, grammatical rules, and semantic patterns. In this way, it can understand the meaning of words, phrases, and sentences in different contexts and generate corresponding semantic vectors or labels.
[0109] Sentiment feature extraction process: Sentiment features are extracted using a trained sentiment analysis model. Sentiment features capture the emotional state expressed by users in conversations, such as happiness, anger, and disappointment. Sentiment analysis is crucial for understanding users' emotional responses and adjusting the tone and style of the system's responses. For example, if a user expresses dissatisfaction, the system can adjust its response to soothe the user's emotions. The trained sentiment analysis model is an artificial intelligence model trained on a large amount of labeled data, specifically designed to identify and analyze the sentiment tendency in text. It can determine whether the sentiment expressed in text (such as sentences, paragraphs, or dialogue content) is positive, negative, or neutral. Such models are typically built based on machine learning or deep learning techniques. Common methods include using traditional machine learning algorithms such as support vector machines and Naive Bayes classifiers, or utilizing deep learning architectures such as recurrent neural networks, convolutional neural networks, and long short-term memory networks. During training, the model learns from a large amount of text data with sentiment annotations, such as labeling "This movie is great!" as "positive" and "The service is terrible" as "negative." By analyzing vocabulary, phrases, grammatical structures, and contextual information in the text, the model can learn patterns and features of sentiment expression.
[0110] User feature extraction process: User features are extracted using natural language understanding (NLU) technology. These features may include the user's language style, preferences, habits, etc. These features help provide more personalized services. For example, if a user habitually uses concise language, a more concise response can be generated. NLU technology is an important branch of artificial intelligence, aiming to enable computers to understand human natural language. It extracts key information and intent by analyzing the syntax, semantics, and context of text. In existing technologies, NLU often combines deep learning models (such as the Transformer architecture) with pre-trained language models to achieve efficient semantic parsing and intent recognition.
[0111] The process of extracting information novelty features involves calculating the similarity between dialogue content and historical information using cosine similarity to determine the information novelty features. Information novelty features reflect whether the current dialogue content provides new information or perspectives. If the current dialogue content is highly similar to historical information, its novelty is low; conversely, if the content is unique, its novelty is high. For example, if a user mentions a new topic that hasn't been mentioned before, its novelty feature will be high. Cosine similarity is a measure of the directional similarity between two vectors, commonly used in text similarity analysis. In natural language processing, text is usually converted into vector form, such as word embeddings or Term Frequency-Inverse Document Frequency (TF-IDF) vectors used in information retrieval and text mining. Cosine similarity measures the similarity between two vectors by calculating the cosine of the angle between them; a value closer to 1 indicates greater similarity. In existing technologies, it is widely used in information retrieval, text matching, and recommendation systems to help quickly determine the relevance of text content.
[0112] Task-related feature extraction process: Task-related features are extracted through text analysis. These features reflect whether the current dialogue content is relevant to the ongoing task or goal. For example, if a user is completing a complex task, does the current dialogue content contribute to its completion? Text analysis involves processing and analyzing text data using natural language processing techniques to extract valuable information and knowledge. Existing technologies often combine deep learning models with traditional algorithms to achieve functions such as sentiment analysis, topic extraction, and text classification. It is widely used in fields such as intelligent customer service and content recommendation, helping enterprises and systems better understand text content and improve decision-making efficiency and user experience.
[0113] Furthermore, by comprehensively considering semantic features, sentiment features, user features, information novelty features, and task relevance features, the importance score of the current dialogue content is calculated using pre-defined importance scoring relationships (such as weighted summation, logistic regression, etc.). This score reflects the comprehensive value of the dialogue content across multiple dimensions, helping the system decide whether to store the dialogue content in short-term memory or working memory, and whether it needs to be removed from working memory. Through this multi-dimensional evaluation mechanism, the system can manage dialogue information more accurately, improving dialogue coherence and user experience.
[0114] For example, the importance scoring relationship satisfies:
[0115] ;
[0116] Where A is the importance score, W S Let S be the weight coefficient of the semantic feature, and W be the semantic feature.E Let E be the weight coefficient of the emotional feature, and W be the emotional feature itself. U Let U be the weight coefficient of the user feature, and W be the user feature. I Let W be the weight coefficient of the information novelty feature, I be the information novelty feature, and W be the weight coefficient of the information novelty feature. T is the weight coefficient of the task-related feature, and T is the task-related feature.
[0117] Optionally, the method further includes:
[0118] Obtain the storage time and initial weight corresponding to the information stored in the working memory layer, the short-term memory layer, and the long-term memory layer;
[0119] The storage time and the initial weight are used to determine the time decay score of the stored information through the time decay relationship;
[0120] The stored information whose time decay score is less than a preset decay threshold is marked as forgotten information;
[0121] The time decay relationship satisfies:
[0122] ;
[0123] Wherein, B is the time decay score, C is the initial weight corresponding to the stored information, λ is the preset decay coefficient, t is the storage time corresponding to the stored information, and e is a natural constant.
[0124] In this optional embodiment, to effectively manage the stored information in the working memory layer, short-term memory layer, and long-term memory layer, a time decay score is determined for each piece of stored information based on its storage time and corresponding initial weight, thereby determining which information needs to be forgotten. Specifically, the storage time (i.e., the time when the information was stored) and initial weight (i.e., the importance assigned to the information at the time of storage) of each piece of stored information are first obtained. The initial weight reflects the importance of the information at the time of storage, while the storage time is used to measure the timeliness of the information. A time decay score for each piece of information is calculated using a preset time decay relationship (usually a time-based decay function, such as exponential decay or linear decay). This score gradually decreases as the storage time increases, indicating that the information becomes less important over time. When the time decay score is less than a preset decay threshold, the system marks the stored information as forgotten information, meaning that this information is considered no longer important and can be removed or downgraded. This mechanism simulates the forgetting process of human memory, ensuring the system can dynamically manage memory resources, prioritizing the retention of important and time-sensitive information while freeing up storage space occupied by less important information. This improves system efficiency and responsiveness while maintaining the coherence and relevance of conversations. A competitive memory mechanism can further optimize memory resource allocation by allowing different types of stored information to "compete" for limited storage resources, prioritizing the retention of important or frequently used information and discarding unimportant information. This mechanism dynamically adjusts the storage and forgetting of information, ensuring efficient system operation, enhancing the coherence and relevance of conversations, and improving the user experience.
[0125] like Figure 2 As shown in the figure, an intelligent dialogue device 200 provided in this embodiment of the invention is applied to an intelligent dialogue system. The intelligent dialogue system includes a working memory layer, a short-term memory layer, and a long-term memory layer. The intelligent dialogue device 200 includes:
[0126] The acquisition module 210 is used to acquire the user's current input information;
[0127] The judgment module 220 is used to determine that the current input information meets the historical retrieval conditions when the current input information meets at least one of the preset reference conditions, semantic association conditions, task continuation conditions and predictive retrieval conditions, and extract the corresponding historical information from the short-term memory layer and the long-term memory layer.
[0128] The splicing module 230 is used to splice the current input information and the historical information through context to generate integrated information;
[0129] The response module 240 is used to generate response information based on the integrated information and the matched preset response template, and to store the current input information and the corresponding response information in the form of key-value pairs in the working memory layer.
[0130] The intelligent dialogue device in this embodiment is used to implement the intelligent dialogue method described above. Its advantages over the prior art are the same as the advantages of the intelligent dialogue method compared to the prior art, and will not be repeated here.
[0131] like Figure 3 As shown, an electronic device 300 provided in this embodiment of the invention includes a memory 310 and a processor 320; the memory 310 is used to store a computer program; the processor 320 is used to implement the intelligent dialogue method as described above when the computer program is executed.
[0132] Alternatively, an electronic device 300 includes a memory 310 and a processor 320 coupled to the memory 310; the memory 310 is configured to store a computer program; and the processor 320 is configured to perform the following operations when the computer program is executed:
[0133] Get the user's current input information;
[0134] If the current input information satisfies at least one of the preset citation conditions, semantic association conditions, task continuation conditions, and predictive retrieval conditions, then it is determined that the current input information satisfies the historical retrieval conditions, and the corresponding historical information is extracted from the short-term memory layer and the long-term memory layer.
[0135] The current input information and the historical information are concatenated using context to generate integrated information;
[0136] Reply information is generated based on the integrated information and the matched preset reply template, and the current input information and the corresponding reply information are stored in the working memory layer in the form of key-value pairs.
[0137] This invention provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the intelligent dialogue method described above.
[0138] Alternatively, a non-volatile computer-readable storage medium storing a computer program that, when executed by a processor, causes the processor to perform the following operations:
[0139] Get the user's current input information;
[0140] If the current input information satisfies at least one of the preset citation conditions, semantic association conditions, task continuation conditions, and predictive retrieval conditions, then it is determined that the current input information satisfies the historical retrieval conditions, and the corresponding historical information is extracted from the short-term memory layer and the long-term memory layer.
[0141] The current input information and the historical information are concatenated using context to generate integrated information;
[0142] Reply information is generated based on the integrated information and the matched preset reply template, and the current input information and the corresponding reply information are stored in the working memory layer in the form of key-value pairs.
[0143] The present invention will now be described an electronic device 300 that can serve as a server or client of the present invention, which is an example of a hardware device that can be applied to various aspects of the present invention. Electronic device 300 is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. Electronic device 300 can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0144] Electronic device 300 includes a computing unit that can perform various appropriate actions and processes based on a computer program stored in read-only memory (ROM) or a computer program loaded from a storage unit into random access memory (RAM). The RAM may also store various programs and data required for device operation. The computing unit, ROM, and RAM are interconnected via a bus. Input / output (I / O) interfaces are also connected to the bus.
[0145] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc. In this application, the units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of the embodiments of the present invention according to actual needs. Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated units can be implemented in hardware or as software functional units.
[0146] While the present invention has been disclosed above, its scope of protection is not limited thereto. Those skilled in the art can make various changes and modifications without departing from the spirit and scope of the present invention, and all such changes and modifications will fall within the scope of protection of the present invention.
Claims
1. An intelligent dialogue method, characterized in that, Applied to an intelligent dialogue system, the intelligent dialogue system includes a working memory layer, a short-term memory layer, and a long-term memory layer, and the intelligent dialogue method includes: Get the user's current input information; If the current input information satisfies at least one of the preset citation conditions, semantic association conditions, task continuation conditions, and predictive retrieval conditions, then it is determined that the current input information satisfies the historical retrieval conditions, and the corresponding historical information is extracted from the short-term memory layer and the long-term memory layer. The current input information and the historical information are concatenated using context to generate integrated information; Reply information is generated based on the integrated information and the matched preset reply template, and the current input information and the corresponding reply information are stored in the working memory layer in the form of key-value pairs; The integrated information includes current user intent, key entities, historical responses, and user preferences; the step of generating response information based on the integrated information and a matched preset response template includes: The preset reply template is determined based on the current user intent and the preset matching rules, wherein the matching rules include a one-to-one correspondence between the user intent and the preset reply template; An initial response template is generated by filling in the preset response template based on the key entities; Generate personalized replies based on the historical replies and the user preferences; The reply information is generated by semantic fusion based on the initial reply template and the personalized reply; Also includes: The importance score is determined by multidimensional feature extraction based on the dialogue content of the current round, wherein the dialogue content of the current round includes the current input information and the corresponding response information; When the importance score is greater than the preset improvement threshold, the dialogue content is saved to the short-term memory layer; When the importance score is less than or equal to the boost threshold and greater than or equal to the preset forget threshold, the dialogue content is retained in the working memory layer, wherein the boost threshold is greater than the forget threshold; When the importance score is less than the forgetting threshold, the dialogue content is removed from the working memory layer.
2. The intelligent dialogue method according to claim 1, characterized in that, Also includes: Retrieve the historical dialogues stored in the short-term memory layer that correspond to the current input information; Based on the matching results between the keywords in the current input information and the feature information of the historical dialogue, it is determined whether the citation condition is met; Based on the similarity between the current input information and the historical dialogue, determine whether the semantic association condition is met; Based on the comparison between the current input information and the unfinished dialogue tasks in the historical dialogue, determine whether the task continuation condition is met; Based on the contextual relationship between the current input information and the historical dialogue, determine whether the predictive retrieval conditions are met.
3. The intelligent dialogue method according to claim 1, characterized in that, The multidimensional features include semantic features, sentiment features, user features, information novelty features, and task-related features; The process of determining the corresponding importance score based on the dialogue content of the current round through multi-dimensional feature extraction includes: Semantic features are extracted from the dialogue content using a trained semantic understanding model. Based on the dialogue content, sentiment features are extracted using a trained sentiment analysis model. User characteristics are extracted based on the dialogue content using natural language understanding technology; The novelty features of the information are determined by cosine similarity based on the dialogue content and the historical information. Based on the dialogue content, task-related features are extracted through text analysis. The importance score is obtained based on the semantic features, the emotional features, the user features, the information novelty features, and the task association features, through a preset importance scoring relationship.
4. The intelligent dialogue method according to claim 3, characterized in that, The importance scoring relationship satisfies: ; Where A is the importance score, W S Let S be the weight coefficient of the semantic feature, and W be the semantic feature. E Let E be the weight coefficient of the emotional feature, and W be the emotional feature itself. U Let U be the weight coefficient of the user feature, and W be the user feature. I Let W be the weight coefficient of the information novelty feature, I be the information novelty feature, and W be the weight coefficient of the information novelty feature. T is the weight coefficient of the task-related feature, and T is the task-related feature.
5. The intelligent dialogue method according to claim 1, characterized in that, Also includes: Obtain the storage time and initial weight corresponding to the information stored in the working memory layer, the short-term memory layer, and the long-term memory layer; The storage time and the initial weight are used to determine the time decay score of the stored information through the time decay relationship; The stored information whose time decay score is less than a preset decay threshold is marked as forgotten information; The time decay score satisfies: ; Wherein, B is the time decay score, C is the initial weight corresponding to the stored information, λ is the preset decay coefficient, t is the storage time corresponding to the stored information, and e is a natural constant.
6. An intelligent dialogue device, characterized in that, The intelligent dialogue device is applied to an intelligent dialogue system, which includes a working memory layer, a short-term memory layer, and a long-term memory layer. The acquisition module is used to acquire the user's current input information; The judgment module is used to determine that the current input information meets the historical retrieval conditions when the current input information meets at least one of the preset reference conditions, semantic association conditions, task continuation conditions, and predictive retrieval conditions, and to extract the corresponding historical information from the short-term memory layer and the long-term memory layer. The splicing module is used to splice the current input information and the historical information through context to generate integrated information; The response module is used to generate response information based on the integrated information and the matched preset response template, and to store the current input information and the corresponding response information in the form of key-value pairs in the working memory layer; The integrated information includes current user intent, key entities, historical replies, and user preferences; the step of generating reply information based on the integrated information and a matched preset reply template includes: The preset reply template is determined based on the current user intent and the preset matching rules, wherein the matching rules include a one-to-one correspondence between the user intent and the preset reply template; An initial response template is generated by filling in the preset response template based on the key entities; Generate personalized replies based on the historical replies and the user preferences; The reply information is generated by semantic fusion based on the initial reply template and the personalized reply; Also includes: The importance score is determined by multidimensional feature extraction based on the dialogue content of the current round, wherein the dialogue content of the current round includes the current input information and the corresponding response information; When the importance score is greater than the preset improvement threshold, the dialogue content is saved to the short-term memory layer; When the importance score is less than or equal to the boost threshold and greater than or equal to the preset forget threshold, the dialogue content is retained in the working memory layer, wherein the boost threshold is greater than the forget threshold; When the importance score is less than the forgetting threshold, the dialogue content is removed from the working memory layer.
7. An electronic device, characterized in that, Including memory and processor; The memory is used to store computer programs; The processor is configured to implement the intelligent dialogue method as described in any one of claims 1 to 5 when executing the computer program.
8. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the intelligent dialogue method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Memory-driven question and answer optimization method and device, equipment and storage medium
CN119226436A
Intelligent dialogue system for time sequence memory management and task distribution
CN120086338A