A method, device, electronic device and storage medium for tracking conversation status

By constructing slot relationships through the graph neural network in the dialogue state tracking model, the problem of low accuracy in multi-domain dialogue state tracking is solved, achieving higher accuracy and scalability.

CN112488157BActive Publication Date: 2024-09-20BEIJING SANKUAI ONLINE TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202011263660.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-12
Publication Date
2024-09-20
Estimated Expiration
2040-11-12

AI Technical Summary

Technical Problem

Existing dialogue state tracking methods have low accuracy and slot-level accuracy in multi-domain situations, and it is difficult to obtain the relationships and features between slots.

Method used

Adopt a pre-built dialogue state tracking model, build the relationship between slots and the relationship between slots and dialogue history through the dialogue history encoder and graph neural network model, use the slot value generation decoder to obtain the slot value, alleviate the data sparse problem and Improve scalability.

Benefits of technology

Significantly improves the accuracy of dialogue status tracking at the turn level and slot level, and improves the accuracy and scalability of multi-domain dialogue status tracking.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112488157B
    Figure CN112488157B
Patent Text Reader

Abstract

The present invention provides a method, device, electronic device and storage medium for tracking a dialogue state. The method comprises: encoding historical dialogue data through a dialogue history encoder in a pre-constructed dialogue state tracking model to obtain word representation data after encoding the historical dialogue data, and encoding each dialogue sentence in the historical dialogue data to obtain the first sentence representation data after encoding the historical dialogue data; according to the first sentence representation data, the field to be tracked and the slots to be tracked under each field, the relationship between the slots and the relationship between the slots and the historical dialogue data is constructed through a graph neural network model in the dialogue state tracking model, and the encoded second sentence representation data and slot representation data are obtained; according to the second sentence representation data, the slot representation data and the word representation data, a decoder is generated through the slot value in the dialogue state tracking model to obtain the dialogue state of the historical dialogue data. The accuracy and scalability of DST are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of Internet technology, and in particular to a conversation state tracking method, device, electronic device and storage medium. Background Art

[0002] Dialogue State Tracker (DST) is a core component of task-oriented dialogue systems. The purpose of DST is to extract the goals / intentions expressed by users in a dialogue and encode them into a compact representation of the dialogue state, i.e., a set of slots and their corresponding values. Moreover, with the increase in skills or domains in intelligent assistants, multi-domain dialogue state tracking has attracted more and more attention from researchers. Multi-domain dialogue state tracking brings new challenges to dialogue state tracking.

[0003] There are several existing solutions for multi-domain dialogue state tracking: 1. Picklist-based method, which encodes the dialogue history and concatenates it with a specific slot representation, and then feeds it into a classifier to assign it to a value in the candidate list. 2. Span-based method, which is mainly based on reading comprehension, takes the dialogue history as an article, the slot representation as a question, and finds the span of the slot value from the dialogue history as the answer to the question. 3. Generation-based method, which generates slot values ​​based on the dialogue history representation and slot representation.

[0004] However, it is difficult for picklist-based methods to obtain a complete ontology in advance, and even if a complete ontology exists, the number of possible slot values ​​may be large and variable; for span-based methods, the slot values ​​corresponding to some slots may never be found in the dialogue history, and the correct span cannot be found; generation-based methods generate values ​​for each slot independently, and cannot obtain the relationship between slots or obtain features from slot co-occurrence. It can be seen that the existing dialogue state tracking solutions cannot obtain the relationship between slots, and have problems such as low accuracy and slot-level accuracy. Summary of the invention

[0005] Embodiments of the present invention provide a method, device, electronic device and storage medium for tracking a dialog state, so as to solve the problem of low accuracy of dialog state tracking results and low accuracy of slot level in the related art.

[0006] In order to solve the above-mentioned technical problems, the present invention is achieved as follows:

[0007] In a first aspect, an embodiment of the present invention provides a method for tracking a dialog state, comprising:

[0008] The historical dialogue data is encoded by a dialogue history encoder in a pre-built dialogue state tracking model to obtain word representation data after the historical dialogue data is encoded, and each dialogue sentence in the historical dialogue data is encoded to obtain first sentence representation data after the historical dialogue data is encoded;

[0009] According to the first sentence representation data, the field to be tracked, and the slots to be tracked under each of the fields, a relationship between the slots and a relationship between the slots and the historical dialogue data are constructed through a graph neural network model in a dialogue state tracking model, and the encoded second sentence representation data and slot representation data are obtained;

[0010] According to the second sentence representation data, the slot representation data, and the word representation data, a decoder is generated by using the slot value in the dialog state tracking model to obtain the slot value of each slot under each of the fields, thereby obtaining the dialog state of the historical dialog data;

[0011] The historical conversation data includes at least one of user conversation data and machine conversation data, the conversation state tracking model is trained by sample conversation data of multiple known conversation states, and the conversation state includes the slot value of each slot in each field.

[0012] In a second aspect, an embodiment of the present invention provides a conversation state tracking device, comprising:

[0013] A dialogue history encoding module is used to encode the historical dialogue data through a dialogue history encoder in a pre-built dialogue state tracking model to obtain word representation data after the historical dialogue data is encoded, and to encode each dialogue sentence in the historical dialogue data to obtain first sentence representation data after the historical dialogue data is encoded;

[0014] a slot information encoding module, configured to construct, based on the first sentence representation data, the field to be tracked, and the slots to be tracked under each field, the relationship between the slots and the relationship between the slots and the historical dialog data through a graph neural network model in a dialog state tracking model, and obtain the encoded second sentence representation data and slot representation data;

[0015] a slot value generation and decoding module, configured to obtain a slot value of each slot under each of the fields through a slot value generation decoder in the dialog state tracking model according to the second sentence representation data, the slot representation data and the word representation data, and obtain the dialog state of the historical dialog data;

[0016] The historical conversation data includes at least one of user conversation data and machine conversation data, the conversation state tracking model is trained by sample conversation data of multiple known conversation states, and the conversation state includes the slot value of each slot in each field.

[0017] In a third aspect, an embodiment of the present invention further provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the conversation state tracking method as described in the first aspect.

[0018] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the conversation state tracking method described in the first aspect are implemented.

[0019] In an embodiment of the present invention, by encoding the relationship between slot information and the relationship between slot information and sentence information in the dialogue history, the encoded information is used to generate slot value information in the dialogue state. Experiments have shown that the model can alleviate the problem of data sparsity and has better scalability for new fields and slots. It has achieved significant improvements in the accuracy of turn-level dialogue state tracking and the accuracy of the slot level, thereby improving the accuracy and scalability of DST.

[0020] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.

[0022] Figure 1 is a flowchart of the steps of a method for tracking a conversation state in an embodiment of the present invention;

[0023] Figure 2 is a structural diagram of a dialogue state tracking model in an embodiment of the present invention;

[0024] Figure 3 is a flowchart of another method for tracking a dialog state in an embodiment of the present invention;

[0025] Figure 4 is a schematic diagram of two slot gate gating mechanisms in an embodiment of the present invention;

[0026] Figure 5 is a structural diagram of a conversation state tracking device in an embodiment of the present invention;

[0027] Figure 6 is a schematic structural diagram of another conversation state tracking device in an embodiment of the present invention;

[0028] Figure 7 It is a schematic diagram of the hardware structure of an electronic device in an embodiment of the present invention. DETAILED DESCRIPTION

[0029] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0030] Reference Figure 1 , showing a flow chart of the steps of a method for tracking a conversation state in an embodiment of the present invention.

[0031] Step 110, encode the historical dialogue data through a dialogue history encoder in a pre-constructed dialogue state tracking model to obtain word representation data of the encoded historical dialogue data, and encode each dialogue sentence in the historical dialogue data to obtain the first sentence representation data of the encoded historical dialogue data.

[0032] Step 120, based on the first sentence representation data, the field to be tracked, and the slots to be tracked under each of the fields, the relationship between the slots and the relationship between the slots and the historical dialogue data are constructed through the graph neural network model in the dialogue state tracking model, and the encoded second sentence representation data and slot representation data are obtained.

[0033] Step 130: Generate a decoder through the slot value in the dialog state tracking model according to the second sentence representation data, the slot representation data and the word representation data, obtain the slot value of each slot under each of the fields, and obtain the dialog state of the historical dialog data; wherein the historical dialog data includes at least one of user conversation data and machine conversation data, the dialog state tracking model is trained by sample dialog data of multiple known dialog states, and the dialog state includes the slot value of each slot under each field.

[0034] In computer science, a graph is a data structure composed of two components: vertices and edges. A graph G can be described by the set of vertices V and edges E it contains. Vertices are also often called nodes, and edges can be directed or undirected, depending on whether there is a directional dependency between vertices. It can be seen that information transfer between two nodes can be set by setting edges between different nodes.

[0035] Therefore, in view of the problems existing in the current multi-domain dialogue state tracking, in an embodiment of the present invention, a multi-domain dialogue state tracking method using GNN (Graph Neural Networks) to model the relationship between slots is proposed. When encoding slot information and historical dialogue information, the method uses GNN to model the relationship between each slot information and the relationship between slot information and historical dialogue. Its purpose is to alleviate the problem of sparse training data in multi-domain dialogue state tracking by modeling the relationship between slot information. At the same time, the method of generating slot values ​​based on historical dialogues and vocabulary does not need to pre-define the ontology, and can be easily extended to new fields, avoiding the problem that slot values ​​do not appear in historical dialogue data. Moreover, in an embodiment of the present invention, in order to track the dialogue state through the above-mentioned dialogue state tracking model, it can be pre-trained through sample dialogue data of multiple known dialogue states, and the dialogue state includes the slot value of each slot in each field. Moreover, during the model training process and the actual use of the model, the working mechanism of each part in the model is basically the same, and the actual dialogue state tracking process is used as an example for detailed description.

[0036] Specifically, when the dialogue state is tracked, the historical dialogue data can be encoded by the dialogue history encoder in the pre-built dialogue state tracking model to obtain the word representation data of the encoded historical dialogue data, and each dialogue sentence in the historical dialogue data can be encoded to obtain the first sentence representation data of the encoded historical dialogue data. The dialogue history encoder can be any model that can be used for text encoding, such as a BiLSTM (Bi-directional Long Short-Term Memory) model, an LSTM (Long Short-Term Memory) model, an RNN (Recurrent Neural Network) model, and the like. Moreover, in practical applications, dialogue state tracking is generally applied in the case of human-computer dialogue. Therefore, in the embodiment of the present invention, the historical dialogue data includes at least one of user conversation data and machine conversation data. The user conversation data can be the conversation data output by the user according to the demand, and the machine conversation data can be the conversation data replied by the machine to the conversation data input by the user.

[0037] Among them, when encoding the historical conversation data, the historical conversation data can be split into multiple characters on a character basis, and each character can be encoded separately, thereby obtaining word representation data after the historical conversation data is encoded. When encoding each conversation sentence in the historical conversation data, each conversation sentence contained in the historical conversation data can be encoded as a unit, thereby obtaining the first sentence representation data after the historical conversation data is encoded.

[0038] Moreover, in the embodiment of the present invention, the historical conversation data can be obtained by any available method, which is not limited by the embodiment of the present invention. For example, for any conversation, each time the conversation state is tracked, the conversation data of the preset time period before the current moment can be obtained as the current historical conversation data of the corresponding conversation; or, all the conversation data in the corresponding conversation at the current moment can be obtained as the current historical conversation data of the corresponding conversation; or, when the conversation state of the Tth round of conversation is obtained, the conversation data of the first T rounds of conversation in the corresponding conversation can be obtained as the current historical conversation data, and so on.

[0039] For example, first define The T-round sentence pairs in the conversation are the historical conversation data of any conversation, Ut represents the user conversation data in any round of conversation, and Rt represents the machine conversation data in the corresponding round of conversation. Assume that the final conversation state is in the form of , B t Can be a triple ,in There are N different domains. There are M different slots (also called slots). is the word sequence of the slot value corresponding to the slot of the i-th domain. In the multi-domain dialogue state tracking task, the input of the dialogue state tracking model can be the above-mentioned T rounds of historical dialogue data , and the output of the dialogue state tracking model can be the dialogue state B corresponding to the Tth round t .

[0040] The division method of the dialogue sentences can be customized according to the requirements, which is not limited in the embodiment of the present invention. For example, the historical dialogue data can be divided by the period as a mark, and the content between two adjacent periods is a dialogue sentence, or the content between any two adjacent symbols used for segmentation such as a period, a comma, an exclamation mark, a question mark, etc. can be a dialogue sentence, and so on. Moreover, in the embodiment of the present invention, the historical conversation data can be segmented by any available method to obtain each word contained therein, and the dialogue sentences contained therein can also be obtained by any available method, which is not limited in the embodiment of the present invention.

[0041] Furthermore, in order to obtain the relationship between different slots and the relationship between slots and dialogue sentences, the first sentence representation data output by the dialogue history encoder, as well as the various fields to be tracked and the slots to be tracked under each of the fields, can be used to construct the relationship between the slots and the relationship between the slots and the historical dialogue data through the graph neural network model in the dialogue state tracking model, and perform information transmission, thereby obtaining the encoded second sentence representation data and slot representation data output by the graph neural network model.

[0042] Among them, a graph neural network is a neural network that acts directly on a graph structure. The graph neural network has the following characteristics: the input order of the nodes is ignored; during the calculation process, the representation of the node is affected by its surrounding neighbor nodes, while the connection of the graph itself remains unchanged; the representation of the graph structure enables graph-based reasoning. The graph neural network model can be any graph neural network model, for example, a gated graph neural network (Gated Graph Neural Network), a graph convolutional neural network (Graph Convolutional Network, GCN), and so on. Moreover, the internal structure of the graph neural network can be adaptively adjusted according to the number of dialogue sentences contained in the current historical dialogue data and the number of slots to be tracked at present, which is not limited in this embodiment of the present invention.

[0043] After obtaining the second sentence representation data and the slot representation data after information transmission, the second sentence representation data, the slot representation data and the word representation data can be further used to generate a decoder through the slot value in the dialogue state tracking model to obtain the slot value of each slot under each of the fields, and then the dialogue state of the historical dialogue data can be obtained based on the slot value of each slot under each of the fields.

[0044] The slot value generation decoder may be any model that can be used for decoding, which is not limited in the embodiment of the present invention. For example, the slot value generation decoder may be set to be a GRU (Gated Recurrent Unit), a BiLSTM, a RNN, and the like.

[0045] It should be noted that in the embodiment of the present invention, each part of the dialogue state tracking model can be trained separately. In this case, the word representation data and the first sentence representation data corresponding to each sample dialogue data used to train the dialogue state tracking model can be obtained respectively to train the dialogue history encoder, and the second sentence representation data and the slot representation data corresponding to each sample dialogue data can be obtained accordingly to train the graph neural network model. The slot value generation decoder can also be trained according to the dialogue state and the second sentence representation data, slot representation data, and word representation data corresponding to each sample dialogue data; and so on. Of course, the dialogue state tracking model can also be jointly trained as a whole, which is not limited by the embodiment of the present invention.

[0046] Reference Figure 3 In another embodiment, the step 120 may further include:

[0047] Step 121, according to the number of dialogue sentences contained in the historical dialogue data, the fields to be tracked and the slots to be tracked under each of the fields, construct a sentence node corresponding to each dialogue sentence and a slot node corresponding to each slot in the graph neural network model, and set edges for transmitting information between each node;

[0048] Step 122, based on the first sentence representation data, the fields to be tracked, and the slots to be tracked under each of the fields, the encoded second sentence representation data and the slot representation data are obtained by constructing the completed graph neural network model.

[0049] As described above, in the embodiment of the present invention, in order to construct the relationship between slots and the relationship between the slots and the historical dialogue data, sentence nodes corresponding to some of the dialogue sentences and / or slot nodes corresponding to some of the slots can be constructed in the graph neural network model. The specific number of sentence nodes and slot nodes constructed can be customized according to needs, and this embodiment of the present invention does not limit this.

[0050] Preferably, in one embodiment, in order to fully construct the relationship between the slots and the relationship between the slots and the historical dialogue data, a sentence node corresponding to each dialogue sentence and a slot node corresponding to each slot can be constructed in the graph neural network model according to the number of dialogue sentences contained in the historical dialogue data, the fields to be tracked and the slots to be tracked under each of the fields, and edges for transmitting information between each node can be set.

[0051] The node for setting the edge may be any one of a sentence node and a slot node. Moreover, in the embodiment of the present invention, an edge for transmitting information may be set between any two nodes, or only the edge between some nodes may be set. The nodes for which the edge needs to be set may be customized according to the requirements, which is not limited by the embodiment of the present invention.

[0052] After the constructed graph neural network model is completed, the encoded second sentence representation data and slot representation data can be further obtained through the constructed graph neural network model based on the first sentence representation data, the field to be tracked, and the slots to be tracked under each of the fields.

[0053] Optionally, in the embodiment of the present invention, step 121 may further include:

[0054] Step 1211, for each of the sentence nodes, setting an edge for information transfer between the sentence node and a target sentence node corresponding to the sentence node, and / or setting an edge for information transfer between the sentence node and each of the slot nodes; and / or,

[0055] Step 1212: for each of the slot nodes, an edge for information transmission is set between the slot node and each slot node of the same domain as the slot node, and / or an edge for information transmission is set between the slot node and each slot node of the same slot value type as the slot node;

[0056] Among them, the target sentence node includes at least one of the sentence nodes of M sentences before the sentence corresponding to the sentence node and the sentence nodes of N sentences after the sentence corresponding to the sentence node, and M and N are both natural numbers.

[0057] Generally speaking, there is a certain correlation between the previous and subsequent dialogue sentences in a conversation. Each dialogue sentence may have a certain correlation with all the slots. There may be a certain correlation between the slots belonging to the same field. There may be a certain correlation between the slots with the same slot value type (for example, time, place).

[0058] Therefore, preferably, in one embodiment, when setting the edge between each node, the edge can be set in at least one of the following ways:

[0059] For each of the sentence nodes, an edge for information transfer is set between the sentence node and a target sentence node corresponding to the sentence node, and / or, an edge for information transfer is set between the sentence node and each of the slot nodes; and / or, for each of the slot nodes, an edge for information transfer is set between the slot node and each slot node having the same field as the slot node, and / or, an edge for information transfer is set between the slot node and each slot node having the same slot value type as the slot node;

[0060] Among them, the target sentence node includes at least one of the sentence nodes of M sentences before the sentence corresponding to the sentence node and the sentence nodes of N sentences after the sentence corresponding to the sentence node, and M and N are both natural numbers.

[0061] The slot value type division method can be customized according to the requirements, which is not limited in the embodiment of the present invention. For example, the slot value type can be set to include the above-mentioned time, place, etc.

[0062] For example, each conversation sentence in the historical conversation data can be regarded as a node, that is, the above-mentioned sentence, and each slot can be regarded as a node, that is, the above-mentioned slot node, and each sentence node can be set to transmit information with the sentence nodes of the preceding M and following N conversation sentences, each sentence node can transmit information with all slot nodes, each slot node can transmit information with slot nodes belonging to the same field, and each slot node can transmit information with slot nodes having the same slot value type (for example, time, place). Among them, the values ​​of M and N can be the same or different, and this is not limited by the embodiment of the present invention.

[0063] In addition, in the embodiment of the present invention, slots under various fields can also be set according to needs. For example, fields can be divided according to business types (such as house viewing business, recruitment business, ordering business, used car business, etc.), and slots under various business types can be set. Moreover, in the embodiment of the present invention, in order to distinguish different fields and slots, any field information that can represent the identity of the field, such as the field identifier of each field, can be obtained according to needs, and any slot information that can represent the identity of the slot, such as the slot identifier of each slot, can also be obtained. This embodiment of the present invention is not limited to this.

[0064] Optionally, in another embodiment, step 130 may further include: and Concatenate as the initial state of the decoder generated by the pre-trained slot value, The slot value is generated as an input to the first step of decoding the slot value of the jth slot for decoding by a decoder;

[0065] When the slot value decoding is performed for any slot, the following steps are executed in a loop until the slot value decoding for the slot is completed, and then the slot value decoding process for the next slot is entered:

[0066] S1, when decoding the kth word in the slot value of the jth slot in any domain, obtaining its probability distribution under each candidate word, the candidate word including each word included in the historical conversation data and each word in a preset vocabulary;

[0067] S2, obtaining the candidate word with the highest probability as the kth slot value of the jth slot;

[0068] Wherein, j and k are both positive integers, represents the first sentence representation data corresponding to the last dialogue sentence in the historical dialogue data, The second sentence representation data corresponding to the last dialogue sentence in the historical dialogue data is represented by Indicates the slot representation data corresponding to the j-th slot under the field.

[0069] In practical applications, the slot value of a certain slot may contain multiple words, that is, it may be composed of multiple words. For example, for a slot related to a city name, assume that its slot value is "Beijing", that is, at this time, its slot value is composed of two words, "North" is the first word, and "Beijing" is the second word. Moreover, when decoding the slot value of a certain slot, each word contained therein can be decoded in turn to obtain the final slot value. Therefore, in one embodiment, when decoding the slot value for each slot, the above steps S1-S2 can be executed cyclically to obtain each word in the slot value of each slot in turn, until the slot value decoding for the slot is completed, that is, all the words in the slot value of the corresponding slot are decoded, and then the slot value decoding process for the next slot is entered until the slot value decoding of all slots is completed.

[0070] For example, you can and Splice as the initial state of the slot value generation decoder (which can be understood as the input of the slot value generation decoder), and As the slot value of the jth slot, it can be understood as the jth The input of the first step is fed into the slot value generation decoder for decoding.

[0071] When decoding the jth At the k-th step (i.e., the k-th word in the slot value), the probability distribution of the specific value of the k-th word under each candidate word can be obtained through the slot value generation decoder, and the candidate words include each word contained in the historical conversation data and each word in the preset vocabulary; and then the candidate word with the highest probability can be obtained as the k-th word in the slot value of the j-th slot.

[0072] The vocabulary may be learned during the training of the dialog state tracking model, or may be customized according to requirements, which is not limited in the embodiment of the present invention.

[0073] Moreover, the slot value decoding end can be determined by any available method, which is not limited in the embodiment of the present invention. For example, for any slot, in the process of executing the above steps S1-S2, if the word obtained at the current position is empty, or is a preset end symbol, or the probability distribution of the word at the current position under each candidate slot value candidate word is lower than the preset probability, then the slot value decoding of the corresponding slot can be determined to be completed.

[0074] Optionally, in an embodiment of the present invention, the conversation history encoder is a BiLSTM network model, the graph neural network model is a graph convolutional neural network model (GCN), and the slot value generation decoder is a gated recurrent unit (GRU).

[0075] Accordingly, for the dialogue history encoder, if the dialogue history data is input , we can get the output of the BiLSTM network model, that is, the word representation data after the dialogue history data is encoded ,in Indicates the number of words contained in the conversation history data, , As parameters, represents the dimension of vocabulary representation, represents the dimension of the hidden state, and The specific value of can be customized according to the needs, for example, you can set and Both are 100 or 200, or you can set and For different values, and so on.

[0076] Each conversation sentence in the historical conversation data can also be fed into BiLSTM in sequence, and the output of BiLSTM is the first sentence representation data after the historical conversation data is encoded. ,in Indicates the number of dialogue sentences contained in the historical dialogue data. In the above formula, the superscripts R and T in the upper right corner are used to distinguish the data, rather than operation symbols.

[0077] It should be noted that, in the embodiment of the present invention, the conversation history encoder may include two BiLSTM network models to respectively encode the historical conversation data to obtain the word representation data after the historical conversation data is encoded, and to encode each conversation sentence in the historical conversation data to obtain the first sentence representation data after the historical conversation data is encoded, such as Figure 2 In the dialogue state tracking model shown, its dialogue history encoder includes two BiLSTM network models, where the RNN model sequence of each layer identifies a BiLSTM network model.

[0078] If the graph neural network model is a graph convolutional neural network model for interaction between slot information, each sentence in the conversation history is taken as a node, and each slot is taken as a node. Each sentence node transmits information with some of the sentence nodes in front and behind it, each sentence node transmits information with all the slot nodes, each slot node transmits information with the slot nodes belonging to the same field, and each slot node transmits information with the slot nodes with the same slot value type (for example, time, place).

[0079] The second sentence representation data after the first sentence representation data is encoded by GCN can be obtained as , and the slot representation data after GCN encoding is , where M is the number of slots.

[0080] The gated recurrent unit is a commonly used gated recurrent neural network, and the gated recurrent neural network was proposed to better capture dependencies with large time step distances in time series. The gated recurrent unit (GRU) is a gating mechanism in recurrent neural networks (RNNs). Similar to other gating mechanisms, it aims to solve the gradient vanishing / exploding problem in standard RNNs while retaining the long-term information of the sequence. GRU performs as well as LSTM in many sequence tasks such as speech recognition, but it has fewer parameters than LSTM, containing only a reset gate and an update gate.

[0081] Optionally, in the embodiment of the present invention, the step S1 may further include:

[0082] Step S11, when decoding the kth word in the slot value of the jth slot in any field, according to the hidden state data corresponding to the kth word in the slot value of the jth slot, respectively obtain the first probability distribution of the kth word in the slot value of the jth slot under each word included in the historical dialogue data, and the second probability distribution of the kth word in the slot value of the jth slot under the vocabulary;

[0083] Step S12: Obtain the final probability distribution of the kth word in the slot value of the jth slot under each candidate word according to the first probability distribution and the second probability distribution.

[0084] Moreover, in one embodiment, when the candidate words include each word included in the historical conversation data and the vocabulary, in order to obtain the probability distribution of the kth word in the slot value of the jth slot under all the candidate words in any field, the first probability distribution under each word included in the historical conversation data and the second probability distribution of the kth slot value under the vocabulary can be obtained through the slot value generation decoder, and then the probability distribution of the kth word in the slot value of the jth slot under each candidate word is obtained according to the first probability distribution and the second probability distribution. The corresponding relationship between the first probability distribution, the second probability distribution, and the probability distribution of the kth slot value under each candidate word can be customized according to the needs, the specific type of the slot value generation decoder, etc., and this is not limited by the embodiment of the present invention.

[0085] When the slot value generator decoder is a gated recurrent unit, when decoding the kth step of the jth slot in any domain, its corresponding hidden state can be used, that is, the hidden state passed down from the previous step , respectively, calculate the probability distribution on the historical dialogue data and vocabulary:

[0086] First probability distribution ,

[0087] Second probability distribution ,

[0088] The final probability distribution is: ,

[0089] Where E is the representation matrix of the vocabulary, |V| is the number of words contained in the vocabulary, express The transpose of . Moreover, the scalar Is trainable: , W1 is used for training The model parameters of the model, w jkrepresents the representation vector of the word decoded in the previous step, that is, the representation vector of the word decoded in the k-1th step. In addition, in the embodiment of the present invention, the above-mentioned , this embodiment of the present invention is not limited to this.

[0090] Optionally, in the embodiment of the present invention, the dialog state tracking model further includes a classifier, and the classifier is connected to the slot value generation decoder. Step 130 may further include:

[0091] Step A1, for each slot under each of the fields, predicting a category identifier of each of the slots according to the classifier;

[0092] Step A2, for each slot whose category identifier is the specified category identifier, according to the second sentence representation data, the slot representation data and the word representation data, a decoder is generated through the slot value in the dialogue state tracking model, and the slot value of each slot is obtained to the dialogue state of the historical dialogue data.

[0093] In actual applications, each time the dialogue state is tracked, there may be some slots whose values ​​do not exist in the current historical dialogue data or vocabulary, that is, their slot values ​​cannot be determined based on the current historical dialogue data or vocabulary. If the above steps of obtaining the slot values ​​are performed on the above slots, it will easily lead to a waste of resources and affect the efficiency of dialogue state tracking.

[0094] Therefore, preferably, in one embodiment, the dialog state tracking model may further include a classifier, and the classifier is connected to the slot value generation decoder, so that the slots that do not need to determine the slot value are filtered out by the classifier. Specifically, for each slot under each domain, the category identifier of each slot can be predicted according to the classifier; and then only for each slot whose category identifier is the specified category identifier, the slot value of each slot is obtained according to the second sentence representation data, the slot representation data and the word representation data through the slot value generation decoder in the dialog state tracking model, to the dialog state of the historical dialog data. Moreover, the input of the classifier may include at least one of slot information, domain information, slot representation data, first sentence representation data, second sentence representation data, and word representation data, and of course may also include any other required data. The input data of the classifier can be customized according to the requirements and the specific type of the classifier, and this is not limited in this embodiment of the present invention. The output of the classifier can be the category identifier of the corresponding slot. The form of the category identifier can be customized according to the requirements, and this is not limited in this embodiment of the present invention.

[0095] It should be noted that in the embodiment of the present invention, the classifier can be trained alone or jointly with other parts included in the dialog state tracking model, which is not limited in the embodiment of the present invention. In addition, in order to train the classifier, the category identifier of each slot in each domain used to train the dialog state tracking model can also be obtained.

[0096] It should be noted that the designated category identifier of the slot to which the slot value needs to be obtained can also be customized according to the needs, which is not limited in the embodiment of the present invention. Moreover, the classifier can be any model that can be trained as a classifier, and the classifier can be a binary classifier, a ternary classifier, etc., which is not limited in the embodiment of the present invention.

[0097] Optionally, in the embodiment of the present invention, the step A1 may further include:

[0098] Step A11, for each slot in each of the fields, according to the hidden state data corresponding to the slot in the initial state, respectively obtain the first probability distribution of each word contained in the historical conversation data in the slot in the initial state;

[0099] Step A12, acquiring prediction parameters for category prediction according to the first probability distribution in the initial state and the first sentence representation data;

[0100] Step A13, obtaining the category identifier of the slot through the classifier according to the prediction parameters.

[0101] Taking the jth For example, we can use the classifier to Mapped to a probability distribution on each category identifier, so that the category identifier with the highest probability is the jth The category identifier of the corresponding slot. It can be called the jth The prediction parameters for .

[0102] And referring to the above In terms of how to obtain , so we can know ,in , It can be called the hidden state data corresponding to the j-th slot in the initial state, that is, The initial hidden state before decoding the corresponding slot value, It can be called the jth A first probability distribution for each word included in the historical conversation data for the corresponding slot in the initial state.

[0103] Optionally, in an embodiment of the present invention, the classifier may be a slot gate gating mechanism, and its structure may be customized according to requirements. For example, a binary classifier, a ternary classifier, etc. may all be a slot gate gating mechanism.

[0104] The slot gate mechanism focuses on learning the relationship between intent and slot attention vectors, and obtains a better semantic frame through global optimization. Slot-gate helps analyze the relationship between slots and intent.

[0105] like Figure 4 Figure 4 shows schematic diagrams of two slot gate gating mechanisms, where 4 (a) represents a slot gate gating mechanism with full attention (slot-gated model with full attention), and 4 (b) represents a slot gate gating mechanism with intent attention (slot-gated model with intent attention).

[0106] For example, assuming that the classifier is a slot gate gating mechanism, and the classifier is a three-classifier, the optional category identifiers include ptr, none, and dontcare. Based on the current classifier, the jth The prediction result for the corresponding slot is , where Wg is the parameter of the current three classifiers, which can be obtained during the training process of the classifier. express The transpose of .

[0107] If the prediction result of the classifier, that is, the classification identifier is none, it means that the slot is not in the current dialogue state and there is no need to obtain its slot value. If the prediction result is dontcare, the slot value of the slot can be directly set to dontcare, and there is no need to perform the above process of obtaining the slot value. If the prediction result is ptr, the slot value is decoded and generated.

[0108] In an embodiment of the present invention, by encoding the relationship between slot information and the relationship between slot information and sentence information in the dialogue history, the encoded information is used to generate slot value information in the dialogue state. Experiments have shown that the model can alleviate the problem of data sparsity and has better scalability for new fields and slots. It has achieved significant improvements in the accuracy of turn-level dialogue state tracking and the accuracy of the slot level, thereby improving the accuracy and scalability of DST.

[0109] Reference Figure 5, shows a schematic diagram of the structure of a conversation state tracking device in an embodiment of the present invention.

[0110] The dialog state tracking device of the embodiment of the present invention includes: a dialog history encoding module 210 , a slot information encoding module 220 , and a slot value generation decoding module 230 .

[0111] The functions of each module and the interactions between them are introduced in detail below.

[0112] The dialogue history encoding module 210 is used to encode the historical dialogue data through the dialogue history encoder in the pre-built dialogue state tracking model to obtain the word representation data after the historical dialogue data is encoded, and to encode each dialogue sentence in the historical dialogue data to obtain the first sentence representation data after the historical dialogue data is encoded;

[0113] A slot information encoding module 220 is used to construct the relationship between the slots and the relationship between the slots and the historical dialog data according to the first sentence representation data, the field to be tracked, and the slots to be tracked under each field through a graph neural network model in a dialog state tracking model, and obtain the encoded second sentence representation data and slot representation data;

[0114] A slot value generation and decoding module 230 is used to obtain the slot value of each slot under each of the fields through a slot value generation decoder in the dialogue state tracking model according to the second sentence representation data, the slot representation data and the word representation data, so as to obtain the dialogue state of the historical dialogue data;

[0115] The historical conversation data includes at least one of user conversation data and machine conversation data, the conversation state tracking model is trained by sample conversation data of multiple known conversation states, and the conversation state includes the slot value of each slot in each field.

[0116] Reference Figure 6 In one embodiment, the slot information encoding module 220 may further include:

[0117] A graph neural network model setting submodule 221 is used to construct a sentence node corresponding to each dialogue sentence and a slot node corresponding to each slot in the graph neural network model according to the number of dialogue sentences contained in the historical dialogue data, the fields to be tracked, and the slots to be tracked under each of the fields, and to set edges for transmitting information between each node;

[0118] The slot information encoding submodule 222 is used to obtain the encoded second sentence representation data and slot representation data according to the first sentence representation data, the field to be tracked and the slots to be tracked under each of the fields, by constructing a completed graph neural network model.

[0119] Optionally, the graph neural network model setting submodule 222 can be specifically used for:

[0120] For each of the sentence nodes, an edge for information transfer is set between the sentence node and a target sentence node corresponding to the sentence node, and / or an edge for information transfer is set between the sentence node and each of the slot nodes;

[0121] and / or, for each of the slot nodes, an edge for information transfer is set between the slot node and each slot node of the same field as the slot node, and / or, an edge for information transfer is set between the slot node and each slot node of the same slot value type as the slot node;

[0122] Among them, the target sentence node includes at least one of the sentence nodes of M sentences before the sentence corresponding to the sentence node and the sentence nodes of N sentences after the sentence corresponding to the sentence node, and M and N are both natural numbers.

[0123] Optionally, the slot value generation decoding module 230 may be specifically used for:

[0124] Will and Concatenate as the initial state of the decoder generated by the pre-trained slot value, The slot value is generated as an input to the first step of decoding the slot value of the jth slot for decoding by a decoder;

[0125] When the slot value decoding is performed for any slot, the following steps are executed in a loop until the slot value decoding for the slot is completed, and then the slot value decoding process for the next slot is entered:

[0126] S1, when decoding the kth word in the slot value of the jth slot in any domain, obtaining its probability distribution under each candidate word, the candidate word including each word included in the historical conversation data and each word in a preset vocabulary;

[0127] S2, obtaining the candidate word with the highest probability as the kth word in the slot value of the jth slot;

[0128] Wherein, j and k are both positive integers, represents the first sentence representation data corresponding to the last dialogue sentence in the historical dialogue data, The second sentence representation data corresponding to the last dialogue sentence in the historical dialogue data is represented by Indicates the slot representation data corresponding to the j-th slot under the field.

[0129] Optionally, the conversation history encoder is a BiLSTM network model, the graph neural network model is a graph convolutional neural network model, and the slot value generation decoder is a gated recurrent unit.

[0130] Optionally, the slot value generation decoding module 230 may also be used to:

[0131] When decoding the kth word in the slot value of the jth slot in any field, according to the hidden state data corresponding to the kth word in the slot value of the jth slot, respectively obtain a first probability distribution of the kth word in the slot value of the jth slot under each word included in the historical conversation data, and a second probability distribution of the kth word in the slot value of the jth slot under the vocabulary;

[0132] According to the first probability distribution and the second probability distribution, the final probability distribution of the kth word in the slot value of the jth slot under each candidate word is obtained.

[0133] Optionally, the dialog state tracking model further includes a classifier, and the classifier is connected to the slot value generation decoder. The slot value generation decoding module 230 may further include:

[0134] A category identification prediction submodule, used for predicting the category identification of each slot under each of the fields according to the classifier;

[0135] The slot value generation decoding submodule is used to obtain the slot value of each slot whose category identifier is the specified category identifier, according to the second sentence representation data, the slot representation data and the word representation data, through the slot value generation decoder in the dialogue state tracking model, to the dialogue state of the historical dialogue data.

[0136] Optionally, the category identification prediction submodule is specifically used to:

[0137] For each slot in each of the fields, according to the hidden state data corresponding to the slot in the initial state, respectively obtain the first probability distribution of each word contained in the historical conversation data in the slot in the initial state;

[0138] Acquire prediction parameters for performing category prediction according to the first probability distribution in the initial state and the first sentence representation data;

[0139] According to the prediction parameters, a category identifier of the slot is obtained through the classifier.

[0140] Optionally, the classifier is a slot gate gating mechanism.

[0141] The dialogue state tracking device provided by the embodiment of the present invention can achieve Figure 1 and Figure 3 To avoid repetition, the various processes implemented in the method embodiment are not described here.

[0142] Preferably, an embodiment of the present invention further provides an electronic device, comprising: a processor, a memory, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, each process of the above-mentioned dialogue state tracking method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.

[0143] The embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, each process of the above-mentioned dialogue state tracking method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. The computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0144] Figure 7 A schematic diagram of the hardware structure of an electronic device for implementing various embodiments of the present invention.

[0145] The electronic device 500 includes but is not limited to: a radio frequency unit 501, a network module 502, an audio output unit 503, an input unit 504, a sensor 505, a display unit 506, a user input unit 507, an interface unit 508, a memory 509, a processor 510, and a power supply 511. Those skilled in the art will appreciate that Figure 7 The electronic device structure shown in the figure does not constitute a limitation on the electronic device, and the electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. In the embodiments of the present invention, the electronic device includes but is not limited to a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted terminal, a wearable device, and a pedometer.

[0146] It should be understood that in the embodiment of the present invention, the radio frequency unit 501 can be used for receiving and sending signals during information transmission or communication. Specifically, after receiving downlink data from the base station, it is sent to the processor 510 for processing; in addition, uplink data is sent to the base station. Generally, the radio frequency unit 501 includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, etc. In addition, the radio frequency unit 501 can also communicate with the network and other devices through a wireless communication system.

[0147] The electronic device provides users with wireless broadband Internet access through the network module 502, such as helping users to send and receive emails, browse web pages, and access streaming media.

[0148] The audio output unit 503 can convert the audio data received by the RF unit 501 or the network module 502 or stored in the memory 509 into an audio signal and output it as sound. Moreover, the audio output unit 503 can also provide audio output related to a specific function performed by the electronic device 500 (for example, a call signal reception sound, a message reception sound, etc.). The audio output unit 503 includes a speaker, a buzzer, a receiver, etc.

[0149] The input unit 504 is used to receive audio or video signals. The input unit 504 may include a graphics processing unit (GPU) 5041 and a microphone 5042. The graphics processor 5041 processes the image data of a static picture or video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The processed image frame can be displayed on the display unit 506. The image frame processed by the graphics processor 5041 can be stored in the memory 509 (or other storage medium) or sent via the radio frequency unit 501 or the network module 502. The microphone 5042 can receive sound and can process such sound into audio data. The processed audio data can be converted into a format output that can be sent to a mobile communication base station via the radio frequency unit 501 in the case of a telephone call mode.

[0150] The electronic device 500 also includes at least one sensor 505, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor and a proximity sensor, wherein the ambient light sensor can adjust the brightness of the display panel 5061 according to the brightness of the ambient light, and the proximity sensor can turn off the display panel 5061 and / or the backlight when the electronic device 500 is moved to the ear. As a type of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally three axes), and can detect the magnitude and direction of gravity when stationary, which can be used to identify the posture of the electronic device (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; the sensor 505 can also include a fingerprint sensor, a pressure sensor, an iris sensor, a molecular sensor, a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, etc., which will not be repeated here.

[0151] The display unit 506 is used to display information input by the user or information provided to the user. The display unit 506 may include a display panel 5061, which may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.

[0152] The user input unit 507 can be used to receive input digital or character information, and generate key signal input related to user settings and function control of the electronic device. Specifically, the user input unit 507 includes a touch panel 5071 and other input devices 5072. The touch panel 5071, also known as a touch screen, can collect user touch operations on or near it (such as operations performed by users using fingers, styluses, or any other suitable objects or accessories on or near the touch panel 5071). The touch panel 5071 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact point coordinates, and then sends it to the processor 510, receives the command sent by the processor 510 and executes it. In addition, the touch panel 5071 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves. In addition to the touch panel 5071, the user input unit 507 may also include other input devices 5072. Specifically, other input devices 5072 may include but are not limited to a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which are not described in detail here.

[0153] Furthermore, the touch panel 5071 may be overlaid on the display panel 5061. When the touch panel 5071 detects a touch operation on or near it, it transmits the information to the processor 510 to determine the type of the touch event. Then, the processor 510 provides a corresponding visual output on the display panel 5061 according to the type of the touch event. Figure 7 In the figure, the touch panel 5071 and the display panel 5061 are used as two independent components to realize the input and output functions of the electronic device. However, in some embodiments, the touch panel 5071 and the display panel 5061 can be integrated to realize the input and output functions of the electronic device, which is not limited here.

[0154] The interface unit 508 is an interface for connecting an external device to the electronic device 500. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device with an identification module, an audio input / output (I / O) port, a video I / O port, a headphone port, etc. The interface unit 508 may be used to receive input (e.g., data information, power, etc.) from an external device and transmit the received input to one or more elements within the electronic device 500 or may be used to transmit data between the electronic device 500 and an external device.

[0155] The memory 509 can be used to store software programs and various data. The memory 509 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory 509 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0156] The processor 510 is the control center of the electronic device. It uses various interfaces and lines to connect various parts of the entire electronic device. By running or executing software programs and / or modules stored in the memory 509 and calling data stored in the memory 509, it performs various functions of the electronic device and processes data, thereby monitoring the electronic device as a whole. The processor 510 may include one or more processing units; preferably, the processor 510 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 510.

[0157] The electronic device 500 may also include a power source 511 (such as a battery) for supplying power to various components. Preferably, the power source 511 may be logically connected to the processor 510 via a power management system, thereby managing functions such as charging, discharging, and power consumption through the power management system.

[0158] In addition, the electronic device 500 includes some functional modules not shown, which will not be described in detail here.

[0159] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0160] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present invention.

[0161] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation modes, which are merely illustrative rather than restrictive. Under the guidance of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the present invention and the claims, all of which are within the protection of the present invention.

[0162] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in the embodiments of the present invention can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0163] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0164] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0165] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0166] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0167] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, ROM, RAM, magnetic disks, or optical disks.

[0168] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. A method for tracking dialogue state, It is characterized in that include: The historical dialogue data is encoded by a dialogue history encoder in a pre-built dialogue state tracking model to obtain word representation data after the historical dialogue data is encoded, and each dialogue sentence in the historical dialogue data is encoded to obtain first sentence representation data after the historical dialogue data is encoded; According to the first sentence representation data, the field to be tracked, and the slots to be tracked under each of the fields, a relationship between the slots and a relationship between the slots and the historical dialogue data are constructed through a graph neural network model in a dialogue state tracking model, and the encoded second sentence representation data and slot representation data are obtained; According to the second sentence representation data, the slot representation data, and the word representation data, a decoder is generated by using the slot value in the dialog state tracking model to obtain the slot value of each slot under each of the fields, thereby obtaining the dialog state of the historical dialog data; The historical conversation data includes at least one of user conversation data and machine conversation data, the conversation state tracking model is trained by sample conversation data of a plurality of known conversation states, and the conversation state includes a slot value of each slot in each domain; The step of constructing the relationship between the slots and the relationship between the slots and the historical dialogue data through the graph neural network model in the dialogue state tracking model according to the first sentence representation data, the field to be tracked, and the slots to be tracked under each of the fields, and obtaining the encoded second sentence representation data and slot representation data includes: According to the number of dialogue sentences contained in the historical dialogue data, the fields to be tracked, and the slots to be tracked under each of the fields, a sentence node corresponding to each dialogue sentence and a slot node corresponding to each slot are constructed in the graph neural network model, and edges for transmitting information between each node are set; According to the first sentence representation data, the fields to be tracked, and the slots to be tracked under each of the fields, the encoded second sentence representation data and slot representation data are obtained by constructing a completed graph neural network model.

2. The method according to claim 1, It is characterized in that The step of setting an edge for transmitting information between each of the nodes comprises: For each of the sentence nodes, an edge for information transfer is set between the sentence node and a target sentence node corresponding to the sentence node, and / or an edge for information transfer is set between the sentence node and each of the slot nodes; and / or, for each of the slot nodes, an edge for information transfer is set between the slot node and each slot node of the same field as the slot node, and / or, an edge for information transfer is set between the slot node and each slot node of the same slot value type as the slot node; Among them, the target sentence node includes at least one of the sentence nodes of M sentences before the sentence corresponding to the sentence node and the sentence nodes of N sentences after the sentence corresponding to the sentence node, and M and N are both natural numbers.

3. The method according to any one of claims 1 to 2, It is characterized in that The step of generating a decoder by the slot value in the dialog state tracking model according to the second sentence representation data, the slot representation data and the word representation data to obtain the slot value of each slot in each of the domains comprises: Will and Concatenate as the initial state of the decoder generated by the pre-trained slot value, The slot value is generated as an input to the first step of decoding the slot value of the jth slot for decoding by a decoder; When the slot value decoding is performed for any slot, the following steps are executed in a loop until the slot value decoding for the slot is completed, and then the slot value decoding process for the next slot is entered: S1, when decoding the kth word in the slot value of the jth slot in any domain, obtaining its probability distribution under each candidate word, the candidate word including each word included in the historical conversation data and each word in a preset vocabulary; S2, obtaining the candidate word with the highest probability as the kth word in the slot value of the jth slot; Wherein, j and k are both positive integers, represents the first sentence representation data corresponding to the last dialogue sentence in the historical dialogue data, The second sentence representation data corresponding to the last dialogue sentence in the historical dialogue data is represented by Indicates the slot representation data corresponding to the j-th slot under the field.

4. The method according to claim 1, It is characterized in that The conversation history encoder is a BiLSTM network model, the graph neural network model is a graph convolutional neural network model, and the slot value generation decoder is a gated recurrent unit.

5. The method according to claim 3, It is characterized in that The step of obtaining the probability distribution of the kth word in the slot value of the jth slot in any field under each candidate word when decoding the kth word includes: When decoding the kth word in the slot value of the jth slot in any field, according to the hidden state data corresponding to the kth word in the slot value of the jth slot, respectively obtain a first probability distribution of the kth word in the slot value of the jth slot under each word included in the historical conversation data, and a second probability distribution of the kth word in the slot value of the jth slot under the vocabulary; According to the first probability distribution and the second probability distribution, the final probability distribution of the kth word in the slot value of the jth slot under each candidate word is obtained.

6. The method according to claim 1, It is characterized in that The dialog state tracking model also includes a classifier, and the classifier is connected to the slot value generation decoder. The step of obtaining the slot value of each slot under each of the fields through the slot value generation decoder in the dialog state tracking model according to the second sentence representation data, the slot representation data and the word representation data to obtain the dialog state of the historical dialog data includes: For each slot under each of the fields, predicting a category identifier of each slot according to the classifier; For each slot whose category identifier is the specified category identifier, a decoder is generated through the slot value in the dialogue state tracking model according to the second sentence representation data, the slot representation data and the word representation data, and the slot value of each slot is obtained to the dialogue state of the historical dialogue data.

7. The method according to claim 6, It is characterized in that The step of predicting the category identification of each slot under each field according to the classifier comprises: For each slot in each of the fields, according to the hidden state data corresponding to the slot in the initial state, respectively obtain the first probability distribution of each word contained in the historical conversation data in the slot in the initial state; Acquire prediction parameters for performing category prediction according to the first probability distribution in the initial state and the first sentence representation data; According to the prediction parameters, a category identifier of the slot is obtained through the classifier.

8. The method according to claim 6 or 7, It is characterized in that The classifier is a slot gate gating mechanism.

9. A conversation state tracking device, It is characterized in that include: A dialogue history encoding module is used to encode the historical dialogue data through a dialogue history encoder in a pre-built dialogue state tracking model to obtain word representation data after the historical dialogue data is encoded, and to encode each dialogue sentence in the historical dialogue data to obtain first sentence representation data after the historical dialogue data is encoded; a slot information encoding module, configured to construct, based on the first sentence representation data, the field to be tracked, and the slots to be tracked under each field, the relationship between the slots and the relationship between the slots and the historical dialog data through a graph neural network model in a dialog state tracking model, and obtain the encoded second sentence representation data and slot representation data; a slot value generation and decoding module, configured to obtain a slot value of each slot under each of the fields through a slot value generation decoder in the dialog state tracking model according to the second sentence representation data, the slot representation data and the word representation data, and obtain the dialog state of the historical dialog data; The historical conversation data includes at least one of user conversation data and machine conversation data, the conversation state tracking model is trained by sample conversation data of a plurality of known conversation states, and the conversation state includes a slot value of each slot in each domain; The device is also used for: According to the number of dialogue sentences contained in the historical dialogue data, the fields to be tracked, and the slots to be tracked under each of the fields, a sentence node corresponding to each dialogue sentence and a slot node corresponding to each slot are constructed in the graph neural network model, and edges for transmitting information between each node are set; According to the first sentence representation data, the fields to be tracked, and the slots to be tracked under each of the fields, the encoded second sentence representation data and slot representation data are obtained by constructing a completed graph neural network model.

10. An electronic device, It is characterized in that include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the dialog state tracking method according to any one of claims 1 to 8.

11. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the dialog state tracking method according to any one of claims 1 to 8 are implemented.

Citation Information

Patent Citations

  • Multi-round task type conversation state tracking method

    CN111522923A

  • Conversation state generation method and device

    CN111522925A

  • Intelligent customer service dialogue reply generation method and device and electronic equipment

    CN111651573A