Dialogue state recognition model training and dialogue state recognition method and device
By processing dialogue data through the encoding and decoding layers of the dialogue state recognition model and training the model until convergence, the problem of inaccurate dialogue state recognition is solved, and accurate generation of dialogue state is achieved, thus improving the user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-22
- Publication Date
- 2026-03-27
AI Technical Summary
Existing technologies cannot accurately identify the user's conversational state, causing chatbots to fail to accurately understand user needs and affecting user experience.
The dialog state recognition model encodes the sample dialog data through its encoding layer to generate the sample hidden state, and generates the slot value of the dialog state slot through its decoding layer. The model is then trained until it converges to achieve accurate recognition of the dialog state.
It improves the accuracy of dialogue state recognition and can generate implicit abstract dialogue states that do not appear in the dialogue text, thus enhancing the user dialogue experience.
Smart Images

Figure CN116822605B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present specification relate to the technical field of artificial intelligence, and in particular to a dialog state recognition model training method and device, and a dialog state recognition method and device. BACKGROUND
[0002] In recent years, with the rapid development of the Internet, a large number of services support online provision. Various services need to rely on a large number of dialog interaction processes, such as consultation, inquiry, marketing, and other interaction processes that need to be dialoged with users. In order to improve the efficiency of dialog interaction, intelligent dialog robots have been widely used in various dialog services to dialog with users. In order to enable the dialog robot to accurately meet the user's needs based on the user's dialog information, it is necessary to accurately identify the user's dialog state first, so that the dialog robot can successfully dialog with the user according to the accurate dialog state. SUMMARY
[0003] Embodiments of the present specification provide a dialog state recognition model training method and device, and a dialog state recognition method and device, which can solve the technical problem that the user's dialog state cannot be accurately identified in related technologies.
[0004] In a first aspect, embodiments of the present specification provide a dialog state recognition model training method, which comprises:
[0005] inputting sample dialog data into a dialog state recognition model, encoding the sample dialog data based on an encoding layer of the dialog state recognition model, and generating a sample hidden state corresponding to the sample dialog data;
[0006] decoding the sample hidden state based on a decoding layer of the dialog state recognition model, and generating a sample slot value corresponding to at least one preset type of dialog state slot in the sample dialog data;
[0007] training the dialog state recognition model according to the standard slot value corresponding to the sample dialog data and the sample slot value until the dialog state recognition model converges.
[0008] In a second aspect, embodiments of the present specification provide a dialog state recognition method, which comprises:
[0009] inputting to-be-recognized dialog data into a dialog state recognition model, encoding the to-be-recognized dialog data based on an encoding layer of the dialog state recognition model, and generating a target hidden state corresponding to the to-be-recognized dialog data;
[0010] decoding the target hidden state based on a decoding layer of the dialog state recognition model, and generating a target slot value corresponding to at least one preset type of dialog state slot in the to-be-recognized dialog data;
[0011] The dialog state recognition model is a dialog state recognition model trained and converged by the dialog state recognition model training method in any of the preceding embodiments.
[0012] In a third aspect, the embodiments of the present specification provide a dialog state recognition model training device, which comprises:
[0013] a sample encoding module configured to input sample dialog data into the dialog state recognition model, encode the sample dialog data based on an encoding layer of the dialog state recognition model, and generate a sample hidden state corresponding to the sample dialog data;
[0014] a sample decoding module configured to decode the sample hidden state based on a decoding layer of the dialog state recognition model, and generate a sample slot value corresponding to a dialog state slot of a preset type in the sample dialog data;
[0015] a model training module configured to train the dialog state recognition model according to the standard slot value corresponding to the sample dialog data and the sample slot value until the dialog state recognition model converges.
[0016] In a fourth aspect, the embodiments of the present specification provide a dialog state recognition device, which comprises:
[0017] a target encoding module configured to input to-be-recognized dialog data into the dialog state recognition model, encode the to-be-recognized dialog data based on an encoding layer of the dialog state recognition model, and generate a target hidden state corresponding to the to-be-recognized dialog data;
[0018] a target decoding module configured to decode the target hidden state based on a decoding layer of the dialog state recognition model, and generate a target slot value corresponding to a dialog state slot of a preset type in the to-be-recognized dialog data;
[0019] The dialog state recognition model is a dialog state recognition model trained and converged by the dialog state recognition model training method in any of the preceding embodiments.
[0020] In a fifth aspect, the embodiments of the present specification provide a computer program product containing instructions, which, when executed on a computer or a processor, cause the computer or the processor to perform the steps of the method described above.
[0021] In a sixth aspect, the embodiments of the present specification provide a computer storage medium storing a plurality of instructions, which are suitable for being loaded and executed by a processor to perform the steps of the method described above.
[0022] In a seventh aspect, the embodiments of the present specification provide a terminal, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being adapted to be loaded by the processor and execute the steps of the method described above.
[0023] The technical solutions provided by some embodiments of the present specification have at least the following beneficial effects:
[0024] The embodiments of the present specification provide a dialogue state recognition model training method. Sample dialogue data is input into a dialogue state recognition model, the sample dialogue data is encoded based on the encoding layer of the dialogue state recognition model, and a sample hidden state corresponding to the sample dialogue data is generated. The sample hidden state is decoded based on the decoding layer of the dialogue state recognition model, and a sample slot value corresponding to at least one preset type of dialogue state slot in the sample dialogue data is generated. The dialogue state recognition model is trained according to the standard slot value corresponding to the sample dialogue data and the sample slot value until the dialogue state recognition model converges. Generally, the dialogue content hidden state can reflect the feature meaning contained in the dialogue content. Therefore, after the dialogue state recognition model after training converges encodes the dialogue data to obtain the hidden state and then decodes on the basis of the hidden state, the dialogue state contained in the dialogue content can be parsed therefrom. Based on the accurate analysis of the dialogue content, the dialogue state recognition model can accurately generate an implicit and abstract dialogue state that does not appear in the dialogue text, complete the dialogue state generation from scratch, obtain an accurate dialogue state for further intelligent dialogue generation scenarios, and improve the user dialogue experience. BRIEF DESCRIPTION OF DRAWINGS
[0025] In order to more clearly illustrate the technical solutions in the embodiments of the present specification or the prior art, brief descriptions will be given below for the drawings needed to be used in the embodiments or prior art descriptions. Obviously, the drawings in the following description are only some embodiments of the present specification, and other drawings can also be obtained by those skilled in the art without creative labor on the basis of these drawings.
[0026] Figure 1 An exemplary system architecture diagram of a dialogue state recognition model training method provided by the embodiments of the present specification is shown in the following figure:
[0027] Figure 2 A flowchart of a dialogue state recognition model training method provided by the embodiments of the present specification is shown in the following figure:
[0028] Figure 3 A flowchart of a dialogue state recognition model training method provided by the embodiments of the present specification is shown in the following figure:
[0029] Figure 4 A logic flowchart of a dialogue state recognition model provided by the embodiments of the present specification is shown in the following figure:
[0030] Figure 5 A flowchart of a dialogue state recognition method provided by an embodiment of the present specification is shown in the following figure:
[0031] Figure 6 A structural block diagram of a dialogue state recognition model training device provided by an embodiment of the present specification is shown in the following figure:
[0032] Figure 7 A structural block diagram of a dialogue state recognition device provided by an embodiment of the present specification is shown in the following figure:
[0033] Figure 8 A structural diagram of a terminal provided by an embodiment of the present specification is shown in the following figure. DETAILED DESCRIPTION
[0034] In order to make the features and advantages of the embodiments of the present specification more obvious and easy to understand, the technical solutions in the embodiments of the present specification will be described clearly and completely in conjunction with the drawings in the embodiments of the present specification. Obviously, the described embodiments are only some of the embodiments of the present specification, not all. Based on the embodiments in the present specification, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the embodiments of the present specification.
[0035] The following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementation described in the following exemplary embodiments does not represent all the implementations consistent with the embodiments of the present specification. Instead, they are only examples of devices and methods consistent with some aspects of the embodiments of the present specification as detailed in the appended claims.
[0036] When providing interactive services to users through a network, in order to improve service efficiency, reduce manual participation and save human resources, intelligent dialogue robots have been widely used in services to dialogue and reply. In the dialogue process, the dialogue content usually contains a large amount of information, and the user's dialogue state in the dialogue has various forms of expression, which may be explicitly expressed in the dialogue text, such as dialogue target, user intent, etc., or implicitly expressed in the dialogue tone, such as user emotion, user opinion, etc. Therefore, only by accurately analyzing the user dialogue and obtaining the accurate meaning expressed by the user in the dialogue content, can the user demand be grasped, and then the user demand can be responded to and appropriate dialogue can be replied.
[0037] With the development of artificial intelligence technology in recent years, many Internet companies have developed many dialogue robots. In the industry, most dialogue robots are task-based robots that can help users handle some simple daily affairs, such as ordering meals, customer service, booking flights, etc. An indispensable part of the dialogue management of the task-based dialogue system is the dialogue state tracking (DST) module, which needs to identify the state slot mentioned by the user in the current round of questions according to the current round of questions and the history dialogue, generally including state slot and corresponding slot-value pairs. The slot is generally used to describe the attributes of an object in a certain aspect, so the slot is the various attributes of the target object, and in the dialogue state recognition scenario, it is the dialogue state of each attribute, such as fund name, user intent, user emotion, etc. in the financial intelligent dialogue scenario, and the corresponding slot value of the slot is the specific value of each slot, such as "dialogue discussion object = XX fund", "user intent = understand XX fund price change", "user emotion = positive" in the double-number financial intelligent dialogue scenario.
[0038] Generally, for task-based dialogue systems with certain professional requirements, dialogue state recognition schemes generally adopt two modes: (1) fixed ontology-based method, which pre-defines a set of dialogue state word tables, i.e. fixed dialogue state slots and fixed slot values. When dialogue state recognition is performed, the most matching dialogue state slot is queried in the fixed word table, and the corresponding fixed slot value is finally output. However, this scheme highly depends on a pre-defined word table or ontology library, and it is difficult to implement complex data sets. In an ideal case, the size of the dialogue state recognition model is linearly related to the size of the word table. In a real scenario, the word table is constantly changing, which means that this scheme does not have maintainability and scalability; (2) slot value span method, which can ensure the relevance of the recognized user dialogue state to the current dialogue. However, the basic model usually only targets the current dialogue. When the dialogue appears words with reference relationships such as "above" and "holding", the target may not be in the current dialogue, but in the history dialogue or other data (such as other databases). In order to solve the reference problem, an additional task type needs to be introduced, or when encountering an answer type task that needs to determine yes / no, an additional task also needs to be introduced. This span value scheme can only be applied to extractive based scenarios, and cannot solve abstractive based scenarios that need to generate semantics, such as generating user emotion and user intent.
[0039] In summary, the current dialogue state recognition scheme cannot accurately express the meaning of the dialogue text after understanding it, that is, it cannot generate accurate words to express the attention factors in the dialogue when recognizing and generating the dialogue state, and inaccurate dialogue state recognition will lead to the natural language generation module generating a dialogue that does not fit the user's real needs when recovering the dialogue, resulting in poor user experience.
[0040] Therefore, the embodiment of the present specification provides a dialogue state recognition model training method, which encodes sample dialogue data based on the encoding layer of the dialogue state recognition model to generate sample hidden states corresponding to the sample dialogue data; decodes the sample hidden states to generate sample slot values corresponding to at least one preset type of dialogue state slot in the sample dialogue data; and trains the dialogue state recognition model until the dialogue state recognition model converges, to solve the technical problem of being unable to accurately recognize the user's dialogue state.
[0041] Please refer to Figure 1 , Figure 1 An exemplary system architecture diagram of a dialogue state recognition model training method provided by the embodiment of the present specification is shown.
[0042] As Figure 1 shown, the system architecture can include a terminal 101, a network 102 and a server 103. The network 102 is used to provide a communication link medium between the terminal 101 and the server 103. The network 102 can include various types of wired communication links or wireless communication links, for example: wired communication links include optical fiber, twisted pair or coaxial cable, wireless communication links include Bluetooth communication link, Wireless-Fidelity (Wi-Fi) communication link or microwave communication link, etc.
[0043] The terminal 101 can interact with the server 103 through the network 102 to receive messages from the server 103 or send messages to the server 103, or the terminal 101 can interact with the server 103 through the network 102 to receive messages or data sent by other users to the server 103. The terminal 101 can be hardware or software. When the terminal 101 is hardware, it can be various electronic devices, including but not limited to smart watches, smart phones, tablet computers, laptop computers and desktop computers, etc. When the terminal 101 is software, it can be installed in the above-mentioned electronic devices, which can be implemented as multiple software or software modules (for example: to provide distributed services), or as a single software or software module, which is not specifically limited here.
[0044] In the embodiment of the present specification, the terminal 101 inputs the sample dialogue data into the dialogue state recognition model, encodes the sample dialogue data based on the encoding layer of the dialogue state recognition model, and generates a sample hidden state corresponding to the sample dialogue data; then, the terminal 101 decodes the sample hidden state based on the decoding layer of the dialogue state recognition model, and generates a sample slot value corresponding to at least one preset type of dialogue state slot in the sample dialogue data; finally, the terminal 101 trains the dialogue state recognition model according to the standard slot value corresponding to the sample dialogue data and the sample slot value until the dialogue state recognition model converges.
[0045] The server 103 can be a transaction server providing various services. It should be noted that the server 103 can be hardware or software. When the server 103 is hardware, it can be implemented as a distributed server cluster composed of multiple servers, or as a single server. When the server 103 is software, it can be implemented as multiple software or software modules (for example, to provide distributed services), or as a single software or software module, which is not limited here.
[0046] Alternatively, the system architecture can also not include the server 103, in other words, the server 103 can be an optional device in the embodiment of the present specification, that is, the method provided by the embodiment of the present specification can be applied to a system structure including only the terminal 101, and the embodiment of the present specification does not limit this.
[0047] It should be understood that Figure 1 The number of terminals, networks and servers in the system architecture is only illustrative, and can be any number of terminals, networks and servers according to the needs of implementation.
[0048] Please refer to Figure 2 , Figure 2 A flowchart of a dialogue state recognition model training method provided by the embodiment of the present specification is shown. The execution subject of the embodiment of the present specification can be a terminal executing the dialogue state recognition model training, or a processor in the terminal executing the dialogue state recognition model training method, or a dialogue state recognition model training service in the terminal executing the dialogue state recognition model training method. For convenience of description, the specific execution process of the dialogue state recognition model training method is introduced below taking the execution subject as the processor in the terminal.
[0049] As shown in Figure 2 , the dialogue state recognition model training method can at least include:
[0050] S202, inputting sample dialogue data into the dialogue state recognition model, encoding the sample dialogue data based on the encoding layer of the dialogue state recognition model, and generating a sample hidden state corresponding to the sample dialogue data.
[0051] Optionally, for some professional scenarios, such as insurance consultation, financial services, illness consultation, etc., the service personnel must have strong professionalism and high complexity of knowledge, and usually such a professional artificial financial consultant is expensive, so there is a large market demand for intelligent dialogue robots in professional scenarios. When interacting with the user around a professional topic, the professional requirement of the dialogue system is usually high, and it is required to quickly integrate a large amount of information, understand the user's demand through dialogue, and then return the information needed by the user, saving the time cost of information acquisition. For example, an intelligent financial assistant defines various dimensions of user state information in order to build individualized dialogue capabilities, including financial entity, product entity, time entity, financial noun, user KYC (Know Your Customer), user focus, user emotion, and fact factor, etc. At this time, according to the state recognition information and NLU (Natural Language Processing) recognition results, intelligent dynamic response decisions can be made to complete individualized dialogue.
[0052] Optionally, since the neural network model can simulate biological neural networks, collect target features and target knowledge through learning of sample data, and automatically complete tasks after learning to a better effect, it also means that the neural network model can directly obtain the knowledge of accurate output data based on input data, output data corresponding to the input data, and standard data corresponding to the input data, thereby quickly obtaining accurate output data. Therefore, in the dialogue state recognition scenario, a dialogue state recognition model can be trained to recognize the user dialogue state in the dialogue, thereby improving the performance of the dialogue strategy based on the user dialogue state for dialogue response.
[0053] Optionally, in the training process of the dialogue state recognition model, the dialogue state recognition performance of the model needs to be trained through learning of sample dialogue data. The sample dialogue data is a sentence or a paragraph of dialogue text prepared in advance, and the source of the sample dialogue data can be collected from an actual scene or generated by a dialogue generator. The sample dialogue data is subjected to preprocessing steps such as filtering of a preset theme and removal of noise data, and the embodiments of the present specification are not limited in detail.
[0054] Optionally, in the dialogue state recognition scenario, it is finally through the dialogue text to generate the dialogue state, that is, from one sentence (or chapter) to generate another sentence (or chapter), and such problems can be processed using a dialogue state recognition model of an encoder-decoder framework, also known as a Seq2Seq model, which is a general processing model for generating another sentence (or chapter) from one sentence (or chapter). For a sentence pair <Source, Target>, the goal of the dialogue state recognition model is to give the input sentence Source, and to expect that the input sequence will be converted into a fixed-length vector through the encoding (Encoder) part in the Encoder-Decoder framework, and then the fixed vector generated before will be converted into an output sequence through the decoding (Decoder) part, to obtain the target sentence Target. Wherein, Source and Target can be the same language, or two different languages.
[0055] Optionally, usually the model understands the text by obtaining the semantic features of the text, and then outputs the next step according to the text semantics understood by the model, and the semantic features of the text are reflected in the hidden state thereof, so in the embodiment of the present specification, after the sample dialogue data is input into the dialogue state recognition model, the dialogue state recognition model needs to first encode the sample dialogue data through the encoding layer, and the hidden state of the encoding layer (Encoder) at the final time step is taken as the input sentence representation and encoding information, that is, to generate the sample hidden state corresponding to the sample dialogue data.
[0056] S204, decoding the sample hidden state based on the decoding layer of the dialogue state recognition model, to generate a sample slot value corresponding to at least one preset type of dialogue state slot in the sample dialogue data.
[0057] Optionally, according to the dialogue scenario, multiple types of dialogue states such as user intent, domain, user emotion, user viewpoint, etc. can be required, and each type of dialogue state needs to set a corresponding decoding task, so at least one preset type of dialogue state slot is determined in advance, and a corresponding decoding task is set for each type of dialogue state slot. Then, after obtaining the sample hidden state of the sample dialogue data, the decoding layer (Decoder) of the dialogue state recognition model uses the encoding information of the input sentence and the output and hidden state of the previous time step as input to decode the sample hidden state in each time step, and generate the sample slot value corresponding to at least one preset type of dialogue state slot in the sample dialogue data. In the embodiments of the present specification, a fixed dialogue state vocabulary does not need to be set, and it is not limited to extracting words from existing text as dialogue states, but can accurately understand dialogue text data to generate slot values corresponding to dialogue states, complete dialogue state generation from scratch, and obtain accurate dialogue states for further intelligent dialogue generation scenarios, improving user dialogue experience.
[0058] S206, training the dialogue state recognition model according to the standard slot value and the sample slot value corresponding to the sample dialogue data until the dialogue state recognition model converges.
[0059] Optionally, during the model training process, a loss function is usually used to calculate the loss value between the output value of each round of training of the model and the standard value corresponding to the sample, and the model adjusts the parameters using the loss value to fit in the direction of reducing the loss value, and when the loss value meets the preset target value, it means that the training result of the model has reached the preset target. Based on this, to train the dialogue state recognition model, first, when preparing the sample dialogue data, the standard slot value of the above preset type of dialogue state slot corresponding to the sample dialogue data is also prepared, and according to the standard slot value and the sample slot value corresponding to the sample dialogue data, the loss value of the dialogue state recognition model during training can be calculated, and the dialogue state recognition model is trained until the dialogue state recognition model converges. Wherein, the loss function can use cross-entropy function, or other common loss functions, and the embodiments of the present specification do not limit this.
[0060] In the embodiment of the present specification, a dialogue state recognition model training method is provided. Sample dialogue data is input into a dialogue state recognition model, the sample dialogue data is encoded based on the encoding layer of the dialogue state recognition model to generate a sample hidden state corresponding to the sample dialogue data; the sample hidden state is decoded based on the decoding layer of the dialogue state recognition model to generate a sample slot value corresponding to at least one preset type of dialogue state slot in the sample dialogue data; and the dialogue state recognition model is trained according to the standard slot value corresponding to the sample dialogue data and the sample slot value until the dialogue state recognition model converges. Generally, the dialogue content hidden state can reflect the feature meaning contained in the dialogue content. Therefore, after the dialogue state recognition model trained and converged encodes the dialogue data to obtain the hidden state and then decodes on the basis of the hidden state, the dialogue state contained in the dialogue content can be parsed therefrom. Based on the accurate analysis of the dialogue content, the dialogue state recognition model can accurately generate an implicit abstract dialogue state that does not appear in the dialogue text, complete the dialogue state generation from scratch, obtain accurate dialogue state for further intelligent dialogue generation scenarios, and improve the user dialogue experience.
[0061] Please refer to Figure 3 , Figure 3 A flowchart of a dialogue state recognition model training method provided by the embodiment of the present specification is shown.
[0062] As Figure 3 indicated, the dialogue state recognition model training method can at least include:
[0063] S302, input sample dialogue data into a dialogue state recognition model, extract semantic features of the sample dialogue data based on the encoding layer of the dialogue state recognition model, and generate a sample hidden state of the sample dialogue data according to the semantic features.
[0064] Optionally, when selecting the dialogue state recognition model, the model base can use a generative language model base to input text information representation. The input sample dialogue data is not limited to one sentence, but can be a paragraph of dialogue context. In order to ensure the coding efficiency of the model and the accuracy of the final hidden state, a preset number of dialogue contexts can be used as a standard text length. In actual application scenarios, it is the preset number of dialogue contexts history + current user input currentutterance, for example, the current input sentence and the previous five rounds of historical dialogue of the sentence are selected to form an input sentence sequence.
[0065] Wherein, when the sample dialogue data is input, a special character " is used before each sentence <bos>"(begin of sequence) indicates the start of a sequence, use special character after each sentence when outputting dialog state" <eos>" (end of sequence) to indicate the end of the sequence. And for different dialogue roles appearing in the dialogue context, different role representations are used to segment in the sample dialogue data, for example, in a dialogue, user A: "XX stocks fell again, is it not working in the Y field?" Robot: "XX stocks have recently fallen by 13% …, have you already made a plan to add or sell?" User A: "Buy point", when converted into model input, the source end is represented as follows: <bos> + <user>XX stock fell again, is not the Y field? <agent>XX stock has recently dropped 13%… do you have a plan to add or sell? <user>Buy it <eos>.
[0066] Optionally, in the multi-round dialogue scenario, a dialogue generation language model DialoGPT can be used. The DialoGPT is used to cope with the challenges encountered by the conversational neural response generation model. The neural response generation is a sub-problem of text generation, and the task is to quickly generate natural text (inconsistent with the training text). The potential response (reply) in human dialogue is more diverse. Therefore, compared with other text generation tasks, the dialogue model presents a larger one-to-many task. Moreover, human dialogue is usually informal and often contains abbreviations or errors, which are all challenges for dialogue generation. The DialoGPT is also represented as an autoregressive (AR) language model, which uses a multi-layer transformer model architecture. The joint probability distribution P(Target, Source) in the fine-grained dialogue flow can be captured.
[0067] Further, the CDial-GPT base is used, and the CDial-GPT model obtained by retraining the DialoGPT model using an open super-large Chinese dialogue dataset is used as the sota base of the dialogue state recognition model in the embodiments of the present disclosure. In addition, in addition to the generative base, models such as bart and uniLm that integrate AR and AE2 frameworks can also be used as the model base.
[0068] Optionally, after determining the model base of the dialogue state recognition model, the dialogue data in the relevant field is used as sample dialogue data for field adaptability training on the basis of the CDial-GPT, in order to improve the coding layer effect. The sample dialogue data is input into the dialogue state recognition model, the semantic features of the sample dialogue data are extracted based on the coding layer of the dialogue state recognition model, the sample hidden state of the sample dialogue data is generated according to the semantic features, and the sample dialogue data related to the scene professional is used to train the model, which can greatly improve the state recognition effect of the model in the corresponding scene.
[0069] S304, based on the decoding layer of the dialogue state recognition model, the sample hidden state is decoded in parallel according to a preset decoding task, and a sample slot value corresponding to at least one preset type of dialogue state slot in the sample dialogue data is generated.
[0070] Optionally, according to the dialogue scenario, multiple types of dialogue states such as user intent, domain, user emotion, user opinion, etc. may be required, and a corresponding decoding task is set for each type of dialogue state slot. Then, after obtaining the sample hidden state of the sample dialogue data, the decoding layer (Decoder) of the dialogue state recognition model uses the encoding information of the input sentence and the output and hidden state of the previous time step as input to decode the sample hidden state. Usually, in the decoding process, each task is solved in series, that is, the completion of the subsequent task depends on the completion of the previous task, and when the previous task is inaccurate, it greatly affects the generation effect of the subsequent task.
[0071] Based on this, in the embodiments of the present specification, a corresponding preset decoding task can be set in the dialogue state recognition model according to at least one preset type of dialogue state slot, and then the sample hidden state is decoded in parallel according to the preset decoding task, so that there is no dependency between multiple preset decoding tasks, and the accuracy of each other does not affect each other, improving the accuracy and stability of the model to generate multiple dialogue states. In a simple dialogue scenario, all dialogue state slots can also be directly spliced, and multi-slot serial decoding is also feasible.
[0072] Optionally, in order to realize the multi-slot parallel decoding of the model, a prompt scheme (prompt) can be used to support parallel decoding. The prompt is a template or paradigm designed for downstream tasks. This paradigm can help the model recall the knowledge learned during pre-training. In simple terms, the prompt scheme can generate guiding words to prompt the model according to the task. The guiding words are equivalent to task annotations, which help the model understand the meaning of the task, so that the model is more clear about what output is required for the task, improving the decoding ability of the model. For example, the guiding word for the task dialogue state slot "fund name" is "proper noun", and the model can understand that the slot value corresponding to the fund name (slot) should be a proper noun. Similarly, the guiding word for the task dialogue state slot "user emotion" can be to identify the user's implied emotion in the dialogue. Then, based on the nature of the prompt guiding word, for some dialogue state slots that appear less frequently and have less resource distribution in sample dialogue data, the model can also output accurate sample slot values based on low-resource sample distribution, which not only improves the decoding accuracy of the model but also improves the decoding efficiency.
[0073] Optionally, in the embodiments of the present specification, the slot value guide words of each dialogue state slot can be set according to the preset types of the dialogue state slots respectively. The slot value guide words are used to attribute the sample slot values corresponding to each dialogue state slot. In this way, the decoding layer of the dialogue state recognition model can decode the sample hidden state according to the slot value guide words. For dialogue state slots in different types of preset decoding tasks, the corresponding guide words can be manually designed or designed using a prompt scheme. When outputting the slot value corresponding to the dialogue state slot, the target end corresponds to: prompt word (manually designed or automatically learned by the model) + slot_name = slot_value.
[0074] Optionally, for details, please refer to Figure 4 , Figure 4 A logical flowchart of a dialogue state recognition model provided by the embodiments of the present specification is provided. As shown in Figure 4 In the dialogue state recognition model, the encoding layer encodes the input sample dialogue data word by word. After extracting semantic information from the first word, the second word is concatenated with the information of the first word as the second step input. For example, the source end input: <bos> + <user>XX stock fell again, is not the Y field? <agent>XX stock has recently dropped 13%… do you have a plan to add or sell? <user>Buy it <eos>; in the decoding layer, after predicting the next word, the word is added to the original sentence as a new word, as a new input, and the next word is predicted, as in the above example, the target end task can have task1, task2… task6, task1: the dialogue state slot is the fund name, and the corresponding slot value is XX stock, so the output of the model for task1 is "fund name = XX stock", task6: the dialogue state slot is the user emotion, and the corresponding slot value is disappointment, so the output of the model for task6 is "user emotion = disappointment" and so on.
[0075] Optionally, in some dialogues, there may be words in the dialogue text that the model has not encountered, i.e. OOV (Out-of-vocabulary), meaning that there are some words that are not in the existing encountered vocabulary, we call these words Out-of-vocabulary, abbreviated as OOV, such as names, usernames, etc., and in real dialogues, such words tend to be repeated in the reply, that is, some segments in the input sequence are selectively copied to the output sequence, so the CopyNet mechanism can be introduced to solve the copying problem of the model.
[0076] Specifically, the CopyNet mechanism is a mechanism for judging whether to directly copy the original text during decoding generation. The CopyNet mechanism first judges whether the sentence used by the copy of the original text during decoding is better than the newly generated sentence, and then decides whether to copy and the segment to be copied and the position in the output. In the embodiments of the present specification, based on the decoding layer of the dialogue state recognition model, it is judged whether the preset decoding task can be decoded according to the original dialogue words of the sample dialogue data, if yes, the sample slot value of the dialogue state slot corresponding to the preset decoding task is generated, wherein the sample slot value includes the original dialogue words; if not, the sample slot value of the dialogue state slot corresponding to the preset decoding task is directly generated.
[0077] Optionally, the dialogue state recognition model in the embodiments of the present specification can solve the slot value extraction type slot, and the generative model naturally solves the slot value semantic abstraction type slot. The size of the task that the model can complete has no direct size relationship with the state scale. The model has simple structure and good scalability, and can well recognize the multi-dimensional and fine-grained state of the user, thereby laying a good foundation for the construction of individualized dialogue capability. In generating the state slot, in order to improve the efficiency and accuracy of the model, a related field limited constraint word table can be used, for example, the range of this table can be controlled within several thousand words, thereby reducing the calculation time of the model and saving computing resources.
[0078] S306, training the dialogue state recognition model according to the standard slot value corresponding to the sample dialogue data and the sample slot value until the dialogue state recognition model converges.
[0079] For step S306, please refer to the detailed description in step S206, which will not be repeated here.
[0080] In the embodiments of the present specification, a dialogue state recognition model training method is provided. Through the deployment of the generative model, the model generation of the dialogue state is not limited by the fixed word table, which is convenient for optimization and maintenance. The prompt scheme for various dialogue state recognition tasks can make the model use the low-resource slot generation task, and realize multi-slot parallel decoding. At the same time, the model will also judge whether the output is suitable for directly copying the input sequence, so that more accurate and more suitable dialogue state slot values for the dialogue scene can be output. The multi-dimensional fine-grained state of the user is well recognized, which lays a good foundation for the construction of personalized dialogue ability.
[0081] Please refer to Figure 5 , Figure 5 A flowchart of a dialogue state recognition method provided by the embodiments of the present specification is shown.
[0082] As Figure 5 shown, the dialogue state recognition method can at least include:
[0083] S502, input the dialogue data to be recognized into the dialogue state recognition model, encode the dialogue data to be recognized based on the encoding layer of the dialogue state recognition model, and generate the target hidden state corresponding to the input dialogue data to be recognized.
[0084] Optionally, in an actual dialogue scene, the dialogue state recognition model trained and converged by the dialogue state recognition model training method in any of the above embodiments is deployed, and then the dialogue data to be recognized is input into the dialogue state recognition model. The dialogue data to be recognized is encoded based on the encoding layer of the dialogue state recognition model, and the target hidden state corresponding to the input dialogue data to be recognized is generated. The dialogue state recognition model can well recognize the multi-dimensional fine-grained state of the user, which lays a good foundation for the construction of personalized dialogue ability.
[0085] S504, decoding the target hidden state based on the decoding layer of the dialogue state recognition model, and generating the target slot value corresponding to at least one preset type of dialogue state slot in the dialogue data to be recognized.
[0086] Similarly, in an actual scenario, a decoding layer in the dialogue state recognition model decodes the target hidden state to generate a target slot value corresponding to at least one preset type of dialogue state slot in the dialogue data to be recognized. The specific process is as follows: the dialogue state recognition model trained and converged by the dialogue state recognition model training method in any one of the foregoing embodiments, and the trained recognition process, which is not described herein again.
[0087] In the embodiments of the present specification, a dialogue state recognition method is provided. The dialogue data to be recognized is input into a dialogue state recognition model. The dialogue data to be recognized is encoded based on an encoding layer of the dialogue state recognition model to generate a target hidden state corresponding to the dialogue data to be recognized. The target hidden state is decoded based on a decoding layer of the dialogue state recognition model to generate a target slot value corresponding to at least one preset type of dialogue state slot in the dialogue data to be recognized. After the dialogue data is encoded by the dialogue state recognition model to obtain a hidden state, and then the hidden state is decoded, the dialogue state contained in the dialogue content can be parsed. Based on the accurate analysis of the dialogue content, the dialogue state recognition model can accurately generate an implicit and abstract dialogue state that does not appear in the dialogue text, complete the dialogue state generation from scratch, obtain an accurate dialogue state for further intelligent dialogue generation scenarios, and improve the user dialogue experience.
[0088] Please refer to Figure 6 , Figure 6 A structural block diagram of a dialogue state recognition model training device provided in the embodiments of the present specification is shown in FIG. 6. Figure 6 As shown in FIG. 6, the dialogue state recognition model training device 600 includes:
[0089] A sample encoding module 610 is configured to input sample dialogue data into a dialogue state recognition model, encode the sample dialogue data based on an encoding layer of the dialogue state recognition model, and generate a sample hidden state corresponding to the sample dialogue data.
[0090] A sample decoding module 620 is configured to decode the sample hidden state based on a decoding layer of the dialogue state recognition model, and generate a sample slot value corresponding to at least one preset type of dialogue state slot in the sample dialogue data.
[0091] A model training module 630 is configured to train the dialogue state recognition model according to the standard slot value and the sample slot value corresponding to the sample dialogue data until the dialogue state recognition model converges.
[0092] Optionally, the sample encoding module 610 is further configured to extract semantic features of the sample dialogue data based on the encoding layer of the dialogue state recognition model, and generate the sample hidden state of the sample dialogue data according to the semantic features.
[0093] Optionally, the sample decoding module 620 is further configured to set slot value guide words for each dialogue state slot according to preset types of the dialogue state slots, and the slot value guide words are used to attribute the sample slot values corresponding to each dialogue state slot; and decode the sample hidden state according to the decoding layer of the dialogue state recognition model based on the slot value guide words.
[0094] Optionally, the sample decoding module 620 is further configured to decode the sample hidden state in parallel according to preset decoding tasks based on the decoding layer of the dialogue state recognition model, and the preset decoding tasks are set according to at least one preset type of the dialogue state slots in the dialogue state recognition model.
[0095] Optionally, the sample decoding module 620 is further configured to judge whether the preset decoding tasks can be decoded according to the original dialogue words of the sample dialogue data based on the decoding layer of the dialogue state recognition model, and if so, generate the sample slot values of the dialogue state slots corresponding to the preset decoding tasks, wherein the sample slot values include the original dialogue words.
[0096] Optionally, the sample dialogue data includes dialogue contexts of a preset number of turns, and different dialogue roles appearing in the dialogue contexts are segmented in the sample dialogue data using different role representations.
[0097] Optionally, the sample dialogue data is dialogue data in a target attribute scene, and the sample slot values are generated based on a preset constraint word table library corresponding to the target attribute scene.
[0098] In the embodiments of the present disclosure, a dialogue state recognition model training device is provided, wherein a sample encoding module is configured to input sample dialogue data into a dialogue state recognition model, encode the sample dialogue data based on an encoding layer of the dialogue state recognition model, and generate a sample hidden state corresponding to the sample dialogue data; a sample decoding module is configured to decode the sample hidden state based on a decoding layer of the dialogue state recognition model, and generate sample slot values corresponding to at least one preset type of dialogue state slots in the sample dialogue data; and a model training module is configured to train the dialogue state recognition model until the dialogue state recognition model converges according to standard slot values and sample slot values corresponding to the sample dialogue data. Generally, the dialogue content hidden state can reflect the feature meanings contained in the dialogue content, so that after the dialogue state recognition model trained and converged encodes the dialogue data to obtain the hidden state and then decodes on the basis of the hidden state, the dialogue state contained in the dialogue content can be parsed, and based on the accurate analysis of the dialogue content, the dialogue state recognition model can accurately generate implicit and abstract dialogue states that do not appear in the dialogue text, complete the dialogue state generation from scratch, obtain accurate dialogue states for further intelligent dialogue generation scenarios, and improve the user dialogue experience.
[0099] Please refer to Figure 7 , Figure 7 A structural block diagram of a dialogue state recognition device is provided in the embodiments of the present specification. As shown in the figure, Figure 7 The dialogue state recognition device 700 comprises:
[0100] A target encoding module 710 is configured to input the dialogue data to be recognized into a dialogue state recognition model, encode the dialogue data to be recognized based on an encoding layer of the dialogue state recognition model, and generate a target hidden state corresponding to the dialogue data to be recognized.
[0101] A target decoding module 720 is configured to decode the target hidden state based on a decoding layer of the dialogue state recognition model, and generate a target slot value corresponding to at least one preset type of dialogue state slot in the dialogue data to be recognized.
[0102] The dialogue state recognition model is a dialogue state recognition model trained and converged by the dialogue state recognition model training method of any one of the above embodiments.
[0103] In the embodiments of the present specification, a dialogue state recognition device is provided, wherein the dialogue state recognition model trained and converged by the dialogue state recognition model training method in any one of the above embodiments is deployed, the target encoding module in the dialogue state recognition model is configured to input the dialogue data to be recognized into the dialogue state recognition model, encode the dialogue data to be recognized based on an encoding layer of the dialogue state recognition model, and generate a target hidden state corresponding to the dialogue data to be recognized; and the target decoding module is configured to decode the target hidden state based on a decoding layer of the dialogue state recognition model, and generate a target slot value corresponding to at least one preset type of dialogue state slot in the dialogue data to be recognized. After the dialogue state recognition model encodes the dialogue data to obtain a hidden state and then decodes the hidden state, the dialogue state recognition model can analyze the dialogue state contained in the dialogue content, accurately generate an implicit and abstract dialogue state that does not appear in the dialogue text, complete the dialogue state generation from scratch, obtain an accurate dialogue state for further intelligent dialogue generation scenarios, and improve the user dialogue experience.
[0104] The embodiments of the present specification provide a computer program product containing instructions, which, when the computer program product is run on a computer or a processor, causes the computer or the processor to execute the steps of the method of any one of the above embodiments.
[0105] The embodiments of the present specification also provide a computer storage medium, which can store a plurality of instructions, and the instructions are suitable for being loaded and executed by a processor to execute the steps of the method of any one of the above embodiments.
[0106] Please refer to Figure 8 , Figure 8 A structural schematic diagram of a terminal is provided for an embodiment of the present specification. As shown in Figure 8 The terminal 800 can include at least one terminal processor 801, at least one network interface 804, a user interface 803, a memory 805, and at least one communication bus 802.
[0107] The communication bus 802 is configured to realize the connection and communication between the components.
[0108] The user interface 803 can include a display, a camera, and optionally a standard wired interface and a wireless interface.
[0109] The network interface 804 can optionally include a standard wired interface and a wireless interface (such as a WI-FI interface).
[0110] The terminal processor 801 can include one or more processing cores. The terminal processor 801 connects various parts in the terminal 800 through various interfaces and lines, executes various functions of the terminal 800 and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory 805, and calling data stored in the memory 805. Optionally, the terminal processor 801 can be implemented in at least one of a digital signal processing (DSP), a field-programmable gate array (FPGA), and a programmable logic array (PLA). The terminal processor 801 can be integrated with a combination of one or more of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. The CPU is mainly used to process an operating system, a user interface, and an application program; the GPU is used to render and draw the content to be displayed on the display; and the modem is used to process wireless communication. It can be understood that the above-mentioned modem can also not be integrated into the terminal processor 801, but can be realized by a separate chip.
[0111] The memory 805 can include a random access memory (RAM) and can also include a read-only memory (ROM). Optionally, the memory 805 includes a non-transitory computer-readable storage medium. The memory 805 can be used to store instructions, programs, codes, code sets, or instruction sets. The memory 805 can include a program storage area and a data storage area, where the program storage area can store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area can store data involved in the above-mentioned various method embodiments, etc. The memory 805 can also be at least one storage device located away from the terminal processor 801. As shown in Figure 8 The memory 805 as a computer storage medium can include an operating system, a network communication module, a user interface module, a dialogue state recognition model training, and a dialogue state recognition program.
[0112] In the terminal 800 shown in Figure 8 In the terminal 800 shown in, the user interface 803 is mainly used to provide an interface for user input and obtain user input data; and the terminal processor 801 can be used to call the dialogue state recognition model training program stored in the memory 805 and specifically perform the following operations:
[0113] inputting the sample dialogue data into the dialogue state recognition model, encoding the sample dialogue data based on the encoding layer of the dialogue state recognition model, and generating a sample hidden state corresponding to the sample dialogue data;
[0114] decoding the sample hidden state based on the decoding layer of the dialogue state recognition model, and generating a sample slot value corresponding to at least one preset type of dialogue state slot in the sample dialogue data;
[0115] training the dialogue state recognition model according to the standard slot value and the sample slot value corresponding to the sample dialogue data until the dialogue state recognition model converges.
[0116] In some embodiments, when the terminal processor 801 performs encoding of the sample dialogue data based on the encoding layer of the dialogue state recognition model to generate the sample hidden state corresponding to the sample dialogue data, the following steps are specifically performed: extracting semantic features of the sample dialogue data based on the encoding layer of the dialogue state recognition model, and generating a sample hidden state of the sample dialogue data according to the semantic features.
[0117] In some embodiments, the terminal processor 801, when decoding the sample hidden state based on the decoding layer of the dialogue state recognition model, specifically performs the following steps: setting slot value guide words for each dialogue state slot according to the preset types of the dialogue state slots, the slot value guide words being used to attribute the sample slot values corresponding to each dialogue state slot; and decoding the sample hidden state according to the slot value guide words based on the decoding layer of the dialogue state recognition model.
[0118] In some embodiments, the terminal processor 801, when decoding the sample hidden state based on the decoding layer of the dialogue state recognition model, specifically performs the following steps: decoding the sample hidden state in parallel according to the preset decoding task based on the decoding layer of the dialogue state recognition model; and wherein the preset decoding task is set according to at least one preset type of the dialogue state slots in the dialogue state recognition model.
[0119] In some embodiments, the terminal processor 801, when decoding the sample hidden state based on the decoding layer of the dialogue state recognition model, specifically performs the following steps: decoding the sample hidden state in parallel according to the preset decoding task based on the decoding layer of the dialogue state recognition model; and wherein the preset decoding task is set according to at least one preset type of the dialogue state slots in the dialogue state recognition model.
[0120] In some embodiments, the sample dialogue data includes dialogue contexts of a preset number of turns, and different dialogue roles appearing in the dialogue contexts are segmented in the sample dialogue data using different role representations.
[0121] In some embodiments, the sample dialogue data is dialogue data in a target attribute scene, and the sample slot values are generated based on a preset constraint word table library corresponding to the target attribute scene.
[0122] In Figure 8 In the terminal 800 shown, the user interface 803 is mainly used to provide an interface for user input and obtain data input by the user; and the terminal processor 801 can be used to call the dialogue state recognition program stored in the storage 805 and further perform the following operations:
[0123] inputting the dialogue data to be recognized into the dialogue state recognition model, encoding the dialogue data to be recognized based on the encoding layer of the dialogue state recognition model, and generating a target hidden state corresponding to the dialogue data to be recognized;
[0124] decoding the target hidden state based on the decoding layer of the dialogue state recognition model, and generating a target slot value corresponding to at least one preset type of dialogue state slot in the dialogue data to be recognized.
[0125] The dialogue state recognition model is a dialogue state recognition model trained and converged by the dialogue state recognition model training method of any one of the above embodiments.
[0126] In several embodiments provided in the specification, it should be understood that the disclosed apparatus and method can be implemented in other manners. For example, the above-described apparatus embodiments are merely schematic. For example, the division of the modules is merely a logical function division. There can be another division manner for the actual implementation. For example, a plurality of modules or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections can be indirect couplings or communication connections through some interfaces, devices or modules, and can be electrical, mechanical or in other forms.
[0127] The modules illustrated as separated components can or can not be physically separated, and the components illustrated as modules can or can not be physical modules, i.e., can be located in one place, or can be distributed to a plurality of network modules. Part or all of the modules can be selected according to actual needs to achieve the purpose of the embodiment.
[0128] In the above embodiments, all or part of the embodiments can be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments can be implemented in the form of a computer program product. The above computer program product includes one or more computer instructions. When the above computer program instructions are loaded and executed on a computer, all or part of the above processes or functions according to the embodiments of the specification are generated. The above computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable devices. The above computer instructions can be stored in a computer readable storage medium or transmitted by the above computer readable storage medium. The above computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center by wire (such as coaxial cable, optical fiber, digital subscriber line (Digital Subscriber Line, DSL)) or wireless (such as infrared, wireless, microwave, etc.). The above computer readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. integrated with one or more available media. The above available medium can be a magnetic medium (for example, floppy disk, hard disk, magnetic tape), an optical medium (for example, digital versatile disc (Digital Versatile Disc, DVD)), or a semiconductor medium (for example, solid state disk (Solid State Disk, SSD)) and the like.
[0129] It should be noted that, for the foregoing method embodiments, for the convenience of description, they are all described as a combination of a series of actions, but those skilled in the art should know that the embodiments of the present specification are not limited by the order of the described actions, because according to the embodiments of the present specification, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the embodiments of the present specification.
[0130] In addition, it should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data for analysis, stored data, displayed data, etc.) and signals involved in the embodiments of the present specification are all authorized by the user or fully authorized by all parties, and the collection, use and processing of related data need to comply with relevant national and regional laws, regulations and standards. For example, the dialog data information involved in the present specification is obtained under sufficient authorization.
[0131] In the above embodiments, the description of each embodiment has its own focus, and the parts not described in detail in a certain embodiment can be referred to the related description of other embodiments.
[0132] The above is the description of the dialog state recognition model training and dialog state recognition method and device provided by the embodiments of the present specification. For those skilled in the art, according to the idea of the embodiments of the present specification, there will be changes in specific implementation and application range. In summary, the content of the present specification should not be understood as a limitation of the embodiments of the present specification.< / eos> < / user> < / agent> < / user> < / bos> < / eos> < / user> < / agent> < / user> < / bos> < / eos> < / bos>
Claims
1. A method for training a dialogue state recognition model, the method comprising: The sample dialogue data is input into the dialogue state recognition model, and the sample dialogue data is encoded based on the encoding layer of the dialogue state recognition model to generate the sample hidden state corresponding to the sample dialogue data. The decoding layer of the dialogue state recognition model decodes the hidden state of the sample to generate sample slot values corresponding to at least one preset type of dialogue state slot in the sample dialogue data. Based on the standard slot values corresponding to the sample dialogue data and the sample slot values, train the dialogue state recognition model until the dialogue state recognition model converges. The decoding layer based on the dialogue state recognition model decodes the sample hidden state, including: setting slot value guide words for each dialogue state slot according to a preset type, wherein the slot value guide words are used to describe the attributes of the sample slot value corresponding to each dialogue state slot; and the decoding layer based on the dialogue state recognition model decodes the sample hidden state according to the slot value guide words. The decoding layer based on the dialogue state recognition model decodes the hidden state of the sample to generate sample slot values corresponding to at least one preset type of dialogue state slot in the sample dialogue data, including: the decoding layer based on the dialogue state recognition model determines whether a preset decoding task can be decoded based on the original dialogue words of the sample dialogue data; if so, it generates sample slot values for the dialogue state slots corresponding to the preset decoding task, wherein the sample slot values include the original dialogue words; The dialogue state slots include abstract dialogue states, which are implicit states that are not explicitly stated in the dialogue text.
2. The method according to claim 1, wherein the encoding layer based on the dialogue state recognition model encodes the sample dialogue data to generate the sample latent state corresponding to the sample dialogue data, comprising: The semantic features of the sample dialogue data are extracted by the encoding layer of the dialogue state recognition model, and the sample latent state of the sample dialogue data is generated based on the semantic features.
3. The method according to claim 1, wherein the preset decoding task is set in the dialogue state recognition model according to at least one preset type of the dialogue state slot.
4. The method according to claim 1, wherein the sample dialogue data includes a dialogue context with a preset number of rounds, and different dialogue roles appearing in the dialogue context are segmented in the sample dialogue data using different role representations.
5. The method according to claim 1, wherein the sample dialogue data is dialogue data under the target attribute scenario, and the sample slot value is generated based on the preset constraint vocabulary library corresponding to the target attribute scenario.
6. A dialogue state recognition method, the method comprising: The dialogue data to be identified is input into the dialogue state recognition model, and the dialogue data to be identified is encoded based on the encoding layer of the dialogue state recognition model to generate the target hidden state corresponding to the dialogue data to be identified. The decoding layer of the dialogue state recognition model decodes the target hidden state to generate target slot values corresponding to at least one preset type of dialogue state slot in the dialogue data to be recognized. The dialogue state recognition model is a dialogue state recognition model trained and converged by the dialogue state recognition model training method according to any one of claims 1 to 5.
7. A training device for a dialogue state recognition model, the device comprising: The sample encoding module is used to input sample dialogue data into the dialogue state recognition model, encode the sample dialogue data based on the encoding layer of the dialogue state recognition model, and generate the sample hidden state corresponding to the sample dialogue data. The sample decoding module is used to decode the hidden state of the sample based on the decoding layer of the dialogue state recognition model, and generate sample slot values corresponding to at least one preset type of dialogue state slot in the sample dialogue data. The model training module is used to train the dialogue state recognition model based on the standard slot values corresponding to the sample dialogue data and the sample slot values until the dialogue state recognition model converges. The sample decoding module is further configured to set slot value guide words for each dialogue state slot according to the preset type of the dialogue state slot, wherein the slot value guide words are used to describe the attributes of the sample slot value corresponding to each dialogue state slot; and the decoding layer based on the dialogue state recognition model decodes the sample hidden state according to the slot value guide words. The sample decoding module is further configured to determine, based on the decoding layer of the dialogue state recognition model, whether the preset decoding task can be decoded according to the original dialogue words of the sample dialogue data; if so, generate the sample slot value of the dialogue state slot corresponding to the preset decoding task, wherein the sample slot value includes the original dialogue words. The dialogue state slots include abstract dialogue states, which are implicit states that are not explicitly stated in the dialogue text.
8. A dialogue state recognition device, the device comprising: The target encoding module is used to input the dialogue data to be identified into the dialogue state recognition model, and encode the dialogue data to be identified based on the encoding layer of the dialogue state recognition model to generate the target hidden state corresponding to the dialogue data to be identified. The target decoding module is used to decode the target hidden state based on the decoding layer of the dialogue state recognition model, and generate the target slot value corresponding to at least one preset type of dialogue state slot in the dialogue data to be recognized. The dialogue state recognition model is a dialogue state recognition model trained and converged by the dialogue state recognition model training method according to any one of claims 1 to 5.
9. A computer program product comprising instructions that, when run on a computer or processor, cause the computer or processor to perform the steps of the method as claimed in any one of claims 1 to 5 or 6.
10. A computer storage medium storing a plurality of instructions adapted for loading by a processor and performing the steps of the method as claimed in any one of claims 1 to 5 or 6.
11. A terminal comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the program, implements the steps of the method as claimed in any one of claims 1 to 5 or 6.
Citation Information
Patent Citations
Conversation understanding method and device, readable medium and electronic equipment
CN112307774A
Conversation state tracking method and system based on enhancement technology
CN114996479A
Training method and device of dialogue state recognition model, medium and equipment
CN116127328A