End-to-end task-based dialogue method, system, terminal and medium based on knowledge tracking
By constructing an end-to-end dialogue data set with knowledge tracking and using GLMP memory network, the problem of unreliability of knowledge base retrieval in end-to-end task-based dialogue systems is solved, and a more reliable and interpretable knowledge base retrieval process is achieved. , improving the reliability of system response.
Patent Information
- Application Number
- CN202311623057.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-30
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2043-11-30
AI Technical Summary
Existing end-to-end task-based dialogue systems have unreliability and uncertainty in the knowledge base retrieval process, resulting in unreliable generated results.
By constructing an end-to-end dialogue dataset with knowledge tracking, using a GLMP memory network to encode the dialogue history, and retrieving knowledge entities and supporting facts through the knowledge tracking layer, it is integrated into a pipeline or conventional end-to-end task-based dialogue system , provides triple vector representation of conversation history and knowledge base to enhance the reliability of the retrieval process.
It improves the reliability and interpretability of knowledge base retrieval, ensures that the system response generation results are based on correct knowledge base retrieval, and enhances the reliability and efficiency of the dialogue system.
Smart Images

Figure CN117668184B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of Internet technology, and in particular to an end-to-end task-based dialogue method, system, terminal and medium based on knowledge tracking. Background Art
[0002] In recent years, the application of task-based dialogue systems in real-world scenarios has achieved rapid development. Compared with open-domain dialogue systems that do not require external knowledge, task-based dialogue systems need to rely on the retrieval of external knowledge bases to obtain some knowledge required for dialogue, and then complete the generation of system responses. Therefore, whether the system can generate reliable answers by correctly and effectively retrieving external knowledge bases has become a key factor in the application of task-based dialogue systems in real-world scenarios.
[0003] Task-based dialogue systems based on model architecture can be divided into two basic types: pipeline task-based dialogue systems and end-to-end task-based dialogue systems. The pipeline task-based dialogue system decomposes the task-based dialogue into multiple specific subtasks, each of which is handled by a corresponding independent module. It is usually divided into modules such as natural language understanding, dialogue state tracking, dialogue strategy, and natural language generation. The traditional pipeline task-based dialogue system can be called through the API to ensure the correct retrieval of the knowledge base, but the operation of calling the API is not differentiable. Therefore, the pipeline task-based dialogue can only be implemented in a sequential cascade manner, that is, the implementation of the entire dialogue relies on multiple modules in a specific order. Each module is responsible for processing a specific subtask and passing the processing result to the next module. The error generated by a previous module will be passed back along this process. Therefore, this model will cause error transmission and due to the inability to parallelize calculations, the system processes the dialogue slowly, which is difficult to meet the needs of real scenarios. The scope of end-to-end task-based dialogue systems is relatively broad. In addition to the conventional end-to-end task-based dialogue systems that use a single model, the entire dialogue system only contains one input and one output, and does not contain the intermediate input and output processes; there are also end-to-end task-based dialogue systems that use a pipeline architecture. This kind of system adopts a modular approach and divides the system into several modules. Each module handles one or more dialogue subtasks, but unlike the end-to-end task-based dialogue system that uses a single model, this model can generate outputs for the intermediate process. The conventional end-to-end task-based dialogue system is an architecture that uses a single model to directly process all subtasks in the dialogue. It uses deep learning models (such as recurrent neural networks, Transformers, etc.) to learn the direct mapping relationship from input to output without explicit modular decomposition. This system architecture can jointly optimize multiple subtask modules and reduce the transmission of errors between modules. Although this method has achieved remarkable results, the end-to-end task-based dialogue system based on deep learning neural networks is a black box model for users, and its internal knowledge base retrieval process is unknown. Therefore, there is no guarantee that the system has searched the external knowledge base or searched correctly and effectively, so it cannot be determined whether the final generation result of the system is obtained by searching the correct knowledge base, which causes uncertainty in the retrieval process and unreliability of the generated results. Summary of the invention
[0004] In view of the above-mentioned shortcomings of the existing end-to-end task-based dialogue systems, the present invention provides an end-to-end task-based dialogue method, system, terminal and medium based on knowledge tracking, which enhances the reliability and explainability of the task-based dialogue system for external knowledge base retrieval by providing supporting facts for the explicit retrieval process.
[0005] In a first aspect, an end-to-end task-based dialogue method based on knowledge tracking is provided, comprising:
[0006] Build an end-to-end conversation dataset with knowledge tracking for training models;
[0007] Convert the content of the conversation history and knowledge base in the end-to-end conversation dataset with knowledge tracking into triple vector representation;
[0008] Use the GLMP memory network to encode the conversation history and store the vectorized conversation history and knowledge base;
[0009] Through the knowledge tracking layer, the last hidden state of the dialogue history is encoded as the query vector to retrieve the corresponding knowledge entities and supporting facts;
[0010] Integrate the obtained supporting facts into an end-to-end task-based or conventional end-to-end task-based dialogue system with a pipeline architecture.
[0011] Furthermore, the supporting fact is in the form of the number of rows of the retrieved knowledge entity in the knowledge base.
[0012] Furthermore, the end-to-end dialogue dataset with knowledge tracking is obtained by optimizing the original SMD (Stanford multi-domain dialogue) dataset, which achieves better retrieval effectiveness. The specific process includes:
[0013] The dialogues in the original SMD dataset that do not involve knowledge entities in the knowledge base are deleted; the dialogue quality in the original SMD dataset is relatively poor, and about 17.9% of the dialogues do not involve knowledge entities in the knowledge base, that is, the knowledge base is not retrieved; in order to solve this problem, such dialogues are deleted to promote the retrieval of the knowledge base by dialogues;
[0014] Introducing conversations outside the scope of the knowledge base into the original SMD dataset; the knowledge entities in the conversations in the original SMD dataset may have appeared in the previous conversation history, causing the model to copy more from the conversation history rather than retrieving from the knowledge base; in order to solve this problem, by introducing some conversations outside the scope of the knowledge base, these conversations query knowledge entities outside the current knowledge base to improve the retrieval ability of the dataset;
[0015] Correct the annotation errors of knowledge entities in the original SMD dataset. The original SMD dataset was collected using the wizard set by Wizard-of-OZ. Due to some reasons, the values annotated by the wizard are not completely consistent with the values of the knowledge entities in the underlying knowledge base. In order to solve this problem, the errors in the original SMD dataset were corrected by re-annotating the dataset so that the system can perform correct retrieval and response generation.
[0016] Supporting facts are defined and annotated in the end-to-end dialogue dataset; the original SMD dataset does not have clear annotations of the knowledge base query process, which makes it difficult for the model to evaluate the knowledge base retrieval ability; to address this problem, supporting facts are explicitly defined and annotated in the end-to-end dialogue dataset for reliable and explainable predictions.
[0017] Through the above optimization, we obtain an end-to-end dialogue dataset with knowledge tracking that is more conducive to the correct and effective retrieval of the model. Then, we use this dataset to train the knowledge tracking layer, so that it can perform a more effective retrieval process and provide supporting facts for the retrieval process of the knowledge base.
[0018] Furthermore, the GLMP memory network includes a global memory encoder and external knowledge; the global memory encoder is used to encode the dialogue history representation, and the external knowledge is used to store the dialogue history representation and the knowledge base representation.
[0019] Furthermore, the method of encoding the last hidden state of the conversation history as a query vector through the knowledge tracking layer, retrieving the corresponding knowledge entity and retrieving supporting facts includes:
[0020] The knowledge tracking layer uses the last hidden state encoded in the dialogue history as the query vector to retrieve the knowledge base representation in the external knowledge. The inner product similarity calculation method is used to calculate the correlation between the query vector and the knowledge entity in the external knowledge, and then a Sigmoid activation function is used to obtain the correlation distribution of the knowledge entity. The calculation formula is as follows:
[0021]
[0022] In the formula, g i represents the predicted value of the retrieved knowledge entity, q represents the query vector, Represents knowledge entity m i Representation of; Represents the golden label of the training sample, which means that when the knowledge entity m i When it appears in the system response Y, The value is 1, otherwise it is 0;
[0023] When the search results are obtained, the number of rows of the corresponding knowledge entity in the knowledge base is output as the corresponding search support fact. The calculation formula is as follows:
[0024] p(SF|X,B)=f(X,B)
[0025] In the formula, X represents the dialogue history, B represents the external knowledge base, SF represents the supporting facts, p(SF|X, B) represents the probability distribution of the supporting facts retrieved based on the given dialogue history X and the external knowledge base B, and f(X, B) represents the mapping relationship from X, B to SF;
[0026] For the probability distribution of the supporting facts obtained, a reliability retrieval threshold z is preset λ , that is, when p(SF|X, B) is greater than z λ When , the value of the corresponding knowledge entity is considered to be the result required to generate the system response, and the row number where the knowledge entity is located is the supporting fact of the retrieval process.
[0027] Furthermore, the step of integrating the obtained supporting facts into an end-to-end task-based or conventional end-to-end task-based dialogue system of a pipeline architecture includes:
[0028] For the pipelined end-to-end task-based dialogue system, a knowledge tracking method with an intermediate process is adopted. That is, after obtaining the supporting facts SF through the knowledge tracking layer, the supporting facts SF are used to replace the knowledge base and used together with the dialogue history representation as the input of the system response generation module to help generate reliable system responses. The implementation of the pipelined end-to-end task-based dialogue system is expressed as:
[0029] p(SF|X,B)=f(X,B)
[0030]
[0031] In the formula, Y represents the system response, t represents the tth time step of generating the response content (word or knowledge entity), and y t represents the tth word or knowledge entity of the system response, p(Y|X, SF) represents the probability of the system response based on the given dialogue history X and the corresponding supporting facts, and p(y t ∣y 1 ,…,y t-1 , X, SF) represents the probability of the tth word or knowledge entity of the system response based on the given dialogue history X and the corresponding supporting facts;
[0032] For conventional end-to-end task-based dialogue systems, a multi-task joint learning method is used. Multi-task joint learning aims to improve the performance and generalization ability of each task by allowing a model to learn multiple related tasks at the same time. For end-to-end task-based dialogue systems, a model can simultaneously learn to solve multiple subtasks in the dialogue system, such as dialogue understanding, knowledge tracking, and response generation. That is, given each dialogue history and the corresponding knowledge base, not only can a reliable system response be generated, but also the corresponding supporting facts can be given. The implementation of a conventional end-to-end task-based dialogue system is expressed as:
[0033] p(SF,Y|X,B)=σ(X,B)
[0034] Where σ represents the mapping function that simultaneously generates supporting facts SF and system responses Y, and p(SF, Y|X, B) represents the probability of obtaining the corresponding system response Y and supporting facts SF based on the given dialogue history X and external knowledge base B.
[0035] Furthermore, the bag-of-words model is used to convert the conversation history and the content of the knowledge base in the end-to-end conversation dataset with knowledge tracking into a representation in the form of a triple vector.
[0036] In the second aspect, an end-to-end task-based dialogue system based on knowledge tracking is provided, including:
[0037] Conversation history information acquisition module: used to obtain user conversation history information and perform preprocessing;
[0038] Encoder module: used to convert the conversation history and knowledge base into triple vector form, encode the conversation history, and use its final encoded representation as the query vector;
[0039] Knowledge tracking module: used to retrieve the knowledge base according to the query vector to obtain the corresponding knowledge entity, and provide the corresponding retrieval support facts;
[0040] Decoder module: used to generate corresponding system responses based on the dialogue history representation and the retrieval results of the knowledge tracking module.
[0041] In a third aspect, an electronic terminal is provided, comprising:
[0042] a memory having a computer program stored thereon;
[0043] The processor is used to implement the end-to-end task-based dialogue method based on knowledge tracking described in the first aspect when loading and executing the computer program.
[0044] In a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the end-to-end task-based dialogue method based on knowledge tracking described in the first aspect is implemented.
[0045] The present invention proposes an end-to-end task-based dialogue method, system, terminal and medium based on knowledge tracking. A knowledge tracking task is added to the traditional end-to-end task-based dialogue system to provide a display basis for the knowledge retrieval process of the external knowledge base - supporting facts, and integrates knowledge tracking into two end-to-end task-based dialogue systems with different architectures, thereby providing a reliable factual basis for the response generation of the end-to-end task-based dialogue system and enhancing the reliability and explainability of the end-to-end task-based dialogue response generation. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0047] Figure 1 is a flow chart of an end-to-end task-based dialogue method based on knowledge tracking provided by an embodiment of the present invention;
[0048] Figure 2 is an example diagram of deleting a conversation beyond the scope of a knowledge base provided by an embodiment of the present invention;
[0049] Figure 3 It is an example diagram of whether the system provided by the embodiment of the present invention has supporting facts and generates system responses, wherein (a) is an example diagram of system responses without supporting facts, and (b) is an example diagram of system responses with supporting facts;
[0050] Figure 4 It is a diagram of examples of four types of knowledge entity annotation errors provided by an embodiment of the present invention;
[0051] Figure 5 It is a schematic diagram of an end-to-end task-based dialogue system of a pipeline architecture based on knowledge tracking provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0052] To make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be described in detail below. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other implementation methods obtained by ordinary technicians in this field without creative work belong to the scope of protection of the present invention.
[0053] like Figure 1 As shown, an embodiment of the present invention provides an end-to-end task-based dialogue method based on knowledge tracking, including:
[0054] S1: Build an end-to-end dialogue dataset with knowledge tracking for training models;
[0055] S2: Convert the dialogue history and knowledge base content in the end-to-end dialogue dataset with knowledge tracking into a representation in the form of a triple vector;
[0056] S3: Use the GLMP memory network to encode the conversation history and store the vectorized conversation history and knowledge base;
[0057] S4: The knowledge tracking layer uses the last hidden state encoded in the conversation history as the query vector to retrieve the corresponding knowledge entities and supporting facts;
[0058] S5: Integrate the obtained supporting facts into the end-to-end task-based dialogue system of the pipeline architecture or the conventional end-to-end task-based dialogue system.
[0059] By adding a knowledge tracking task to the traditional end-to-end task-based dialogue system, we provide an explicit basis for the knowledge retrieval process in the external knowledge base - supporting facts, and integrate knowledge tracking into two end-to-end task-based dialogue systems with different architectures, thereby providing a reliable factual basis for the response generation of the end-to-end task-based dialogue system and enhancing the reliability and explainability of the end-to-end task-based dialogue response generation.
[0060] In this embodiment, the end-to-end dialogue dataset with knowledge tracking in step S1 is obtained by optimizing the original SMD dialogue dataset, so that the system can better and more effectively retrieve the external knowledge base. Figure 2 , Figure 3 , Figure 4 This is an example of some optimization and modification of the original SMD dataset, mainly including the correction of 4 existing problems that cause errors in model retrieval of external knowledge bases, including:
[0061] (1) Delete the dialogues in the original SMD dataset that do not involve knowledge entities in the knowledge base. The dialogue quality in the original SMD dataset is relatively poor. About 17.9% of the dialogues do not involve knowledge entities in the knowledge base, that is, the knowledge base is not searched. In order to solve this problem, such dialogues are deleted to promote the search of the knowledge base. In this embodiment, the dialogues that do not contain knowledge base entities in the dialogue history but the system can still give the corresponding correct responses are deleted. For example, the user asks: "What are the more famous stinky tofu brands in Changsha? Give two examples", and then the system gives a reply: "The more famous stinky tofu brands in Changsha are Black Classic and Fire Palace." However, there are no entities such as stinky tofu, Black Classic, and Fire Palace in the external knowledge base. The system may have learned them from training samples or previous dialogue history. Therefore, in order to avoid this non-retrieval behavior, such dialogues need to be deleted.
[0062] (2) Introducing conversations outside the scope of the knowledge base into the original SMD dataset. The knowledge entities in the conversations in the original SMD dataset may have appeared in the previous conversation history, causing the model to copy more from the conversation history rather than retrieving from the knowledge base; to solve this problem, by introducing some conversations outside the scope of the knowledge base, these conversations query knowledge entities outside the current knowledge base to improve the retrieval ability of the dataset. Figure 2 As shown, for the construction of dialogues outside the scope of the knowledge base, de-entity is first adopted, that is, all knowledge entities are replaced by their corresponding entity type slots. For example, the entity value 3pm is replaced by time (entity type slot). Then, specific entity types are sampled from the entire knowledge base to ensure that when filling the corresponding slots, the filled entity types are not within the scope of the knowledge base entity. Therefore, in this way, the created questions cannot be answered with the corresponding knowledge base. For the generation of responses beyond the scope of the knowledge base, you can choose to directly generate standard responses, such as "I'm sorry, I can't find the entity type in the corresponding knowledge base." In order to ensure diversity and richness, about 30 types of templates are constructed for each field in this embodiment. In addition, in order to maintain the consistency of the dialogue logic, it is further randomly inserted into the beginning of some dialogues, and manual inspection is used to check whether the overall logic of the dialogue after insertion is reasonable. If it is unreasonable, the part of the insertion is removed.
[0063] (3) Correct the annotation errors of knowledge entities in the original SMD dataset. The original SMD dataset was collected using the wizard set by Wizard-of-OZ. For some reasons, the values annotated by the wizard are not completely consistent with the values of the knowledge entities in the underlying knowledge base. In order to solve this problem, the errors in the original SMD dataset are corrected by re-annotating the dataset so that the system can perform correct retrieval and response generation. Figure 4As shown, in this embodiment, entity annotation errors are mainly divided into four types and corresponding modifications are made. The first type is missing annotation content, such as Figure 4 The first row shown shows that the entity Stanford Oval is missing the subword Parking; the second is that the entity annotation is inconsistent with the actual logic, such as Figure 4 The second row of the hail local weather conflict shown; the third is the misspelling of the entity name, such as Figure 4 The place name in the third row shown is such a case; the fourth type is that the entity labeling is not standardized, such as Figure 4 The one mile in the fourth line shown should be annotated as 1mile. Although the two are semantically consistent and do not hinder user understanding, in order to standardize and avoid some unexpected problems, we require that the annotation must be standardized.
[0064] (4) Supporting facts are defined and annotated in the end-to-end dialogue dataset. Specifically, the supporting facts set in this dataset are in the form of the number of rows of the retrieved knowledge entity in the knowledge base. The original SMD dataset does not have clear annotations on the knowledge base query process, which makes it difficult for the model to evaluate the knowledge base retrieval ability. To solve this problem, supporting facts are clearly defined and annotated in the end-to-end dialogue dataset for reliable and explainable predictions. Figure 3 As shown in (a) and (b), the system provides an example of whether there are supporting facts and generating system responses. When the user asks to query the activity time of the latest appointment, the system needs to retrieve the corresponding knowledge base to generate a response based on the user's needs. In order to further verify the reliability of the retrieval, as shown in Figure 3 As shown in (b), the number of rows of knowledge entities in the knowledge base is added to the dataset, so that the knowledge tracking layer can capture the number of rows in the knowledge base as the supporting facts of the retrieval when the system retrieves the corresponding knowledge entity. Afterwards, in order to ensure the accuracy of training on this dataset, you can manually check whether the system response generated in the training data matches the corresponding supporting facts, and correct the wrong supporting facts.
[0065] Through the above optimization, we obtain an end-to-end dialogue dataset with knowledge tracking that is more conducive to the correct and effective retrieval of the model. Then, we use this dataset to train the knowledge tracking layer, so that it can perform a more effective retrieval process and provide supporting facts for the retrieval process of the knowledge base.
[0066] In this embodiment, in step S2, the method of using the bag-of-words model is used to convert the conversation history and the content of the knowledge base in the end-to-end conversation dataset with knowledge tracking into a representation in the form of a triple vector, which specifically includes:
[0067] 1) Use the bag-of-words model to convert the conversation history input into triples, such as Figure 2 The original first-round conversation content of the user is "Is there a tai_pan here?", which can be expressed as ($Driver, turn1, is), ($Driver, turn1, there), ..., ($Driver, turn1, here), ...; and the system's conversation content in the third round of conversation is "setting gps, we will arrive shortly", which can be expressed as ($Car, turn3, setting), ($Car, turn3, gaps), ..., ($Car, turn3, shortly). This representation method can not only retain the content information of the conversation in a concise and effective way, but also include the main information of the conversation and the location information of the conversation in the context, which is conducive to the model learning through context information.
[0068] 2) Use the bag-of-words model to convert the external knowledge base into triples, such as Figure 2 As shown in the figure, the knowledge base content is about the name, type and distance of some nearby infrastructure and entertainment facilities. It can be expressed as (palo_alto_cafe, type, coffee_or_tea_place), (palo_alto_cafe, distance, 5_miles)... This representation method not only uses a unified paradigm to record the representation of the knowledge base, but also enables the model to learn the relationship between different entity information in the knowledge base.
[0069] In step S3, the GLMP memory network includes a global memory encoder and external knowledge; the global memory encoder is used to encode the dialogue history representation, and the external knowledge is used to store the dialogue history representation and the knowledge base representation.
[0070] In step S4, the knowledge tracking layer uses the last hidden state encoded in the conversation history as a query vector to retrieve the corresponding knowledge entity and retrieve supporting facts, including:
[0071] After the global memory encoder encodes the conversation history and uses external knowledge to store the conversation history representation and knowledge base representation, the knowledge tracking layer uses the last hidden state of the conversation history encoding as the query vector to retrieve the knowledge base representation in the external knowledge. The inner product similarity calculation method is used to calculate the correlation between the query vector and the knowledge entity in the external knowledge, and then a Sigmoid activation function is used to obtain the correlation distribution of the knowledge entity. The calculation formula is as follows:
[0072]
[0073] In the formula, g irepresents the predicted value of the retrieved knowledge entity, q represents the query vector, Represents knowledge entity m i Representation of; Represents the golden label of the training sample, which means that when the knowledge entity m i When it appears in the system response Y, The value is 1, otherwise it is 0;
[0074] Since this process is an implicit retrieval process, in order to make this retrieval process more reliable, it is required to output the number of rows of the corresponding knowledge entity in the knowledge base as the corresponding retrieval supporting fact, namely SF (Supporting Fact), when the retrieval results are obtained. The calculation formula is as follows:
[0075] p(SF|X,B)=f(X,B)
[0076] In the formula, X represents the dialogue history, B represents the external knowledge base, SF represents the supporting facts, p(SF|X,B) represents the probability distribution of the supporting facts retrieved based on the given dialogue history X and the external knowledge base B, and f(X,B) represents the mapping relationship from X, B to SF;
[0077] For the probability distribution of the supporting facts obtained, a reliability retrieval threshold z is preset λ In this task, λ The value of is 0.5, that is, when p(SF|X, B) is greater than 0.5, it is considered that the value of the corresponding knowledge entity is the result required to generate the system response, and the number of rows where the knowledge entity is located is the supporting fact of the retrieval process.
[0078] When p(SF|X, B) is greater than 0.5, the relevant knowledge entity is retrieved, requiring the knowledge tracking layer to extract not only the corresponding knowledge entity, but also the corresponding supporting facts, in order to verify the reliability of the retrieval. Figure 3 As shown in (b), when the model understands the user's intention based on the dialogue history representation is to query the time of the (recent) appointment activity, the knowledge tracking layer will calculate the inner product similarity with the knowledge entities in the knowledge base, and obtain the g of the knowledge entities in the first and sixth rows of the knowledge base. i The value is 1, which determines that the relevant knowledge entities are in the first and sixth rows of the corresponding knowledge base, that is, the time of the first appointment activity is 4 pm on the 2nd, and the time of the second appointment activity is 10 am on the 12th; at the same time, in order to ensure the reliability of the retrieval, the knowledge tracking layer is also required to give the row number where the knowledge entity is located as the supporting fact of the retrieval, that is, SF = [1,6].
[0079] In step S5, the obtained supporting facts are integrated into an end-to-end task-based or conventional end-to-end task-based dialogue system of a pipeline architecture, specifically including:
[0080] For an end-to-end task-based dialogue system with a pipeline architecture, such as Figure 5 As shown in Figure 1, a knowledge tracking method with an intermediate process is adopted, that is, after obtaining the supporting facts SF through the knowledge tracking layer, the supporting facts SF are used to replace the knowledge base and used together with the dialogue history representation as the input of the decoder to help generate reliable system responses; the implementation of the end-to-end task-based dialogue system with a pipeline architecture is expressed as:
[0081] p(SF|X,B)=f(X,B)
[0082]
[0083] In the formula, Y represents the system response, t represents the tth time step of generating the response content (word or knowledge entity), and y t represents the tth word or knowledge entity of the system response, p(Y|X,SF) represents the probability of the system response based on the given dialogue history X and the corresponding supporting facts, and p(y t ∣y 1 ,…,y t-1 , X, SF) represents the probability of the tth word or knowledge entity of the system response based on the given dialogue history X and the corresponding supporting facts.
[0084] For example, if Figure 3 As shown in (b), when the model correctly retrieves the corresponding knowledge entities {(first row) optometrist_apointment, 4pm, the 2nd, father; (sixth row) optometrist_apointment, 10am, the 12th, jeff} through the knowledge tracking layer and gives the supporting facts {1, 6} in the corresponding knowledge base (Event knowledge base), the system then replaces the knowledge base with the supporting facts and uses them together with the dialogue history as the input of the response generation module to generate the system response. This method directly and explicitly uses the supporting facts, that is, it directly provides them as input to the response generation module in the middle process of the system generating the response, providing a reliable basis for the generation of the system response and improving the reliability of system retrieval and generation.
[0085] For conventional end-to-end task-based dialogue systems that use a multi-task joint learning architecture, a knowledge tracking method without intermediate processes is used, that is, a unified closed model is used to solve multiple tasks in an end-to-end task-based dialogue without the output and input of the intermediate process. In the multi-task learning framework of the dialogue system, it is hoped that a model can simultaneously learn to solve multiple subtasks in the dialogue system, such as dialogue understanding, knowledge tracking, and response generation, that is, given each dialogue history and the corresponding knowledge base, not only can a reliable system response be generated, but also the corresponding supporting facts can be given; the implementation of a conventional end-to-end task-based dialogue system is expressed as:
[0086] p(SF,Y|X,B)=σ(X,B)
[0087] Where σ represents the mapping function that simultaneously generates supporting facts SF and system responses Y, and p(SF,Y|X,B) represents the probability of obtaining the corresponding system response Y and supporting facts SF based on the given dialogue history X and external knowledge base B.
[0088] For example, for Figure 3 In the dialogue (b), if a conventional end-to-end task-based dialogue system with a multi-task joint learning architecture is used, the system needs to complete the response generation task and the knowledge tracking task at the decoder side at the same time, that is, the decoder simultaneously generates the system response {you have two optometrist_appointment scheduled; one for the_2nd at 4pm with father and one the_12th at 10am with jeff} and the supporting facts {1, 6} in the corresponding knowledge base (Event knowledge base). This method has no intermediate process, and does not use the supporting facts as the input of the response generation module. Instead, it is output together with the system response, providing additional support for system retrieval and improving the interpretability of the system retrieval process.
[0089] It should be noted that the process of generating corresponding system responses based on the retrieved results in the pipeline architecture end-to-end task-based and conventional end-to-end task-based dialogue systems is prior art and is not the focus of the present invention and will not be elaborated here.
[0090] The embodiment of the present invention further provides an end-to-end task-based dialogue system based on knowledge tracking, comprising:
[0091] Conversation history information acquisition module: used to obtain user conversation history information and perform preprocessing. The preprocessing process is to splice the conversation content of a certain round together;
[0092] Encoder module: used to convert the conversation history and knowledge base into triple vector form, encode the conversation history, and use its final encoded representation as the query vector;
[0093] Knowledge tracking module: used to retrieve the knowledge base according to the query vector to obtain the corresponding knowledge entity, and provide the corresponding retrieval support facts;
[0094] Decoder module: used to generate corresponding system responses based on the dialogue history representation and the retrieval results of the knowledge tracking module.
[0095] Of course, the above-mentioned end-to-end task-based dialogue system based on knowledge tracking needs to be trained with the end-to-end dialogue dataset with knowledge tracking constructed in the above-mentioned embodiment and then put into online use.
[0096] It should be understood that the functional unit modules in various embodiments of the present invention may be concentrated in one processing unit, or each unit module may exist physically separately, or two or more unit modules may be integrated in one unit module, and may be implemented in the form of hardware or software.
[0097] An embodiment of the present invention further provides an electronic terminal, including:
[0098] a memory having a computer program stored thereon;
[0099] The processor is used to implement the end-to-end task-based dialogue method based on knowledge tracking described in the above embodiment when loading and executing the computer program.
[0100] An embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the end-to-end task-based dialogue method based on knowledge tracking described in the aforementioned embodiment is implemented.
[0101] It can be understood that the same or similar parts of the above embodiments can be referenced to each other, and the contents not described in detail in some embodiments can refer to the same or similar contents in other embodiments.
[0102] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0103] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0104] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0105] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0106] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.
Claims
1. An end-to-end task-based dialogue method based on knowledge tracking, characterized in that: include: Build an end-to-end conversation dataset with knowledge tracking for training models; Convert the content of the conversation history and knowledge base in the end-to-end conversation dataset with knowledge tracking into triple vector representation; Use the GLMP memory network to encode the conversation history and store the vectorized conversation history and knowledge base; Through the knowledge tracking layer, the last hidden state of the dialogue history is encoded as the query vector to retrieve the corresponding knowledge entities and supporting facts; Integrate the obtained supporting facts into an end-to-end task-based dialogue system with a pipeline architecture; The end-to-end dialogue dataset with knowledge tracking is obtained by optimizing the original SMD dataset. The specific process includes: Delete the conversations in the original SMD dataset that do not involve knowledge entities in the knowledge base; Introducing conversations outside the scope of the knowledge base into the original SMD dataset; Correct the labeling errors of knowledge entities in the original SMD dataset; Define and annotate supporting facts in the end-to-end dialogue dataset; The GLMP memory network includes a global memory encoder and external knowledge; the global memory encoder is used to encode the dialogue history representation, and the external knowledge is used to store the dialogue history representation and the knowledge base representation; The knowledge tracking layer uses the last hidden state encoded in the dialogue history as a query vector to retrieve the corresponding knowledge entity and retrieve supporting facts, including: The knowledge tracking layer uses the last hidden state encoded in the dialogue history as the query vector to retrieve the knowledge base representation in the external knowledge. The inner product similarity calculation method is used to calculate the correlation between the query vector and the knowledge entity in the external knowledge, and then a Sigmoid activation function is used to obtain the correlation distribution of the knowledge entity. The calculation formula is as follows: In the formula, g i represents the predicted value of the retrieved knowledge entity, q represents the query vector, Represents knowledge entity m i ' Represents the golden label of the training sample, which means that when the knowledge entity m i When it appears in the system response Y, The value is 1, otherwise it is 0; When the search results are obtained, the number of rows of the corresponding knowledge entity in the knowledge base is output as the corresponding search support fact. The calculation formula is as follows: p(SF|X,B)=f(X,B) In the formula, X represents the dialogue history, B represents the external knowledge base, SF represents the supporting facts, p(SF|X,B) represents the probability distribution of the supporting facts retrieved based on the given dialogue history X and the external knowledge base B, and f(X,B) represents the mapping relationship from X, B to SF; For the probability distribution of the supporting facts obtained, a reliability retrieval threshold z is preset λ , that is, when p(SF|X,B) is greater than z λ When , the value of the corresponding knowledge entity is considered to be the result required to generate the system response, and the row number where the knowledge entity is located is the supporting fact of the retrieval process; The step of integrating the obtained supporting facts into an end-to-end task-based dialogue system of a pipeline architecture includes: For the end-to-end task-based dialogue system with pipeline architecture, the knowledge base is replaced by supporting facts SF, and together with the dialogue history representation, it is used as the input of the system response generation module to help generate reliable system responses; the implementation of the end-to-end task-based dialogue system with pipeline architecture is expressed as: p(SF|X,B)=f(X,B) In the formula, Y represents the system response, t represents the tth time step of generating the response content, and y t represents the tth word or knowledge entity of the system response, p(Y|X,SF) represents the probability of the system response based on the given dialogue history X and the corresponding supporting facts, and p(y t |y1,…,y t-1 ,X,SF) represents the probability of the tth word or knowledge entity of the system response based on the given dialogue history X and the corresponding supporting facts.
2. The end-to-end task-based dialogue method based on knowledge tracking according to claim 1 is characterized in that: The supporting fact is in the form of the number of rows of the retrieved knowledge entity in the knowledge base.
3. The end-to-end task-based dialogue method based on knowledge tracking according to claim 1 is characterized in that: The bag-of-words model is used to convert the conversation history and knowledge base content in the end-to-end conversation dataset with knowledge tracking into a representation in the form of a triple vector.
4. An end-to-end task-based dialogue system based on knowledge tracking, characterized in that: The method for implementing the end-to-end task-based dialogue based on knowledge tracking as claimed in any one of claims 1 to 3 comprises: Conversation history information acquisition module: used to obtain user conversation history information and perform preprocessing; Encoder module: used to convert the conversation history and knowledge base into triple vector form, encode the conversation history, and use its final encoded representation as the query vector; Knowledge tracking module: used to retrieve the knowledge base according to the query vector to obtain the corresponding knowledge entity, and provide the corresponding retrieval support facts; Decoder module: used to generate corresponding system responses based on the dialogue history representation and the retrieval results of the knowledge tracking module.
5. An electronic terminal, characterized in that: include: a memory having a computer program stored thereon; A processor, configured to implement the end-to-end task-based dialogue method based on knowledge tracking as described in any one of claims 1 to 3 when loading and executing the computer program.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the end-to-end task-based dialogue method based on knowledge tracking as described in any one of claims 1 to 3 is implemented.
Citation Information
Patent Citations
Global-to-local memory pointer networks for task-oriented dialogue
CN112771531A
