Intention recognition method and device
By combining multi-path query with small and large model intent recognition methods, the stability and adaptability issues of intent recognition in open business scenarios are solved, achieving more efficient and accurate intent recognition and expanding the application scope of question answering systems.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2026-03-31
AI Technical Summary
Existing intent recognition methods suffer from problems such as a single recognition path, unstable results, and poor adaptability in open business scenarios, making it difficult to accurately identify complex and diverse user query intents.
A multi-path query approach is adopted, combining small and large models for intent recognition. The small model first identifies known types, leveraging its stability and accuracy, while the large model then identifies unknown types. The recognition module is updated through an adaptive training module to adapt to scene changes.
It improves the accuracy and efficiency of the question-answering system, expands application scenarios, reduces recognition time, enhances adaptability, and reduces update lag.
Smart Images

Figure CN121765037A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of information retrieval technology, and in particular to an intent recognition method and apparatus. Background Technology
[0002] Question answering systems (QA) are a type of information retrieval system that uses accurate and concise natural language to answer user questions posed in natural language. The rise of QA research is primarily driven by the need for quick and accurate information retrieval. QA systems represent a highly promising and closely watched research area within artificial intelligence and natural language processing.
[0003] Retrieval augmented generation (RAG) is an artificial intelligence technique that combines information retrieval technology with language generation models. This technique enhances the ability of large language models (LLMs) to handle knowledge-intensive tasks such as question answering, text summarization, and content generation by retrieving relevant information from external knowledge bases and feeding it as prompts.
[0004] like Figure 1 As shown, user intent recognition technology is the core foundation of the RAG system. For each user query, the system first identifies the user's query intent, then retrieves and rearranges the identified intent from the knowledge base, and finally inputs the rearranged structure into a Large Language Model (LLM), which outputs the answer provided to the user.
[0005] In open business scenarios such as network operations and maintenance, service experience consulting and system integration (SEC), user queries are characterized by complex and diverse query types and dynamic changes in query scenarios. How to accurately identify the user's query intent is the key to the problem system. Summary of the Invention
[0006] This application provides an intent recognition method and apparatus to improve the accuracy of intent recognition and increase its wide applicability.
[0007] In a first aspect, embodiments of this application provide an intent recognition method, comprising: inputting a first user query into a first recognition module, wherein the first recognition module is a small model recognition module for recognizing whether the target intent of the user query belongs to a preset type; if the first recognition module recognizes the first target intent of the first user query, outputting the first target intent as a result; if the first recognition module fails to recognize the first target intent of the first user query, inputting the first user query into a second recognition module, wherein the second recognition module is a large model recognition module for determining the type to which the target intent of the user query belongs; and outputting the second target intent of the first user query recognized by the second recognition module as a result.
[0008] The intent recognition method provided in this application employs a multi-path query approach. First, a small model is used to recognize the intent of the input user query, identifying whether the query belongs to a preset type. This leverages the advantage of the small model's stable and accurate recognition of known types. If the small model fails to recognize the intent, a large model is used to continue recognizing the intent of the input user query, utilizing the large model's ability to recognize unknown types. This allows the intent recognition method to cover various business scenarios, accurately recognizing both known and unknown types, thereby improving the reliability of the question-and-answer system and expanding its application scenarios. Furthermore, if the target intent can be recognized through the small model, it is not necessary to use the large model for recognition for every user query, which helps reduce the time spent on the recognition process and improves the efficiency of the question-and-answer system.
[0009] In one possible implementation, the method further includes: if the first recognition module can identify the first target intent of the first user query, inputting the first user query and the first target intent into a model training module, wherein the model training module retrains the first recognition module based on the first user query and the first target intent. Retraining the first recognition module based on the first user query and the first target intent helps improve the accuracy of the first recognition module's recognition, increases the ways in which preset types can be expressed in different languages, thereby improving the recognition performance of the first recognition module.
[0010] In one possible implementation, the model training module retrains the first recognition module based on the first user query and the first target intent. This includes: when the number of target intents identified by the first recognition module reaches a first preset number, retraining the first recognition module based on the first preset number of target intents and the user query corresponding to each target intent. If the amount of training data is insufficient, the retraining result may not meet expectations. Conversely, the more training data used, the better the retraining result matches expectations, and the higher the recognition performance of the updated first recognition module. However, excessive training data means a longer waiting time to collect sufficient data, potentially preventing the first recognition module from being updated for an extended period, resulting in greater update lag. Therefore, setting a reasonable first preset number can reduce poor retraining performance and prevent the first recognition module from being unable to be updated for an extended period.
[0011] In one possible implementation, the method further includes: if the second recognition module identifies a second target intent of the first user query, inputting the first user query and the second target intent into a model training module, wherein the model training module retrains the first recognition module based on the first user query and the second target intent. By retraining the first recognition module based on the user query and target intent identified by the second recognition module, the model training module can increase the ways in which preset types are expressed in different languages, and also increase the types of preset types that the first recognition module can recognize, thereby improving the recognition performance of the first recognition module.
[0012] In one possible implementation, the model training module retrains the first recognition module based on the first user query and the first target intent. This includes: when the number of target intents identified by the second recognition module obtained by the model training module reaches a second preset number, retraining the first recognition module based on the second preset number of target intents and the user query corresponding to each target intent. If the amount of training data is insufficient, the retraining result may not meet expectations. Conversely, the more training data used, the better the retraining result matches expectations, and the higher the recognition performance of the updated first recognition module. However, excessive training data means a longer waiting time to collect sufficient data, potentially preventing the first recognition module from being updated for an extended period, resulting in greater update lag. Therefore, setting a reasonable second preset number can reduce poor retraining performance and prevent the first recognition module from being unable to be updated for an extended period.
[0013] In one possible implementation, the result output by the first identification module includes: the confidence level of the first user query corresponding to each of the preset types; the step of outputting the first target intent as a result if the first identification module identifies the first target intent of the first user query includes: if the first confidence level of the first user query corresponding to the first preset type is the highest, and the first confidence level is greater than or equal to the first preset threshold, then the first preset type is taken as the first target intent, and the first target intent is output as a result; or the first target intent and the first confidence level are output as a result. A higher confidence level indicates a higher degree of matching between the first user query and the preset type, and vice versa. Therefore, the first user query can be judged to belong to a preset type based on the confidence level of the first user query corresponding to each preset type. Outputting the confidence level allows for determining the degree of matching between the first user query and the first target intent if the first target intent is determined.
[0014] In one possible implementation, the step of the first identification module identifying the first target intent of the first user query includes: if the first identification module identifies that the confidence level of each preset type corresponding to the first user query is less than or equal to a second preset threshold, then it is determined that the first identification module has failed to identify the first target intent of the first user query. A higher confidence level indicates a higher degree of matching between the first user query and the preset type; conversely, a lower confidence level indicates a lower degree of matching. Therefore, the first user query can be judged to belong to a preset type based on the confidence level of each preset type corresponding to the first user query.
[0015] In one possible implementation, before inputting the first user query into the first identification module, the method further includes: inputting the first user query into a third identification module, wherein the third identification module is an identification module for identifying whether the user query is a preset question; if the third identification module identifies that the first user query does not belong to the preset question, the first user query is input into the first identification module. The third identification module can identify frequently asked questions, thus it can reliably and accurately identify known questions with a short identification time. Furthermore, the answers to frequently asked questions are usually cached or stored and can be quickly retrieved without needing to perform intent recognition, information retrieval, or answer generation steps. Therefore, using the third identification module first helps reduce the identification time, and the first identification module is used only when the third identification module cannot identify the question, to ensure identification reliability.
[0016] In one possible implementation, the method further includes: if the third identification module identifies that the first user query belongs to the first question in the preset questions; obtaining the answer corresponding to the first question; and outputting the answer corresponding to the first question as a result. If the third identification module identifies that the first user query belongs to the first question, then there is no need to identify the intent of the first user query; the answer to the first question can be read and output directly, which helps to improve the efficiency of the question-and-answer system.
[0017] In one possible implementation, the method further includes: if the third identification module identifies that the first user query belongs to the first question among the preset questions, inputting the first user query and the first question into the model training module, and the model training module retraining the third identification module based on the first user query and the first question. Retraining the third identification module based on the first user query and the first question helps improve the accuracy of the third identification module's identification, increases the number of ways the preset questions can be expressed in different languages, and thus improves the identification performance of the third identification module.
[0018] In one possible implementation, the model training module retrains the third recognition module based on the first user query and the first question. This includes: when the number of preset questions identified by the third recognition module reaches a third preset number, the model training module retrains the third recognition module based on the third preset number of preset questions and the user query corresponding to each preset question. If the amount of training data is small, the retraining result may not meet expectations. Conversely, the more training data, the better the retraining result matches expectations, and the higher the recognition performance of the updated third recognition module. However, too much training data means a longer waiting time to collect sufficient data, potentially preventing the third recognition module from being updated for an extended period, resulting in greater update lag. Therefore, setting a reasonable third preset number can reduce poor retraining performance and prevent the third recognition module from being unable to be updated for a long time.
[0019] In one possible implementation, the step of the third identification module identifying that the first user query does not belong to the preset questions includes: if the third identification module identifies that the confidence level of each preset question corresponding to the first user query is less than or equal to a third preset threshold, then it is determined that the third identification module has identified that the first user query does not belong to the preset questions. A higher confidence level indicates a higher degree of matching between the first user query and the preset questions, and vice versa. Therefore, whether the first user query belongs to a preset question can be determined based on the confidence level of each preset question corresponding to the first user query.
[0020] In one possible implementation, the method further includes: pre-configuring at least one preset type for the first identification module, so that the first identification module can identify whether a user query belongs to the at least one preset type.
[0021] In one possible implementation, the preset type includes one or any combination of the following types: detail query, summary query, comparison query, and process query.
[0022] Secondly, embodiments of this application provide an intent recognition device. This communication device has the functions to implement the first aspect described above. For example, the intent recognition device includes modules, units, or means corresponding to the operations involved in the first aspect. These modules, units, or means can be implemented by software, hardware, or a combination of software and hardware.
[0023] Thirdly, this application provides a computer device, the computer device including a memory, a processor and a communication interface; the memory stores a computer program; the processor is used to call the computer program stored in the memory and execute the method as described in the first aspect and any implementation thereof through the communication interface.
[0024] Fourthly, embodiments of this application provide a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the method as described in the first aspect and any implementation thereof.
[0025] Fifthly, embodiments of this application provide a computer program product containing instructions that, when run on a computer, cause the methods described in the first aspect and any implementation thereof to be executed.
[0026] In a sixth aspect, embodiments of this application provide a chip, including: a processor coupled to a memory for storing instructions, wherein when the instructions are executed by the processor, the chip causes the chip to implement the method described in the first aspect and any of its implementations.
[0027] For the technical effects that can be achieved by any possible implementation of any of the second to sixth aspects mentioned above, please refer to the description of the technical effects that can be achieved by the corresponding implementation scheme in the first aspect mentioned above. Repeated parts will not be discussed. Attached Figure Description
[0028] Figure 1 A schematic diagram of a RAG system provided in an embodiment of this application;
[0029] Figure 2(a) is a schematic diagram of a small model provided in an embodiment of this application;
[0030] Figure 2(b) is a schematic diagram of a large model provided in an embodiment of this application;
[0031] Figure 3 A schematic diagram of a question-and-answer system provided in an embodiment of this application;
[0032] Figure 4 A schematic diagram of a system logic architecture provided for an embodiment of this application;
[0033] Figure 5 A flowchart illustrating an intent recognition method provided in an embodiment of this application;
[0034] Figure 6 A flowchart illustrating another intent recognition method provided in an embodiment of this application;
[0035] Figure 7 A flowchart illustrating another intent recognition method provided in an embodiment of this application;
[0036] Figure 8 A flowchart illustrating another intent recognition method provided in an embodiment of this application;
[0037] Figure 9 This is a schematic diagram of the structure of the intent recognition device provided in the embodiments of this application;
[0038] Figure 10 A schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation
[0039] With the rapid development of the internet, people are placing increasingly higher demands on automated information retrieval systems such as search engines and chatbots. In these systems, query intent recognition plays a crucial role. Intent recognition refers to automatically determining a user's needs and intent by analyzing their input query, thereby improving information retrieval and answering user questions. However, due to the complexity and diversity of language itself, as well as the uncertainty of user intent, query intent recognition remains a challenging problem.
[0040] Especially when question-and-answer systems are applied to open business scenarios such as network operations and maintenance, service experience consulting, and system integration, user queries exhibit the following characteristics:
[0041] 1) The query types are complex and diverse: The questions used for querying include not only simple questions that can be answered by a single document, but also difficult questions that require multiple documents to answer, complex questions involving logical reasoning, etc.
[0042] 2) Query scenarios are dynamic: The intent used for querying is complex and varied, the knowledge domains targeted by the query are wide-ranging, and the types of documents to be retrieved are varied and complex in structure, covering text, images, table data, etc.
[0043] However, existing intent recognition methods are usually designed for specific scenarios and types. When faced with adjustments and changes in intent recognition presentation in open scenarios, there are often problems such as unstable output types and inaccurate recognition results, which significantly affect the final question-answering effect of the question-answering system.
[0044] Because most existing intent recognition methods use a single model, even when recognizing complex user query intents, the constructed recognition path is relatively simple. Figures 2(a) and 2(b) show the schemes of recognizing user intent using a small model alone and recognizing user intent using a large model alone, respectively.
[0045] A scheme for small-scale model-based user intent recognition can include: First, collecting and labeling user queries from defined business scenarios, assigning an intent category label to each user query (e.g., a user query: "How many work orders have been reported today?", labeled as "detailed query"), and constructing a training dataset. Then, using the training dataset, a small-scale intent recognition model is trained. In application, the user query is input into the intent recognition model, which then identifies the intent used for the query.
[0046] A large-scale model approach to identifying user intent can include: First, determining the type of user query intent, such as: detailed query, summary query, common sense query, comparison query, causal query, predictive query, etc. Then, inputting the user query tagged with the intent type into the existing large-scale model. For example, a user query like, "How much has the number of work orders reported today increased compared to yesterday?" corresponds to the intent category of "comparison query." The large-scale model can then perform semantic analysis based on the input user query and its corresponding intent type. This allows it to reason about new user queries from a semantic perspective, determine which query type they are similar to, and then output the intent category. Large-scale models can typically identify intent types that smaller models cannot.
[0047] However, current intent recognition methods (regardless of whether they use small or large intent recognition models) suffer from a single recognition path: existing intent recognition schemes use a single model (small or large), constructing a single recognition path. This single-path limitation prevents the integration of the advantages of different models, restricts recognition results, and makes it difficult to stably and accurately recognize complex queries in open scenarios. For example, a single small model path has poor ability to recognize unknown types of intent, but can effectively recognize known preset categories. A single large model path not only has high computational time and the output results may vary each time, resulting in unstable recognition results, but it can better understand the corresponding semantics and purpose for unknown categories of intent.
[0048] In view of this, embodiments of this application provide an intent recognition method for realizing multi-path intent recognition, leveraging the advantages of different models to improve the accuracy, stability, and diversity of question-answering systems.
[0049] The intent recognition method provided in this application can be applied to question-and-answer systems. Figure 3 This is a schematic diagram of a possible question-answering system architecture applicable to embodiments of this application. For example... Figure 3 As shown, the question-and-answer system architecture may include server 101 and one or more user-side client devices (e.g., ...). Figure 3 (See client devices 1021, 1022, 1023, and 1024).
[0050] The user-side client device or the human customer service-side client device can be a terminal device, such as a mobile phone, tablet, or desktop computer, without specific limitations. The user-side client device can be used to obtain user-input queries and send them to the server. For example, if the user enters text information in the client's dialog box, the user-side client device can obtain the text information and send it to the server; if the user enters voice information in the dialog box, the user-side client device can use voice recognition technology to convert the voice into text information and then send the text information to the server. Alternatively, the client device can also send voice information to the server for voice recognition.
[0051] The server can be used to handle various calculations, recognition, and retrieval required by the question-answering system, such as intent recognition, question-answer matching, information retrieval, and answer generation for queries. After generating the answer, the server can send the answer information back to the user's client device, which then presents it to the user. There may be various ways to present it, and no specific limitation is made.
[0052] Figure 4Another exemplary system logic architecture applicable to embodiments of this application is provided, such as... Figure 4 As shown, this system architecture can be applied to an intent recognition device executing embodiments of this application. The system architecture may include a multi-path intent recognition module, and further, an adaptive recognition module. The multi-path intent recognition module may include a first recognition module and a second recognition module for recognizing the user's query intent, and further, a third recognition module. The data recognized by the multi-path intent recognition module can also be input into the adaptive recognition module for retraining the first and / or third recognition modules to adapt to new types and use cases in changing scenarios. This system architecture can be applied to RAG question-answering systems in network operation and maintenance and network optimization scenarios for intent recognition, enabling the RAG system to select appropriate processing flows based on different intents, thereby improving the accuracy of question-answering in network operation and maintenance scenarios.
[0053] Figure 5 An exemplary flowchart of an intent recognition method provided in this application embodiment is provided. This intent recognition method can be executed by an intent recognition device, which can be deployed independently or in conjunction with other devices. For example, the intent recognition device can be deployed together with other devices in a question-and-answer system. Figure 3 On the server shown, or deployed on Figure 3 A virtual module on the client device; or the intent recognition device may also have such Figure 4 The system architecture shown.
[0054] like Figure 5 As shown, the intent recognition method may include the following steps:
[0055] Step 501: Input the first user query into the first recognition module, wherein the first recognition module is a small model recognition module used to identify whether the target intent of the user query belongs to a preset type.
[0056] The aforementioned first identification module is a small-model identification module. This module matches the first user query with preset intent types. If a preset intent type matches the first user query, the first target intent of the first user query is determined to belong to that preset intent type. If no match is found between the first user query and any preset intent type, then the small-model identification module is considered to have failed to identify the target intent of the first user query.
[0057] Optionally, at least one preset type can be pre-configured for the first identification module. For example, the first identification module can be trained based on multiple user query data labeled as preset type A and multiple user query data labeled as preset type B, so that the first identification module can identify whether the user query belongs to preset type A or preset type B.
[0058] The small model recognition module can stably and accurately identify known types, and its recognition time is relatively shorter than that of the large model recognition module. Therefore, inputting the first user query into the small model recognition module for intent recognition is beneficial for quickly and accurately obtaining the target intent.
[0059] Optionally, the above preset types may include one or any combination of the following types:
[0060] Detailed queries enable the question-and-answer system to retrieve the specific types of information the user needs from a large database. For example, a user query might be: "What specific products are included in the work orders reported this week, and how many work orders are there for each product?" This user query requires a summary of details such as the type and quantity of work orders for this week, and therefore can be considered a detailed query.
[0061] Summary queries enable the question-and-answer system to retrieve the information needed by the user from the database and summarize the retrieved information. For example, if a user queries, "What are the characteristics of project XX?", the user needs to retrieve information about project XX and summarize the retrieved information.
[0062] Comparative queries allow the question-and-answer system to retrieve information about A and B from a database and compare the information of A with that of B. For example, a user query might be: "How much has the number of work orders reported today increased compared to yesterday?" This query requires retrieving the number of work orders for today and yesterday, and then comparing the two numbers.
[0063] Flow-based queries enable the question-and-answer system to retrieve the flow of a user's query event from the database. For example, a user query might be: "What are the execution flow components of project XX?" This user query requires retrieving flow information for project XX.
[0064] Step 502a: If the first identification module identifies the first target intent of the first user's query, the first target intent is output as the result.
[0065] Optionally, when identifying the first user query, the first identification module can identify the confidence level of each preset type corresponding to the first user query. For example, the first identification module identifies: the confidence level of the first user query as intent type A is δ1, the confidence level of the first user query as intent type B is δ2, the confidence level of the first user query as intent type C is δ3, the confidence level of the first user query as intent type D is δ4, ...
[0066] In this scenario, if the first identification module identifies the first query as having the highest confidence level for the first preset type, and the confidence level for the first preset type (i.e., the first confidence level) is greater than or equal to the first preset threshold, then the first preset type can be used as the first target intent of the first user's query. That is, the first identification module identifies the first target intent of the first user's query as the first preset type. For the intent recognition process, the first target intent can be output as the result, or the first target intent and the first confidence level can be output as the result. Furthermore, this result can be input into the device of the next process after intent recognition in the question-and-answer process.
[0067] For example, the confidence level for the first user query as intent type A is 0.1, the confidence level for the first user query as intent type B is 0.08, the confidence level for the first user query as intent type C is 0.93, and the confidence level for the first user query as intent type D is 0.21, while the first preset threshold is 0.8. It is clear that the highest confidence level of 0.93 is greater than the first preset threshold, therefore intent type C is taken as the first target intent of the first user query. The output of the first identification module can then be intent type C, or intent type C and a confidence level of 0.93. Optionally, the first identification module can input intent type C (or intent type C and a confidence level of 0.93) into the retrieval rearrangement device of the question-answering module, so that the retrieval rearrangement device performs retrieval rearrangement operations based on intent type C.
[0068] Step 502b: If the first identification module fails to identify the first target intent of the first user query, the first user query is input into the second identification module, wherein the second identification module is a large model identification module used to determine the type of the target intent of the user query.
[0069] Optionally, if the first identification module identifies that the confidence level of the first user query for each preset type is less than or equal to the second preset threshold, it can be considered that the first user query does not belong to any preset type that the first identification module can identify, and it is determined that the first identification module has failed to identify the first target intent of the first user query. The second preset threshold may be the same as or different from the first preset threshold in the aforementioned embodiments.
[0070] For example, the confidence level of the first user query for intent type A is 0.1, the confidence level of the first user query for intent type B is 0.08, the confidence level of the first user query for intent type C is 0.34, the confidence level of the first user query for intent type D is 0.21, and the second preset threshold is 0.8. It can be seen that the confidence level of the first user query for each preset type is less than 0.8, so the first identification module failed to identify the first target intent of the first user query.
[0071] Because the large model recognition module is time-consuming and the recognition results are unstable, but it can better understand the corresponding semantics and purpose for unknown categories of intent, the second recognition module (i.e., the large model recognition module) is not used to recognize the intent of the user query first. Instead, the second recognition module is used to recognize the target intent of the first user query when the first recognition module fails to recognize the first target intent of the first user query, so as to obtain the first target intent of the first user query.
[0072] The second identification module can identify the target intent of user queries through semantic analysis. Optionally, the types of intents that the second identification module can identify may include those that the first identification module cannot identify, thus supplementing the first identification module and enabling intent identification for user queries in various scenarios. For example, the first identification module can identify detailed queries, summary queries, comparison queries, and process queries, while the second identification module can identify causal queries, predictive queries, and so on.
[0073] In addition, the second recognition module can also recognize some or all of the preset types that the first recognition module can recognize, thereby helping to optimize the first recognition module.
[0074] Step 503: Output the second target intent of the first user query identified by the second identification module as the result.
[0075] After recognizing the second target intent of the first user's query, the second recognition module can output the second target intent, or output the second target intent and its corresponding confidence level. Furthermore, this result can be input into the device that performs the next step in the question-and-answer process after intent recognition.
[0076] The intent recognition method provided in this application employs a multi-path query approach. First, a small model is used to recognize the intent of the input user query, identifying whether the query belongs to a preset type. This leverages the advantage of the small model's stable and accurate recognition of known types. If the small model fails to recognize the intent, a large model is used to continue recognizing the intent of the input user query, utilizing the large model's ability to recognize unknown types. This allows the intent recognition method to cover various business scenarios, accurately recognizing both known and unknown types, thereby improving the reliability of the question-and-answer system and expanding its application scenarios. Furthermore, if the target intent can be recognized through the small model, it is not necessary to use the large model for recognition for every user query, which helps reduce the time spent on the recognition process and improves the efficiency of the question-and-answer system.
[0077] Traditional intent recognition methods suffer from problems such as limited recognition paths, poor adaptability, and delayed updates. Current intent recognition methods are mostly designed for specific business scenarios, and often cannot adapt to changes in scenarios or the addition of new intent types, resulting in poor flexibility. Furthermore, they cannot proactively detect changes in scenarios and query types, relying on manual judgment which is inherently lagging.
[0078] To address the aforementioned issues, the intent recognition method provided in this application, based on multi-path recognition, can also adaptively update the recognition module, thereby improving the adaptability of the question-and-answer system, expanding the application scenarios of the question-and-answer system, reducing lag, and minimizing manual operations.
[0079] In one possible design, if the first recognition module can identify the first target intent of the first user's query, the first user query and the first target intent are input into the model training module. The model training module then retrains the first recognition module based on the first user query and the first target intent. This retraining by the model training module improves the accuracy of the first recognition module's identification and increases the number of ways the preset types can be expressed in different languages, thereby increasing the likelihood that the first recognition module can identify the target intent for the query.
[0080] Furthermore, when the model training module retrains, it can wait until the number of user queries and target intents identified by the first recognition module reaches a first preset number before retraining the first recognition module. If the amount of training data is small, the retraining result may not meet expectations. Conversely, the more training data, the better the retraining result matches expectations, and the higher the recognition performance of the updated first recognition module. However, too much training data means a longer waiting time to collect sufficient data, potentially preventing the first recognition module from being updated for an extended period, resulting in greater update lag. Therefore, setting a reasonable first preset number can reduce poor retraining performance and prevent the first recognition module from being unable to update for an extended period. For example, if the first preset number is set to 100, the model training module can retrain the first recognition module based on 100 pairs of user queries and target intents identified by the first recognition module; if the number of user queries and target intents identified by the first recognition module is less than 100, retraining will not be performed.
[0081] Optionally, the first identification module can input the user query and the target intent identified by the first identification module into the model training module after identifying the target intent of each user query. Alternatively, it can input the first preset number of user queries and the target intent identified by the first identification module into the model training module after identifying the target intent of a first preset number of user queries. Figure 1 The same input is fed into the model training module.
[0082] In another possible design, the first user query and the second target intent identified by the second recognition module can also be used for the retraining of the first recognition module.
[0083] For example, due to limited data for training the first recognition module, it may only be able to recognize user queries of type A expressed through language expression mode 1 or language expression mode 2 for the preset type A. However, in actual applications, language expression mode 3 may also be able to express user queries of type A. In this case, the first recognition module may not be able to recognize that the target intent of the user query using language expression mode 3 belongs to the preset type A. However, the second recognition module recognizes that the target intent of the user query using language expression mode 3 belongs to the preset type A. Therefore, the model training module can retrain the first recognition module based on the user query using language expression mode 3 and the preset type A, thereby improving the recognition ability of the first recognition module.
[0084] For example, due to limited data for training the first recognition module, the types of target intent that the first recognition module can identify only include preset types A, B, C, and D. Therefore, for user queries that do not belong to these four preset types, the first recognition module cannot identify their intent. However, the second recognition module identifies the user query's intent as type E. The model training module can then retrain the first recognition module based on the user query and type E, enabling the first recognition module to also identify user queries with target intent of type E. This provides the first recognition module with intent recognition capabilities. Thus, when a user query of type E appears again, the first recognition module can identify its intent without using the time-consuming second recognition model, thereby helping to improve the efficiency of the question-answering system.
[0085] Furthermore, when the model training module retrains, it can wait until the number of user queries and target intentions identified by the second recognition module reaches a second preset number before retraining the first recognition module. For example, if the second preset number is set to 30, the model training module can retrain the first recognition module based on 30 pairs of user queries and target intentions identified by the second recognition module; if the number of user queries and target intentions identified by the second recognition module is less than 30, retraining will not be performed.
[0086] Optionally, the second recognition module can input the user query and the target intent identified by the second recognition module into the model training module after recognizing the target intent of each user query. Alternatively, it can input the second preset number of user queries and the target intent identified by the second recognition module into the model training module after recognizing the target intent of a second preset number of user queries. Figure 1 The same input is fed into the model training module.
[0087] For example, an adaptive intent recognition method can be as follows: Figure 6 As shown, it includes the following steps:
[0088] Step 601: Input the first user query into the first recognition module.
[0089] The first identification module can identify whether the user's query intent belongs to a preset type. Optionally, the preset type may include one or any combination of the following types: detailed query, summary query, comparison query, and process query.
[0090] Optionally, when identifying the first user query, the first identification module can determine the confidence level of each preset type corresponding to the first user query.
[0091] If the first identification module identifies that the first type of query has the highest confidence level and the confidence level of the first type (i.e., the first confidence level) is greater than or equal to the first preset threshold, then the first preset type can be used as the first target intent of the first user query. That is, the first identification module identifies the first target intent of the first user query as the first preset type.
[0092] If the first identification module identifies that the confidence level of each preset type corresponding to the first user query is less than the second preset threshold, it can be considered that the first user query does not belong to any preset type that the first identification module can identify, and it is determined that the first identification module failed to identify the first target intent of the first user query.
[0093] If the first identification module can identify the first target intent of the first user's query, then step 602 is executed; if the first identification module cannot identify the first target intent of the first user's query, then step 606 is executed.
[0094] Step 602: If the first identification module can identify the first target intent of the first user's query, the first target intent will be output as the result.
[0095] For the intent recognition process, the first target intent can be output as the result, or the first target intent and the first confidence level can be output as the result. Furthermore, this result can be input into the device that performs the next step after intent recognition in the question-and-answer process, such as a retrieval and rearrangement device.
[0096] Step 603: Input the first user query and the first target intent into the model training module.
[0097] Step 604: The model training module determines whether the number of user queries and target intents identified by the first recognition module has reached the first preset number.
[0098] The amount of data used for training should not be too little or too much. Setting a reasonable initial preset amount can reduce the number of poorly performing retraining processes and prevent the first recognition module from being unable to be updated for a long time.
[0099] If the number of user queries and target intents identified by the first recognition module obtained by the model training module reaches the first preset number, then step 605 is executed; otherwise, wait for the number of first user queries and first target intents obtained to reach the first preset number before executing step 605.
[0100] Step 605: Retrain the first recognition module based on the first preset number of user queries and target intents.
[0101] Step 606: If the first identification module fails to identify the first target intent of the first user query, the first user query is input into the second identification module.
[0102] The second identification module is a large-scale model identification module used to determine the type of the user's query target intent. Since it can better understand the corresponding semantics and purpose for intents of unknown categories, the first user query that the first identification module cannot identify is input into the second identification module for intent identification, so as to identify the intent of the first user query and obtain the second target intent of the first user query.
[0103] Step 607: Output the second target intent of the first user query identified by the second identification module as the result.
[0104] After recognizing the second target intent of the first user's query, the second recognition module can output the second target intent, or output the second target intent and its corresponding confidence level. Furthermore, this result can be input into the device that performs the next step in the question-and-answer process after intent recognition.
[0105] Step 608: Input the first user query and the second target intent into the model training module.
[0106] Step 609: The model training module determines whether the number of user queries and target intents identified by the second recognition module has reached the second preset number.
[0107] The amount of data used for training should not be too little or too much. Setting a reasonable second preset amount can reduce the retraining process with poor results and prevent the first recognition module from being unable to be updated for a long time.
[0108] If the number of user queries and target intents identified by the second identification module obtained by the model training module reaches the second preset number, then step 610 is executed; otherwise, wait for the number of user queries and target intents identified by the second identification module to reach the second preset number before executing step 610.
[0109] Step 610: Retrain the first recognition module based on the second preset number of user queries and target intents.
[0110] In one possible implementation, before using the small model recognition module (i.e., the first recognition module) to perform intent recognition on the first user query, a third recognition module, namely the preset question recognition module, can be used to recognize whether the first user query belongs to a preset question. If the third recognition module identifies that the first user query belongs to a preset question, then it is not necessary to use the first recognition module to recognize the first user query; if the third recognition module fails to identify that the first user query belongs to a preset question, then the first recognition module is used to recognize the first user query.
[0111] For example, intent recognition methods can also be as follows: Figure 7 As shown, it includes the following steps:
[0112] Step 701: Input the first user query into the third identification module, wherein the third identification module is an identification module used to identify whether the user query is a preset question.
[0113] Optionally, the third identification module can be a frequently asked questions (FAQ) identification module. At least one frequently asked question can be pre-configured for the FAQ identification module. For example, based on multiple user query data labeled as preset question A and multiple user query data labeled as preset question B, the FAQ identification module can be trained to identify whether a user query is a preset question or preset question B.
[0114] The FAQ recognition module can reliably and accurately identify known questions with a short recognition time. The answers to frequently asked questions are usually cached or stored and can be quickly retrieved without having to go through steps such as intent recognition, information retrieval, and answer generation.
[0115] Step 702a: If the third identification module identifies the first user query as the first question in the preset questions, obtain the answer corresponding to the first question, and output the answer corresponding to the first question as the result.
[0116] Optionally, when identifying the first user query, the third identification module can identify the confidence level of each preset question corresponding to the first user query. For example, the third identification module identifies: the confidence level of the first user query as preset question A is δ1, the confidence level of the first user query as preset question B is δ2, the confidence level of the first user query as preset question C is δ3, the confidence level of the first user query as intent type D is δ4, ...
[0117] In this case, if the third identification module identifies that the first user query has the highest confidence level for the first question, and the confidence level for the first question is greater than or equal to the third preset threshold, then the first question can be used as the question that the first user wants to query.
[0118] Optionally, the answers to the preset questions that the third recognition module can recognize can be stored in a cache or memory. If the first user query is identified as the first question among the preset questions, the answer to the first question can be read from the cache or memory, and the third recognition module can directly output the answer to the first question without going through other processes of the question-and-answer system.
[0119] For example, the confidence level for the first user query as preset question A is 0.1, the confidence level for the first user query as preset question B is 0.08, the confidence level for the first user query as preset question C is 0.93, and the confidence level for the first user query as preset question D is 0.21. The third preset threshold is 0.9. Therefore, the highest confidence level of 0.93 is greater than the third preset threshold, so the first user query can be considered to belong to preset question C. The third identification module can then read the answer to preset question C from the cache and output it. In other words, the output of the third identification module can be the answer to preset question C, or the answer to preset question C along with a confidence level of 0.93.
[0120] Step 702b: If the third identification module identifies that the first user query does not belong to the preset question, the first user query is input into the first identification module, wherein the first identification module is a small model identification module used to identify whether the target intent of the user query belongs to the preset type.
[0121] Optionally, if the third identification module identifies that the confidence level of the first user query for each preset question is less than or equal to the third preset threshold, it can be considered that the first user query does not belong to any preset question that the third identification module can identify. For example, the confidence level of the first user query for preset question A is 0.1, the confidence level of the first user query for preset question B is 0.08, the confidence level of the first user query for preset question C is 0.34, the confidence level of the first user query for preset question D is 0.21, and the third preset threshold is 0.9; thus, it can be seen that the confidence level of the first user query for each preset question is less than 0.9, so the third identification module failed to identify that the first user query belongs to a preset question.
[0122] The step of using the first identification module to identify the intent of the first user query is similar to step 401 in the previous embodiment. The advantages of the first identification module can also be referred to in the previous embodiment, and will not be repeated here.
[0123] Step 703a: If the first identification module identifies the first target intent of the first user's query, the first target intent is output as the result.
[0124] Step 703b: If the first identification module fails to identify the first target intent of the first user query, the first user query is input into the second identification module, wherein the second identification module is a large model identification module used to determine the type of the target intent of the user query.
[0125] Step 704: Output the second target intent of the first user query identified by the second identification module as the result.
[0126] Steps 703a, 703b, and 704 are similar to steps 502a, 502b, and 503 in the foregoing embodiments, and can be explained with reference to the foregoing embodiments, and will not be repeated here.
[0127] In one possible design, if the third recognition module can identify that the first user query belongs to the first question, the first user query and the first question can be input into the model training module. The model training module then retrains the third recognition module based on the first user query and the first question. This retraining of the third recognition module by the model training module based on the first user query and the first question helps improve the accuracy of the third recognition module's recognition, and by adding the possibility of expressing the preset question in different languages, it improves the recognition performance of the third recognition module.
[0128] Furthermore, when the model training module retrains, it can wait until the number of user queries and preset questions identified by the third recognition module reaches a third preset number before retraining the third recognition module. The training data should not be too little or too much. Setting a reasonable third preset number can reduce poor retraining processes and prevent the third recognition module from being unable to update for an extended period. For example, if the third preset number is set to 100, the model training module can retrain the third recognition module based on 100 pairs of user queries and preset questions identified by the third recognition module; if the number of user queries and preset questions identified by the third recognition module is less than 100, retraining will not be performed.
[0129] Figure 8 An example is provided of an intent recognition method with three specific recognition paths and adaptive capabilities. For example... Figure 7 As shown, the method may include the following steps:
[0130] Step 801: Input the first user query into the FAQ recognition module.
[0131] The FAQ recognition module can identify whether the first user's query belongs to the preset frequently asked questions.
[0132] Optionally, when identifying the first user query, the third identification module can identify the confidence level of each preset question corresponding to the first user query. If the third identification module identifies that the first user query has the highest confidence level for the first question, and the confidence level for the first question is greater than or equal to a third preset threshold, then the first question can be considered as the question the first user query wants to query. If the third identification module identifies that the confidence level of each preset question corresponding to the first user query is less than or equal to the third preset threshold, then the first user query can be considered not to belong to any preset question that the third identification module can identify.
[0133] If the FAQ identification module can identify the first question to which the first user's query belongs, then proceed to step 802; if the first identification module cannot identify the first question to which the first user's query belongs, then proceed to step 806.
[0134] Step 802: If the FAQ recognition module identifies that the first user's query belongs to the first question in the preset questions, obtain the answer corresponding to the first question, and output the answer corresponding to the first question as the result.
[0135] Optionally, the answer to the first question has been stored in a cache or memory. If it is identified that the first user query belongs to the first question in the preset questions, the answer to the first question can be read from the cache or memory. Then the third identification module can directly output the answer to the first question without going through other processes of the question-and-answer system.
[0136] Step 803: Input the first user query and the first question into the model training module.
[0137] Step 804: The model training module determines whether the number of user queries and preset questions identified by the FAQ identification module has reached the third preset number.
[0138] The amount of data used for training should not be too little or too much. Setting a reasonable number of third presets can reduce the number of poorly performing retraining processes and prevent the third recognition module from being unable to be updated for a long time.
[0139] If the number of user queries and preset questions identified by the FAQ recognition module obtained by the model training module reaches the third preset number, then step 805 is executed; otherwise, wait for the number of user queries and preset questions obtained to reach the third preset number before executing step 505.
[0140] Step 805: Retrain the FAQ recognition module based on the third preset number of user queries and preset questions.
[0141] Step 806: If the FAQ recognition module identifies that the first user query does not belong to the preset question, input the first user query into the small model recognition module.
[0142] The small model recognition module can identify whether the intent of the first user's query belongs to a preset type. Optionally, the preset type may include one or any combination of the following types: detailed query, summary query, comparison query, and process query.
[0143] Optionally, when identifying the first user query, the small model recognition module can determine the confidence level of each preset type corresponding to the first user query. If the small model recognition module identifies that the first preset type corresponding to the query has the highest confidence level, and the confidence level of the first preset type (i.e., the first confidence level) is greater than or equal to the first preset threshold, then the first preset type can be taken as the first target intent of the first user query. If the small model recognition module identifies that the confidence level of each preset type corresponding to the first user query is less than the first preset threshold, it can be considered that the first user query does not belong to any preset type that the small model recognition module can recognize, and it is determined that the small model recognition module has failed to recognize the first target intent of the first user query.
[0144] If the small model recognition module can identify the first target intent of the first user's query, then proceed to step 807; if the small model recognition module cannot identify the first target intent of the first user's query, then proceed to step 811.
[0145] Step 807: If the small model recognition module can identify the first target intent of the first user's query, the first target intent will be output as the result.
[0146] For the intent recognition process, the first target intent can be output as the result, or the first target intent and the first confidence level can be output as the result. Furthermore, this result can be input into the device that performs the next step after intent recognition in the question-and-answer process, such as a retrieval and rearrangement device.
[0147] Step 808: Input the first user query and the first target intent into the model training module.
[0148] Step 809: The model training module determines whether the number of user queries and target intents identified by the small model recognition module has reached the first preset number.
[0149] If the number of user queries and target intents identified by the small model recognition module obtained by the model training module reaches the first preset number, then step 810 is executed; otherwise, wait for the number of first user queries and first target intents obtained to reach the first preset number before executing step 810.
[0150] Step 810: Retrain the small model recognition module based on the first preset number of user queries and target intents.
[0151] Step 811: If the small model recognition module fails to recognize the first target intent of the first user query, input the first user query into the large model recognition module.
[0152] The large model recognition module is used to determine the type of the user's query intent. Since it can better understand the corresponding semantics and purpose for intents of unknown categories, the first user query, which the small model recognition module cannot recognize, is input into the large model recognition module for intent recognition, so as to identify the intent of the first user query and obtain the second target intent of the first user query.
[0153] Step 812: Output the second target intent of the first user query identified by the large model recognition module as the result.
[0154] After identifying the second target intent of the first user's query, the large model recognition module can output the second target intent, or output the second target intent and its corresponding confidence level. Furthermore, this result can be input into the device that performs the next step in the question-and-answer process after intent recognition.
[0155] Step 813: Input the first user query and the second target intent into the model training module.
[0156] Step 814: The model training module determines whether the number of user queries and target intents identified by the large model recognition module has reached the second preset number.
[0157] If the number of user queries and target intents identified by the large model recognition module obtained by the model training module reaches the second preset number, then step 815 is executed; otherwise, wait for the number of user queries and target intents identified by the large model recognition module to reach the second preset number before executing step 815.
[0158] Step 815: Retrain the first recognition module based on the second preset number of user queries and target intents.
[0159] Based on the same technical concept, embodiments of this application also provide an intent recognition device, including modules / units that perform the functions of the intent recognition device in the above method embodiments. This device can be an intent recognition device, a component of an intent recognition device (e.g., a processor, chip, or chip system), or a logic node, logic module, or software capable of implementing all or part of the functions of the intent recognition device. These modules / units can be implemented in hardware or by hardware executing corresponding software.
[0160] For example, the intent recognition device can be as follows: Figure 9As shown, the device includes an interface module 901 and a processing module 902. The interface module 901 is used for message sending and receiving, and the processing module 902 is used to implement the device's processing of messages. It should be understood that the processing module 902 in this embodiment can be implemented by a processor or processor-related circuit components (or, referred to as processing circuitry), and the interface module 901 can be implemented by a communication bus, a transceiver, or transceiver-related circuit components.
[0161] Specifically, the processing module 902 is used to input the first user query into the first identification module, which is a small model identification module used to identify whether the target intent of the user query belongs to a preset type; if the first identification module identifies the first target intent of the first user query, the first target intent is output as a result through the interface module 901; if it is determined that the first identification module fails to identify the first target intent of the first user query, the first user query is input into the second identification module, which is a large model identification module used to determine the type to which the target intent of the user query belongs; the second target intent of the first user query identified by the second identification module is output as a result through the interface module 901.
[0162] In one possible implementation, the processing module 902 is further configured to: if the first identification module can identify the first target intent of the first user query, input the first user query and the first target intent into the model training module, and call the model training module to retrain the first identification module based on the first user query and the first target intent.
[0163] In one possible implementation, when the processing module 902 calls the model training module to retrain the first recognition module based on the first user query and the first target intent, it is specifically used to: when the number of target intents identified by the first recognition module obtained by the model training module reaches a first preset number, retrain the first recognition module based on the first preset number of target intents and the user query corresponding to each target intent.
[0164] In one possible implementation, the processing module 902 is further configured to: if the second identification module identifies the second target intent of the first user query, input the first user query and the second target intent into the model training module, and call the model training module to retrain the first identification module based on the first user query and the second target intent.
[0165] In one possible implementation, when the processing module 902 calls the model training module to retrain the first recognition module based on the first user query and the first target intent, it is specifically used to: when the number of target intents identified by the second recognition module obtained by the model training module reaches a second preset number, retrain the first recognition module based on the second preset number of target intents and the user query corresponding to each target intent.
[0166] In one possible implementation, the result output by the first identification module includes: the confidence level of the first user query corresponding to each of the preset types; if the first identification module identifies the first target intent of the first user query, and the processing module 902 outputs the first target intent as a result through the interface module 901, specifically it is used to: if the first confidence level of the first user query corresponding to the first preset type is the highest, and the first confidence level is greater than or equal to the first preset threshold, the first preset type is taken as the first target intent, and the first target intent is output as a result through the interface module 901, or the first target intent and the first confidence level are output as a result through the interface module 901.
[0167] In one possible implementation, when the processing module 902 determines that the first identification module has failed to identify the first target intent of the first user query, it is specifically configured to: if the first identification module identifies that the confidence level of each preset type corresponding to the first user query is less than or equal to the second preset threshold, then determine that the first identification module has failed to identify the first target intent of the first user query.
[0168] In one possible implementation, before inputting the first user query into the first identification module, the processing module 902 is further configured to: input the first user query into a third identification module, wherein the third identification module is an identification module for identifying whether the user query is a preset question; if it is determined that the third identification module identifies that the first user query does not belong to the preset question, the first user query is input into the first identification module.
[0169] In one possible implementation, the processing module 902 is further configured to: if the third identification module identifies that the first user query belongs to the first question in the preset questions; obtain the answer corresponding to the first question; and output the answer corresponding to the first question as a result through the interface module 901.
[0170] In one possible implementation, the processing module 902 is further configured to: if it is determined that the third identification module identifies the first user query as belonging to the first question in the preset questions, input the first user query and the first question into the model training module, and call the model training module to retrain the third identification module based on the first user query and the first question.
[0171] In one possible implementation, when the processing module 902 calls the model training module to retrain the third identification module based on the first user query and the first question, it is specifically used to: when the number of preset questions identified by the third identification module obtained by the model training module reaches a third preset number, retrain the third identification module based on the third preset number of preset questions and the user query corresponding to each preset question.
[0172] In one possible implementation, when the processing module 902 determines that the third identification module has identified that the first user query does not belong to the preset question, it is specifically used to: if the third identification module has identified that the confidence level of each preset question corresponding to the first user query is less than or equal to the third preset threshold, then determine that the third identification module has identified that the first user query does not belong to the preset question.
[0173] In one possible implementation, the processing module 902 is further configured to: pre-configure at least one preset type for the first identification module, so that the first identification module can identify whether the user query belongs to the at least one preset type.
[0174] In one possible implementation, the preset type includes one or any combination of the following types: detail query, summary query, comparison query, and process query.
[0175] Based on the same technical concept, this application also provides a computer device for implementing the above-described method embodiments. The computer device includes: a processor and a memory coupled to the processor; the processor is configured to execute instructions or programs within the memory to cause the terminal device to perform the method as described in any of the above-described method embodiments.
[0176] The computer device includes, for example: Figure 10 The processor 1001 shown, and the communication interface 1002 connected to the processor 1001.
[0177] The processor 1001 can be a general-purpose processor, a microprocessor, an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or one or more integrated circuits used to control the execution of the program in this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of this application can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules in the processor.
[0178] Communication interface 1002 is used to communicate with other devices, such as PCI bus interface, Ethernet, radio access network (RAN), wireless local area network (WLAN), input / output (I / O) interface, etc.
[0179] In this embodiment of the application, the processor 1001 is used to call the communication interface 1002 to perform the functions of receiving and / or sending, and to perform the method as described in any of the previous possible implementations.
[0180] Furthermore, the computer device may also include a memory 1003 and a communication bus 1004.
[0181] Memory 1003 stores program instructions and / or data so that processor 1001 can call the instructions and / or data stored in memory 1003 to implement the aforementioned functions of processor 1001. Memory 1003 can be read-only memory (ROM) or other types of static storage devices that can store static information and instructions, random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, electrically erasable programmable read-only memory (EEPROM), or any other medium capable of carrying or storing desired program code in the form of instructions or data structures that can be accessed by a computer, but is not limited thereto. Memory 1003 can exist independently, such as off-chip memory, and is connected to processor 1001 via communication bus 1004. Memory 1003 can also be integrated with processor 1001.
[0182] The communication bus 1004 may include a path for transmitting information between the aforementioned components.
[0183] The computer device can communicate with the storage structure via a network, or the computer device may further include a storage structure (not shown in the figure). The storage structure includes one or more memory devices, which may be disks, solid-state disks (SSDs), storage-class memory (SCM), etc., used to store the objects accessed by the access request.
[0184] For example, the processor 1001 can perform the following steps through the communication interface 1002: inputting a first user query into a first identification module, the first identification module being a small model identification module for identifying whether the target intent of the user query belongs to a preset type; if the first identification module identifies the first target intent of the first user query, outputting the first target intent as a result; if the first identification module fails to identify the first target intent of the first user query, inputting the first user query into a second identification module, the second identification module being a large model identification module for determining the type to which the target intent of the user query belongs; and outputting the second target intent of the first user query identified by the second identification module as a result.
[0185] Based on the same technical concept, embodiments of this application also provide a computer-readable storage medium storing computer-readable instructions, which, when executed on a computer, cause the above-described method embodiments to be performed.
[0186] Based on the same technical concept, this application also provides a computer program product containing instructions that, when run on a computer, cause the above-described method embodiments to be executed.
[0187] It should be understood that in the description of this application, terms such as "first" and "second" are used only for distinguishing purposes and should not be construed as indicating or implying relative importance or order. References to "one embodiment" or "some embodiments" in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, phrases such as "in one embodiment," "in some embodiments," "in other embodiments," and "in still other embodiments" appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0188] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0189] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0190] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0191] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0192] Although preferred embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application.
[0193] Obviously, those skilled in the art can make various modifications and variations to the embodiments of this application without departing from the spirit and scope of the embodiments of this application. Therefore, if these modifications and variations to the embodiments of this application fall within the scope of the claims of this application and their equivalents, this application also intends to include these modifications and variations.
Claims
1. An intent recognition method, characterized in that, The method includes: The first user query is input into the first recognition module, which is a small model recognition module used to identify whether the user's query target intent belongs to a preset type. If the first identification module identifies the first target intent of the first user's query, it outputs the first target intent as the result; If the first identification module fails to identify the first target intent of the first user query, the first user query is input into the second identification module, which is a large model identification module used to determine the type of the target intent of the user query. The second target intent of the first user query identified by the second identification module is output as the result.
2. The method according to claim 1, characterized in that, The method further includes: If the first recognition module can identify the first target intent of the first user query, the first user query and the first target intent are input into the model training module, and the model training module retrains the first recognition module based on the first user query and the first target intent.
3. The method according to claim 2, characterized in that, The model training module retrains the first recognition module based on the first user query and the first target intent, including: When the number of target intents identified by the first recognition module obtained by the model training module reaches a first preset number, the first recognition module is retrained based on the first preset number of target intents and the user query corresponding to each target intent.
4. The method according to any one of claims 1-3, characterized in that, The method further includes: If the second identification module identifies the second target intent of the first user query, it inputs the first user query and the second target intent into the model training module, and the model training module retrains the first identification module based on the first user query and the second target intent.
5. The method according to claim 4, characterized in that, The model training module retrains the first recognition module based on the first user query and the first target intent, including: When the number of target intents identified by the second recognition module obtained by the model training module reaches a second preset number, the first recognition module is retrained based on the second preset number of target intents and the user query corresponding to each target intent.
6. The method according to any one of claims 1-5, characterized in that, The results output by the first identification module include: the confidence level of the first user query corresponding to each of the preset types; If the first identification module identifies the first target intent of the first user's query, and outputs the first target intent as a result, the following steps are included: If the first user query has the highest first confidence level for the corresponding first preset type, and the first confidence level is greater than or equal to the first preset threshold, the first preset type is taken as the first target intent, and the first target intent is output as the result, or the first target intent and the first confidence level are output as the result.
7. The method according to any one of claims 1-6, characterized in that, If the first identification module fails to identify the first target intent of the first user's query, it includes: If the first identification module identifies that the confidence level of each preset type corresponding to the first user query is less than or equal to the second preset threshold, then it is determined that the first identification module failed to identify the first target intent of the first user query.
8. The method according to any one of claims 1-7, characterized in that, Before inputting the first user query into the first identification module, the method further includes: The first user query is input into the third identification module, which is an identification module used to identify whether the user query is a preset question; If the third identification module identifies that the first user query does not belong to the preset question, the first user query is input into the first identification module.
9. The method according to claim 8, characterized in that, The method further includes: If the third identification module identifies that the first user query belongs to the first question among the preset questions; Get the answer to the first question; Output the answer to the first question as the result.
10. The method according to claim 9, characterized in that, The method further includes: If the third identification module identifies that the first user query belongs to the first question in the preset questions, the first user query and the first question are input into the model training module, and the model training module retrains the third identification module based on the first user query and the first question.
11. The method according to claim 10, characterized in that, The model training module retrains the third recognition module based on the first user query and the first question, including: When the number of preset questions identified by the third recognition module obtained by the model training module reaches the third preset number, the third recognition module is retrained based on the third preset number of preset questions and the user query corresponding to each preset question.
12. The method according to any one of claims 8-11, characterized in that, If the third identification module identifies that the first user query does not belong to the preset question, it includes: If the third identification module identifies that the confidence level of each preset question corresponding to the first user query is less than or equal to the third preset threshold, then it is determined that the third identification module identifies that the first user query does not belong to the preset question.
13. The method according to any one of claims 1-12, characterized in that, The method further includes: At least one preset type is pre-configured for the first identification module so that the first identification module can identify whether the user query belongs to the at least one preset type.
14. The method according to any one of claims 1-13, characterized in that, The preset types include one or any combination of the following types: detail query, summary query, comparison query, and process query.
15. An intent recognition device, characterized in that, Includes a unit for performing the method as described in any one of claims 1-14.
16. An intent recognition device, characterized in that, include: A processor coupled to a memory for storing a program or instructions which, when executed by the processor, cause the apparatus to perform the method as described in any one of claims 1-14.
17. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores instructions that, when executed on a computer, cause the computer to perform the method as described in any one of claims 1-14.
18. A computer program product containing instructions, characterized in that, When the instructions are executed on a computer, the computer causes the computer to perform the method as described in any one of claims 1-14.