Task-type dialogue response method and apparatus
By introducing a large language model for dialogue state and large language model for dialogue strategy in traditional dialogue systems, the problem of poor dialogue ability in dialogue systems is solved, the generalization ability and output accuracy are improved, and the user experience is improved.
Patent Information
- Application Number
- PCT/CN2024/119119
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-11-22
- Filing Date
- 2024-09-14
- Publication Date
- 2025-05-30
AI Technical Summary
The existing dialogue systems have poor capabilities when handling multi-round task-based conversations, poor user experience, and the hallucination problems of large language models lead to low accuracy of output results.
In traditional dialogue systems, a large language model for dialogue state and a large language model for dialogue strategy are introduced. Through these models, basic dialogue information is analyzed, dialogue strategy is loaded and analyzed, the target dialogue generation strategy is generated, and the policy is executed through the engineering dialogue generation module, and the request response information is output.
It improves the generalization ability of the dialogue system in multiple rounds of task-based dialogue, improves the accuracy of output results, and improves the user experience.
Smart Images

Figure CN2024119119_30052025_PF_FP_ABST
Abstract
Description
Task-based dialogue response method and device
[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on November 22, 2023, with application number 2023115692146 and application name “Task-based Dialogue Response Method and Device”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the technical field of dialogue systems, and more specifically, to a task-based dialogue response method and device. Background Art
[0003] In the field of dialogue systems, task-based dialogue is a common type of conversation in scenarios such as intelligent customer service and intelligent assistants. Task-based dialogues typically involve multiple rounds of dialogue and have specific business rules. Therefore, conversation analysis and processing require consideration of the user's conversation context. This makes it a relatively complex type of dialogue and also a relatively poor user experience in conversational robot applications. Traditional dialogue systems often fail to address issues such as generalization, inheritance, and coreference resolution in multi-round dialogues.
[0004] Large language models currently demonstrate powerful capabilities in open-domain conversations, including content generation, semantic and contextual understanding, and summarization. Consequently, they are expected to be used to handle task-based conversations. However, existing conversation processing solutions underutilize the capabilities of large language models, resulting in insufficient overall fluency. Furthermore, the large language models themselves suffer from hallucinations, resulting in inaccurate output that fails to meet user needs.
[0005] To address the above-mentioned problems, no effective solutions have been proposed so far.
[0006] Summary of the Invention
[0007] The embodiments of the present application provide a task-based dialogue response method and device to at least solve the technical problems in the related art that the dialogue system has poor ability to handle multi-round task-based dialogues and poor user experience.
[0008] According to one aspect of an embodiment of the present application, a task-based dialogue response method is provided, comprising: obtaining basic dialogue information of a task-based dialogue, wherein the basic dialogue information includes at least: intent information of a current turn request and historical dialogue information; analyzing the basic dialogue information using a dialogue state large language model to obtain a target dialogue strategy request based on a domain-specific language; loading a target dialogue strategy example corresponding to the target dialogue strategy request using a dialogue strategy loader; analyzing the target dialogue strategy example using the dialogue strategy large language model to obtain a target dialogue generation strategy; executing the target dialogue generation strategy using an engineered dialogue generation module to obtain request response information, and outputting the request response information.
[0009] In some embodiments, obtaining basic dialogue information of a task-based dialogue includes: using an intent recognition module to perform intent recognition on a current round request of the task-based dialogue to obtain intent information, wherein the intent information includes: intent keywords and slots; obtaining historical dialogue information before the current round request in the task-based dialogue; obtaining user information and dialogue scene information corresponding to the task-based dialogue; and using the intent information, historical dialogue information, user information, and dialogue scene information together as basic dialogue information.
[0010] In some embodiments, basic dialogue information is analyzed using a large dialogue state language model to obtain a target dialogue strategy request based on a specific domain language, including: using a prompt word constructor to generate a first prompt word corresponding to the basic dialogue information, wherein the prompt word constructor manages prompt word templates corresponding to multiple dialogue stages; and using the large dialogue state language model to analyze the first prompt word to obtain at least one target dialogue strategy request based on the specific domain language.
[0011] In some embodiments, using a dialogue strategy loader to load a target dialogue strategy example corresponding to a target dialogue strategy request includes: using the dialogue strategy loader to parse a target domain corresponding to the target dialogue strategy request, and loading the target dialogue strategy example corresponding to the target dialogue strategy request from a dialogue strategy database of the target domain, wherein the dialogue strategy database stores a mapping relationship between multiple dialogue strategy requests and dialogue strategy examples in the target domain.
[0012] In some embodiments, a target dialogue strategy example is analyzed using a dialogue strategy large language model to obtain a target dialogue generation strategy, including: using a prompt word constructor to convert the target dialogue strategy example in the form of a flowchart into a second prompt word in the form of a natural language, and inputting the second prompt word into the dialogue strategy large language model in a small sample manner; and using the dialogue strategy large language model to analyze the second prompt word to obtain the target dialogue generation strategy.
[0013] In some embodiments, an engineered dialogue generation module is used to execute a target dialogue generation strategy to obtain request response information, including: using the engineered dialogue generation module to call a target interface associated with the target dialogue generation strategy to execute the target dialogue generation strategy, obtaining interface response data returned by the target interface, and generating request response information based on the interface response data.
[0014] In some embodiments, before outputting the request response information, the request response information is quality checked and security checked according to preset standards; when both the quality check and the security check are passed, the request response information is output; when either the quality check or the security check fails, the request response information is regenerated.
[0015] According to another aspect of an embodiment of the present application, a task-based dialogue response device is also provided, including: an acquisition module for acquiring basic dialogue information of a task-based dialogue, wherein the basic dialogue information includes at least: intent information of a current turn request and historical dialogue information; a first analysis module for analyzing the basic dialogue information using a dialogue state large language model to obtain a target dialogue strategy request based on a specific domain language; a loading module for loading a target dialogue strategy example corresponding to the target dialogue strategy request using a dialogue strategy loader; a second analysis module for analyzing the target dialogue strategy example using a dialogue strategy large language model to obtain a target dialogue generation strategy; and a response module for executing the target dialogue generation strategy using an engineered dialogue generation module to obtain request response information and output the request response information.
[0016] According to another aspect of an embodiment of the present application, a non-volatile storage medium is further provided, which includes a stored computer program, wherein the device where the non-volatile storage medium is located executes the above-mentioned task-based dialogue response method by running the computer program.
[0017] According to another aspect of an embodiment of the present application, an electronic device is provided, which includes: a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to execute the above-mentioned task-based dialogue response method through the computer program.
[0018] In an embodiment of the present application, basic dialogue information for a task-based dialogue is first obtained, which includes at least the intent information of the current turn request and historical dialogue information. The basic dialogue information is then analyzed using a large dialogue state language model to obtain a target dialogue strategy request based on a specific domain language. A dialogue strategy loader is then used to load a target dialogue strategy example corresponding to the target dialogue strategy request. The target dialogue strategy example is then analyzed using the large dialogue strategy language model to obtain a target dialogue generation strategy. Finally, an engineered dialogue generation module is used to execute the target dialogue generation strategy, obtain request response information, and output the request response information. By introducing a large dialogue state language model and a large dialogue strategy language model into a traditional dialogue system, and leveraging the understanding capabilities of the large language model combined with the business issues inherent in task-based dialogue, the dialogue state can be accurately judged and a dialogue generation strategy can be generated, thereby improving overall generalization capabilities. This solution also addresses the problem of hallucinations caused by relying on the large language model in traditional systems to control the large language model during the result generation phase, thereby improving the accuracy of the output results. This solution effectively addresses the technical issues in the related art where dialogue systems have a poor ability to handle multi-turn task-based dialogues and experience a poor user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0020] FIG1 is a schematic structural diagram of a computer terminal according to an embodiment of the present application;
[0021] FIG2 is a flowchart of a task-based dialogue response method according to an embodiment of the present application;
[0022] FIG3 is a schematic diagram of a sample dialogue strategy for a call charge inquiry scenario according to an embodiment of the present application;
[0023] FIG4 is a schematic diagram of task-based dialogue analysis and response according to an embodiment of the present application;
[0024] FIG5 is a schematic diagram of the structure of a task-based dialogue response device according to an embodiment of the present application. DETAILED DESCRIPTION
[0025] In order to enable those skilled in the art to better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of this application.
[0026] It should be noted that the terms "first", "second", etc. in the specification, claims, and drawings of the present application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product, or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products, or devices.
[0027] In order to better understand the embodiments of the present application, some nouns or terms that appear in the description of the embodiments of the present application are first translated and explained as follows:
[0028] Large Language Model (LLM): A deep learning model trained using large amounts of text data. It is used to generate natural language text or understand the meaning of language text and can handle a variety of natural language tasks such as text classification, question answering, and conversation.
[0029] Dialogue State Tracking (DST): Tracks the conversation state between the user and the system in a dialogue system, and determines the user's intentions and needs in the current round of dialogue based on the conversation context.
[0030] Dialogue Policy (DP): A strategy developed and implemented in a dialogue system to guide the system on how to conduct effective dialogue communication and interaction with users.
[0031] Natural Language Generation (NLG): used to convert unstructured data into natural language text.
[0032] Domain Specific Language (DSL): A language designed to meet the needs of a specific domain, which can help more accurately describe, express, and operate related concepts and tasks in that domain.
[0033] Example 1
[0034] In order to solve the technical problems in the related art that the dialogue system has poor ability to handle multi-round task-based dialogues and poor user experience, the embodiments of the present application improve the traditional dialogue system by introducing a large language model of dialogue state and a large language model of dialogue strategy into the traditional dialogue system, and utilizing the understanding ability of the large language model itself combined with the business problems of the task-based dialogue itself to accurately judge the dialogue state and provide a dialogue generation strategy, thereby improving the overall generalization ability. In the result generation stage, the hallucination problem of relying on the traditional system to control the large language model can be solved, and the accuracy of the output results can be improved.
[0035] In some embodiments, a task-based dialogue response method is provided. It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0036] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal, or a similar computing device. Figure 1 shows a hardware block diagram of a computer terminal (or mobile device) for implementing the task-based dialogue response method. As shown in Figure 1 , the computer terminal 10 (or mobile device 10) may include one or more processors 102 (illustrated as 102a, 102b, ..., 102n) (the processor 102 may include, but is not limited to, a microprocessor (MCU) or a programmable logic device (FPGA) processing device), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of a BUS bus), a network interface, a power supply, and / or a camera. Those skilled in the art will understand that the structure shown in Figure 1 is merely illustrative and does not limit the structure of the electronic device described above. For example, the computer terminal 10 may include more or fewer components than shown in Figure 1 , or have a configuration different from that shown in Figure 1 .
[0037] It should be noted that the one or more processors 102 and / or other data processing circuits described above may generally be referred to herein as "data processing circuitry". The data processing circuitry may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuitry may be a single independent processing module, or may be incorporated in whole or in part into any of the other components of the computer terminal 10 (or mobile device). As described in the embodiments of the present application, the data processing circuitry serves as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).
[0038] Memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the task-based dialogue response method in the embodiments of the present application. Processor 102 executes the software programs and modules stored in memory 104 to perform various functional applications and data processing, thereby implementing the aforementioned application vulnerability detection method. Memory 104 can include high-speed random access memory (RAM) and non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, memory 104 may further include memory remotely located from processor 102, which can be connected to computer terminal 10 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0039] The transmission device 106 is configured to receive or transmit data via a network. A specific example of the aforementioned network may include a wireless network provided by the communications provider of the computer terminal 10. In one embodiment, the transmission device 106 includes a network interface controller (NIC), which can be connected to other network devices via a base station to enable communication with the Internet. In another embodiment, the transmission device 106 may be a radio frequency (RF) module, which is configured to communicate with the Internet wirelessly.
[0040] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 10 (or mobile device).
[0041] In the above operating environment, an embodiment of the present application provides a task-based dialogue response method, as shown in FIG2 , which includes the following steps:
[0042] Step S202: Obtain basic dialogue information of the task-based dialogue, wherein the basic dialogue information includes at least: the intent information of the current round request and historical dialogue information;
[0043] Step S204: Analyze the basic dialogue information using the dialogue state large language model to obtain a target dialogue strategy request based on the domain-specific language;
[0044] Step S206: Using a dialogue strategy loader, load a target dialogue strategy example corresponding to the target dialogue strategy request;
[0045] Step S208: Analyze the target dialogue strategy examples using the dialogue strategy large language model to obtain the target dialogue generation strategy;
[0046] Step S210: Utilize the engineered dialogue generation module to execute the target dialogue generation strategy, obtain request response information, and output the request response information.
[0047] The following describes the various steps of the task-based dialogue response method in conjunction with a specific implementation process.
[0048] As an optional implementation method, when obtaining the basic dialogue information of the task-based dialogue, the intention recognition module in the traditional dialogue system can be used to first identify the intent of the current round request of the task-based dialogue to obtain the intent information, which includes: intent keywords and slots; then obtain the historical dialogue information before the current round request in the task-based dialogue; at the same time, the user information and dialogue scene information corresponding to the task-based dialogue can also be obtained, such as the user portrait stored on the operator side, the device information of the terminal currently used by the user, the current location information, etc.; the obtained intent information, historical dialogue information, user information and dialogue scene information are collectively used as basic dialogue information and input into the dialogue state large language model for analysis.
[0049] To enhance the analysis effectiveness of the large dialog state language model, some embodiments of the present application also introduce a prompt builder. This builder manages prompt templates corresponding to various dialog stages and provides the ability to generate personalized prompts. After acquiring basic dialog information, the prompt builder can be used to generate a first prompt corresponding to the basic dialog information. The large dialog state language model is then used to analyze the first prompt, determine the target domain of the dialog, and obtain at least one target dialog strategy request based on the domain-specific language.
[0050] Afterwards, the dialogue strategy loader can be used to parse the target domain corresponding to the target dialogue strategy request, and load the target dialogue strategy example corresponding to the target dialogue strategy request from the dialogue strategy database of the target domain. The dialogue strategy database stores the mapping relationship between multiple dialogue strategy requests and dialogue strategy examples in the target domain. Figure 3 shows a dialogue strategy example for a call charge query scenario.
[0051] As shown in Figure 3, dialogue policy examples are typically stored in the form of flowcharts. Directly analyzing them using a large dialogue policy language model often yields poor results. To improve the large dialogue policy language model's ability to understand configuration-based policies, a prompt word constructor can be used to convert the target dialogue policy examples in flowchart form into a second prompt word in natural language. This second prompt word is then fed into the large dialogue policy language model as a small sample. The large dialogue policy language model then analyzes the second prompt word to generate the target dialogue policy. It should be noted that the target dialogue policy here is similar to the action generated by a traditional dialogue system. It is a system-defined return structure that requires further processing and cannot directly respond to the user.
[0052] In some embodiments, an engineered dialogue generation module in a traditional dialogue system can be used to execute a target dialogue generation strategy to obtain request response information. In some embodiments, the engineered dialogue generation module can be used to call a target interface associated with the target dialogue generation strategy to execute the target dialogue generation strategy, obtain interface response data returned by the target interface, and generate request response information based on the interface response data.
[0053] In some embodiments, leveraging the reasoning and contextual understanding capabilities of a large language model, when working with multiple domain tasks, it is possible to effectively integrate slots and achieve domain intent transition and integration, alleviating the current issues of relatively rigid rules and unsmooth conversations during the dialogue state tracking and dialogue policy generation stages. Furthermore, by using the dialogue state large language model and the dialogue policy large language model to break down the dialogue problem, the large language models at both stages can be fine-tuned, further improving their effectiveness.
[0054] As an optional implementation, taking into account the common hallucination problem of large language models, before outputting the request response information, the request response information can also be quality-checked and security-checked according to preset standards; the request response information will only be output when both the quality check and the security check are passed; when either the quality check or the security check fails, the request response information needs to be regenerated through the above processing process.
[0055] FIG4 is a schematic diagram of an optional task-based dialogue analysis and response according to an embodiment of the present application. The task-based dialogue processing process is exemplified below with reference to FIG4 .
[0056] S1, obtain basic conversation information as follows:
[0057] Historical conversation information: user: I want to recharge my phone package; bot: What is the mobile phone number you want to recharge?
[0058] Historical conversation status: Check package (type: call charges).
[0059] Current round request: The number is 138xxxx. Please also help me check if there are any activities.
[0060] Intent information: Query activities (mobile phone number: 138xxxx).
[0061] User information: device (IPhone), level (10).
[0062] S2: Generate the first prompt word corresponding to the basic dialogue information using the prompt word constructor as follows:
[0063] Check the package (type: phone bill, name: xx, mobile number: xx, user level: xxx).
[0064] Buy a mobile phone (type: xx).
[0065] S3: Analyze the first prompt word using the large dialogue state language model to obtain two dialogue strategy requests based on the specific domain language as follows:
[0066] Dialogue strategy request 1: Check the package (package type: phone bill, mobile phone number: 138xxxx).
[0067] Dialogue strategy request 2: Check activities (mobile phone number: 138xxx).
[0068] S4: Use the dialogue strategy loader to load two dialogue strategy samples corresponding to the two dialogue strategy requests.
[0069] Dialogue strategy example 1: Check package: key information (type, mobile phone number, payment method). If any type is missing, ask for the corresponding key information.
[0070] Dialogue Strategy Example 2: To query the latest events of the day, you can use the user's existing information as keywords for the query.
[0071] S5, using the prompt word constructor to convert the two dialogue strategy examples into corresponding second prompt words;
[0072] S6: Use the dialogue strategy large language model to analyze the second prompt word and obtain the following dialogue generation strategy:
[0073] Mix(Package(Request=Payment Method), Activity(Date=Latest, Phone Number=138xxxxx, Keyword=Call Charges).
[0074] S7, using the engineered dialogue generation module in the traditional dialogue system to call the relevant interface to execute the dialogue generation strategy, specifically: call the relevant interface to query the supported payment methods such as Alipay and WeChat; call the relevant interface to query the current user's supported phone package activities; then assemble the interface response data to generate request response information.
[0075] S8, perform quality inspection on the request response information and determine whether the quality inspection passes. If it passes, execute step S9; if it fails, return to step S2.
[0076] S9: Output the request response information to the user.
[0077] In an embodiment of the present application, basic dialogue information for a task-based dialogue is first obtained, which includes at least the intent information of the current turn request and historical dialogue information. The basic dialogue information is then analyzed using a large dialogue state language model to obtain a target dialogue strategy request based on a specific domain language. A dialogue strategy loader is then used to load a target dialogue strategy example corresponding to the target dialogue strategy request. The target dialogue strategy example is then analyzed using the large dialogue strategy language model to obtain a target dialogue generation strategy. Finally, an engineered dialogue generation module is used to execute the target dialogue generation strategy, obtain request response information, and output the request response information. By introducing a large dialogue state language model and a large dialogue strategy language model into a traditional dialogue system, and leveraging the understanding capabilities of the large language model combined with the business issues inherent in task-based dialogue, the dialogue state can be accurately judged and a dialogue generation strategy can be generated, thereby improving overall generalization capabilities. This solution also addresses the problem of hallucinations caused by relying on the large language model in traditional systems to control the large language model during the result generation phase, thereby improving the accuracy of the output results. This solution effectively addresses the technical issues in the related art where dialogue systems have a poor ability to handle multi-turn task-based dialogues and experience a poor user experience.
[0078] Example 2
[0079] According to an embodiment of the present application, a task-based dialogue response device for implementing the task-based dialogue response method in Example 1 is also provided. As shown in FIG5 , the task-based dialogue response device includes at least: an acquisition module 51, a first analysis module 52, a loading module 53, a second analysis module 54, and a response module 55, wherein:
[0080] The acquisition module 51 is used to obtain basic dialogue information of the task-based dialogue, wherein the basic dialogue information at least includes: the intention information of the current round request and the historical dialogue information;
[0081] The first analysis module 52 is used to analyze the basic dialogue information using the dialogue state large language model to obtain a target dialogue strategy request based on the specific domain language;
[0082] The loading module 53 is used to load the target dialogue strategy sample corresponding to the target dialogue strategy request using the dialogue strategy loader;
[0083] The second analysis module 54 is used to analyze the target dialogue strategy examples using the dialogue strategy large language model to obtain the target dialogue generation strategy;
[0084] The response module 55 is used to use the engineered dialogue generation module to execute the target dialogue generation strategy, obtain request response information, and output the request response information.
[0085] As an optional implementation method, when acquiring the basic dialogue information of the task-based dialogue, the acquisition module can first use the intention recognition module in the traditional dialogue system to perform intent recognition on the current round request of the task-based dialogue to obtain intent information, which includes: intent keywords and slots; then obtain the historical dialogue information before the current round request in the task-based dialogue; at the same time, it can also obtain user information and dialogue scene information corresponding to the task-based dialogue, such as user portraits stored on the operator side, device information of the user's current terminal, current location information, etc.; the acquired intent information, historical dialogue information, user information and dialogue scene information are collectively used as basic dialogue information and input into the dialogue state large language model for analysis.
[0086] To enhance the analysis effectiveness of the large dialog state language model, some embodiments of the present application also introduce a prompt builder. This builder manages prompt templates corresponding to various dialog stages and provides the ability to generate personalized prompts. After the acquisition module acquires basic dialog information, the first analysis module uses the prompt builder to generate a first prompt corresponding to the basic dialog information. The large dialog state language model then analyzes the first prompt to determine the target domain of the dialog and obtain at least one target dialog strategy request based on the domain-specific language.
[0087] Afterwards, the loading module can use the dialogue strategy loader to parse the target domain corresponding to the target dialogue strategy request, and load the target dialogue strategy example corresponding to the target dialogue strategy request from the dialogue strategy database of the target domain, where the dialogue strategy database stores the mapping relationship between multiple dialogue strategy requests and dialogue strategy examples in the target domain.
[0088] Because dialogue policy examples are typically stored in the form of flowcharts, directly analyzing them using a large dialogue policy language model often yields poor results. To improve the large dialogue policy language model's ability to understand configuration-based policies, the second analysis module can first use a prompt word constructor to convert the target dialogue policy examples in flowchart form into second prompt words in natural language. This second prompt word is then fed into the large dialogue policy language model as a small sample. The large dialogue policy language model then analyzes the second prompt words to generate the target dialogue policy. It should be noted that the target dialogue policy here, similar to the actions generated by traditional dialogue systems, is a system-defined return structure that requires further processing and cannot directly respond to the user.
[0089] In some embodiments, the response module can utilize an engineered dialogue generation module in a traditional dialogue system to execute a target dialogue generation strategy and obtain request response information. In some embodiments, the engineered dialogue generation module can be utilized to call a target interface associated with the target dialogue generation strategy to execute the target dialogue generation strategy, obtain interface response data returned by the target interface, and generate request response information based on the interface response data.
[0090] In some embodiments, leveraging the reasoning and contextual understanding capabilities of a large language model, when working with multiple domain tasks, it is possible to effectively integrate slots and achieve domain intent transition and integration, alleviating the current issues of relatively rigid rules and unsmooth conversations during the dialogue state tracking and dialogue policy generation stages. Furthermore, by using the dialogue state large language model and the dialogue policy large language model to break down the dialogue problem, the large language models at both stages can be fine-tuned, further improving their effectiveness.
[0091] Considering the hallucination problem commonly encountered in large language models, the task-based dialogue response device in the embodiments of the present application also includes a quality control module. Before outputting the request response information, the quality control module can also perform quality and security checks on the request response information according to preset standards. The request response information is only output if both the quality and security checks pass. If either the quality or security checks fail, other modules are called to reanalyze and generate the request response information.
[0092] It should be noted that the modules in the task-based dialogue response device in the embodiment of the present application correspond one-to-one to the implementation steps of the task-based dialogue response method in Example 1. Since a detailed description has been given in Example 1, some details not reflected in this embodiment can be referred to Example 1 and will not be repeated here.
[0093] Example 3
[0094] According to an embodiment of the present application, a non-volatile storage medium is also provided, which includes a stored computer program, wherein the device where the non-volatile storage medium is located executes the task-based dialogue response method in Example 1 by running the computer program.
[0095] In some embodiments, the device where the non-volatile storage medium is located implements the following steps by running the computer program: obtaining basic dialogue information of the task-based dialogue, wherein the basic dialogue information includes at least: intent information of the current round request and historical dialogue information; using the dialogue state large language model to analyze the basic dialogue information to obtain a target dialogue strategy request based on a specific domain language; using a dialogue strategy loader to load a target dialogue strategy example corresponding to the target dialogue strategy request; using the dialogue strategy large language model to analyze the target dialogue strategy example to obtain a target dialogue generation strategy; using an engineered dialogue generation module to execute the target dialogue generation strategy to obtain request response information, and output the request response information.
[0096] According to an embodiment of the present application, a processor is further provided, which is used to run a computer program, wherein the computer program executes the task-based dialogue response method in Example 1 when running.
[0097] In some embodiments, the computer program executes the following steps when it is running: obtaining basic dialogue information of a task-based dialogue, wherein the basic dialogue information includes at least: intent information of a current turn request and historical dialogue information; analyzing the basic dialogue information using a dialogue state large language model to obtain a target dialogue strategy request based on a domain-specific language; loading a target dialogue strategy example corresponding to the target dialogue strategy request using a dialogue strategy loader; analyzing the target dialogue strategy example using a dialogue strategy large language model to obtain a target dialogue generation strategy; executing the target dialogue generation strategy using an engineered dialogue generation module to obtain request response information, and outputting the request response information.
[0098] According to an embodiment of the present application, an electronic device is also provided, which includes: a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to execute the task-based dialogue response method in Example 1 through the computer program.
[0099] In some embodiments, the processor is configured to implement the following steps through a computer program: obtaining basic dialogue information of a task-based dialogue, wherein the basic dialogue information includes at least: intent information of a current turn request and historical dialogue information; analyzing the basic dialogue information using a dialogue state large language model to obtain a target dialogue strategy request based on a domain-specific language; loading a target dialogue strategy example corresponding to the target dialogue strategy request using a dialogue strategy loader; analyzing the target dialogue strategy example using a dialogue strategy large language model to obtain a target dialogue generation strategy; executing the target dialogue generation strategy using an engineered dialogue generation module to obtain request response information, and outputting the request response information.
[0100] The serial numbers of the above embodiments are for description only and do not represent the advantages or disadvantages of the embodiments.
[0101] In the above embodiments of the present application, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0102] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only exemplary. For example, the division of units can be a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0103] Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple units. Some or all of the units may be selected to achieve the purpose of the present embodiment according to actual needs.
[0104] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0105] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program code.
[0106] The above is only a preferred embodiment of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A task-based dialogue response method, comprising: Obtaining basic dialogue information of the task-based dialogue, wherein the basic dialogue information at least includes: intent information of the current round request and historical dialogue information; Analyzing the basic dialogue information using a dialogue state large language model to obtain a target dialogue strategy request based on a domain-specific language; Using a dialogue strategy loader to load a target dialogue strategy example corresponding to the target dialogue strategy request; Analyzing the target dialogue strategy examples using a dialogue strategy large language model to obtain a target dialogue generation strategy; The target dialogue generation strategy is executed by using an engineered dialogue generation module to obtain request response information, and the request response information is output.
2. The method according to claim 1, wherein: Get the basic dialogue information of the task-based dialogue, including: Using an intention recognition module to perform intention recognition on the current round request of the task-based dialogue to obtain the intention information, wherein the intention information includes: intention keywords and slots; Obtaining the historical dialogue information before the current round request in the task-based dialogue; Obtaining user information and dialogue scenario information corresponding to the task-based dialogue; The intention information, the historical conversation information, the user information and the conversation scene information are collectively used as the basic conversation information.
3. The method according to claim 1, wherein: The basic dialogue information is analyzed using a dialogue state large language model to obtain a target dialogue strategy request based on a specific domain language, including: Generate a first prompt word corresponding to the basic dialogue information by using a prompt word constructor, wherein the prompt word constructor manages prompt word templates corresponding to multiple dialogue stages; The first prompt word is analyzed using the dialog state large language model to obtain at least one of the target dialog strategy requests based on a specific domain language.
4. The method according to claim 1, wherein: Using a dialogue strategy loader to load a target dialogue strategy example corresponding to the target dialogue strategy request includes: The dialog strategy loader is used to parse the target domain corresponding to the target dialog strategy request, and the target dialog strategy example corresponding to the target dialog strategy request is loaded from a dialog strategy database of the target domain, wherein the dialog strategy database stores a mapping relationship between multiple dialog strategy requests and dialog strategy examples of the target domain.
5. The method according to claim 3, wherein: The target dialogue strategy example is analyzed using the dialogue strategy large language model to obtain the target dialogue generation strategy, including: Using the prompt word constructor to convert the target dialogue strategy sample in the form of a flowchart into a second prompt word in the form of a natural language, and inputting the second prompt word into the dialogue strategy large language model in a small sample manner; The second prompt word is analyzed using the dialogue strategy large language model to obtain the target dialogue generation strategy.
6. The method according to claim 1, wherein: The target dialogue generation strategy is executed by using the engineered dialogue generation module to obtain request response information, including: The target interface associated with the target dialogue generation strategy is called by the engineered dialogue generation module to execute the target dialogue generation strategy, interface response data returned by the target interface is obtained, and the request response information is generated according to the interface response data.
7. The method according to claim 1, wherein: The target dialogue generation strategy is executed by using the engineered dialogue generation module to obtain request response information, including: Use the engineered dialogue generation module in the traditional dialogue system to call the relevant interface to query the supported payment methods; Use the engineered dialogue generation module in the traditional dialogue system to call the relevant interface to query the current user's supported call package activities; The payment method and the call fee package activities supported by the current user are assembled as interface response data to generate request response information.
8. The method according to claim 1, further comprising: Before outputting the request response information, Performing quality verification and security verification on the request response information according to preset standards; When both the quality check and the security check are passed, outputting the request response information; When either the quality check or the security check fails, the request response information is regenerated.
9. A task-based dialogue response device, comprising: An acquisition module, used to acquire basic dialogue information of the task-based dialogue, wherein the basic dialogue information at least includes: intention information of the current round request and historical dialogue information; A first analysis module is used to analyze the basic dialogue information using a dialogue state large language model to obtain a target dialogue strategy request based on a specific domain language; A loading module, used for loading a target dialogue strategy example corresponding to the target dialogue strategy request using a dialogue strategy loader; A second analysis module is used to analyze the target dialogue strategy sample using a dialogue strategy large language model to obtain a target dialogue generation strategy; The response module is used to use the engineered dialogue generation module to execute the target dialogue generation strategy, obtain request response information, and output the request response information.
10. A non-volatile storage medium, wherein: The non-volatile storage medium includes a stored computer program, wherein the device where the non-volatile storage medium is located executes the task-based dialogue response method according to any one of claims 1 to 8 by running the computer program.
11. An electronic device, comprising: A memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the task-based dialogue response method according to any one of claims 1 to 8 through the computer program.
Citation Information
Patent Citations
Robot reply method and device in outbound call, electronic equipment and storage medium
CN116805489A
Chained natural language interaction method and system driven by large language model
CN116992006A
Task type dialogue response method and device
CN117609449A
Method and system for generating intent responses through virtual agents
US20230350929A1
Cited By
Information extraction task-oriented cue word design and optimization method and system
CN120671823A
Method and device for identifying risk type of social session
CN120744593A
Code scanning analysis method and system based on large model
CN120893046A
Optimization method and device for multi-mode large model picture recognition cue word
CN121527600A
Data resource generation system, method, computer equipment and storage medium
CN122570510A