Multi-round dialogue context memory intention correction and optimization method and system

By optimizing the context memory of a multi-turn dialogue system through joint semantic encoding and intent evolution relationship graph, the problems of intent recognition errors and inconsistent interactions in existing technologies are solved, and the dialogue system achieves high accuracy and consistency.

CN121542394AActive Publication Date: 2026-02-17BEIJING YIZHUANG INTELLIGENT CITY RES INST GRP CO LTD

Patent Information

Application Number
CN202610064396.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-19
Publication Date
2026-02-17
Estimated Expiration
2046-01-19

AI Technical Summary

Technical Problem

Existing multi-turn dialogue systems cannot dynamically adjust the importance of historical turns in their context memory mechanism design, leading to the introduction of irrelevant context noise or the omission of key information. Furthermore, they lack systematic intent evolution modeling, making it difficult to capture user intent transfer patterns, resulting in intent recognition errors and inconsistent interactions.

Method used

By jointly generating semantic vector representations of the fusion context through semantic encoding, constructing an intent evolution relationship graph, performing consistency verification on the initial intent recognition results, dynamically adjusting encoding weights, generating corrected intent recognition results, and optimizing the contextual understanding of the dialogue system.

Benefits of technology

It improves the accuracy of intent recognition and the coherence of interaction in multi-turn dialogues, can correct intent recognition biases in real time, optimize the system's contextual understanding capabilities, and maintain high accuracy and coherence in long dialogue interactions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121542394A_ABST
    Figure CN121542394A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of artificial intelligence dialogue systems, in particular to an intention correction and optimization method and system for multi-round dialogue context memory. According to the method, joint semantic coding is carried out on user input and historical dialogues, key semantic elements are extracted to construct an intention evolution relation graph, context consistency verification is carried out on an initial intention recognition result, and an intention correction candidate set is generated when conflicts are detected; and dynamically adjusting the context coding weight of the historical dialogue based on the corrected intention recognition result. According to the method, the intention recognition accuracy and context coherence in multiple rounds of conversations are effectively improved, and the semantic migration risk is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence dialogue system technology, and in particular to a method and system for intention correction and optimization based on multi-turn dialogue context memory. Background Technology

[0002] In the field of intelligent dialogue systems, multi-turn dialogue context memory and intent understanding are key technologies for improving the naturalness and accuracy of human-computer interaction. With the widespread adoption of applications such as intelligent assistants and customer service robots, the interaction between users and systems is becoming increasingly complex, making contextual dependence and intent coherence during dialogue more crucial. Traditional intent recognition methods primarily analyze single-turn dialogue content, failing to effectively handle complex linguistic phenomena such as cross-turn referential resolution, topic continuation, and intent shift.

[0003] In recent years, although deep learning-based dialogue systems have made some progress in intent recognition, many challenges remain in handling multi-turn dialogue contexts and dynamic intent evolution. Existing technologies typically employ simple context splicing or attention mechanisms to fuse historical information, lacking accurate capture of key semantic elements in the context and systematic modeling of intent evolution paths.

[0004] The main shortcomings and deficiencies of existing technologies include: Firstly, existing multi-turn dialogue systems generally use fixed weights to handle historical dialogue turns in their context memory mechanism design, failing to dynamically adjust the importance of different historical turns based on the current dialogue content. This leads to the introduction of irrelevant contextual noise or the omission of key historical information in complex dialogue scenarios. Secondly, traditional intent recognition methods lack a systematic intent evolution modeling mechanism, making it difficult to accurately capture the intent transfer patterns of users during multi-turn dialogues. This is especially true when user intent involves implicit transformations or partial inheritance, easily resulting in intent recognition errors or inconsistencies. Existing technologies lack effective error correction and adjustment mechanisms when intent recognition errors occur, failing to utilize semantic association information accumulated in historical dialogues to verify and adjust the current recognition result, leading to erroneous intent recognition. Figure 1 Once this happens, it will affect the accuracy and fluency of subsequent dialogue and interaction. Summary of the Invention

[0005] The present invention provides a method and system for intent correction and optimization of multi-turn dialogue context memory, which can solve the problems in the prior art.

[0006] A first aspect of the present invention provides a method for intent correction and optimization based on multi-turn dialogue context memory, comprising:

[0007] Joint semantic encoding is performed on the user input statement in the current dialogue round and the historical dialogue context sequence to generate a semantic vector representation of the fused context, and key semantic elements in the user input statement are extracted;

[0008] Based on the semantic correlation between the key semantic elements and the historical intent recognition results, an intent evolution relationship graph is constructed;

[0009] Based on the semantic vector representation of the fusion context, initial intent recognition is performed in a predefined intent space to obtain the initial intent recognition result;

[0010] The initial intent recognition result is checked for context consistency based on the intent evolution relationship graph. When a conflict is detected between the initial intent recognition result and the transition path in the intent evolution relationship graph, an intent correction candidate set is generated, and the corrected intent recognition result is obtained based on the intent correction candidate set.

[0011] The system response is generated based on the corrected intent recognition result, and the encoding weights of different historical rounds in the historical dialogue context sequence are dynamically adjusted according to the difference between the corrected intent recognition result and the initial intent recognition result.

[0012] Joint semantic encoding is performed on the user input statement in the current dialogue round and the historical dialogue context sequence to generate a semantic vector representation of the fused context, and key semantic elements in the user input statement are extracted, including:

[0013] Lexical analysis is performed on the user input statement to identify semantic units and syntactic dependency relationships between them, thereby obtaining a syntactic structure representation.

[0014] Semantic encoding is performed on each historical round in the historical dialogue context sequence to obtain the historical semantic vector corresponding to each historical round;

[0015] The importance weights of each semantic unit in the user input statement are determined based on the syntactic dependency relations, and key semantic elements are selected from the user input statement based on the importance weights.

[0016] Calculate the semantic similarity between the key semantic elements and each of the historical semantic vectors, and assign contextual association weights to each of the historical semantic vectors based on the semantic similarity.

[0017] The user input statement is semantically encoded to obtain the current semantic vector, and the current semantic vector is weighted and fused with each of the historical semantic vectors according to the context association weight to obtain the semantic vector representation of the fused context.

[0018] Based on the semantic correlation between the key semantic elements and the historical intent recognition results, an intent evolution relationship graph is constructed, including:

[0019] Extract key historical semantic elements corresponding to each historical round from the historical dialogue context sequence, and establish a mapping relationship between the key historical semantic elements and the historical intent recognition results;

[0020] Semantic matching is performed between the key semantic elements and each of the historical key semantic elements, and the semantic correlation degree between the key semantic elements and each of the historical key semantic elements is calculated;

[0021] Based on the semantic relevance, target historical key semantic elements associated with the key semantic elements are selected, and the target historical intent recognition result corresponding to the target historical key semantic elements is obtained through the mapping relationship;

[0022] Based on the temporal positional relationship between the target historical intent recognition result and the current dialogue round, an intent transfer path is determined, and the semantic difference features between the key semantic elements and the target historical key semantic elements are extracted as the transfer conditions of the intent transfer path;

[0023] The target historical intent recognition result is used as an intent node, and the intent evolution relationship graph is generated based on the intent transfer path and the transfer conditions.

[0024] Based on the temporal positional relationship between the target historical intent recognition result and the current dialogue round, an intent transfer path is determined, and semantic difference features between the key semantic elements and the target historical key semantic elements are extracted as transfer conditions for the intent transfer path, including:

[0025] Obtain the historical turn index of the target historical intent recognition result in the historical dialogue context sequence, and calculate the temporal interval distance between the historical turn index and the current dialogue turn index;

[0026] The historical intent recognition results of multiple targets are sorted in time according to the time interval distance, and directed connections are established between adjacent historical intent recognition results of targets in time order to form intent transfer paths;

[0027] For each directed connection in the intent transfer path, extract the corresponding key semantic elements of the preceding target history and the key semantic elements of the subsequent target history;

[0028] A semantic comparison is performed between the key semantic elements of the preceding target history and the key semantic elements of the subsequent target history to determine the semantic difference features between the key semantic elements of the preceding target history and the key semantic elements of the subsequent target history, and the semantic difference features are used as the transition conditions corresponding to the directed connection relationship.

[0029] Based on the semantic vector representation of the fusion context, initial intent recognition is performed in a predefined intent space to obtain the initial intent recognition result, including:

[0030] Calculate the vector distance between the semantic vector representation of the fusion context and the semantic vector of the intent corresponding to each predefined intent category in the predefined intent space;

[0031] Based on the vector distance, a set of candidate intent categories matching the semantic vector representation of the fusion context is determined;

[0032] For each candidate intent category in the candidate intent category set, extract the historical intent transition frequency related to each candidate intent category from the historical dialogue context sequence;

[0033] Based on the vector distance and the historical intent transfer frequency, a comprehensive matching score is calculated for each candidate intent category, wherein the historical intent transfer frequency is used to characterize the historical statistical pattern of transfer from the previous historical intent recognition result to each candidate intent category;

[0034] The candidate intent category with the highest comprehensive matching score is used as the initial intent recognition result.

[0035] Based on the intent evolution relationship graph, the initial intent recognition result is subjected to context consistency verification. When a conflict is detected between the initial intent recognition result and the transition path in the intent evolution relationship graph, an intent correction candidate set is generated. Based on the intent correction candidate set, a corrected intent recognition result is obtained, including:

[0036] Based on the historical dialogue context sequence, the preceding intent is determined, and in the intent evolution relationship graph, all intent transfer paths starting from the preceding intent are determined, along with the corresponding target intent node set and transfer conditions.

[0037] Determine whether the initial intent recognition result exists in the target intent node set. If the initial intent recognition result does not exist in the target intent node set, determine that the initial intent recognition result conflicts with the transition path in the intent evolution relationship graph.

[0038] For each target intent node in the target intent node set, the condition satisfaction degree between the key semantic element and the transition condition corresponding to each target intent node is calculated. Based on the condition satisfaction degree, the target intent node set is filtered to obtain an intent correction candidate set.

[0039] Calculate the semantic matching degree between the semantic vector representation of the fusion context and the semantic vector of the intent corresponding to each candidate intent in the intent correction candidate set, and combine the condition satisfaction degree with the semantic matching degree to calculate the corrected intent recognition result from each candidate intent.

[0040] For each target intent node in the target intent node set, the condition satisfaction degree between the key semantic element and the transition condition corresponding to each target intent node is calculated. Based on the condition satisfaction degree, the target intent node set is filtered to obtain an intent correction candidate set, including:

[0041] Syntactic analysis is performed on the transition conditions corresponding to each target intent node to identify the semantic component boundaries and the dependency relationships between the semantic components in the transition conditions;

[0042] Based on the dependency relationship, the semantic core component of the transfer condition and the semantic limiting component that has a modification relationship with the semantic core component are determined, and the semantic core component and the semantic limiting component are regarded as necessary semantic components;

[0043] For each of the necessary semantic components, the semantic type of each necessary semantic component is determined based on the syntactic role of the necessary semantic component in the transition condition and the lexical semantic features of the necessary semantic component.

[0044] Extract matching semantic elements from the key semantic elements that match the semantic type of each necessary semantic component;

[0045] Based on the semantic similarity between each of the matching semantic elements and the corresponding necessary semantic components, the coverage rate of semantic components that satisfy the transfer conditions in the key semantic elements is counted as the condition satisfaction rate of the target intent node corresponding to the transfer conditions.

[0046] Target intent nodes whose condition satisfaction exceeds a preset threshold are selected from the target intent node set to form an intent correction candidate set.

[0047] A second aspect of the present invention provides an intent correction and optimization system for multi-turn dialogue context memory, comprising:

[0048] The first unit is used to perform joint semantic encoding on the user input statement in the current dialogue round and the historical dialogue context sequence, generate a semantic vector representation of the fused context, and extract key semantic elements from the user input statement;

[0049] The second unit is used to construct an intent evolution relationship graph based on the semantic correlation between the key semantic elements and the historical intent recognition results;

[0050] The third unit is used to perform initial intent recognition in a predefined intent space based on the semantic vector representation of the fusion context, and obtain the initial intent recognition result;

[0051] The fourth unit is used to perform context consistency verification on the initial intent recognition result based on the intent evolution relationship graph. When a conflict is detected between the initial intent recognition result and the transition path in the intent evolution relationship graph, an intent correction candidate set is generated, and a corrected intent recognition result is obtained based on the intent correction candidate set.

[0052] The fifth unit is used to generate a system response based on the corrected intent recognition result, and dynamically adjust the encoding weights of different historical rounds in the historical dialogue context sequence according to the difference between the corrected intent recognition result and the initial intent recognition result.

[0053] A third aspect of the present invention provides an electronic device, comprising:

[0054] processor;

[0055] Memory used to store processor-executable instructions;

[0056] The processor is configured to invoke instructions stored in the memory to execute the aforementioned method.

[0057] A fourth aspect of the present invention provides a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, implement the aforementioned method.

[0058] This invention achieves a grasp of the complete context of the dialogue and improves the accuracy of intent recognition by jointly semantically encoding the current user input and the historical dialogue context to generate a semantic vector representation of the fused context.

[0059] This invention constructs an intent evolution relationship graph based on extracted key semantic elements, enabling the understanding and prediction of coherent transition paths of dialogue intent and effectively capturing the intent evolution patterns in multi-turn dialogues.

[0060] This invention uses an intent evolution relationship graph to perform contextual consistency verification on the initial intent recognition results, promptly detects and corrects intent recognition errors that do not conform to the dialogue logic, and significantly improves the accuracy of intent recognition in multi-turn dialogues.

[0061] This invention dynamically adjusts the encoding weight of historical dialogue context based on the difference between the intention correction result and the initial recognition result, thereby achieving adaptive evaluation of the importance of historical information, optimizing the memory mechanism of context information, and improving the contextual understanding ability and interactive coherence of the dialogue system.

[0062] This invention constructs a complete intent correction closed-loop optimization mechanism, which can not only correct intent recognition deviations in real time, but also continuously optimize the system's context understanding ability through dynamic weight adjustment, enabling the dialogue system to maintain high accuracy and coherence in long dialogue interactions. Attached Figure Description

[0063] Figure 1 This is a flowchart illustrating the intent correction and optimization method for multi-turn dialogue context memory according to an embodiment of the present invention.

[0064] Figure 2 This is a schematic diagram of the process for determining the initial intent recognition result according to an embodiment of the present invention. Detailed Implementation

[0065] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0066] The technical solution of the present invention will be described in detail below with reference to specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.

[0067] Figure 1 This is a flowchart illustrating the intent correction and optimization method for multi-turn dialogue context memory according to an embodiment of the present invention. Figure 1 As shown, the method includes:

[0068] Joint semantic encoding is performed on the user input statement in the current dialogue round and the historical dialogue context sequence to generate a semantic vector representation of the fused context, and key semantic elements in the user input statement are extracted;

[0069] Based on the semantic correlation between the key semantic elements and the historical intent recognition results, an intent evolution relationship graph is constructed;

[0070] Based on the semantic vector representation of the fusion context, initial intent recognition is performed in a predefined intent space to obtain the initial intent recognition result;

[0071] The initial intent recognition result is checked for context consistency based on the intent evolution relationship graph. When a conflict is detected between the initial intent recognition result and the transition path in the intent evolution relationship graph, an intent correction candidate set is generated, and the corrected intent recognition result is obtained based on the intent correction candidate set.

[0072] The system response is generated based on the corrected intent recognition result, and the encoding weights of different historical rounds in the historical dialogue context sequence are dynamically adjusted according to the difference between the corrected intent recognition result and the initial intent recognition result.

[0073] In one optional implementation, joint semantic encoding is performed on the user input statement of the current dialogue turn and the historical dialogue context sequence to generate a semantic vector representation of the fused context, and key semantic elements in the user input statement are extracted, including:

[0074] Lexical analysis is performed on the user input statement to identify semantic units and syntactic dependency relationships between them, thereby obtaining a syntactic structure representation.

[0075] Semantic encoding is performed on each historical round in the historical dialogue context sequence to obtain the historical semantic vector corresponding to each historical round;

[0076] The importance weights of each semantic unit in the user input statement are determined based on the syntactic dependency relations, and key semantic elements are selected from the user input statement based on the importance weights.

[0077] Calculate the semantic similarity between the key semantic elements and each of the historical semantic vectors, and assign contextual association weights to each of the historical semantic vectors based on the semantic similarity.

[0078] The user input statement is semantically encoded to obtain the current semantic vector, and the current semantic vector is weighted and fused with each of the historical semantic vectors according to the context association weight to obtain the semantic vector representation of the fused context.

[0079] In this embodiment, to address the problem of contextual semantic understanding in dialogue systems, a semantic vector representation of the fused context is generated by jointly semantically encoding the user input statement and the historical dialogue context, and key semantic elements in the user input statement are extracted, thereby improving the dialogue system's ability to understand user intent.

[0080] First, lexical analysis is performed on the user input to identify semantic units and their syntactic dependencies. Specifically, natural language processing techniques are used to segment, tag, and perform dependency parsing on the user input text. For example, for the user input "I want to check the weather in Beijing tomorrow," word segmentation yields lexical units such as "I," "want," "check," "tomorrow," "Beijing," "of," "weather," and "condition." Dependency parsing identifies "check" as the core predicate, "I" as the subject, "weather" and "condition" as objects, and "tomorrow" and "Beijing" as time and location modifiers, respectively. This process outputs a syntactic structure representation, providing a foundation for subsequent semantic analysis.

[0081] Next, semantic encoding is performed on each historical round in the historical dialogue context sequence. For each round of historical dialogue, including user input and system response, a pre-trained language model is used for encoding to obtain the corresponding vector representation. For example, models such as BERT are used to map the historical dialogue text to a high-dimensional semantic space, with each round of dialogue forming a vector of fixed dimensions. Assuming that the historical dialogue contains three rounds, three historical semantic vectors H1, H2, and H3 are obtained, which capture the semantic information of the historical dialogue.

[0082] Subsequently, the importance weights of each semantic unit in the user input are determined based on syntactic dependency relations. Different weights are assigned to different semantic units based on the results of syntactic analysis; for example, core predicates and key nouns typically have higher weights, while function words and auxiliary words have lower weights. In the example above, words like "query," "weather," "Beijing," and "tomorrow" have higher weights, while words like "of" and "situation" have lower weights. Based on these importance weights, key semantic elements are filtered from the user input; for example, "query," "weather," "Beijing," and "tomorrow" constitute the core semantic element set of this user query.

[0083] Next, the semantic similarity between key semantic elements and each historical semantic vector is calculated. The selected key semantic elements are vectorized, and then cosine similarity or dot product similarity is calculated with each historical semantic vector to obtain a similarity score. For example, if the semantic elements of the current weather query have a high similarity with the second round of historical dialogue (which also involves weather queries), then that historical round will receive a higher association weight. Based on the calculated semantic similarity, contextual association weights are assigned to each historical semantic vector. These weights reflect the relevance of the historical dialogue content to the current user input.

[0084] Finally, the user input is semantically encoded to obtain the current semantic vector C. This current semantic vector is then fused with the weighted historical semantic vectors. The fusion process uses a weighted summation method: let the semantic vector of the i-th round of historical dialogue be Hᵢ, and its corresponding contextual weight be wᵢ. Then, the fused semantic vector representation F can be expressed as F = C + Σ(wᵢ × Hᵢ). This fusion method ensures that the semantic information of the current user input is preserved, while appropriately introducing historical contextual information related to the current semantics, making the final semantic representation more complete and accurate.

[0085] In practical applications, when a user asks "What will the weather be like in Beijing tomorrow?" and "What about the day after tomorrow?" in succession, the above method can be used to identify that the location information "Beijing" and the query object "weather" omitted in the second sentence both come from the previous round of dialogue. This information is then integrated into the semantic representation to correctly understand the user's intention as "to check the weather in Beijing the day after tomorrow", rather than simply "to check the information for the day after tomorrow".

[0086] Through the aforementioned joint semantic encoding method, the dialogue system can more accurately understand dialogue input containing linguistic phenomena such as ellipsis and pronoun reference, improve semantic understanding in multi-turn dialogues, and provide a more accurate semantic basis for subsequent dialogue response generation.

[0087] In one optional implementation, an intent evolution relationship graph is constructed based on the semantic correlation between the key semantic elements and the historical intent recognition results, including:

[0088] Extract key historical semantic elements corresponding to each historical round from the historical dialogue context sequence, and establish a mapping relationship between the key historical semantic elements and the historical intent recognition results;

[0089] Semantic matching is performed between the key semantic elements and each of the historical key semantic elements, and the semantic correlation degree between the key semantic elements and each of the historical key semantic elements is calculated;

[0090] Based on the semantic relevance, target historical key semantic elements associated with the key semantic elements are selected, and the target historical intent recognition result corresponding to the target historical key semantic elements is obtained through the mapping relationship;

[0091] Based on the temporal positional relationship between the target historical intent recognition result and the current dialogue round, an intent transfer path is determined, and the semantic difference features between the key semantic elements and the target historical key semantic elements are extracted as the transfer conditions of the intent transfer path;

[0092] The target historical intent recognition result is used as an intent node, and the intent evolution relationship graph is generated based on the intent transfer path and the transfer conditions.

[0093] In dialogue systems, to accurately understand a user's current intent, it is necessary not only to analyze the current utterance but also to consider the evolutionary relationships of historical dialogues. This implementation method can effectively solve the problem of intent coherence recognition in dialogue systems.

[0094] First, key semantic elements corresponding to each round are extracted from the historical dialogue context sequence, and a mapping relationship is established between these semantic elements and the historical intent recognition results. For each round in the historical dialogue, semantic analysis techniques are used to extract semantic units such as entity words, key verbs, and modifiers from the user's utterance, and these semantic units are combined to form a set of key semantic elements. For example, when a user expresses "I want to know about tourist attractions in Beijing" in a tourism scenario, "Beijing" can be extracted as the location entity, "know" as the intent verb, and "tourist attractions" as the target entity, thus constituting a set of key semantic elements. Subsequently, an intent classification model is used to identify the intent of each round of historical dialogue, and a mapping relationship is established between the identification results and the corresponding key semantic elements, stored in a semantic-intent mapping table, forming structured data of {historical key semantic elements} → {historical intent}.

[0095] Next, semantic matching is performed on the key semantic elements extracted in the current dialogue turn and each historical key semantic element to calculate their semantic relevance. The calculation method includes two steps: vectorization and similarity calculation. First, a pre-trained language model is used to convert the key semantic elements into semantic vector representations. Then, cosine similarity and other metrics are used to calculate the semantic relevance between the current key semantic elements and each historical key semantic element. Specifically, let the vector representation of the current key semantic element be V_current, and the vector representation of a certain historical key semantic element be V_history. The semantic relevance between them can be calculated using the cosine similarity of the two vectors. Furthermore, a context-weighted mechanism can be introduced to dynamically adjust the semantic relevance based on the time distance between historical dialogue turns and the current turn, reflecting the greater influence of recent dialogues on the current intent.

[0096] Based on the calculated semantic relevance, a threshold is set to filter out target historical key semantic elements that are highly related to the current key semantic elements. If the semantic relevance between a historical key semantic element and the current element exceeds a preset threshold (e.g., 0.75), it is included in the target set. Through the aforementioned mapping relationship, the target historical intent recognition results corresponding to these target historical key semantic elements can be obtained, serving as potential sources of association for the current intent.

[0097] Subsequently, based on the temporal relationship between the target historical intent identification results and the current dialogue round, the intent transfer path is determined. First, the selected target historical intents are sorted chronologically to construct a preliminary intent transfer sequence. For changes in intent between adjacent rounds, the transfer patterns are analyzed, including intent continuation (the same intent remains unchanged across different rounds), intent refinement (shifting from a general intent to a more specific intent), and intent transformation (a shift between completely different intents). Simultaneously, semantic difference features between the current key semantic elements and the target historical key semantic elements are extracted as transfer conditions for the intent transfer path. Semantic difference features are mainly obtained by comparing changes in entities, relationships, and attributes, such as the location entity changing from "Beijing" to "Shanghai," or the query object changing from "tourist attractions" to "food recommendations." These semantic difference features directly reflect the triggering factors for user intent transformation.

[0098] Finally, the target historical intent recognition results are used as intent nodes. Based on the previously determined intent transfer paths and conditions, an intent evolution relationship graph is generated. Specifically, a directed graph structure is used, where nodes represent individual intents, edges represent transfer relationships between intents, and attributes on the edges label the transfer conditions. During graph construction, frequently occurring intent transfer patterns can be assigned higher weights, indicating higher reliability of the transfer path. Furthermore, based on the time interval between the current dialogue round and previous rounds, a decay mechanism can be set for the connections between intent nodes to reflect the impact of time on the strength of intent association.

[0099] In practical applications, taking the intelligent customer service scenario as an example, when a user shifts from inquiring about the "mobile order status" to asking about the "refund policy", the system can capture this shift through the intent evolution relationship graph and identify that the triggering condition is the user's refund request after learning that the "order was delayed in shipping". This allows the system to accurately understand the user's current intent and provide the corresponding refund policy information.

[0100] By constructing an intent evolution relationship graph, the dialogue system can more comprehensively grasp the evolution of user intent, improve the accuracy of intent understanding in multi-turn dialogues, and provide users with a more coherent and natural interactive experience.

[0101] In one optional implementation, based on the temporal positional relationship between the target historical intent recognition result and the current dialogue turn, an intent transfer path is determined, and semantic difference features between the key semantic elements and the target historical key semantic elements are extracted as transfer conditions for the intent transfer path, including:

[0102] Obtain the historical turn index of the target historical intent recognition result in the historical dialogue context sequence, and calculate the temporal interval distance between the historical turn index and the current dialogue turn index;

[0103] The historical intent recognition results of multiple targets are sorted in time according to the time interval distance, and directed connections are established between adjacent historical intent recognition results of targets in time order to form intent transfer paths;

[0104] For each directed connection in the intent transfer path, extract the corresponding key semantic elements of the preceding target history and the key semantic elements of the subsequent target history;

[0105] A semantic comparison is performed between the key semantic elements of the preceding target history and the key semantic elements of the subsequent target history to determine the semantic difference features between the key semantic elements of the preceding target history and the key semantic elements of the subsequent target history, and the semantic difference features are used as the transition conditions corresponding to the directed connection relationship.

[0106] In multi-turn dialogue systems, a user's intent shifts as the dialogue progresses. To accurately understand the transition path of user intent and predict intent changes, we first obtain the historical turn index of the target historical intent recognition result in the historical dialogue context sequence, and then calculate the temporal interval distance between this historical turn index and the current dialogue turn index. Assume the historical dialogue context sequence contains multiple turns, each with a corresponding turn index. For example, the historical dialogue contains 5 turns with turn indices 1, 2, 3, 4, and 5, and the current dialogue turn index is 6. By searching, we find the target historical intent in turns 2 and 4, so the historical turn indices for these two target historical intents are 2 and 4, respectively. Calculating their temporal interval distances with the current turn yields distances of 4 and 2, respectively.

[0107] Based on the temporal interval distance, the historical intent recognition results of multiple targets are sorted chronologically, and directed connections are established between adjacent historical intent recognition results to form intent transfer paths. Continuing the example above, the intent "check the weather" in round 2 and the intent "traffic information" in round 4 are sorted chronologically to form a directed connection from "check the weather" to "traffic information". If the intent "restaurant reservation" is also found in round 3, the complete intent transfer path is: check the weather → restaurant reservation → traffic information.

[0108] For each directed connection in the intent transfer path, extract the corresponding preceding target historical key semantic elements and subsequent target historical key semantic elements. For example, in the connection relationship of querying weather → restaurant reservation, the preceding key semantic elements are {location=Beijing, time=tomorrow}, and the subsequent key semantic elements are {restaurant type=Western restaurant, location=Beijing, number of people=two}.

[0109] A semantic comparison is performed between the key semantic elements of the preceding target's history and the key semantic elements of the subsequent target's history to determine the semantic differences between them. These differences are then used as the transition conditions for directed connections. In the example above, the comparison reveals that the "location" element remains unchanged, while the "restaurant type" and "number of people" elements are added. Simultaneously, the intent shifts from "checking the weather" to "restaurant reservations." This semantic difference indicates that after confirming the weather at the destination, the user further inquires about restaurant availability at that location. The intent transition condition can be described as "retaining location information and adding dining needs information."

[0110] In practical applications, semantic difference features can be extracted in a variety of ways. One method is to use a semantic matching model to calculate the similarity between key semantic elements before and after. If the semantic similarity of some elements is higher than a preset threshold, these elements are considered to be consistent. If some elements exist in the preceding sequence but not in the following sequence, these elements are considered to be discarded. If some elements do not exist in the preceding sequence but appear in the following sequence, these elements are considered to be newly added.

[0111] Another approach is to use semantic slot filling technology, which represents key semantic elements as a series of slots and their corresponding values. Semantic differences are determined by comparing changes in the slot values ​​before and after. For example, in the intent shift from "booking a flight" to "searching for a hotel", slot values ​​such as {destination=Paris, date=next Friday} are retained, while slot values ​​such as {hotel star rating=five-star, price range=medium} are added, and slot values ​​such as {departure city=Beijing, flight class=economy class} are discarded.

[0112] Intent transfer paths and their conditions can be applied to tasks such as dialogue state tracking and next-round intent prediction. For example, when semantic differences matching historical transfer conditions are detected in the current dialogue, the user's intent can be predicted to transfer accordingly. This is of great value for preparing relevant information resources in advance and optimizing dialogue response strategies.

[0113] Through the above methods, we can not only identify the user's intent shift path during the dialogue process, but also capture the semantic conditions that lead to intent shifts. This enables the dialogue system to more intelligently understand and predict changes in user intent, providing a more coherent and personalized dialogue experience.

[0114] In one optional implementation, initial intent recognition is performed in a predefined intent space based on the semantic vector representation of the fusion context to obtain an initial intent recognition result, including:

[0115] Calculate the vector distance between the semantic vector representation of the fusion context and the semantic vector of the intent corresponding to each predefined intent category in the predefined intent space;

[0116] Based on the vector distance, a set of candidate intent categories matching the semantic vector representation of the fusion context is determined;

[0117] For each candidate intent category in the candidate intent category set, extract the historical intent transition frequency related to each candidate intent category from the historical dialogue context sequence;

[0118] Based on the vector distance and the historical intent transfer frequency, a comprehensive matching score is calculated for each candidate intent category, wherein the historical intent transfer frequency is used to characterize the historical statistical pattern of transfer from the previous historical intent recognition result to each candidate intent category;

[0119] The candidate intent category with the highest comprehensive matching score is used as the initial intent recognition result.

[0120] Figure 2 This is a schematic diagram illustrating the process of determining the initial intent recognition result according to an embodiment of the present invention. Figure 2 As shown, firstly, the vector distance between the semantic vector representation of the fusion context and the semantic vectors corresponding to each predefined intent category in the predefined intent space is calculated. In a specific implementation, a cosine similarity calculation method can be used. The vector distance Distance_i between the semantic vector representation V_context of the fusion context and the semantic vector V_intent_i corresponding to the i-th predefined intent category in the predefined intent space is calculated as follows: divide the inner product of the two vectors by the product of their magnitudes, and then subtract the obtained similarity from 1 to get the vector distance. The smaller the vector distance, the higher the semantic similarity, meaning a higher degree of matching between the fusion context and the intent category.

[0121] Next, a set of candidate intent categories matching the semantic vector representation of the fusion context is determined based on the vector distance. A vector distance threshold can be set; when the vector distance between a predefined intent category and the semantic vector representation of the fusion context is less than the threshold, the intent category is added to the candidate intent category set. To improve recognition efficiency, the top N predefined intent categories with the smallest vector distance can also be selected as the candidate intent category set, where N is a preset positive integer, such as 5 or 10.

[0122] Subsequently, for each candidate intent category in the candidate intent category set, the historical intent transition frequency related to each candidate intent category is extracted from the historical dialogue context sequence. The historical intent transition frequency reflects the regularity of intent transformation in the dialogue system, that is, the probability of transitioning from one intent category to another. In specific implementation, an intent transition matrix M can be maintained, where the element M[i][j] represents the number of times intent category i transitions to intent category j. For the previous historical intent recognition result of the current dialogue, intent_prev, for each candidate intent category intent_cand in the candidate intent category set, the corresponding historical intent transition frequency M[intent_prev][intent_cand] is extracted from the matrix M.

[0123] Subsequently, based on the vector distance and the historical intent transfer frequency, a comprehensive matching score is calculated for each candidate intent category. The comprehensive matching score considers both semantic similarity and historical intent transfer patterns, and can be calculated using a weighted combination. For each candidate intent category `intent_cand` in the candidate intent category set, its comprehensive matching score `Score_cand` can be calculated as follows: the sum of the inverse of the vector distance (representing semantic similarity) multiplied by the weight `alpha` and the historical intent transfer frequency multiplied by the weight `beta` is used as the comprehensive matching score. Here, `alpha` and `beta` are preset weight parameters that satisfy `alpha + beta = 1`, and the values ​​of these two parameters can be adjusted according to specific application scenarios.

[0124] Finally, the candidate intent category with the highest comprehensive matching score is selected as the initial intent recognition result. By comparing the comprehensive matching scores of each candidate intent category in the candidate intent category set, the intent category with the highest score is selected as the initial intent recognition result. If multiple candidate intent categories have the same and highest comprehensive matching score, the one with the smallest vector distance can be selected as the initial intent recognition result.

[0125] For example, suppose a smart customer service system has a predefined intent space containing multiple intent categories such as querying bills, handling business, and making complaints and suggestions. When a user enters "I want to see my spending records for the past month," this sentence is first fused with the historical dialogue context to obtain a semantic vector representation of the fused context. Then, the vector distance between this semantic vector representation and the semantic vectors of the intents of each predefined intent category is calculated. It is found that the vector distance with the intent categories of querying bills, account details, and spending is relatively small, so these three intent categories are added to the candidate intent category set.

[0126] Next, the historical intent transition frequencies related to these three candidate intent categories are extracted from the historical dialogue context sequence. Assuming the user's preceding historical intent identification result is account login, according to the intent transition matrix, the historical intent transition frequency from account login to bill query is 15 times, the transition frequency to account details is 8 times, and the transition frequency to consumption query is 12 times.

[0127] Then, calculate the overall matching score for these three candidate intent categories. Assuming alpha=0.7 and beta=0.3, the vector distance for querying bills is 0.2, and the overall matching score is 0.7×(1 / 0.2)+0.3×15=3.5+4.5=8.0; the vector distance for account details is 0.25, and the overall matching score is 0.7×(1 / 0.25)+0.3×8=2.8+2.4=5.2; the vector distance for consumption query is 0.22, and the overall matching score is 0.7×(1 / 0.22)+0.3×12=3.18+3.6=6.78.

[0128] Finally, the query bill with the highest overall matching score is used as the initial intent recognition result, which enables us to accurately understand the user's intent and provide corresponding services.

[0129] In one optional implementation, the initial intent recognition result is subjected to contextual consistency verification based on the intent evolution relationship graph. When a conflict is detected between the initial intent recognition result and the transition path in the intent evolution relationship graph, an intent correction candidate set is generated. A corrected intent recognition result is obtained based on the intent correction candidate set, including:

[0130] Based on the historical dialogue context sequence, the preceding intent is determined, and in the intent evolution relationship graph, all intent transfer paths starting from the preceding intent are determined, along with the corresponding target intent node set and transfer conditions.

[0131] Determine whether the initial intent recognition result exists in the target intent node set. If the initial intent recognition result does not exist in the target intent node set, determine that the initial intent recognition result conflicts with the transition path in the intent evolution relationship graph.

[0132] For each target intent node in the target intent node set, the condition satisfaction degree between the key semantic element and the transition condition corresponding to each target intent node is calculated. Based on the condition satisfaction degree, the target intent node set is filtered to obtain an intent correction candidate set.

[0133] Calculate the semantic matching degree between the semantic vector representation of the fusion context and the semantic vector of the intent corresponding to each candidate intent in the intent correction candidate set, and combine the condition satisfaction degree with the semantic matching degree to calculate the corrected intent recognition result from each candidate intent.

[0134] First, the preceding intent is determined based on the historical dialogue context sequence. In a dialogue system, when a new user input is received, it is necessary to review the historical dialogue rounds and extract the intent identified in the most recent round or multiple rounds as the preceding intent. For example, in a flight booking scenario, if the user has just completed the intent to search for flights in a previous dialogue, then the current preceding intent is to search for flights. In practice, a dialogue state manager can be maintained to record the intent recognition results of each round of dialogue and extract the intent sequence of the previous N rounds when needed.

[0135] After determining the preceding intent, all possible intent transition paths are identified based on the intent evolution relationship graph. This graph is a directed graph structure where nodes represent intent types, edges represent transition relationships between intents, and each edge is labeled with a transition condition. Starting with the preceding intent as the node, all edges originating from that node are traversed to collect all reachable target intent nodes and their corresponding transition conditions, forming a set of target intent nodes. For example, starting with the intent to query flights, subsequent intents include booking tickets, querying ticket prices, and querying flight status; each transition has specific semantic conditions.

[0136] Next, it is determined whether the initial intent recognition result exists in the target intent node set. The initial intent recognition result refers to the intent result obtained by analyzing the current user input through the basic intent recognition model. If the result is not in the target intent node set, it is considered that the current recognition result conflicts with the transition path in the intent evolution relationship graph and needs to be corrected. For example, if the initial recognition result is to cancel a hotel reservation, but the reachable intent set starting from the flight query intent does not include canceled hotels, then a conflict is determined to exist.

[0137] For each target intent node in the target intent node set, the condition satisfaction degree between key semantic elements and transition conditions is calculated. Key semantic elements are core semantic information extracted from the current user input, including elements such as entities, attributes, and actions. Transition conditions are predefined semantic rules that describe the semantic features required to trigger a specific intent transition. The condition satisfaction degree can be calculated using rule-based matching methods or semantic similarity-based methods. For example, if the transition conditions require the inclusion of keywords such as "reservation" or "ticket booking" and the entity "flight number," then the user input is checked for the presence of these elements, and the matching degree is calculated.

[0138] The set of target intent nodes is filtered based on condition satisfaction to generate a candidate set for intent correction. A condition satisfaction threshold can be set to retain only target intents with satisfaction scores higher than the threshold as correction candidates. Alternatively, the top K intents with the highest condition satisfaction scores can be selected as the candidate set. For example, if the condition satisfaction scores for booking a flight and querying flight prices are 0.85 and 0.72 respectively, and the threshold is set to 0.7, both will be included in the correction candidate set.

[0139] The semantic matching degree is calculated between the semantic vector representation of the fused context and the semantic vectors of the intents corresponding to each candidate intent in the intent correction candidate set. The fused context refers to the context representation formed by fusing the current user input with the historical dialogue context, which can be converted from text to vector representation through a pre-trained language model. Each intent also has a corresponding semantic vector representation, which can be obtained by vectorizing the intent description text or learning based on training samples. The semantic matching degree can be obtained by calculating the cosine similarity or dot product between vectors. For example, the similarity between the vector obtained by fusing the user input "I want to book a flight tomorrow" with the historical context and the intent vector for booking a flight is calculated.

[0140] Finally, the corrected intent recognition result is determined by combining the condition satisfaction score and semantic matching score. A weighted fusion method can be used, such as linear weighting: Final Score = α × Condition Satisfaction Score + (1-α) × Semantic Matching Score, where α is the weight coefficient. The candidate intent with the highest final score is selected as the corrected result. For example, if the condition satisfaction score of "book a flight" is 0.85, the semantic matching score is 0.92, and α is 0.5, then its final score is 0.885; if this score is higher than other candidate intents, then "book a flight" is determined as the corrected intent recognition result.

[0141] By introducing constraints on intent evolution relationships into the dialogue system, as described above, the accuracy of intent recognition can be effectively improved, especially when handling complex multi-turn dialogues. This reduces intent recognition errors and enhances the user experience. At the same time, this method maintains sufficient flexibility to adapt to the needs of dialogue scenarios in different domains.

[0142] In one optional implementation, for each target intent node in the target intent node set, the condition satisfaction degree between the key semantic element and the transition condition corresponding to each target intent node is calculated. The target intent node set is then filtered based on the condition satisfaction degree to obtain an intent correction candidate set, including:

[0143] Syntactic analysis is performed on the transition conditions corresponding to each target intent node to identify the semantic component boundaries and the dependency relationships between the semantic components in the transition conditions;

[0144] Based on the dependency relationship, the semantic core component of the transfer condition and the semantic limiting component that has a modification relationship with the semantic core component are determined, and the semantic core component and the semantic limiting component are regarded as necessary semantic components;

[0145] For each of the necessary semantic components, the semantic type of each necessary semantic component is determined based on the syntactic role of the necessary semantic component in the transition condition and the lexical semantic features of the necessary semantic component.

[0146] Extract matching semantic elements from the key semantic elements that match the semantic type of each necessary semantic component;

[0147] Based on the semantic similarity between each of the matching semantic elements and the corresponding necessary semantic components, the coverage rate of semantic components that satisfy the transfer conditions in the key semantic elements is counted as the condition satisfaction rate of the target intent node corresponding to the transfer conditions.

[0148] Target intent nodes whose condition satisfaction exceeds a preset threshold are selected from the target intent node set to form an intent correction candidate set.

[0149] First, syntactic analysis is performed on the transition conditions corresponding to each target intent node to identify the semantic component boundaries and dependency relationships between them. Specifically, syntactic analysis tools are used to parse the transition condition text and construct a syntactic dependency tree. For example, for the transition condition "I want to book a plane ticket for tomorrow", syntactic analysis yields a subject-verb-object structure, where "I" is the subject, "want to book" is the verb, and "tomorrow's plane ticket" is the object, with "tomorrow's" modifying "plane ticket".

[0150] Next, based on dependency relationships, the semantic core components of the transfer condition and the semantic limiting components that modify the semantic core components are determined. These semantic core components and semantic limiting components are then considered necessary semantic components. Specifically, the semantic core components are usually predicate verbs or head nouns in the syntactic structure, such as "book" and "ticket" in the example above; the semantic limiting components are those that modify the semantic core components, such as "tomorrow's" modifying "ticket". These necessary semantic components constitute the core semantic framework of the transfer condition.

[0151] Then, for each necessary semantic component, its semantic type is determined based on its syntactic role in the transfer condition and its lexical semantic features. Specifically, a semantic type label is assigned to each necessary semantic component based on part-of-speech tagging and a lexical semantic knowledge base. For example, "booking" is labeled as "behavior_booking", "ticket" as "item_ticketing", and "tomorrow" as "time_specific date". These semantic type labels are helpful for subsequent semantic matching.

[0152] The process involves extracting matching semantic elements from the key semantic elements that correspond to the semantic types of each necessary semantic component. Specifically, it involves traversing the set of key semantic elements, identifying the semantic type of each semantic element, and matching it with the semantic types of the necessary semantic components. For example, if the key semantic element input by the user includes "order," and its semantic type is "behavior_reservation," then it can be matched with "reservation" in the transition condition (which also has the semantic type "behavior_reservation").

[0153] Based on the semantic similarity between each matched semantic element and its corresponding necessary semantic component, the coverage rate of semantic components satisfying the transfer conditions in the key semantic elements is used as the condition satisfaction rate of the target intent node corresponding to the transfer conditions. Specifically, a word vector model can be used to calculate semantic similarity, such as using the cosine similarity method: for each pair of matched semantic elements and necessary semantic components, the cosine similarity between their word vector representations is calculated. When the similarity exceeds a preset threshold (e.g., 0.8), the match is considered valid. The semantic component coverage rate is calculated as follows: the number of validly matched necessary semantic components divided by the total number of necessary semantic components in the transfer conditions.

[0154] Target intent nodes whose condition satisfaction exceeds a preset threshold are selected from the target intent node set to form an intent correction candidate set. Specifically, a condition satisfaction threshold (e.g., 0.7) is set, and target intent nodes with a condition satisfaction greater than or equal to this threshold are included in the intent correction candidate set. This ensures that the intent nodes in the candidate set have a high degree of matching with the key semantic elements of the user input.

[0155] The above process is illustrated with a specific example: Assume that there are two intent nodes in the dialogue system: "book a flight" and "check flight prices". Their transition conditions are "book a flight to a certain destination" and "check flight prices to a certain destination", respectively. When the user enters "I want to know how many flights are to Beijing tomorrow", the key semantic elements are first extracted: "know", "tomorrow", "to Beijing", "flight", and "how much".

[0156] Syntactic analysis is performed on the transition conditions of the two intent nodes to determine the necessary semantic components and semantic types: "booking" (behavior_booking), "ticket" (item_ticketing), "location" (location_destination); "query" (behavior_query), "ticket" (item_ticketing), "price" (attribute_price), "location" (location_destination).

[0157] Extract matching semantic elements from key semantic elements: "know" (behavior_query), "flight" (item_ticket), "to Beijing" (location_destination), "how much" (attribute_price), "tomorrow" (time_specific date).

[0158] The condition satisfaction score is calculated as follows: The condition satisfaction score of the intent node "Book a flight" is 0.67 (matches the two components "flight" and "location", but does not match "book"); the condition satisfaction score of the intent node "Query flight price" is 1.0 (completely matches all necessary semantic components).

[0159] Because the condition satisfaction rate of the intent node "check flight prices" exceeds the preset threshold of 0.7, it is included in the intent correction candidate set. Ultimately, the user's current intent will be corrected to "check flight prices," and the dialogue interaction will continue based on this.

[0160] The above technical solutions can accurately identify changes in user intent, improve the understanding accuracy and interaction fluency of the dialogue system, and respond more intelligently to changes in user needs.

[0161] The intent correction and optimization system for multi-turn dialogue context memory according to embodiments of the present invention includes:

[0162] The first unit is used to perform joint semantic encoding on the user input statement in the current dialogue round and the historical dialogue context sequence, generate a semantic vector representation of the fused context, and extract key semantic elements from the user input statement;

[0163] The second unit is used to construct an intent evolution relationship graph based on the semantic correlation between the key semantic elements and the historical intent recognition results;

[0164] The third unit is used to perform initial intent recognition in a predefined intent space based on the semantic vector representation of the fusion context, and obtain the initial intent recognition result;

[0165] The fourth unit is used to perform context consistency verification on the initial intent recognition result based on the intent evolution relationship graph. When a conflict is detected between the initial intent recognition result and the transition path in the intent evolution relationship graph, an intent correction candidate set is generated, and a corrected intent recognition result is obtained based on the intent correction candidate set.

[0166] The fifth unit is used to generate a system response based on the corrected intent recognition result, and dynamically adjust the encoding weights of different historical rounds in the historical dialogue context sequence according to the difference between the corrected intent recognition result and the initial intent recognition result.

[0167] A third aspect of the present invention provides an electronic device, comprising:

[0168] processor;

[0169] Memory used to store processor-executable instructions;

[0170] The processor is configured to invoke instructions stored in the memory to execute the aforementioned method.

[0171] A fourth aspect of the present invention provides a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, implement the aforementioned method.

[0172] This invention can be a method, apparatus, system, and / or computer program product. The computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for performing various aspects of the invention.

[0173] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. An intent revision and optimization method for multi-turn dialogue context memory, characterized in that, The method comprises the following steps: joint semantic encoding of the user input sentence of the current dialogue turn and the historical dialogue context sequence, generating a semantic vector representation that integrates the context, and extracting key semantic elements from the user input sentence; According to the semantic correlation between the key semantic elements and the historical intent recognition results, an intent evolution relationship graph is constructed; According to the semantic vector representation that integrates the context, initial intent recognition is performed in the pre-defined intent space to obtain an initial intent recognition result; Based on the context consistency verification of the initial intent recognition result based on the intent evolution relationship graph, when the initial intent recognition result and the transition path in the intent evolution relationship graph are detected to exist conflict, an intent correction candidate set is generated, and a corrected intent recognition result is obtained based on the intent correction candidate set; Based on the corrected intent recognition result, a system response is generated, and according to the difference between the corrected intent recognition result and the initial intent recognition result, the encoding weight of different historical turns in the historical dialogue context sequence is dynamically adjusted.

2. The method of claim 1, wherein, Joint semantic encoding of the user input sentence of the current dialogue turn and the historical dialogue context sequence, generating a semantic vector representation that integrates the context, and extracting key semantic elements from the user input sentence, comprising: Performing lexical analysis on the user input sentence to identify semantic units and syntactic dependency relationships between semantic units in the user input sentence to obtain a syntactic structure representation; Respectively encode each historical turn in the historical dialogue context sequence to obtain a historical semantic vector corresponding to each historical turn; Determine the importance weight of each semantic unit in the user input sentence according to the syntactic dependency relationship, and select key semantic elements from the user input sentence based on the importance weight; Calculate the semantic similarity between the key semantic elements and each historical semantic vector, and assign a context association weight to each historical semantic vector according to the semantic similarity; The user input sentence is encoded to obtain a current semantic vector, and the current semantic vector and each historical semantic vector are weighted and integrated according to the context association weight to obtain the semantic vector representation that integrates the context.

3. The method of claim 1, wherein, According to the semantic correlation between the key semantic elements and the historical intent recognition results, an intent evolution relationship graph is constructed, comprising: Extract historical key semantic elements corresponding to each historical turn from the historical dialogue context sequence, and establish a mapping relationship between the historical key semantic elements and the historical intent recognition results; Perform semantic matching on the key semantic elements and each historical key semantic element to calculate the semantic correlation between the key semantic elements and each historical key semantic element; According to the semantic correlation, the target historical key semantic elements associated with the key semantic elements are selected, and the target historical intent recognition results corresponding to the target historical key semantic elements are obtained through the mapping relationship; determine an intent transition path based on a time sequence position relationship between the target historical intent recognition result and the current dialogue turn, and extract a semantic difference feature between the key semantic element and the target historical key semantic element as a transition condition of the intent transition path; generate the intent evolution relationship graph based on the intent transition path and the transition condition, taking the target historical intent recognition result as an intent node.

4. The method of claim 3, wherein, determine an intent transition path based on a time sequence position relationship between the target historical intent recognition result and the current dialogue turn, and extract a semantic difference feature between the key semantic element and the target historical key semantic element as a transition condition of the intent transition path, comprising: obtain a historical turn index of the target historical intent recognition result in the historical dialogue context sequence, and calculate a time interval distance between the historical turn index and a current dialogue turn index; sequentially sort a plurality of target historical intent recognition results according to the time interval distance, and establish a directed connection relationship between adjacent target historical intent recognition results in a time sequence order to form an intent transition path; extract a corresponding preceding target historical key semantic element and a subsequent target historical key semantic element for each directed connection relationship in the intent transition path; compare the preceding target historical key semantic element and the subsequent target historical key semantic element in semantics to determine a semantic difference feature between the preceding target historical key semantic element and the subsequent target historical key semantic element, and take the semantic difference feature as a transition condition corresponding to the directed connection relationship.

5. The method of claim 1, wherein, perform initial intent recognition in a predefined intent space according to the semantic vector representation of the fused context to obtain an initial intent recognition result, comprising: calculate a vector distance between the semantic vector representation of the fused context and an intent semantic vector corresponding to each predefined intent category in the predefined intent space; determine a candidate intent category set matching the semantic vector representation of the fused context according to the vector distance; extract a historical intent transition frequency related to each candidate intent category in the historical dialogue context sequence for each candidate intent category in the candidate intent category set; calculate a comprehensive matching score of each candidate intent category according to the vector distance and the historical intent transition frequency, wherein the historical intent transition frequency represents a historical statistical rule of transition from a preceding historical intent recognition result to each candidate intent category; take the candidate intent category with the highest comprehensive matching score as the initial intent recognition result.

6. The method of claim 1, wherein, perform context consistency verification on the initial intent recognition result based on the intent evolution relationship graph, generate an intent modification candidate set when a conflict between the initial intent recognition result and the transition path in the intent evolution relationship graph is detected, and obtain a modified intent recognition result based on the intent modification candidate set, comprising: determine a precedent intent based on the historical dialogue context sequence, determine all intent transition paths with the precedent intent as a starting node in the intent evolution relationship graph, and a corresponding target intent node set and transition condition; determine whether the initial intent recognition result exists in the target intent node set, and when the initial intent recognition result does not exist in the target intent node set, determine that the initial intent recognition result conflicts with the transition path in the intent evolution relationship graph; calculate a condition satisfaction degree between the key semantic element and the transition condition corresponding to each target intent node in the target intent node set, filter the target intent node set according to the condition satisfaction degree, and obtain an intent correction candidate set; calculate a semantic matching degree between the semantic vector representation of the fused context and an intent semantic vector corresponding to each candidate intent in the intent correction candidate set, and combine the condition satisfaction degree and the semantic matching degree to determine a corrected intent recognition result from each candidate intent.

7. The method of claim 6, wherein, calculate a condition satisfaction degree between the key semantic element and the transition condition corresponding to each target intent node in the target intent node set, filter the target intent node set according to the condition satisfaction degree, and obtain an intent correction candidate set, including: perform syntactic analysis on the transition condition corresponding to each target intent node, identify semantic component boundaries in the transition condition and dependency relationships between semantic components; determine a semantic core component of the transition condition and a semantic limiting component in a modifying relationship with the semantic core component based on the dependency relationship, and take the semantic core component and the semantic limiting component as necessary semantic components; determine a semantic type of each necessary semantic component according to a syntactic role of the necessary semantic component in the transition condition and a lexical semantic feature of the necessary semantic component; extract a matching semantic element matching the semantic type of each necessary semantic component from the key semantic element; based on the semantic similarity between each matching semantic element and the corresponding necessary semantic component, count a semantic component coverage rate of the key semantic element satisfying the transition condition as a condition satisfaction degree of the target intent node corresponding to the transition condition; filter out target intent nodes with a condition satisfaction degree exceeding a preset threshold from the target intent node set to form an intent correction candidate set.

8. An intent revision and optimization system for multi-turn dialogue context memory for implementing the method of any one of claims 1-7, characterized in that, including: a first unit configured to jointly encode a user input sentence of a current dialogue turn and a historical dialogue context sequence, generate a semantic vector representation of a fused context, and extract a key semantic element in the user input sentence; a second unit configured to construct an intent evolution relationship graph according to a semantic association degree between the key semantic element and a historical intent recognition result; a third unit configured to perform initial intent recognition in a predefined intent space according to the semantic vector representation of the fused context, and obtain an initial intent recognition result; a fourth unit configured to perform context consistency verification on the initial intent recognition result based on the intent evolution relationship graph, and generate an intent correction candidate set when a conflict between the initial intent recognition result and a transition path in the intent evolution relationship graph is detected, and obtain a corrected intent recognition result based on the intent correction candidate set; a fifth unit configured to generate a system response based on the corrected intent recognition result, and dynamically adjust the encoding weights of different historical rounds in the historical dialogue context sequence according to a difference degree between the corrected intent recognition result and the initial intent recognition result.

9. An electronic device, comprising: comprise: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to invoke the instructions stored in the memory to perform the method of any one of claims 1 to 7.

10. A computer-readable storage medium having stored thereon computer program instructions, wherein, The computer program instructions, when executed by the processor, implement the method of any one of claims 1 to 7. The computer program instructions, when executed by the processor, implement the method of any one of claims 1 to 7.

Citation Information

Patent Citations

  • Method for correcting dialogue intention information of old people based on deep neural network

    CN119577522A

  • Conversation interaction processing method and device, equipment, medium and product

    CN120745639A

  • Human-computer interaction dialogue method, system and equipment based on natural language and medium

    CN121257719A

  • Multi-round dialogue robot intention hit optimization method

    CN121301521A

  • System and method for defining dialog intents and building zero-shot intent recognition models

    US20200251091A1

Cited By

  • Intention recognition method, system and equipment based on multi-round dialogue dependency graph

    CN121833909A

  • Intent recognition method, system and device based on multi-round dialogue dependency graph

    CN121833909B

  • Large-model multi-round dialogue contradiction identification and correction method, system and device and medium

    CN122173591A

  • A method and system for seamless switching of full-channel conversations based on reinforcement learning

    CN122285853A