Task-based dialogue question-answering method and device, equipment, storage medium and program product
By querying the rewrite model to rewritten the conversation data input by the user, and using the task dialogue model to identify the question-and-answer types and task nodes, the problem of high standardization of user input in the prior art is solved, and the accuracy of task-based conversation questions and answers is improved.
Patent Information
- Application Number
- CN202411728605.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-28
- Publication Date
- 2025-03-14
AI Technical Summary
In the prior art, the rule matching method has high standardization requirements for user input, making it difficult to deal with spoken questions and vague questions, resulting in a reduced accuracy of task-based conversation questions and answers.
The query rewriting model is used to rewritten the conversation data input by the user into semantic complete dialogue data, and the target question-and-answer type and task node corresponding to the conversation data are identified through the task dialogue model, thereby determining the reply data of the task-based dialogue question-and-answer question-and-answer question-and-answer question-and-answer question-and-answer question-and-answer question-and-answer question-and-answer question-and-answer question-and-answer question-and-answer question-and-answer question-and-answer question-and-answer question-and-answer question-and-answer question-and-answer question-and-answer question-and-answer question-and-answer question-and-answer question-and-answer question-and-answer question-and-an
It improves the accuracy of task-based dialogue questions and answers, can effectively handle non-normative questions, and enhances the semantic understanding ability of dialogue data.
Smart Images

Figure CN119621907A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a task-based dialogue question-answering method, device, equipment, storage medium and program product. Background Art
[0002] Task-based dialogue is a form of human-computer dialogue with a specific task as the main line of dialogue. The task-based dialogue system generally gradually confirms the user's intention through steps such as follow-up questions and clarifications, guides the user to clarify the specific goals of the question, and then outputs the response to the task-based dialogue.
[0003] In related technologies, task-based conversational question and answering is usually implemented by rule matching. First, text matching is performed on the user's input to identify the entities to be extracted, and the slots are filled with the entities to be extracted. Then, the task-based conversational question and answer process is advanced to the next node or directly jumps to the reply node to obtain the reply data of the task-based conversational question and answer.
[0004] However, the rule matching method has high requirements on the standardization of user input and requires a series of templates to be set in advance for matching. When the user inputs text with low standardization such as colloquial questions and fuzzy questions, it is easy to reduce the accuracy of task-based dialogue question answering. Summary of the invention
[0005] Based on this, it is necessary to provide a task-based dialogue question and answer method, device, equipment, storage medium and program product that can improve the accuracy of task-based dialogue question and answer in response to the above technical problems.
[0006] In a first aspect, the present application provides a task-based dialogue question-answering method, comprising:
[0007] Receiving first dialogue data input by a user in a task-based dialogue question and answer;
[0008] If the first dialogue data is non-first-round dialogue data in a multi-round dialogue, rewriting the first dialogue data into semantically complete second dialogue data using a query rewriting model;
[0009] The second dialogue data is input into a task dialogue model, and a task node of the second dialogue data output by the task dialogue model in a task tree is obtained; the task dialogue model is used to identify a target question and answer type corresponding to the second dialogue data, and identify a task node corresponding to the second dialogue data in the task tree corresponding to the target question and answer type;
[0010] Determine the response data of the task-based dialogue question and answer according to the task node corresponding to the second dialogue data.
[0011] In one of the embodiments, the query rewriting model is used to rewrite the first dialogue data into the second dialogue data based on the historical dialogue data in the multiple rounds of dialogue.
[0012] In one embodiment, the task nodes include reply nodes, clarification nodes and follow-up nodes.
[0013] In one embodiment, determining the response data of the task-based dialogue question and answer according to the task node of the second dialogue data includes:
[0014] If the task node is a reply node, the reply data of the first dialogue data is obtained from the data of the reply node.
[0015] In one embodiment, determining the response data of the task-based dialogue question and answer according to the task node of the second dialogue data includes:
[0016] If the task node is not a reply node, clarification data or follow-up data is generated based on the data in the task node and the node branch of the task node to advance the process of task-based dialogue question and answer to the reply node; and reply data of the first dialogue data is obtained from the data of the reply node.
[0017] In one embodiment, the method further comprises:
[0018] Get multiple knowledge documents uploaded by users;
[0019] Clustering the plurality of knowledge documents using a clustering model, and determining the clustered question and answer types and the question and answer type corresponding to each knowledge document;
[0020] Use the structured processing model to perform structured processing on the data in each knowledge document to obtain the tree structure data of each knowledge document;
[0021] According to the question and answer type corresponding to each knowledge document, the tree structure data of each knowledge document is merged to generate a task tree corresponding to each question and answer type.
[0022] In a second aspect, the present application provides a task-based dialogue question-answering device, comprising:
[0023] A receiving module, configured to receive first dialogue data input by a user in a task-based dialogue question and answer;
[0024] a rewriting module, configured to rewrite the first dialogue data into semantically complete second dialogue data using a query rewriting model if the first dialogue data is non-first-round dialogue data in a multi-round dialogue;
[0025] an identification module, configured to input the second dialogue data into a task dialogue model, and obtain a task node of the second dialogue data output by the task dialogue model in a task tree; the task dialogue model is configured to identify a target question and answer type corresponding to the second dialogue data, and identify a task node corresponding to the second dialogue data in the task tree corresponding to the target question and answer type;
[0026] A reply module is used to determine reply data of the task-based dialogue question and answer according to the task node of the second dialogue data.
[0027] In one of the embodiments, the query rewriting model is used to rewrite the first dialogue data into the second dialogue data based on the historical dialogue data in the multiple rounds of dialogue.
[0028] In one embodiment, the task nodes include reply nodes, clarification nodes and follow-up nodes.
[0029] In one of the embodiments, the reply module is further configured to obtain reply data of the first conversation data from data of the reply node if the task node is a reply node.
[0030] In one embodiment, the reply module is also used to generate clarification data or follow-up data based on the data in the task node and the node branch of the task node if the task node is not a reply node, so as to advance the process of task-based dialogue question and answer to the reply node; and obtain reply data of the first dialogue data from the data of the reply node.
[0031] In one embodiment, the task-based dialogue question-answering device further includes:
[0032] A generation module is used to obtain multiple knowledge documents uploaded by users; cluster the multiple knowledge documents using a clustering model to determine the clustered question and answer types and the question and answer types corresponding to each knowledge document; use a structured processing model to structure the data in each knowledge document to obtain tree structure data of each knowledge document; merge the tree structure data of each knowledge document according to the question and answer type corresponding to each knowledge document to generate a task tree corresponding to each question and answer type.
[0033] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the task-based dialogue question-answering method of the first aspect is implemented.
[0034] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the task-based dialogue question-and-answer method of the first aspect described above.
[0035] In a fifth aspect, the present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the task-based dialogue question-answering method of the first aspect mentioned above.
[0036] The above-mentioned task-based dialogue question-answering method, device, equipment, storage medium and program product first receive the first dialogue data input by the user in the task-based dialogue question-answering. If the first dialogue data is non-first-round dialogue data in a multi-round dialogue, the query rewriting model is used to rewrite the first dialogue data into semantically complete second dialogue data. Subsequently, the second dialogue data is input into the task dialogue model, and the task node of the second dialogue data output by the task dialogue model in the task tree is obtained. The task dialogue model is used to identify the target question-answering type corresponding to the second dialogue data, and identify the task node corresponding to the second dialogue data in the task tree corresponding to the target question-answering type. Finally, the reply data of the task-based dialogue question-answering is determined according to the task node corresponding to the second dialogue data. Since the dialogue data input by the user is rewritten into semantically complete dialogue data through the query rewriting model, the question-answering type corresponding to the dialogue data is identified by relying on the semantic understanding ability of the task dialogue model, and the corresponding task node is queried in the task tree corresponding to the question-answering type, so that the dialogue data input by the user can be understood even if it is a non-standard question, thereby improving the accuracy of the task-based dialogue question-answering. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0038] Figure 1 An application environment diagram of a task-based dialogue question-answering method provided in an embodiment of the present application;
[0039] Figure 2 A flowchart of a task-based dialogue question-answering method provided in an embodiment of the present application;
[0040] Figure 3 A schematic diagram of the principle of a task-based dialogue question-answering method provided in an embodiment of the present application;
[0041] Figure 4A flowchart of another task-based dialogue question-answering method provided in an embodiment of the present application;
[0042] Figure 5 A structural block diagram of a task-based dialogue question-answering device provided in an embodiment of the present application;
[0043] Figure 6 An internal structure diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0044] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0045] First, the related technology will be described below.
[0046] Task-based dialogue is a form of human-computer dialogue with a specific task as the main line of dialogue. The task-based dialogue system generally gradually confirms the user's intention through steps such as follow-up questions and clarifications, guides the user to clarify the specific goals of the question, and then outputs the task-based dialogue response. A typical task-based dialogue system usually includes: an intention classification unit that diverts user questions, an information clarification unit that fills the user input, and a response unit that answers the specific question goals.
[0047] In the related technology, there are two commonly used methods to implement task-based dialogue question and answer.
[0048] In the first method, the task-based dialogue question and answer is implemented by rule matching. First, the user's input is matched with text, the entities to be extracted are identified, and the slots are filled with the entities to be extracted. Then, the task-based dialogue question and answer process is advanced to the next node or directly jumps to the reply node to obtain the reply data of the task-based dialogue question and answer. However, the rule matching method has high requirements on the standardization of user input, and a series of templates need to be set in advance for matching. When the user inputs text with low standardization such as colloquial questions and fuzzy questions, it is easy to affect the accuracy of task-based dialogue question and answer.
[0049] In the second approach, an end-to-end approach is used to implement task-based dialogue question and answer. A large language model (LLM) can be trained to complete multiple rounds of dialogue, directly provide feedback on user input, and rely on the understanding ability of the large language model to advance the dialogue process. However, the end-to-end approach has poor interpretability.
[0050] Moreover, whether using a rule-matching approach or an end-to-end approach to implement task-based dialogue question and answer, the task process needs to be manually configured, which is labor-intensive and time-consuming.
[0051] To solve the above problems, the embodiments of the present application provide a task-based dialogue question and answer method, apparatus, device, storage medium and program product. By querying the rewriting model, the dialogue data input by the user is rewritten into semantically complete dialogue data, relying on the semantic understanding ability of the task dialogue model to identify the question and answer type corresponding to the dialogue data, and querying the corresponding task node in the task tree corresponding to the question and answer type, so that the dialogue data input by the user can be understood even if it is a non-standard question, thereby improving the accuracy of task-based dialogue question and answer.
[0052] The following describes the application scenarios of the task-based dialogue question-answering method provided in the embodiments of the present application.
[0053] The task-based dialogue question-answering method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown, the terminal 102 communicates with the server 104 through a network. The data storage system can store data that the server 104 needs to process. The data storage system can be integrated on the server 104, or placed on the cloud or other network servers.
[0054] The task-based dialogue question and answer sent by the terminal 102 to the server 104 may include the first dialogue data. If the first dialogue data is non-first-round dialogue data in a multi-round dialogue, the server 104 first uses the query rewriting model to rewrite the first dialogue data into semantically complete second dialogue data. Subsequently, the server 104 inputs the second dialogue data into the task dialogue model, and obtains the task node of the second dialogue data output by the task dialogue model in the task tree. The task dialogue model is used to identify the target question and answer type corresponding to the second dialogue data, and identify the task node corresponding to the second dialogue data in the task tree corresponding to the target question and answer type. Finally, the server 104 determines the reply data of the task-based dialogue question and answer according to the task node corresponding to the second dialogue data, and sends the reply data to the terminal 102.
[0055] The terminal 102 may be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, IoT devices, and portable wearable devices. The IoT devices may be smart speakers, smart TVs, smart air conditioners, smart car devices, projection devices, etc. Portable wearable devices may be smart watches, smart bracelets, head-mounted devices, etc. Head-mounted devices may be virtual reality (VR) devices, augmented reality (AR) devices, smart glasses, etc. The server 104 may be an independent physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server that provides cloud computing services.
[0056] In an exemplary embodiment, Figure 2 As shown in the figure, a task-based dialogue question answering method is provided, which is applied to Figure 1 Taking the server in as an example, the task-based dialogue question-answering method includes S201-S204:
[0057] S201: Receive first dialogue data input by a user in a task-based dialogue question and answer session.
[0058] In the present application, when a task-based conversation question and answer is required, the server can receive the first conversation data input by the user in the task-based conversation question and answer.
[0059] Among them, the task-based dialogue question and answer can be a form of human-computer dialogue with a specific task as the main line of dialogue. The above-mentioned first dialogue data can be dialogue data input by the user in any round of task-based dialogue question and answer. Exemplarily, the above-mentioned first dialogue data can include question data input by the user.
[0060] In some embodiments, the terminal may receive first dialogue data input by a user in a task-based dialogue question and answer session, and then the terminal may send the first dialogue data to a server. For example, the user may input the first dialogue data in a variety of ways, such as text input, voice input, and image input.
[0061] S202: If the first dialogue data is not the first-round dialogue data in the multi-round dialogue, use the query rewriting model to rewrite the first dialogue data into semantically complete second dialogue data.
[0062] In this step, after receiving the first dialogue data input by the user in the task-based dialogue question and answer, the server can determine whether the first dialogue data is non-first-round dialogue data in the multi-round dialogue. If the first dialogue data is non-first-round dialogue data in the multi-round dialogue, the server uses the query rewriting model to rewrite the first dialogue data into semantically complete second dialogue data.
[0063] In other embodiments, if the first dialogue data is the first round of dialogue data in a multi-round dialogue, there is no need to rewrite the first dialogue data, and the first dialogue data can be directly used to determine the corresponding question and answer type.
[0064] The query rewriting model is used to rewrite the first dialogue data into the second dialogue data according to the historical dialogue data in the multi-round dialogue. Exemplarily, the query rewriting model can be generated by training a general large language model with semantically complete and relevant dialogue samples.
[0065] For example, Figure 3 A schematic diagram of the principle of a task-based dialogue question-answering method provided in an embodiment of the present application, such as Figure 3 As shown, the first dialogue data input by the user in the task-based dialogue question and answer is By rewriting the model F through query, it can convert the first dialogue data into the historical dialogue data in multiple rounds of dialogue. Rewrite to semantically complete second conversation data , the query rewriting model F can be rewritten as shown in formula (1):
[0066] (1)
[0067] S203: Input the second dialogue data into the task dialogue model, and obtain the task node in the task tree of the second dialogue data output by the task dialogue model.
[0068] In this step, after the server rewrites the first dialogue data into semantically complete second dialogue data, the second dialogue data may be input into the task dialogue model, and the task node of the second dialogue data output by the task dialogue model in the task tree may be obtained.
[0069] The task dialogue model is used to identify the target question and answer type corresponding to the second dialogue data, and to identify the task node corresponding to the second dialogue data in the task tree corresponding to the target question and answer type.
[0070] Among them, the task tree is a tree structure that hierarchizes the process of task-based dialogue question and answer. The task tree can include multiple task nodes, and each task node can store data.
[0071] The data stored in the task node may be a knowledge point, including the text, URL, node ID, image, audio and video, storage address of the source document, etc. of the knowledge point.
[0072] Exemplarily, the task dialogue model may be a large language model, and a general large language model may be trained using sample data of intent recognition.
[0073] For example, continue to refer to Figure 3 , the general large language model is trained to obtain the task dialogue model G, and the second dialogue data Input task dialogue model G, task dialogue model G first analyzes the second dialogue data Perform intent classification and identification to determine the second conversation data Corresponding target question and answer type Then, the task dialogue model G obtains the target question and answer type Corresponding task tree , and then identify the task tree Second conversation data The corresponding task node.
[0074] Exemplarily, the identification of the task dialogue model G can be expressed by formula (2) and formula (3).
[0075] (2)
[0076] (3)
[0077] Among them, the target question answering type , is the task tree corresponding to the target question and answer type, is the second dialogue data, G is the task dialogue model, and res is the second dialogue data The corresponding task node.
[0078] The following describes how to generate a task tree.
[0079] In some embodiments, the server may first obtain multiple knowledge documents uploaded by the user. Secondly, the server may cluster the multiple knowledge documents using a clustering model to determine the clustered question and answer types and the question and answer types corresponding to each knowledge document. Thirdly, the server may use a structured processing model to perform structured processing on the data in each knowledge document to obtain the tree structure data of each knowledge document. Finally, the server may merge the tree structure data of each knowledge document according to the question and answer type corresponding to each knowledge document to generate a task tree corresponding to each question and answer type.
[0080] Among them, the above-mentioned knowledge documents are documents uploaded by users to the task-based dialogue question-answering system in the server, and the question and answer content of the task-based dialogue question-answering system all comes from a collection of multiple knowledge documents.
[0081] It should be understood that the above clustering model can be a general large language model, and the clustering prompt of the clustering model can be "
Clustering Task Prompt
[0082] It should be understood that the above-mentioned structured processing model can also be a general large language model, and the structured processing prompt of the structured processing model can be "Refer to the example, organize the input document into a tree structure, and output the tree in the format of a dictionary. You must abide by the following guidelines:\n- The key value of the dictionary can only be a dictionary or a string, and lists are prohibited.\n- The key value is a string, and the key value must be the original text in the input document.\n- The outermost layer of the dictionary can only have one key-value pair, and the business involved in the document is extracted from the document title as the outermost key.\n<Example 1>\n......\n<Example 2>\n......\n<Start processing user input>\nInput:".
[0083] In some embodiments, after the clustering of question and answer types and the structuring of knowledge documents are completed, the tree structure data of knowledge documents of the same question and answer type may be merged to generate a task tree corresponding to each question and answer type.
[0084] In this application, a task-based dialogue question-answering system based on large language models such as clustering models and structured processing models can automatically generate a task tree based on knowledge documents uploaded by users, which significantly improves efficiency compared to the traditional method of manually building a task tree.
[0085] S204: Determine response data for the task-based dialogue question and answer according to the task node corresponding to the second dialogue data.
[0086] In this step, when the server's second dialogue data is at a task node in the task tree, the response data of the task-based dialogue question and answer can be determined according to the task node corresponding to the second dialogue data.
[0087] The above-mentioned task nodes may include reply nodes, clarification nodes, and follow-up question nodes, etc. For different task nodes, different methods may be used to determine the reply data of the task-based dialogue question and answer.
[0088] In some embodiments, if the task node is a reply node, the reply data of the first conversation data is obtained from the data of the reply node.
[0089] In other embodiments, if the task node is not a reply node, clarification data or follow-up question data is generated based on the data in the task node and the node branch of the task node to advance the process of the task-based dialogue question and answer to the reply node. Subsequently, the reply data of the first dialogue data is obtained from the data in the reply node.
[0090] The data of the reply node may be a knowledge point, including the text, URL, node ID, picture, audio and video, storage address of the source document, etc. of the knowledge point.
[0091] In this application, the task dialogue model is used to automatically query the corresponding task nodes, and automatically generate clarification words, follow-up words, and reply words, eliminating the step of manually configuring the task tree node words and improving efficiency. At the same time, the task process is gradually advanced according to the task tree, and it is explainable and has a high accuracy rate.
[0092] The task-based dialogue question-answering method provided in the embodiment of the present application first receives the first dialogue data input by the user in the task-based dialogue question-answering. If the first dialogue data is non-first-round dialogue data in a multi-round dialogue, the query rewriting model is used to rewrite the first dialogue data into semantically complete second dialogue data. Subsequently, the second dialogue data is input into the task dialogue model, and the task node of the second dialogue data output by the task dialogue model in the task tree is obtained. The task dialogue model is used to identify the target question-answering type corresponding to the second dialogue data, and identify the task node corresponding to the second dialogue data in the task tree corresponding to the target question-answering type. Finally, the reply data of the task-based dialogue question-answering is determined according to the task node corresponding to the second dialogue data. Since the dialogue data input by the user is rewritten into semantically complete dialogue data through the query rewriting model, the question-answering type corresponding to the dialogue data is identified by relying on the semantic understanding ability of the task dialogue model, and the corresponding task node is queried in the task tree corresponding to the question-answering type, so that the dialogue data input by the user can be understood even if it is a non-standard question, thereby improving the accuracy of the task-based dialogue question-answering.
[0093] The following describes how to generate a task tree corresponding to each question and answer type. Figure 4 A flowchart of another task-based dialogue question-answering method provided in an embodiment of the present application is shown in FIG. Figure 4 As shown, the task-based dialogue question answering method includes S301-S308:
[0094] S301. Acquire multiple knowledge documents uploaded by a user.
[0095] S302: Cluster multiple knowledge documents using a clustering model to determine the clustered question and answer types and the question and answer types corresponding to each knowledge document.
[0096] S303: Use the structured processing model to perform structured processing on the data in each knowledge document to obtain tree structure data of each knowledge document.
[0097] S304: According to the question and answer type corresponding to each knowledge document, the tree structure data of each knowledge document is merged to generate a task tree corresponding to each question and answer type.
[0098] S305: Receive first dialogue data input by the user in the task-based dialogue question and answer.
[0099] S306: If the first dialogue data is not the first-round dialogue data in the multi-round dialogue, use the query rewriting model to rewrite the first dialogue data into semantically complete second dialogue data.
[0100] S307, input the second dialogue data into the task dialogue model, and obtain the task node of the second dialogue data output by the task dialogue model in the task tree; the task dialogue model is used to identify the target question and answer type corresponding to the second dialogue data, and identify the task node corresponding to the second dialogue data in the task tree corresponding to the target question and answer type.
[0101] S308: Determine response data for the task-based dialogue question and answer according to the task node corresponding to the second dialogue data.
[0102] The task-based dialogue question-answering method provided in the embodiment of the present application first receives the first dialogue data input by the user in the task-based dialogue question-answering. If the first dialogue data is non-first-round dialogue data in a multi-round dialogue, the query rewriting model is used to rewrite the first dialogue data into semantically complete second dialogue data. Subsequently, the second dialogue data is input into the task dialogue model, and the task node of the second dialogue data output by the task dialogue model in the task tree is obtained. The task dialogue model is used to identify the target question-answering type corresponding to the second dialogue data, and identify the task node corresponding to the second dialogue data in the task tree corresponding to the target question-answering type. Finally, the reply data of the task-based dialogue question-answering is determined according to the task node corresponding to the second dialogue data. Since the dialogue data input by the user is rewritten into semantically complete dialogue data through the query rewriting model, the question-answering type corresponding to the dialogue data is identified by relying on the semantic understanding ability of the task dialogue model, and the corresponding task node is queried in the task tree corresponding to the question-answering type, so that the dialogue data input by the user can be understood even if it is a non-standard question, thereby improving the accuracy of the task-based dialogue question-answering.
[0103] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0104] Based on the same inventive concept, the embodiment of the present application also provides a task-based dialogue question-answering device for implementing the task-based dialogue question-answering method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations of one or more task-based dialogue question-answering device embodiments provided below can refer to the limitations of the task-based dialogue question-answering method above, and will not be repeated here.
[0105] In an exemplary embodiment, Figure 5 As shown, a task-based dialogue question-answering device 400 is provided, comprising: a receiving module 401, a rewriting module 402, a recognition module 403 and a reply module 404, wherein:
[0106] The receiving module 401 is used to receive first dialogue data input by a user in a task-based dialogue question and answer session.
[0107] The rewriting module 402 is configured to use a query rewriting model to rewrite the first dialogue data into semantically complete second dialogue data if the first dialogue data is non-first-round dialogue data in a multi-round dialogue.
[0108] The identification module 403 is used to input the second dialogue data into the task dialogue model and obtain the task node of the second dialogue data output by the task dialogue model in the task tree; the task dialogue model is used to identify the target question and answer type corresponding to the second dialogue data, and identify the task node corresponding to the second dialogue data in the task tree corresponding to the target question and answer type.
[0109] The reply module 404 is used to determine the reply data of the task-based dialogue question and answer according to the task node of the second dialogue data.
[0110] In one embodiment, the query rewriting model is used to rewrite first dialogue data into second dialogue data based on historical dialogue data in multiple rounds of dialogue.
[0111] In one embodiment, the task nodes include reply nodes, clarification nodes and follow-up nodes.
[0112] In one embodiment, the reply module 404 is further configured to obtain reply data of the first conversation data from data of the reply node if the task node is a reply node.
[0113] In one embodiment, the reply module 404 is also used to generate clarification data or follow-up data based on the data in the task node and the node branch of the task node if the task node is not a reply node, so as to advance the process of task-based dialogue question and answer to the reply node; and obtain reply data of the first dialogue data from the data of the reply node.
[0114] In one embodiment, the task-based dialogue question-answering device further includes:
[0115] A generation module is used to obtain multiple knowledge documents uploaded by users; cluster multiple knowledge documents using a clustering model to determine the clustered question and answer types and the question and answer types corresponding to each knowledge document; use a structured processing model to structure the data in each knowledge document to obtain tree structure data for each knowledge document; merge the tree structure data of each knowledge document according to the question and answer type corresponding to each knowledge document to generate a task tree corresponding to each question and answer type.
[0116] Each module in the task-based dialogue question-answering device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each module.
[0117] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 6 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a task-based dialogue question-answering method is implemented.
[0118] Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0119] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the above-mentioned task-based dialogue question-answering method when executing the computer program.
[0120] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the above-mentioned task-based dialogue question-answering method is implemented.
[0121] In one embodiment, a computer program product is provided, including a computer program, which implements the above-mentioned task-based dialogue question-answering method when executed by a processor.
[0122] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0123] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0124] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0125] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A task-based dialogue question-answering method, characterized in that: The method comprises: Receiving first dialogue data input by a user in a task-based dialogue question and answer; If the first dialogue data is non-first-round dialogue data in a multi-round dialogue, rewriting the first dialogue data into semantically complete second dialogue data using a query rewriting model; The second dialogue data is input into a task dialogue model, and a task node of the second dialogue data output by the task dialogue model in a task tree is obtained; the task dialogue model is used to identify a target question and answer type corresponding to the second dialogue data, and identify a task node corresponding to the second dialogue data in the task tree corresponding to the target question and answer type; Determine the response data of the task-based dialogue question and answer according to the task node corresponding to the second dialogue data.
2. The method according to claim 1, characterized in that The query rewriting model is used to rewrite the first dialogue data into the second dialogue data according to the historical dialogue data in the multiple rounds of dialogue.
3. The method according to claim 1, characterized in that The task nodes include reply nodes, clarification nodes and questioning nodes.
4. The method according to claim 3, characterized in that The determining the response data of the task-based dialogue question and answer according to the task node of the second dialogue data includes: If the task node is a reply node, the reply data of the first dialogue data is obtained from the data of the reply node.
5. The method according to claim 3, characterized in that: The step of determining the reply data of the task-based dialogue question and answer according to the task node of the second dialogue data further includes: If the task node is not a reply node, clarification data or follow-up data is generated based on the data in the task node and the node branch of the task node to advance the process of task-based dialogue question and answer to the reply node; and reply data of the first dialogue data is obtained from the data of the reply node.
6. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: Get multiple knowledge documents uploaded by users; Clustering the plurality of knowledge documents using a clustering model, and determining the clustered question and answer types and the question and answer type corresponding to each knowledge document; Use the structured processing model to perform structured processing on the data in each knowledge document to obtain the tree structure data of each knowledge document; According to the question and answer type corresponding to each knowledge document, the tree structure data of each knowledge document is merged to generate a task tree corresponding to each question and answer type.
7. A task-based dialogue question-answering device, characterized in that: The device comprises: A receiving module, configured to receive first dialogue data input by a user in a task-based dialogue question and answer; a rewriting module, configured to rewrite the first dialogue data into semantically complete second dialogue data using a query rewriting model if the first dialogue data is non-first-round dialogue data in a multi-round dialogue; an identification module, configured to input the second dialogue data into a task dialogue model, and obtain a task node of the second dialogue data output by the task dialogue model in a task tree; the task dialogue model is configured to identify a target question and answer type corresponding to the second dialogue data, and identify a task node corresponding to the second dialogue data in the task tree corresponding to the target question and answer type; A reply module is used to determine reply data of the task-based dialogue question and answer according to the task node of the second dialogue data.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.