Intent recognition method, system and device based on multi-round dialogue dependency graph
By constructing a multi-turn dialogue dependency graph, the semantic dependencies between each turn in the dialogue history are explicitly modeled, which solves the problem of insufficient intent dependency modeling in existing technologies and improves the accuracy and robustness of intent recognition in multi-turn dialogue scenarios.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NORTHEASTERN UNIV CHINA
- Filing Date
- 2026-03-13
- Publication Date
- 2026-06-02
AI Technical Summary
Existing technologies lack explicit modeling of intent dependencies in multi-turn dialogue scenarios, making it difficult for models to accurately capture the semantic association between the current turn and previous turns, to effectively distinguish the importance of different previous turns to the current intent recognition, and to identify the switching of user intent, which can easily lead to misjudgments.
A multi-turn dialogue dependency graph is constructed. By creating dialogue nodes and establishing context edges and dependency edges, the semantic dependencies between each turn in the dialogue history are explicitly modeled. The dependency evaluation vector is used to quantify the degree of dependency, and the intent is recognized by combining it with a large language model.
It significantly improves the accuracy and robustness of intent recognition in multi-turn dialogue scenarios, and can accurately filter out historical information that is valuable for current intent recognition, thereby improving the efficiency and accuracy of intent recognition.
Smart Images

Figure CN121833909B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of natural language processing technology, and in particular to an intent recognition method, system, and device based on a multi-turn dialogue dependency graph. Background Technology
[0002] Intent recognition is a crucial component of task-oriented dialogue systems and a core task in Natural Language Processing (NLP). It aims to automatically identify a user's underlying purpose or need from their text and categorize it into predefined intent categories. Multi-turn dialogue refers to a dialogue mode where the user and system interact through multiple messages. Compared to single-turn dialogue, it has the following significant characteristics: First, multi-turn dialogue requires understanding historical messages, as each response may depend on previous content; second, the user's intent may gradually become clear during the dialogue, requiring multiple rounds of interaction to reveal it; finally, the dialogue content may contain deeper intents or implicit information, requiring inference based on the context.
[0003] Currently, intent recognition methods based on Large Language Models (LLMs) mainly suffer from the following problems: First, they lack explicit modeling of intent dependencies in multi-turn dialogues, making it difficult for the model to accurately capture the semantic association between the current turn and previous turns; second, existing methods usually simply concatenate the history of multi-turn dialogues as input, failing to effectively distinguish the importance of different historical turns to the current intent recognition; and third, when user intent changes, existing methods struggle to accurately identify new intents and are easily influenced by historical dialogues, leading to misjudgments.
[0004] Therefore, how to accurately identify user intent in multi-turn dialogue scenarios, especially how to model and utilize dependencies in the dialogue history, has become a key issue in improving the accuracy of intent recognition. Summary of the Invention
[0005] To address the aforementioned technical problems, this invention provides an intent recognition method, system, and device based on a multi-turn dialogue dependency graph, belonging to the application of artificial intelligence technology in dialogue systems. The aim is to improve the accuracy of intent recognition in multi-turn dialogue scenarios by constructing a directed graph G of multi-turn dialogue dependencies and explicitly modeling the semantic dependencies between each turn in the dialogue history.
[0006] Based on the above objectives, the technical solution of the present invention is: an intent recognition method based on a multi-turn dialogue dependency graph, comprising the following steps;
[0007] Step 1: Based on the training data D train Constructing a multi-turn dialogue dependency graph G, including creating dialogue nodes N and establishing context edges E. ctx and dependent edge E dep;
[0008] Step 2: For the multi-turn dialogue D to be identified test Node N is matched from the multi-turn dialogue dependency graph G based on semantic similarity. match ;
[0009] Step 3: Based on the matching node N match Determine the dependencies and construct the dependency history H without dependency tags and the dependency history H with dependency tags. dep ;
[0010] Step 4: Combine the history H without dependency tags and the candidate intent list I list Inputting a large language model for initial intent prediction yields the initial intent I. init The dependency history H containing dependency tags dep Current user's comments curr and initial intention I init Input a large language model, perform intent recognition, and output the final intent I. final .
[0011] Step 1 specifically involves:
[0012] Step 1.1: From training data D train Extract multi-turn dialogue samples, and create dialogue node N for each round of dialogue samples. i Node attributes include intent i User dialogue action user_act i The previous round of system dialogue action pre_sys_act i and dialogue rounds i ;
[0013] Step 1.2: For dialogue nodes in adjacent rounds within the same session, establish a context edge E. ctx The dialogue node in the previous round points to the dialogue node in the current round; within the same session, the dialogue node is determined by the user's speech. i And system speech S i Alternating structure, and includes user dialogue actions (user_act) i System dialogue action sys_act i Candidate Intent List I list ;
[0014] Step 1.3: For each dialogue round, evaluate the dependency level (DL) between the current dialogue node and the historical dialogue nodes based on the large language model; the dependency level is divided into 1 to 5 levels, where level 1 represents no dependency and level 5 represents very strong dependency; dependency level 1 represents that the current dialogue node and the historical dialogue node are independent, dependency level 2 represents general context, dependency level 3 represents intent inheritance, dependency level 4 represents reference, and dependency level 5 represents direct causality.
[0015] Step 1.4: Calculate the dependency evaluation vector V = [ ];
[0016] Recency represents the time decay factor, Recency = decay distance distance=turn source -turn target This represents the distance between dialogue rounds; decay is the decay coefficient, with a value range of [0.9, 0.95]; turn target For the historical dialogue rounds, turn source The current dialogue round is represented by Relevance, which represents semantic similarity. The embedding model is used to vectorize the user speech content corresponding to the two dialogue nodes into user speech vectors, and the cosine similarity between the two user speech vectors is calculated as semantic similarity. DL represents dependency level, which is normalized to the [0,1] interval by the maximum value of dependency level evaluated by the large language model. Since a dependency edge may correspond to multiple instances in the dataset, the final dependency evaluation vector V is obtained by averaging the Recency, Relevance, and DL of all instances.
[0017] Step 1.5: Based on the weighted score of the dependency evaluation vector, establish dependency edges E between historical dialogue nodes and the current dialogue node that meet the preset threshold. dep The weighted score ;in , , For weighting coefficients; when Exceeding the preset threshold threshold At that time, a dependency edge E is established between the historical dialogue node and the current dialogue node. dep .
[0018] Step 2 specifically involves:
[0019] Step 2.1: For the Nth round of user speech U N First, based on the context edge E ctx Perform filtering, retaining only nodes N that match the previous round. match N-1 The set C of candidate nodes with contextual connectionsN In the initial dialogue round, the candidate node set C N For all initial dialogue nodes, filter out those with intent and I. init Consistent candidate nodes, calculate the current user's speech vector U. vec User action vectors for each candidate node (user_act) ivec The node with the highest cosine similarity is selected as the matching node N. mat ;
[0020] Step 2.2: Calculate the current user's speech vector U vec User action vector for interaction with candidate nodes (user_act) ivec The cosine similarity is used as the semantic similarity; the candidate node with the highest semantic similarity is selected as the matching node N. match ;
[0021] Step 2.3: When there are multiple candidate nodes with the same semantic similarity that are not the initial dialogue nodes, calculate the system speech vector S from the previous round. vec The previous system dialogue action vector sys_act with the candidate node ivec The cosine similarity is used for secondary screening.
[0022] Step 3 includes:
[0023] Step 3.1: From matching node N match Starting from this point, traverse its outgoing edges and obtain the set T of historical dialogue rounds that have dependencies on it. dep ;
[0024] Step 3.2: Construct a history H without dependency tags: Concatenate the dialogue content of all historical dialogue rounds in sequence, without distinguishing dependencies;
[0025] Step 3.3: Construct the dependency history H containing dependency tags dep For historical dialogue rounds t∈T with dependencies dep Add dependency tags in the dependency history.
[0026] Step 4 includes:
[0027] Step 4.1: Initial Intent Prediction: Combine the history H without dependency labels with the candidate intent list I list Embedding prompt word templates, calling a large language model to predict initial intent, and outputting initial intent I init ;
[0028] Step 4.2: Final Intent Identification: Resolve the dependency history H containing dependency tags. dep Current user's comments currand initial intention I init Embed prompt word templates, call a large language model for intent recognition, and output a formatted final intent I. final .
[0029] An intent recognition system based on a multi-turn dialogue dependency graph includes a dependency graph construction module, a node matching module, a dependency context construction module, and an intent recognition module.
[0030] The dependency graph construction module is used to construct a multi-turn dialogue dependency graph based on training data, including creating dialogue nodes, establishing context edges and dependency edges;
[0031] The node matching module receives a multi-turn dialogue to be identified and matches nodes from the multi-turn dialogue dependency graph based on semantic similarity.
[0032] The dependency context building module constructs a history without dependency tags and a dependency history with dependency tags based on the dependency relationships of the matching nodes.
[0033] The intent recognition module first inputs the history without dependency tags and the candidate intent list into the large language model to obtain the initial intent. Then, it inputs the dependency history with dependency tags, the current user's speech, and the initial intent into the large language model, which then performs intent recognition and outputs the final intent.
[0034] The dependency graph construction module includes:
[0035] The node creation unit is used to extract multi-round dialogue samples from the training data and create a dialogue node for each round of dialogue sample. The node attributes include intent, user dialogue action, previous round of system dialogue action, and dialogue round.
[0036] The context edge establishment unit is used to establish context edges between dialogue nodes in adjacent rounds of the same session;
[0037] The dependency evaluation unit is used to evaluate the dependency level between the current dialogue node and the historical dialogue nodes based on the large language model, and to calculate the dependency evaluation vector.
[0038] The dependency edge establishment unit is used to evaluate the weighted score of the vector based on the dependency relationship and establish dependency edges between the historical dialogue node and the current dialogue node that meet the threshold condition.
[0039] The node matching module includes:
[0040] The initial node selection unit is used for user speech in the initial dialogue round. It selects similar nodes from all initial dialogue nodes based on semantic similarity as matching nodes for the initial dialogue round.
[0041] The context filtering unit is used to filter the user's speech in the Nth round based on context edges, retaining only the set of candidate nodes that have a context connection relationship with the matched nodes in the previous round;
[0042] The user vector matching unit is used to calculate the cosine similarity between the current user's speech vector and the user dialogue action vector of the candidate node as the semantic similarity, and select the matching node with the highest semantic similarity.
[0043] The system vector filtering unit is used to perform secondary filtering when there are multiple candidate nodes with the same semantic similarity, by further calculating the cosine similarity between the previous round system speech vector and the previous round system dialogue action vector of the candidate node.
[0044] A computer device includes a memory and a processor; the memory stores a computer program; and the processor executes the computer program to implement an intent recognition method based on a multi-turn dialogue dependency graph.
[0045] The beneficial effects of this invention are:
[0046] 1. This invention constructs a multi-turn dialogue dependency graph to explicitly model the semantic dependencies between each turn in the dialogue history, enabling intent recognition to be based on structured dependency information rather than simple text concatenation, thus significantly improving the accuracy of intent recognition in multi-turn dialogue scenarios.
[0047] 2. This invention comprehensively considers three dimensions—time decay factor, semantic similarity, and dependency level—through dependency evaluation vectors, which can accurately quantify the degree of dependency between the current round and historical rounds, thereby effectively filtering historical information that is valuable for current intent recognition.
[0048] 3. This invention improves the accuracy and robustness of intent recognition through a two-stage recognition mechanism of initial intent prediction and final intent recognition. First, an initial prediction is obtained based on a complete history, and then the prediction is refined by combining dependencies.
[0049] 4. This invention uses a dual filtering mechanism of context edges and dependency edges to quickly locate relevant nodes during graph matching, thereby improving the efficiency and accuracy of node matching. Attached Figure Description
[0050] Figure 1 This is a schematic diagram of the intent recognition method based on a multi-turn dialogue dependency graph.
[0051] Figure 2 This is a block diagram of an intent recognition system based on a multi-turn dialogue dependency graph.
[0052] In the diagram: 20 - Intent recognition system based on multi-turn dialogue dependency graph; 21 - Dependency graph construction module; 22 - Node matching module; 23 - Dependency context construction module; 24 - Intent recognition module; 211 - Node creation unit; 212 - Context edge establishment unit; 213 - Dependency evaluation unit; 214 - Dependency edge establishment unit; 221 - Initial node selection unit; 222 - Context filtering unit; 223 - User vector matching unit; 224 - System vector filtering unit. Detailed Implementation
[0053] To enable those skilled in the art to better understand the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are merely some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort should fall within the scope of protection of the present invention.
[0054] In a first aspect, this invention discloses an intent recognition method based on a multi-turn dialogue dependency graph, comprising the following steps:
[0055] Step 1: Based on the training data D train Constructing a multi-turn dialogue dependency graph G, including creating dialogue nodes N and establishing context edges E. ctx and dependent edge E dep ;
[0056] Step 2: For the multi-turn dialogue D to be identified test Node N is matched from the multi-turn dialogue dependency graph G based on semantic similarity. match ;
[0057] Step 3: Based on the matching node N match Determine the dependencies and construct the dependency history H without dependency tags and the dependency history H with dependency tags. dep ;
[0058] Step 4: Combine the history H without dependency tags and the candidate intent list I list Inputting a large language model for initial intent prediction yields the initial intent I. init The dependency history H containing dependency tags dep Current user's comments curr and initial intention I init Input a large language model, perform intent recognition, and output the final intent I. final .
[0059] Step 1 includes:
[0060] Step 1.1: From training data D train (The same session is spoken by the user U) i And system speech S i Alternating structure, and includes user-interaction annotations (user_act). i System interaction action sys_act i and candidate intent list I list Extract multi-turn dialogue samples from the dataset, and create dialogue node N for each round of dialogue samples. i (The same dialogue node can have multiple instances in the dataset), node attributes include intent. i User dialogue action user_act i (Text labels, such as Train-Inform representing the action - providing train information), previous system dialogue action pre_sys_act i and dialogue rounds i ;
[0061] Step 1.2: For dialogue nodes in adjacent rounds within the same session, establish a context edge E. ctx ; The dialogue node in the previous dialogue round points to the dialogue node in the current dialogue round;
[0062] Step 1.3: For each dialogue round, evaluate the dependency level (DL) between the current dialogue node and the historical dialogue nodes based on the large language model. The dependency level is divided into 1 to 5 levels, where level 1 represents no dependency and level 5 represents very strong dependency. Dependency level 1 represents that the current dialogue node and the historical dialogue node are independent; dependency level 2 represents general context (such as topic continuation); dependency level 3 represents intent inheritance (such as adding details or expanding previous intents); dependency level 4 represents reference; and dependency level 5 represents direct causality.
[0063] Step 1.4: Calculate the dependency evaluation vector V = [ ];
[0064] Recency represents the time decay factor, Recency = decay distance distance=turn source -turn target This represents the distance between dialogue rounds; decay is the decay coefficient, with a value range of [0.9, 0.95]; turn target For historical dialogue rounds (e.g., initial round is 0), turn sourceThe current dialogue round is represented by Relevance, which represents semantic similarity. An embedding model (a model that converts text into vectors, such as the bge-large-en model) is used to vectorize the user speech content corresponding to the two dialogue nodes as user speech vectors, and the cosine similarity between the two user speech vectors is calculated as semantic similarity.
[0065] DL represents the dependency level. The maximum dependency level evaluated by the large language model is normalized to the interval [0,1]. Since an edge may correspond to multiple instances in the dataset, the final dependency evaluation vector V is obtained by averaging the Recency, Relevance, and DL of all instances.
[0066] Step 1.5: Based on the weighted score of the dependency evaluation vector, establish dependency edges E between historical dialogue nodes and the current dialogue node that meet the preset threshold. dep ;
[0067] The weighted score ;
[0068] in , , For weighting coefficients; when Exceeding the preset threshold threshold At that time, a dependency edge E is established between the historical dialogue node and the current dialogue node. dep .
[0069] Step 2 includes:
[0070] Step 2.1: For the Nth round of user speech U N First, based on the context edge E ctx Perform filtering, retaining only nodes N that match the previous round. match N-1 The set C of candidate nodes with contextual connections N Specifically, for the initial dialogue round, the candidate node set C N For all initial dialogue nodes, filter out those with intent and I. init Consistent candidate nodes, calculate the current user's speech vector U. vec User action vectors for each candidate node (user_act) ivec The node with the highest cosine similarity is selected as the matching node N. mat ;
[0071] Step 2.2: Calculate the current user's speech vector U vec(The current user's speech is vectorized using an embedding model; all subsequent vectors are obtained by vectorizing the text using an embedding model.) User dialogue action vector user_act with candidate nodes. ivec The cosine similarity is used as the semantic similarity; the candidate node with the highest semantic similarity is selected as the matching node N. match ;
[0072] Step 2.3: When there are multiple candidate nodes with the same semantic similarity that are not the initial dialogue nodes, calculate the system speech vector S from the previous round. vec The previous system dialogue action vector sys_act with the candidate node ivec The cosine similarity is used for secondary screening.
[0073] Step 3 includes:
[0074] Step 3.1: From matching node N match Starting from this point, traverse its outgoing edges and obtain the set T of historical dialogue rounds that have dependencies on it. dep ;
[0075] Step 3.2: Construct a dependency-free history H: Concatenate the dialogue content of all historical dialogue rounds in sequence, without distinguishing dependencies, in the following format:
[0076] [Turn 0] intent:intent_0;
[0077] [user] user_utterance_0;
[0078] [system] system_utterance_0;
[0079] [Turn 1] intent:intent_1; ...
[0080] Step 3.3: Construct the dependency history H containing dependency tags dep For historical dialogue rounds t∈T with dependencies dep Add dependency tags (specifically, the text [Dependency turn t]) to the dependency history:
[0081] [Dependency turn 0] intent:intent_0;
[0082] [user] user_utterance_0;
[0083] [system] system_utterance_0;
[0084] [Turn 1] intent:intent_1; ...
[0085] Step 4 includes:
[0086] Step 4.1: Initial Intent Prediction: Combine the history H without dependency labels with the candidate intent list I list Embedding prompt word templates, calling a large language model to predict initial intent, and outputting initial intent I init ;
[0087] Step 4.2: Final Intent Identification: Resolve the dependency history H containing dependency tags. dep Current user's comments curr and initial intention I init Embed prompt word templates, call a large language model for intent recognition, and output a formatted final intent I. final ;
[0088] In a second aspect, the present invention discloses an intent recognition system 20 based on a multi-turn dialogue dependency graph, comprising a dependency graph construction module 21, a node matching module 22, a dependency context construction module 23, and an intent recognition module 24.
[0089] The dependency graph construction module 21 is used to extract multi-turn dialogue samples from training data and construct a multi-turn dialogue dependency graph, including creating dialogue nodes, establishing context edges and dependency edges;
[0090] The dependency graph construction module 21 includes:
[0091] The node creation unit 211 is used to extract multi-round dialogue samples from the training data and create a dialogue node for each dialogue round. The node attributes include intent, user dialogue action, previous system dialogue action, and dialogue round.
[0092] Context edge establishment unit 212 is used to establish context edges between adjacent dialogue nodes in the same session;
[0093] The dependency evaluation unit 213 is used to evaluate the dependency level between the current dialogue node and the historical dialogue node using a large language model, and to calculate the dependency evaluation vector.
[0094] The dependency edge establishment unit 214 is used to evaluate the weighted score of the vector based on the dependency relationship and establish dependency edges between the historical dialogue node and the current dialogue node that meet the threshold condition.
[0095] The node matching module 22 receives the multi-turn dialogue to be identified and matches the most similar node path from the multi-turn dialogue dependency graph based on semantic similarity.
[0096] The node matching module 22 includes:
[0097] The initial node selection unit 221 is used to select the most similar matching node from all initial nodes based on semantic similarity when the user speaks in the 0th round of the initial dialogue.
[0098] The context filtering unit 222 is used to filter the user's speech in the Nth round based on the context edge, and retain only the set of candidate nodes that have a context connection relationship with the matching node in the previous round;
[0099] User vector matching unit 223 is used to calculate the cosine similarity between the current user's speech vector and the user dialogue action vector of the candidate node, and select the matching node with the highest similarity.
[0100] The system vector filtering unit 224 is used to further calculate the cosine similarity between the previous round system speech vector and the previous round system dialogue action vector of the candidate node for secondary filtering when there are multiple candidate nodes with the same similarity.
[0101] The dependency context construction module 23 constructs a history without dependency tags and a dependency history with dependency tags based on the dependency relationships of the matching nodes.
[0102] The intent recognition module 24 first inputs the history without dependency tags and the candidate intent list into the large language model to obtain the initial intent, and then inputs the dependency history with dependency tags, the current user's speech and the initial intent into the large language model. The large language model then performs intent recognition and outputs the final intent.
[0103] A third aspect of the present invention discloses a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the above-described method.
[0104] Example 1
[0105] like Figure 1 As shown, the first aspect of this invention discloses an intent recognition method based on a multi-turn dialogue dependency graph, comprising the following steps:
[0106] Step 1: Construct a directed graph G of multi-turn dialogue dependencies.
[0107] This step starts from the training data D train Extract multi-turn dialogue samples and construct a system containing dialogue nodes N and context edges E. ctx and dependent edge E dep A multi-turn dialogue dependency graph G. Specifically, it includes:
[0108] Step 1.1: Create dialogue node Ni For each user dialogue turn in the training data, create a dialogue node N. i Node attributes include: intent i User dialogue action user_act i The previous round of system dialogue action pre_sys_act i and dialogue rounds i .
[0109] Step 1.2: Establish context edge E ctx For dialogue nodes in adjacent user turns within the same session, context edges are established between the corresponding dialogue nodes to represent the natural flow of the dialogue.
[0110] Step 1.3: Evaluate Dependency Level (DL). For each user round, evaluate its dependency level with each historical round using a large language model (such as Deepseek-V3.2). Dependency levels are divided into 1 to 5 levels:
[0111] Level 1: Completely independent; independent statements, requiring no preceding context, such as independent greetings;
[0112] Level 2: Weak dependency; topic continuation or general context, such as sharing related topics but without specific inheritance;
[0113] Level 3: Medium dependency; intends to inherit or supplement details, such as answering extended questions;
[0114] Level 4: Strong dependency; refers to a relationship or conditional response, such as responding based on the preceding entity;
[0115] Level 5: Extremely strong dependency; direct causation or unfulfilled intention, such as clarifying ambiguities in the preceding text.
[0116] Step 1.4: Calculate the dependency evaluation vector V = [ For each source round (earlier) and target round (later), compute the dependency evaluation vector, where:
[0117] Recency represents the time decay factor, calculated as recency = decay. distance , where distance=turn target -turn source This represents the distance between rounds, and decay is the decay coefficient, with a value range of [0.9, 0.95].
[0118] Relevance represents semantic similarity. It uses an embedding model (such as the bge-large-en model) to calculate the cosine similarity of the content of two nodes, representing the degree of semantic similarity.
[0119] DL represents dependency level, which is the dependency level evaluated by a large language model (such as Deepseek-V3.2 model) and normalized to the [0,1] interval.
[0120] Step 1.5: Establish dependency edge E dep Calculate the weighted score of the dependency evaluation vector: Where w1=0.1, w2=0.3, and w3=0.6 are weight coefficients. When the score exceeds the preset threshold of 0.5, a dependency edge E is established between the source round node and the target round node. dep .
[0121] Step 2: Match nodes from the multi-turn dialogue dependency graph G based on semantic similarity.
[0122] For the multi-turn dialogue D to be identified test Different node matching strategies are adopted depending on the current round:
[0123] For the user's initial speech U0 in the initial dialogue round: First, the initial intent I is predicted using the Deepseek-V3.2 model. init Then, from all the starting nodes where turn=0 in the dialogue rounds, filter out those with intent and I. init Consistent candidate nodes. Calculate the current user's speech vector U. vec User action vectors for each candidate node (user_act) ivec The node with the highest cosine similarity is selected as the matching node N. match .
[0124] For the Nth round of user comments U N N≥1: First, based on the context edge E ctx Perform filtering, retaining only nodes N that match the previous round. match N-1 There are candidate nodes connected by context edges. Then, the current user's speech vector U is calculated. vec User action vectors for each candidate node (user_act) ivec The cosine similarity is calculated. If multiple candidate nodes have the same cosine similarity, the previous round's system speech vector S is further calculated. vec The previous round of system dialogue action vector sys_act with each candidate node ivec The node with the highest cosine similarity is selected as the matching node N. match.
[0125] Step 3: Construct the history H without dependency tags and the dependency history H containing dependency tags. dep ;
[0126] From matching node N match Starting from this point, traverse its outgoing edges and identify the set T of historical dialogue rounds in which nodes have dependencies. dep .
[0127] Construct a history H without dependency tags: For historical dialogue rounds t∈T with dependencies dep Add dependency tags to the dependency history. The format is:
[0128] [Turn 0] intent:find_restaurant;
[0129] [user] I need a place to eat.
[0130] [system] What type of food?
[0131] [Turn 1] intent:find_restaurant;
[0132] [user] Italian food.
[0133] [system] There are several options.
[0134] Build a dependency history H containing dependency tags dep For historical dialogue rounds t∈T with dependencies dep Add dependency tags in the dependency history, in the following format:
[0135] [Dependency turn 0] intent:find_restaurant;
[0136] [user] I need a place to eat.
[0137] [system] What type of food?
[0138] [Turn 1] intent:find_restaurant;
[0139] [user] Italian food.
[0140] [system] There are several options.
[0141] Step 4: Deepseek-V3.2 model intent recognition.
[0142] Step 4.1: Initial Intent Prediction. Combine the history H (without dependency tags) and the candidate intent list I. list Embedding prompt word templates, the Deepseek-V3.2 model is called to predict the initial intent, and the initial intent I is output. init The prompt word template contains a complete dialogue history and a list of candidate intents, requiring the model to predict the current user's intent based on the dialogue content.
[0143] Step 4.2: Final Intent Identification. This involves identifying the dependency history H containing dependency tags. dep Current user's comments curr and initial intention I init The prompt word template is embedded, and the Deepseek-V3.2 model is invoked for intent recognition. The prompt word template contains the following key instructions:
[0144] Based on historical data, determine whether the current round should inherit the historical intent or switch to a new intent;
[0145] When a user switches topics, the user's new intent is determined based on the current user's message.
[0146] Distinguish between "find" and "book" intents: If a domain is mentioned for the first time, use the "find_xxx" intent even if it contains words like "book" or "reserve"; only use the "book_xxx" intent when "find_xxx" explicitly expresses a booking intent.
[0147] Output format requirements: Strictly use the [intent_name] format, and only include the intent name within square brackets.
[0148] The Deepseek-V3.2 model infers based on the above prompts and outputs a formatted final intent I. final .
[0149] Example 2
[0150] like Figure 2 As shown, in a second aspect, the present invention discloses an intent recognition system 20 based on a multi-turn dialogue dependency graph, including a dependency graph construction module 21, a node matching module 22, a dependency context construction module 23, and an intent recognition module 24.
[0151] The dependency graph construction module 21 is responsible for extracting multi-turn dialogue samples from the training data and constructing a multi-turn dialogue dependency graph G, including:
[0152] The node creation unit 211 is used to extract multi-round dialogue samples from the training data and create a dialogue node for each user round. The node attributes include intent, user dialogue action, previous round system dialogue action and dialogue round.
[0153] Context edge establishment unit 212 is used to establish context edges between dialogue nodes in adjacent rounds of the same session;
[0154] The dependency evaluation unit 213 is used to evaluate the dependency level between the current dialogue node and the historical dialogue node according to the large language model, and to calculate the dependency evaluation vector.
[0155] The dependency edge establishment unit 214 is used to evaluate the weighted score of the vector based on the dependency relationship and establish dependency edges between the historical dialogue node and the current dialogue node that meet the threshold condition.
[0156] The initial node selection unit 221 is used for the user to speak in the initial dialogue round, and selects similar nodes from all initial dialogue nodes based on semantic similarity as matching nodes for the initial dialogue round.
[0157] The context filtering unit 222 is used to filter the user's speech in the Nth round based on the context edge, and retain only the set of candidate nodes that have a context connection relationship with the matching node in the previous round;
[0158] User vector matching unit 223 is used to calculate the cosine similarity between the current user's speech vector and the user dialogue action vector of the candidate node as semantic similarity, and select the matching node with the highest semantic similarity.
[0159] The system vector filtering unit 224 is used to further calculate the cosine similarity between the previous round system speech vector and the previous round system dialogue action vector of the candidate node for secondary filtering when there are multiple candidate nodes with the same semantic similarity.
[0160] The dependency context building module 23 builds a history without dependency tags and a dependency history with dependency tags based on the dependency relationship of the matching nodes.
[0161] The intent recognition module 24 first inputs the history without dependency tags and the candidate intent list into the large language model to obtain the initial intent. Then, it inputs the dependency history with dependency tags, the current user's speech, and the initial intent into the large language model, which performs intent recognition and outputs the final intent.
[0162] The modules in the aforementioned intent recognition system based on multi-turn dialogue dependency graphs can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the computer device's memory as software, allowing the processor to invoke and execute the corresponding operations. By using this system, the aforementioned computational processing methods can be executed, and the corresponding technical effects can be achieved.
[0163] Example 3
[0164] In one embodiment, a computer device is provided, including a memory and a processor. Specifically, the memory stores data and related computer programs required to execute a method, and the processor can invoke the data and programs in the memory to implement all steps of the method. The computer device also includes input / output interfaces (I / O), communication interfaces, an audio processor, a display, a power supply, and other components. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is connected to the system bus via the I / O interfaces; these are well known to those skilled in the art and therefore will not be described further. The processor of the computer device provides computational and control capabilities. The memory of the computer device includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database of the computer device stores data such as directed graphs of dependencies.
[0165] Example 4
[0166] In a fourth aspect, this invention discloses a computer-readable storage medium storing a computer program that, when executed by a processor, implements the aforementioned intent recognition method. This can be a readable storage medium capable of storing program code, such as a USB flash drive, portable hard drive, read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk. For example, the computer-readable storage medium can be the aforementioned memory including program instructions, which can be executed by the processor of the intent recognition system 20 to complete the aforementioned intent recognition method. Those skilled in the art will recognize that the modules and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of each example have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0167] The above description is merely an example and illustration of the structure of the present invention. Those skilled in the art can make various modifications or additions to the specific embodiments described, or use similar methods to replace them, as long as they do not deviate from the structure of the invention or exceed the scope defined in the claims, all of which should fall within the protection scope of the present invention.
Claims
1. An intent recognition method based on a multi-turn dialogue dependency graph, characterized in that, Includes the following steps; Step 1: Based on the training data D train Constructing a multi-turn dialogue dependency graph G, including creating dialogue nodes N and establishing context edges E. ctx and dependent edge E dep ; Step 1 specifically involves: Step 1.1: From training data D train Extract multi-turn dialogue samples, and create dialogue node N for each round of dialogue samples. i Node attributes include intent i User dialogue action user_act i The previous round of system dialogue action pre_sys_act i and dialogue rounds i ; Step 1.2: For dialogue nodes in adjacent rounds within the same session, establish a context edge E. ctx The dialogue node in the previous round points to the dialogue node in the current round; within the same session, the dialogue node is determined by the user's speech. i And system speech S i Alternating structure, and includes user dialogue actions (user_act) i System dialogue action sys_act i Candidate Intent List I list ; Step 1.3: For each dialogue round, evaluate the dependency level (DL) between the current dialogue node and the historical dialogue nodes based on the large language model; the dependency level is divided into 1 to 5 levels, where level 1 represents no dependency and level 5 represents very strong dependency. Dependency level 1 represents that the current dialogue node and the historical dialogue node are independent; dependency level 2 represents general context; dependency level 3 represents intent inheritance; dependency level 4 represents referentiality; dependency level 5 represents direct causality. Step 1.4: Calculate the dependency evaluation vector V = [ ]; Recency represents the time decay factor, Recency = decay distance distance=turn source -turn target This represents the distance between dialogue rounds; decay is the decay coefficient, with a value range of [0.9, 0.95]; turn target For the historical dialogue rounds, turn source The current dialogue round is represented by Relevance, which represents semantic similarity. The embedding model is used to vectorize the user speech content corresponding to the two dialogue nodes into user speech vectors, and the cosine similarity between the two user speech vectors is calculated as semantic similarity. DL represents dependency level, which is normalized to the [0,1] interval by the maximum value of dependency level evaluated by the large language model. Since a dependency edge corresponds to multiple instances in the dataset, the final dependency evaluation vector V is obtained by averaging the Recency, Relevance, and DL of all instances. Step 1.5: Based on the weighted score of the dependency evaluation vector, establish dependency edges E between historical dialogue nodes and the current dialogue node that meet the preset threshold. dep The weighted score ;in , , For weighting coefficients; when Exceeding the preset threshold threshold At that time, a dependency edge E is established between the historical dialogue node and the current dialogue node. dep Step 2: For the multi-turn dialogue D to be identified test Node N is matched from the multi-turn dialogue dependency graph G based on semantic similarity. match ; Step 3: Based on the matching node N match Determine the dependencies and construct the dependency history H without dependency tags and the dependency history H with dependency tags. dep ; Step 4: Combine the history H without dependency tags and the candidate intent list I list Inputting a large language model for initial intent prediction yields the initial intent I. init The dependency history H containing dependency tags dep Current user's comments curr and initial intention I init Input a large language model, perform intent recognition, and output the final intent I. final .
2. The intent recognition method based on multi-turn dialogue dependency graph according to claim 1, characterized in that, Step 2 specifically involves: Step 2.1: For the Nth round of user speech U N First, based on the context edge E ctx Perform filtering, retaining only nodes N that match the previous round. match N-1 The set C of candidate nodes with contextual connections N In the initial dialogue round, the candidate node set C N For all initial dialogue nodes, filter out those with intent and I. init Consistent candidate nodes, calculate the current user's speech vector U. vec User action vectors for each candidate node (user_act) ivec The node with the highest cosine similarity is selected as the matching node N. mat ; Step 2.2: Calculate the current user's speech vector U vec User action vector for interaction with candidate nodes (user_act) ivec The cosine similarity is used as the semantic similarity; the candidate node with the highest semantic similarity is selected as the matching node N. match ; Step 2.3: When there are multiple candidate nodes with the same semantic similarity that are not the initial dialogue nodes, calculate the system speech vector S from the previous round. vec The previous system dialogue action vector sys_act with the candidate node ivec The cosine similarity is used for secondary screening.
3. The intent recognition method based on a multi-turn dialogue dependency graph according to claim 1, characterized in that, Step 3 includes: Step 3.1: From matching node N match Starting from this point, traverse its outgoing edges and obtain the set T of historical dialogue rounds that have dependencies on it. dep ; Step 3.2: Construct a history H without dependency tags: Concatenate the dialogue content of all historical dialogue rounds in sequence, without distinguishing dependencies; Step 3.3: Construct the dependency history H containing dependency tags dep For historical dialogue rounds t∈T with dependencies dep Add dependency tags in the dependency history.
4. The intent recognition method based on a multi-turn dialogue dependency graph according to claim 1, characterized in that, Step 4 includes: Step 4.1: Initial Intent Prediction: Combine the history H without dependency labels with the candidate intent list I list Embedding prompt word templates, calling a large language model to predict initial intent, and outputting initial intent I init ; Step 4.2: Final Intent Identification: Resolve the dependency history H containing dependency tags. dep Current user's comments curr and initial intention I init Embed prompt word templates, call a large language model for intent recognition, and output a formatted final intent I. final .
5. An intent recognition system based on a multi-turn dialogue dependency graph, characterized in that, The intent recognition method based on multi-turn dialogue dependency graph as described in any one of claims 1-4 includes a dependency graph construction module (21), a node matching module (22), a dependency context construction module (23), and an intent recognition module (24). The dependency graph construction module (21) is used to construct a multi-turn dialogue dependency graph based on training data, including creating dialogue nodes, establishing context edges and dependency edges; The node matching module (22) receives the multi-turn dialogue to be identified and matches nodes from the multi-turn dialogue dependency graph based on semantic similarity. The dependency context building module (23) builds a history without dependency tags and a dependency history with dependency tags based on the dependency relationship of the matching nodes; The intent recognition module (24) first inputs the history without dependency tags and the candidate intent list into the large language model to obtain the initial intent, and then inputs the dependency history with dependency tags, the current user's speech and the initial intent into the large language model. The large language model performs intent recognition and outputs the final intent.
6. The intent recognition system based on a multi-turn dialogue dependency graph according to claim 5, characterized in that, The dependency graph construction module (21) includes: The node creation unit (211) is used to extract multi-round dialogue samples from the training data and create a dialogue node for each round of dialogue sample. The node attributes include intent, user dialogue action, previous round of system dialogue action and dialogue round. The context edge establishment unit (212) is used to establish context edges between dialogue nodes in adjacent rounds of the same session; The dependency evaluation unit (213) is used to evaluate the dependency level between the current dialogue node and the historical dialogue node according to the large language model, and to calculate the dependency evaluation vector. The dependency edge establishment unit (214) is used to evaluate the weighted score of the vector based on the dependency relationship and establish dependency edges between the historical dialogue node and the current dialogue node that meet the threshold condition.
7. The intent recognition system based on a multi-turn dialogue dependency graph according to claim 5, characterized in that, The node matching module (22) includes: The initial node selection unit (221) is used for the user to speak in the initial dialogue round. It selects similar nodes from all initial dialogue nodes based on semantic similarity as matching nodes for the initial dialogue round. The context filtering unit (222) is used to filter the Nth round of user speech based on context edges, and retain only the set of candidate nodes that have a context connection relationship with the matching node in the previous round; The user vector matching unit (223) is used to calculate the cosine similarity between the current user's speech vector and the user dialogue action vector of the candidate node as the semantic similarity, and select the matching node with the highest semantic similarity. The system vector filtering unit (224) is used to further calculate the cosine similarity between the previous round system speech vector and the previous round system dialogue action vector of the candidate node for secondary filtering when there are multiple candidate nodes with the same semantic similarity.
8. A computer device, characterized in that, It includes a memory and a processor; the memory stores a computer program; the processor executes the computer program to implement the method of any one of claims 1-4.