A task-based dialogue state tracking method integrating slot association and semantic association
By integrating slot association and semantic association in task-based dialogue state tracking method, using multi-relationship graphs and pre-trained language models, the high encoding complexity, unconsidered slot relationships and insufficient semantic correlations in multi-domain scenarios are solved. The problem achieves more efficient and accurate dialogue status tracking.
Patent Information
- Application Number
- CN202210491157.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-07
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2042-05-07
AI Technical Summary
The existing task-based dialogue state tracking method faces the problem of high coding complexity, insufficient information on the relationship between slots and semantic correlation in multiple domain scenarios.
A task-based dialogue state tracking method that combines slot association and semantic association is adopted to obtain the relationship between different slots through multiple relationship diagrams, and feature encoding is used to use the pre-trained language model BERT, and combine the hierarchical attention mechanism and word level. Semantic similarity, enhance feature representation to improve model accuracy.
It effectively reduces the coding complexity, improves the accuracy of slot value prediction and the speed of state tracking, and enhances the model's understanding of slot relationships and semantic associations.
Smart Images

Figure CN114860908B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of deep learning technology, and in particular to a task-based dialogue state tracking method that integrates slot association and semantic association. Background Art
[0002] In recent years, artificial intelligence has developed rapidly, and more and more applications are inseparable from intelligent interaction. Among them, the most significant development is human-computer dialogue interaction. In layman's terms, it is robot dialogue. Human-computer dialogue interaction can be divided into chat-type dialogue system and task-based dialogue system according to the content of the dialogue. Chat-type dialogue system belongs to open domain question and answer, and there is no specific chat field, such as Xiaoai speaker, Microsoft Xiaobing and other voice assistants. Task-based dialogue system aims to help users complete one or more specific tasks, such as ticket booking system, intelligent customer service system, etc. The purpose of developing task-based dialogue system is to reduce labor costs, simplify business processing procedures through intelligent interaction, and improve user satisfaction. Therefore, this research has far-reaching application significance.
[0003] The task-based dialogue system mainly consists of four modules, namely natural language understanding, dialogue state tracking, dialogue strategy optimization and natural language generation. Among them, dialogue state tracking is the core module in the task-based dialogue system. The purpose of dialogue state tracking is to extract user goals and intentions based on the dialogue context and represent them as dialogue states. The dialogue state is a compressed representation of the current dialogue, which consists of a set of (slot-slot value) forms. Among them, the slot is a set of domain ontologies predefined in the dialogue system, such as hotel-area means "hotel area", and the slot value is the specific information of the slot, such as "city center".
[0004] At present, the mainstream neural network-based methods can be divided into two types: predefined ontology-based methods and open vocabulary-based methods. Among them, open vocabulary methods can be further divided into generative methods and span-based methods. The predefined ontology-based method regards dialogue state tracking as a classification task. The basic idea is to predefine an ontology containing all possible slot-value pairs, and classify and predict each slot value in each round of dialogue based on this ontology. However, this method is difficult to implement in real scenarios. First, the ontology is usually very large in multi-domain scenarios; second, it is difficult to predefine all possible values for each slot, such as the slot value of the time type is not enumerable, and the slot value of the name type is dynamically changing. The generative method is not based on a predefined ontology, but directly generates slot values according to the dialogue context. However, when encountering complex slot values, the generative method faces the risk of generating confusing strings, such as generating repeated words. The span-based method regards dialogue state tracking as a reading comprehension task, and directly predicts the starting and ending positions of each slot value from the dialogue history. However, this method cannot deal well with the situation where the slot value does not appear in the dialogue history.
[0005] Based on the above three dialogue state tracking methods, the present invention proposes a task-based dialogue state tracking method that integrates slot association and semantic association to solve the three problems faced by multi-domain dialogue systems. The three problems solved are:
[0006] (1) High encoding complexity. In each round of state tracking, existing methods usually encode all the dialogue history. As the number of dialogue rounds increases, the length of the dialogue context also increases, which increases the encoding difficulty, computational complexity and memory consumption.
[0007] (2) The relationship between slots is not considered. In multi-domain scenarios, many methods often ignore the relationship between domains and slots, while the relationship between slots can help the model learn useful information hidden on the surface of the conversation. For example, in the multi-domain life service intelligent robot application scenario, a user's goal is to book a taxi to a hotel. At this time, the domain related to booking a taxi is the previous conversation involving the hotel domain. The dialogue state tracking model should have the ability to infer from "hotel-name" to "taxi-destination", that is, in the current conversation context, these two slots are associated and they share slot values.
[0008] (3) Insufficient semantic relevance information. In order to determine whether a certain field or slot is involved in the current conversation, existing methods choose to traverse all slots and then use the slot gate mechanism to perform three-category prediction on each slot to determine the value type of the slot. This method makes the dialogue state tracking process inefficient and time-consuming. Moreover, the input information of the slot gate mechanism is too simple and fails to fully extract the global semantic relevance information, causing the state tracking to miss the slots mentioned in the current conversation. Summary of the invention
[0009] In view of this, the purpose of the present invention is to provide a task-based dialogue state tracking method that integrates slot association and semantic association to solve the technical problems raised in the background technology. The method comprehensively considers slot association information and semantic association information, obtains the relationship between different slots through a multi-relationship graph, enhances features through the semantic similarity between slots and word-level dialogue context, and finally improves the accuracy of the dialogue state tracking model.
[0010] In order to achieve the above object, the present invention adopts the following technical solution:
[0011] A task-based dialogue state tracking method integrating slot association and semantic association, the method comprising the following steps:
[0012] Step S1: preprocessing of multi-domain dialogue data sets, processing the dialogue data into samples in units of dialogue turns, where the original features are the previous round system response, the current round user statement and the previous round dialogue state, and the sample label is the current round dialogue state;
[0013] Step S2, encoding the sample features processed in step S1, and using the pre-trained language model BERT to encode the original features into numerical data;
[0014] Step S3, obtaining domain ontology information, that is, all domain-slot information; constructing the ontology information into a multi-relation graph structure, using the hierarchical attention mechanism to fuse the relationship between slots, and finally obtaining the embedding vector of each slot;
[0015] Step S4: Calculate the semantic similarity between each word and the slot in the conversation context, concatenate the semantic similarities into a semantic similarity vector, and connect the vector with the slot embedding vector obtained in step S3 as the input of the slot gate mechanism;
[0016] Step S5: According to the output result of the slot gate mechanism in step S4, the source of the slot value is determined, and the slot value is predicted by the value decoder module, and the slot value is predicted one by one, and finally the dialogue state of the current round is updated.
[0017] Furthermore, in step S1, the data set used for data preprocessing is the multi-domain dialogue data set MultiWOZ2.0 proposed by researchers from Cambridge University. Each sample is based on a dialogue round, the original features are the previous round system response, the current round user statement and the previous round dialogue state, and the sample label is the current round dialogue state. This operation can effectively reduce the encoding complexity and improve the training speed.
[0018] Furthermore, in step S2, the sample features processed in step S1 are encoded, and the original features are encoded into numerical data using the pre-trained language model BERT. The input of the BERT model consists of three parts, namely, word vector, segment vector and position vector.
[0019] Furthermore, the step S2 specifically includes the following steps:
[0020] S21, dialogue statement representation: The dialogue statement of round t is represented as a connected dialogue sequence, Where R t-1 Indicates the previous round of system response, U t Indicates the current round of user statements. [CLS] and [SEP] are auxiliary tokens used to segment sentences. Represents the sequence concatenation operation, and the role of [CLS] is to capture the complete sequence embedding;
[0021] S22, the previous round of dialogue state representation: The dialogue state is a series of triples, which can be regarded as a compressed representation of the dialogue history. The previous round of dialogue state is represented as Among them, each S represents a subsequence of the form domain-slot-value, [SLOT] represents the aggregate information embedding of domain-slot-value triples, and J represents the total number of domain-slots;
[0022] If the value of the jth slot in round t is NULL, then the special token [NULL] is used as input, and if the value is DONTCARE, then the phrase "don't care" is used as input;
[0023] S23, encoder input: In order to improve encoding efficiency, the dialogue sentence and the previous dialogue state are concatenated into a single sequence X t , Among them, X t The input embedding of is the embedding vector after the word embedding, segment embedding and position embedding are added together;
[0024] Among them, word embedding is the word vector of each word in the input sequence; segment embedding is the encoding of each input segment in the input sequence, with 0 representing the segment belonging to R t-1 1 represents the word belonging to U t The word 2 represents the word belonging to B t-1 The position embedding is the position encoding of each word in the input sequence, which follows the standard form in BERT;
[0025] S24, encoder output: The output of the encoder is expressed as H t , the entire input sequence embedding is represented as The embedding of each slot is represented as The entire input X t The aggregate sequence representation of Obtained by a forward neural network, whose network parameters are W pool , the calculation formula is as follows:
[0026]
[0027] Furthermore, in step S3, the types of relationships between the slots include: domain connection, slot name connection, shared value connection and implicit connection.
[0028] Furthermore, the step S3 specifically includes:
[0029] S31. Construction of multi-relational pattern graph: Based on the ontology pattern, the pattern graph is defined as G = (N, E); where N = {(domain, slot)}, indicating that the nodes of the pattern graph are composed of slots in the form of domain-slot, and the undirected edge e∈E represents the relationship between two nodes;
[0030] S32. Multi-relational pattern graph encoding: In order to model the relationship between slots, a hierarchical graph attention network is used to encode the nodes in the multi-relational pattern graph, so as to fuse the various relationship information between different slots and obtain the final slot embedding.
[0031] Further, in the step S32, the hierarchical graph attention network includes L layers, each layer is divided into an attention sublayer and an FFN sublayer; the attention sublayer is divided into a relationship level attention mechanism and a node level attention mechanism;
[0032] Before updating, each sublayer will add residual connections and LayerNorm. The specific formula is as follows:
[0033] C G =LayerNorm(h (l) +h (l+1) )
[0034]
[0035] After L layers of stacking, each slot incorporates multiple slot-related information, and the final slot embedding is represented by S t L .
[0036] Furthermore, in step S4, the word-level similarity between the slot and the word-level dialogue context is used as an enhanced feature of the slot gate mechanism; then it is embedded and spliced with the slot obtained in step S3 as the input of the slot gate mechanism; finally, the slot gate category corresponding to the slot is output.
[0037] Furthermore, in step S4,
[0038] Concatenate the conversation history of round t into a variable-length sequence Seq t , whose maximum length is len; each word in the dialogue history corresponds to a word vector t∈R 1×d , the word vector matrix corresponds to the word embedding matrix in the conversation encoder;
[0039] The slot semantic vector is obtained by adding the word vectors corresponding to the domain and slot, denoted as ds j ∈R 1×d ; The semantic similarity between the slot semantic vector and each word vector in the dialogue history sequence is evaluated by calculating the cosine value of the angle between the two;
[0040] For the dialogue history sequence Seq t The word vector of any word in t=[t1,t2,...t d ], the semantic vector of the jth slot Then t and ds j The formula for calculating the cosine value of the angle θ is as follows:
[0041]
[0042] According to the above method, the semantic similarity between each word in the dialogue history sequence and the jth slot is calculated and merged into a word-level semantic similarity vector, denoted as sim j ∈R 1×len ;
[0043] Concatenate the word-level semantic similarity vector with the slot embedding vector:
[0044]
[0045] Finally, the prediction result of the slot door category of the jth slot in the tth round is:
[0046]
[0047] Furthermore, in step S5, in order to cope with different slot value sources, the decoder module is divided into a generative slot value decoder and a copy slot value decoder. The generative slot value decoder is used to predict slot values that can be directly extracted from the dialogue context, and the copy slot value decoder is used to predict slot values that need to be inferred from the dialogue context.
[0048] Furthermore, the prediction method of the generative slot value decoder is:
[0049] Use the GRU decoder to directly extract the value corresponding to the slot from the current round of dialogue history; first, for the slot with the k-th slot prediction type of "generate", define the initial hidden state of the GRU as The initial input is defined as
[0050] Hidden state at time m The update process is as follows: First, the word decoded at the current moment is embedded As input, until a special marker [EOS] is generated, indicating the end of decoding:
[0051]
[0052] During the mth step of decoding, the hidden state of the decoder is converted into a probability distribution based on vocabulary, calculated as follows:
[0053]
[0054] Among them, the word embedding matrix Shared with the word embedding matrix of the dialogue encoder module, d vocab Indicates the vocabulary size;
[0055] At the same time, the hidden state of the decoder is also converted into a probability distribution based on the conversation history, calculated as follows:
[0056]
[0057] Using the soft copy mechanism, the final distribution is the weighted sum of two probability distributions:
[0058]
[0059] Furthermore, the prediction method of the copied value decoder is:
[0060] The copy value decoder uses a mapping layer to predict which slot value in the previous dialogue state to copy to the target slot; for the kth slot gate prediction type "copy", the slot's representation in the dialogue encoder is and representations in multi-relational schema graph encoders As the input of the copy value decoder, the calculation formula is as follows:
[0061]
[0062]
[0063] in, It is based on the probability distribution of all slots domain-slot;
[0064] Then, by Get the index of the slot to be copied; finally, the value of the target slot is copied using the following formula:
[0065]
[0066] The beneficial effects of the present invention are:
[0067] On the one hand, the present invention takes into account the coding complexity problem and shortens the coding object to the previous round of system replies and the current round of user statements instead of all the dialogue history, which can effectively reduce the coding burden of the system; on the other hand, it comprehensively considers the slot association and semantic association information, integrates various relationship information between different slots into the slot embedding, and adds word-level semantic similarity information to the slot gate mechanism, which not only improves the accuracy of slot value prediction, but also speeds up state tracking. BRIEF DESCRIPTION OF THE DRAWINGS
[0068] Figure 1 A flowchart of a task-based dialog state tracking method integrating slot association and semantic association provided in an embodiment.
[0069] Figure 2 is a schematic diagram of a dialog state tracking model structure in an embodiment;
[0070] Figure 3 Schematic diagram of a multi-relationship graph structure in an embodiment.
[0071] Figure 4 Schematic diagram of a multi-relation graph encoder in an embodiment. DETAILED DESCRIPTION
[0072] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings 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.
[0073] like Figure 1 The present invention is a task-based dialogue state tracking method that integrates slot association and semantic association, and the method includes the following steps:
[0074] S1. Preprocessing of multi-domain dialogue datasets: processing dialogue data into samples in dialogue rounds, where the original features are the previous round system response, the current round user statement and the previous round dialogue state, and the sample label is the current round dialogue state;
[0075] Specifically, in this embodiment, a multi-domain dialogue dataset manually collected by researchers at Cambridge University is used for data preprocessing. The original dataset is collected in units of dialogues, while in this embodiment, the data needs to be processed into samples in units of rounds. The features of each sample are the system response in the previous round, the user statement in the current round, and the dialogue state in the previous round, and the sample label is the dialogue state in the current round. The dialogue state is represented as a set containing all slot-value pairs.
[0076] S2, encode the sample features processed by S1, and use the pre-trained language model BERT to encode the original features into numerical data, which specifically includes the following steps:
[0077] S21, dialogue statement representation: The dialogue statement of round t is represented as a connected dialogue sequence, Where R t-1 Indicates the previous round of system response, Ut Indicates the current round of user statements. [CLS] and [SEP] are auxiliary tokens used to segment sentences. Represents the sequence concatenation operation, and the role of [CLS] is to capture the complete sequence embedding.
[0078] S22. Representation of the previous round of dialogue state: The dialogue state is a set of (domain-slot-value) triples, which can be regarded as a compressed representation of the dialogue history. In this paper, the previous round of dialogue state is represented as Where each S represents a subsequence of the form (domain-slot-value), [SLOT] is similar to [CLS], representing the aggregate information embedding of (domain-slot-value) triples, and J represents the total number of (domain-slot). If the value of the j-th slot in round t is NULL, the special tag [NULL] is used as input, and if the value is DONTCARE, the phrase "don't care" is used as input.
[0079] S23, encoder input: In order to improve encoding efficiency, this paper concatenates the dialogue sentence and the previous dialogue state into a single sequence X t , like Figure 3 As shown, X t The input embedding of is the embedding vector after the word embedding, segment embedding and position embedding are added together. Among them, the word embedding is the word vector of each word in the input sequence; the segment embedding is the encoding of each input segment in the input sequence. In this paper, 0 is used to represent the position of R. t-1 1 represents the word belonging to U t The word 2 represents the word belonging to B t-1 The position embedding is the position encoding of each word in the input sequence, which follows the standard form in BERT. Figure 3 Shown is a schematic diagram of the entire encoder input embedding.
[0080] S24, encoder output: The output of the encoder is expressed as H t , the entire input sequence embedding is represented as The embedding of each slot is represented as The entire input X t The aggregate sequence representation of Obtained by a forward neural network, whose network parameters are W pool , the calculation formula is as follows:
[0081]
[0082] S3. Obtain domain ontology information, that is, all (domain-slot) information. Construct the ontology information into a multi-relation graph structure, use the hierarchical attention mechanism to fuse the relationship between slots, and finally obtain the embedding vector of each slot, which specifically includes the following steps:
[0083] S31. Construction of multi-relational schema: Based on the ontology schema, the schema is defined as G = (N, E). Where N = {(domain, slot)}, indicating that the nodes of the schema are composed of slots in the form of (domain-slot), and the undirected edge e∈E represents the relationship between two nodes. It is worth noting that compared with the single-type connection defined in previous studies, the present invention proposes four slot relationships, that is, there are four types of edges in the schema. Figure 4 As shown, it is a schematic diagram of four types of relationships. The present invention constructs four adjacency matrices based on these three edge types, and the specific description of the edges is as follows:
[0084] 1) Field connection: If For example, (restaurant, area) and (restaurant, food) have this relationship;
[0085] 2) Slot name connection: If For example, (restaurant,area) and (hotel,area) have this relationship;
[0086] 3) Shared value connection: if For example, (restaurant, name) and (taxi, destination) have this relationship;
[0087] 4) Implicit connection: There is no explicit association between two slots, but from the perspective of semantics and common sense, there is a hidden association between the two. For example, there is an implicit connection between (hotel, star) and (restaurant, price range) because the price range of a restaurant booked by a user is often related to the star level of the hotel he / she booked. Therefore, for this connection type, define
[0088] S32. Multi-relational pattern graph encoding: In order to model the relationship between slots, this paper uses a graph attention network (GAT) to encode the nodes in the multi-relational pattern graph to fuse the slot relationship information. Compared with previous work that only calculates the attention scores between nodes and adjacent nodes, this paper proposes a hierarchical graph attention network (HGAT). The hierarchical graph attention network contains L layers, each of which is divided into an attention sublayer and a FFN (Feed Forward Network) sublayer. Among them, the attention sublayer is divided into a relation-level attention mechanism (relation-level) and a node-level attention mechanism (node-level). The relation-level attention mechanism calculates the attention scores between nodes and relations, and the node-level attention mechanism calculates the attention scores between nodes.
[0089] like Figure 4 As shown in the figure, it is the structural diagram of multi-relational pattern graph encoding, and on the right is the detailed structural diagram of the attention sub-layer.
[0090] (1) Attention sublayer
[0091] Relation-level attention mechanism: Assume there are three vectors, query vector Key Vector Sum value vector in and in, represents the embedding vector of the i-th node, and It represents the embedding vector of the i-th type of relationship. This paper adopts one-hot encoding to represent the four types of relationships in the multi-relationship pattern graph. The dimension of the relationship embedding vector is consistent with the node vector dimension d, denoted as R = {r0, r1, r2, r3}.
[0092] Node-level attention mechanism: Assume there are three vectors, query vector Key Vector Sum value vector in and In fact, these three vectors are expressed as the embedding vectors of all slots. The initial embedding vectors of all slots in this paper are all the embedding vectors of all slots in the dialogue encoder module. S t , d represents the latent vector dimension of the encoder.
[0093] (2) FFN sublayer
[0094] The FFN sublayer is a feed-forward neural network, which consists of two layers of full connection and ReLu activation function. This layer enables the slot to learn more nonlinear information and assists in parameter updating.
[0095] The specific formula is as follows:
[0096] FFN(x)=W2ReLu(W1x+b1)+b2
[0097] Among them, W1, W2, b1 and b2 are all trainable parameters.
[0098] In addition, each sublayer will add residual connections and LayerNorm before updating. The specific formula is as follows:
[0099] C G =LayerNorm(h (l) +h (l+1) )
[0100]
[0101] After L layers of stacking, each slot incorporates multiple slot-related information, and the final slot embedding is expressed as
[0102] S4, calculate the semantic similarity between each word and the slot in the dialogue context, concatenate the semantic similarities into a semantic similarity vector, and connect the vector with the slot embedding obtained in step S3 as the input of the slot gate mechanism;
[0103] Specifically, in this embodiment, the role of the slot gate mechanism is to determine whether each slot is mentioned in the current conversation, which is essentially a multi-classifier. There are five slot gate categories designed by the present invention, namely "none", "dontcare", "carryover", "generate" and "copy". Among them, "none" means that the user has not mentioned the slot in the current conversation; "dontcare" means that the user indicates that he does not care about the value of the slot, that is, any value is acceptable; "carryover" means that the slot value remains unchanged; "generate" means that the user explicitly specifies the value of the slot in the current conversation; "copy" means that the user specifies the value of the slot in an implicit way in the current conversation, such as referring to or omitting.
[0104] More specifically, the present invention uses word-level semantic similarity as an enhanced feature of the slot gate mechanism. In order to fully learn the semantics between the slot and the conversation history, this paper concatenates the conversation history of the tth round into a variable-length sequence Seq t , whose maximum length is len. Each word in the dialogue history corresponds to a word vector t∈R 1×d , the word vector matrix corresponds to the word embedding matrix in the dialogue encoder, that is, the word vector of each word can be queried through this matrix.
[0105] The slot semantic vector is obtained by adding the word vectors corresponding to the domain (such as hotel) and the slot (such as area), denoted as ds j ∈R 1×d This paper evaluates the semantic similarity between the slot semantic vector and each word vector in the dialogue history sequence by calculating the cosine value of the angle between the two.
[0106] For the dialogue history sequence Seq t The word vector of any word in t=[t1,t2,...t d ], the semantic vector of the jth slot Then t and ds j The formula for calculating the cosine value of the angle θ is as follows:
[0107]
[0108] According to the above method, the semantic similarity between each word in the dialogue history sequence and the jth slot is calculated and merged into a word-level semantic similarity vector, denoted as sim j ∈R 1×len .
[0109] Concatenate the word-level semantic similarity vector with the slot embedding vector:
[0110]
[0111] Finally, the prediction result of the slot door category of the jth slot in the tth round is:
[0112]
[0113] S5. According to the output result of the slot gate mechanism in step S4, determine the source of the slot value, and use the value decoder module to predict the slot value. The generative value decoder corresponds to the slot with the prediction category of "generate" by the slot gate mechanism, and the copy value decoder corresponds to the slot with the prediction category of "copy" by the slot gate mechanism. The current round of dialogue state is updated by predicting each slot one by one, which specifically includes the following steps:
[0114] S51. Generative value decoder: This paper uses the GRU decoder to directly extract the value corresponding to the slot from the current round of dialogue history. First, for the kth slot with the prediction type of "generate", the initial hidden state of the GRU is defined as The initial input is defined as
[0115] Hidden state at time m The update process is as follows: First, the word decoded at the current moment is embedded As input, until a special marker [EOS] is generated, indicating the end of decoding:
[0116]
[0117] During the mth step of decoding, the hidden state of the decoder is converted into a probability distribution based on vocabulary, calculated as follows:
[0118]
[0119] Among them, the word embedding matrix Shared with the word embedding matrix of the dialogue encoder module, d vocab Indicates the vocabulary size.
[0120] At the same time, the hidden state of the decoder is also converted into a probability distribution based on the conversation history, calculated as follows:
[0121]
[0122] The present invention uses a soft copy mechanism, and the final distribution is the weighted sum of two probability distributions:
[0123]
[0124] S52, copy value decoder: For the target slot whose slot prediction category is "copy", its slot value is difficult to extract directly from the dialogue history, which often involves reasoning, such as co-reference or omission problems. Therefore, it is necessary to consider the relationship between different slots and obtain the value of the target slot from other slots in the previous round of dialogue state.
[0125] The copy value decoder uses a mapping layer to predict which slot value in the previous dialogue state to copy to the target slot. For the kth slot with prediction type "copy", the representation of the slot in the dialogue encoder is and representations in multi-relational schema graph encoders As the input of the copy value decoder, the calculation formula is as follows:
[0126]
[0127]
[0128] in, It is a probability distribution based on all domain-slots.
[0129] Then, by Get the index of the slot to be copied. Finally, the value of the target slot is copied using the following formula:
[0130]
[0131] The present invention has the following advantages: on the one hand, by taking the previous round of system sentences, the current user sentences and the previous round of dialogue status as the input of the encoder, the computational complexity and memory consumption are reduced; on the other hand, by constructing a multi-relational pattern graph and integrating word-level semantic similarity into the model slot gate mechanism, the slot relationship and semantic relationship are fully integrated, thereby improving the model accuracy.
[0132] The matters not described in detail in the present invention are all known technologies to those skilled in the art.
[0133] The preferred specific embodiments of the present invention are described in detail above. It should be understood that a person skilled in the art can make many modifications and changes based on the concept of the present invention without creative work. Therefore, any technical solution that can be obtained by a person skilled in the art through logical analysis, reasoning or limited experiments based on the concept of the present invention on the basis of the prior art should be within the scope of protection determined by the claims.
Claims
1. A task-based dialog state tracking method integrating slot association and semantic association, characterized in that: The method comprises the following steps: Step S1: preprocessing of multi-domain dialogue data sets, processing the dialogue data into samples in units of dialogue turns, where the original features are the previous round system response, the current round user statement and the previous round dialogue state, and the sample label is the current round dialogue state; Step S2, encoding the sample features processed in step S1, and using the pre-trained language model BERT to encode the original features into numerical data; Step S3, obtaining domain ontology information, that is, all domain-slot information; constructing the ontology information into a multi-relation graph structure, using the hierarchical attention mechanism to fuse the relationship between slots, and finally obtaining the embedding vector of each slot; Step S4: Calculate the semantic similarity between each word and the slot in the conversation context, concatenate the semantic similarities into a semantic similarity vector, and connect the vector with the slot embedding vector obtained in step S3 as the input of the slot gate mechanism; Step S5: According to the output result of the slot gate mechanism in step S4, the source of the slot value is determined, and the slot value is predicted by the value decoder module, and the slot value is predicted one by one, and finally the dialogue state of the current round is updated.
2. According to claim 1, a task-based dialog state tracking method integrating slot association and semantic association is characterized in that: The step S2 specifically includes the following steps: S21, dialogue statement representation: The dialogue statement of round t is represented as a connected dialogue sequence, Where R t-1 Indicates the previous round of system response, U t Indicates the current round of user statements. [CLS] and [SEP] are auxiliary tokens used to segment sentences. Represents the sequence concatenation operation, and the role of [CLS] is to capture the complete sequence embedding; S22, the previous round of dialogue state representation: The dialogue state is a series of triples, which can be regarded as a compressed representation of the dialogue history. The previous round of dialogue state is represented as Among them, each S represents a subsequence of the form domain-slot-value, [SLOT] represents the aggregate information embedding of domain-slot-value triples, and J represents the total number of domain-slots; If the value of the jth slot in round t is NULL, then the special token [NULL] is used as input, and if the value is DONTCARE, then the phrase "don't care" is used as input; S23, encoder input: In order to improve encoding efficiency, the dialogue sentence and the previous dialogue state are concatenated into a single sequence X t , Among them, X t The input embedding of is the embedding vector after the word embedding, segment embedding and position embedding are added together; Among them, word embedding is the word vector of each word in the input sequence; segment embedding is the encoding of each input segment in the input sequence, with 0 representing the segment belonging to R t-1 1 represents the word belonging to U t The word 2 represents the word belonging to B t-1 The position embedding is the position encoding of each word in the input sequence, which follows the standard form in BERT; S24, encoder output: The output of the encoder is expressed as H t , the entire input sequence embedding is represented as The embedding of each slot is represented as The entire input X t The aggregate sequence representation of Obtained by a forward neural network, whose network parameters are W pool , the calculation formula is as follows:
3. According to claim 1, a task-based dialog state tracking method integrating slot association and semantic association is characterized in that: In step S3, the types of relationships between the slots include: domain connection, slot name connection, shared value connection and implicit connection.
4. According to claim 3, a task-based dialog state tracking method integrating slot association and semantic association is characterized in that: The step S3 specifically includes: S31. Construction of multi-relational pattern graph: Based on the ontology pattern, the pattern graph is defined as G = (N, E); where N = {(domain, slot)}, indicating that the nodes of the pattern graph are composed of slots in the form of domain-slot, and the undirected edge e∈E represents the relationship between two nodes; S32. Multi-relational pattern graph encoding: In order to model the relationship between slots, a hierarchical graph attention network is used to encode the nodes in the multi-relational pattern graph, so as to fuse the various relationship information between different slots and obtain the final slot embedding.
5. According to claim 4, a task-based dialog state tracking method integrating slot association and semantic association is characterized in that: In the step S32, the hierarchical graph attention network includes L layers, each layer is divided into an attention sublayer and an FFN sublayer; the attention sublayer is divided into a relationship level attention mechanism and a node level attention mechanism; Before updating, each sublayer will add residual connections and LayerNorm. The specific formula is as follows: C G =LayerNorm(h (l) +h (l+1) ) After L layers of stacking, each slot incorporates multiple slot-related information, and the final slot embedding is expressed as 6. The task-based dialog state tracking method integrating slot association and semantic association according to claim 1, characterized in that: In the step S4, the word-level similarity between the slot and the word-level conversation context is used as an enhanced feature of the slot gate mechanism; Then it is embedded and spliced with the slot obtained in step S3 as the input of the slot gate mechanism; finally, the slot gate category corresponding to the slot is output.
7. The task-based dialog state tracking method integrating slot association and semantic association according to claim 1, characterized in that: In the step S4, Concatenate the conversation history of round t into a variable-length sequence Seq t , whose maximum length is len; each word in the dialogue history corresponds to a word vector t∈R 1×d , the word vector matrix corresponds to the word embedding matrix in the conversation encoder; The slot semantic vector is obtained by adding the word vectors corresponding to the domain and slot, denoted as ds j ∈R 1×d ; The semantic similarity between the slot semantic vector and each word vector in the dialogue history sequence is evaluated by calculating the cosine value of the angle between the two. For the dialogue history sequence Seq t The word vector of any word in t=[t1,t2,...t d ], the semantic vector of the jth slot Then t and ds j The formula for calculating the cosine value of the angle θ is as follows: According to the above method, the semantic similarity between each word in the dialogue history sequence and the jth slot is calculated and merged into a word-level semantic similarity vector, denoted as sim j ∈R 1×len ; Concatenate the word-level semantic similarity vector with the slot embedding vector: Finally, the prediction result of the slot door category of the jth slot in the tth round is:
8. The task-based dialog state tracking method integrating slot association and semantic association according to claim 1, characterized in that: In step S5, in order to cope with different slot value sources, the decoder module is divided into a generative slot value decoder and a copy slot value decoder. The generative slot value decoder is used to predict slot values that can be directly extracted from the dialogue context, and the copy slot value decoder is used to predict slot values that need to be inferred from the dialogue context.
9. The task-based dialog state tracking method integrating slot association and semantic association according to claim 8, characterized in that: The prediction method of the generative slot value decoder is: Use the GRU decoder to directly extract the value corresponding to the slot from the current round of dialogue history; first, for the slot with the k-th slot prediction type of "generate", define the initial hidden state of the GRU as The initial input is defined as in, is the representation of the kth slot gate in the conversation encoder, is the representation in the multi-relational pattern graph encoder; Hidden state at time m The update process is as follows: First, the word decoded at the current moment is embedded As input, until a special marker [EOS] is generated, indicating the end of decoding: During the mth step of decoding, the hidden state of the decoder is converted into a probability distribution based on vocabulary, calculated as follows: Among them, the word embedding matrix Shared with the word embedding matrix of the dialogue encoder module, d vocab Indicates the vocabulary size; At the same time, the hidden state of the decoder is also converted into a probability distribution based on the conversation history, calculated as follows: Among them, H t is the output representation of the encoder; Using the soft copy mechanism, the final distribution is the weighted sum of two probability distributions:
10. The task-based dialog state tracking method integrating slot association and semantic association according to claim 8, characterized in that: The prediction method of the copied value decoder is: The copy value decoder uses a mapping layer to predict which slot value in the previous dialogue state to copy to the target slot; for the kth slot gate prediction type "copy", the slot's representation in the dialogue encoder is and representations in multi-relational schema graph encoders As the input of the copy value decoder, the calculation formula is as follows: in, It is based on the probability distribution of all slots domain-slot; Then, by Get the index of the slot to be copied; finally, the value of the target slot is copied using the following formula: