Conversation method and device, electronic equipment, storage medium and program product
By combining intention recognition and slot filling large models, and using large language models for dialogue management, the problems of intention recognition, slot filling and reply generation in task-based dialogue systems are solved, and the user experience and system performance are improved.
Patent Information
- Application Number
- CN202410130999.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-30
- Publication Date
- 2024-10-18
AI Technical Summary
Existing task-based dialogue systems have deficiencies in intent recognition accuracy, word slot filling flexibility, dialogue management efficiency, and reply generation diversity, resulting in poor user experience.
Through the combination of the large intention recognition model and the large slot-filling model, the user's intention is identified and the word slots are filled according to the intention, and dialogue reply information is generated. The large language model is used for dialogue management and reply generation, and the dialogue process and reply content are optimized.
It improves the accuracy of intent recognition, the flexibility of word slot filling and the efficiency of dialogue management, generates more diverse and personalized reply information, and improves the user experience.
Smart Images

Figure CN118798351A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of natural language processing, and in particular relates to a dialogue method, device, electronic device, storage medium and program product. Background Art
[0002] A task-based dialogue system is a human-computer interaction system that aims to achieve goal-oriented natural language dialogue. This system can understand and parse the questions or instructions raised by the user and provide corresponding answers or perform corresponding tasks. In related technologies, task-based dialogue systems cannot accurately understand user intentions and thus cannot accurately generate dialogue response information. Summary of the invention
[0003] Embodiments of the present application provide a conversation method, device, electronic device, and storage medium.
[0004] The present application provides a dialogue method, the method comprising:
[0005] Perform intent recognition on user input information to obtain user intent;
[0006] Obtaining the word slot required by the user intention;
[0007] According to the user input information and the user intention, word slots required by the user intention are filled to obtain the word slot filling result;
[0008] When the word slot filling result satisfies a dialogue completion condition, dialogue reply information for the user input information is generated, and the dialogue completion condition indicates a condition under which the dialogue reply information can be generated.
[0009] In some embodiments, after obtaining the user intent, the method further includes: determining interface information, the interface information indicating a target interface that needs to be called according to the user intent; and generating a dialogue reply information for the user input information when the word slot filling result satisfies a dialogue completion condition, including: generating a dialogue reply information for the user input information when the target interface call is successful and the word slot filling result satisfies a dialogue completion condition.
[0010] In an embodiment of the present application, by calling the target interface, the content required to complete the user's intention can be obtained. Therefore, when the target interface is called successfully and the word slot filling result meets the dialogue completion condition, the dialogue reply information for the user input information can be generated more accurately.
[0011] In some embodiments, when the target interface is called successfully and the word slot filling result satisfies the dialogue completion condition, a dialogue reply information is generated for the user input information, including: obtaining the call result of the target interface; and generating a dialogue reply information for the user input information based on the call result of the target interface and the word slot filling result.
[0012] It can be seen that the call result of the target interface can represent the content required to complete the user's intention. Therefore, when the target interface is called successfully and the word slot filling result meets the dialogue completion condition, the dialogue reply information for the user input information can be generated more accurately based on the call result of the target interface.
[0013] In some embodiments, after determining the interface information, the method further includes: when the target interface call fails, generating a dialog reply message for the user input information according to the reason for the failure of the target interface call.
[0014] It can be seen that since the dialogue reply information for the user input information is generated according to the reason for the failure of the target interface call, the dialogue reply information can reflect the reason for the failure of the target interface call, which is conducive to the subsequent processing of the reason for the failure of the target interface call.
[0015] In some embodiments, when the word slot filling result meets the dialogue completion condition, generating dialogue reply information for the user input information includes: when the user intention does not require calling an interface and the word slot filling result meets the dialogue completion condition, generating dialogue reply information for the user input information.
[0016] It can be seen that when the user intention does not require calling the interface, it is possible to directly determine whether the dialogue completion conditions are met based on the word slot filling results. When the word slot filling results meet the dialogue completion conditions, dialogue reply information for the user input information can be directly generated without calling the interface, which is simple and easy to implement.
[0017] In some embodiments, after obtaining the word slot filling result, the method further includes: when the word slot filling result does not meet the dialogue completion condition, generating follow-up question information for the unfilled word slot; obtaining user response information for the follow-up question information, and updating the word slot filling result according to the user response information.
[0018] It can be seen that when the word slot filling result does not meet the dialogue completion condition, the user's reply information can be obtained by generating follow-up information for the unfilled word slot; on the basis of obtaining the user's reply information, by updating the word slot filling result, it is beneficial to make the updated word slot filling result meet the dialogue completion condition, thereby facilitating the generation of dialogue reply information for the user input information.
[0019] In some embodiments, the performing intent recognition on the user input information to obtain the user intent includes: performing intent recognition on the user input information to obtain a class of intent corresponding to the user input information from various predetermined types of intent; and selecting the user intent corresponding to the user input information from the class of intent corresponding to the user input information.
[0020] It can be seen that the embodiment of the present application can first determine a category of intent corresponding to the user input information, and then determine the user intent corresponding to the user input information in the category of intent corresponding to the user input information. In this way, when the total amount of intentions of each category of predetermined intentions is large, accurate identification of user intent categories and user intents can be achieved.
[0021] The embodiment of the present application also provides a conversation device, the device comprising:
[0022] The recognition module is used to recognize the intention of the user input information and obtain the user's intention;
[0023] A processing module, configured to obtain the word slots required by the user intention; and fill the word slots required by the user intention according to the user input information and the user intention to obtain the word slot filling result;
[0024] A generation module is used to generate dialogue reply information for the user input information when the word slot filling result meets the dialogue completion condition, and the dialogue completion condition represents the condition under which the dialogue reply information can be generated.
[0025] An embodiment of the present application also provides an electronic device, comprising a processor and a memory for storing a computer program that can be run on the processor; wherein the processor is used to run the computer program to execute any one of the above-mentioned dialogue methods.
[0026] An embodiment of the present application also provides a computer storage medium on which a computer program is stored. When the computer program is executed by a processor, any one of the above-mentioned dialogue methods is implemented.
[0027] An embodiment of the present application also provides a computer program product, including a computer program, which implements any of the above-mentioned dialogue methods when executed by a processor.
[0028] It can be seen that the embodiment of the present application can obtain the word slot filling result according to the user intention after identifying the user intention, and then, when the word slot filling result meets the dialogue completion condition, it can generate dialogue reply information for the user input information. Therefore, the embodiment of the present application can generate dialogue reply information for the user input information more accurately based on the accurate understanding of the user intention. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 A flowchart of a conversation method according to an embodiment of the present application;
[0030] Figure 2 This is an example diagram for determining user intent in an embodiment of the present application;
[0031] Figure 3 This is an example diagram of asking questions about user intentions in an embodiment of the present application;
[0032] Figure 4 A flowchart of another dialogue method provided in an embodiment of the present application;
[0033] Figure 5 This is an example diagram of generating follow-up questions for word slot filling results in an embodiment of the present application;
[0034] Figure 6 This is an example diagram of generating failure response information when a task fails to execute in an embodiment of the present application;
[0035] Figure 7 A schematic diagram of the structure of a conversation device according to an embodiment of the present application;
[0036] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0037] Task-based dialogue systems have been widely used in many fields. For example, task-based dialogue systems can be applied to intelligent assistants, customer service, smart homes and other fields. At present, the technology of task-based dialogue systems is in a rapid development stage. Research related to task-based dialogue systems mainly focuses on the following areas:
[0038] 1) Natural Language Understanding (NLU). The core of task-based dialogue systems is to understand the semantics of user input. NLU technology understands user needs by identifying user intent and parsing key information and entities. NLU technology uses deep learning and natural language processing technologies, such as recursive neural networks (RNN), convolutional neural networks (CNN), and attention mechanisms to improve the understanding ability of dialogue systems.
[0039] 2) Dialog Management (DM). Dialog management is a key link in task-based dialogue systems and is used to determine how the system responds to user input. DM technology usually uses dialogue state tracking and decision algorithms to manage the dialogue process and generate appropriate responses. Reinforcement learning is a commonly used dialogue management method that optimizes the system's decision-making strategy by interacting with users.
[0040] 3) Natural Language Generation (NLG). Task-based dialogue systems need to be able to generate natural and fluent responses to interact with users. NLG technology is used to convert the system's responses into natural language expressions. Some research focuses on generating diverse and accurate responses, as well as improving the readability and human perception of responses.
[0041] 4) Domain adaptation and personalization. Task-based dialogue systems need to provide accurate answers and support in specific fields. Therefore, domain adaptation and personalization is an important research direction in this field. By using domain knowledge and personalized data, dialogue systems can better meet user needs and provide a more personalized experience.
[0042] 5) Multimodal dialogue systems. With the advancement of vision and speech technologies, multimodal dialogue systems are becoming an important direction for task-based dialogue systems. Such systems can process multiple inputs such as speech, images, and text at the same time, and can interact with users in a variety of ways. Multimodal dialogue systems have the potential to enhance user experience, provide richer information, and solve problems in specific scenarios.
[0043] In general, task-based dialogue system technology is developing in a smarter, more natural, and more personalized direction. With the continuous advancement of deep learning and natural language processing technology, task-based dialogue systems will be widely used in various fields in the future and provide users with a better interactive experience. However, this field still faces some challenges, such as the accuracy of semantic understanding, the complexity of dialogue management, and the realization of personalization. These problems require further research and innovation to solve.
[0044] In the first solution of the related technology, customized data can be constructed from scratch and generalized and enhanced without basic corpus or basic templates, so as to build mass-produced interactive data from 0 to 1 and perform data enhancement to meet a wide range of semantic interaction needs. The first technical solution of the related technology first constructs customized data and generalizes and enhances it from multiple information sources as a knowledge base, ignoring some deep logical relationships in the task-based dialogue process; secondly, the method of fine-tuning the large language model after data enhancement is not suitable for use scenarios with frequent task changes, and the training cost is high; finally, the customized responses are relatively stiff and single, and the user experience is average.
[0045] In the second solution of the related technology, the current sentence input by the user is converted into a digital vector representation, the Transformer encoder model is used to process the word feature vector sequence, and the Transformer encoder is used for intent recognition and entity extraction. The intent recognition result is combined with the prediction of the current round of input intent to obtain a fused intent; based on the fused intent result and the entity extraction result, a series of pre-set dialogue state attribute values are filled in, and the Transformer decoder model is used to predict the user's most likely next input intention based on the dialogue history record of the dialogue process and the fused intent, so as to comprehensively judge the user's most likely intention for the next round. The second solution of the related technology has the problems of poor real-time data update and high training cost. Furthermore, the second solution of the related technology needs to vectorize the dialogue state, which may face the problem of insufficient data; after the intent prediction, it cannot solve the problem of how to ask questions efficiently and complete the task quickly.
[0046] The technical solutions of related technologies still have the following technical problems:
[0047] 1) Poor accuracy of intent recognition. Current intent recognition technology has low accuracy when faced with complex user input. It may not accurately judge the user's intent, resulting in errors in subsequent processing or misleading results. The lack of accuracy in intent recognition leads to the inability of task-based dialogue systems to accurately understand the user's intent and needs, affecting the execution of subsequent tasks and user experience.
[0048] 2) Slot filling problem. The follow-up question method is single. Even when there are multiple possible intentions, the slot filling module lacks flexibility and can only use fixed follow-up questions. At the same time, the entity recognition accuracy is also low, and it is unable to accurately identify the key entity information in the user input. Inaccurate slot filling leads to the inability to accurately process subsequent tasks. The task-based dialogue system cannot meet the needs of users, which reduces the user experience.
[0049] 3) Dialogue management issues. The follow-up questioning process is unreasonable, and it is not possible to flexibly ask questions based on the characteristics of different intents. The task completion efficiency is low, and user needs cannot be efficiently met. The topic switching ability is poor, and different topics cannot be switched smoothly. At the same time, the utilization rate of contextual information is also low, and the previous dialogue content cannot be fully utilized. Dialogue management issues cause the task-based dialogue system to be unable to accurately understand user intent and context, and cannot effectively guide dialogues and meet user needs, affecting user experience and task execution efficiency.
[0050] 4) The problem of reply information generation. The reply content is relatively simple and lacks diversity and personalization, resulting in fewer changes in replies, which gives users a sense of mechanicalness and repetition. The reply generation content is simple and lacks personalization, which reduces user interest and participation and affects user experience.
[0051] It can be seen that the technical problems existing in the technical solutions of related technologies require improving the accuracy of intent recognition and entity recognition, improving the flexibility and efficiency of word slot filling and dialogue management, optimizing the topic conversion capability and the utilization of contextual information, and increasing the diversity and personalization of response generation, so as to improve the system performance and user experience.
[0052] In order to solve the above technical problems, a technical solution of the embodiment of the present application is proposed.
[0053] The following is a further detailed description of the embodiments of the present application in conjunction with the accompanying drawings and examples. It should be understood that the embodiments provided herein are only used to explain the embodiments of the present application and are not intended to limit the embodiments of the present application. In addition, the embodiments provided below are partial embodiments for implementing the present application, rather than providing all embodiments for implementing the present application. In the absence of conflict, the technical solutions recorded in the embodiments of the present application can be implemented in any combination.
[0054] It should be noted that, in the embodiments of the present application, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a method or device including a series of elements includes not only the elements explicitly recorded, but also includes other elements not explicitly listed, or also includes elements inherent to the implementation of the method or device. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the presence of other related elements (such as steps in a method or units in a device, for example, a unit may be a part of a circuit, a part of a processor, a part of a program or software, etc.) in the method or device including the element.
[0055] The dialogue method provided in the embodiment of the present application includes a series of steps, but the dialogue method provided in the embodiment of the present application is not limited to the recorded steps. Similarly, the dialogue device provided in the embodiment of the present application includes a series of modules, but the device provided in the embodiment of the present application is not limited to including the modules explicitly recorded, and can also include modules that need to be set for obtaining relevant information or processing based on information.
[0056] Figure 1 A flow chart of a conversation method according to an embodiment of the present application is shown in FIG. Figure 1 As shown, the process may include:
[0057] Step 101: Perform intent recognition on user input information to obtain user intent.
[0058] In the embodiment of the present application, user input information can be used as an object of intent recognition, and at least one label for representing the user's intent can be obtained by performing intent recognition on the user input information. For example, while taking the user input as an object of intent recognition, a finite set of tasks that the robot can complete can be listed, and the finite set can be used as a label for intent recognition.
[0059] Exemplarily, when the total amount of predetermined intentions is small, the user input information can be directly mapped to the user intentions. Figure 2 , the predetermined intentions include: "buy air tickets", "check weather", "buy insurance", "book a hotel" and "check phone bills", and the user input information is: "Will it rain in city A the day after tomorrow? I want to travel and may even stay there." The user intentions include "check weather" and "book a hotel".
[0060] Exemplarily, after performing intent recognition on the user input information, if no label is obtained for indicating the user's intent, it can be determined that the intent recognition has failed. Figure 2, the predetermined intents include: "buy air tickets", "check weather", "buy insurance", "book a hotel" and "check phone bills", and the user input information is "City A is a good place". Then the user intent cannot be classified as any of the intents of "buy air tickets", "check weather", "buy insurance", "book a hotel" or "check phone bills".
[0061] Exemplarily, when the total number of predetermined intentions is large, intent recognition can be performed on the user input information to obtain a category of intent corresponding to the user input information from among the predetermined categories of intentions; in the category of intent corresponding to the user input information, the user intent corresponding to the user input information is selected.
[0062] Exemplarily, the intent recognition process can be implemented by a pre-trained intent recognition large model. When the total amount of predetermined intents is large, the intent recognition large model can be accessed multiple times so that the access result obtained each time does not exceed the text upper limit supported by the intent recognition large model. In one example, the predetermined intents can be divided into multiple intent categories, each intent category includes multiple user intents. The first use of the intent recognition large model can determine a class of intents corresponding to the user input information. Then, by accessing the intent recognition large model again, it can be determined to locate a specific intent label in the class of intents corresponding to the user input information, that is, to determine the user intent corresponding to the user input information.
[0063] It can be seen that the embodiment of the present application can first determine a category of intent corresponding to the user input information, and then determine the user intent corresponding to the user input information in the category of intent corresponding to the user input information. In this way, when the total amount of the predetermined types of intents is large, the user intent category and the user intent can be accurately identified. The intent recognition model in the embodiment of the present application adopts a hierarchical structure design, and will not fail to locate the intent due to too many intents.
[0064] In some embodiments, when there are many tags used to express the user's intention, the user can be guided to clarify the intention. For example, when the user input information and the user's intention are combined into prompt information, a field related to the question can be added to the prompt information, and a determination and character replacement function can be added to the system. Figure 3 , the first intention recognition results include "check the weather" and "book a hotel", and the following question can be generated: "Are you more concerned about weather information or hotel reservation?" The user's input for this question is: "Let's check the weather first." According to the user's response to this question, the user's intention can be identified as "check the weather".
[0065] Step 102: Obtain the word slots required by the user's intention.
[0066] In some embodiments, the word slots required for the user intent can be determined based on the identifier of the user intent and the intent word slot information database. The identifier of the user intent can be an ID, name or other identifier, and the intent word slot information database represents the correspondence between each intent and the word slots required for each intent.
[0067] Exemplarily, the intent word slot information database also represents the correspondence between each intent and the interface that needs to be called for each intent. In this way, the target interface that needs to be called for the user intent can be determined based on the user intent identifier and the intent word slot information database. The target interface can implement calls to applications, databases, web services, and the like.
[0068] Step 103: According to the user input information and the user intention, the word slots required by the user intention are filled to obtain the word slot filling results.
[0069] In some embodiments, the user input information and the information queried from the intended word slot information database can be combined into prompt information of the slot filling model, the prompt information of the slot filling model can be input into the trained slot filling model, and the prompt information can be processed by the slot filling model to obtain the slot filling result. Here, the information queried from the intended word slot information database can include the word slot required by the user's intention. Exemplarily, the information queried from the intended word slot information database can also include one or more of the following: the target interface required to be called by the user's intention, the word slot that the user has filled, the interface that can be called by the word slot required by the user's intention, information indicating whether the dialogue task can be completed, the output of the task-based dialogue system, etc.
[0070] Step 104: When the word slot filling result satisfies the dialogue completion condition, dialogue reply information is generated for the user input information. The dialogue completion condition indicates the condition under which the dialogue reply information can be generated.
[0071] In an embodiment of the present application, the dialogue completion conditions can be pre-set according to actual needs. For example, when the word slot filling result meets the dialogue completion condition, the word slot filling result can at least be input into the trained reply model, and the input data can be processed using the reply model to obtain dialogue reply information for the user input information.
[0072] In practical applications, steps 101 to 104 can be implemented based on a processor of an electronic device, and the processor can be at least one of an application specific integrated circuit (ASIC), a digital signal processor (DSP), a digital signal processing device (DSPD), a programmable logic device (PLD), a field programmable gate array (FPGA), a central processing unit (CPU), a controller, a microcontroller, and a microprocessor.
[0073] It can be seen that the embodiment of the present application can obtain the word slot filling result according to the user intention after identifying the user intention, and then, when the word slot filling result meets the dialogue completion condition, it can generate dialogue reply information for the user input information. Therefore, the embodiment of the present application can generate dialogue reply information for the user input information more accurately based on the accurate understanding of the user intention.
[0074] In some embodiments of the present application, after obtaining the user intention, interface information may also be determined, where the interface information indicates a target interface that needs to be called according to the user intention.
[0075] Accordingly, when the word slot filling result meets the dialogue completion condition, the process of generating dialogue reply information for the user input information may include:
[0076] When the target interface is successfully called and the word slot filling result meets the dialogue completion condition, a dialogue reply message for the user input information is generated.
[0077] In an embodiment of the present application, by calling the target interface, the content required to complete the user's intention can be obtained. Therefore, when the target interface is called successfully and the word slot filling result meets the dialogue completion condition, the dialogue reply information for the user input information can be generated more accurately.
[0078] In some embodiments of the present application, when the target interface is successfully called and the word slot filling result satisfies the dialog completion condition, the process of generating dialog reply information for the user input information may include:
[0079] Obtain the call result of the target interface; generate dialogue reply information for the user input information according to the call result of the target interface and the word slot filling result.
[0080] It can be seen that the call result of the target interface can represent the content required to complete the user's intention. Therefore, when the target interface is called successfully and the word slot filling result meets the dialogue completion condition, the dialogue reply information for the user input information can be generated more accurately based on the call result of the target interface.
[0081] In some embodiments of the present application, after determining the interface information, the method further includes: when the target interface call fails, generating a dialog reply message for the user input information according to the reason for the target interface call failure.
[0082] It can be seen that since the dialogue reply information for the user input information is generated according to the reason for the failure of the target interface call, the dialogue reply information can reflect the reason for the failure of the target interface call, which is conducive to the subsequent processing of the reason for the failure of the target interface call.
[0083] In some embodiments of the present application, when the word slot filling result meets the dialogue completion condition, dialogue reply information is generated for the user input information, including: when the user intention does not require calling an interface and the word slot filling result meets the dialogue completion condition, dialogue reply information is generated for the user input information.
[0084] It can be seen that when the user intention does not require calling the interface, it is possible to directly determine whether the dialogue completion conditions are met based on the word slot filling results. When the word slot filling results meet the dialogue completion conditions, dialogue reply information for the user input information can be directly generated without calling the interface, which is simple and easy to implement.
[0085] In some embodiments of the present application, after obtaining the word slot filling result, the method also includes: when the word slot filling result does not meet the dialogue completion condition, generating follow-up question information for the unfilled word slot; obtaining user response information for the follow-up question information, and updating the word slot filling result according to the user response information.
[0086] It can be seen that when the word slot filling result does not meet the dialogue completion condition, the user's reply information can be obtained by generating follow-up information for the unfilled word slot; on the basis of obtaining the user's reply information, by updating the word slot filling result, it is beneficial to make the updated word slot filling result meet the dialogue completion condition, thereby facilitating the generation of dialogue reply information for the user input information.
[0087] Figure 4 A flowchart of another dialogue method provided in an embodiment of the present application, such as Figure 4As shown, the user input information can be input into the intention recognition model, and the intention recognition model can obtain a type of intention corresponding to the user input information from the intention category library according to the user input information; illustratively, the information obtained by the intention recognition model from the intention category library can be prompt information composed of a type of intention corresponding to the user input information. The intention recognition model can identify the user intention corresponding to the user input information from the type of intention corresponding to the user input information.
[0088] According to the ID of the user's intention, the word slot required by the user's intention and the target interface to be called by the user's intention are determined from the intention word slot information database. The user input information and the information queried from the intention word slot information database are combined into the prompt information of the slot filling model, and the prompt information of the slot filling model is input into the trained slot filling model; the prompt information is processed by the slot filling model to obtain the word slot filling result and the dialogue state. For example, the dialogue state is used to determine whether the interface needs to be called, whether the dialogue completion conditions are met, and whether the interface call is successful.
[0089] Reference Figure 4 , the dialogue state and word slot filling results can be input into the dialogue management model. In the dialogue management model, first determine whether the user intention needs to call the interface. If the user intention needs to call the interface, the data related to the interface call output by the slot filling model can be combined into interface call parameters, and the interface output results can be obtained according to the interface output parameter acquisition method output by the slot filling model. If the user intention needs to call the interface, it can be determined whether the interface call is successful. If the interface call fails, the pre-trained reply model can generate dialogue reply information based on the reason for the failure of the target interface call and the reply restriction information, thereby guiding the user to modify the parameters or end the conversation. If the interface call is successful or the user intention does not need to call the interface, it can be determined whether the word slot filling result meets the dialogue completion condition.
[0090] If the slot filling result meets the dialogue completion condition, the reply model can be used to generate dialogue reply information; if the slot filling result does not meet the dialogue completion condition, a follow-up letter for the unfilled slot is generated to complete the necessary information required to complete the dialogue task. For example, if the slot filling result does not meet the dialogue completion condition, the dialogue management capability of the dialogue management model selects appropriate follow-up information.
[0091] When the user replies to an unfilled word slot, the dialogue management model can receive the user's reply information to the follow-up information, and the dialogue management model updates the dialogue state and the word slot filling results according to the user's reply information. Exemplarily, the dialogue management model can determine the newly added and modified word slot filling results in the user's reply information, and write the corresponding word slot filling results into the dialogue state. Here, the newly added and modified word slot filling results in the user's reply information can be combined into prompt information. The specification requirements for the prompt information are relatively high. If the content boundaries of the dialogue state and the dialogue process are not clearly defined, the dialogue management model may add hallucinations and information that the system does not support to the dialogue management based on the general common sense in the general training corpus. Among them, the prompt information includes but is not limited to: the word slot required for the intent, the intent-related interface and its required word slot, the user's current input, the user's history of filling the word slot, the interface that can be called by the current word slot, information representing whether the dialogue task can be completed, the output of the dialogue system, etc. Reference Figure 5 ,When the word slot filling result does not meet the dialogue completion condition, the following question can be generated: “When is your check-out date?”
[0092] For example, the word slot information required for executing the task collected by the system and the task execution interface information forwarded by the dialogue management model can be input into the task execution component of the system, and the task component formats the return content of the interface and outputs it to the reply model. The task execution interface information can include information such as the interface address, parameter name, and parameter structure.
[0093] The reply model can generate corresponding reply information based on the task execution status returned by the task execution interface. When the task is successfully executed, the corresponding words of successful execution are returned. For example, a dialogue reply message can be generated for the user input information. When the task fails, the task execution failure can be input into the reply model, and the reply model will output a natural and appropriate failure response. Give a response. If the task is successful, the corresponding words of successful execution are returned. If the task fails, the failure reason combination is input into the model, and the model will output a natural and appropriate failure response. Figure 6 , when the "book a hotel" task fails, a proper failure response message can be generated.
[0094] In the embodiment of the present application, firstly, it can support the user to graphically configure the logical relationship and process of the dialogue; secondly, it can achieve full decoupling of knowledge, with the characteristics of fast upload and timely response; finally, the large language model is used to generate natural language replies under the guidance of prompts that introduce dialogue status and attribute information to improve user experience. The embodiment of the present application can use the understanding and logical reasoning capabilities of the general large language model to fully import the tasks of intent recognition, entity extraction, and dialogue status tracking into the large model and obtain output results; and the large language model can be called in follow-up questions and replies for dialogue management to generate more reasonable and efficient system feedback.
[0095] The embodiment of the present application proposes a design scheme for a task-based dialogue system based on a large language model. A general large language model is introduced into the dialogue system based on retrieval and a single task model, and the large model capability is introduced into the intent recognition module to improve the accuracy of intent recognition. The preliminary intent recognition results processed by the large model are used to query the available word slots, and the word slot filling process is also handled by the large model. The word slot filling and dialogue state management are used as black boxes to directly guide the dialogue process to the call of the interface or the execution of the final task. In this process, in order to maximize the control of the hallucination problem of the large model, the current dialogue state information and the final task goal will be added to the prompt of each round. Finally, after the execution of the task is completed, the large model generates a more natural language-closer and diversified output based on the execution of the task.
[0096] The large model for intent recognition of the embodiment of the present application can adopt a hierarchical structure design. When the number of intents is small, a single-layer architecture can be used. However, when the number of intents is large, all intent information cannot be input into the large model at one time. In view of the high accuracy of intent recognition of the large model and the low impact of the cumulative error of multiple serial calls, a hierarchical architecture can be adopted and multiple calls can be made to complete the task of intent classification.
[0097] The embodiment of the present application combines the dialogue state and the word slot filling result as the intermediate information of the dialogue. In the related art, the dialogue management and slot recognition of the dialogue system are implemented independently by two modules, but the advantage of the large model in the field of natural language processing determines that it can take into account the tasks of dialogue management and entity recognition, and these two modules are also coupled to each other in practical applications, so the embodiment of the present application can realize the simultaneous implementation of dialogue management and slot recognition through the design of prompt information.
[0098] The embodiments of the present application can achieve a close integration of the general large language model and the modules of the dialogue system. In the intention recognition large model, the intention category library is input into the large model in the form of prompt information, which can give full play to the intention recognition ability of the large model. When the intention information is compiled into the prompt information, the prompt information can be used as the information basis for model reasoning, so that the intention can be recognized in real time. Therefore, the embodiments of the present application support the dynamic change of intention and have the characteristics of strong generalization ability.
[0099] In the process of word slot filling and dialogue management, the embodiment of the present application can complete the slot filling and questioning process through the entity recognition ability and logical thinking ability of the large model. The embodiment of the present application can fill the current word slot and question the unfilled word slot according to the historical word slot information, and has a higher logical ability. Therefore, the flexibility and adaptability of word slot filling and dialogue management are improved, and the accuracy and user experience are improved. When generating user reply information, the language generation ability of the large model can be used to optimize the system's reply output.
[0100] Those skilled in the art will appreciate that, in the above method of specific implementation, the order in which the steps are written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of the steps should be determined by their functions and possible internal logic.
[0101] Based on the dialogue method proposed in the above-mentioned embodiment, the embodiment of the present application also proposes a dialogue device.
[0102] Figure 7 Schematic diagram of the structure of the dialogue device of the embodiment of the present application, such as Figure 7 As shown, the device comprises:
[0103] The recognition module 701 is used to recognize the intention of the user input information and obtain the user intention;
[0104] Processing module 702, used to obtain the word slots required by the user intention; fill the word slots required by the user intention according to the user input information and the user intention, and obtain the word slot filling result;
[0105] The generating module 703 is used to generate a dialogue reply message for the user input message when the word slot filling result satisfies a dialogue completion condition, wherein the dialogue completion condition indicates a condition under which the dialogue reply message can be generated.
[0106] In some embodiments, the processing module 702 is further used to determine interface information, where the interface information indicates a target interface that the user intends to call;
[0107] The generating module 703 is used to generate a dialogue reply message for the user input message when the word slot filling result meets the dialogue completion condition, including:
[0108] When the target interface is successfully called and the word slot filling result satisfies the dialog completion condition, a dialog reply message for the user input information is generated.
[0109] In some embodiments, the generating module 703 is used to generate a dialog reply message for the user input information when the target interface is successfully called and the word slot filling result satisfies the dialog completion condition, including:
[0110] Obtaining the calling result of the target interface;
[0111] According to the calling result of the target interface and the word slot filling result, a dialogue reply message for the user input information is generated.
[0112] In some embodiments, the generating module 703 is further configured to generate dialog reply information for the user input information according to the reason for the failure of calling the target interface when the calling of the target interface fails.
[0113] In some embodiments, the generating module 703 is used to generate a dialog reply message for the user input information when the word slot filling result satisfies the dialog completion condition, including:
[0114] When the user intention does not require calling an interface and the word slot filling result meets the dialogue completion condition, dialogue reply information for the user input information is generated.
[0115] In some embodiments, the processing module 702 is also used to generate follow-up information for unfilled word slots after obtaining the word slot filling result, when the word slot filling result does not meet the dialogue completion condition; obtain user response information for the follow-up information, and update the word slot filling result according to the user response information.
[0116] In some embodiments, the identification module 701 is used to perform intent recognition on user input information to obtain user intent, including: obtaining a class of intent corresponding to the user input information from various predetermined intentions by performing intent recognition on the user input information; and selecting the user intent corresponding to the user input information from the class of intent corresponding to the user input information.
[0117] In practical applications, the identification module 701, the processing module 702 and the generation module 703 can all be implemented based on a processor of an electronic device.
[0118] It should be noted that the description of the above device embodiment is similar to the description of the above method embodiment, and has similar beneficial effects as the method embodiment. For technical details not disclosed in the device embodiment of the present application, please refer to the description of the method embodiment of the present application for understanding.
[0119] It should be noted that in the embodiments of the present application, if the above method is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium, including a number of instructions to enable a computer device (which can be a terminal, a server, etc.) to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a U disk, a mobile hard disk, a read-only memory (ROM), a disk or an optical disk. In this way, the embodiments of the present application are not limited to any specific combination of hardware and software.
[0120] Correspondingly, an embodiment of the present application further provides a computer program product, which includes computer executable instructions, and the computer executable instructions are used to implement any one of the dialogue methods provided in the embodiments of the present application.
[0121] Correspondingly, an embodiment of the present application further provides a computer storage medium, on which computer executable instructions are stored, and the computer executable instructions are used to implement any one of the dialogue methods provided in the above embodiments.
[0122] An embodiment of the present application also provides an electronic device. Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown in FIG. Figure 8 As shown, the electronic device 80 may include:
[0123] Memory 801, used to store executable instructions;
[0124] The processor 802 is configured to implement any one of the above-mentioned dialogue methods when executing the executable instructions stored in the memory 801.
[0125] The processor 802 may be at least one of an ASIC, a DSP, a DSPD, a PLD, a FPGA, a CPU, a controller, a microcontroller, and a microprocessor.
[0126] The above-mentioned computer-readable storage medium or memory 801 can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory (Flash Memory), a magnetic surface memory, an optical disk, or a compact disc read-only memory (CD-ROM) and other memories; it can also be various terminals including one or any combination of the above-mentioned memories, such as mobile phones, computers, tablet devices, personal digital assistants, etc.
[0127] In some embodiments, the functions or modules included in the device provided in the embodiments of the present application can be used to execute the method described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments. For the sake of brevity, it will not be repeated here.
[0128] The above description of various embodiments tends to emphasize the differences between the various embodiments. The same or similar aspects can be referenced to each other, and for the sake of brevity, they will not be repeated herein.
[0129] The methods disclosed in the various method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.
[0130] The features disclosed in the various product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.
[0131] The features disclosed in the various method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.
[0132] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0133] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. A conversation method, characterized in that: The method comprises: Perform intent recognition on user input information to obtain user intent; Obtaining the word slot required by the user intention; According to the user input information and the user intention, word slots required by the user intention are filled to obtain the word slot filling result; When the word slot filling result satisfies a dialogue completion condition, dialogue reply information for the user input information is generated, and the dialogue completion condition indicates a condition under which the dialogue reply information can be generated.
2. The method according to claim 1, characterized in that After obtaining the user intention, the method further includes: determining interface information, the interface information indicating a target interface to be called according to the user intention; When the word slot filling result meets the dialogue completion condition, generating dialogue reply information for the user input information includes: When the target interface is successfully called and the word slot filling result satisfies the dialog completion condition, a dialog reply message for the user input information is generated.
3. The method according to claim 2, characterized in that When the target interface is successfully called and the word slot filling result satisfies the dialog completion condition, generating dialog reply information for the user input information includes: Obtaining the calling result of the target interface; According to the calling result of the target interface and the word slot filling result, a dialogue reply message for the user input information is generated.
4. The method according to claim 2, characterized in that: After determining the interface information, the method further includes: When the target interface call fails, a dialog reply message for the user input information is generated according to the reason for the target interface call failure.
5. The method according to claim 1, characterized in that When the word slot filling result meets the dialogue completion condition, generating dialogue reply information for the user input information includes: When the user intention does not require calling an interface and the word slot filling result meets the dialogue completion condition, dialogue reply information for the user input information is generated.
6. The method according to claim 1, characterized in that After obtaining the word slot filling result, the method further includes: When the word slot filling result does not meet the dialogue completion condition, generating follow-up question information for the unfilled word slot; Obtain user response information for the follow-up question information, and update the word slot filling result according to the user response information.
7. The method according to any one of claims 1 to 6, characterized in that: The performing intention recognition on the user input information to obtain the user intention includes: By performing intent recognition on the user input information, a type of intent corresponding to the user input information among various types of predetermined intents is obtained; In a category of intents corresponding to the user input information, a user intent corresponding to the user input information is selected.
8. A conversation device, characterized in that: The device comprises: The recognition module is used to recognize the intention of the user input information and obtain the user's intention; A processing module, configured to obtain the word slots required by the user intention; and fill the word slots required by the user intention according to the user input information and the user intention to obtain the word slot filling result; A generation module is used to generate dialogue reply information for the user input information when the word slot filling result meets the dialogue completion condition, and the dialogue completion condition represents the condition under which the dialogue reply information can be generated.
9. An electronic device, characterized in that: The electronic device comprises a processor and a memory for storing a computer program that can be run on the processor; wherein, The processor is configured to run the computer program to execute the dialogue method according to any one of claims 1 to 7.
10. A computer storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the dialogue method according to any one of claims 1 to 7 is implemented.
11. A computer program product, comprising a computer program, characterized in that The computer program implements the method according to any one of claims 1 to 7 when executed by a processor.
Citation Information
Patent Citations
Stack-based chat robot dialogue management method
CN110400564A
Dialogue generation method and device, computer readable storage medium and electronic equipment
CN111198937A
Conversation method and device, storage medium and electronic equipment
CN116186218A
Cited By
Stateful pretrained transformers in a generative response engine
US12400074B1
