LLM-based intention recognition method and apparatus, device, and storage medium

By adopting a large language model (LLM)-based method in intention recognition, the problem that the intention recognition model in the prior art needs to be specially trained for various fields is solved, and the universality and efficiency of intention recognition are improved.

WO2025123631A1PCT designated stage expired Publication Date: 2025-06-19BAIDU INTELLIGENT CLOUD (CHENGDU) SCIENCE TECHNOLOGY CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/100119
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-12-13
Filing Date
2024-06-19
Publication Date
2025-06-19

AI Technical Summary

Technical Problem

In the prior art, intent identification models based on specific domains need to be specially trained for each domain, resulting in high development costs and poor versatility.

Method used

The intent recognition method based on the large language model (LLM) is adopted, and the LLM prompt information is generated by obtaining the current round of query statements and inheritance information, and the initial intent of the current round of query statements is determined, and the target intent is determined based on the inheritance intent.

Benefits of technology

It improves the versatility of intention recognition, reduces the need for specialized model training in various fields, and achieves a more efficient intention recognition process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024100119_19062025_PF_FP_ABST
    Figure CN2024100119_19062025_PF_FP_ABST
Patent Text Reader

Abstract

An LLM-based intention recognition method and apparatus, a device, and a storage medium, relating to the technical field of artificial intelligence. The method comprises: acquiring a query statement of a current round and inheritance information, the inheritance information comprising an inherited intention, and the inherited intention being obtained after performing intention recognition on a query statement of a previous round (101); generating prompt information of an LLM on the basis of the query statement of the current round, and using the LLM to determine an initial intention of the query statement of the current round on the basis of the prompt information (102); and on the basis of the initial intention and the inherited intention, determining a target intention of the query statement of the current round (103).
Need to check novelty before this filing date? Find Prior Art

Description

LLM-based intention recognition method, device, equipment and storage medium

[0001] This application claims priority to a Chinese patent application filed on December 13, 2023, with application number 202311724473.1 and invention name “LLM-based intent recognition method, apparatus, device and storage medium”. Technical Field

[0002] The present disclosure relates to the field of artificial intelligence technology, specifically to technical fields such as smart office, cloud computing, and large models, and in particular to an LLM-based intent recognition method, device, equipment, and storage medium. Background Art

[0003] The intent recognition component is a key component in the government affairs assistant. It can identify the intent of the query statement entered by the user and then obtain the query results corresponding to the query statement based on the intent.

[0004] In related technologies, intent recognition can be performed based on an intent recognition model in a specific field.

[0005] Summary of the Invention

[0006] The present disclosure provides an LLM-based intent recognition method, apparatus, device, and medium.

[0007] According to one aspect of the present disclosure, a method for intent recognition based on LLM is provided, comprising: obtaining a current round query statement and inheritance information; the inheritance information includes an inheritance intent, which is obtained after intent recognition of a previous round query statement; generating LLM prompt information based on the current round query statement, and using the LLM to determine the initial intent of the current round query statement based on the prompt information; and determining the target intent of the current round query statement based on the initial intent and the inheritance intent.

[0008] According to another aspect of the present disclosure, an LLM-based intent recognition device is provided, including: an acquisition module for acquiring a current round query statement and inheritance information; the inheritance information includes an inheritance intent, which is obtained after intent recognition of a previous round query statement; a first determination module for generating LLM prompt information according to the current round query statement, and using the LLM to determine the initial intent of the current round query statement based on the prompt information; a second determination module for determining the target intent of the current round query statement based on the initial intent and the inheritance intent.

[0009] According to another aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute any one of the methods described in any one of the above aspects.

[0010] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute any one of the methods according to any one of the above aspects.

[0011] According to another aspect of the present disclosure, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the method according to any one of the above aspects.

[0012] According to the technical solution disclosed in the present invention, the versatility of intent recognition can be improved.

[0013] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] The accompanying drawings are provided to facilitate a better understanding of the present invention and do not constitute a limitation of the present disclosure.

[0015] FIG1 is a schematic diagram of a first embodiment of the present disclosure;

[0016] FIG2 is a schematic diagram of an application scenario for implementing an embodiment of the present disclosure;

[0017] FIG3 is a schematic diagram of the overall process of intent recognition provided according to an embodiment of the present disclosure;

[0018] FIG4 is a schematic diagram according to a second embodiment of the present disclosure;

[0019] FIG5 is a schematic diagram according to a third embodiment of the present disclosure;

[0020] FIG6 is a schematic diagram of an electronic device for implementing the LLM-based intention recognition method according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0021] The following description of exemplary embodiments of the present disclosure is provided in conjunction with the accompanying drawings, which include various details to facilitate understanding. These details should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted from the following description.

[0022] In related technologies, when performing intent recognition based on a field-specific intent recognition model, it is necessary to train the corresponding intent recognition model specifically for each field, which results in high development costs and poor versatility.

[0023] In order to improve the versatility of intent recognition, the present disclosure provides the following embodiments.

[0024] FIG1 is a schematic diagram of a first embodiment of the present disclosure. This embodiment provides an LLM-based intent recognition method, which includes:

[0025] 101. Obtain a current round of query statements and inheritance information; the inheritance information includes inheritance intent, and the inheritance intent is obtained after performing intent recognition on the previous round of query statements.

[0026] 102. Generate LLM prompt information based on the current round query statement, and use the LLM to determine the initial intention of the current round query statement based on the prompt information.

[0027] 103. Based on the initial intent and the inherited intent, determine the target intent of the current round of query statement.

[0028] The query statement (query) may be input by a user, for example, the user inputs the query statement in a natural language.

[0029] Users can have multiple rounds of conversations with the query system to obtain the final query results.

[0030] The target intent refers to the intent finally determined after intent recognition for each round of query statements.

[0031] The initial intent refers to the intent of each query statement obtained based on LLM.

[0032] Inherited intent: For the current query, the target intent of the previous query is called the inherited intent. The inherited intent can be null or contain specific content, such as "Apply for housing provident fund withdrawal for renting a house."

[0033] For the current round of query statements, the target intent of the current round of query statements can be obtained based on the initial intent and inherited intent of the current round of query statements.

[0034] Large Language Model (LLM) has been a hot topic in the field of artificial intelligence in recent years. LLM is a pre-trained language model that learns rich language knowledge and world knowledge through pre-training on massive text data, enabling it to achieve amazing results in various natural language processing (NLP) and image generation tasks. Wenxin Yiyan, ChatGPT, etc. are applications developed based on LLM. They can generate fluent, logical, and creative text content, and can even have natural conversations with humans. Specifically, LLM can be a general pre-trained Transformer (Generative Pre-trained Transformer, GPT) model based on Transformer, or an Enhanced Representation through Knowledge Integration (ERNIE) model based on knowledge integration.

[0035] The input of LLM includes prompt information, and LLM generates corresponding output information based on the prompt information.

[0036] Specifically in the intent recognition scenario, the prompt information of LLM can be generated based on the current round query statement, and the output information of LLM can specifically be the initial intent of the current round query statement.

[0037] After obtaining the initial intent using LLM, the target intent of the current query can be derived by combining the initial intent with the inherited intent. This target intent can then be used as the inherited intent for the next query, enabling a multi-round dialogue between the user and the query system.

[0038] In this embodiment, the initial intent of the current query is obtained based on the LLM, and the target intent of the current query is determined based on this initial intent and inherited intents. This eliminates the need to train specialized intent recognition models for each domain, thereby improving the versatility of intent recognition. Furthermore, by referencing inherited intents to determine the target intent, intent inheritance can be implemented, improving the accuracy of intent recognition.

[0039] In order to better understand the embodiments of the present disclosure, the application scenarios of the embodiments of the present disclosure are described below.

[0040] As shown in Figure 2, users can interact with the query system through user terminal 201, which can be located on server 202. In the context of government affairs query, the query system can be referred to as a government affairs assistant. The user terminal can be a personal computer (PC), laptop, or mobile device (such as a mobile phone). The server can be a local server or a cloud server, and can be a single server or a server cluster. The user terminal and server can communicate via a wired communication network and / or a wireless communication network.

[0041] The user may send a query statement (query) to the query system through the user terminal, and the user may have multiple rounds of dialogue with the query system. Therefore, the query statement may be a query statement of at least one round.

[0042] For the current round of query statements, the intent recognition module of the query system can perform intent recognition on the current round of query statements to determine the target intent of the current round of query statements. Then, the query system can obtain the query results corresponding to the current round of query statements based on the target intent and feedback them to the user.

[0043] In related technologies, a domain-specific intention recognition model trained specifically for the domain can be used for intention recognition, but this model suffers from poor universality.

[0044] In order to improve versatility, this embodiment may use LLM for intent recognition. Since LLM is universal in various fields, performing intent recognition based on LLM can improve versatility.

[0045] In addition, since LLM is universal in various fields, there may be a problem of insufficient accuracy. In order to improve the accuracy of intent recognition, this embodiment can also obtain inherited intent. The intent obtained using LLM can be called the initial intent. For the current round of query statements, its final target intent can be obtained based on the inherited intent and the initial intent.

[0046] As shown in Figure 3, for the current round of query statements, the query system can generate prompt information based on the current round of query statements, and use the preset interface between the LLM to input the prompt information into the LLM; the LLM obtains the initial intent of the current round of query statements based on the prompt information, and feeds it back to the query system through the above interface; in addition, the query system can also obtain the inherited intent of the current round of query statements. Specifically, the query system can record the target intent of each round of query statements, and for the current round of query statements, use the target intent of the previous round of query statements as the inherited intent of the current round of query statements; thereafter, the query system can obtain the target intent of the current round of query statements based on the preset rules, based on the initial intent obtained by the LLM and the recorded inherited intent.

[0047] In combination with the above application scenarios, the present disclosure also provides an LLM-based intent recognition method.

[0048] FIG4 is a schematic diagram of a second embodiment of the present disclosure. This embodiment provides an LLM-based intent recognition method, which includes:

[0049] 401. Get the current round query statement and inheritance information.

[0050] The inheritance information includes the inheritance intent, which is obtained after the intent recognition of the previous round of query statements. That is, the target intent of the previous round of query statements can be used as the inheritance intent of the current round of query statements.

[0051] In addition, the inheritance information may also include: an inherited named entity.

[0052] A named entity refers to an entity identified by a name, such as a person's name, an organization's name, a place's name, or a time.

[0053] For a specific scenario, you can pre-configure the named entities that need to be identified in that scenario. For example, in a government affairs scenario, a named entity could be the place name of the agency, such as YY District, City X.

[0054] For each round of query statements, named entity recognition may be performed on the query statements to obtain the named entities of the query statements.

[0055] Inherited named entities refer to those obtained after performing named entity recognition on the previous round of query statements.

[0056] The above inherited intent can be empty or not empty, and the inherited named entity can also be empty or not empty.

[0057] Since inheritance information (including inheritance intent and inherited named entities) is obtained based on the previous query of the current round, in some cases, such as when the current query is the first query of the entire conversation, there is no previous query for the current query (i.e., the first query). In this case, the inheritance information is empty. For another example, inherited named entities are obtained by performing named entity recognition on the previous query. If the named entity to be recognized does not exist in the previous query (such as a place name), the inherited named entity is also empty.

[0058] Whether the inheritance information is empty will affect the subsequent target intent determination process. For example, the target intent is determined based on the initial intent and the inherited intent. If the inherited intent is empty, the initial intent can be used as the target intent; or, if the inherited intent is not empty, in some cases, the inherited intent can be used as the target intent, or, in other cases, the initial intent can be used as the target intent. The specific determination process can be found in the subsequent related description.

[0059] 402. Generate LLM prompt information based on the current round query statement, and use the LLM to determine the initial intention of the current round query statement based on the prompt information.

[0060] Among them, the candidate intents associated with the current round query statement can be obtained in the preset intent library; and the LLM prompt information is generated based on the preset generation template, the candidate intents and the current round query statement.

[0061] In this embodiment, candidate intents associated with the current round of query statements are obtained, and prompt information is generated based on the candidate intents. This can improve the relevance of the prompt information to the current round of query statements and improve processing accuracy and efficiency.

[0062] Among them, multiple intents can be pre-established in the intent library, which may specifically include the name and / or summary text of each intent. After obtaining the current round query statement, the intent associated with the current round query statement can be obtained from multiple intents as candidate intents based on keyword matching or semantic matching. For example, the semantic similarity between the current round query statement and the name and / or summary text of each intent is calculated, and the intent with a semantic similarity greater than a preset value is selected as a candidate intent.

[0063] A preset generation template is used to describe how prompt information is generated. LLM prompt information is generated based on this preset generation template. Different preset generation templates can be configured for different fields or projects.

[0064] LLM prompts can be dynamically generated based on the preset generation template, candidate intents, and the current round of query statements.

[0065] The prompt example is as follows:

[0066] You are an intent classifier that classifies the policy content of the user input query. The policy intent categories and corresponding policy contents are as follows:

[0067] 1. Apply for withdrawal of housing provident fund

[0068] 2. Confirm the qualifications for operating chartered or overtime buses during specific periods of time

[0069] 3. Annual inspection of road passenger vehicles

[0070] 4. Tourist Passenger Vehicle Pass

[0071] In addition, when the user input query is not related to the above specific policy intents, the following intentions may be involved:

[0072] 5. Others

[0073] 6. Policy Operation Content

[0074] 7. Small talk

[0075] [For example] The user enters the query: I rent a house and withdraw my provident fund. Can I do it offline?

[0076] Output: ```json{"intention":"Apply for housing provident fund withdrawal for renting a house","reason":"The user mentioned renting a house and wanted to withdraw the provident fund, so the intention meets the "apply for housing provident fund withdrawal for renting a house" item; the user asked if it can be handled offline, so the action meets the "handling method" category"}```

[0077] [For example] The user enters the query: How to apply for an ID card?

[0078] Output: ```json{"intention":"Other","reason":"The user asked a non-policy question, and the judgment was "Other""}```

[0079] [For example] The user enters the query: Where is the processing location?

[0080] Output: ```json{"intention":"Policy operation content","reason":"When the user asks about the handling location, handling conditions, required materials, or when the user asks about the content of the materials without mentioning the name of the relevant matter or has vague intentions, it is judged as "policy operation content""}```

[0081] [For example] The user enters the query: What do you think of the trade war?

[0082] Output: ```json{"intention":"Chatting","reason":"When users ask for information unrelated to relevant policies or chat about life and entertainment, it is judged as "chatting""}```

[0083] [Current question] User input query: Hello, I want to drive a passenger bus, what materials do I need to provide?

[0084] Please classify the intent of the query entered by the current user and output a JSON file that conforms to the above example format.

[0085] The intents to be identified in the prompt, such as the intents numbered 1 to 7, are candidate intents; the "user input query" in the prompt is the query statement for the current round; the preset generation template is used to indicate the structure and composition of the prompt, such as using a json structure (a data structure) for output, and the output content consists of the intents and reasons identified by the LLM.

[0086] After generating the prompt, the LLM inputs it into the query. Based on this prompt, the LLM identifies the initial intent of the current query. For example, if the query is "Hello, how do I withdraw my housing provident fund?", the LLM identifies the initial intent as "1. Apply for a housing provident fund withdrawal."

[0087] 403. Determine clarification intentions based on the initial intention, where the number of clarification intentions is less than or equal to a preset number.

[0088] In this embodiment, by acquiring clarification intentions whose number does not exceed a preset number, the effectiveness of clarification intentions can be improved and the efficiency of intention recognition can be improved.

[0089] Specifically, the initial intent may include: the current parent intent. The initial intent obtained by LLM may be one or more. If there is one initial intent, the one initial intent may be used as the current parent intent. Alternatively, if there are multiple initial intents, one of the initial intents may be used as the current parent intent, and the remaining initial intents may be used as alternative intents. Specifically, LLM may also determine the confidence level of each initial intent, and use the initial intent with the highest confidence level as the current parent intent, with the remaining initial intents being used as alternative intents.

[0090] The query system can pre-record some intents, which can be recorded in a hierarchical format. The higher-level intent is called the parent intent, and the intents under the parent intent are called child intents. For example, the parent intent "Apply for Housing Provident Fund Withdrawal" has corresponding child intents such as "Apply for Housing Provident Fund Withdrawal for Buying a House" and "Apply for Housing Provident Fund Withdrawal for Renting a House."

[0091] The parent intent and child intent recorded in the query system can be called preconfigured parent intent and preconfigured child intent.

[0092] Based on the correspondence between the preconfigured parent intent and the preconfigured child intent, a current child intent corresponding to the current parent intent included in the initial intent may be obtained.

[0093] For example, the pre-configured parent intent is "Apply for withdrawal of housing provident fund", and the corresponding pre-configured sub-intents include "Apply for withdrawal of housing provident fund for buying a house" and "Apply for withdrawal of housing provident fund for renting a house". Assuming that the current parent intent is "Apply for withdrawal of housing provident fund", the current sub-intents include: "Apply for withdrawal of housing provident fund for buying a house" and "Apply for withdrawal of housing provident fund for renting a house".

[0094] The preset number is usually 1. Since the current sub-intention number is 2, which is greater than 1, a clarification operation is required to obtain 1 clarification intent. For example, after the clarification operation, the clarification intent can be "Apply for housing provident fund withdrawal for house purchase."

[0095] If the number of current sub-intents does not exceed the preset number, for example, if the current sub-intent is 1, the current sub-intent can be used as a clarification intent. Alternatively, if the current parent-child graph does not exist in the correspondence between the preconfigured parent intent and the preconfigured sub-intent, the current parent intent is used as a clarification intent.

[0096] In this embodiment, when the number of current sub-intentions is greater than the preset number, the clarification intention is obtained based on the current sub-intention, which can realize the intention clarification function, and then when the target intention is determined based on the clarification intention, the accuracy of the target intention can be improved.

[0097] In some embodiments, if the current sub-intent does not contain a named entity, an intent clarification operation is performed based on a preset first configuration file to obtain the clarified intent.

[0098] For example, if the named entity is a place name and the two current sub-intents mentioned above do not contain a place name, the intent clarification operation can be performed using the preset first configuration file. The first configuration file can be configured with an intent clarification script template, and an intent clarification script is generated based on the intent clarification script. A dialogue interaction is conducted with the user based on the intent clarification script to obtain the clarification intent.

[0099] In some embodiments, if the current sub-intent includes a named entity, the target named entity corresponding to the current round query statement is obtained, and the current sub-intent including the target named entity is used as the clarification intent.

[0100] For example, if the named entity is a place name, and the current sub-intent includes "XX policy in District A" and "XX policy in District B," where District A and District B are place names, then the target named entity corresponding to the current query statement can be obtained, and the current sub-intent containing the target named entity can be used as the clarification intent. For example, if the target named entity is District A, the clarification intent is "XX policy in District A."

[0101] In this embodiment, based on whether the current sub-intent contains a named entity, different methods are used to obtain the clarification intent, which can improve processing flexibility and accuracy.

[0102] Furthermore, the target named entity can be obtained by using at least one of the following items:

[0103] Performing named entity recognition on the current round query statement to obtain the target named entity;

[0104] The inheritance information also includes: an inheritance named entity, and taking the inheritance named entity as the target named entity;

[0105] A named entity clarification operation is performed based on a preset second configuration file to obtain the target named entity.

[0106] Among them, with respect to obtaining the target named entity through named entity recognition: specifically, after obtaining the current round query statement, named entity recognition can be performed on the current round query statement to obtain the target named entity. For example, taking the case where the named entity to be identified is a place name, a lexical analysis (Lexical Analysis of Chinese, LAC) model can be used to extract the place name as the target named entity. The LAC model is a lexical analysis model used for tasks such as Chinese word segmentation, part-of-speech tagging, and named entity recognition. Specifically, for example, if the current round query statement is "XX District YY Policy", then through named entity recognition, it can be obtained that the target named entity is "XX District". In this way, by performing named entity recognition on the current round query statement, the target named entity can be obtained.

[0107] Regarding obtaining a target named entity based on inheritance information: Specifically, as shown in 401, the inheritance information may also include an inherited named entity, and the inherited named entity can be obtained from the inheritance information as the target named entity. For example, when obtaining the current query statement, inherited naming information (such as XX District) is also obtained. In this way, the inherited naming information "XX District" can be used as the target named entity. In this way, the target named entity can be obtained through the inherited named entity.

[0108] Obtaining the target named entity for a named entity clarification operation: Specifically, if the named entity analysis result of the current query statement is empty and the inherited named entity is also empty, a dialog interaction with the user can be conducted through a preset second configuration file to clarify the named entity. For example, by asking the user whether they are inquiring about the policies of District A or District B, the target named entity can be obtained through this process. This can also be achieved through interaction with the user.

[0109] In this embodiment, the target named entity can be obtained through named entity recognition, named entity inheritance, or named entity clarification, which can improve processing flexibility and accuracy.

[0110] 404. Based on the clarification intent and the inheritance intent, determine the target intent of the current round of query statement.

[0111] Wherein, the inheritance intention may be used as the target intention when the following conditions are met; otherwise, the clarification intention may be used as the target intention:

[0112] The initial intention also includes: at least one alternative intention; if the clarifying intention is different from the inherited intention, and the inherited intention belongs to the alternative intention, the inherited intention is used as the target intention; or,

[0113] If the clarification intent does not belong to the preset explicit intent and the inherited intent is not empty, the inherited intent is used as the target intent.

[0114] Among them, the inheritance intent is obtained based on the previous round of query statements. If the inheritance intent belongs to the alternative intent corresponding to the current round of query statements, then, since the inheritance intent is determined based on two rounds of query statements, while the clarification intent is determined only based on the current round of query statements, the inheritance intent is more accurate than the clarification intent. In this case, the inheritance intent is used as the target intent.

[0115] In different scenarios, you can preset the clear intention of the scenario. For example, in the prompt example above, the intentions numbered 1 to 4 are clear intentions, and the intentions coded 5 to 7 are not clear intentions. Assuming that the clarification intention is "other" and the inherited intention is not empty, the inherited intention at this time is more accurate than the clarification intention, so the inherited intention is used as the target intention.

[0116] In other cases, clarifying intention can be used as the target intention.

[0117] In this embodiment, the target intention is determined in the above manner, which can improve accuracy.

[0118] In addition, this embodiment takes the use of LLM for intent recognition as an example. In some embodiments, after obtaining the current round query statement, it can also be determined according to the preset matching rules whether there is a preset intent that matches the keywords in the current round query statement. If so, the preset intent is used as the target intent. When the matching preset intent does not exist, the above-mentioned 402 and subsequent steps are executed.

[0119] FIG5 is a schematic diagram of a third embodiment of the present disclosure. This embodiment provides an LLM-based intention recognition device. The device 500 includes: an acquisition module 501 , a first determination module 502 , and a second determination module 503 .

[0120] The acquisition module 501 is used to obtain the current round query statement and inheritance information; the inheritance information includes inheritance intent, which is obtained after intent recognition of the previous round query statement; the first determination module 502 is used to generate LLM prompt information based on the current round query statement, and use the LLM to determine the initial intent of the current round query statement based on the prompt information; the second determination module 503 is used to determine the target intent of the current round query statement based on the initial intent and the inheritance intent.

[0121] In this embodiment, the initial intent of the current query is obtained based on the LLM, and the target intent of the current query is determined based on this initial intent and inherited intents. This eliminates the need to train specialized intent recognition models for each domain, thereby improving the versatility of intent recognition. Furthermore, by referencing inherited intents to determine the target intent, intent inheritance can be implemented, improving the accuracy of intent recognition.

[0122] In some embodiments, the first determining module 502 is further configured to:

[0123] Obtaining candidate intents associated with the current round of query statements from a preset intent library;

[0124] Generate LLM prompt information based on the preset generation template, the candidate intent and the current round query statement.

[0125] In this embodiment, candidate intents associated with the current round of query statements are obtained, and prompt information is generated based on the candidate intents. This can improve the relevance of the prompt information to the current round of query statements and improve processing accuracy and efficiency.

[0126] In some embodiments, the second determining module 503 is further configured to:

[0127] determining clarification intentions based on the initial intentions, wherein the number of the clarification intentions is less than or equal to a preset number;

[0128] The target intent is determined based on the clarifying intent and the inherited intent.

[0129] In this embodiment, by acquiring clarification intentions whose number does not exceed a preset number, the effectiveness of clarification intentions can be improved and the efficiency of intention recognition can be improved.

[0130] In some embodiments, the initial intent includes: a current parent intent; and the second determination module 503 is further configured to:

[0131] If the correspondence between the preset preconfigured parent intent and the preconfigured child intent does not include the current parent intent, the current parent intent is used as the clarification intent;

[0132] or,

[0133] If the correspondence between the preconfigured parent intent and the preconfigured child intent includes the current parent intent, obtaining the current child intent corresponding to the current parent intent based on the correspondence between the preconfigured parent intent and the preconfigured child intent; and if the number of the current child intents is less than or equal to a preset number, using the current child intent as the clarification intent;

[0134] or,

[0135] If the correspondence between the preconfigured parent intent and the preconfigured child intent includes the current parent intent, the current child intent corresponding to the current parent intent is obtained based on the correspondence between the preconfigured parent intent and the preconfigured child intent; and if the number of the current child intents is greater than the preset number, the current child intent is processed to determine the clarification intent.

[0136] In this embodiment, when the number of current sub-intentions is greater than the preset number, the clarification intention is obtained based on the current sub-intention, which can realize the intention clarification function, and then when the target intention is determined based on the clarification intention, the accuracy of the target intention can be improved.

[0137] In some embodiments, the second determining module 503 is further configured to:

[0138] If the current sub-intent does not contain a named entity, performing an intent clarification operation based on a preset first configuration file to determine the clarification intent; or

[0139] If the current sub-intent contains a named entity, obtain the target named entity corresponding to the current round query statement, and use the current sub-intent containing the target named entity as the clarification intent.

[0140] In this embodiment, based on whether the current sub-intent contains a named entity, different methods are used to obtain the clarification intent, which can improve processing flexibility and accuracy.

[0141] In some embodiments, the second determining module 503 is further configured to:

[0142] Performing named entity recognition on the current round query statement to obtain the target named entity;

[0143] The inheritance information also includes: an inheritance named entity, and taking the inheritance named entity as the target named entity;

[0144] A named entity clarification operation is performed based on a preset second configuration file to obtain the target named entity.

[0145] In this embodiment, the target named entity can be obtained through named entity recognition, named entity inheritance, or named entity clarification, which can improve processing flexibility and accuracy.

[0146] In some embodiments, the second determining module 503 is further configured to:

[0147] When the following conditions are met, the inherited intent is used as the target intent; otherwise, the clarified intent is used as the target intent:

[0148] The initial intention also includes: at least one alternative intention; if the clarifying intention is different from the inherited intention, and the inherited intention belongs to the alternative intention, the inherited intention is used as the target intention; or,

[0149] If the clarification intent does not belong to the preset explicit intent and the inherited intent is not empty, the inherited intent is used as the target intent.

[0150] In this embodiment, the target intention is determined in the above manner, which can improve accuracy.

[0151] It can be understood that in the embodiments of the present disclosure, the same or similar contents in different embodiments can be referenced to each other.

[0152] It can be understood that the terms “first”, “second”, etc. in the embodiments of the present disclosure are only used for distinction and do not indicate the degree of importance, time sequence, etc.

[0153] In the technical solutions disclosed herein, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0154] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium, and a computer program product.

[0155] FIG6 shows a schematic block diagram of an example electronic device 600 that can be used to implement an embodiment of the present disclosure. Electronic device 600 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, servers, blade servers, mainframe computers, and other suitable computers. Electronic device 600 can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0156] As shown in Figure 6, electronic device 600 includes a computing unit 601, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 602 or a computer program loaded from a storage unit 608 into a random access memory (RAM) 603. In RAM 603, various programs and data required for the operation of electronic device 600 can also be stored. Computing unit 601, ROM 602, and RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to bus 604.

[0157] Multiple components in the electronic device 600 are connected to the I / O interface 605, including an input unit 606, such as a keyboard, a mouse, etc.; an output unit 607, such as various types of displays, speakers, etc.; a storage unit 608, such as a magnetic disk, an optical disk, etc.; and a communication unit 609, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 609 allows the electronic device 600 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.

[0158] The computing unit 601 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units that run machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The computing unit 601 performs the various methods and processes described above, such as the LLM-based intent recognition method. For example, in some embodiments, the LLM-based intent recognition method can be implemented as a computer software program that is tangibly contained in a machine-readable medium, such as a storage unit 608. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 600 via the ROM 602 and / or the communication unit 609. When the computer program is loaded into the RAM 603 and executed by the computing unit 601, one or more steps of the LLM-based intent recognition method described above can be performed. Alternatively, in other embodiments, the computing unit 601 may be configured to execute the LLM-based intention recognition method in any other appropriate manner (eg, by means of firmware).

[0159] Various embodiments of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0160] The program code for implementing the methods of the present disclosure can be written in any combination of one or more programming languages. Such program code can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable load balancing device, so that when the program code is executed by the processor or controller, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The program code can be executed entirely on the machine, partially on the machine, as a standalone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0161] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0162] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0163] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), and the Internet.

[0164] A computer system may include a client and a server. The client and server are generally remote from each other and typically interact via a communication network. This client-server relationship is established by computer programs running on the respective computers, establishing a client-server relationship. The server may be a cloud server, also known as a cloud computing server or cloud host, a host product within the cloud computing service ecosystem that addresses the management difficulties and limited scalability of traditional physical hosts and VPS services ("Virtual Private Servers" or simply "VPS"). The server may also be a server in a distributed system or a server integrated with blockchain.

[0165] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved. This is not a limitation herein.

[0166] The above specific embodiments do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure shall be included within the scope of protection of this disclosure.

Claims

1. An LLM-based intent recognition method, comprising: Get the current round query statement and inheritance information; The inheritance information includes inheritance intent, which is obtained after intent recognition is performed on the previous round of query statements; Generate LLM prompt information based on the current round query statement, and use the LLM to determine the initial intention of the current round query statement based on the prompt information; Based on the initial intent and the inherited intent, the target intent of the current round of query statement is determined.

2. The method according to claim 1, wherein: The prompt information for generating the LLM based on the current round query statement includes: In the preset intent library, obtain the candidate intent associated with the current round query statement; Generate LLM prompt information based on the preset generation template, the candidate intent and the current round query statement.

3. The method according to claim 1 or 2, wherein: The determining the target intent of the current round of query statement based on the initial intent and the inherited intent includes: Determine clarification intentions based on the initial intentions, the number of clarification intentions being less than or equal to a preset number; Based on the clarifying intent and the inherited intent, the target intent is determined.

4. The method according to claim 3, wherein: The initial intent includes: the current parent intent; The determining of the clarification intention based on the initial intention comprises: If the correspondence between the preset preconfigured parent intent and the preconfigured child intent does not include the current parent intent, the current parent intent is used as the clarification intent; or, If the correspondence between the preconfigured parent intent and the preconfigured sub-intent includes the current parent intent, then the current sub-intent corresponding to the current parent intent is obtained based on the correspondence between the preconfigured parent intent and the preconfigured sub-intent; and if the number of the current sub-intents is less than or equal to a preset number, then the current sub-intent is used as the clarification intent; or, If the correspondence between the preconfigured parent intent and the preconfigured child intent contains the The previous parent intent is obtained based on the correspondence between the preconfigured parent intent and the preconfigured child intents, and if the number of the current child intents is greater than the preset number, the current child intents are processed to determine the clarification intent.

5. The method according to claim 4, wherein: The processing of the current sub-intent to determine the clarification intent includes: If the current sub-intent does not contain a named entity, performing an intent clarification operation based on a preset first configuration file to determine the clarification intent; or If the current sub-intent contains a named entity, obtain the target named entity corresponding to the current round of query statement, and use the current sub-intent containing the target named entity as the clarification intent.

6. The method according to claim 5, wherein: The acquiring of the target named entity corresponding to the current round query statement includes at least one of the following items: Performing named entity recognition on the current round query statement to obtain the target named entity; The inheritance information also includes: an inheritance named entity, taking the inheritance named entity as the target named entity; A named entity clarification operation is performed based on a preset second configuration file to obtain the target named entity.

7. The method according to claim 3, wherein: The determining the target intention based on the clarification intention and the inheritance intention includes: When the following conditions are met, the inherited intent is used as the target intent; otherwise, the clarified intent is used as the target intent: The initial intention also includes: at least one alternative intention; if the clarifying intention is different from the inherited intention, and the inherited intention belongs to the alternative intention, the inherited intention is used as the target intention; or, If the clarification intent does not belong to the preset explicit intent, and the inherited intent is not empty, the inherited intent is used as the target intent.

8. An LLM-based intention recognition device, comprising: The acquisition module is used to obtain the current round query statement and inheritance information; The inheritance information includes inheritance intent, which is obtained after intent recognition is performed on the previous round of query statements; A first determination module, configured to generate LLM prompt information according to the current round query statement, and use the LLM to determine the initial intention of the current round query statement based on the prompt information; The second determination module is used to determine the target intent of the current round of query statements according to the initial intent and the inherited intent.

9. The device according to claim 8, wherein: The first determining module is further configured to: In the preset intent library, obtain the candidate intent associated with the current round query statement; Generate LLM prompt information based on the preset generation template, the candidate intent and the current round query statement.

10. The device according to claim 8 or 9, wherein: The second determining module is further used for: Determine a clarification intent based on the current parent intent of the initial intent, where the number of the clarification intents is less than or equal to a preset number; Based on the clarifying intent and the inherited intent, the target intent is determined.

11. The device according to claim 10, wherein: The initial intent includes: the current parent intent; The second determination module is further used for: If the correspondence between the preset preconfigured parent intent and the preconfigured child intent does not include the current parent intent, the current parent intent is used as the clarification intent; or, If the correspondence between the preconfigured parent intent and the preconfigured sub-intent includes the current parent intent, then the current sub-intent corresponding to the current parent intent is obtained based on the correspondence between the preconfigured parent intent and the preconfigured sub-intent; and if the number of the current sub-intents is less than or equal to a preset number, then the current sub-intent is used as the clarification intent; or, If the correspondence between the preconfigured parent intent and the preconfigured child intent includes the current parent intent, the current child intent corresponding to the current parent intent is obtained based on the correspondence between the preconfigured parent intent and the preconfigured child intent; and if the number of the current child intents is greater than the preset number, the current child intent is processed to determine the clarification intent.

12. The device according to claim 11, wherein The second determining module is further used for: If the current sub-intent does not include a named entity, performing an intent clarification operation based on a preset first configuration file to determine the clarification intent; or, If the current sub-intent contains a named entity, obtain the target named entity corresponding to the current round of query statement, and use the current sub-intent containing the target named entity as the clarification intent.

13. The device according to claim 12, wherein: The second determining module is further used for: Performing named entity recognition on the current round query statement to obtain the target named entity; The inheritance information also includes: an inheritance named entity, taking the inheritance named entity as the target named entity; A named entity clarification operation is performed based on a preset second configuration file to obtain the target named entity.

14. The device according to claim 10, wherein: The second determining module is further used for: When the following conditions are met, the inherited intent is used as the target intent; otherwise, the clarified intent is used as the target intent: The initial intention also includes: at least one alternative intention; if the clarifying intention is different from the inherited intention, and the inherited intention belongs to the alternative intention, the inherited intention is used as the target intention; or, If the clarification intent does not belong to the preset explicit intent, and the inherited intent is not empty, the inherited intent is used as the target intent.

15. An electronic device, comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 7.

16. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-7.

17. A computer program product, comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Medical field multi-round dialogue intelligent question and answer method and device and computer equipment

    CN112256825A

  • Multi-round dialogue method and system for intelligent interaction, storage medium and computer equipment

    CN113948086A

  • Multi-round dialogue intention recognition method and device, equipment, medium and program product

    CN116955525A

  • User intention recognition method, reply generation method, and server

    CN117034958A

  • LLM-based intention recognition method, apparatus and device, and storage medium

    CN117932013A