Dialogue intention recognition method, composite dialogue system and storage medium

By combining large language models and search enhanced generative models, and using vector database to search target intention examples, the problem of low user intention recognition efficiency in composite dialogue systems is solved, and more efficient and accurate intention recognition is achieved, supporting rapid business expansion.

CN119179767BActive Publication Date: 2025-03-14ZHEJIANG LAB
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411678322.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-22
Publication Date
2025-03-14
Estimated Expiration
2044-11-22

AI Technical Summary

Technical Problem

In the prior art, dialogue intention recognition is inefficient and not accurate enough, especially in a composite dialogue system, it is difficult to efficiently identify user intentions and perform tasks.

Method used

By combining the Large Language Model (LLM) and the Retrieval Enhanced Generative Model (RAG), a pre-constructed vector database is used to retrieve target intent examples, intent prediction and slot information extraction, map to intents in the predefined domain, and perform preset tasks based on the target intent.

Benefits of technology

It improves the efficiency and accuracy of dialogue intention recognition, simplifies the intent data annotation and model training process, and enables LLM to make intent predictions in real time based on external search information, and supports fast and flexible access to diversified business processes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119179767B_ABST
    Figure CN119179767B_ABST
Patent Text Reader

Abstract

The present application relates to a method for identifying conversation intentions, a composite conversation system and a storage medium. The method comprises the following steps: in response to the conversation content input by a user, retrieving a target intention example based on a vector database; using LLM to predict the intention based on the target intention example to obtain an intention label; mapping the intention label to the intention in a predefined domain to determine the matching target intention; wherein the predefined domain includes the intentions of multiple business scenarios; guiding to the corresponding conversation scenario node based on the target intention; executing a preset task according to the conversation scenario node, and outputting the execution result of the preset task; and improving the efficiency and accuracy of conversation intention recognition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of natural language processing, and in particular to a method for recognizing conversation intentions, a composite conversation system, and a storage medium. Background Art

[0002] With the development of artificial intelligence technology, open-domain dialogue systems and task-oriented dialogue systems have gradually become the two core types in the field of intelligent interaction. Open-domain dialogue systems are used to conduct natural, open-ended dialogues with users, supporting natural communication on a wide range of topics and unstructured scenarios. The content of the dialogues is wide-ranging, ranging from daily small talk to in-depth discussions in certain specific areas. Task-oriented dialogue systems, on the other hand, focus on completing specific tasks, usually requiring accurate identification of user intent and performing corresponding tasks according to preset processes.

[0003] In practical applications, there is an increasing need to integrate open dialogue and task-based dialogue systems. This type of dialogue system is called a composite dialogue system. It not only needs to have the flexibility of open dialogue, but also needs to be able to accurately identify the user's intention to perform a specific task and perform the task. Therefore, how to effectively identify user intentions in such a complex dialogue environment becomes a key challenge.

[0004] At present, no effective solution has been proposed to address the problem of low efficiency and inaccuracy in conversation intention recognition in related technologies. Summary of the invention

[0005] Based on this, it is necessary to provide a dialogue intention recognition method, a composite dialogue system and a storage medium that can improve the efficiency and accuracy of dialogue intention recognition in response to the above technical problems.

[0006] In a first aspect, the present application provides a method for identifying a conversation intention, comprising:

[0007] In response to the dialogue content input by the user, a target intent example is retrieved based on a vector database;

[0008] Using LLM to predict the intent based on the target intent example to obtain the intent label;

[0009] Mapping the intent tag to an intent in a predefined domain to determine a matching target intent; wherein the predefined domain includes intents of multiple business scenarios;

[0010] Guiding to a corresponding dialogue scene node based on the target intention;

[0011] Execute the preset task according to the dialogue scene node, and output the execution result of the preset task.

[0012] In one of the embodiments, the vector database stores a plurality of intent examples, each of the intent examples comprising a user example, slot information, and at least one intent label.

[0013] In one embodiment, in response to the dialogue content input by the user, a target intent example is retrieved based on a vector database, including:

[0014] Preprocessing the conversation content to generate a corresponding vector representation;

[0015] Calculating similarity between the vector representation and the intent examples stored in the vector database to obtain a plurality of similar intent examples;

[0016] The multiple similar intent examples are arranged according to the degree of similarity, and the most similar TopN intent examples are selected from the queue as the target intent examples.

[0017] In one embodiment, LLM is used to predict intent based on the target intent example to obtain an intent label, including:

[0018] Constructing a prompt template according to the target intent example and its context information and the conversation content;

[0019] The LLM is used to predict the intent based on the prompt template to obtain the intent label.

[0020] In one of the embodiments, after LLM is used to perform intent prediction based on the target intent example to obtain an intent label, the method further includes:

[0021] Extracting slot information related to the intent tag from the conversation content;

[0022] Determining whether the slot information is complete according to the target intent example;

[0023] If it is determined that the slot information is incomplete, generating prompt content to guide the user to provide the missing slot information;

[0024] After the user updates the missing slot information, the current dialog state and slot information are synchronously updated.

[0025] In one embodiment, guiding to a corresponding dialogue scene node based on the target intention and performing a preset task according to the dialogue scene node includes:

[0026] According to the target intention, select the corresponding dialogue scene node from the preset dialogue process; wherein each dialogue scene node corresponds to a preset task;

[0027] After entering the dialogue scene node, selecting a preset task associated with the dialogue scene node;

[0028] Execute the preset task.

[0029] In one embodiment, after outputting the execution result of the preset task, the method further includes:

[0030] receiving feedback content input by the user regarding the execution result;

[0031] Determining whether the feedback content involves a new intention;

[0032] If it is determined that the feedback content involves a new intent, the feedback content is used as new conversation content and the process returns to the step of retrieving target intent examples based on a vector database in response to the conversation content input by the user.

[0033] In one of the embodiments, before retrieving a target intent example based on a vector database in response to the dialogue content input by the user, the method further includes:

[0034] Sorting out and embedding relevant intent examples according to business scenarios, and storing the intent examples in the vector database;

[0035] An intent label is generated according to the intent example, and the predefined domain is constructed according to the intent label.

[0036] In a second aspect, the present application provides a composite dialogue system, including:

[0037] A user input module, used to receive the dialogue content input by the user;

[0038] The NLU processing module is used to retrieve a target intent example based on a vector database in response to the dialogue content input by the user; use LLM to predict the intent based on the target intent example to obtain an intent label; map the intent label to an intent in a predefined domain to determine a matching target intent; wherein the predefined domain includes intents of multiple business scenarios;

[0039] A dialogue management module, used to receive the target intent output by the NLU processing module, and guide the target intent to a corresponding dialogue scene node based on the target intent;

[0040] A task execution module, used to execute preset tasks according to the dialogue scene nodes and obtain execution results;

[0041] An NLG processing module, used to generate a response message according to the execution result;

[0042] An output module is used to send the response message to the user.

[0043] In a third aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the method described in the first aspect above.

[0044] The above-mentioned conversation intention recognition method, composite conversation system and storage medium retrieve intent examples related to business scenarios based on a pre-built vector database, so that LLM not only relies on its own pre-trained knowledge, but also can call external search results in real time to more accurately predict intent, and match and map based on the pre-built predefined domain and the intent label measured by LLM, determine the target intent, and finally execute the preset task based on the target intent and output the execution result; such a setting greatly simplifies the process of intent data annotation and model training, so that LLM can combine external search information in real time to make more accurate intent predictions, thereby improving the recognition efficiency and accuracy of conversation intentions. Moreover, when it is necessary to support new business scenarios, it is only necessary to add new intent examples to the embedded intent examples in advance, without frequent model fine-tuning or large-scale regression testing, so that business expansion can be carried out efficiently and flexibly, which is conducive to realizing the rapid and flexible access to diversified business processes in open conversation systems. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] Figure 1 A diagram showing an application environment of a method for identifying conversation intentions in one embodiment;

[0046] Figure 2 is a flowchart of a method for identifying conversation intention in one embodiment;

[0047] Figure 3 is a schematic diagram of the structure of a composite dialogue system in one embodiment;

[0048] Figure 4 A flowchart of a method for identifying conversation intention in another embodiment;

[0049] Figure 5 This is a working principle diagram of the composite dialogue system of this embodiment. DETAILED DESCRIPTION

[0050] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0051] Unless otherwise defined, the technical terms or scientific terms involved in this application shall have the general meaning understood by people with general skills in the technical field to which this application belongs. The words "one", "a", "the", "these" and the like in this application do not indicate a quantitative limitation, and they may be singular or plural. The terms "include", "comprise", "have" and any variants thereof involved in this application are intended to cover non-exclusive inclusions; for example, a process, method and system, product or device comprising a series of steps or modules (units) is not limited to the listed steps or modules (units), but may include unlisted steps or modules (units), or may include other steps or modules (units) inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The "multiple" involved in this application refers to two or more. "And / or" describes the association relationship of associated objects, indicating that there may be three relationships, for example, "A and / or B" may mean: A exists alone, A and B exist at the same time, and B exists alone. Generally, the character " / " indicates that the objects associated with each other are in an "or" relationship. The terms "first", "second", "third", etc. in this application are only used to distinguish similar objects and do not represent a specific ordering of the objects.

[0052] Traditional intent recognition methods include: (1) rule-based classification methods, which recognize intent through predefined rules or templates, but have limited generalization capabilities and cannot cope with changing dialogue scenarios. (2) Methods based on deep learning models require a large amount of labeled data for training. (3) Intent recognition based on large models, which uses pre-trained large language models (LLMs) for intent prediction and has strong understanding capabilities. However, intent recognition that relies on large models faces two major problems: first, model fine-tuning and prompt engineering often require a lot of testing, and performance in different scenarios may be unstable; second, with the introduction of new tasks and scenarios, regression testing is required for all scenarios, resulting in low efficiency and poor scalability.

[0053] Therefore, in a complex dialogue system, how to efficiently and accurately identify user intentions becomes the key to solving the core problems in this field.

[0054] In view of the above analysis, in order to better support the intention recognition of the composite dialogue system, in one embodiment, a dialogue intention recognition method is provided, which combines a large language model (LLM) with a retrieval-augmented generation model (RAG) to improve the efficiency and accuracy of dialogue intention recognition. The dialogue intention recognition method can be applied to Figure 1 In the application environment shown. Among them, the terminal 101 communicates with the server 102 through the network. The data storage system 103 can store the data that the server 102 needs to process. The data storage system 103 can be integrated on the server 102, or it can be placed on the cloud or other network servers. The terminal 101 is used to provide an input interface (such as an input interface or API) to receive user input, and send the user input to the server 102, triggering the server 102 to execute the dialogue intention recognition method, and return the execution result to the terminal 101. Among them, the server 102 can have a built-in composite dialogue system (referred to as the system) for executing the dialogue intention recognition method. The terminal 101 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server 102 can be implemented with an independent server or a server cluster consisting of multiple servers.

[0055] Figure 2 is a flowchart of the method for identifying conversation intentions in this embodiment, and the method is applied to Figure 1 Taking the server 102 in the example as an example, the following steps are included:

[0056] Step S101, in response to the dialogue content input by the user, retrieve target intent examples based on a vector database.

[0057] When retrieving target intent examples based on the vector database, the conversation content can be preprocessed to generate the corresponding vector representation; the vector representation and the intent examples stored in the vector database are similarly calculated to obtain multiple similar intent examples; the multiple similar intent examples are arranged according to the similarity, and the most similar TopN intent examples are selected from the queue as the target intent examples. N is a positive integer, and the target intent examples can be 1, 2, 3 or even more.

[0058] Specifically, the natural language input by the user is preprocessed, such as word segmentation and stop word removal, to generate a corresponding vector representation; using a pre-built vector database, the vector representation corresponding to the user input is similar to the intent examples stored in the vector database. Based on the similarity calculation results, the system retrieves the intent example that is most similar to the current vector representation from the vector database, and selects the most similar Top3 intent examples as the target intent examples.

[0059] In this embodiment, the pre-built vector database helps the system to quickly vectorize the input conversation content and quickly find the target intent example that matches it, which is faster than the traditional rule-based matching intent recognition method. Moreover, the matching of the vector dimension can capture the semantic information in the text, so that even when faced with never-before-seen conversation content, the system can accurately identify the user's intention based on its semantic similarity, thereby better dealing with the ambiguity and fuzziness in natural language. The target intent example can not only give a best answer, but also provide several alternatives, which is helpful for dealing with some situations where there may be multiple interpretations.

[0060] In some embodiments, before step S101, relevant intent examples can be sorted out and embedded according to business scenarios, and the intent examples can be stored in a vector database. In order to support diversified business scenarios, for example, scientific research scenarios may include tasks such as document overview, document extraction, data visualization, graph-to-table, code execution, academic retrieval, and geological map recognition. The vector database stores intent examples for multiple business scenarios, and provides a sufficient number of intent examples for each business scenario. Each intent example includes a user example, slot information, and at least one intent label. Among them, the user example may include text information entered by the user, whether to upload a document, the type of document uploaded, etc. For business scenarios with multiple task combinations, two or more intent label combinations can be set in the corresponding intent examples.

[0061] Step S102: Use LLM to predict the intent based on the target intent example to obtain the intent label.

[0062] LLM is a pre-trained large language model. When predicting intent based on the target intent example, you can first build a prompt template based on the target intent example and its context information and the conversation content; use LLM to predict intent based on the prompt template to obtain the intent label. Specifically, the most similar Top3 intent examples and their context information can be used as part of the prompt, combined with the user's current input, to build a prompt template for LLM to guide intent prediction; based on the constructed prompt, LLM predicts the user's specific intent through its generation ability and gives the most likely intent label.

[0063] Step S103, mapping the intent tag to the intent in the predefined domain to determine a matching target intent; wherein the predefined domain includes intents of multiple business scenarios.

[0064] Match or map the intent labels predicted by LLM with the intent domain predefined by the system (i.e., predefined domain). The intents in the predefined domain cover all possible intents in a specific business scenario. Mapping ensures that the intent labels generated by LLM are consistent with the intents that the system can recognize and process.

[0065] In some embodiments, before step S101, after combing and embedding relevant intent examples according to business scenarios, intent labels can be generated according to intent examples, and predefined domains can be constructed according to the intent labels. Among them, the predefined domain is a set of intent labels defined in advance, and the intent label is the name of a predefined task or goal, representing different needs that users may express in conversations, helping the system understand the meaning of user input and triggering specific system behaviors. In order to support diverse business scenarios, for example, scientific research scenarios may include tasks such as document overview, document extraction, data visualization, graph-to-table conversion, code execution, academic retrieval, and geological map recognition. The intents in the predefined domain can cover all possible intents in scientific research scenarios and business scenarios.

[0066] Step S104, guiding to the corresponding dialogue scene node based on the target intention.

[0067] According to the target intention, select the corresponding dialogue scene node from the preset dialogue process; each dialogue scene node corresponds to a preset task; after entering the dialogue scene node, select the preset task associated with the dialogue scene node; execute the preset task. The preset task includes one of the following: drawing a graph, extracting a data table, and identifying data.

[0068] Specifically, according to the confirmed intention, the system selects the corresponding dialogue scene node from the predefined dialogue process, and each dialogue scene node corresponds to a specific task, such as parsing documents, drawing charts, identifying geological maps, etc. After entering the corresponding dialogue scene node, the system selects the preset task associated with the node, which contains a series of actions, and the system will execute the series of actions of the preset task.

[0069] Step S105, executing the preset task according to the dialogue scene node, and outputting the execution result of the preset task.

[0070] After the system executes the preset task action, the execution result of the task may include different types of data display, including drawn graphics, extracted data tables, recognized data, etc., and then the specific execution results are output and displayed according to the corresponding style.

[0071] In the above steps S101 to S105, the intent examples related to the business scenarios are retrieved based on the pre-built vector database, so that LLM not only relies on its own pre-trained knowledge, but also can call external search results in real time to more accurately predict intent, and match and map based on the pre-built predefined domain and the intent label measured by LLM to determine the target intent, and finally execute the preset task based on the target intent and output the execution result; such a setting greatly simplifies the process of intent data annotation and model training, so that LLM can combine external search information in real time to make more accurate intent predictions, thereby improving the recognition efficiency and accuracy of dialogue intent. Moreover, when it is necessary to support new business scenarios, it is only necessary to add new intent examples to the embedded intent examples in advance, without frequent model fine-tuning or large-scale regression testing, so that business expansion can be carried out efficiently and flexibly, which is conducive to the rapid and flexible access to diversified business processes in open dialogue systems.

[0072] In one embodiment, after performing intent prediction based on the target intent example and obtaining the intent label, the method further includes:

[0073] Extract slot information related to intent labels from the conversation content; determine whether the slot information is complete based on the target intent example; if the slot information is determined to be incomplete, generate prompt content to guide the user to provide the missing slot information; after the user updates the missing slot information, synchronously update the current conversation status and slot information.

[0074] In this embodiment, based on the constructed Prompt, LLM predicts the user's specific intention through its generation capability, gives the most likely intention label, and further extracts the slot information related to the intention label in the user input. Among them, the slot information includes but is not limited to key parameters such as time, quantity, type, data, and object. In the subsequent dialogue of the user input, the system will continue to use the acquired intention label and slot information, and update or supplement the slot information according to the new input to ensure the continuity and accuracy of the dialogue. Further, the system will check whether the user input contains all the necessary slot information related to the target intention (such as time, number of articles, type, etc.) according to the target intention obtained after mapping. If the extracted slot information is incomplete and the system identifies the missing slot, it will dynamically generate appropriate supplementary questions or clarification prompts through natural language generation technology to guide the user to provide the missing slot information. After the user supplements or modifies the missing slot information according to the prompt, the system will synchronously update the dialogue state and slot information to ensure the integrity of the information.

[0075] For traditional methods based on deep learning models, in addition to requiring a large amount of labeled data for training, it is also difficult to support complex multi-round intent recognition. To solve this problem, in one embodiment, after outputting the execution result of the preset task, the method also includes:

[0076] Receive feedback content input by the user regarding the execution result; determine whether the feedback content involves a new intent; if it is determined that the feedback content involves a new intent, use the feedback content as new conversation content, return to the conversation content in response to the user input, and retrieve the target intent example based on the vector database.

[0077] In this embodiment, when the user is not satisfied with the task execution result, or finds that the system has recognition or extraction errors, the user can provide feedback. The system will regard user feedback as new input, and based on user feedback, the system will re-recognize intent, including text parsing, intent analysis, and slot extraction. At this time, the system will re-judge whether the user's new input is related to the current conversation, or whether a new task is introduced, or whether it is just modifying the slot information. If the user feedback involves a new intent, the system will use LLM to combine the current conversation context to predict the intent and extract new slot information. Based on the content of the feedback, the system automatically modifies the current task flow, adjusts the scene nodes, or starts a new task flow, and generates a corresponding reply. With this setting, the system can effectively handle multiple rounds of conversations by combining historical messages with context, ensuring continuous tracking and dynamic updating of user intentions.

[0078] In one embodiment, Figure 3 A composite dialogue system is provided, such as Figure 3 As shown, the system includes:

[0079] A user input module 11, used to receive the dialogue content input by the user;

[0080] The NLU processing module 12 is used to retrieve a target intent example based on a vector database in response to the dialogue content input by the user; use LLM to predict the intent based on the target intent example to obtain an intent label; map the intent label to an intent in a predefined domain to determine a matching target intent; wherein the predefined domain includes intents of multiple business scenarios;

[0081] The dialogue management module 13 is used to receive the target intent output by the NLU processing module 12 and guide the target intent to the corresponding dialogue scene node;

[0082] The task execution module 14 is used to execute the preset task according to the dialogue scene node and obtain the execution result;

[0083] NLG processing module 15, used to generate a response message according to the execution result;

[0084] The output module 16 is used to send a response message to the user.

[0085] The following will introduce the conversation intention recognition method and the composite conversation system provided by this application in combination with specific business scenarios.

[0086] Business scenario 1:

[0087] In one embodiment, Figure 4 A flowchart of another method for identifying conversational intent is provided, such as Figure 4 As shown, the process includes the following steps:

[0088] Step S201, sorting and embedding relevant intent examples according to business scenarios, and storing the intent examples in a vector database; and generating intent tags according to the intent examples, and constructing predefined domains according to the intent tags;

[0089] Step S202, in response to the conversation content input by the user, similar intent examples are retrieved based on the vector database, and sorted according to similarity, and the top three most similar intent examples are taken as target intent examples;

[0090] Step S203: LLM uses the target intent example as a prompt to predict the intent, obtains the intent label, and further extracts the relevant slot information. If the slot information is missing, the user is prompted to supplement it, and the current dialogue state and slot information are updated synchronously.

[0091] Step S204, mapping the intent tag to the intent in the predefined domain to determine a matching target intent;

[0092] Step S205, guiding to the corresponding dialogue scene node based on the target intention;

[0093] Step S206, selecting and executing a preset task according to the dialogue scenario node, outputting the execution result of the preset task, and generating reply content;

[0094] Step S207, optimize the dialogue strategy and intent recognition according to user feedback, and update the current dialogue state.

[0095] Taking the scientific research scenario as an example, the system supports open questions and answers about professional domain knowledge with users, and also integrates different task types in various scientific research scenarios, including document overview, document extraction, image-to-table conversion, data visualization, code running, academic retrieval, geological map recognition, etc. By pre-analyzing possible user needs, a set of predefined domain intents is constructed in the system, as shown in Table 1.

[0096] Table 1

[0097]

[0098] The system supports a variety of business scenarios, such as document overview, document extraction, data visualization, image-to-table conversion, code execution, geological map recognition, etc., and provides a sufficient number of intent examples for each business scenario and intent in the predefined domain; each intent example information includes user examples, intent labels, and slot information, where specific examples include text information entered by the user, whether to upload a document, the type of document uploaded, and so on. The system sorts out all relevant intent examples and corresponding slot information based on the business scenario and the intent labels in the predefined domain. In this embodiment, the document_qa intent label is taken as an example for illustration, as shown in Table 2.

[0099] Table 2

[0100]

[0101] The system converts all intent examples related to business scenarios into embedded vectors and stores them in the vector database. When the user enters information, the natural language input by the user is preprocessed, such as word segmentation, stop word removal, etc., to generate the corresponding vector representation; using the pre-built vector database, the vector input by the user is similar to the intent example vector stored in the database. Based on the similarity calculation results, the system retrieves intent examples similar to the current input from the vector database and selects the top 3 most similar intent examples as the target intent examples.

[0102] For example, when a user inputs: "Please answer the question about the formation of the Himalayas based on this article" and uploads a pdf document in the dialog input box, the system converts the user input into an embedding vector, retrieves intent examples similar to the current input in the vector repository, and ranks them based on similarity. The similarity between the input information vector and each intent example in the repository is calculated, and the target intent example is returned, as shown below:

[0103] Intent example 1: "Please answer the cause of earthquakes based on the content of the article." + "Attachment.pdf" → Intent: document_qa, Similarity: 0.95;

[0104] Intent example 2: "Please summarize the content of the following document" + "Attachment.pdf" → Intent: document_qa, Similarity: 0.85;

[0105] Intent example 3: “Please summarize the content of the document” + “Attachment 1.pdf” + “Attachment 2.pdf” → Intent: document_qa, Similarity: 0.80.

[0106] LLM includes the top three most similar intent examples in the LLM prompt, uses them as prompts for intent prediction, extracts relevant slot information, and then synchronously updates the dialogue status based on the intent label and slot information. The prompt is as follows:

[0107] Tip:

[0108] User input: "Please answer the origin of the Himalayas based on this document."

[0109] Similar examples:

[0110] 1. "Please answer the cause of earthquakes based on the content of the article." + "Attachment.pdf" → Intent: document_qa, slot information: doc=attachment.pdf, content=cause of earthquakes;

[0111] 2. "Please summarize the content of the following document" + "Attachment.pdf" → Intent: document_qa, slot: doc=attachment.pdf, content=summary content;

[0112] 3. "Please summarize the content of the document" + "Attachment 1.pdf" + "Attachment 2.pdf" → Intent: document_qa, slot: doc=Attachment 1.pdf, Attachment 2.pdf, content=Compare the content of the document.

[0113] Based on these examples, predict the user's intent and slot information.

[0114] The system uses the top 3 similar intent examples and their context information retrieved from the vector database as part of the prompt, and combines the user's current input to build a prompt template for LLM to guide intent prediction. Based on the constructed prompt, LLM predicts the user's specific intent through its generation capability, gives the most likely intent label, and further extracts slot information related to the intent in the user input, including key parameters such as time, quantity, type, data, and object.

[0115] In this embodiment, LLM predicts the intent based on the provided Prompt and extracts the relevant slot information. Assuming that the user intent is document_qa, the slot information includes doc: no specific document is given, and additional documents are required, content: the cause of the Himalayas.

[0116] Based on the intent prediction results and slot information, the system will synchronously update the conversation state and slot information to ensure the integrity of the information. In subsequent conversations input by the user, the system will continue to use the extracted intent and slot information, and update or supplement the slots based on the new input to ensure the continuity and accuracy of the conversation.

[0117] Match or map the intent labels generated by LLM predictions with the intent domains predefined by the system. The intents in the predefined domains cover all possible intents in a specific business scenario. The mapping step ensures that the labels generated by LLM are consistent with the intents that the system can recognize and process. Map the intent labels generated by LLM predictions to the intents in the predefined domains. The comparison result is the required content of the two slots doc and content of the document_qa intent.

[0118] Based on the mapped intent, the system checks whether the user input contains all the necessary slot information related to the intent (such as time, number of articles, type, etc.). If the extracted slot information is incomplete, the system identifies the missing slots and dynamically generates appropriate supplementary questions or clarification prompts through natural language generation technology to guide the user to provide the missing slot information. After the user supplements or modifies the missing slot information according to the prompts, the system will synchronously update the conversation status and slot information to ensure the integrity of the information. If the required doc slot is missing, the system will dynamically prompt the user to supplement it, such as sending a new message to prompt the user, such as "Please upload the document."

[0119] When the intent is confirmed and the slot information is complete, the system selects the corresponding scene from the predefined dialogue flow according to the confirmed intent. Each scene corresponds to a specific task or operation, such as parsing documents, drawing charts, identifying geological maps, etc. After entering the corresponding scene node, the system selects the pre-set task action associated with the node and executes the task action.

[0120] In the above embodiment, document_qa is related to the document question-and-answer process. The system will pass doc and content to the corresponding application, and obtain a summary of the document.

[0121] Generate reply content based on the result of the action task execution. Generate reply content based on the result returned by the application and output it to the user. The execution result of the system executing the pre-set task may include different types of data display, such as drawn graphics, extracted data tables, recognized data, etc. The specific execution results need to be output and displayed accordingly according to the corresponding style requirements.

[0122] The user gives corresponding feedback based on the reply result, and the user feedback is used as new input. Based on the new input, the dialogue strategy and intent recognition are optimized, and the current dialogue state is updated. The user can continue to input information based on the context content, such as "Please continue to analyze this paper", and the context content and the current input information will be vector-embedded and compared again, and the current intent label and slot information will be updated for another round of dialogue.

[0123] When the user is not satisfied with the result of the task execution, or believes that the system has an intent recognition error or a slot extraction error, the user can provide feedback. User feedback is regarded as new input, and based on the user feedback, the system re-recognizes intent, including text parsing, intent analysis, and slot extraction. At this time, the system will re-judge whether the user's new input is related to the current conversation, whether a new task is introduced, or whether it is just modifying the slot information. If the user feedback involves a new intent, the system will use LLM to combine the current conversation context to predict the intent and extract new slot information. Based on the content of the feedback, the system automatically modifies the current task process, adjusts the scene nodes, or starts a new task process, and generates a corresponding reply.

[0124] Figure 5 FIG. 1 is a working principle diagram of the composite dialogue system of this embodiment. Figure 5 As shown in the figure, each module is responsible for different links from user input to response generation, ensuring that the system can handle complex multi-round conversations.

[0125] The user can conduct a question-and-answer dialogue with the system through the user dialogue interaction interface provided by the PC end of the system. The user input information may include only one piece of information input by the user most recently, or may include several pieces of information input by the user most recently, or may include all information input by the user in the past, which is not limited in this embodiment.

[0126] After receiving the user input information, the user input information is passed to the NLU processing module, which is responsible for parsing the user input, identifying the intent and filling the relevant slots. Through LLM prediction, the system can automatically generate intent labels and match similar intent examples. At the same time, it maps the predicted intent to the intent in the predefined domain to ensure that the system can correctly understand the user's needs.

[0127] The output of the NLU processing module is passed to the dialogue management module, which updates the dialogue status in real time and selects the corresponding dialogue scenario or task path based on the output of the NLU processing module. This module ensures the logical coherence of the dialogue and guides the user in multiple rounds of dialogue to select the appropriate operation by matching the task.

[0128] Once the user's intent is clear, the task execution module is responsible for executing specific business logic or operations to perform the task requested by the user. This module ensures that the system can handle the execution of different task types, such as document parsing, data visualization, or code execution.

[0129] After the task is completed, the NLG processing module generates appropriate language responses based on the execution results and feeds back the results to the user. This module is responsible for converting the task execution results within the system into natural language responses that the user can understand.

[0130] The generated response content is sent to the user through the output module (such as the user dialogue interaction interface or API provided by the PC side of the system). The user can continue multiple rounds of dialogue based on the feedback, and the system repeats the above steps.

[0131] Business scenario 2:

[0132] In one embodiment, the user sends natural language input to the system through a chat interface or an API interface, allowing the user to input multiple task scenarios simultaneously in a single round of dialogue. For example, the user inputs: "Please convert this table image into data and display a scatter plot of this data on the map." The user needs to convert the table image into data and generate a map scatter plot based on this data.

[0133] In order to cope with this single-round dialogue multi-tasking scenario, in this embodiment, the system combines LLM with RAG. Without the need for frequent model fine-tuning or large-scale regression testing, it can quickly adapt to new scenarios and tasks by updating the intent example library, thereby significantly improving the scalability and efficiency of the system.

[0134] Based on the understanding of business scenarios, we pre-sort out the possible task combinations in a single-round conversation and supplement the response intent example library to adapt to this task combination. We take the two intent combinations of "converting a graph to a table" and "drawing a map scatter plot" as examples.

[0135] Based on the understanding of the business scenario, the system sorts out relevant examples of combined intents and corresponding slot information. In this embodiment, the document_qa intent tag is used as an example for explanation. The document_qa intent tag is shown in Table 3.

[0136] Table 3

[0137]

[0138] The system first processes the user's input through the NLU (natural language understanding) module. The NLU processing module retrieves the intent example library in the system, and by matching similar intent examples, the system recognizes that the user input is a combination of the two intent labels "convert graph to table" and "draw map scatter plot".

[0139] The system retrieves examples related to "converting tables to data" and "drawing scatter plots" from the intent example library and sorts them based on similarity for LLM to make the next prediction. The prompt in this example is as follows:

[0140] Tip:

[0141] User input: "Please convert this table image into data and display a scatter plot of this data on a map."

[0142] Similar examples:

[0143] 1. "Please convert the picture into a table, and then use the data in the table to draw a map scatter plot" + "picture.png" → Intent tag 1: picture_table slot: pic = "picture.png"; Intent tag 2: data_visualize slot: type = map scatter plot, data = {execution result of intent tag 1};

[0144] 2. "Please convert the following picture into a table, and then use the data in the table to draw a line chart" + "picture.png" → Intent tag 1: picture_table slot: pic = "picture.png"; Intent tag 2: data_visualize slot: type = line chart, data = {execution result of intent tag 1};

[0145] 3. "Please extract the table data in the picture, and then draw a bar chart of the table data" + "picture.png" → Intent tag 1: picture_table slot: pic="picture.png"; Intent tag 2: data_visualize slot: type=bar chart, data={execution result of intent tag 1}.

[0146] Based on these examples, predict the user's intent and slot information.

[0147] Based on the recognized intent, LLM will try to extract relevant slot information (such as table files, map locations, scattered data, etc.). For slots with image files, the system dynamically prompts the user to supplement or upload table images.

[0148] Based on the identified intent, the system guides the conversation to the corresponding scenario node. For example, the system will first process the "table conversion" task, and then guide the user to the "generate map scatter plot" task scenario.

[0149] The system calls the pre-set table image conversion function through the execution module to convert the table image uploaded by the user into usable table data. OCR technology or other image processing algorithms can be used to parse the text and data in the image.

[0150] After the table data is converted, the system will use the geographic location data to generate a map scatter plot. The execution module will call the relevant drawing program according to user needs to visualize the data.

[0151] The system generates a corresponding response based on the results of the above task execution. For example, the result data of the table conversion is first generated and fed back to the user. Then, when the map scatter plot is completed, the system generates an image and feeds it back to the user, such as a download image display.

[0152] The system will feed back the generated response to the user through the chat interface or API, and the user will see the table data conversion results and map scatter plots.

[0153] Through this process, the system can efficiently handle users' complex task requirements, use the combination of LLM and RAG technology to dynamically adapt to different scenarios and accurately identify users' combined intentions, and ultimately complete complex task chains.

[0154] Business scenario three:

[0155] In one embodiment, by combining LLM with RAG, the system can quickly adapt to new scenarios and tasks by updating the intent example library without frequent model fine-tuning or large-scale regression testing, thereby significantly improving the scalability and efficiency of the system.

[0156] To further improve the system's functionality, users hope that the dialogue system can help them perform academic retrieval tasks. Traditional methods require redesigning intent recognition logic, training models, and conducting complex scenario tests to ensure that it understands new intents such as "retrieve the latest papers on quantum computing."

[0157] This embodiment is based on the system of LLM and RAG. It only needs to add the scholar_search intent tag to the intent set of the predetermined domain of inquiry, embed the intent examples related to "academic search", and define the execution logic of the corresponding task. The "academic search" intent tag is shown in Table 4.

[0158] Table 4

[0159]

[0160] We sort out the response intent examples for the scholar_search intent label and perform vector embedding, as shown in Table 5.

[0161] Table 5

[0162]

[0163] In this way, the system can quickly introduce new scenarios and business tasks without a lot of testing and model adjustments, greatly improving development efficiency and system scalability.

[0164] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0165] In response to the dialogue content input by the user, a target intent example is retrieved based on a vector database;

[0166] Use LLM to predict intent based on target intent examples and obtain intent labels;

[0167] Map the intent label to the intent in the predefined domain to determine the matching target intent; the predefined domain includes intents of multiple business scenarios;

[0168] Guide to the corresponding dialogue scene node based on the target intention;

[0169] Execute preset tasks according to the dialogue scenario nodes and output the execution results of the preset tasks.

[0170] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.

[0171] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0172] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0173] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A method for identifying conversation intention, characterized in that: include: In response to the dialogue content input by the user, a target intent example is retrieved based on a vector database; Using LLM to predict the intent based on the target intent example to obtain the intent label; Mapping the intent tag to an intent in a predefined domain to determine a matching target intent; wherein the predefined domain includes intents of multiple business scenarios; Guiding to a corresponding dialogue scene node based on the target intention; Execute the preset task according to the dialogue scene node, and output the execution result of the preset task.

2. The method for identifying conversation intention according to claim 1, characterized in that: The vector database stores multiple intent examples, each of which includes a user example, slot information and at least one intent label.

3. The method for identifying conversation intention according to claim 1, characterized in that: In response to the dialogue content input by the user, a target intent example is retrieved based on the vector database, including: Preprocessing the conversation content to generate a corresponding vector representation; Calculating similarity between the vector representation and the intent examples stored in the vector database to obtain a plurality of similar intent examples; The multiple similar intent examples are arranged according to the degree of similarity, and the most similar TopN intent examples are selected from the queue as the target intent examples.

4. The method for identifying conversation intention according to claim 1, characterized in that: LLM is used to predict the intent based on the target intent example to obtain the intent label, including: Constructing a prompt template according to the target intent example and its context information and the conversation content; The LLM is used to predict the intent based on the prompt template to obtain the intent label.

5. The method for identifying conversation intention according to claim 1, characterized in that: After LLM is used to predict intent based on the target intent example to obtain an intent label, the method further includes: Extracting slot information related to the intent tag from the conversation content; Determining whether the slot information is complete according to the target intent example; If it is determined that the slot information is incomplete, generating prompt content to guide the user to provide the missing slot information; After the user updates the missing slot information, the current dialog state and slot information are synchronously updated.

6. The method for identifying conversation intention according to claim 1, characterized in that: Guiding to a corresponding dialogue scene node based on the target intention, and executing a preset task according to the dialogue scene node, including: According to the target intention, select the corresponding dialogue scene node from the preset dialogue process; wherein each dialogue scene node corresponds to a preset task; After entering the dialogue scene node, selecting a preset task associated with the dialogue scene node; Execute the preset task.

7. The method for identifying conversation intention according to claim 1, characterized in that: After outputting the execution result of the preset task, the method further includes: receiving feedback content input by the user regarding the execution result; Determining whether the feedback content involves a new intention; If it is determined that the feedback content involves a new intent, the feedback content is used as new conversation content and the process returns to the step of retrieving target intent examples based on a vector database in response to the conversation content input by the user.

8. The method for identifying conversation intention according to claim 1, characterized in that: Before retrieving a target intent example based on a vector database in response to the dialogue content input by the user, the method further includes: Sorting out and embedding relevant intent examples according to business scenarios, and storing the intent examples in the vector database; An intent label is generated according to the intent example, and the predefined domain is constructed according to the intent label.

9. A composite dialogue system, characterized in that: include: A user input module, used to receive the dialogue content input by the user; An NLU processing module, for retrieving target intent examples based on a vector database in response to the dialogue content input by the user; Using LLM to predict intent based on the target intent example to obtain an intent label; mapping the intent label to an intent in a predefined domain to determine a matching target intent; wherein the predefined domain includes intents of multiple business scenarios; A dialogue management module, used to receive the target intent output by the NLU processing module, and guide the target intent to a corresponding dialogue scene node based on the target intent; A task execution module, used to execute preset tasks according to the dialogue scene nodes and obtain execution results; An NLG processing module, used to generate a response message according to the execution result; An output module is used to send the response message to the user.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.

Citation Information

Patent Citations

  • Customer service multi-round dialogue intention and slot position identification method and system

    CN114186042A

  • Multi-intention identification method and system for power business scene

    CN116306685A