Intention recognition method and device, equipment, medium and product
By using multiple intent recognition modules and combining weights for cross-module scoring, the problem of low intent recognition accuracy in complex user input is solved, and higher intent recognition accuracy is achieved.
Patent Information
- Application Number
- CN202510022169.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-07
- Publication Date
- 2025-04-15
- Estimated Expiration
- 2045-01-07
AI Technical Summary
A single large language model has low accuracy in intent recognition when dealing with diverse and complex user input.
Multiple pre-acquisition intention recognition modules are used to identify the conversation text separately, and cross-module scores are performed in combination with the weight of each module to improve the accuracy of intention recognition.
By integrating the respective advantages of different intention identification modules, the accuracy of intention identification is improved and the processing ability of complex user input is enhanced.
Smart Images

Figure CN119830922A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of artificial intelligence technology, and in particular, relates to an intent recognition method, device, equipment, medium and product. Background Art
[0002] With the rapid development of artificial intelligence technology, natural language processing has been widely used in various fields. In particular, large language models (such as ChatGPT) have shown powerful capabilities in user intent recognition. However, a single large model may have low accuracy in intent recognition when processing diverse and complex user inputs. Summary of the invention
[0003] The embodiments of the present application provide a method, apparatus, device, medium and product for intent recognition, which can improve the accuracy of intent recognition.
[0004] In a first aspect, an embodiment of the present application provides an intent recognition method, the method comprising:
[0005] Get the conversation text;
[0006] Using the pre-acquired multiple intention recognition modules to respectively perform intention recognition on the conversation text, and obtain candidate intentions output by each intention recognition module, wherein each intention recognition module adopts a different intention recognition method;
[0007] The candidate intents output by each of the intent recognition modules are cross-module scored to obtain the target intent of the dialogue text, and the cross-module scoring is used to score each of the candidate intents according to the weight of each of the intent recognition modules.
[0008] In a second aspect, an embodiment of the present application provides an intention recognition device, the device comprising:
[0009] The acquisition module is used to obtain the conversation text;
[0010] A first recognition module, configured to use a plurality of pre-acquired intent recognition modules to respectively perform intent recognition on the conversation text, and obtain candidate intents output by each of the intent recognition modules, wherein each of the intent recognition modules uses a different intent recognition method;
[0011] The second recognition module is used to perform cross-module scoring on the candidate intents output by each of the intent recognition modules to obtain the target intent of the dialogue text, and the cross-module scoring is used to score each of the candidate intents according to the weight of each of the intent recognition modules.
[0012] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor and a memory storing computer program instructions;
[0013] When the processor executes the computer program instructions, the intention recognition method as described in the first aspect is implemented.
[0014] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having computer program instructions stored thereon, and when the computer program instructions are executed by a processor, the intention recognition method as described in the first aspect is implemented.
[0015] In a fifth aspect, an embodiment of the present application provides a computer program product. When instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes the intent recognition method as described in the first aspect.
[0016] In this embodiment, a conversation text is obtained; multiple pre-acquired intent recognition modules are used to perform intent recognition on the conversation text respectively, and candidate intents output by each of the intent recognition modules are obtained, wherein each of the intent recognition modules uses a different intent recognition method; cross-module scoring is performed on the candidate intents output by each of the intent recognition modules to obtain the target intent of the conversation text, and the cross-module scoring is used to score each of the candidate intents according to the weight of each of the intent recognition modules. In the above, by performing intent recognition on the conversation text respectively through multiple intent recognition modules, the advantages of different intent recognition methods can be combined to improve the accuracy of intent recognition. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solution of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0018] Figure 1 It is a flowchart of the intention recognition method provided by the embodiment of the present application;
[0019] Figure 2a is another flowchart of the intent recognition method provided in an embodiment of the present application;
[0020] Figure 2b It is a schematic diagram of the implementation flow of the rule matching module provided in the embodiment of the present application;
[0021] Figure 3 is a schematic diagram of the structure of the intent classification device provided in an embodiment of the present application;
[0022] Figure 4 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0023] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by illustrating the examples of the present application.
[0024] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0025] In each specific implementation of the present application, when it comes to the need to perform relevant processing based on data related to user identity or characteristics such as user information, user behavior data, user historical data, and user location information, the user's permission or consent will be obtained first, and the collection, use, and processing of these data will comply with relevant laws, regulations, and standards. In addition, when the embodiment of the present application needs to obtain the user's sensitive personal information, the user's separate permission or consent will be obtained through a pop-up window or by jumping to a confirmation page. After clearly obtaining the user's separate permission or consent, the necessary user-related data for the normal operation of the disclosed embodiment will be obtained.
[0026] In order to solve the problems of the prior art, the embodiments of the present application provide an intention recognition method, device, equipment, medium and product. The intention recognition method provided by the embodiments of the present application is first introduced below.
[0027] Figure 1 FIG. 1 is a flow chart of an intention recognition method provided by an embodiment of the present application. Figure 1 As shown, the intention recognition method provided in the embodiment of the present application is applied to an electronic device and includes the following steps 101 to 103, wherein:
[0028] Step 101, obtaining the conversation text.
[0029] The dialogue text may refer to text input by the user, for example, "I want to buy a mobile phone" or "What's the weather like today", which is not limited here.
[0030] Step 102, using the pre-acquired multiple intention recognition modules to perform intention recognition on the conversation text respectively, and obtain candidate intentions output by each of the intention recognition modules, wherein each of the intention recognition modules uses a different intention recognition method.
[0031] The intent recognition module is pre-configured, and there are multiple intent recognition modules. Each intent recognition module adopts a different intent recognition method. For example, if there are two intent recognition modules, one intent recognition module can use keyword matching to perform intent recognition, and the other intent recognition module can use a regular expression-based method to perform intent recognition. In addition, the intent recognition module can also be implemented using a Few-Shot large model, or perform intent recognition based on similarity matching, which is not limited here.
[0032] Step 103, performing cross-module scoring on the candidate intent output by each of the intent recognition modules to obtain the target intent of the conversation text, wherein the cross-module scoring is used to score each of the candidate intent according to the weight of each of the intent recognition modules.
[0033] The candidate intent output by each intent recognition module is scored according to the weight of each intent recognition module. The greater the weight of the intent recognition module, the higher the score of the candidate intent output by the intent recognition module. For example, if the candidate intents output by two intent recognition modules are the same, the score corresponding to the candidate intent can be the sum of the weights of the two intent recognition modules. For example, the candidate intent with the highest score can be used as the target intent.
[0034] It should be noted that the sum of the weights of each intent recognition module is 1.
[0035] In this embodiment, a conversation text is obtained; multiple pre-acquired intent recognition modules are used to perform intent recognition on the conversation text respectively, and candidate intents output by each of the intent recognition modules are obtained, wherein each of the intent recognition modules uses a different intent recognition method; a cross-module score is performed on the candidate intent output by each of the intent recognition modules to obtain a target intent of the conversation text, and the cross-module score is used to score each of the candidate intent according to the weight of each of the intent recognition modules. In the above, by performing intent recognition on the conversation text respectively through multiple intent recognition modules, the advantages of different intent recognition methods can be combined to improve the accuracy of intent recognition.
[0036] In an embodiment of the present application, multiple pre-acquired intent recognition modules are used to respectively perform intent recognition on the conversation text, and candidate intents output by each of the intent recognition modules are obtained, including:
[0037] Using a plurality of pre-acquired intent recognition modules to respectively perform intent recognition on the conversation text, and obtaining candidate intents output by each of the intent recognition modules and first scores of the candidate intents, wherein the first scores of the candidate intents output by the intent recognition modules are determined according to weights of the intent recognition modules;
[0038] The candidate intents output by each of the intent recognition modules are scored across modules to obtain the target intent of the dialogue text, including:
[0039] According to the weight of each of the intent recognition modules and the first score of the candidate intent, a cross-module score is performed on the candidate intent output by each of the intent recognition modules to obtain a second score for each of the candidate intent;
[0040] The target intent of the dialogue text is determined based on the second score of each candidate intent.
[0041] In this embodiment, the intent recognition module outputs the first score of the candidate intent at the same time as the candidate intent is output. The first score is obtained by the intent recognition module scoring the candidate intent within the module. According to the weight of the intent recognition module and the first score of the candidate intent, the candidate intent can be scored across modules to obtain a second score. For example, if there are three intent recognition modules, the weights of the three intent recognition modules are 0.5, 0.3, and 0.2 respectively, and the module outputs are the candidate intents. Figure 1 (first score 0.2), candidate intention 2 (first score 0.5), candidate intention Figure 1 (first score 0.3), then when performing cross-module scoring, the candidate meaning is calculated Figure 1 The second score of candidate intent 1 is: 0.5×0.2+0.2×0.3=0.16; the second score of candidate intent 2 is calculated to be: 0.15. After calculating the second score of each candidate intent, an intent can be selected from the candidate intents as the target intent according to the second score, for example, the candidate intent with the highest second score is selected as the target intent.
[0042] In this embodiment, based on the weight of each of the intention recognition modules and the first score of the candidate intent, a cross-module score is performed on the candidate intent output by each of the intention recognition modules to obtain a second score for each of the candidate intent; based on the second score of each of the candidate intent, the target intent of the conversation text is determined. By performing intent recognition on the conversation text separately through multiple intention recognition modules, the advantages of different intent recognition methods can be combined, and the target intent is determined based on the score of the candidate intent, which can improve the accuracy of intent recognition.
[0043] In another embodiment of the present application, the pre-acquired multiple intent recognition modules are used to perform intent recognition on the conversation text respectively, and the candidate intent output by each of the intent recognition modules and the first score of the candidate intent are obtained, including:
[0044] Generalizing the dialogue text to obtain multiple generalized texts;
[0045] For each of the intent recognition modules, the following processing is performed:
[0046] Using the intention recognition module to perform intention recognition on the plurality of generalized texts, and obtaining an initial intention corresponding to each generalized text, and a confidence level of the initial intention;
[0047] According to the confidence of the initial intent corresponding to each generalized text, a candidate intent output by the intent recognition module and a first score of the candidate intent are selected from the obtained initial intent.
[0048] In this embodiment, the dialogue text is generalized to obtain multiple generalized texts, and each intention recognition module is used to perform intention recognition on each generalized text. Specifically, the intention recognition module is used to perform intention recognition on each generalized text to obtain the initial intention corresponding to each generalized text and the confidence of the initial intention, wherein the greater the confidence of the initial intention, the greater the possibility that the initial intention is the true intention of the dialogue text. Exemplarily, after obtaining the confidence of the initial intention corresponding to each generalized text, the initial intention corresponding to the confidence with the largest value can be selected as the candidate intention output by the intention recognition module, and the confidence is used as the first score of the candidate intention. It can also be determined in other ways, which are not limited here.
[0049] In this embodiment, the dialogue text is generalized to obtain multiple generalized texts. Generalization can support the understanding of the complexity of human language expression. Multiple generalized texts can express different intentions. By performing intent recognition on multiple generalized texts and selecting the intent of the dialogue text from them, the accuracy of the candidate intent output by the intent recognition module is higher.
[0050] In another embodiment of the present application, selecting the candidate intent output by the intent recognition module and the first score of the candidate intent from the obtained initial intent according to the confidence of the initial intent corresponding to each generalized text includes:
[0051] Grouping the initial intentions corresponding to the plurality of generalized texts to obtain a plurality of first groups, wherein initial intentions with the same intention belong to the same group;
[0052] For each of the first groups, executing: calculating according to the confidence of each initial intent in the first group and the weight of the intent recognition module to obtain a first score of the initial intent corresponding to the first group;
[0053] The initial intent with the highest first score is used as the candidate intent output by the intent recognition module, and the highest first score is used as the first score of the candidate intent.
[0054] In the above, the initial intentions corresponding to multiple generalized texts may be the same, and the same initial intentions belong to one initial intention. The initial intentions corresponding to the multiple generalized texts are grouped to obtain multiple first groups, and the same initial intentions are divided into the same group. The first score of the initial intention corresponding to each first group is calculated. Exemplarily, if the weight of the intention recognition module is 0.2, corresponding to two first groups, there are 2 first initial intentions in the first first group, and the confidences are 0.5 and 0.2 respectively, then the first score of the first initial intention is a weighted calculation of 0.5×0.2+0.2×0.2=0.14; there is 1 second initial intention in the second first group, and the confidence is 0.8, then the first score of the second initial intention is a weighted calculation of 0.8×0.2=0.16, and the second initial intention is used as the candidate intention output by the intention recognition module, and 0.16 is the first score of the candidate intention.
[0055] In this embodiment, the initial intentions corresponding to the plurality of generalized texts are grouped to obtain a plurality of first groups, and the initial intentions with the same intention belong to the same group; for each of the first groups, the following are performed: the confidence of each initial intention in the first group and the weight of the intention recognition module are calculated to obtain a first score of the initial intention corresponding to the first group; the initial intention with the highest first score is used as the candidate intention output by the intention recognition module, and the highest first score is used as the first score of the candidate intention. By performing the above process on the initial intentions identified by the intention recognition module, the first score corresponding to each initial intention is obtained, and the initial intention with the highest first score is used as the candidate intention output by the intention recognition module, which can improve the accuracy of the intention output by the intention recognition module.
[0056] In another embodiment of the present application, the candidate intent output by each of the intent recognition modules is scored across modules according to the weight of each of the intent recognition modules and the first score of the candidate intent to obtain a second score for each of the candidate intent, including:
[0057] Grouping the candidate intents output by the plurality of intent recognition modules to obtain a plurality of second groups, wherein the candidate intents having the same intent belong to the same group;
[0058] For each of the second groups, execute: perform weighted calculation based on the first score of each candidate intent in the second group and the weight of the intent recognition module corresponding to the candidate intent, to obtain the second score of each candidate intent corresponding to the second group.
[0059] Specifically, the candidate intents output by the intent recognition module are voted across modules to obtain the second score of the candidate intent corresponding to each second group. The same candidate intents are divided into the same group, and the second score of the candidate intent corresponding to each second group is calculated. For example, if there are two second groups, the first second group has two first candidate intents with confidences of 0.16 and 0.2, respectively, and the corresponding weights of the intent recognition module are 0.2 and 0.3, respectively, then the second score of the first candidate intent is 0.16×0.2+0.2×0.3=0.092; the second second group has one second candidate intent with a confidence of 0.25, and the corresponding weight of the intent recognition module is 0.5, then the second score of the second candidate intent is 0.25×0.5=0.125. Furthermore, the second candidate intent can be used as the candidate intent output by the intent recognition module.
[0060] In this embodiment, the candidate intents output by the intent recognition module are cross-module scored through the above process to obtain a second score corresponding to each candidate intent. The target intent of the dialogue text can be subsequently determined based on the second score of the candidate intent, which can improve the accuracy of intent recognition.
[0061] In yet another embodiment of the present application, determining the target intent of the conversation text according to the second score of each candidate intent includes:
[0062] Sorting the second scores of the candidate intents from largest to smallest to obtain a sorting result;
[0063] If the difference between the first second score ranked first in the sorting result and the second second score is greater than or equal to a preset threshold, the candidate intent corresponding to the first second score is used as the target intent of the dialogue text;
[0064] If the difference between the first second score and the second second score is less than a preset threshold, the weight of each intent recognition module is adjusted, and the process jumps to the step of using the pre-acquired multiple intent recognition modules to perform intent recognition on the conversation text respectively, and obtains the candidate intent output by each of the intent recognition modules and the first score of the candidate intent.
[0065] Specifically, the preset threshold can be set according to actual conditions and is not limited here. For example, the preset threshold can be 0.01, or 0.02, etc. If the difference between the two second scores ranked first in the sorting result is greater than or equal to the preset threshold, it means that the possibility of these two candidate intents being the target intent is quite different, and the candidate intent corresponding to the first second score is more likely to be the target intent, then the candidate intent corresponding to the second score ranked first is used as the target intent of the dialogue text;
[0066] If the difference between the first second score and the second second score is less than a preset threshold, it means that the second scores of the two candidate intentions ranked first are relatively close, and the possibility of these two candidate intentions being the target intentions is not much different. In order to make the target intention more accurate, the weight of each intention recognition module can be dynamically adjusted using preset rules, and then the conversation text is re-recognized for intent, that is, the step of using the pre-acquired multiple intention recognition modules to perform intent recognition on the conversation text respectively is executed again to obtain the candidate intent output by each of the intention recognition modules and the first score of the candidate intent, thereby improving the accuracy of intent recognition.
[0067] It should be noted that if the difference between the first second score and the second second score is less than the preset threshold, the weight of each intention recognition module is adjusted, and the step of using the pre-acquired multiple intention recognition modules to respectively recognize the conversation text to obtain the candidate intention output by each intention recognition module and the first score of the candidate intention is performed again; it can also be that if the difference between the first second score and the second second score is less than the preset threshold, the weight of each intention recognition module is adjusted, and according to the confidence of the initial intention corresponding to each generalized text, the candidate intention output by the intention recognition module and the first score of the candidate intention are selected from the obtained initial intention. The difference between the two is that the former needs to use the intention recognition module to respectively recognize the intention of the conversation text again, while the latter does not need to recognize the intention again, but directly uses the confidence of the initial intention obtained by the first recognition and the weight of the intention recognition module to calculate the first score.
[0068] In another embodiment of the present application, if the difference between the first second score ranked first in the sorting result and the second second score is less than the preset threshold, adjusting the weight of each intention recognition module includes:
[0069] If the difference between the first second score ranked first in the sorting result and the second second score ranked first in the sorting result is less than the preset threshold, the weight of each intention recognition module is adjusted according to at least one of the following items:
[0070] The accuracy rate of intent recognition performed by each of the intent recognition modules in the first historical time period;
[0071] The degree of fit between the intent predicted by each of the intent recognition modules in the second historical time period and the context of the conversation text;
[0072] The preset priority of each of the intent recognition modules.
[0073] In the above, the first historical time period and the second historical time period may be the same or different, and are not limited here. The first historical time period and the second historical time period may be the most recent week, the most recent month, etc., and may be set specifically according to actual conditions. The higher the accuracy of the intent recognition module in the first historical time period, the greater the weight added to the intent recognition module. For example, the corresponding relationship between the accuracy and the added weight may be preset. For example, if the accuracy is 0.1, the weight is increased by 0.1; if the accuracy is 0.2, the weight is increased by 0.2, and so on. The corresponding relationship between the accuracy and the weight of the intent recognition module may also be set in other ways, and are not limited here.
[0074] The higher the degree of fit between the intention predicted by the intention recognition module in the second historical time period and the context of the conversation text, the greater the weight of the intention recognition module, that is, if the conversation scene is determined according to the context of the conversation text, and the intention recognition module predicts the intention with a higher accuracy in the conversation scene in the second historical time period, the weight of the intention recognition module increases. For example, if the conversation scene is determined to be a shopping scene according to the context of the conversation text, and the intention recognition module using the similarity matching method predicts the intention with a higher accuracy in the shopping scene in the second historical time period, the weight of the intention recognition module increases.
[0075] The higher the priority of the intent recognition module, the greater the added weight. The priority of the intent recognition module can be preset. For example, in a new field, the priority of the Few-Shot intent recognition module is set higher, or the priority of the intent recognition module with excellent historical performance is set higher. The priority of the intent recognition module can also be adjusted dynamically. For example, the more times the candidate intent output by the intent recognition module becomes the target intent in the third historical time period, the higher the priority of the intent recognition module is adjusted. The third historical time period can be set according to actual conditions. For example, if the priority of the intent recognition module is 1, the weight of the intent recognition module is increased by 0.1; if the priority of the intent recognition module is 2 (the larger the priority, the higher the priority), the weight of the intent recognition module is increased by 0.2. Other methods of adjusting weights according to priority can also be used, which are not limited here.
[0076] It should be noted that after adjusting the weight of each intent recognition module, the weight of each intent recognition module needs to be normalized so that the sum of the weights of each intent recognition module is 1.
[0077] In this embodiment, the weight of the intention recognition module can be dynamically adjusted in the above manner to improve the accuracy of ultimately determining the target intention.
[0078] In another embodiment of the present application, the intention recognition module is used to perform intention recognition on the plurality of generalized texts to obtain the initial intention corresponding to each generalized text and the confidence of the initial intention, including:
[0079] If the intention recognition module includes a first recognition submodule and a second recognition submodule, the following processing is performed for each generalized text:
[0080] The first recognition submodule is used to perform intent recognition on the generalized text to obtain a first initial intent corresponding to the generalized text, and the second recognition submodule is used to perform intent recognition on the generalized text to obtain a second initial intent corresponding to the generalized text, wherein one of the first recognition submodule and the second recognition submodule performs intent recognition based on keywords, and the other performs intent recognition based on regular expressions;
[0081] If the first initial intent and the second initial intent are the same, taking the first initial intent or the second initial intent as the initial intent corresponding to the generalized text;
[0082] If the first initial intent and the second initial intent are different, and the confidence of the first initial intent is greater than the confidence of the second initial intent, and the difference between the confidence of the first initial intent and the confidence of the second initial intent is greater than a first difference threshold, then the first initial intent is used as the initial intent corresponding to the generalized text;
[0083] If the first initial intention and the second initial intention are different, and the confidence of the first initial intention is greater than the confidence of the second initial intention, and the difference between the confidence of the first initial intention and the confidence of the second initial intention is less than or equal to the first difference threshold, then based on the user's historical behavior information, it is determined that the first initial intention or the second initial intention is the initial intention corresponding to the generalized text, and the user is the user who provided the conversation text.
[0084] In the above, the implementation principle of the recognition submodule for keyword-based intent recognition includes:
[0085] 1. Keyword library construction: Establish a domain-related keyword library, where each keyword corresponds to one or more intents.
[0086] 2. Keyword extraction: Segment the input generalized text and extract the keywords.
[0087] 3. Keyword matching: Compare the extracted keywords with the keywords in the keyword library to find matching keywords and their corresponding intents.
[0088] 4. Intent judgment: Determine the intent of the generalized text based on the matched keywords.
[0089] The implementation principle of the recognition submodule for intent recognition based on regular expressions includes:
[0090] 1. Pattern library construction: Use regular expressions to define common query patterns, each pattern corresponds to an intent.
[0091] 2. Pattern extraction: Perform pattern matching on the input generalized text and extract text information that matches the pattern.
[0092] 3. Pattern matching: Compare the extracted patterns with the patterns in the pattern library to find matching patterns and their corresponding intents.
[0093] For example, the pattern library:
[0094] “I want to buy.*” corresponds to the intention “buy”;
[0095] "Help me find .*" corresponds to the intent "find";
[0096] Generalized text: "I want to buy a mobile phone" matching pattern: "I want to buy.*", extraction pattern: "I want to buy a mobile phone", matching result: the intention is "buy".
[0097] In this embodiment, one of the first recognition submodule and the second recognition submodule performs intent recognition based on keywords, and the other performs intent recognition based on regular expressions. When the first initial intent and the second initial intent are different (conflict occurs), if the difference between the confidence of the first initial intent and the confidence of the second initial intent is greater than the first difference threshold, the first difference threshold can be set according to actual conditions and is not limited here. In this case, it means that the confidence of the first initial intent is significantly different from the confidence of the second initial intent, and the first initial intent is used as the initial intent corresponding to the generalized text; if the difference between the confidence of the first initial intent and the confidence of the second initial intent is less than or equal to the first difference threshold, it means that the confidence of the first initial intent is slightly different from the confidence of the second initial intent, and the first initial intent or the second initial intent is determined as the initial intent corresponding to the generalized text based on the user's historical behavior information, and the user is the user who provides the conversation text.
[0098] In this embodiment, the various situations of the first initial intent and the second initial intent are processed separately, which can improve the accuracy of the intent recognition module in determining the initial intent corresponding to the generalized text.
[0099] In the above, the determining, based on the historical behavior information of the user, that the first initial intent or the second initial intent is the initial intent corresponding to the generalized text includes:
[0100] Acquiring the historical behavior information, wherein the historical behavior information includes at least one of the historical conversation information of the user, context information of the conversation text, the importance of keywords, and the user's preference;
[0101] Determine the weights of the first initial intention and the second initial intention respectively according to the historical behavior information;
[0102] An initial intent with the largest corresponding weight is selected from the first initial intent and the second initial intent as the initial intent corresponding to the generalized text.
[0103] Exemplarily, if the intention determined according to the historical conversation information is the same as the first initial intention, for example, the user consults multiple times in the fourth historical time period, and the first initial intention is consultation, then the intention determined according to the historical conversation information is considered to be the same as the first initial intention, and the weight of the first initial intention is increased;
[0104] If the intent determined based on the context information of the conversation text is the same as the first initial intent, the weight of the first initial intent is increased;
[0105] If the generalized text includes the target keyword, and the first recognition submodule is a recognition submodule that performs intent recognition based on keywords, and the target keyword is a keyword in the keyword library of the first recognition submodule, then the weight of the first initial intent output by the first recognition submodule is increased.
[0106] For example, if the user prefers to express the intention by direct questioning, and the first recognition submodule is a recognition submodule that recognizes the intention based on keywords, the weight of the first initial intention output by the first recognition submodule is increased.
[0107] In this embodiment, when there is a conflict between the first initial intent and the second initial intent, the first initial intent or the second initial intent is determined to be the initial intent corresponding to the generalized text through the user's historical behavior information, which can improve the accuracy of the intent recognition module in determining the initial intent corresponding to the generalized text.
[0108] The following uses three intent recognition modules as examples to illustrate the intent recognition method provided in the embodiment of the present application. The three intent recognition modules are: a rule matching module, a similarity matching module and a Few-Shot large model module, wherein the rule matching module includes a keyword matching submodule and a pattern matching submodule, the keyword matching submodule is an intent recognition submodule based on keyword matching, and the pattern matching submodule is an intent recognition submodule based on regular expression matching; the similarity matching module is an intent recognition module based on similarity matching, and the Few-Shot large model module is an intent recognition module that performs intent recognition through Few-Shot learning.
[0109] Specifically, 1. Rule matching module:
[0110] Input: generalized text;
[0111] Output: Intent results obtained through keyword and pattern matching;
[0112] Function: Identify keywords and patterns in generalized text and determine intent.
[0113] 2. Similarity matching module:
[0114] Input: generalized text.
[0115] Output: Intent result obtained by similarity calculation.
[0116] Function: Use Word2Vec to calculate the similarity between generalized text and historical generalized text, and retrieve similar intents.
[0117] The implementation process of the similarity matching module includes:
[0118] Query vectorization: Convert generalized text and preset text in the preset matching library into vector representations.
[0119] Similarity calculation: Calculate the similarity between the vector of the generalized text and the vector of the preset text in the matching library, and select several preset texts with the highest similarity.
[0120] Result retrieval: Sort by similarity and select the top k most similar preset texts and their corresponding intentions.
[0121] The generalized text is Q, and the preset text in the matching library is D = {d1, d2, ..., dn}. The vector representations of the generalized text and the preset text are and Calculate cosine similarity:
[0122]
[0123] 3. Few-Shot Large Model Module:
[0124] Input: generalized text.
[0125] Output: Intent results obtained through Few-Shot learning.
[0126] Function: Use a small number of examples to guide large models for intent recognition and adapt to new domains and tasks.
[0127] The implementation process of the Few-Shot large model module includes:
[0128] 1. Configure prompt word template: Design a prompt word template containing a small number of examples to guide the large model to make intent judgments.
[0129] 2. Model reasoning: Use the prompt word template and generalized text for reasoning to generate intent prediction results.
[0130] 3. Result evaluation: Evaluate the intent of the model output and adjust the prompt word template to optimize the results.
[0131] The specific implementation process includes:
[0132] 1. Example selection: Select a small number of high-quality examples for each intent from the training dataset and build a few-shot prompt word template.
[0133] 2. Prompt word construction: Combine examples with generalized text (i.e., query) to build a complete prompt word input model.
[0134] 3. Model reasoning: Use a large model (such as GPT-3) to process prompt words and generate intent prediction results.
[0135] 4. Feedback optimization: Adjust and optimize the prompt word template according to the accuracy of the model output.
[0136] For example, the prompt word template is set as:
[0137] {
[0138] Example 1: User: "I want to buy a mobile phone" Model predicts intent: Buy a mobile phone
[0139] Example 2: User: "Help me find a restaurant" Model predicts intent: Find a restaurant
[0140] User: "{query}"
[0141] Model predictions:
[0142] }
[0143] Query: "I need a new phone" Model output: Buy a phone.
[0144] Figure 2a FIG. 1 is a flow chart of an intention recognition method provided in an embodiment of the present application. Figure 2a As shown, the intention recognition method includes the following steps:
[0145] Step 201, obtaining the conversation text;
[0146] Step 202, generalizing the dialogue text using a large language model (LLM) to obtain a plurality of generalized texts;
[0147] Step 203, using multiple intent recognition modules to perform intent recognition on each conversation text, and obtaining candidate intents output by each intent recognition module;
[0148] Step 204: The candidate intents output by each intent recognition module are voted by a voting selection module. Specifically:
[0149] Voting selection module:
[0150] Input: Intent results of the three modules: rule matching module, similarity matching module and Few-Shot large model module.
[0151] Output: The final determined user intent (i.e. target intent).
[0152] Function: Vote on the results of the three modules and comprehensively select the result that best meets the user's intention.
[0153] In the above, the rule matching module includes a keyword matching submodule and a pattern matching submodule, wherein Figure 2b As shown in the figure, the implementation process of the rule matching module includes:
[0154] Keyword library construction: Establish a domain-related keyword library, where each keyword corresponds to one or more intents.
[0155] Keyword extraction: Segment generalized text and extract the keywords.
[0156] Keyword matching: Compare the extracted keywords with the keyword library to find matching keywords and their corresponding intents.
[0157] Keyword matching result 1: Determine the user's intention based on the matched keywords.
[0158] Suppose the keyword library is K = {k1, k2, ..., kn}, and the intent corresponding to each keyword ki is Ii. The query input by the user is Q, and the extracted keyword set is Qk = {q1, q2, ..., qm}.
[0159] The keyword matching process is: Match(Qk,K)={Ij|qi∈Qk,qi=kj,kj∈K}
[0160] The pattern matching submodule implementation process includes:
[0161] Build a pattern library: Use regular expressions to define common query patterns, each corresponding to an intent.
[0162] Pattern extraction: Perform pattern matching on generalized text and extract information that matches the pattern.
[0163] Pattern matching result 2: Compare the extracted pattern with the pattern library to find the matching pattern and its corresponding intent.
[0164] Exemplarily: The pattern library includes:
[0165] “I want to buy.*” corresponds to the intention “buy”;
[0166] "Help me find .*" corresponds to the intent "find";
[0167] Generalized text: "I want to buy a mobile phone" Matching pattern: "I want to buy.*" Extraction pattern: "I want to buy a mobile phone" Matching result: The intention is "buy".
[0168] Determine whether the intent results obtained by keyword matching and pattern matching conflict with each other. If not, obtain the final intent result. If so, introduce the context and perform iterative analysis to determine the final intent, where:
[0169] Context analysis includes: based on the contextual information of generalized text, such as historical text, conversation context, etc.
[0170] Iterative analysis: Make decisions based on contextual information and select the intent that best fits the current context.
[0171] For example, historical text: "I want to buy a mobile phone", generalized text: "Look for a tablet";
[0172] Based on the context, the intention is "buy a tablet" rather than "find a tablet".
[0173] The following example illustrates how to handle conflicts between keyword matching and pattern matching:
[0174] When the intents obtained through keyword matching and pattern matching are inconsistent as follows, it can be considered a conflict:
[0175] (1) Inconsistent intent classification: The results of keyword matching and pattern matching belong to different intent categories. For example, keyword matching identifies the intent as “purchase” while pattern matching identifies the intent as “consultation”.
[0176] (2) Obvious differences in intent weights: The confidence (or similarity) of the two matching results is close, but it is unclear which one is better.
[0177] In order to determine the final intent based on context analysis in conflict situations, multi-dimensional data such as historical conversations, session context, and user behavior can be combined to determine the intent results with higher priority.
[0178] 1. Context weight assignment: Define a context weight table, as shown in Table 1, and dynamically adjust the weight of each intent category based on the user's historical conversation records, the contextual intent of the current conversation, and the behavior patterns in the historical data.
[0179] Table 1
[0180]
[0181] For example, if the user has had "purchase" intentions many times in the past, and the current conversation involves commodity-related words (such as "mobile phone" and "computer"), the weight of the "purchase" intention will be increased.
[0182] For example, if a user has asked "buy a mobile phone" many times in the past week, and the current query (i.e., generalized text) "help me find a smart phone" contains the keyword "mobile phone", then the context weight can refer to the historical meaning. Figure 1 Dynamic adjustment based on consistency, keyword importance, etc. The assignment rules are as follows:
[0183] Historical meaning Figure 1 Consistency: Since the user’s past queries all pointed to “purchase”, the weight of “purchase” in the current intent is increased by 0.2.
[0184] Keyword importance: The current query contains the keyword "mobile phone", and the importance of keywords in this field is given a weight of 0.3.
[0185] User preference: Users tend to express their intent through direct questions, so keyword matching results are given priority.
[0186] According to the context weight table, the comprehensive weight is: total weight = 0.2 + 0.3 + 0.15 = 0.65;
[0187] 2. Time series analysis: Model the user's historical intention behavior through time series, and make judgments based on trends at time nodes. For example, if a user repeatedly searches for the same category of products or intentions in a specific time period, time series analysis can be used to confirm whether this behavior is consistent with user habits. For example, through time series models (such as LSTM), the current intention can be judged in combination with the user's query behavior in different time periods.
[0188] 3. Conflict decision algorithm (based on the rule base to measure first, and context analysis without starting):
[0189] Define priority rules when intents conflict. If some intents appear more frequently in the current context or historical behavior, give them a higher weight.
[0190] Use a dynamic weighted algorithm: Let the confidence of the intent obtained by keyword matching be Ik, the intent obtained by pattern matching be Im, and the intent weights given after context analysis be Wk and Wm respectively. The final confidence of the intent If is obtained by weighting: When Wk>Wm, the keyword matching result is given priority, otherwise the pattern matching result is selected.
[0191] Through LLM generalization, n similar generalized texts are obtained. Each generalized text will obtain multiple intent results. These intent results can be scored across modules (also known as cross-module voting) to ultimately determine the result that best meets the user's true intent (i.e., the target intent).
[0192] 1. Preliminary voting within the module:
[0193] Input processing: n generalized texts generate several intent candidate results in the rule matching module, similarity matching module, and Few-Shot large model module respectively.
[0194] Preliminary voting mechanism: Vote on the candidate intent results within each module, using a weighted voting mechanism within the module to calculate a comprehensive score based on the module's confidence, output intent confidence, context relevance, etc. The intent with the highest score becomes the preliminary result of the module.
[0195] Weighted voting formula:
[0196] in:
[0197] ·S m The internal voting score of the module (i.e. the first score);
[0198] ·C i is the confidence of the i-th intention;
[0199] ·W m is the weight of the module;
[0200] For example, the candidate intent results obtained by the rule matching module are "purchase" (confidence 0.7) and "consultation" (confidence 0.5), and the module weight is 0.4. The score is:
[0201] Finally, “purchase” with the highest score is selected as the preliminary result of the rule matching module.
[0202] 2. Merge voting across modules:
[0203] Inter-module summary: summarize the preliminary results of each module (rule matching module, similarity matching module, Few-Shot large model module).
[0204] Cross-module voting: During the cross-module voting phase, the voting results of each module are weighted based on the module's historical performance, current context suitability, and module priority.
[0205] Weighted formula:
[0206] in:
[0207] ·S final The final score across modules (i.e., the second score);
[0208] Module weight adjustment basis:
[0209] Historical performance of the module: The weight is adjusted based on the module’s accuracy and recall over the past period of time.
[0210] Contextual fit: The weight is adjusted based on the fit between the current conversation topic and the module. For example, if the current sentence is a shopping scenario and the similarity matching module has performed well in the past, the weight of similarity matching will be increased.
[0211] Module priority: In new areas, the priority of the few-shot module is higher, and the weight of the module with excellent historical performance is also relatively higher.
[0212] Example: Assume that the preliminary result of rule matching is "purchase" 0.28, the similarity matching module is "consultation" 0.3, and the Few-Shot large model is "purchase" 0.4. The weights of each module are:
[0213] Rule matching: 0.3; Similarity matching: 0.2; Few-Shot: 0.5;
[0214] Calculated by the formula:
[0215]
[0216] The final higher scoring intent is "Purchase".
[0217] 3. Global voting and dynamic adjustment:
[0218] Confidence weighting: If the scores after voting across modules are close, the system will perform a weighted average based on the confidence of each intent to calculate the final global score.
[0219] Dynamic adjustment: If the confidence is still close (i.e. the difference between the two second scores in the top ranking is less than the preset threshold), the dynamic adjustment phase is entered. Adjustments are made based on contextual information, historical behavior patterns, and time series analysis to increase the weight of certain intents.
[0220] Dynamic adjustment formula: W adjusted =W m +f(context)+f(historical behavior);
[0221] Based on the adjusted weights, the score of each intent is recalculated and the final intent is selected.
[0222] Example: If the scores of "purchase" and "inquiry" are close in the global vote, the system will dynamically increase the weight of the "purchase" intention through context analysis (the current user has searched for a large number of products on the shopping website) and historical behavior patterns (the user has expressed purchase intentions many times in the past week):
[0223] W 购买adjusted =0.5+0.1(context improvement)+0.1(historical behavior improvement)=0.7;
[0224] After recalculation, the score finally selects the "purchase" intent.
[0225] The intention recognition method provided in the above embodiment has the following beneficial effects:
[0226] Refinement of voting within the module: Weighted voting is performed within the module to improve the accuracy of intent recognition for each module.
[0227] Dynamic adjustment of cross-module weights: Cross-module voting dynamically adjusts module weights based on historical performance, contextual adaptability, and priority, improving the flexibility and adaptability of the system.
[0228] Global voting and multiple filtering: Combining confidence weighting, dynamic adjustment and global analysis, the system can effectively handle multiple conflicting intentions in complex scenarios and improve the accuracy and robustness of the final decision.
[0229] This complex voting mechanism improves the accuracy and flexibility of intent recognition through three-level weighting and dynamic adjustment, combined with context, historical data and confidence multi-dimensional analysis. At the same time, by dynamically adjusting the module weights, the system can perform adaptive optimization in different scenarios to achieve more efficient and accurate image judgment.
[0230] Figure 3 FIG. 1 shows a structural diagram of an intention recognition device provided in an embodiment of the present application. Figure 3 As shown, the intention recognition device 300 includes:
[0231] An acquisition module 301 is used to acquire a conversation text;
[0232] A first recognition module 302 is used to use a plurality of pre-acquired intention recognition modules to perform intention recognition on the conversation text respectively, and obtain candidate intentions output by each of the intention recognition modules, wherein each of the intention recognition modules uses a different intention recognition method;
[0233] The second recognition module 303 is used to perform cross-module scoring on the candidate intents output by each of the intent recognition modules to obtain the target intent of the conversation text. The cross-module scoring is used to score each of the candidate intents according to the weight of each of the intent recognition modules.
[0234] In one embodiment of the present application, the first identification module 302 includes:
[0235] a first recognition submodule, configured to use a plurality of pre-acquired intent recognition modules to respectively perform intent recognition on the conversation text, obtain candidate intents output by each of the intent recognition modules and first scores of the candidate intents, wherein the first scores of the candidate intents output by the intent recognition modules are determined according to weights of the intent recognition modules;
[0236] The second identification module 303 includes:
[0237] A first scoring submodule, configured to perform a cross-module scoring on the candidate intent output by each of the intent recognition modules according to the weight of each of the intent recognition modules and the first score of the candidate intent, so as to obtain a second score for each of the candidate intent;
[0238] A determination submodule is used to determine the target intent of the dialogue text according to the second score of each candidate intent.
[0239] In an embodiment of the present application, the first identification submodule includes:
[0240] A generalization unit, used for generalizing the dialogue text to obtain a plurality of generalized texts;
[0241] The processing unit is used to perform the following processing on each of the intention recognition modules:
[0242] Using the intention recognition module to perform intention recognition on the plurality of generalized texts, and obtaining an initial intention corresponding to each generalized text and a confidence level of the initial intention;
[0243] According to the confidence of the initial intent corresponding to each generalized text, a candidate intent output by the intent recognition module and a first score of the candidate intent are selected from the obtained initial intent.
[0244] In one embodiment of the present application, the processing unit is further configured to:
[0245] Grouping the initial intentions corresponding to the plurality of generalized texts to obtain a plurality of first groups, wherein initial intentions with the same intention belong to the same group;
[0246] For each of the first groups, executing: calculating according to the confidence of each initial intent in the first group and the weight of the intent recognition module to obtain a first score of the initial intent corresponding to the first group;
[0247] The initial intent with the highest first score is used as the candidate intent output by the intent recognition module, and the highest first score is used as the first score of the candidate intent.
[0248] In one embodiment of the present application, the first scoring submodule includes:
[0249] a grouping unit, configured to group the candidate intents outputted by the plurality of intent recognition modules to obtain a plurality of second groups, wherein the candidate intents having the same intent belong to the same group;
[0250] A scoring unit is used to execute, for each of the second groups, the following: performing a weighted calculation based on the first score of each candidate intent in the second group and the weight of the intent recognition module corresponding to the candidate intent, to obtain a second score for each candidate intent corresponding to the second group.
[0251] In an embodiment of the present application, the determining submodule includes:
[0252] A sorting unit, used to sort the second scores of the candidate intents from large to small to obtain a sorting result;
[0253] A first determining unit, configured to use the candidate intent corresponding to the first second score as the target intent of the dialogue text if the difference between the first second score and the second second score in the sorting result is greater than or equal to a preset threshold;
[0254] The second determination unit is used to adjust the weight of each intention recognition module if the difference between the first second score ranked first in the sorting result and the second second score is less than the preset threshold, and jump to the step of using the pre-acquired multiple intention recognition modules to perform intent recognition on the conversation text respectively, and obtain the candidate intent output by each of the intention recognition modules and the first score of the candidate intent.
[0255] In an embodiment of the present application, the second determining unit is specifically configured to:
[0256] If the difference between the first second score ranked first in the sorting result and the second second score ranked first in the sorting result is less than the preset threshold, the weight of each intention recognition module is adjusted according to at least one of the following items:
[0257] The accuracy rate of intent recognition performed by each of the intent recognition modules in the first historical time period;
[0258] The degree of fit between the intent predicted by each of the intent recognition modules in the second historical time period and the context of the conversation text;
[0259] The preset priority of each of the intent recognition modules.
[0260] In one embodiment of the present application, the processing unit is further configured to:
[0261] If the intention recognition module includes a first recognition submodule and a second recognition submodule, the following processing is performed for each generalized text:
[0262] The first recognition submodule is used to perform intent recognition on the generalized text to obtain a first initial intent corresponding to the generalized text, and the second recognition submodule is used to perform intent recognition on the generalized text to obtain a second initial intent corresponding to the generalized text, wherein one of the first recognition submodule and the second recognition submodule performs intent recognition based on keywords, and the other performs intent recognition based on regular expressions;
[0263] If the first initial intent and the second initial intent are the same, taking the first initial intent or the second initial intent as the initial intent corresponding to the generalized text;
[0264] If the first initial intent and the second initial intent are different, and the confidence of the first initial intent is greater than the confidence of the second initial intent, and the difference between the confidence of the first initial intent and the confidence of the second initial intent is greater than a first difference threshold, then the first initial intent is used as the initial intent corresponding to the generalized text;
[0265] If the first initial intention and the second initial intention are different, and the confidence of the first initial intention is greater than the confidence of the second initial intention, and the difference between the confidence of the first initial intention and the confidence of the second initial intention is less than or equal to the first difference threshold, then based on the user's historical behavior information, it is determined that the first initial intention or the second initial intention is the initial intention corresponding to the generalized text, and the user is the user who provided the conversation text.
[0266] In one embodiment of the present application, the processing unit is further configured to:
[0267] Acquiring the historical behavior information, wherein the historical behavior information includes at least one of the historical conversation information of the user, context information of the conversation text, the importance of keywords, and the user's preference;
[0268] Determine the weights of the first initial intention and the second initial intention respectively according to the historical behavior information;
[0269] An initial intent with the largest corresponding weight is selected from the first initial intent and the second initial intent as the initial intent corresponding to the generalized text.
[0270] The intention recognition device 300 provided in the embodiment of the present application can implement the various processes implemented in the aforementioned intention recognition method embodiment and achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0271] Figure 4 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application is shown.
[0272] The electronic device may include a processor 401 and a memory 402 storing computer program instructions.
[0273] Specifically, the processor 401 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0274] Memory 402 may include a large capacity memory for data or instructions. By way of example and not limitation, memory 402 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, memory 402 may include a removable or non-removable (or fixed) medium. In appropriate cases, memory 402 may be inside or outside of an integrated gateway disaster recovery device. In a specific embodiment, memory 402 is a non-volatile solid-state memory.
[0275] The memory may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk storage medium device, an optical storage medium device, a flash memory device, an electrical, optical or other physical / tangible memory storage device. Thus, typically, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., a memory device) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to the first aspect or the second aspect of the present disclosure.
[0276] The processor 401 implements any one of the information auditing methods in the above embodiments by reading and executing computer program instructions stored in the memory 402 .
[0277] In one example, the electronic device may further include a communication interface 403 and a bus 410. Figure 4 As shown, the processor 401, the memory 402, and the communication interface 403 are connected via a bus 410 and communicate with each other.
[0278] The communication interface 403 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.
[0279] Bus 410 includes hardware, software or both, and the parts of information audit method or verification equipment are coupled to each other. For example, but not limitation, bus may include accelerated graphics port (AGP) or other graphics bus, enhanced industrial standard architecture (EISA) bus, front side bus (FSB), hypertransport (HT) interconnection, industrial standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 410 may include one or more buses. Although the present application embodiment describes and shows a specific bus, the application considers any suitable bus or interconnection.
[0280] In addition, in combination with the intention recognition method in the above embodiment, the embodiment of the present application can provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when the computer program instructions are executed by a processor, any one of the intention recognition methods in the above embodiment is implemented.
[0281] An embodiment of the present application may provide a computer program product. When instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes any one of the intent recognition methods in the above embodiments.
[0282] An embodiment of the present application also provides a computer program product. When instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes any one of the intent recognition methods in the above embodiments.
[0283] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiment, several specific steps are described as examples. However, the method process of the present application is not limited to the specific steps described, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.
[0284] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.
[0285] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.
[0286] Aspects of the present disclosure are described above with reference to the flowchart and / or block diagram of the method, device (system) according to the embodiment of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the implementation of the function / action specified in one or more boxes of the flowchart and / or block diagram. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field programmable logic circuit. It can also be understood that each box in the block diagram and / or flowchart and the combination of boxes in the block diagram and / or flowchart can also be implemented by dedicated hardware that performs a specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.
[0287] The above is only a specific implementation of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the protection scope of this application.
Claims
1. A method for intention recognition, characterized in that: The method comprises: Get the conversation text; Using the pre-acquired multiple intention recognition modules to respectively perform intention recognition on the conversation text, and obtain candidate intentions output by each intention recognition module, wherein each intention recognition module adopts a different intention recognition method; The candidate intents output by each of the intent recognition modules are cross-module scored to obtain the target intent of the dialogue text, and the cross-module scoring is used to score each of the candidate intents according to the weight of each of the intent recognition modules.
2. The method for intention recognition according to claim 1, characterized in that: Using the pre-acquired multiple intention recognition modules to respectively perform intention recognition on the conversation text, and obtaining candidate intentions output by each of the intention recognition modules, including: Using a plurality of pre-acquired intent recognition modules to respectively perform intent recognition on the conversation text, and obtaining candidate intents output by each of the intent recognition modules and first scores of the candidate intents, wherein the first scores of the candidate intents output by the intent recognition modules are determined according to weights of the intent recognition modules; The candidate intents output by each of the intent recognition modules are scored across modules to obtain the target intent of the dialogue text, including: According to the weight of each of the intent recognition modules and the first score of the candidate intent, a cross-module score is performed on the candidate intent output by each of the intent recognition modules to obtain a second score for each of the candidate intent; The target intent of the dialogue text is determined based on the second score of each candidate intent.
3. The method for identifying intention according to claim 2, characterized in that: The method of using the pre-acquired multiple intention recognition modules to respectively perform intention recognition on the conversation text to obtain candidate intentions output by each of the intention recognition modules and a first score of the candidate intentions includes: Generalizing the dialogue text to obtain multiple generalized texts; For each of the intent recognition modules, the following processing is performed: Using the intention recognition module to perform intention recognition on the plurality of generalized texts, and obtaining an initial intention corresponding to each generalized text and a confidence level of the initial intention; According to the confidence of the initial intent corresponding to each generalized text, a candidate intent output by the intent recognition module and a first score of the candidate intent are selected from the obtained initial intent.
4. The method for intention recognition according to claim 3, characterized in that: The step of selecting, according to the confidence of the initial intent corresponding to each of the generalized texts, the candidate intent output by the intent recognition module and the first score of the candidate intent from the obtained initial intents includes: Grouping the initial intentions corresponding to the plurality of generalized texts to obtain a plurality of first groups, wherein initial intentions with the same intention belong to the same group; For each of the first groups, executing: calculating according to the confidence of each initial intent in the first group and the weight of the intent recognition module to obtain a first score of the initial intent corresponding to the first group; The initial intention with the highest first score is used as the candidate intention output by the intention recognition module, and the highest first score is used as the first score of the candidate intention.
5. The method for identifying intention according to claim 2, characterized in that: The step of performing cross-module scoring on the candidate intent output by each of the intent recognition modules according to the weight of each of the intent recognition modules and the first score of the candidate intent to obtain a second score for each of the candidate intent includes: Grouping the candidate intents output by the plurality of intent recognition modules to obtain a plurality of second groups, wherein the candidate intents having the same intent belong to the same group; For each of the second groups, execute: perform weighted calculation based on the first score of each candidate intent in the second group and the weight of the intent recognition module corresponding to the candidate intent, to obtain the second score of each candidate intent corresponding to the second group.
6. The method for identifying intention according to claim 2, characterized in that: Determining the target intent of the dialogue text according to the second score of each candidate intent includes: Sorting the second scores of the candidate intents from largest to smallest to obtain a sorting result; If the difference between the first second score ranked first in the sorting result and the second second score is greater than or equal to a preset threshold, the candidate intent corresponding to the first second score is used as the target intent of the dialogue text; If the difference between the first second score ranked first in the sorting result and the second second score is less than the preset threshold, the weight of each intention recognition module is adjusted, and the process jumps to the step of using the pre-acquired multiple intention recognition modules to perform intent recognition on the conversation text respectively, and obtains the candidate intent output by each of the intention recognition modules and the first score of the candidate intent.
7. The method for identifying intention according to claim 6, characterized in that: If the difference between the first second score ranked first in the sorting result and the second second score ranked first in the sorting result is less than the preset threshold, adjusting the weight of each intention recognition module includes: If the difference between the first second score ranked first in the sorting result and the second second score ranked first in the sorting result is less than the preset threshold, the weight of each intention recognition module is adjusted according to at least one of the following items: The accuracy rate of intent recognition performed by each of the intent recognition modules in the first historical time period; The degree of fit between the intent predicted by each of the intent recognition modules in the second historical time period and the context of the conversation text; The preset priority of each of the intent recognition modules.
8. The method for intention recognition according to claim 3, characterized in that: The using the intention recognition module to perform intention recognition on the plurality of generalized texts to obtain the initial intention corresponding to each generalized text and the confidence of the initial intention includes: If the intention recognition module includes a first recognition submodule and a second recognition submodule, the following processing is performed for each generalized text: The first recognition submodule is used to perform intent recognition on the generalized text to obtain a first initial intent corresponding to the generalized text, and the second recognition submodule is used to perform intent recognition on the generalized text to obtain a second initial intent corresponding to the generalized text, wherein one of the first recognition submodule and the second recognition submodule performs intent recognition based on keywords, and the other performs intent recognition based on regular expressions; If the first initial intent and the second initial intent are the same, taking the first initial intent or the second initial intent as the initial intent corresponding to the generalized text; If the first initial intent and the second initial intent are different, and the confidence of the first initial intent is greater than the confidence of the second initial intent, and the difference between the confidence of the first initial intent and the confidence of the second initial intent is greater than a first difference threshold, then the first initial intent is used as the initial intent corresponding to the generalized text; If the first initial intention and the second initial intention are different, and the confidence of the first initial intention is greater than the confidence of the second initial intention, and the difference between the confidence of the first initial intention and the confidence of the second initial intention is less than or equal to the first difference threshold, then based on the user's historical behavior information, it is determined that the first initial intention or the second initial intention is the initial intention corresponding to the generalized text, and the user is the user who provided the conversation text.
9. The method for intention recognition according to claim 8, characterized in that: The determining, according to the historical behavior information of the user, that the first initial intent or the second initial intent is the initial intent corresponding to the generalized text includes: Acquiring the historical behavior information, wherein the historical behavior information includes at least one of the historical conversation information of the user, context information of the conversation text, the importance of keywords, and the user's preference; Determine the weights of the first initial intention and the second initial intention respectively according to the historical behavior information; An initial intent with the largest corresponding weight is selected from the first initial intent and the second initial intent as the initial intent corresponding to the generalized text.
10. An intention recognition device, characterized in that: The device comprises: The acquisition module is used to obtain the conversation text; A first recognition module, configured to use a plurality of pre-acquired intent recognition modules to respectively perform intent recognition on the conversation text, and obtain candidate intents output by each of the intent recognition modules, wherein each of the intent recognition modules uses a different intent recognition method; The second recognition module is used to perform cross-module scoring on the candidate intents output by each of the intent recognition modules to obtain the target intent of the dialogue text, and the cross-module scoring is used to score each of the candidate intents according to the weight of each of the intent recognition modules.
11. An electronic device, characterized in that: include: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, the intention recognition method as described in any one of claims 1-9 is implemented.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, the intention recognition method as described in any one of claims 1 to 9 is implemented.
13. A computer program product, characterized in that When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes the intention recognition method as described in any one of claims 1-9.
Citation Information
Patent Citations
Method and device for mining intentions
CN103942204A
Natural language processing method and device based on human-computer interaction, equipment and medium
CN113486170A
Method and system for realizing intelligent outbound call of robot
CN117915002A
Driving interaction method, system and device, medium and program product
CN118800234A
Cited By
Intelligent intention judgment method based on template content automatic preferential selection
CN120745654A
Dynamic intention recognition method and system, medium and product
CN121808423A
A dynamic intent recognition method, system, medium and product
CN121808423B