A method for switchable orchestration of multi-turn dialogue intent recognition, clarification, and execution.
By combining support vector machines, long short-term memory networks, and conditional random fields, the problem of recognition and execution in multi-turn dialogue systems during changes in user intent and task switching is solved, achieving high accuracy and continuity in multi-turn dialogue systems.
Patent Information
- Application Number
- CN202611579670.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-13
- Publication Date
- 2026-11-10
AI Technical Summary
Existing multi-turn dialogue systems struggle to accurately identify changes in user intent under uncertain user intent and cross-session/cross-task switching scenarios, leading to mixed information, incorrect execution node selection, and impacting the accuracy of context and user experience after task switching.
By acquiring semantic vectors from multi-turn dialogues, using support vector machines to identify intent categories and clarification needs, combining long short-term memory networks to process inter-period conversation information, performing singular value decomposition and noise reduction, and using conditional random fields to determine accurate call sequences, the system can achieve the switching and orchestration of task execution nodes and the updating of dialogue states.
It improves the accuracy of intent recognition and the continuity of task execution in multi-turn dialogue systems in scenarios with dynamic switching between cross-session and multi-task, reduces the probability of information mixing and execution errors, and enhances the user experience.
Smart Images

Figure CN123070131A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of artificial intelligence and natural language processing, specifically to a method for switchable orchestration of multi-turn dialogue intent recognition, clarification, and execution. Background Technology
[0002] With the development of artificial intelligence technology and intelligent assistant services, multi-turn dialogue systems have been widely applied in business scenarios such as customer service, office collaboration, and professional consulting. Compared to traditional question-and-answer interactions, multi-turn dialogues typically require continuous information exchange around one or more task objectives. The user's expression, task objectives, and focus may change continuously throughout the dialogue, and the same user's interaction may span multiple conversation cycles. Therefore, multi-turn dialogue systems not only need to understand the user's current input but also need to continuously determine the user's intent based on historical dialogue information and maintain good execution continuity between different tasks.
[0003] Existing multi-turn dialogue systems typically identify user intent based on the current input or a pre-defined context window. Some solutions also determine user needs through historical dialogue splicing, dialogue summarization, or fixed rules. However, in actual multi-turn interactions, user intent is not always stable; it may change as semantic expressions are supplemented, corrected, or shifted. When semantic changes between different turns are significant, or when user expressions themselves are ambiguous, existing systems tend to determine the intent category based on only partial statements, failing to promptly identify the degree of change in user intent and the information still to be clarified in the current expression. This leads to inconsistencies between intent recognition results and actual user needs. When user intent is uncertain, existing dialogue systems usually need to clarify it through follow-up questions to obtain business type, processing object, target parameters, or other necessary information. However, in cross-turn or cross-session scenarios, the information generated during clarification is often scattered throughout historical dialogue text or used only as temporary context in the current session. When a session is interrupted, a task is switched, or a task is resumed, previously confirmed entity information, relationship information, and slot information may not be stably retained and re-associated. This can lead to the system repeatedly initiating clarifications, omitting existing information, or misinterpreting confirmed user requests, thus increasing the burden of repetitive input for users. Furthermore, in complex business scenarios, users may temporarily switch between multiple tasks. For example, a user might switch to another business matter before completing their current task and then resume the original task in a subsequent session. Existing systems often store the context information generated by different tasks in a unified history record during such cross-session and cross-task switching processes, or only restore the task state based on the most recent dialogue content. When multiple tasks involve similar business entities, parameters, or semantic expressions, information can easily become mixed or interfere with each other between different task contexts, making it difficult for the system to accurately determine which historical information should be inherited and which irrelevant information should be hidden, thus affecting the accuracy of the context after a task switch. Further, when a user switches from one task to another or resumes a previously paused task, the dialogue system not only needs to restore the corresponding context information but also needs to determine the processing nodes that the current task should continue to execute and the subsequent call order. Existing task management methods based on fixed processes or simple state saving are prone to problems such as incorrect execution node selection, inaccurate call order, duplicate execution of completed steps, or skipping of incomplete steps when users frequently change task goals, resume tasks across sessions, or have multiple tasks executed concurrently. Furthermore, if the slot information and dialogue state are not consistent before and after task switching, subsequent output may not match the information previously confirmed by the user. Summary of the Invention
[0004] The purpose of this invention is to provide a method for switchable orchestration of multi-turn dialogue intent recognition, clarification, and execution, thereby solving the problems existing in the prior art.
[0005] To achieve the above objectives, the present invention provides the following technical solution: a method for switchable orchestration of multi-turn dialogue intent recognition, clarification, and execution, comprising: S1. Obtain the initial text sequence of user intent in multi-turn dialogue, determine the degree of dynamic change of semantic vector in the initial text sequence, and obtain the intent feature vector; S2. Based on the intent feature vector, support vector machine is used for high-dimensional space mapping and classification to obtain the user intent category, active clarification identifier and corresponding clarification slot node; S3. If the value of the active clarification flag is greater than the preset threshold, extract the entity relation triplet corresponding to the historical information in the current dialogue and concatenate it with the clarification slot node to generate the first context tensor. S4. Obtain the target domain label carried by the task switching instruction in the inter-period session, process the first context tensor and the target domain label through the long short-term memory network to obtain the second context tensor; S5. For the second context tensor, determine whether there are mutual interference features in the second context tensor. If there are mutual interference features, perform singular value decomposition and noise reduction on the second context tensor to obtain the third context tensor. If no mutual interference features are detected, extract the second context tensor as the third context tensor. S6. Based on the third context tensor and the target domain label, use conditional random fields to perform hidden state sequence labeling and probability transition calculation to determine the accurate calling sequence corresponding to the target task; S7. Switch and arrange the task execution nodes according to the accurate call sequence, and update the slot filling value in the dialogue state tracking matrix through the accurate call sequence to obtain the task coherent output sequence.
[0006] Preferably, step S1 includes obtaining an initial text sequence of user intent in a multi-turn dialogue; processing the initial text sequence to obtain an initial semantic vector; comparing the initial semantic vector to obtain a semantic offset; if the semantic offset is greater than a preset threshold, determining the degree of dynamic change; extracting a first intent feature based on the degree of dynamic change; and processing the first intent feature to obtain an intent feature vector.
[0007] Preferably, step S2 includes obtaining an intent feature vector, obtaining high-dimensional space mapping data based on the intent feature vector, classifying the high-dimensional space mapping data using a support vector machine to obtain a classification result, determining the user intent category by identifying the active clarification identifier and obtaining the intent feature vector based on the active clarification identifier and the user intent category, and obtaining a clarification slot node based on the active clarification identifier and the user intent category.
[0008] Preferably, step S3 includes acquiring the historical dialogue text of the current dialogue, extracting features from the historical dialogue text to obtain node feature vectors; extracting entity relation triples corresponding to historical information in the current dialogue based on the node feature vectors; processing the entity relation triples according to intent classification labels to extract clarification slot nodes; and if the identifier value corresponding to the acquired active clarification identifier is greater than a preset threshold, concatenating the entity relation triples and the clarification slot nodes to generate a first context tensor.
[0009] Preferably, step S4 includes obtaining a task switching instruction in a cross-period session, the task switching instruction carrying a target domain label and a time interval feature; performing semantic decay calculation on the first context tensor based on the time interval feature to obtain a decayed context tensor; processing the decayed context tensor and the target domain label through a long short-term memory network to extract the slot inheritance feature and intent transfer vector corresponding to the decayed context tensor; if the confidence of the slot inheritance feature is greater than a preset threshold, then concatenating and fusing the slot inheritance feature, the intent transfer vector, and the decayed context tensor to obtain a second context tensor.
[0010] Preferably, step S5 includes obtaining a second context tensor and calculating the feature correlation matrix corresponding to the second context tensor; determining whether there are mutually interfering features in the feature correlation matrix; if there are mutually interfering features, performing singular value decomposition and filtering on the second context tensor to obtain a denoised diagonal matrix; reconstructing the tensor based on the denoised diagonal matrix to obtain a reconstructed tensor, and extracting the reconstructed tensor as a third context tensor; if no mutually interfering features are detected, extracting the second context tensor as the third context tensor.
[0011] Preferably, step S6 includes obtaining a third context tensor and a target domain label, mapping the third context tensor and the target domain label using a multilayer perceptron to obtain a domain feature vector, and calculating the emission probability distribution using a conditional random field model based on the domain feature vector.
[0012] Preferably, step S6 further includes decoding calculation based on the emission probability distribution and a preset probability transition matrix to obtain a hidden state sequence; if the decoding score of the hidden state sequence is greater than a preset confidence threshold, then state nodes are extracted based on the hidden state sequence to determine the accurate calling sequence corresponding to the target task.
[0013] Preferably, step S7 includes obtaining an accurate call sequence, which is used to parse task execution nodes and generate a node switching orchestration diagram; and extracting state transition probabilities based on the node switching orchestration diagram, which are used to query the dialogue state tracking matrix to obtain the coordinates of the slot to be updated.
[0014] Preferably, step S7 further includes replacing the slot filling value in the dialogue state tracking matrix with the coordinates of the slot to be updated to obtain the target state tracking matrix; if the coherence score of the target state tracking matrix is greater than a preset score threshold, then the target state tracking matrix is decoded to obtain a task coherence output sequence.
[0015] As can be seen from the above technical solution, the present invention has the following beneficial effects: This method for switchable orchestration of intent recognition, clarification, and execution in multi-turn dialogues obtains intent feature vectors by judging the degree of dynamic change of semantic vectors in multi-turn dialogues. It combines support vector machines to identify user intent categories and proactive clarification needs, which helps improve the recognition accuracy when user intents are supplemented, corrected, or transferred. By associating entity relation triples corresponding to historical information with clarification slot nodes, it can retain the contextual information formed during the clarification process. When task switching occurs across sessions, it processes contextual information in conjunction with target domain labels and denoises contextual information with mutually interfering features, which helps reduce information mixing and mutual interference between different task contexts. Furthermore, it determines the accurate call sequence corresponding to the target task based on the processed contextual information, and switches and orchestrates task execution nodes accordingly and updates the slot filling values in the dialogue state tracking matrix. This ensures that the execution nodes, call order, and dialogue state are connected after task switching or resumption, thereby improving the accuracy of intent recognition, task execution continuity, and output reliability in multi-turn dialogues under dynamic switching scenarios across sessions and multiple tasks. Attached Figure Description
[0016] Figure 1 This is a flowchart of the method of the present invention; Figure 2 This is a flowchart illustrating the task execution and status update process of this invention. Figure 3 This is a bar chart comparing the performance of intent identification and clarification in this invention. Figure 4 This is a convergence curve of dialogue state tracking in the cross-domain task switching scenario of the present invention; Figure 5 This is a bar chart showing the impact of each key module of the ablation experiment of this invention on the performance of cross-domain task switching; Figure 6 This is a graph showing the singular value distribution of the second context tensor and the denoising pruning curves of the present invention. Detailed Implementation
[0017] 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.
[0018] Example 1: like Figure 1 and Figure 6 As shown, the present invention provides a technical solution: a method for switchable orchestration of multi-turn dialogue intent recognition, clarification, and execution, comprising: S1. Obtain the initial text sequence of user intent in multi-turn dialogue, determine the degree of dynamic change of semantic vector in the initial text sequence, and obtain the intent feature vector; S2. Based on the intent feature vector, support vector machine is used for high-dimensional space mapping and classification to obtain the user intent category, active clarification identifier and corresponding clarification slot node; S3. If the value of the active clarification flag is greater than the preset threshold, extract the entity relation triplet corresponding to the historical information in the current dialogue and concatenate it with the clarification slot node to generate the first context tensor. S4. Obtain the target domain label carried by the task switching instruction in the inter-period session, process the first context tensor and the target domain label through the long short-term memory network to obtain the second context tensor; S5. For the second context tensor, determine whether there are mutual interference features in the second context tensor. If there are mutual interference features, perform singular value decomposition and noise reduction on the second context tensor to obtain the third context tensor. If no mutual interference features are detected, extract the second context tensor as the third context tensor. S6. Based on the third context tensor and the target domain label, use conditional random fields to perform hidden state sequence labeling and probability transition calculation to determine the accurate calling sequence corresponding to the target task; S7. Switch and arrange the task execution nodes according to the accurate call sequence, and update the slot filling value in the dialogue state tracking matrix through the accurate call sequence to obtain the task coherent output sequence.
[0019] In this embodiment, the text information continuously input by the user in chronological order during the multi-turn dialogue is first obtained, and an initial text sequence is established based on the order in which the texts of each turn are generated.
[0020] Specifically, semantic encoding is performed on each round of text in the initial text sequence, converting each round of text into a semantic vector with the same dimension. Then, the difference between the semantic vectors corresponding to adjacent rounds is calculated, and the similarity between the semantic vectors of two adjacent rounds is obtained according to the preset similarity calculation rules. The corresponding semantic change value is then obtained based on the similarity. The above calculation is repeated for each adjacent round, and the semantic change values are arranged according to the order in which the dialogue occurs, thereby forming a semantic change sequence.
[0021] Furthermore, the semantic vector corresponding to the current round of text, the semantic change value within the preset historical round range, and the semantic change features obtained according to preset statistical rules are combined to generate an intent feature vector.
[0022] Among them, the preset historical round range is used to limit the number of historical dialogues involved in the current intent judgment; semantic change features are used to characterize the changes in the user's expressed content in consecutive rounds; through the above processing, the intent feature vector simultaneously contains the semantic information of the current round text and the semantic change information between historical rounds, and serves as the input for subsequent user intent classification.
[0023] Furthermore, the intention feature vector is input into the pre-trained support vector machine.
[0024] Specifically, the support vector machine maps the intent feature vector to the feature space for classification according to a preset feature mapping method, and performs classification processing based on the classification boundary determined during the training phase. When training the support vector machine, the historical dialogue samples are pre-labeled with the corresponding user intent category, active clarification result and slot information, so that the support vector machine can determine the corresponding user intent category based on the current intent feature vector and output the label value corresponding to the active clarification label.
[0025] In this embodiment, based on the identified user intent category, all slots required for the current task are extracted from the pre-established correspondence between intent categories and task slot sets, and the current filling status of each slot in the dialogue state tracking matrix is read. For unfilled slots, the corresponding slots are determined as candidate clarification slots. For slots that already have a filling value but whose filling value does not meet the preset format conditions, data type conditions, or task invocation conditions, they are also determined as candidate clarification slots. Then, clarification slot nodes are determined from the candidate clarification slots according to the preset slot priority order, thereby obtaining the specific clarification object corresponding to the active clarification identifier.
[0026] Furthermore, the identifier value corresponding to the proactive clarification identifier is compared with a preset threshold.
[0027] When the value of the active clarification flag is greater than the preset threshold, the historical context extraction process is initiated. At this time, entities and the relationships between entities are identified from the historical information already recorded in the current dialogue, and two entities that are semantically related to each other and the relationship between the two entities are organized into entity relationship triples. Entities can correspond to task objects, time, location, people, attributes, operation objects, business objects, or other predefined entity types. Relationships are used to represent the semantic connection between two entities.
[0028] Furthermore, vectorization is performed on each entity-relation triple, converting the first entity, relation, and second entity in the triple into feature representations under a unified data structure.
[0029] Specifically, the entity relation triples are arranged according to their order of appearance in the historical dialogue, and the clarification slot nodes are converted into slot feature representations that meet the same dimension requirements as the entity relation triples. According to the preset splicing order, the feature representations of the historical entity relation triples are spliced with the feature representations of the clarification slot nodes, and the completion or truncation processing is performed according to the preset tensor structure to obtain the first context tensor.
[0030] Therefore, the first context tensor contains both the slot information that needs to be clarified at present and the entity relationship information that has been determined in the historical dialogue.
[0031] Furthermore, the task switching instructions in the inter-period session are obtained, and the target domain tags are read from the task switching instructions.
[0032] The target domain label is used to determine the business domain to be entered after the task switch; a one-to-one correspondence between different business domains and domain labels is established in advance, and the target domain label is converted into a domain feature representation that can be processed by a long short-term memory network.
[0033] Furthermore, the first context tensor and the domain feature representations corresponding to the target domain labels are jointly input into the Long Short-Term Memory network.
[0034] Specifically, the Long Short-Term Memory (LSTM) network updates the state item by item according to the information arrangement order in the first context tensor. During each state update, based on the current input information, the state information retained from the previous time step, and the domain features corresponding to the target domain label, it determines the context information to be written, the historical information to be retained, and the state information to be output to the next processing stage. By continuously executing state updates, entity relationship information and slot information corresponding to the target domain in the historical dialogue continue to participate in subsequent processing, while the transmission range of context information is restricted according to the target domain label. After completing the processing of all context units, the state results generated at each time step are arranged in a preset order to generate the second context tensor.
[0035] Perform mutual interference feature detection on the second context tensor.
[0036] First, the second context tensor is converted into a two-dimensional feature structure according to a preset expansion method. Then, the correlation between different feature dimensions is calculated one by one according to the preset feature correlation calculation rules. For any two feature dimensions, when the calculation results meet the preset interference judgment conditions, the two feature dimensions are marked as mutually interfering features. As long as at least one set of features that meet the preset interference judgment conditions is detected, it is determined that there are mutually interfering features in the second context tensor. When all feature combinations do not meet the preset interference judgment conditions, it is determined that there are no mutually interfering features in the second context tensor.
[0037] Specifically, when mutually interfering features are detected in the second context tensor, singular value decomposition is performed on the two-dimensional feature structure corresponding to the second context tensor. The singular value decomposition process splits the original feature structure into several independent feature components and generates a corresponding singular value for each feature component. All feature components are sorted in descending order of singular values, and the feature components that are ranked first are retained according to a preset retention number. For feature components that are not included in the preset retention number range, their corresponding values are set to zero.
[0038] Subsequently, the denoised two-dimensional feature structure is reconstructed using the retained feature components, and restored to tensor form according to the original tensor arrangement of the second context tensor to obtain the third context tensor.
[0039] When there are no mutually interfering features in the second context tensor, singular value decomposition and noise reduction are not performed, and the second context tensor is directly extracted into the third context tensor.
[0040] This ensures that a third context tensor with a unified data structure can be output in both cases with and without interference features, and guarantees that subsequent task call sequence calculations use the same data interface.
[0041] Furthermore, the third context tensor and the target domain label are input into the conditional random field.
[0042] First, based on the target domain labels, the set of task execution nodes that can be invoked in the current target domain is determined from the pre-established mapping relationship between domain labels and task execution node sets. Then, the third context tensor is mapped to each hidden state position in the conditional random field in chronological order, and the state matching result of each candidate task execution node corresponding to each hidden state position is calculated.
[0043] In addition, the Conditional Random Field also reads the pre-trained task execution node transition relationships to determine the corresponding transition result when one task execution node switches to another.
[0044] For any candidate call sequence, obtain the state matching result corresponding to each task execution node in the candidate call sequence, as well as the transition result between two adjacent task execution nodes. Then, combine all state matching results and all transition results according to the preset sequence evaluation rules to obtain the overall sequence result corresponding to the candidate call sequence. Repeat the above process for all candidate call sequences, sort them according to the overall sequence result, and determine the candidate call sequence that ranks first in the sorted result as the accurate call sequence corresponding to the target task.
[0045] Furthermore, task execution nodes are switched and orchestrated based on the accurate call sequence.
[0046] Specifically, according to the order of nodes in the accurate call sequence, the task execution node that is first in the sequence is set as the current execution node; after the current execution node completes the task processing, it writes the corresponding execution result into the task status storage area and switches to the next task execution node according to the accurate call sequence.
[0047] Execute the above steps sequentially until all task execution nodes in the sequence are accurately invoked and the processing is completed.
[0048] As a preferred embodiment, each task execution node reads the slot information in the dialogue state tracking matrix according to its corresponding slot mapping relationship during the execution process.
[0049] Specifically, the dialogue state tracking matrix records at least the slot identifier, slot fill value, and slot state. For slot fill values identified in the current round of user input, they are written into the dialogue state tracking matrix according to the corresponding slot identifier, and the corresponding slot state is set to filled. For slot fill values that have been recorded in historical dialogues and meet the conditions for calling the current target task, the original slot fill values are maintained and provided to the current task execution node. For new slot fill values generated by the task execution node during execution, the corresponding position in the dialogue state tracking matrix is updated according to the slot identifier corresponding to the returned result.
[0050] Specifically, when a task switching instruction causes the current task to switch from the original domain to the target domain, the task execution node to be called is determined based on the target domain label and the accurate call sequence, and the set of slots corresponding to the target domain is read.
[0051] For slots that belong to both the original domain and the target domain, retain their current fill value; for slots that belong only to the original domain and not to the target domain task execution input conditions, stop calling during the target domain task execution; for slots that belong to the target domain and are currently unfilled, supplement the corresponding fill value according to the active clarification result.
[0052] Through the above processing, after the task domain changes, the effective slot information in the dialogue state tracking matrix is inherited and updated according to the needs of the target task.
[0053] After all task execution nodes in the accurate call sequence have completed their execution, the corresponding output results are extracted according to the order of each task execution node in the accurate call sequence, and the output results of each node are combined according to the preset output organization rules to form a coherent task output sequence.
[0054] In this embodiment, the current question, after semantic completion processing, is vectorized, and the vector similarity between the current question and the intent description and / or example question corresponding to the preset intent is calculated. Based on the vector similarity, multiple candidate intents are recalled from the preset intent set. The vector similarity is used for preliminary screening of candidate intents to narrow down the data range for subsequent intent determination.
[0055] Furthermore, the current question and the recalled candidate intents are input into the reordering model, the correlation between the current question and each candidate intent is calculated through the reordering model, the reordering score corresponding to each candidate intent is obtained, and the candidate intents are reordered according to the reordering score.
[0056] In one possible implementation, a comprehensive score for a candidate intent is calculated based on the vector similarity and rearrangement score corresponding to the candidate intent. For example, the vector similarity and rearrangement score are normalized and weighted according to a preset weight to obtain the comprehensive score of the corresponding candidate intent. The candidate intents are sorted according to the comprehensive score, and the top-ranked candidate intents are selected as the candidate intents to be judged.
[0057] Furthermore, the first comprehensive score corresponding to the first candidate intent ranked first in comprehensive score and the second comprehensive score corresponding to the second candidate intent ranked second in comprehensive score are obtained, and the score difference between the first comprehensive score and the second comprehensive score is calculated; the score difference is used to characterize the degree of distinction between the first candidate intent and the second candidate intent; when the score difference is less than a preset ambiguity threshold, an ambiguity label indicating insufficient distinction of candidate intent is generated.
[0058] The current question, historical dialogue information, current intent, candidate intents to be determined, and the intent description, example question, vector similarity, re-ranking score, comprehensive score and / or ambiguity markers corresponding to the candidate intents to be determined are input into the large language model. The large language model combines the semantic relationship between the current question and historical dialogue and the correlation between different candidate intents to determine the intent judgment result corresponding to the current user input.
[0059] The intent determination result includes at least one of the following: continuation of the current intent, exact match, ambiguity, and exceeding the range. Specifically, when the determination result is continuation of the current intent, the task processing flow corresponding to the current intent continues; when the determination result is an exact match, the corresponding task processing flow is entered based on the matched target intent; when the determination result is ambiguous or lacks information required to determine the target intent, clarification information is generated based on the differences between the candidate intents to be determined, and after obtaining supplementary information input by the user regarding the clarification information, intent recognition is re-performed in conjunction with the supplementary information; when the determination result is exceeding the range, the processing flow corresponding to exceeding the preset intent range is executed.
[0060] Among them, the comprehensive score corresponding to the candidate intent, the score difference between the top-ranked candidate intents, and the ambiguity threshold are used to provide quantitative information on the degree of distinction of candidate intents to the large language model. The large language model further combines historical dialogues and the current intent state to determine the final intent judgment result, so as to reduce the misjudgment caused by judging intent based solely on candidate intent scores or fixed thresholds.
[0061] In this embodiment, the intent recognition process further includes extracting and filling in slot information from the user input. The slot information is used to characterize the semantic elements needed to determine the user's intent, including objects, attributes, operation types, time, scope, conditions, or other semantic information that can distinguish different candidate intents. Slot extraction and filling occur during the intent recognition stage, and their purpose is to complete the semantic meaning of the user's actual expressed intent, rather than merely supplementing order or task parameters during the business execution stage.
[0062] Specifically, the system obtains the current user input and historical dialogue information in the current session, extracts the explicit slot information in the current user input, identifies the omitted information, referential information or context inheritance information in the current user input based on the historical dialogue information, and fills the slot values in the historical dialogue that are related to the current intent judgment into the intent state corresponding to the current user input, thereby forming the completed intent information.
[0063] For example, if a user has already clearly identified the business object in the previous round of dialogue, and the current round only inputs the operation content for that business object, the corresponding object slots can be inherited from the historical dialogue. When the pronouns or omitted expressions in the current input can be identified as referring to objects based on the historical dialogue, the corresponding slots can be completed using entity information from the historical dialogue. In this way, the current user input is transformed from an incomplete partial expression into a relatively complete semantic representation that can be used for candidate intent retrieval and judgment.
[0064] After slot completion, candidate intents are recalled and ranked based on the completed intent information. If the currently obtained slot information is sufficient to distinguish different candidate intents, the corresponding target intent is further determined; if the current slot information is insufficient to support a unique intent judgment, or if multiple candidate intents are highly correlated with the current user input, it is determined that the current intent recognition result has missing information or semantic ambiguity.
[0065] Furthermore, a clarification slot is determined based on the differences between different candidate intentions; the clarification slot is a semantic element that can distinguish at least two candidate intentions but has not yet obtained a definite slot value in the current intention state; clarification information is generated and output based on the clarification slot to guide the user to supplement the necessary information for distinguishing candidate intentions.
[0066] In one possible implementation, when a unique target intent cannot be directly determined in the current round, one or more candidate intents awaiting user selection or confirmation are saved as candidate intents to be confirmed. These candidate intents to be confirmed include at least a candidate intent identifier and can be further associated with one or more of the following: intent description, filled slots, missing slots, candidate scores, ranking information, and slots to be clarified. In the next round, after obtaining supplementary content input by the user regarding clarification information, slot extraction is performed on the supplementary content, and the newly obtained slot values are updated to the current intent state. Simultaneously, candidate intent recall is performed again based on the supplemented intent information to obtain the current round's recalled candidate intent set.
[0067] Furthermore, the candidate intents to be confirmed saved in the previous round are merged with the candidate intent set recalled in the current round, and deduplication is performed according to the candidate intent identifier and / or intent semantics to obtain an updated candidate intent set; for candidate intents that appear repeatedly in the candidate intent set in the previous round and the candidate intent set recalled in the current round, their historical candidate status can be retained, and the slot matching result and candidate score corresponding to the candidate intent can be updated using the information supplemented by the user in the current round.
[0068] Therefore, the user's clarification response is not only used to supplement the text information of the current round, but also to continue to verify the candidate intents that have not been eliminated in the previous round. Based on the slot information newly added by the user, the system re-evaluates the relevance and intent of the merged candidate intents to determine whether the information added by the user supports a certain candidate intent to be confirmed, or whether one or more original candidate intents are excluded.
[0069] If the supplemented slot information is sufficient to distinguish a candidate intent from other candidate intents, then the candidate intent is determined as the target intent; if the supplemented information is still insufficient to complete the unique intent determination, then the next round of clarification information is generated based on the undetermined difference slots among the remaining candidate intents; if the information supplemented by the user makes all the original candidate intents to be confirmed no longer match, then the candidate intent is re-determined based on the supplemented intent information.
[0070] Therefore, the intent recognition process forms a closed-loop process, which includes the fusion of current input and historical dialogue, slot extraction and completion, candidate intent recall, candidate intent judgment, ambiguity detection, clarification information generation, cross-round storage of candidate intent, acquisition of user supplementary information, slot update, merging and deduplication of historical candidates and newly recalled candidates, and re-judgment, so that the clarification results can be continuously fed back to the subsequent intent recognition process.
[0071] In this embodiment, after determining the user's current target intent, the corresponding task execution node is determined according to the intent type corresponding to the target intent. The context information of the current dialogue, the identified slot information, and the target intent information are sent to the corresponding task execution node. Different intent types can be associated with a knowledge base, a preset workflow, or an orchestration graph. Specifically, knowledge query intents can be distributed to the corresponding knowledge base for retrieval and response, task intents with predefined processing steps can be distributed to the preset workflow for processing, and intents that require multiple task nodes to be executed collaboratively can be distributed to the corresponding orchestration graph. The orchestration graph then calls the corresponding task execution node according to the preset node relationship. Thus, the intent recognition result can directly determine the subsequent execution path, and the user input can enter the task processing flow that matches the target intent from the intent recognition stage.
[0072] Specifically, a mapping relationship between intent identifiers and execution resources can be established based on the target intent. The execution resources include at least one of knowledge base identifiers, workflow identifiers, and orchestration graph identifiers. After obtaining the target intent, the mapping relationship is queried based on the target intent to determine the execution resources corresponding to the target intent. The filled slots in the current dialogue state, the valid information inherited from the historical dialogue, and the current round of user input are used as execution parameters to input the corresponding execution resources. For the target intent determined after clarification, the supplementary slot information obtained during the clarification process can also be synchronously written into the dialogue state tracking information, so that subsequent task execution can directly use the complete semantic information after intent recognition and clarification confirmation, thereby maintaining the information consistency between the intent recognition stage and the task execution stage.
[0073] In one possible implementation, a task switching instruction may also be generated during task execution. The task switching instruction is used to indicate that the current execution process needs to switch from the processing process corresponding to the current intent to the processing process corresponding to another target intent, and carries at least a target intent identifier. The task switching instruction may be generated by a task execution node in a preset workflow or orchestration diagram based on the current processing result. For example, when the execution result of the current workflow indicates that the subsequent processing belongs to another business intent, or when the output of the current task needs to call the business process corresponding to another intent, the task switching instruction and the target intent identifier are written into the workflow output.
[0074] After obtaining the task switching instruction, instead of directly continuing to call the processing node corresponding to the target intent within the current workflow, the target intent is extracted according to the task switching instruction, and the intent distribution and execution process is re-entered with the target intent. Specifically, the mapping relationship between the target intent and the execution resource is re-queried according to the target intent, the knowledge base, preset workflow or orchestration diagram corresponding to the target intent is determined, and the valid slot information that can be inherited in the current dialogue, the output information generated by the previous execution process, and the input parameters corresponding to the target intent are passed to the new execution resource, so that the task execution is switched from the processing flow corresponding to the current intent to the processing flow corresponding to the target intent. By re-entering the unified distribution mechanism, a large number of fixed direct call relationships can be avoided between different workflows, and different intents can still enter the corresponding task execution node according to the same intent distribution rules after the switch.
[0075] Furthermore, during task switching, slot information that can be inherited across intents can be determined based on the current intent, the target intent, and dialogue state tracking information. For slot values that are still related to the target intent, they can be retained and written into the state information corresponding to the target intent. For slot information that is only related to the original intent or may interfere with the target intent, it will not be inherited or its effectiveness in the target task will be reduced. After the target intent enters the corresponding processing flow, it will continue to be executed based on the inherited slot information and the context information generated during task switching, thereby reducing the user's need to repeatedly input already clear information after task switching and reducing the impact of irrelevant information in the original task on the execution of the target task.
[0076] In one possible implementation, to avoid cyclic calls between multiple workflows or orchestration diagrams via task switching instructions, a recursion depth parameter is set for the task switching process. Each time a target intent is redistributed based on a task switching instruction, the recursion depth is updated. Before executing a new task switch, the current recursion depth is compared with a preset maximum recursion depth. When the current recursion depth has not reached the preset maximum recursion depth, distribution and execution are allowed to continue based on the new target intent. When the current recursion depth reaches or exceeds the preset maximum recursion depth, the intent switching is terminated, and preset exception handling, state preservation, or prompt handling is executed. This avoids the cyclical execution formed by switching the workflow corresponding to intent A to intent B, and then the workflow corresponding to intent B switching back to intent A.
[0077] This application involves experimental verification: The experiment uses the publicly available Chinese cross-domain task-oriented dialogue dataset CrossWOZ. This dataset contains 6,000 dialogue sessions, covering five domains: hotels, restaurants, tourist attractions, subways, and taxis. It also labels the dialogue state (domain-slot-value), intent, and cross-domain dependencies. It is one of the most suitable publicly available datasets for the application scenarios of this method (Chinese, multi-domain, cross-domain task switching). The training set / validation set / test set (approximately 5:1:1 ratio) are used in the experiment.
[0078] Construct a cross-period handover test subset based on the test set: 860 sessions containing cross-domain switching were selected from the test set (CrossWOZ itself contains a large number of cross-domain sessions); The same user target is split into two session segments with different time intervals (the interval labels are 10min, 1h, and 24h). When the first session ends, some filled slots are retained. When the second session occurs, domain switching or task resumption occurs, forming task switching instructions + target domain label samples, totaling 2580 switching samples. A random inspection of 200 slots showed a 96.5% consistency rate in the labeling of slot inheritance relationships, meeting the experimental requirements.
[0079] The text encoding uses the Chinese pre-trained model BERT-base-chinese as the initial semantic vector extractor.
[0080] Hardware and software environment: Table 1
[0081] The semantic offset is calculated by the cosine distance between the semantic vectors of adjacent rounds; the support vector machine uses the RBF kernel (the default implementation in scikit-learn); the long short-term memory network is a two-layer bidirectional LSTM; the singular value decomposition calls torch.linalg.svd; the conditional random field is a linear chain CRF; and the dialogue state tracking matrix is implemented as a two-dimensional table of neighborhood × slot.
[0082] Comparison method: To control for variables, all three methods used the same BERT encoder and training data, differing only in their orchestration strategies: Traditional slot filling baseline: BERT + fully connected layer directly performs intent classification and slot filling, without active clarification, cross-session inheritance and noise reduction modules; Pipeline context modeling: In the current methodological system, the common pipeline scheme is that intent recognition → dialogue state tracking → policy is linked step by step. The context is passed in by concatenating historical text, without clarification context preservation, singular value decomposition noise reduction and switchable orchestration. The proposed method fully implements the S1–S7 process of this application.
[0083] Evaluation indicators: Table 2
[0084] Experiment 1: Performance Comparison of Multi-Turn Dialogue Intent Recognition and Proactive Clarification Experimental Procedure: The intent recognition and clarification triggering capabilities of the three methods were evaluated on the CrossWOZ test set. To examine the sensitivity of S1 to dynamic changes in intent, the recognition accuracy of intent supplementation / correction / transfer subclass samples (3120 samples in total) was statistically analyzed separately; the results are shown in Table 3. Figure 3 .
[0085] Table 3. Performance Comparison of Intent Recognition and Clarification (%)
[0086] From Table 3 and Figure 3As can be seen, the proposed method outperforms the two comparative methods in all three metrics; the clarification trigger F1 score reaches 88.9%, which is 12.7 percentage points higher than the pipeline method, indicating that the mechanism of triggering active clarification and locating the clarification slot node when the classification score is lower than the threshold can significantly reduce missed clarification and false clarification; the accuracy is improved by 11.1 percentage points in the intent supplementation / correction scenario, which verifies the effectiveness of capturing user supplementation and correction behavior by characterizing the dynamic changes of intent through semantic offset.
[0087] Experiment 2: Convergence Comparison of Dialogue State Tracking in Cross-Domain Task Switching Scenarios Experimental Procedure: Three methods were trained for 12 epochs each on a cross-session switching test subset (2580 switching samples), and the dialogue state tracking JGA was recorded for each epoch. This experiment directly examines whether (semantic decay + slot inheritance) and (singular value decomposition denoising) can alleviate contextual clutter in cross-session and cross-domain task switching scenarios; the results are shown in Table 4. Figure 4 .
[0088] Table 4. Joint target accuracy (JGA, %) of different methods in each training round for dialogue state tracking in cross-domain task switching scenarios.
[0089] Depend on Figure 4 As shown in Table 4, the proposed method converges faster and achieves higher joint target accuracy: after 12 training epochs, the joint target accuracy reaches 62.1%, which is 7.8 percentage points higher than the pipeline method and 14.3 percentage points higher than the traditional baseline. The proposed method converges significantly faster than the comparison method in epochs 3–8, indicating that the mechanism of semantic decay based on time interval features, preservation of slot inheritance features, and fusion of target domain labels can enable the old state of the inter-epoch session to transition to the new task more smoothly. Meanwhile, singular value decomposition denoising effectively suppresses the mutual interference between the contexts of the preceding and following tasks, thereby avoiding the state tracking matrix from being contaminated by erroneous slots.
[0090] Experiment 3: Ablation Experiment Experimental Procedure: To verify the necessity of each key module, four modules were removed from the complete method: Clarifying Context Preservation (S3, removing entity relation triple concatenation), Singular Value Decomposition (S5, skipping denoising and proceeding directly to S6), CRF switching orchestration (S6, changing to greedy decoding), and State Tracking Update (S7, not updating slot fill values). The cross-domain task completion rate and dialogue state tracking JGA were evaluated on a cross-period switching test subset. The results are shown in Table 5. Figure 5 .
[0091] Table 5 Comparison of ablation experiments (%)
[0092] like Figure 5 As shown in Table 5, removing any key module will cause a performance decrease. Among them, removing singular value decomposition and noise reduction has the greatest impact on task completion rate (a decrease of 8.8 percentage points), and removing clarification context preservation has the greatest impact on JGA (a decrease of 6.7 percentage points). This shows that clarification context preservation in S3 is an important support for maintaining the continuity of dialogue state, while singular value decomposition and noise reduction in S5 is the core link of cross-domain task switching anti-interference capability; S6 and S7 together ensure the accurate connection between the call sequence and the slot state.
[0093] Experiment 4: Analysis of Inter-Period Session Slot Inheritance and Switching Delay Experimental procedure: The slot inheritance accuracy and average switching latency of the three methods were evaluated on the inter-period switching test subset; the slot inheritance accuracy reflects the ability of S4 to retain old slots of inter-period sessions by the slot inheritance feature confidence judgment + splicing fusion; the average switching latency reflects the running efficiency of S6 in generating accurate call sequences of conditional random fields and S7 in updating state tracking matrix; the results are shown in Table 4.
[0094] Table 6 Comparison of Inter-period Session Slot Inheritance and Switching Delay
[0095] To visually demonstrate the physical significance of the S5 singular value decomposition noise reduction process, Figure 6 The singular value energy distribution of the second context tensor in the cross-period switching sample is given; it can be seen that its energy is highly concentrated in the first 12 principal singular values (cumulative energy accounts for 98.2%), indicating that there are a large number of low-energy noise components from the previous task context (i.e., mutual interference features) in this tensor; denoising can be completed by truncating and retaining the first 12 principal singular values, which not only preserves the core information related to the task, but also filters out the interference components.
[0096] As shown in Table 6, the slot inheritance accuracy of the proposed method reaches 93.8%, which is 7.3 percentage points higher than that of the pipeline method. This indicates that the semantic decay and slot inheritance mechanism of S4 can effectively preserve the slots that should be inherited in the inter-session session and avoid the old task slots being mistakenly covered by the new task. At the same time, the average switching latency of the proposed method is 71ms, which is 22.8% lower than that of the pipeline method. This indicates that the feature space is cleaner after the noise reduction of S5 and the S6 conditional random field decodes the accurate call sequence, reducing repeated retries and rollbacks caused by context interference. Figure 6 Numerical data supports the rationality of the S5 noise reduction operation: tensor energy is concentrated on a few principal singular values, and truncation noise reduction does not lose effective information, but can significantly suppress mutually interfering features.
[0097] In summary, this experiment systematically validated the switchable orchestration method for intent recognition, clarification, and execution in multi-turn dialogues on the publicly available Chinese cross-domain task-oriented dialogue dataset CrossWOZ through four reproducible experiments (performance comparison of intent recognition and clarification, convergence comparison of cross-domain task switching, ablation experiment, and slot inheritance and switching delay analysis). The main conclusions are as follows: The proposed method achieves an intent recognition accuracy of 92.4% and a clarification trigger F1 score of 88.9%. In intent supplementation / correction scenarios, the accuracy is improved by 18.3 percentage points compared with the traditional baseline, which verifies the effectiveness of intent feature extraction and proactive clarification mechanism based on the degree of semantic dynamic change. Ablation experiments show that removing the clarification context preservation module reduces the dialogue state tracking JGA by 6.7 percentage points, verifying the supporting role of entity relation triples and clarification slot node splicing in context continuity. The proposed method achieves a JGA accuracy of 62.1% in cross-domain task switching scenarios. After singular value decomposition and denoising, the tensor energy is concentrated in the first 12 principal singular values (cumulatively accounting for 98.2%), effectively filtering out cross-task context interference, and the slot inheritance accuracy reaches 93.8%. The proposed method achieves a cross-domain task completion rate of 79.6% and an average switching latency of 71ms. Conditional random field call sequence labeling and dialogue state tracking matrix updates ensure a smooth connection between execution nodes, call order, and dialogue state after task switching or resumption.
[0098] Example 2: S1 includes obtaining the initial text sequence of user intent in multi-turn dialogue, processing the initial text sequence to obtain an initial semantic vector, comparing the initial semantic vector to obtain a semantic offset, and if the semantic offset is greater than a preset threshold, determining the degree of dynamic change; extracting a first intent feature based on the degree of dynamic change; and processing the first intent feature to obtain an intent feature vector.
[0099] In this embodiment, when obtaining the initial text sequence of user intent in a multi-turn dialogue, the current round user input text and the historical user input text within a preset number of rounds prior to the current round are arranged in chronological order.
[0100] The preset number of rounds is determined based on historical dialogue samples during the model training phase. Specifically, training samples are constructed using different historical rounds, and the accuracy results of intent recognition corresponding to each historical round are statistically analyzed. The minimum number of rounds in which the recognition results meet the preset accuracy requirements and the intention classification results are no longer changed when the number of historical rounds is increased is selected as the historical rounds used in actual operation.
[0101] Therefore, each round of text in the initial text sequence has a definite round position and can reflect the continuous relationship between the current user expression and the previous expression.
[0102] In the process of processing the initial text sequence to obtain the initial semantic vector, control characters that have no effect on semantic recognition are first removed according to the unified text processing rules, consecutive spaces are merged, and time, location, object, quantity and operation words that can affect the judgment of user intent are retained. The processed text of each round is input into the same semantic encoding model, and the semantic encoding model outputs the corresponding semantic representation according to a fixed dimension.
[0103] For texts shorter than the model input length, a preset padding value is used to fill the gaps. For texts longer than the model input length, the text is truncated from the beginning position according to the maximum input length allowed by the model. Each round of text undergoes the same semantic encoding process to obtain an initial semantic vector with consistent dimensions, which is then saved according to the round order of the text.
[0104] When comparing the initial semantic vectors to obtain the semantic offset, the semantic vectors corresponding to two adjacent rounds are used as a set of comparison objects. The corresponding operations are performed on the values of the same dimension positions in the two semantic vectors. First, the cumulative result of the product of the values of the same dimension is calculated. Then, the square root result corresponding to the sum of the squares of the values of each dimension of the two semantic vectors is calculated. The cumulative result is divided by the product of the two square root results to obtain the semantic similarity result between the semantic vectors of the two adjacent rounds.
[0105] Subsequently, the semantic similarity result is subtracted from the preset maximum similarity benchmark value to obtain the semantic offset corresponding to the two rounds of text; the first and second rounds, the second and third rounds, and subsequent adjacent rounds are processed in the same way to obtain the semantic offset corresponding to each adjacent round.
[0106] The preset threshold is determined using historical dialogue samples labeled with intent changes before the support vector machine is trained.
[0107] Specifically, semantic offsets are calculated for two consecutive rounds of text in historical samples, and the samples are divided into groups with changed intent and groups without changed intent based on the manual annotation results. Then, all semantic offsets are used as candidate thresholds in ascending order for verification. For each candidate threshold, samples with semantic offsets greater than the candidate threshold are judged as having changed intent, and the remaining samples are judged as not having changed intent. The number of samples consistent with the manual annotation results is counted. The candidate threshold with the largest number of consistent samples is selected as the preset threshold. When there are more than two candidate thresholds with the same number of consistent samples, the candidate threshold with the smallest value is selected as the preset threshold. After determination, the preset threshold is fixed into the semantic offset judgment process.
[0108] Furthermore, after obtaining the semantic offset corresponding to each adjacent round, each semantic offset is compared with the preset threshold.
[0109] When the semantic offset is greater than a preset threshold, the two adjacent rounds are marked as semantic changes, and the value of the semantic offset, the position of the previous round, and the position of the next round are recorded; when the semantic offset is not greater than the preset threshold, the two adjacent rounds are marked as semantic continuity; the degree of dynamic change is determined by the comparison results of all rounds.
[0110] Specifically, semantic offsets exceeding a preset threshold in the initial text sequence are arranged in round order, and the round position and value corresponding to each semantic offset are recorded to form dynamic change data; if there are no semantic offsets exceeding the preset threshold in the initial text sequence, the dynamic change state is recorded as not triggered.
[0111] When extracting the first intent feature based on the degree of dynamic change, the round position recorded in the dynamic change data is used as the starting point for feature extraction.
[0112] Specifically, for cases where the semantic offset is greater than a preset threshold, the semantic vector of the previous round, the semantic vector of the next round, the semantic offset, and the round position of the next round in the initial text sequence corresponding to the semantic offset are extracted and combined in the order of the semantic information of the previous round, the semantic information of the next round, the offset information, and the round information; when there are more than two semantic change positions, the above information corresponding to each change position is extracted in the order of the dialogue.
[0113] Therefore, the first intent feature includes the semantic content, the change value, and the change location before and after the user's intent changes.
[0114] For cases where the dynamic change state is not triggered, the semantic vector of the current round, the semantic vector of the previous round, and the semantic offset of the two are extracted as the first intent feature.
[0115] With this processing method, regardless of whether the intent changes in the current multi-turn dialogue, the first intent feature contains the semantic information of the current turn and the correspondence with the previous semantic state, which can maintain the consistency of the input structure of subsequent feature processing.
[0116] When processing the first intent feature to obtain the intent feature vector, the data in the first intent feature are first connected according to a preset order.
[0117] For cases with multiple semantic change locations, the features corresponding to each change location are arranged sequentially according to the round order. When the length of the concatenated feature exceeds the preset feature length, the feature corresponding to the semantic change location closest to the current round is retained until the preset feature length is reached. When the length of the concatenated feature is less than the preset feature length, a fixed value is added to the end to make the feature lengths of all samples consistent.
[0118] The preset feature length is determined based on the feature length in the training samples.
[0119] Specifically, during the model training phase, input data for the support vector machine are constructed sequentially using different feature lengths, and the user intent classification results corresponding to each feature length are verified. The minimum feature length that meets the preset accuracy requirement and whose verification results are not changed when the feature length is further increased is selected as the preset feature length.
[0120] Therefore, while ensuring the completeness of the information required for intent classification, the feature dimensions entering the support vector machine can be kept fixed.
[0121] Furthermore, after completing the feature length processing, the values of each dimension are subjected to uniform scaling.
[0122] Specifically, for each feature dimension in the training samples, the minimum and maximum values of that dimension are determined. For the corresponding dimension of the current first intent feature, the current value is subtracted from the minimum value of that dimension, and then divided by the difference between the maximum and minimum values of that dimension, so that the semantic features, semantic offsets, and round position data from different sources are transformed into a unified numerical range. The minimum and maximum values of each dimension obtained during the training phase remain unchanged after the model is deployed. After the above arrangement, length processing, and unified scale processing, the intent feature vector used for subsequent support vector machine classification is obtained.
[0123] Through the above processing, each round of text in the initial text sequence is converted into a fixed-dimensional semantic representation. The semantic changes between adjacent rounds are obtained through a defined calculation process to obtain semantic offsets. Then, the position of semantic changes is determined by using a preset threshold based on historical labeled samples. The semantic information before and after the change, the semantic offset, and the round position are converted into first intent features. Finally, the intent feature vector is formed through fixed-length processing and uniform scale processing.
[0124] Example 3: S2 includes obtaining the intent feature vector, obtaining high-dimensional space mapping data based on the intent feature vector; classifying the high-dimensional space mapping data using a support vector machine to obtain the classification result; if the score of the classification result is less than a preset threshold, determining the active clarification identifier and obtaining the user intent category of the intent feature vector; and obtaining the clarification slot node based on the active clarification identifier and the user intent category.
[0125] In this embodiment, the intention feature vector formed by the preceding steps is obtained, and the values of each dimension are read according to the feature arrangement order used when training the support vector machine.
[0126] To ensure that the data to be identified and the training data are in the same feature space, the intention feature vector is transformed using the same scaling parameters as in the training phase, and then used as input data for high-dimensional space mapping.
[0127] When obtaining high-dimensional spatial mapping data based on the intention feature vector, the radial basis kernel determined during the support vector machine training phase is used for mapping.
[0128] In specific processing, the current intent feature vector is compared with each support vector retained during the training phase. For each support vector, the numerical difference between the current intent feature vector and the support vector in the same dimension is calculated sequentially. The difference in each dimension is squared, and all squared results are summed to obtain the distance between the current intent feature vector and the support vector. Subsequently, the distance result is subjected to exponential decay transformation using kernel parameters fixed during the training phase to obtain the mapping value of the current intent feature vector relative to the support vector. All mapping values are obtained sequentially according to the fixed arrangement order of the support vectors, and the mapping values are combined to form high-dimensional space mapping data.
[0129] The kernel parameters are predetermined during the support vector machine training phase.
[0130] Specifically, different candidate kernel parameters are selected to train the corresponding support vector machine models, and validation samples with real intent category labels are used for classification validation. For each candidate kernel parameter, the number of validation samples correctly classified by the corresponding model is counted, and the candidate kernel parameter with the largest number of correctly classified samples is selected as the kernel parameter actually used. When there are more than two candidate kernel parameters with the same number of correctly classified samples, the smaller value is selected, thereby fixing the calculation parameters used for subsequent high-dimensional space mapping.
[0131] In this embodiment, when classifying high-dimensional spatial mapping data using support vector machines, classification criteria are established for each pre-defined user intent category.
[0132] Specifically, for each classification term, the support vector weights and bias data obtained during the training phase are called. Each mapping value in the high-dimensional space mapping data is multiplied by the corresponding weight, and then all the product results are accumulated. The bias value corresponding to the classification term is added to obtain the classification score of the current intent feature vector for the user intent category. The classification scores corresponding to all user intent categories are calculated in the same way, and sorted in descending order of scores. The user intent category ranked first is taken as the candidate user intent category corresponding to the current intent feature vector, and the classification score corresponding to the category is taken as the score of the classification processing result.
[0133] The preset threshold corresponding to the classification results is determined using independent validation samples.
[0134] Specifically, the trained support vector machine classifies all validation samples and records the highest classification score of each validation sample and whether it needs clarification (pre-labeled by the human editor). The highest classification scores among the validation samples are arranged in ascending order and used as candidate thresholds. For each candidate threshold, validation samples with the highest classification score less than the candidate threshold are determined to need active clarification, while those with the highest classification score not less than the candidate threshold are determined to not need active clarification. These are then compared with the human-labeled results, and the number of samples with consistent clarification is counted. The candidate threshold with the largest number of consistent clarifications is selected as the preset threshold. When the number of consistent clarifications is the same for two or more candidate thresholds, the candidate threshold with the largest value is selected, and the determined preset threshold is stored in the classification judgment parameters.
[0135] In actual dialogue processing, the score of the classification result is directly compared with the preset threshold.
[0136] Specifically, when the score of the classification result is less than a preset threshold, the active clarification flag is set to the triggered state, and the category with the highest classification score among all user intent categories is determined as the user intent category corresponding to the intent feature vector. By adopting this processing method, the target intent category currently determined by the support vector machine can be retained even if the classification score does not reach the threshold for directly entering the task execution process, and the information that needs to be supplemented can be further determined accordingly.
[0137] When a clarification slot node is obtained based on the proactive clarification identifier and the user intent category, the slot configuration data corresponding to that user intent category is read.
[0138] Specifically, the slot configuration data pre-records the slot identifier, whether the slot is mandatory, the slot data type, the slot value range, and the execution order relationship between the slots required to complete the user intent; when the active clarification identifier is in the triggered state, the status of each mandatory slot corresponding to the user intent category is read from the dialogue state tracking matrix, and it is determined one by one whether each mandatory slot has obtained a fill value that meets the configuration conditions.
[0139] For required slots that are not filled, they are directly added to the set of slots to be clarified. For required slots that already have filled values, they are further validated according to their corresponding data type, value range, and format requirements. If any validation condition is not met, the slot is added to the set of slots to be clarified. If all validation conditions are met, no further clarification processing is performed on the slot.
[0140] This yields a set of slots to be clarified corresponding to the current user intent category.
[0141] When there is only one slot in the set of slots to be clarified, that slot is determined as the clarification slot node.
[0142] When there are more than two slots in the set of slots to be clarified, the slots are sorted according to the pre-defined task execution order in the slot configuration data, and the preceding slots on which the values of subsequent slots depend are selected first; when there is no data dependency, the slots that are listed first are selected according to the task execution node calling order, and the selected slots are determined as the clarification slot nodes for this round.
[0143] Example 4: S3 includes obtaining the historical dialogue text of the current dialogue, extracting features from the historical dialogue text to obtain node feature vectors; extracting entity relation triples corresponding to historical information in the current dialogue based on the node feature vectors; processing the entity relation triples according to the intent classification label to extract clarification slot nodes; if the label value corresponding to the obtained active clarification label is greater than a preset threshold, then concatenating the entity relation triples and the clarification slot nodes to generate the first context tensor.
[0144] In this embodiment, when obtaining the historical dialogue text of the current dialogue, the user input text and corresponding reply text that have been recorded before the current user input round are read based on the current user input round, and arranged in order of the dialogue occurrence time.
[0145] The reading range of historical dialogue text is limited by a preset number of historical rounds. During the training phase, entity relationship extraction and verification are performed at different historical rounds, and the number of correctly identified entity relationship samples corresponding to each historical round is counted. The minimum number of historical rounds that meets the preset recognition requirements and whose number of correct samples no longer increases after further increasing the number of historical rounds is selected as the reading range of historical text during actual operation.
[0146] When extracting features from historical dialogue text, the text of each round is first divided into continuous word units according to the preset word segmentation rules, and the position of each word unit in its respective sentence and the corresponding dialogue round are recorded.
[0147] Subsequently, each word unit is input into the semantic coding model to obtain a fixed-dimensional semantic coding result. The semantic coding result, word position data, and round position data are then concatenated in a fixed order to form word-level features. For multiple word units that continuously constitute the same entity, the corresponding word-level features are extracted according to the text arrangement order, and the values of the same dimension positions are accumulated and then divided by the number of words contained in the entity to obtain the aggregated features corresponding to the entity. The aggregated features are then concatenated with the entity's start position, end position, and round data in the text to form a node feature vector.
[0148] Therefore, each entity candidate corresponds to a node feature vector, which simultaneously reflects the semantic content of the entity and its positional relationship in historical dialogues.
[0149] When extracting entity relation triples corresponding to historical information in the current dialogue based on node feature vectors, the feature vectors of each node are first input into a pre-trained entity classification model. The entity classification model calculates the classification score of each node belonging to each preset entity category, and takes the entity category with the highest score as the entity category of that node.
[0150] Once the entity category is determined, the two entity nodes that meet the preset entity combination rules are paired according to the order of the nodes in the historical dialogue. The node feature vectors of the two nodes, the text interval between the two nodes, the round interval, and the entity category data are extracted to form relationship judgment data.
[0151] Furthermore, the relationship judgment data is input into the relationship classification model, which generates relationship scores for each preset relationship category.
[0152] During calculation, the values of each dimension in the relation judgment data are multiplied by the corresponding weights determined in the training phase, and the resulting products are summed. Then, the bias parameter of the corresponding relation category is added to obtain the relation score of the entity node combination for the corresponding relation category. After performing the same calculation on all preset relation categories, the relation category with the first-ranked relation score is selected as the candidate relation category, and the relation score corresponding to this category is compared with the relation judgment threshold. When the relation score is not less than the relation judgment threshold, the first entity, the candidate relation category, and the second entity are combined into an entity relation triplet. When the relation score is less than the relation judgment threshold, the entity relation between the two entities is not established.
[0153] The relationship determination threshold is predetermined by verification samples labeled with entity relationships.
[0154] Specifically, for each verification sample, the relation score corresponding to the candidate relation category is calculated, and the obtained relation scores are arranged in ascending order of value, and used as candidate thresholds in sequence. For each candidate threshold, samples with relation scores not less than the candidate threshold are judged to have the corresponding entity relation, and samples with relation scores less than the candidate threshold are judged to not have the corresponding entity relation, and the results are compared with the annotation results of the verification samples one by one. The number of consistent samples corresponding to each candidate threshold is counted, and the candidate threshold with the largest number of consistent samples is determined as the relation judgment threshold. When the number of consistent samples corresponding to two or more candidate thresholds is the same, the candidate threshold with the largest value is adopted.
[0155] Specifically, when processing entity relationship triples based on intent classification labels, the user intent category output by the preceding intent classification process is read, and the intent classification label corresponding to that user intent category is obtained.
[0156] Specifically, a mapping relationship between intent classification labels and slot types is pre-established. Each intent classification label corresponds to the set of slots required to complete the intent, as well as the entity and relation categories that each slot is allowed to receive. The obtained entity-relationship triples are matched item by item, and the entity and relation categories in the triples are compared with the slot configuration corresponding to the current intent classification label. When the entity and relation categories in the triples simultaneously meet the configuration conditions of a certain slot, the corresponding entity value is written to that slot.
[0157] If there are more than two entity relationship triples corresponding to the same slot, they are first arranged from back to front according to the historical dialogue rounds, and then the slot verification is performed starting from the entity relationship triple closest to the current round.
[0158] For entity values that pass the data type, format, and value range validation, they are determined as the fill value for that slot, and the reading of the other triples corresponding to that slot is stopped; thus, the historical entity relationship triples are converted into slot information that can be directly used under the current user intent.
[0159] Furthermore, after matching the entity relationship triples with the slots, all required slots corresponding to the current intent category label are read and compared item by item with the slots that have already been filled.
[0160] Specifically, required slots that have not yet received a fill value are directly listed as slots awaiting clarification; required slots that have received a fill value but have not passed the slot data type, format, or value range validation are also listed as slots awaiting clarification; when there is only one slot awaiting clarification, that slot is determined as the clarification slot node; when there are two or more slots awaiting clarification, they are arranged according to the pre-recorded task execution dependency order, and the slot ranked first is determined as the clarification slot node; the task execution dependency order is pre-configured according to the task node invocation conditions and serves as the basis for slot selection during subsequent active clarification.
[0161] In this embodiment, after obtaining the active clarification identifier, its corresponding identifier value is compared with a preset threshold; the preset threshold is determined using a verification dialogue sample with active clarification annotation.
[0162] Specifically, each verification sample is input into the pre-processing intent classification model to obtain the corresponding active clarification label value. All label values are arranged in ascending order and used as candidate thresholds. For each candidate threshold, samples with label values greater than the candidate threshold are determined to trigger active clarification, while samples with label values less than the candidate threshold are determined not to trigger active clarification. The results are then compared with the manually labeled results. The candidate threshold with the largest number of consistent samples is selected as the preset threshold. When the number of consistent samples corresponding to two or more candidate thresholds is the same, the candidate threshold with the largest value is used.
[0163] When the identifier value corresponding to the active clarification identifier is greater than the preset threshold, the entity relationship triplet and the clarification slot node are spliced together.
[0164] Specifically, the first entity feature, relation feature, and second entity feature in each entity relation triple are first connected in a fixed order to form a triple feature unit; then, all triple feature units are arranged from front to back according to the historical dialogue rounds corresponding to each entity relation triple; the clarification slot node extracts the corresponding features according to the slot identifier, slot type, slot filling status, and the task position, and processes them to the same feature dimension as the triple feature unit.
[0165] Subsequently, the arranged entity relationship triplet feature units and the clarification slot node features are connected at preset positions.
[0166] When the number of entity relation triples is less than the preset number, a fixed value is added to the empty position; when the number of entity relation triples exceeds the preset number, the preset number of entity relation triples closest to the current round is retained; the preset number is verified by different triple input numbers during the training phase, and the minimum number corresponding to the correct judgment when the preset judgment requirements are met and the number of triples continues to increase is no longer increased is selected.
[0167] After completing the above splicing, the splicing results are arranged according to the dimensions of historical dialogue rounds, entity relationship features, and clarification slot feature positions to generate the first context tensor. The first context tensor thus contains both the historical entity relationship information corresponding to the current intent and the clarification slot information that needs to be supplemented.
[0168] Example 5: S4 includes obtaining a task switching instruction in a cross-period session, the task switching instruction carrying a target domain label and a time interval feature; performing semantic decay calculation on a first context tensor based on the time interval feature to obtain a decayed context tensor; processing the decayed context tensor and the target domain label through a long short-term memory network to extract the slot inheritance feature and intent transfer vector corresponding to the decayed context tensor; if the confidence of the slot inheritance feature is greater than a preset threshold, then concatenating and fusing the slot inheritance feature, the intent transfer vector, and the decayed context tensor to obtain a second context tensor.
[0169] In this embodiment, when obtaining the task switching instruction in the inter-period session, the target domain label carried in the task switching instruction is read, and the end time of the previous associated session and the generation time of the current task switching instruction are obtained. After converting the two times to the same time unit, the time difference obtained by subtracting the end time of the previous associated session from the generation time of the current task switching instruction is used as the original value of the time interval. Then, according to the preset time interval, the original value of the time interval is mapped to the corresponding time interval feature.
[0170] Each time interval is determined based on historical inter-period session samples. Specifically, the time interval of the historical samples and the actual inheritance results of the corresponding slots in subsequent sessions are statistically analyzed. Different time boundary values are used as candidate boundary values one by one. The number of consistent results between the slot inheritance judgment results and the annotation results when each candidate boundary value is used is compared, and the boundary value with the largest number of consistent results is selected as the time interval boundary.
[0171] This gives the time interval feature a fixed set of values.
[0172] When performing semantic decay calculation on the first context tensor based on the time interval characteristics, the corresponding decay coefficient is first determined based on the time interval characteristics.
[0173] Specifically, the attenuation coefficient is determined by historical cross-period conversation samples during the training phase. Multiple candidate attenuation coefficients are used to process the first context tensor in the historical samples. The processed context data is then used for slot inheritance judgment. The number of correct judgment samples corresponding to each candidate attenuation coefficient is counted, and the candidate attenuation coefficient with the largest number of correct judgment samples is selected as the fixed attenuation coefficient corresponding to that time interval.
[0174] In actual processing, the value of each feature position in the first context tensor is multiplied by the attenuation coefficient, while keeping the original arrangement of each feature unchanged, to obtain the attenuated feature value; after performing the same processing on all features in the first context tensor, an attenuated context tensor is formed; the longer the time interval, the attenuation coefficient used for the corresponding time interval is determined according to the training results, without additionally changing the tensor structure.
[0175] In this embodiment, when processing the decaying context tensor and target domain labels through the Long Short-Term Memory (LSTM) network, the target domain labels are first converted into fixed-dimensional domain features, and these domain features are then connected to each context unit in the decaying context tensor. The connected data is then input into the LSM network in the order of the context units. When processing the current context unit, the LSM network simultaneously reads the state information retained from the previous time step and determines the part of the state to be retained from the previous time step, the part of the state written into the current context unit, and the output state at the current time step based on the gating parameters obtained during training. After processing all context units, a state output corresponding to each context unit is obtained.
[0176] As a preferred embodiment, the slot inheritance feature is extracted based on the above state output.
[0177] For each slot already recorded in the first context tensor, locate the context position corresponding to the slot, read the state feature output by the Long Short-Term Memory network at that position, and connect the state feature with the slot type, the current filling state of the slot, and the slot configuration data corresponding to the target domain label; the result of the connection is used as the inheritance judgment feature of the slot; perform the same processing on all historical slots in the original slot order, and arrange the inheritance judgment features corresponding to each slot in sequence to obtain the slot inheritance feature.
[0178] In addition, the intention transition vector is generated from the terminal state after the Long Short-Term Memory network has finished processing.
[0179] Specifically, the state output corresponding to the last context unit is read and connected with the domain features corresponding to the target domain label; then, the values of each dimension after connection are multiplied by the weights determined in the training phase, and the results of all multiplications are summed and added to the corresponding bias value to obtain an intent transfer feature value; the above operation is performed for each dimension of the intent transfer vector, and all intent transfer feature values are arranged in a preset dimension order to form an intent transfer vector.
[0180] The confidence level of slot inheritance features is calculated separately for each slot.
[0181] First, the values of each dimension in the inheritance judgment feature corresponding to the slot are multiplied by the inheritance weights determined in the training phase, and then all the product results are added together and the inheritance bias value is added to obtain the slot inheritance score. Then, according to the fixed numerical mapping method in the training phase, the slot inheritance score is converted into a confidence level within a preset numerical range. Each slot gets a corresponding confidence level.
[0182] Furthermore, the preset threshold is determined using verification samples labeled with whether slot inheritance across periods is allowed.
[0183] For each validation sample, calculate the slot inheritance confidence score and arrange all confidence scores in ascending order. Then, select each confidence score as a candidate threshold. If the slot inheritance confidence score of a validation sample is greater than a candidate threshold, the slot is deemed inheritable. If the slot inheritance confidence score is not greater than a candidate threshold, the slot is deemed disallowed. Compare the judgment results with the annotation results of the validation samples item by item, and count the number of consistent judgments corresponding to each candidate threshold. Select the candidate threshold with the largest number of consistent judgments as the preset threshold. When two or more candidate thresholds have the same number of consistent judgments, select the candidate threshold with the largest value.
[0184] When the confidence level of the slot inheritance feature is greater than the preset threshold, the slot inheritance feature corresponding to that slot is retained; when the confidence level is not greater than the preset threshold, the inheritance feature corresponding to that slot is not written into the subsequent fusion data.
[0185] When there are multiple slots that meet the inheritance conditions, the inherited features of each slot are connected sequentially according to the order of the slots in the original context to form slot inheritance data.
[0186] Furthermore, after obtaining the slot inheritance data, the intention transfer vector is concatenated after the slot inheritance data, and then the decay context tensor is expanded according to the original context unit order and concatenated with the aforementioned data.
[0187] After the connection is completed, the positions of each feature are rearranged according to the preset tensor dimensions. When the length of the connected features is less than the preset length, fixed padding values are added to the empty positions. When the length of the connected features exceeds the preset length, the context unit closest to the current task in the decay context tensor, the slot inheritance features that have passed the confidence judgment, and the complete intent transfer vector are retained first. The excess part is truncated according to the sorting order. After the above processing, the second context tensor is formed.
[0188] Therefore, the time interval feature in the task switching instruction is first used to reduce the influence of historical context features in the current session. The target domain label then participates in the state calculation of the long short-term memory network and forms slot inheritance features and intent transfer vectors from the network output. Inheritable slots are filtered through the confidence threshold determined by the fixed verification process. Finally, the retained slot inheritance features, intent transfer vectors and decayed historical context data are combined into a second context tensor according to a fixed positional relationship.
[0189] Example 6: S5 includes obtaining the second context tensor and calculating the feature correlation matrix corresponding to the second context tensor; determining whether there are mutually interfering features in the feature correlation matrix; if there are mutually interfering features, performing singular value decomposition and filtering on the second context tensor to obtain a denoised diagonal matrix; reconstructing the tensor based on the denoised diagonal matrix to obtain a reconstructed tensor, and extracting the reconstructed tensor as the third context tensor; if no mutually interfering features are detected, extracting the second context tensor as the third context tensor.
[0190] In this embodiment, after obtaining the second context tensor output by S4, the data in the tensor is first expanded according to the context unit and feature dimension.
[0191] Specifically, features belonging to the same context unit are arranged in a row, and different context units are arranged in rows according to their original order in the second context tensor, thus forming two-dimensional feature data for correlation calculation. During expansion, the position of the context unit corresponding to each row and the position of the feature dimension corresponding to each column are recorded simultaneously so that the original tensor structure can be restored after subsequent reconstruction.
[0192] When calculating the feature correlation matrix, the correlation degree is calculated for any two columns of features in the two-dimensional feature data.
[0193] Specifically, first, the average value of the two features in all contextual units is calculated. Then, the average value of each feature is subtracted from the average value of the column to obtain the corresponding deviation value. For two deviation values that are in the same contextual unit, a multiplication process is performed, and all multiplications are accumulated to obtain the cumulative result of the common change of the two features.
[0194] Meanwhile, the deviation values of each of the two feature columns are squared and summed, and then the summation results are squared to obtain the change scales of the two feature columns. The cumulative result of the common change is divided by the product of the two change scales, and the resulting value is the correlation value between the two feature dimensions. The above process is used to traverse all feature dimension combinations and the calculation results are written into the corresponding row and column positions to form a feature correlation matrix.
[0195] In addition, for the same feature dimension and its corresponding position, they are not included in the mutual interference judgment; the correlation values of the remaining positions in the feature correlation matrix are read item by item, and their absolute values are used as the basis for interference judgment.
[0196] When the absolute value of the correlation between any two different feature dimensions reaches the pre-set interference judgment condition, the two feature dimensions are recorded as mutually interfering features; if the absolute value of the correlation between all different feature dimensions does not reach the interference judgment condition, it is determined that there are no mutually interfering features in the second context tensor.
[0197] In this embodiment, the interference determination condition is determined based on historical context samples with interference annotations during the model training phase.
[0198] Specifically, the absolute value of the correlation corresponding to each feature combination is calculated for each historical sample, and the values are arranged in ascending order. The correlation values are then used as candidate judgment values one by one. For each candidate judgment value, feature combinations with an absolute correlation value not less than the candidate judgment value are judged as having interference, while other feature combinations are judged as not having interference. The results are then compared with the manually labeled results. The number of consistent samples corresponding to each candidate judgment value is counted, and the candidate judgment value with the largest number of consistent samples is determined as the interference judgment value actually used. If there are more than two candidate judgment values with the same number of consistent samples, the candidate judgment value with the largest value is adopted.
[0199] When mutually interfering features are detected, singular value decomposition is performed on the two-dimensional feature data after the second context tensor is expanded.
[0200] In the processing, orthogonal feature components in the context unit direction and orthogonal feature components in the feature dimension direction are first determined based on the two-dimensional feature data. Then, the data intensity carried by each set of corresponding orthogonal feature components is calculated. The data intensity is arranged from largest to smallest and written into the diagonal position to form singular value diagonal data. The two sets of orthogonal feature components corresponding to each data intensity are arranged synchronously in the same order. Through this processing, the original two-dimensional feature data is decomposed into orthogonal feature data in the context unit direction, singular value diagonal data, and orthogonal feature data in the feature dimension direction.
[0201] When filtering singular values, a preset number of preceding singular values are retained from the sorted singular values, and the remaining singular values exceeding the preset retention number are adjusted to 0. The diagonal positions of each singular value remain unchanged, thus forming a noise reduction diagonal matrix.
[0202] The preset retention quantity is determined during the training phase. Specifically, different singular retention quantities are used to process historical context samples containing interference features. Then, the processed data is used to perform subsequent task call sequence recognition, and the number of correctly recognized call sequence samples corresponding to each retention quantity is counted. The retention quantity corresponding to the maximum number of correct samples is selected as the actual preset retention quantity. When two or more retention quantities correspond to the same number of correct samples, the retention quantity with the smallest value is used.
[0203] Furthermore, after obtaining the denoised diagonal matrix, it is reconstructed according to the data correspondence preserved during singular value decomposition.
[0204] First, the orthogonal feature data in the context unit direction is multiplied with the noise reduction diagonal matrix. Specifically, the values in each row of the former are multiplied with the values in the corresponding columns of the latter and then accumulated to form intermediate feature data. Then, the intermediate feature data is multiplied with the orthogonal feature data in the feature dimension direction. The values at the corresponding positions are multiplied and accumulated to obtain reconstructed feature data with the same number of rows and columns as the original two-dimensional feature data. Since the singular values that were not retained have been set to 0, their corresponding data components are not recovered during the reconstruction process.
[0205] Subsequently, based on the location of the context unit and the location of the feature dimension recorded when expanding the second context tensor, the reconstructed feature data is written back to the corresponding location of the original tensor item by item, so that the reconstructed data is restored to the same dimensional structure as the second context tensor, thus obtaining the reconstructed tensor.
[0206] The order of contextual units, the order of feature dimensions, and the correspondence between each position in the reconstructed tensor are consistent with those of the second contextual tensor. Only the data components that are identified as sources of interference are filtered. The reconstructed tensor is extracted as the third contextual tensor and input into the subsequent call sequence to determine the steps.
[0207] If no mutually interfering features are detected after traversing the feature correlation matrix, the singular value decomposition, filtering and reconstruction processes are skipped. The feature values, context unit order and feature dimension positions in the second context tensor are not changed, and the second context tensor is directly extracted as the third context tensor.
[0208] Example 7: S6 includes obtaining a third context tensor and target domain labels, mapping the third context tensor and target domain labels using a multilayer perceptron to obtain a domain feature vector, calculating the emission probability distribution using a conditional random field model based on the domain feature vector, decoding the emission probability distribution and a preset probability transition matrix to obtain a hidden state sequence, and extracting state nodes based on the hidden state sequence if the decoding score of the hidden state sequence is greater than a preset confidence threshold to determine the accurate call sequence corresponding to the target task.
[0209] In this embodiment, after obtaining the third context tensor and the target domain label, the corresponding feature values are read according to the arrangement order of each context unit in the third context tensor, and the target domain label is converted into a fixed-dimensional domain feature according to the pre-established domain encoding table. The domain features are then attached to the features corresponding to each context unit, so that each context unit contains both the current context feature and the target domain feature. The resulting data is used as the input of the multilayer perceptron.
[0210] When mapping input data, the multilayer perceptron performs linear and nonlinear transformations of each network layer sequentially for each context unit.
[0211] Specifically, the feature values of each dimension of the context unit are multiplied by the weights corresponding to the current network layer, and the product results belonging to the same output node are accumulated, and then the bias value corresponding to the output node is added; then the results are transformed according to the activation method determined in the training phase, and the transformed values are used as the input of the next network layer; after all network layers are processed, the fixed-dimensional features corresponding to the context unit are obtained; the same processing is performed on all context units in the third context tensor, and the processing results are arranged according to the original context order to form the domain feature vector.
[0212] When using a conditional random field model to perform calculations based on the domain feature vectors, a set of corresponding state nodes is pre-configured for the target domain, with each state node corresponding to one task execution state.
[0213] Specifically, for each context position in the domain feature vector, the feature values of each dimension of the position are multiplied by the emission weights corresponding to each state node, and all multiplications are summed. Then, the emission bias value corresponding to the state node is added to obtain the emission score of the current context position belonging to the state node. The same calculation process is used to obtain the emission scores of the current position for all state nodes, and all emission scores are uniformly normalized to convert the results corresponding to each state node into comparable probability values, thereby obtaining the emission probability distribution of the context position. After traversing all context positions, a sequence of emission probability distributions corresponding to the domain feature vectors is formed.
[0214] In addition, the probability transition matrix used for decoding is determined during the conditional random field training phase based on historical samples with task state annotations.
[0215] During training, state transition parameters are established according to the sequential relationship between two adjacent state nodes in each labeled sequence. The transition parameters are adjusted through iterative training to make the overall score of the labeled state path higher than that of other candidate state paths. After training, the transition parameters from each preceding state node to each subsequent state node are arranged in a fixed state order to form a probability transition matrix. For state transitions that are not allowed according to the target task execution rules, the corresponding matrix position is set to a prohibited transition value so that the transition path does not participate in the candidate path selection during the decoding process.
[0216] When decoding based on the emission probability distribution and probability transition matrix, starting from the first context position, the emission score when selecting each state node at that position is recorded respectively.
[0217] When processing the second context position, for each candidate state node at this position, the cumulative score corresponding to each candidate state node at the first position is read, and then the transition score from the corresponding preceding state node to the current state node and the emission score at the current position are added. The cumulative results formed by different preceding state nodes are compared, and the path with the largest cumulative result and its preceding state node are retained. Subsequent context positions are processed in the same way, one position at a time, until the calculation of the last context position is completed.
[0218] Among all candidate state nodes at the last context position, select the state node with the highest cumulative score as the final state node, and then trace back step by step according to the preceding state nodes recorded during the decoding process until returning to the first context position; rearrange the state nodes obtained by tracing back according to the context order to obtain the hidden state sequence.
[0219] The hidden state sequence is constrained by both the state emission results at each context location and the transition relationships between adjacent state nodes.
[0220] As a preferred embodiment, the decoding score of the hidden state sequence is calculated based on the state nodes actually traversed by the hidden state sequence.
[0221] Specifically, the emission score of each state node in the hidden state sequence at the corresponding context position is extracted sequentially, and the transition score of two adjacent state nodes in the probability transition matrix is extracted. All emission scores and all transition scores are added together to obtain the original sequence score of the hidden state sequence. Then, the original sequence score is converted to a preset confidence value range using a fixed score mapping method during the training phase. The resulting value is used as the decoding score of the hidden state sequence.
[0222] The pre-set reliability threshold was determined using validation samples labeled with correct task call sequences.
[0223] Specifically, each validation sample is input into the trained conditional random field model to obtain the corresponding hidden state sequence and decoding score, and it is determined whether the task call sequence transformed from the hidden state sequence is consistent with the annotation result. The decoding scores of all validation samples are arranged in ascending order and used as candidate thresholds in turn. For each candidate threshold, samples with decoding scores greater than the candidate threshold are judged to meet the output conditions of the call sequence, and the remaining samples are judged to not meet the output conditions. The correctness of the sequence is then compared with that of the actual sequence of the validation samples item by item. The number of consistent samples corresponding to each candidate threshold is counted, and the candidate threshold with the largest number of consistent samples is determined as the confidence threshold. When the number of consistent samples corresponding to two or more candidate thresholds is the same, the candidate threshold with the largest value is adopted.
[0224] When the decoding score of the hidden state sequence is greater than the preset confidence threshold, the state nodes are extracted one by one according to the order of the hidden state sequence, and each state node is converted into the corresponding task execution node according to the pre-established mapping relationship between the state nodes and the task execution nodes.
[0225] For status nodes that only indicate the start or end of a sequence or are not in a task call state, they are not written into the call sequence; for status nodes that appear consecutively and correspond to the same task execution node, only their first appearance is retained.
[0226] Furthermore, after completing the state node transformation, the set of task execution nodes allowed to be called in the target domain is read according to the target domain label, and the transformed task execution nodes are verified one by one; only the task execution nodes belonging to the target domain node set are retained, and their order in the hidden state sequence remains unchanged; after state node extraction, node mapping, duplicate node processing and target domain verification, the resulting task execution node sequence is determined as the accurate calling sequence corresponding to the target task.
[0227] Example 8: S7 includes obtaining an accurate call sequence, which is used to parse task execution nodes and generate a node switching orchestration diagram; extracting state transition probabilities based on the node switching orchestration diagram, which are used to query the dialogue state tracking matrix to obtain the coordinates of the slots to be updated; replacing the slot filling values in the dialogue state tracking matrix with the coordinates of the slots to be updated to obtain the target state tracking matrix; if the coherence score of the target state tracking matrix is greater than a preset score threshold, then decoding the target state tracking matrix to obtain a task coherence output sequence.
[0228] In this embodiment, after obtaining the accurate call sequence, the task execution nodes are parsed one by one according to the order in the sequence; for each task execution node, the corresponding node identifier, input slot, output slot, and allowed successor nodes are read; the task execution node ranked first in the sequence is determined as the starting node, a directed connection is established between two adjacent task execution nodes, and the task execution node ranked last in the sequence is determined as the ending node; each task execution node and its directed connection are written into the graph structure according to the original call order to generate a node switching arrangement graph.
[0229] Therefore, the node positions in the node switching orchestration diagram correspond to the task execution order, and the directed connections correspond to the switching relationships between the task execution nodes.
[0230] Specifically, when extracting state transition probabilities based on the node switching orchestration diagram, for each directed connection, the preceding and following task execution nodes are read, and a pre-established node transition statistics table is queried.
[0231] The node transition statistics table is generated from historical task execution records. Specifically, it counts the actual number of times a preceding node transitions to each subsequent node after its execution. Then, it divides the number of times the preceding node transitions to the target subsequent node by the total number of all valid transitions that the preceding node has. The result is used as the state transition probability between the two nodes. The above query is executed sequentially on all directed connections in the node switching orchestration graph to obtain the state transition probability that corresponds one-to-one with the switching relationship of each node.
[0232] In addition, when querying the dialogue state tracking matrix using state transition probabilities, the set of input slots corresponding to the subsequent task execution node is first read and matched with the set of output slots of the preceding task execution node.
[0233] If the same slot exists in both the output slot set of the preceding node and the input slot set of the following node, then the slot is identified as a candidate update slot. Subsequently, the state transition probability of the corresponding directed connection is compared with a preset update threshold. When the state transition probability is not less than the preset update threshold, the row position in the dialogue state tracking matrix is determined according to the identifier of the following task execution node, and the column position is determined according to the slot identifier of the candidate update slot. The intersection of the two is the coordinate of the slot to be updated.
[0234] In this embodiment, the preset update threshold is determined based on historical task samples with actual slot update results.
[0235] Specifically, the state transition probability between nodes is calculated for each historical sample, and the corresponding node switching is marked as whether a valid slot update is generated. All state transition probabilities are arranged in ascending order of value, and each state transition probability is taken as a candidate update threshold. For each candidate update threshold, samples with a state transition probability not less than the candidate update threshold are judged as allowed to update, and samples with a state transition probability less than the candidate update threshold are judged as not updated, and compared with the actual update results in the historical samples. The number of consistent samples corresponding to each candidate update threshold is counted, and the candidate update threshold with the largest number of consistent samples is determined as the preset update threshold. When two or more candidate update thresholds correspond to the same number of consistent samples, the candidate update threshold with the largest value is adopted.
[0236] Specifically, when replacing the slot fill value in the dialogue state tracking matrix based on the slot coordinates to be updated, the currently saved slot value at that coordinate position is read first, and then the slot value with the same name output by the previous task execution node is read.
[0237] The new slot value is validated sequentially for data type, data format, and value range. If all validations pass, the original slot fill value is replaced with the new slot value, and the corresponding slot status is updated to filled. If any validation condition is not met, the replacement is not performed, and the original slot value for that coordinate is retained.
[0238] Additionally, when the same slot corresponds to more than two updates in the accurate call sequence, it is processed sequentially according to the node execution order in the node switching orchestration diagram.
[0239] The slot value written by the previous task execution node is used as the current matrix value. The new slot value generated by the subsequent task execution node will overwrite the current matrix value after passing the slot verification. After all the slot coordinates to be updated are processed, a target state tracking matrix is formed. The target state tracking matrix retains the original slot data that was not updated by this call sequence and records the slot results actually written by each task execution node in this call.
[0240] When calculating the coherence score for the target state tracking matrix, the following checks are made: slot continuity between nodes, integrity of the target task's required slots, and consistency of shared slots between consecutive nodes.
[0241] For slot transfer items between nodes, if the slot value output by the preceding node is the same as the slot value read by the following node, the transfer item is considered valid; otherwise, it is considered invalid. For complete items for required slots, if the corresponding slot status is filled and the slot value passes the preset verification, the item is considered valid; otherwise, it is considered invalid. For consistent slot items shared by consecutive nodes, if the slot values read by adjacent nodes remain the same without reassignment, the item is considered valid; otherwise, it is considered invalid.
[0242] Furthermore, the sum of the number of all the above valid items is added together and then divided by the total number of slot acceptance items, mandatory slot items, and shared slot consistency items participating in this inspection. The result is used as the coherence score of the target state tracking matrix.
[0243] Through this calculation, the coherence score directly reflects the state transition results between nodes after the accurate execution of the call sequence and the complete state of the target task slot.
[0244] As a preferred embodiment, the preset scoring threshold is determined using validation samples with task output coherence annotations.
[0245] Specifically, for each validation sample, a target state tracking matrix is generated and a coherence score is calculated according to the above process. The obtained coherence scores are then arranged in ascending order of value and used as candidate scoring thresholds. For each candidate scoring threshold, samples with a coherence score greater than the threshold are determined to be allowed to output, while the remaining samples are determined to be disallowed to output. The coherence scores are then compared item by item with the coherence labeling results of the validation samples. The number of consistent samples corresponding to each candidate scoring threshold is counted, and the candidate scoring threshold with the largest number of consistent samples is determined as the actual scoring threshold used. When two or more candidate scoring thresholds correspond to the same number of consistent samples, the candidate scoring threshold with the largest value is used.
[0246] When the coherence score of the target state tracking matrix is greater than the preset score threshold, the target state tracking matrix is decoded.
[0247] Specifically, according to the task execution order in the node switching orchestration diagram, the filled slots corresponding to each task execution node are read, and the slot filling value is written to the corresponding output position according to the output structure of the task execution node. Control fields used only for intermediate node status transmission are not written to the final output. For task results that need to be passed to subsequent nodes, they are retained until the corresponding subsequent node is processed in the node switching order.
[0248] Furthermore, after all task execution nodes have completed decoding, the effective output content of each node is combined sequentially according to the order of the node switching arrangement diagram, and the results are organized according to the output field order corresponding to the target task, thereby obtaining a coherent task output sequence.
[0249] The slot values in the output sequence are derived from the target state tracking matrix, and the node arrangement is derived from the accurate call sequence, so that the final output corresponds to the current task execution state.
[0250] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A method for switchable orchestration of multi-turn dialogue intent recognition, clarification, and execution, characterized in that, include: S1. Obtain the initial text sequence of user intent in multi-turn dialogue, determine the degree of dynamic change of semantic vector in the initial text sequence, and obtain the intent feature vector; S2. Based on the intent feature vector, support vector machine is used for high-dimensional space mapping and classification to obtain the user intent category, active clarification identifier and corresponding clarification slot node; S3. If the value of the active clarification flag is greater than the preset threshold, extract the entity relation triplet corresponding to the historical information in the current dialogue and concatenate it with the clarification slot node to generate the first context tensor. S4. Obtain the target domain label carried by the task switching instruction in the inter-period session, process the first context tensor and the target domain label through the long short-term memory network to obtain the second context tensor; S5. For the second context tensor, determine whether there are mutual interference features in the second context tensor. If there are mutual interference features, perform singular value decomposition and noise reduction on the second context tensor to obtain the third context tensor. If no mutual interference features are detected, extract the second context tensor as the third context tensor. S6. Based on the third context tensor and the target domain label, use conditional random fields to perform hidden state sequence labeling and probability transition calculation to determine the accurate calling sequence corresponding to the target task; S7. Switch and arrange the task execution nodes according to the accurate call sequence, and update the slot filling value in the dialogue state tracking matrix through the accurate call sequence to obtain the task coherent output sequence.
2. The method for switchable orchestration of multi-turn dialogue intent recognition, clarification, and execution according to claim 1, characterized in that: S1 includes: Obtain the initial text sequence of user intent in multi-turn dialogue, and process the initial text sequence to obtain the initial semantic vector; The initial semantic vector is compared to obtain the semantic offset. If the semantic offset is greater than a preset threshold, the degree of dynamic change is determined. Extract the primary intent feature based on the degree of dynamic change; The first intent feature is processed to obtain the intent feature vector.
3. The method for switchable orchestration of multi-turn dialogue intent recognition, clarification, and execution according to claim 1, characterized in that: S2 includes: Obtain the intent feature vector, and then obtain high-dimensional space mapping data based on the intent feature vector; The high-dimensional spatial mapping data is classified using support vector machines to obtain the classification results. If the score of the classification result is less than the preset threshold, then the user intent category is determined by actively clarifying the identifier and obtaining the intent feature vector. Clarification slot nodes are obtained based on the proactive clarification identifier and the user intent category.
4. The method for switchable orchestration of multi-turn dialogue intent recognition, clarification, and execution according to claim 1, characterized in that: S3 includes: Obtain the historical dialogue text of the current dialogue, extract features from the historical dialogue text, and obtain node feature vectors; Extract entity relation triples corresponding to historical information in the current dialogue based on node feature vectors; Process entity relationship triples based on intent classification labels and extract clarification slot nodes; If the value of the obtained active clarification identifier is greater than the preset threshold, the entity relation triple and the clarification slot node are concatenated to generate the first context tensor.
5. The method for switchable orchestration of multi-turn dialogue intent recognition, clarification, and execution according to claim 1, characterized in that: S4 includes: Obtain task switching instructions from inter-period sessions, wherein the task switching instructions carry target domain labels and time interval characteristics; Based on the time interval characteristics, semantic decay calculation is performed on the first context tensor to obtain the decayed context tensor; By using a long short-term memory network to process the decaying context tensor and the target domain label, the slot inheritance features and intent transfer vectors corresponding to the decaying context tensor are extracted. If the confidence level of the slot inheritance feature is greater than the preset threshold, the slot inheritance feature, the intent transfer vector, and the decay context tensor are concatenated and fused to obtain the second context tensor.
6. The method for switchable orchestration of multi-turn dialogue intent recognition, clarification, and execution according to claim 1, characterized in that: S5 includes: Obtain the second context tensor and calculate the feature correlation matrix corresponding to the second context tensor; Determine whether there are mutually interfering features in the feature correlation matrix; If there are mutual interference features, the second context tensor is subjected to singular value decomposition and filtering to obtain a noise-reduced diagonal matrix; The reconstructed tensor is obtained by reconstructing the noise reduction diagonal matrix, and the reconstructed tensor is extracted as the third context tensor. If no mutual interference features are detected, the second context tensor is extracted as the third context tensor.
7. The method for switchable orchestration of multi-turn dialogue intent recognition, clarification, and execution according to claim 1, characterized in that: S6 includes: Obtain the third context tensor and the target domain label, and map the third context tensor and the target domain label through a multilayer perceptron to obtain the domain feature vector; The emission probability distribution is obtained by using a conditional random field model based on the domain feature vector.
8. The method for switchable orchestration of multi-turn dialogue intent recognition, clarification, and execution according to claim 7, characterized in that: S6 further includes: The hidden state sequence is obtained by decoding the emission probability distribution and the preset probability transition matrix. If the decoding score of the hidden state sequence is greater than the preset confidence threshold, then the state nodes are extracted based on the hidden state sequence to determine the accurate call sequence corresponding to the target task.
9. The method for switchable orchestration of multi-turn dialogue intent recognition, clarification, and execution according to claim 1, characterized in that: S7 includes: Obtain the accurate call sequence, which is used to parse task execution nodes and generate a node switching orchestration diagram; The state transition probability is extracted from the node switching orchestration diagram. The state transition probability is used to query the dialogue state tracking matrix to obtain the coordinates of the slot to be updated.
10. The method for switchable orchestration of multi-turn dialogue intent recognition, clarification, and execution according to claim 9, characterized in that: The S7 also includes: The target state tracking matrix is obtained by replacing the slot fill values in the dialogue state tracking matrix with the coordinates of the slot to be updated. If the coherence score of the target state tracking matrix is greater than the preset score threshold, the target state tracking matrix is decoded to obtain a coherent output sequence for the task.
