A multi-turn dialogue method and system supporting multi-person real-time group chat
By encoding the context and predicting intent in multi-person group dialogues, combined with dialogue state tracking and personal profile updates, and using reinforcement learning to train dialogue strategies, efficient multi-turn dialogues in real-time multi-person group chats are achieved, solving the complexity problem of dialogue systems in multi-person group scenarios in existing technologies.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-17
- Publication Date
- 2026-03-24
AI Technical Summary
Existing multi-turn conversation systems are mainly designed for single users, which cannot effectively integrate the speeches of different users, and cannot freely start, switch and terminate tasks in multi-person groups, making the design of dialogue systems in multi-person group scenarios complex and expensive.
By acquiring user role information and text input in real time from multi-person group chats, performing context encoding and intent prediction, combining dialogue state tracking and personal profile updates, using sequence labeling models for semantic slot filling, and training dialogue strategies through reinforcement learning, multi-turn dialogues in real-time group chats are achieved.
It enables efficient management of dialogues in multi-person groups, simplifies complex dialogue strategies, solves the problems of task startup, switching and termination in multi-person group scenarios, and avoids errors and redundancy in conventional methods.
Smart Images

Figure CN116680374B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of natural language processing, and in particular to a multi-turn dialogue method and system that supports real-time group chat among multiple people. Background Technology
[0002] This invention mainly designs a multi-person task-based conversation system that supports real-time, multi-round task-based conversations in a multi-person group. It can simultaneously receive and process information from all users and flexibly perform tasks such as starting, stopping, and switching in multi-user scenarios.
[0003] Task-oriented dialogue systems are designed for specific vertical domains, aiming to help users complete pre-defined tasks or actions with as few dialogue turns as possible, such as booking flights, hotels, and restaurants. Most task-oriented dialogue systems have relatively small datasets, making it difficult to train models with large amounts of data. The initial cold-start problem requires manually defined rules, making the construction of dialogue systems expensive and time-consuming, thus limiting their application in other domains.
[0004] Currently, task-oriented conversations mostly use pipeline-based methods, which divide a complete dialogue process into three modules: Natural Language Understanding (NLU), Dialogue Management (DM), and Natural Language Generation (NLG).
[0005] The NLU module processes user text information and returns the corresponding domain, intent, and entity information. Domain recognition and intent detection fall under text classification tasks, while semantic slot filling belongs to sequence labeling tasks. The DM module needs to comprehensively analyze historical dialogue information and contextual information to determine and track the current dialogue state and decide on the appropriate system strategy, such as follow-up questions, clarification, or confirmation. Its main tasks include: Dialogue State Tracking (DST) and Dialogue Policy Generation (DP).
[0006] The main task of Natural Language Generation (NLG) is to transform the abstract expressions output by the DM module into syntactically valid and semantically accurate natural language sentences. A good response should possess contextual coherence, accuracy of content, readability, and diversity. NLG methods can be categorized into rule-based template / sentence planning methods, language model-based methods, and deep learning-based methods.
[0007] However, current multi-turn dialogue systems are designed for single users, and there is no mature dialogue system for multiple groups. Existing systems, such as group robots, are basically single-turn dialogue systems designed for one question and one answer. They cannot integrate the speeches of different users, nor can they be started, switched, and terminated freely between tasks. Summary of the Invention
[0008] The purpose of this invention is to address the shortcomings of existing technologies by proposing a multi-turn dialogue method and system that supports real-time group chat among multiple people.
[0009] The objective of this invention is achieved through the following technical solution: a multi-turn dialogue method supporting real-time group chat for multiple users, the method comprising the following steps:
[0010] S1. In real time, obtain the user role information and text input information of a newly sent dialogue text in a multi-person group dialogue, perform context encoding on the text input information, and obtain the context encoding representation of the text.
[0011] S2. Combine the context encoding representation of the text with user role information to perform domain prediction and intent prediction. Based on the sequence labeling model, the entity of the text is labeled. The input text is semantically classified to obtain the domain, intent and semantic slot entities corresponding to the dialogue text issued by the user role. The intent and slot filling tasks are jointly trained.
[0012] S3. Combine the dialogue state tracking method with the user's unique or shared personal profile to update the previous dialogue state and fill the semantic slots; at the same time, retain the semantic information and user information of the semantic slots.
[0013] S4. Based on the updated dialogue state and semantic slot information, the dialogue strategy method is used to calculate and combine the encoded representation containing role information with the external database and external interface transmission.
[0014] S5. Based on the encoded representation in S4, match the corresponding dialogue generation template, and choose to either not interrupt the dialogue or output the dialogue text generated in the current dialogue state according to the intent of the dialogue text, thus completing a single-turn dialogue.
[0015] S6. Continue to wait for the next input from a user and repeat the above steps.
[0016] Furthermore, the context encoding in S1 specifically refers to the hidden layer encoding sequence output by the input text after passing through the BERT pre-trained language model as h = (h1, h2, ..., h...). N ), where h i Let be an n-dimensional vector representing the encoding of the i-th word in the text.
[0017] Furthermore, the neighborhood prediction in S2 specifically includes:
[0018] After the context encoding representation is input into the softmax layer, the probability distribution prediction d(h) on the domain set D is performed; the domain prediction domain∈D is the domain corresponding to the maximum value in d(h).
[0019] Furthermore, the intention prediction in S2 specifically includes:
[0020] After the context-encoded representation is input into the softmax layer, the probability prediction f(h) of the intent distribution for the intent set I is performed. The specific formula is as follows:
[0021] f(h) = softmax(W) f h1+W intent y+b f )
[0022] Wherein, parameter W f W is an m×n dimensional second-order matrix. intent Let b be an m×M dimensional second-order matrix. f Let y be an m-dimensional vector, and let M be an M-dimensional vector. The total number of users in the system is M. Let M represent the recorded intent distribution of each user. If no intent has been recorded, it is set to an empty intent. An empty intent means that the system does not need to respond to the query, but will record the input text and slot filling status as historical information.
[0023] The intent prediction also sets an intent threshold k0 and a specific intent representing user behavior, with text corresponding to the intent.
[0024]
[0025] Special intents represent user actions rather than requests for help from the system. They do not require a system response or specific procedures. Special intents that require adding or clarifying slot information include: agreeing with other users and opposing other users. Special intents that are processed normally include: joining a topic, starting a new topic, adding to a topic, and ending a topic.
[0026] Furthermore, in S2, entity annotation of the text is performed based on a sequence labeling model, that is, for each word x in the text x. i Categorize:
[0027] g(h i = softmax(W) g h i +b g ), i∈1,2,…,N.
[0028] Wherein, parameter W g Let b be an m×n dimensional second-order matrix. g It is an m-dimensional vector. The word x is obtained by calculating using formula g. i If the corresponding semantic slot is "slot", then fill the corresponding semantic slot with slot.insert({x i Since there are multiple users, the entity x corresponding to the slot is stored simultaneously. iAnd user ID; that is, satisfying the following characteristics: each slot has more than one single value, and a hash_map structure is used to store the entities filled by different users. The entities filled by different users serve as the personal profiles of the corresponding users. When the same entity serves as the personal profiles of different users, the entity is a common profile of different users.
[0029] Furthermore, the joint training of the intent and slot filling tasks specifically involves:
[0030] When jointly training the intent and slot filling tasks, maximize the conditional probability:
[0031]
[0032] Where g i =g(x i f has already incorporated the intent distributions of multiple users. To implement model training, this end-to-end joint model is fine-tuned during training by minimizing the cross-entropy loss of the conditional probability p(f, g|x).
[0033] Furthermore, the dialogue state tracking method organizes possible dialogue states using a tree structure, and its specific requirements are as follows:
[0034] The current dialogue state is determined by matching domain and slot information. This is represented as a node in a tree-like state tree, where each child node represents a dialogue state obtained by writing a value to a potentially used but unfilled slot in its own slot information. Specifically, the root node indicates an initial state where no slots are filled; leaf nodes indicate that the slots filled in the current dialogue state already contain the slot values required for all non-empty and non-specific intents in that state, meaning that no slot filling is needed to output the information required by the current dialogue user.
[0035] Furthermore, the slots in the dialogue state are jointly maintained by all users. When a slot has been filled by one or more users, the user determines whether to fill it based on the input user role information and whether the user has shown any special intent in the historical information. If the user has no special intent to "oppose other users" in the historical information, then the slot is used if it has been filled by the current user in the dialogue. In addition, slots in the dialogue state can also be filled by other user roles in the dialogue. When it is decided not to use any slot, the slot is displayed as unfilled in the dialogue state.
[0036] Furthermore, the dialogue strategy method specifically involves: for the obtained dialogue state s0, training a policy selection model A using a reinforcement learning machine with active teaching functionality to obtain the policy a1 = A(s0) to be adopted for the current state. Policy a1 is the path from the current node in the state tree to other nodes in the subtree rooted at the current node. The reinforcement objective is to minimize the number of policy steps to reach the leaf node that satisfies the current intention, i.e., the reward function is designed as follows:
[0037]
[0038] Where s1 represents the dialogue state after the initial state s0 is processed by policy a1, and depth(s) represents the depth of the corresponding node in the state tree for state s. Maximizing the reward is achieved through O-learning training.
[0039] U t =R t +γR t+1 +γ 2 R t+2 +γ 3 R t+3 +…
[0040] The choice model A(s), where R t Let represent the reward function at step t, where γ is a constant less than 1.
[0041] The active teaching function is as follows: calculate the confidence of policy a1 through the pre-trained model. If the confidence is lower than the set threshold, let a human give a policy a1′ to correct the error and provide a reward function to train model A.
[0042] On the other hand, this invention also provides a system for implementing the method, the system comprising: a dialogue management module, a natural language understanding module, and a natural language generation module;
[0043] The natural language understanding module is used to perform domain prediction and intent prediction by combining the context encoding representation of the text with user role information, to perform entity annotation of the text based on the sequence labeling model, to perform semantic classification of the input text, to obtain the domain, intent and semantic slot entities corresponding to the dialogue text issued by the user role, and to jointly train the intent and slot filling tasks.
[0044] The dialogue management module is used to update the previous dialogue state by combining the dialogue state tracking method with the user's unique or shared personal profile; and to fill the semantic slots. At the same time, the semantic information and user information of the semantic slots are retained.
[0045] The natural language generation module is used to calculate based on the updated dialogue state and semantic slot information, combined with the external database and external interface to transmit encoded representations containing role information; based on the encoded representations, it matches the corresponding dialogue generation templates, and selects whether to not interrupt the dialogue or output the dialogue text generated by the current dialogue state according to the intent of the dialogue text, thus completing a single round of dialogue.
[0046] The beneficial effects of this invention are: it fills the gap in multi-person, multi-turn conversation systems, solves errors that occur in conventional single-slot methods in the same scenario, and simplifies the complex dialogue strategies that are unavoidable in conventional single-slot methods in the same scenario. Through predefined empty intents and special intents, it provides new triggers for solving state management problems such as task start and end in groups. It allows multiple people to simultaneously fill the same slot for the same task and resolves conflicts. Attached Figure Description
[0047] Figure 1 A flowchart of a multi-turn dialogue method supporting real-time group chat for multiple people provided in an embodiment of the present invention;
[0048] Figure 2 A flowchart illustrating the implementation of dialogue management in an embodiment of the present invention;
[0049] Figure 3 Diagram of an embodiment of the dialogue method 1 provided in this invention;
[0050] Figure 4 The diagram shows an embodiment of the single-slot replacement method used in Dialogue 2 provided by this invention.
[0051] Figure 5 The diagram shows an embodiment of the single-slot query clarification method used in Dialogue 3 provided in this invention. Detailed Implementation
[0052] The specific embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.
[0053] like Figure 1 As shown, this invention provides a multi-turn dialogue method and system that supports real-time group chat with multiple people.
[0054] The objective of this invention is achieved through the following technical solution: a multi-turn dialogue method supporting real-time group chat for multiple users, the method comprising the following steps:
[0055] S1. In real time, obtain the user role information and text input information of a newly sent dialogue text in a multi-person group dialogue, perform context encoding on the text input information, and obtain the context encoding representation of the text.
[0056] S2. Combine the context encoding representation of the text with user role information to perform domain prediction and intent prediction. Based on the sequence labeling model, the entity of the text is labeled. The input text is semantically classified to obtain the domain, intent and semantic slot entities corresponding to the dialogue text issued by the user role. The intent and slot filling tasks are jointly trained.
[0057] S3. Combine the dialogue state tracking method with the user's unique or shared personal profile to update the dialogue state and populate the semantic slots; at the same time, retain the semantic information and user information of the semantic slots.
[0058] S4. Based on the updated dialogue state and semantic slot information, the dialogue strategy method is used to calculate and combine the encoded representation containing role information with the external database and external interface transmission.
[0059] S5. Based on the encoded representation in S4, match the corresponding dialogue generation template, and choose to either not interrupt the dialogue or output the dialogue text generated in the current dialogue state according to the intent of the dialogue text, thus completing a single-turn dialogue.
[0060] S6. Continue to wait for the next input from a user and repeat the above steps.
[0061] Furthermore, the context encoding in S1 specifically refers to the hidden layer encoding sequence output by the input text after passing through the BERT pre-trained language model as h = (h1, h2, ..., h...). N ), where h i Let be an n-dimensional vector representing the encoding of the i-th word in the text.
[0062] Furthermore, the neighborhood prediction in S2 specifically includes:
[0063] After the context-encoded representation is input into the softmax layer, the probability distribution f(h) is predicted on the domain set D; the domain prediction domain∈D is the domain corresponding to the maximum value in d(h).
[0064] Furthermore, the intention prediction in S2 specifically includes:
[0065] After the context-encoded representation is input into the softmax layer, the probability prediction f(h) of the intent distribution for the intent set I is performed. The specific formula is as follows:
[0066] f(h) = softmax(W) f h1+W intent y+b f )
[0067] Wherein, parameter W f W is an m×n dimensional second-order matrix. intent Let b be an m×M dimensional second-order matrix. fLet y be an m-dimensional vector, and let M be an M-dimensional vector. The total number of users in the system is M. Let M represent the recorded intent distribution of each user. If no intent has been recorded, it is set to an empty intent. An empty intent means that the system does not need to respond to the query, but will record the input text and slot filling status as historical information.
[0068] The intent prediction also sets an intent threshold k0 and a specific intent representing user behavior, with text corresponding to the intent.
[0069]
[0070] Special intents represent user actions rather than requests for help from the system. They do not require a system response or specific procedures. Special intents that require adding or clarifying slot information include: agreeing with other users and opposing other users. Special intents that are processed normally include: joining a topic, starting a new topic, adding to a topic, and ending a topic.
[0071] Furthermore, in S2, entity annotation of the text is performed based on a sequence labeling model, that is, for each word x in the text x. i Categorize:
[0072] g(h i = softmax(W) g h i +b g ), i∈1,2,…,N.
[0073] Wherein, parameter W g Let b be an m×n dimensional second-order matrix. g It is an m-dimensional vector. The word x is obtained by calculating using formula g. i If the corresponding semantic slot is "slot", then fill the corresponding semantic slot with slot.insert({x i Since there are multiple users, the entity x corresponding to the slot is stored simultaneously. i And user i; that is, satisfying the following characteristics: each slot has more than one single value, and the entities filled by different users are stored in a hash_map structure. The entities filled by different users serve as the personal profiles of the corresponding users. When the same entity serves as the personal profiles of different users, the entity is a common profile of different users.
[0074] Furthermore, the joint training of the intent and slot filling tasks specifically involves:
[0075] When jointly training the intent and slot filling tasks, maximize the conditional probability:
[0076]
[0077] Where gi =g(x i f has already incorporated the intent distributions of multiple users. To implement model training, this end-to-end joint model is fine-tuned during training by minimizing the cross-entropy loss of the conditional probability p(f, g|x).
[0078] Furthermore, the dialogue state tracking method organizes possible dialogue states using a tree structure, and its specific requirements are as follows:
[0079] The current dialogue state is determined by matching domain and slot information. This is represented as a node in a tree-like state tree, where each child node represents a dialogue state obtained by writing a value to a potentially used but unfilled slot in its own slot information. Specifically, the root node indicates an initial state where no slots are filled; leaf nodes indicate that the slots filled in the current dialogue state already contain the slot values required for all non-empty and non-specific intents in that state, meaning that no slot filling is needed to output the information required by the current dialogue user.
[0080] Specifically, we can use a string of binary bits to represent the current slot status. A binary bit of 1 indicates that the corresponding slot has been filled, and a binary bit of 0 indicates that the corresponding slot has not been filled. For example,
[01000] means that only the lower 4 bits of the corresponding slot have been filled.
[0081] Furthermore, the slots in the dialogue state are jointly maintained by all users. When a slot has been filled by one or more users, the user determines whether to fill it based on the input user role information and whether the user has shown any special intent in the historical information. If the user has no special intent to "oppose other users" in the historical information, then the slot is used if it has been filled by the current user in the dialogue. In addition, slots in the dialogue state can also be filled by other user roles in the dialogue. When it is decided not to use any slot, the slot is displayed as unfilled in the dialogue state.
[0082] Furthermore, the dialogue strategy method specifically involves: for the obtained dialogue state s0, training a policy selection model A using a reinforcement learning machine with active teaching functionality to obtain the policy a1 = A(s0) to be adopted for the current state. Policy a1 is the path from the current node in the state tree to other nodes in the subtree rooted at the current node. The reinforcement objective is to minimize the number of policy steps to reach the leaf node that satisfies the current intention, i.e., the reward function is designed as follows:
[0083]
[0084] Where s1 represents the dialogue state after the initial state s0 is processed by policy a1, and depth(s) represents the depth of the corresponding node in the state tree for state s. Q-learning is used to maximize the reward.
[0085] U t =R t +γR t+1 +γ 2 R t+2 +γ 3 R t+3 +…
[0086] The choice model A(s), where R t Let represent the reward function at step t, where γ is a constant less than 1.
[0087] The active teaching function is as follows: calculate the confidence of policy a1 through the pre-trained model. If the confidence is lower than the set threshold, let a human give a policy a1′ to correct the error and provide a reward function to train model A.
[0088] On the other hand, such as Figure 1 As shown, this embodiment of the invention also provides a system for implementing the method, the system comprising: a dialogue management module, a natural language understanding module, and a natural language generation module;
[0089] The natural language understanding module is used to perform domain prediction and intent prediction by combining the context encoding representation of the text with user role information, to perform entity annotation of the text based on the sequence labeling model, to perform semantic classification of the input text, and to obtain the domain, intent and semantic slot entities corresponding to the dialogue text issued by the user role; and to jointly train the intent and slot filling tasks.
[0090] like Figure 2 The dialogue management module described above is used to update the previous dialogue state by combining the dialogue state tracking method with the user's unique or shared personal profile; and to fill the semantic slots. At the same time, the semantic information and user information of the semantic slots are retained.
[0091] The natural language generation module is used to calculate based on the updated dialogue state and semantic slot information, combined with the external database and external interface to transmit encoded representations containing role information; based on the encoded representations, it matches the corresponding dialogue generation templates, and selects whether to not interrupt the dialogue or output the dialogue text generated by the current dialogue state according to the intent of the dialogue text, thus completing a single round of dialogue.
[0092] Implementation Case:
[0093] The following are illustrations showing the effect of an intelligent question-answering robot implemented using the multi-slot method described in this patent in a multi-person group scenario, when two people simultaneously fill the same slot location and time, as well as the shortcomings of intelligent question-answering robots implemented using two conventional single-slot methods when facing the same scenario.
[0094] like Figure 3 , Figure 4 and Figure 5 As shown, there are three dialogue characters in this scene. The avatars "Lake" and "Stream" represent tourists who only visit West Lake and tourists who visit Xixi Wetland first, respectively. The avatar "Guide" represents a virtual tour guide robot. The dialogue occurs linearly in the order shown in the diagram.
[0095] In this example, we let "lake" represent user A and "stream" represent user B. The eight dialogue segments are represented as Query1 to Query8 according to the order of the conversation. For example, in the dialogue record using the multi-user slot method of this patent, Query1 represents the statement sent by user A: "I have something to do tomorrow, how about we go for a stroll around West Lake together in the backend?" Furthermore, we will denote the following three different dialogue records generated by the three different methods as Dialogue 1 to Dialogue 3.
[0096] The following shows the slot filling status during the three dialogues:
[0097] Query1:
[0098] The Query1 for all three dialogues is the same. After being identified by the NLU module, the location and time slots are filled. However, when filling the slots, the IDs of the people whose slots are filled are additionally saved (here identified as A and B).
[0099] In addition, when filling the time slot, "the day after tomorrow" has been directly replaced with "20221004: null" according to the actual time generated by the dialogue and certain rules, indicating October 4, 2022. The time accurate to the hour and minute was not filled as null. Since no specific question and answer business was triggered, no dialogue strategy such as supplementation was performed.
[0100] slot Place time Dialogue 1 {A, West Lake} {A, 20221004: null} Dialogue 2 West Lake 20221004: null Dialogue 3 West Lake 20221004: null
[0101] Query2:
[0102] slot Place time Dialogue 1 {A, West Lake}, {B, Xixi Wetland} {A, 20221004: null} Dialogue 2 Xixi Wetland 20221004: null Dialogue 3 null 20221004: null
[0103] Query3:
[0104] Query3 user A activates the Q&A system's answer system (DM module + NLG module) through the "@guide" trigger, and simultaneously starts the "query specific attractions / photo spots in [XX] scenic area" business after being identified by the NLU module, without changing the slot.
[0105] Query4:
[0106] In the three dialogues, the DM module adopted different dialogue strategies based on the business category "Query specific attractions / photo spots within [XX] scenic area" and the previously filled slots.
[0107] Dialogue 1: According to the method described in the technical solution S2 of this patent, the dialogue strategy for querying and returning specific tourist / photo spots in the [West Lake] scenic area is calculated based on the dialogue initiator A and the location slots "{A, West Lake}, {B, Xixi Wetland}". The results are returned by recording the data in the knowledge graph of the graph database: "Popular photo spots in West Lake include: Broken Bridge in Snow, Autumn Moon over the Calm Lake, Lotus in the Breeze at Quyuan Garden, Twin Peaks Piercing the Clouds, Spring Dawn on Su Causeway, Viewing Fish at Flower Harbor, Three Pools Mirroring the Moon, Evening Bell at Nanping Hill, Sunset Glow at Leifeng Pagoda, and Orioles Singing in the Willows".
[0108] Dialogue 2: Due to the use of the single-slot replacement method, when user A initiates a business query, the location slot corresponding to the business category "Query specific tourist / photo spots in [XX] scenic area" has been replaced with "Xixi Wetland" filled by user B. Therefore, the result corresponding to Xixi Wetland is returned by the knowledge graph recorded in the graph database: "Popular photo spots in Xixi Wetland include: Yanshui Fishing Village, Bo'an Thatched Cottage, Xixi Water Pavilion, Meizhu Villa, Shentankou, Xixi Thatched Cottage".
[0109] Dialogue 3: Due to the use of the single-slot query clarification method, a conflict occurred in the location slots after Query1 and Query2, and a conflict record was generated. Therefore, based on the dialogue strategy of the single-slot query clarification method, the strategy of query clarification of location slots was adopted, and the question "What popular tourist attractions and photo spots do you want to query?" was generated in the NLG module.
[0110] Summary of the first 4 queries:
[0111] In the same scenario, when faced with two users having the same three-line dialogue, the method used in dialogue 2 resulted in incorrect answers, and the method used in dialogue 3 resulted in an overly complex and redundant dialogue strategy. Only dialogue 1, which used the method shown in this patent, yielded a reasonable result.
[0112] Query5~Query8:
[0113] After Query4 returned different results, both Dialogue 2 and Dialogue 3 adopted corresponding strategies to conduct additional dialogues to make up for the problems.
[0114] As you can see, in a dialogue with the same 8 queries, the results of 3 dialogues are as follows:
[0115] Business Numbers result Dialogue 1 3 Three business transactions received the correct responses. Dialogue 2 2 One service received an error response and was corrected; one service was not completed. Dialogue 3 2 One transaction received a correct response, and one transaction was not completed.
[0116] The final status of the slots after 8 queries is shown below:
[0117] slot Place time Specific landscape Dialogue 1 {A, West Lake}, {B, Xixi Wetland} {A, 20221004: null} {B, 20221003: null} {B, Autumn Reeds and Flying Snow} Dialogue 2 West Lake 20221004: null null Dialogue 3 West Lake 20221004: null null
[0118] The above embodiments are used to explain and illustrate the present invention, but not to limit the present invention. Any modifications and changes made to the present invention within the spirit and scope of the claims shall fall within the protection scope of the present invention.
Claims
1. A multi-turn dialogue method supporting real-time group chat with multiple people, characterized in that, The method includes the following steps: S1. In real time, obtain the user role information and text input information of a newly sent dialogue text in a multi-person group dialogue, perform context encoding on the text input information, and obtain the context encoding representation of the text. S2. Combine the context encoding representation of the text with user role information to perform domain prediction and intent prediction. Based on the sequence labeling model, the entity of the text is labeled. The input text is semantically classified to obtain the domain, intent and semantic slot entities corresponding to the dialogue text issued by the user role. The intent and slot filling tasks are jointly trained. The intention prediction in S2 specifically refers to: After the context-encoded representation is input into the softmax layer, the probability prediction f(h) of the intent distribution for the intent set I is performed. The specific formula is as follows: f(h)=softmax(W f h1+W intent y+b f ) Wherein, parameter W f W is an m×n dimensional second-order matrix. intent Let b be an m×M dimensional second-order matrix. f Let y be an m-dimensional vector, and M be an M-dimensional vector. The total number of users is M. Let M represent the recorded intent distribution of each user. If no intent has been recorded, it is set to an empty intent. An empty intent means that the system does not need to respond to the query, but will record the input text and slot filling status as historical information. The intent prediction also sets an intent threshold k0 and a specific intent representing user behavior, with text corresponding to the intent. Special intents represent user actions rather than requests for help from the system. They do not require a system response or specific procedures. Special intents that require adding or clarifying slot information include: agreeing with other users and opposing other users. Special intents that are processed normally include: joining a topic, starting a new topic, adding to a topic, and ending a topic. S3. Combine the dialogue state tracking method with the user's unique or shared personal profile to update the previous dialogue state and fill the semantic slots; at the same time, retain the semantic information and user information of the semantic slots. S4. Based on the updated dialogue state and semantic slot information, the dialogue strategy method is used to calculate and combine the encoded representation containing role information with the external database and external interface transmission. The dialogue strategy method is as follows: For the obtained dialogue state s0, a policy selection model A is trained using a reinforcement learning machine with active teaching functionality to obtain the policy a1 = A(s0) to be adopted for the current state. Policy a1 is the path from the current node in the state tree to other nodes in the subtree rooted at the current node. The reinforcement objective is to minimize the number of policy steps to reach the leaf node that satisfies the current intention, i.e., the reward function is designed as follows: Where s1 represents the dialogue state after the initial state s0 is processed by policy a1, and depth(s) represents the depth of the corresponding node in the state tree for state s; the maximum reward is obtained through Q-learning training. U t =R t +γR t+1 +γ 2 R t+2 +γ 3 R t+3 +…the choice model A(s), where R t Let represent the reward function at step t, where γ is a constant less than 1; The active teaching function is as follows: calculate the confidence of policy a1 through the pre-trained model; if the confidence is lower than the set threshold, let a human give a policy a1′ to correct the error and provide a reward function to train model A. S5. Based on the encoded representation in S4, match the corresponding dialogue generation template, and choose to either not interrupt the dialogue or output the dialogue text generated in the current dialogue state according to the intent of the dialogue text, thus completing a single-turn dialogue. S6. Continue to wait for the next input from a user and repeat the above steps.
2. The multi-turn dialogue method supporting real-time group chat for multiple users according to claim 1, characterized in that, The context encoding in S1 specifically refers to the hidden layer encoding sequence output by the input text after passing through the BERT pre-trained language model, which is h = (h1, h2, ..., h...). N ), where h i Let be an n-dimensional vector representing the encoding of the i-th word in the text.
3. The multi-turn dialogue method supporting real-time group chat for multiple users according to claim 1, characterized in that, The specific domain prediction in S2 is as follows: After the context encoding representation is input into the softmax layer, the probability distribution prediction d(h) on the domain set D is performed; the domain prediction domain∈D is the domain corresponding to the maximum value in d(h).
4. A multi-turn dialogue method supporting real-time group chat for multiple users according to claim 1, characterized in that, In S2, entity annotation of the text is performed based on the sequence labeling model, that is, for each word x in the text x. i Categorize: g(h i )=softmax(W g h i +b g ),i∈1,2,…,N Wherein, parameter W g Let b be an m×n dimensional second-order matrix. g Given an m-dimensional vector; word x is obtained by calculating using formula g. i If the corresponding semantic slot is "slot", then fill the corresponding semantic slot with slot.insert({x i Since there are multiple users, the entity x corresponding to each slot is stored simultaneously. i And user ID; that is, satisfying the following characteristics: each slot has more than one single value, and a hash_map structure is used to store the entities filled by different users. The entities filled by different users serve as the personal profiles of the corresponding users. When the same entity serves as the personal profiles of different users, the entity is a common profile of different users.
5. A multi-turn dialogue method supporting real-time group chat for multiple users according to claim 4, characterized in that, The joint training of the intent and slot filling tasks specifically involves... When jointly training the intent and slot filling tasks, maximize the conditional probability: Where g i =g(x i f has already incorporated the intent distributions of multiple users. To implement model training, this end-to-end joint model is fine-tuned during training by minimizing the cross-entropy loss of the conditional probability p(f,g|x).
6. A multi-turn dialogue method supporting real-time group chat for multiple users according to claim 1, characterized in that, The dialogue state tracking method uses a tree structure to organize possible dialogue states, and its specific requirements are as follows: The current dialogue state is matched based on the domain and slot information. Specifically, it is represented as a node in a tree-like state tree. Its child nodes represent the dialogue state obtained by writing a value to a slot in its own slot information that may be used but has not yet been filled. In particular, the root node represents the initial state where no slots have been filled. The leaf nodes represent the current dialogue state where the filled slots already have the slot value information required by all non-empty intentions and non-special intentions in that state. That is, the information required by the current dialogue user can be output without filling any slots.
7. A multi-turn dialogue method supporting real-time group chat for multiple users according to claim 1, characterized in that, In the dialogue state, slots are maintained jointly by all users. When a slot has been filled by one or more users, the user determines whether to fill it based on the input user role information and whether the user has shown any special intent in the historical information. If the user has no special intent to "oppose other users" in the historical information, then the slot is used if it has been filled by the current user in the dialogue. In addition, slots in the dialogue state can also be filled by other user roles in the dialogue. When it is decided not to use any slot, the slot is displayed as unfilled in the dialogue state.
8. A system for implementing the method according to any one of claims 1-7, characterized in that, The system includes: a dialogue management module, a natural language understanding module, and a natural language generation module; The natural language understanding module is used to perform domain prediction and intent prediction by combining the context encoding representation of the text with user role information, to perform entity annotation of the text based on the sequence labeling model, to perform semantic classification of the input text, to obtain the domain, intent and semantic slot entities corresponding to the dialogue text issued by the user role, and to jointly train the intent and slot filling tasks. The dialogue management module is used to update the previous dialogue state by combining the dialogue state tracking method with the user's unique or shared personal profile; and to fill the semantic slots. At the same time, the semantic information and user information of the semantic slots are retained. The natural language generation module is used to calculate based on the updated dialogue state and semantic slot information, combined with the external database and external interface to transmit encoded representations containing role information; based on the encoded representations, it matches the corresponding dialogue generation templates, and selects whether to not interrupt the dialogue or output the dialogue text generated by the current dialogue state according to the intent of the dialogue text, thus completing a single round of dialogue.
Citation Information
Patent Citations
Multi-round dialogue intelligent voice interaction system and device
CN110209791A
Collaboration-oriented voice interaction system and method
CN115294988A