A method and device for recognizing voice intent, an electronic device, and a storage medium
Patent Information
- Application Number
- CN202211137116.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-19
- Publication Date
- 2026-09-08
- Estimated Expiration
- 2042-09-19
AI Technical Summary
由于人机交互的场景复杂且多样,单一的意图分类方法的输出结果不具有代表性,面对广领域的场景,需要结合多个意图分类方法,才能保证人机交互的可用性和准确性
[0122] By employing the above technical solution, this application obtains several intent classification sets by inputting voice information into several preset voice intent classifiers. Each intent classification set is output by a voice intent classifier. Based on the degree of difference among all intent classification sets in intent type, intent quantity, and intent score, an analysis mode for filtering the target intent of the voice information is determined. Under this analysis mode, the target intent of the voice information is determined based on each intent in all intent classification sets, or the intent score of each intent. Therefore, several voice intent classifiers will output different results for the intent analysis of the same voice information. By analyzing the degree of difference among these different results in intent type, intent quantity, and intent score, an analysis mode for filtering the target intent of the voice information can be determined. Since this analysis mode is comprehensively confirmed based on various evaluation indicators (such as intent type, intent quantity, and intent score) related to the output results, it has more accurate filtering criteria and can filter the target intent of the voice information from multiple output results. Confirming the target intent of the voice information under the determined analysis mode is more reliable, thus making subsequent voice interactions more accurate.
Smart Images

Figure CN115527529B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of voice interaction, and more specifically, to a method, apparatus, electronic device, and storage medium for voice intent recognition. Background Technology
[0002] With the continuous development of artificial intelligence technology, intent classification is increasingly being applied in the field of intelligent recognition. Intent classification is a fundamental model function for most human-computer interactions, and most intent classification methods are learned within narrow domains. Due to the complexity and diversity of human-computer interaction scenarios, the output of a single intent classification method is not representative. For scenarios spanning a wide range, it is necessary to combine multiple intent classification methods to ensure the usability and accuracy of human-computer interaction.
[0003] In voice interaction scenarios, the results output by multiple voice intent classification methods based on different principles often differ significantly and cannot usually be directly compared, leading to inaccuracies in voice interaction. How to obtain more accurate voice intents based on the outputs of multiple voice intent classification methods is a problem that needs attention. Summary of the Invention
[0004] In view of the above problems, this application is made to provide a method, apparatus, electronic device and storage medium for voice intent recognition, so as to improve the accuracy of voice interaction.
[0005] To achieve the above objectives, the following specific solutions are proposed:
[0006] A method for speech intent recognition includes:
[0007] Voice information is input into several preset voice intent classifiers to obtain several intent classification sets. Each intent classification set is output by one of the voice intent classifiers. Each intent classification set includes at least one intent and an intent score for each intent.
[0008] Based on the degree of difference among all the aforementioned intent classification sets in terms of intent type, intent quantity, and intent score, an analysis pattern for the target intent to filter the voice information is determined.
[0009] In the analysis mode, the target intent of the voice information is determined based on each intent in all intent classification sets, and / or the intent score of each intent.
[0010] Optionally, determining the analysis pattern for filtering the target intent of the voice information based on the degree of difference among all the intent classification sets in intent type, intent quantity, and intent score includes:
[0011] In all the intent classification sets, if the first condition and the second condition are both met, then the analysis mode for the target intent of the voice information is determined to be the first mode. The first condition is that the intents with the highest intent scores in each intent classification set are of the same type, and the second condition is that the highest intent scores are all greater than a first preset score.
[0012] In all the intent classification sets, if the first condition is not met, and both the second and third conditions are met, then the analysis mode for filtering the target intent of the voice information is determined to be the second mode. The third condition is that the number of intents under each intent category is evenly distributed, and the intent score under each intent category is evenly distributed.
[0013] If neither the first condition nor the fourth condition is met, and the second condition and the third condition are not met simultaneously, then the analysis mode for the target intent of the voice information is determined to be the third mode. The fourth condition is that the score of each intent in all intent classification sets is less than the second preset score, and the second preset score is less than the first preset score.
[0014] If the fourth condition is met, then the analysis mode for the target intent of the voice information is determined to be the fourth mode.
[0015] Optionally, the analysis mode includes a first mode;
[0016] In the analysis mode, the target intent of the voice information is determined based on each intent in all intent classification sets, and / or the intent score of each intent, including:
[0017] In the first mode, the intent with the highest intent score in each intent category set is determined as the target intent of the voice information.
[0018] Optionally, the analysis mode includes a second mode;
[0019] In the analysis mode, the target intent of the voice information is determined based on each intent in all intent classification sets, and / or the intent score of each intent, including:
[0020] In the second mode, intentions whose intention scores are higher than a preset score threshold under each intention category in all intention classification sets are identified as candidate intentions for that type of intention;
[0021] The intent scores of each candidate intent in each intent are summed to obtain the total intent score for that intent.
[0022] The intent type with the highest total intent score is determined as the target intent of the voice information.
[0023] Optionally, all intent types appearing in the intent classification set are included in the intent labels already labeled in the total sample data used by the speech intent classifier during training, and one intent type corresponds to one intent label;
[0024] The method also includes:
[0025] The proportion of sample data under each intent label in the total sample data used during training of the speech intent classifier corresponding to each intent classification set is calculated.
[0026] The compensation coefficient for each intent type is calculated based on the aforementioned ratio.
[0027] The total intention score for each intention is multiplied by the compensation coefficient for that intention to obtain the compensation score for that intention, and the intention type with the highest compensation score is taken as the target intention of the speech information.
[0028] Optionally, the analysis mode includes a third mode;
[0029] In the analysis mode, the target intent of the voice information is determined based on each intent in all intent classification sets, and / or the intent score of each intent, including:
[0030] In the third mode, the number of intents difference coefficients for each intent are determined based on the number of each intent in all intent classification sets;
[0031] Calculate the average score of each intent across all intent categories based on the intent score of each intent within each intent category;
[0032] The intention number difference coefficient for each intention is multiplied by the average score of that intention to obtain the weighted score of that intention, and the intention type with the highest weighted score among all intentions is taken as the target intention of the speech information.
[0033] Optionally, the step of calculating the average score of each intent across all intent categories based on the intent score of each intent within each intent category includes:
[0034] The intent scores of each intent of the same type in all intent classification sets are summed to obtain the cumulative score for each intent.
[0035] In all intent categories, the cumulative score for each intent is divided by the number of intents of that type to obtain the average score for that intent.
[0036] Optionally, the method further includes:
[0037] Based on the maximum and minimum intent scores for each intent in all intent classification sets, determine the intent score deviation score for that intent.
[0038] The intention score deviation score of each intention is added to the weighted score of that intention to obtain the corrected score of that intention, and the intention type with the highest corrected score is taken as the target intention of the speech information.
[0039] Optionally, all intent types appearing in the intent classification set are included in the intent labels already labeled in the total sample data used by the speech intent classifier during training, and one intent type corresponds to one intent label;
[0040] The method also includes:
[0041] The proportion of sample data under each intent label in the total sample data used during training of the speech intent classifier corresponding to each intent classification set is calculated.
[0042] The compensation coefficient for each intent type is calculated based on the aforementioned ratio.
[0043] The weighted score of each intent is multiplied by the compensation coefficient of that intent to obtain the compensation score of that intent, and the intent type with the highest compensation score is taken as the target intent of the speech information.
[0044] Optionally, all intent types appearing in the intent classification set are included in the intent labels already labeled in the total sample data used by the speech intent classifier during training, and one intent type corresponds to one intent label;
[0045] The method also includes:
[0046] The proportion of sample data under each intent label in the total sample data used during training of the speech intent classifier corresponding to each intent classification set is calculated.
[0047] The compensation coefficient for each intent type is calculated based on the aforementioned ratio.
[0048] The correction score for each intent is multiplied by the compensation coefficient for that intent to obtain the compensation score for that intent, and the intent type with the highest compensation score is taken as the target intent of the speech information.
[0049] Optionally, the analysis mode includes a fourth mode;
[0050] In the analysis mode, the target intent of the voice information is determined based on each intent in all intent classification sets, and / or the intent score of each intent, including:
[0051] In the fourth mode, the correlation between each intent in all intent classification sets and preset historical intent data is analyzed, and the intent type with the highest correlation with the historical intent data is determined as the target intent of the voice information.
[0052] Optionally, the analysis mode includes a fourth mode;
[0053] In the analysis mode, the target intent of the voice information is determined based on each intent in all intent classification sets, and / or the intent score of each intent, including:
[0054] In the fourth mode, the intent with the highest intent score in each intent category set is taken as the basic intent, resulting in at least one basic intent;
[0055] In the preset history, find the intent with the highest intent score that has a similarity greater than a preset similarity threshold to each basic intent, and use it as the reference intent corresponding to that basic intent;
[0056] Based on each basic intent and its corresponding reference intent, determine the extended intent corresponding to that basic intent;
[0057] For each extended intent, the intent score of the extended intent is determined based on the intent score of the basic intent corresponding to the extended intent and the intent score of the reference intent.
[0058] Among the various extended intents, the extended intent with the highest intent score is determined as the intent result of the speech information.
[0059] Optionally, the method further includes:
[0060] In the fourth mode, user behavior information after a preset date is extracted from pre-stored user historical behavior information;
[0061] Analyze the frequency of each user behavior in the user behavior information to determine the target intent of the voice information.
[0062] A device for voice intent recognition, comprising:
[0063] The intent classification set acquisition unit is used to input voice information into several preset voice intent classifiers to obtain several intent classification sets. Each intent classification set is output by one of the voice intent classifiers. Each intent classification set includes at least one intent and an intent score for each intent.
[0064] The analysis pattern determination unit is used to determine the analysis pattern of the target intent for filtering the voice information based on the degree of difference between all the intent classification sets in intent type, intent quantity, and intent score.
[0065] A target intent determination unit is configured to determine the target intent of the voice information based on each intent in all intent classification sets and / or the intent score of each intent in the analysis mode.
[0066] Optionally, the analysis mode determination unit includes:
[0067] The first mode determination unit is used to determine the analysis mode of the target intent for filtering the voice information as the first mode if the first condition and the second condition are both met in all the intent classification sets. The first condition is that the intents with the highest intent scores in each intent classification set are of the same type, and the second condition is that the highest intent scores are all greater than a first preset score.
[0068] The second mode determination unit is used to determine the analysis mode of the target intent for filtering the voice information as the second mode if the first condition is not met and both the second and third conditions are met in all the intent classification sets. The third condition is that the number of intents under each intent category is evenly distributed and the intent score under each intent category is evenly distributed.
[0069] The third mode determination unit is used to determine the analysis mode of the target intent for filtering the voice information as the third mode if neither the first condition nor the fourth condition is met, and the second condition and the third condition are not met simultaneously. The fourth condition is that the score of each intent in all intent classification sets is less than the second preset score, and the second preset score is less than the first preset score.
[0070] The fourth mode determination unit is used to determine the analysis mode of the target intent for filtering the voice information as the fourth mode if the fourth condition is met.
[0071] Optionally, the analysis mode includes a first mode;
[0072] The target intent determination unit includes:
[0073] The first target intent determination subunit is used to determine, in the first mode, the intent with the highest intent score in each intent category set among all intent category sets, as the target intent of the voice information.
[0074] Optionally, the analysis mode includes a second mode;
[0075] The target intent determination unit includes:
[0076] The second target intent determination subunit is used to determine, in the second mode, intents whose intent scores under each intent category in all intent classification sets are higher than a preset score threshold, and to identify them as candidate intents for that type of intent.
[0077] The third target intent determination subunit is used to accumulate the intent scores of each candidate intent in each intent to obtain the total intent score of that intent.
[0078] The fourth target intent determination subunit is used to determine the intent type with the highest total intent score as the target intent of the voice information.
[0079] Optionally, all intent types appearing in the intent classification set are included in the intent labels already labeled in the total sample data used by the speech intent classifier during training, and one intent type corresponds to one intent label;
[0080] The device also includes:
[0081] The first sample proportion statistics unit is used to calculate the proportion of sample data under each intent label in the total sample data used by the voice intent classifier during training for each intent classification set.
[0082] The first compensation coefficient determination unit is used to calculate the compensation coefficient for each intent type based on the ratio.
[0083] The first compensation score determination unit is used to multiply the total intention score of each intention by the compensation coefficient of that intention to obtain the compensation score of that intention, and to take the intention type with the highest compensation score as the target intention of the voice information.
[0084] Optionally, the analysis mode includes a third mode;
[0085] The target intent determination unit includes:
[0086] The fifth target intent determination subunit is used to determine the intent number difference coefficient for each intent based on the number of each intent in all intent classification sets in the third mode;
[0087] The sixth target intent determination subunit is used to calculate the average score of each intent across all intent classification sets based on the intent score of each intent within each intent.
[0088] The seventh target intent determination subunit is used to multiply the intent number difference coefficient of each intent by the average score of that intent to obtain the weighted score of that intent, and take the intent type with the highest weighted score among all intents as the target intent of the speech information.
[0089] Optionally, the sixth target intent determination subunit includes:
[0090] The intent total score determination unit is used to accumulate the intent scores of each intent of the same intent in all intent classification sets to obtain the cumulative score of each intent.
[0091] The average score calculation unit is used to divide the cumulative score of each intent by the number of intents of that type across all intent classification sets to obtain the average score of that intent.
[0092] Optionally, the device may also include:
[0093] The intent score deviation score determination unit is used to determine the intent score deviation score of each intent based on the maximum intent score and the minimum intent score of each intent in all intent classification sets.
[0094] The weighted score correction unit is used to add the intention score deviation score of each intention to the weighted score of that intention to obtain the corrected score of that intention, and to take the intention type with the highest corrected score as the target intention of the speech information.
[0095] Optionally, all intent types appearing in the intent classification set are included in the intent labels already labeled in the total sample data used by the speech intent classifier during training, and one intent type corresponds to one intent label;
[0096] The device also includes:
[0097] The second sample proportion statistics unit is used to calculate the proportion of sample data under each intent label in the total sample data used by the voice intent classifier during training for each intent classification set.
[0098] The second compensation coefficient determination unit is used to calculate the compensation coefficient for each intent type based on the ratio.
[0099] The second compensation score determination unit is used to multiply the weighted score of each intention by the compensation coefficient of that intention to obtain the compensation score of that intention, and to take the intention type with the highest compensation score as the target intention of the voice information.
[0100] Optionally, all intent types appearing in the intent classification set are included in the intent labels already labeled in the total sample data used by the speech intent classifier during training, and one intent type corresponds to one intent label;
[0101] The device also includes:
[0102] The third sample proportion statistics unit is used to calculate the proportion of sample data under each intent label in the total sample data used by the speech intent classifier during training for each intent classification set.
[0103] The third compensation coefficient determination unit is used to calculate the compensation coefficient for each intent type based on the ratio.
[0104] The third compensation score determination unit is used to multiply the correction score of each intention by the compensation coefficient of that intention to obtain the compensation score of that intention, and to take the intention type with the highest compensation score as the target intention of the speech information.
[0105] Optionally, the analysis mode includes a fourth mode;
[0106] The target intent determination unit includes:
[0107] The eighth target intent determination subunit is used in the fourth mode to analyze the correlation between each intent in all intent classification sets and preset historical intent data, and to determine the intent type with the highest correlation with the historical intent data as the target intent of the voice information.
[0108] Optionally, the analysis mode includes a fourth mode;
[0109] The target intent determination unit includes:
[0110] The ninth target intent determination subunit is used in the fourth mode to take the intent with the highest intent score in each intent classification set as the basic intent to obtain at least one basic intent;
[0111] The tenth target intent determination subunit is used to find the intent with the highest intent score that has a similarity greater than a preset similarity threshold to each basic intent in the preset history, and use it as the reference intent corresponding to that basic intent.
[0112] The eleventh target intent determination subunit is used to determine the extended intent corresponding to each basic intent based on each basic intent and its corresponding reference intent.
[0113] The twelfth target intent determination subunit is used to determine the intent score of each extended intent based on the intent score of the basic intent corresponding to the extended intent and the intent score of the reference intent.
[0114] The thirteenth target intent determination subunit is used to determine the extended intent with the highest intent score among the various extended intents as the intent result of the speech information.
[0115] Optionally, the device may also include:
[0116] The historical information extraction unit is used to extract user behavior information after a preset date from pre-stored user historical behavior information in the fourth mode;
[0117] The behavior information analysis unit is used to analyze the frequency of each user behavior in the user behavior information and determine the target intent of the voice information.
[0118] An electronic device for voice intent recognition, comprising a memory and a processor;
[0119] The memory is used to store programs;
[0120] The processor is used to execute the program to implement the various steps of the voice intent recognition method as described above.
[0121] A readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the speech intent recognition method as described above.
[0122] By employing the above technical solution, this application obtains several intent classification sets by inputting voice information into several preset voice intent classifiers. Each intent classification set is output by a voice intent classifier. Based on the degree of difference among all intent classification sets in intent type, intent quantity, and intent score, an analysis mode for filtering the target intent of the voice information is determined. Under this analysis mode, the target intent of the voice information is determined based on each intent in all intent classification sets, or the intent score of each intent. Therefore, several voice intent classifiers will output different results for the intent analysis of the same voice information. By analyzing the degree of difference among these different results in intent type, intent quantity, and intent score, an analysis mode for filtering the target intent of the voice information can be determined. Since this analysis mode is comprehensively confirmed based on various evaluation indicators (such as intent type, intent quantity, and intent score) related to the output results, it has more accurate filtering criteria and can filter the target intent of the voice information from multiple output results. Confirming the target intent of the voice information under the determined analysis mode is more reliable, thus making subsequent voice interactions more accurate. Attached Figure Description
[0123] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the scope of this application. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:
[0124] Figure 1 A flowchart illustrating a method for implementing speech intent recognition provided in an embodiment of this application;
[0125] Figure 2 A schematic diagram of a device structure for implementing voice intent recognition provided in an embodiment of this application;
[0126] Figure 3 This is a schematic diagram of a device for implementing voice intent recognition, provided in an embodiment of this application. Detailed Implementation
[0127] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0128] The proposed solution can be implemented based on a terminal with data processing capabilities, such as a mobile phone, computer, server, or cloud platform.
[0129] Next, combined Figure 1 As shown, the speech intent recognition method of this application may include the following steps:
[0130] Step S110: Input the voice information into several preset voice intent classifiers to obtain several intent classification sets. Each intent classification set is output by one of the voice intent classifiers.
[0131] Among the preset voice intent classifiers, there may be voice intent classifiers that do not output any intent. Each voice intent classifier that outputs an intent can output an intent classification set. Each intent classification set can include at least one intent output by the voice intent classifier corresponding to the intent classification set and the intent score of each intent.
[0132] Specifically, several speech intent classifiers can be divided into different speech intent classifiers according to different intent classification logics, including rule classifiers, statistical classifiers, and other classifiers. Among them, the statistical classifier can include intent discrimination classifiers, semantic retrieval classifiers, etc., and the rule classifier has multiple conditional rules. For example, the intent classification logic of the rule classifier can be to prioritize the intents that hit the most rules.
[0133] It is understandable that, due to the different intent classification logic of each voice intent classifier, the output intent and intent score of each voice intent classifier may differ.
[0134] For example, we can assume that there are three speech intent classifiers that output the following intent classification sets for the input speech information "Let's go enjoy life tonight": Intent Classification Set A {Reading: 0.85, Eating: 0.85, Drinking Tea: 0.5}, Intent Classification Set B {Eating: 0.95, Reading: 0.6, Reading: 0.5}, and Intent Classification Set C {Drinking Tea: 0.8, Reading: 0.8, Eating: 0.4}. Here, reading, eating, and drinking tea are the output intents, and their corresponding values are the intent scores.
[0135] The examples of the three specific intent classification sets described above can serve as reference examples for subsequent examples.
[0136] Step S120: Based on the degree of difference between all the intent classification sets in terms of intent type, intent quantity, and intent score, determine the analysis mode for filtering the target intent of the voice information.
[0137] Specifically, the intent type can represent the types of intents that have appeared in all the intent classification sets, the intent quantity can represent the number of times each intent has appeared in all the intent classification sets, and the intent score can represent the probability that each intent in all the intent classification sets is the target intent of the current speech information.
[0138] Understandably, the degree of difference between the intent classification results output by various speech intent classifiers can be reflected in at least three dimensions: intent type, intent quantity, and intent score. Specifically, this includes, for example, whether the types of intents output are consistent, the differences in the quantity of various intents, and the differences in the intent scores of various intents. When all speech intent classifiers output the same intent type, the deviation between the number of various intents is small, and the distribution of intent scores for various intents is relatively balanced (e.g., the variance of the score distribution is less than a preset threshold), then it can be considered that the difference between the classification results output by these speech intent classifiers in performing intent analysis on the input speech information is small (or defined as a certain level of difference). Therefore, it can be determined that the analysis mode for filtering the target intent of the speech information is the analysis mode corresponding to the small difference (or defined as a certain level of difference).
[0139] Step S130: In the analysis mode, determine the target intent of the voice information based on each intent in the set of all intent categories, or the intent score of each intent.
[0140] Specifically, based on analysis modes corresponding to different degrees of difference, each intent in all intent classification sets can be selected for analysis, and / or the intent score of each intent can be used to determine the target intent of the speech information. Alternatively, based on the intent scores under each intent, derivative intents related to each intent in the semantic scene and the intent scores of these derivative intents can be introduced for quantitative analysis to determine the intent result of the speech information.
[0141] The voice intent recognition method provided in this application involves inputting voice information into several preset voice intent classifiers to obtain several intent classification sets. Each intent classification set is output by a voice intent classifier. Based on the degree of difference among all intent classification sets in intent type, intent quantity, and intent score, an analysis mode for filtering the target intent of the voice information is determined. Under this analysis mode, the target intent of the voice information is determined based on each intent in all intent classification sets, or the intent score of each intent. Therefore, several voice intent classifiers will output different results for the same voice information. By analyzing the degree of difference between these different results in intent type, intent quantity, and intent score, an analysis mode for filtering the target intent of the voice information can be determined. Since this analysis mode is obtained by comprehensively confirming various evaluation indicators (such as intent type, intent quantity, and intent score) related to the output results, it has more accurate filtering criteria and can filter the target intent of the voice information from multiple output results. Confirming the target intent of the voice information under the determined analysis mode is more reliable, thereby making subsequent voice interactions more accurate.
[0142] In some embodiments of this application, the process of determining the analysis pattern of the target intent for filtering the voice information based on the degree of difference between all the intent classification sets in terms of intent type, intent quantity, and intent score is described. This process may include the following four cases:
[0143] Firstly, if both the first and second conditions are met in all the intent classification sets, then the analysis mode for filtering the target intent of the voice information is determined to be the first mode.
[0144] Specifically, the first condition can be that the intents with the highest intent scores in each intent classification set are of the same intent type, and the second condition can be that the highest intent scores are all greater than a first preset score.
[0145] The first preset score can be used to determine whether the highest intent score is reliable. If the highest intent score is greater than the first preset score, it can be used to indicate that the intent corresponding to the highest intent score is a reliable output result.
[0146] It is understandable that if the intents with the highest output intent scores in each intent classification set indicate the same intent type, and the intent scores of these intents are all greater than the first preset score, it can be said that all intent classification sets are most likely to determine that the intent type is the target intent, and the intent scores of each intent type are reliable. Therefore, the degree of difference between the intent classification sets in terms of intent type, number of intents, and intent scores can be determined as the first level of difference, thereby determining the analysis mode for filtering the target intent of the voice information as the first mode.
[0147] The second approach is to determine the analysis mode for filtering the target intent of the voice information as the second mode if the first condition is not met and both the second and third conditions are met in all the intent classification sets.
[0148] The third condition is that the distribution of the number of intentions under each type of intention is balanced, and the distribution of the intention scores under each type of intention is balanced.
[0149] It is understandable that a balanced distribution of intent quantity under each intent type indicates that the difference in the number of intents under each intent type output by all intent classification sets is small. In one implementation, the distribution of intent quantity under each intent type can be determined by using an intent quantity difference threshold.
[0150] For example, if the threshold for the difference in the number of intents is 4, and the intent category set A is {reading: 0.85, eating: 0.85, drinking tea: 0.5}, the intent category set B is {eating: 0.95, reading: 0.6, reading: 0.5}, and the intent category set C is {drinking tea: 0.8, reading: 0.8, eating: 0.4}, then the number of eating intents is 3, the number of drinking tea intents is 2, and the number of reading intents is 4. Therefore, the difference in the number of intents for each category is |2-(2+3+4) / 3|+|3-(2+3+4) / 3|+|4-(2+3+4) / 3|=2>4, indicating a balanced distribution of intent counts across all intent categories.
[0151] It should be noted that the balanced distribution of intent quantity under each intent type can be represented by various specific implementation methods. For example, the difference between each pair of intents under each intent type can be compared with an intent quantity difference threshold to determine whether the intent quantity distribution is balanced. Alternatively, the variance of the intent quantity under each intent type can be calculated and compared with the intent quantity difference threshold to determine whether the intent quantity distribution is balanced. The intent quantity difference threshold can be set according to specific circumstances. This embodiment of the invention does not specifically limit the specific manifestation of the balanced distribution of intent quantity under each intent type or the evaluation method for determining whether it is balanced.
[0152] It is understandable that a balanced distribution of intent scores across different intent categories indicates that the differences in intent scores across different intent categories are relatively small. In one implementation, an intent score difference threshold can be used to determine whether the intent scores of each intent in each intent category set are evenly distributed.
[0153] For example, with an intent score difference threshold of 0.5, for intent categories A, B, and C, the scores for each intent category of "reading" are (0.85, 0.6, 0.5, 0.8), so the difference between the highest and lowest intent scores for "reading" is 0.85 - 0.5 = 0.35; the scores for each intent category of "eating" are (0.85, 0.95, 0.4), so the difference between the highest and lowest intent scores for "eating" is 0.85 - 0.4 = 0.45; and the scores for each intent category of "drinking tea" are (0.5, 0.8), so the difference between the highest and lowest intent scores for "drinking tea" is 0.8 - 0.5 = 0.3. Since the differences between the highest and lowest intent scores for each of the above intent categories are all less than 0.5, this indicates that the intent score distribution is balanced across all intent categories.
[0154] It should be noted that the balanced distribution of intent scores under each intent category can be represented in various specific ways. For example, the average intent score under each intent category can be compared with the intent score difference threshold to determine whether the intent score distribution is balanced. Alternatively, the variance of intent scores under each intent category can be calculated for all intent scores, and then each variance can be compared with the intent score difference threshold to determine whether the intent score distribution is balanced. The intent score difference threshold can be set according to specific circumstances. This embodiment of the invention does not specifically limit the specific manifestation of the balanced distribution of intent scores under each intent category or the evaluation method for determining whether it is balanced.
[0155] Specifically, if the first condition is not met, but the second and third conditions are both met, the degree of difference between the intent classification set in terms of intent type, intent quantity, and intent score can be defined as the second level of difference. Then, the analysis mode for filtering the target intent of the voice information can be determined as the second mode.
[0156] Third, if neither the first nor the fourth condition is met, and the second and third conditions are not met simultaneously, then the analysis mode for the target intent of the voice information is determined to be the third mode.
[0157] Specifically, the fourth condition is that the score of each intent in all intent classification sets is less than the second preset score.
[0158] The second preset score can represent the reliability judgment score of each intent score, and the second preset score is less than the first preset score.
[0159] It is understandable that when the fourth condition is not met, it means that the scores of each intent in all intent classification sets are not all less than the second preset score, that is, there are intent results in all intent classification sets with intent scores greater than the second preset score. At this time, the second preset score can be used as an evaluation index to assess the reliability of the intent results output by each speech intent classifier. It can be said that the output results of all speech intent classifiers are reliable. The degree of difference between the intent classification sets in terms of intent type, intent quantity, and intent score can be defined as the third level of difference. Then, the analysis mode for filtering the target intent of the speech information is determined as the third mode.
[0160] Fourth, if the fourth condition is met, then the analysis mode for the target intent of the voice information is determined to be the fourth mode.
[0161] It is understandable that if the score of each intent in all intent classification sets is less than the second preset score, it can be said that the output results of all speech intent classifiers are unreliable. The degree of difference between the intent classification sets in terms of intent type, intent quantity, and intent score can be defined as the fourth level of difference. Then, the analysis mode for selecting the target intent of the speech information is determined to be the fourth mode.
[0162] The speech intent recognition method provided in this application determines the analysis mode for filtering the speech information by analyzing whether a first, second, third, and fourth condition are met. The first mode defines the condition that the highest-scoring intent category in each intent category set is the same, indicating a high degree of consistency in the output results of each speech intent classifier. The second mode defines the condition that the output results of each speech intent classifier are relatively consistent, i.e., the distribution of intent and intent score in the output results is balanced. The third mode defines the condition that the output results of each speech intent classifier differ significantly, but the output results of each speech intent classifier still contain intent scores higher than a second preset score, i.e., the output results of each speech intent classifier are still reliable. The fourth mode defines the condition that the intent scores output by each speech intent classifier are all lower than the second preset score, i.e., the output results of each speech intent classifier are unreliable. Different combinations of conditions may result in different analysis modes for analyzing the target intent, different ways of determining the target intent, and make the analysis of the target intent of the speech information more appropriate, accurate, and reliable under the corresponding analysis mode.
[0163] In some embodiments of this application, when the analysis mode for filtering the target intent of the voice information mentioned in the above embodiments is the first mode, the process of determining the target intent of the voice information according to each intent in all intent classification sets, or the intent score of each intent, as mentioned in the above embodiments, under the analysis mode, is described. This process may specifically include:
[0164] In the first mode, the intent with the highest intent score in each intent category set is determined as the target intent of the voice information.
[0165] It is understandable that when all intent classification sets determine that a certain intent type is most likely to be the target intent, then that intent type can be determined as the target intent of the voice information.
[0166] The voice intent recognition method provided in this application embodiment, in the first mode, can directly determine the intent with the highest intent score in each intent category set among all intent category sets as the target intent of the voice information, thereby reducing the complexity of determining the target intent.
[0167] In some embodiments of this application, when the analysis mode for filtering the target intent of the voice information mentioned in the above embodiments is the second mode, the process of determining the target intent of the voice information based on each intent in all intent classification sets, or the intent score of each intent, as mentioned in the above embodiments, under the analysis mode, is described. This process may specifically include:
[0168] S1. In the second mode, determine the intents whose intent scores are higher than a preset score threshold under each intent category in all intent classification sets, and identify them as candidate intents for that type of intent.
[0169] Specifically, the preset score threshold can represent a score that indicates a high degree of reliability in determining the intent, and the preset score threshold can be between the first preset score and the second preset score.
[0170] For example, with a preset score threshold of 0.7, and intent classification set A {reading: 0.85, eating: 0.85, drinking tea: 0.5}, intent classification set B {eating: 0.95, reading: 0.6, reading: 0.5}, and intent classification set C {drinking tea: 0.8, reading: 0.8, eating: 0.4}, then the candidate intents for the "reading" intent are "reading" in A (0.85) and "reading" in C (0.8). The candidate intents for the "eating" intent are "eating" in A (0.85) and "eating" in B (0.95). The candidate intent for the "drinking tea" intent is "drinking tea" in C (0.8).
[0171] S2. Sum the intent scores of each candidate intent in each intent to obtain the total intent score for that intent.
[0172] For example, for intent classification sets A, B, and C, the total intent score for the intent to read is 0.85 + 0.8 = 1.65, the total intent score for the intent to eat is 0.85 + 0.95 = 1.8, and the total intent score for the intent to drink tea is 0.8.
[0173] S3. The intent type with the highest total intent score is determined as the target intent of the voice information.
[0174] For example, for intent classification sets A, B, and C, the intent to eat has the highest total score, so the intent to eat can be determined as the target intent of the voice information.
[0175] The voice intent recognition method provided in this application embodiment, in the second mode, can statistically analyze intents that are higher than a preset score threshold according to intent type, thereby determining the intent with the highest total statistical intent score as the target intent of the voice information, effectively filtering out intents with low (or unreliable) intent scores.
[0176] Considering that in the training data for training a speech intent classifier, there may be instances where the sample data corresponding to some intent labels is relatively small, the trained classifier will tend to output intents with a larger proportion of training samples, while neglecting intents with a smaller proportion. Figure 1 Once an output is received, it indicates that the output result is more important and needs to be compensated. All intent categories appearing in the intent classification set are already included in the intent labels labeled in the total sample data used during the training of the speech intent classifier. One intent category corresponds to one intent label. Based on this, the speech intent recognition method of this application further includes a process of compensating for the total intent score, which may include:
[0177] S1. Calculate the proportion of sample data under each intent label in the total sample data used during training of the speech intent classifier corresponding to each intent classification set.
[0178] S2. Calculate the compensation coefficient for the intent type corresponding to each intent tag based on the ratio.
[0179] S3. Multiply the total intention score of each intention by the compensation coefficient of that intention to obtain the compensation score of that intention, and take the intention type with the highest compensation score as the target intention of the voice information.
[0180] The speech intent recognition method provided in this application combines the training sample data of the speech intent classifier during its training, determines the compensation coefficient of each intent by the proportion of sample data for each intent, and compensates the total intent score for each intent, so that the obtained target intent is more reliable.
[0181] In some embodiments of this application, when the analysis mode for filtering the target intent of the voice information mentioned in the above embodiments is the third mode, the process of determining the target intent of the voice information according to each intent in all intent classification sets, or the intent score of each intent, as mentioned in the above embodiments, is described. This process may specifically include:
[0182] S1. In the third mode, determine the intent number difference coefficient for each intent based on the number of each intent in all intent classification sets.
[0183] Specifically, a preset mapping function can be used to merge the number of each type of intent in all intent classification sets, thereby mapping each intent to obtain the intent number difference coefficient for that type of intent.
[0184] The preset mapping function may include, but is not limited to, linear regression functions, nonlinear activation functions, and nonlinear model functions, such as sigmoid, relu, tanh, and logistic functions.
[0185] For example, consider the intent classification set A {reading: 0.85, eating: 0.85, drinking tea: 0.5}, intent classification set B {eating: 0.95, reading: 0.6, reading: 0.5}, and intent classification set C {drinking tea: 0.8, reading: 0.8, eating: 0.4}. Here, reading, eating, and drinking tea are the output intents, and their corresponding values are the intent scores. The number of reading, eating, and drinking tea intents are 4, 3, and 2 respectively. Therefore, using the sigmoid algorithm, the difference coefficients between the number of intents for drinking tea, eating, and reading are 0.88, 0.952, and 0.982, respectively.
[0186] It should be noted that, in this embodiment, the difference coefficient of the number of intents for various intents can characterize the degree of tendency of several voice intent classifiers that output intent classification sets to output that kind of intent. When the difference coefficient of the number of intents for a certain intent is larger, it means that each voice intent classifier is more inclined to output that kind of intent, and the greater the possibility that the kind of intent is the target intent.
[0187] S2. Based on the intent score of each intent in each intent, calculate the average score of each intent across all intent categories.
[0188] Understandably, the average score of each intent across all intent categories can represent the likelihood of each intent being the target intent of the speech information.
[0189] Specifically, the process of calculating the average score of each intent across all intent categories, based on the intent score of each intent within each intent category, may include:
[0190] S21. Accumulate the intent scores of each intent of the same type in all intent classification sets to obtain the cumulative score of each intent.
[0191] For example, considering intention categories A, B, and C, the cumulative score for the intention to read is 0.85 + 0.6 + 0.5 + 0.8 = 2.75, the cumulative score for the intention to eat is 0.85 + 0.95 + 0.4 = 2.2, and the cumulative score for the intention to drink tea is 0.5 + 0.8 = 1.3. The number of reading intentions (in all intention categories) is 4, the number of eating intentions (in all intention categories) is 3, and the number of tea intentions (in all intention categories) is 2. Therefore, the average score for the reading intention is 2.75 / 4 = 0.6875, the average score for the eating intention is 2.2 / 3 = 0.7333, and the average score for the tea intention is 1.3 / 2 = 0.65.
[0192] S22. In all intent classification sets, divide the total intent score for each intent by the number of such intents to obtain the average score for that intent.
[0193] For example, considering the intention categories A, B, and C, the average score for the intention to read is 2.75 / 4 = 0.6875, the average score for the intention to eat is 2.2 / 3 = 0.7333, and the average score for the intention to drink tea is 1.3 / 2 = 0.65.
[0194] S3. Multiply the difference coefficient of the number of intentions for each intention by the average score of that intention to obtain the weighted score of that intention, and take the intention type with the highest weighted score among all intentions as the target intention of the voice information.
[0195] For example, considering the intention categories A, B, and C, the weighted score for the intention to read is 0.6875 * 0.982 ≈ 0.675, the weighted score for the intention to eat is 0.7333 * 0.952 ≈ 0.698, and the weighted score for the intention to drink tea is 0.65 * 0.88 = 0.572.
[0196] The speech intent recognition method provided in this application calculates the average score of each intent and the intent number difference coefficient. The average score of each intent can represent the score base of the intent that can be output as the target intent, and the intent number difference coefficient of each intent can represent the weighting coefficient of the intent that is considered as the target intent. By multiplying the average score of each intent by the intent number difference coefficient, a weighted score for comprehensively weighing the intent as the target intent can be obtained, and the intent type with the highest weighted score among all intents is taken as the target intent of the speech information.
[0197] Considering the differences between the scores of each intent, the weighted score of each intent is adjusted to make the weighing of the target intent among each intent more objective and reasonable. Based on this, the speech intent recognition method proposed in this application also includes a process of adjusting the weighted score, which may include:
[0198] S1. Determine the intention score deviation score for each intention based on the maximum and minimum intention scores of each intention in all intention classification sets.
[0199] Specifically, the maximum and minimum intent scores for each intent can be merged using a preset mapping function, thereby mapping each intent to obtain the intent score deviation score for that intent.
[0200] The preset mapping function may include, but is not limited to, linear regression functions, nonlinear activation functions, and nonlinear model functions, such as sigmoid, relu, tanh, and logistic functions.
[0201] For example, consider the intent classification set A {reading: 0.85, eating: 0.85, drinking tea: 0.5}, intent classification set B {eating: 0.95, reading: 0.6, reading: 0.5}, and intent classification set C {drinking tea: 0.8, reading: 0.8, eating: 0.4}. The maximum intent score for the eating intent is 0.95, and the minimum intent score is 0.4. The maximum intent score for reading is 0.85, and the minimum intent score is 0.5. The maximum intent score for drinking tea is 0.8, and the minimum intent score is 0.5. Using the sigmoid algorithm, the intent score deviations for drinking tea, eating, and reading are 0.365, 0.413, and 0.425, respectively.
[0202] S2. Add the intention score deviation score of each intention to the weighted score of that intention to obtain the corrected score of that intention, and take the intention type with the highest corrected score as the target intention of the speech information.
[0203] For example, considering the intent classification sets A, B, and C, the corrected score for the intent to read is 0.675 + 0.413 = 1.088, the corrected score for the intent to eat is 0.698 + 0.365 = 1.063, and the corrected score for the intent to drink tea is 0.572 + 0.425 = 0.997. Therefore, the intent with the highest corrected score is the intent to read, which is the target intent of the voice information.
[0204] The speech intent recognition method provided in this application calculates the intent score deviation between the maximum and minimum intent scores for each intent and corrects the weighted score, thereby balancing the differences between the various intent scores for each intent and making the obtained target intent more reliable.
[0205] Considering that in the training data for training a speech intent classifier, there may be instances where the sample data corresponding to some intent labels is relatively small, the trained classifier will tend to output intents with a larger proportion of training samples, while neglecting intents with a smaller proportion. Figure 1 Once an output is received, it indicates that the output result is more important and needs to be compensated. All intent categories appearing in the intent classification set are already included in the intent labels labeled in the total sample data used during the training of the speech intent classifier. One intent category corresponds to one intent label. Based on this, the speech intent recognition method of this application further includes a weighted score compensation process, which may include:
[0206] S1. Calculate the proportion of sample data under each intent label in the total sample data used during training of the speech intent classifier corresponding to each intent classification set.
[0207] S2. Calculate the compensation coefficient for the intent type corresponding to each intent tag based on the ratio.
[0208] S3. Multiply the weighted score of each intention by the compensation coefficient of that intention to obtain the compensation score of that intention, and take the intention type with the highest compensation score as the target intention of the voice information.
[0209] The speech intent recognition method provided in this application combines the training sample data of the speech intent classifier during its training, determines the compensation coefficient of each intent by the proportion of sample data for each intent, and compensates the weighted score of each intent, so that the obtained target intent is more reliable.
[0210] Considering that in the training data for training a speech intent classifier, there may be instances where the sample data corresponding to some intent labels is relatively small, the trained classifier will tend to output intents with a larger proportion of training samples, while neglecting intents with a smaller proportion. Figure 1Once an output is received, it indicates that the output result is more important and needs to be compensated. All intent categories appearing in the intent classification set are already included in the intent labels labeled in the total sample data used during the training of the speech intent classifier. One intent category corresponds to one intent label. Based on this, the speech intent recognition method of this application further includes a process of score correction compensation, which may include:
[0211] S1. Calculate the proportion of sample data under each intent label in the total sample data used during training of the speech intent classifier corresponding to each intent classification set.
[0212] S2. Calculate the compensation coefficient for the intent type corresponding to each intent tag based on the ratio.
[0213] S3. Multiply the correction score of each intention by the compensation coefficient of that intention to obtain the compensation score of that intention, and take the intention type with the highest compensation score as the target intention of the speech information.
[0214] The speech intent recognition method provided in this application combines the training sample data of the speech intent classifier during its training, determines the compensation coefficient of each intent by the proportion of sample data for each intent, and compensates the correction score of each intent, so that the obtained target intent is more reliable.
[0215] In some embodiments of this application, when the analysis mode for filtering the target intent of the voice information mentioned in the above embodiments is the fourth mode, the process of determining the target intent of the voice information based on each intent in all intent classification sets, or the intent score of each intent, as mentioned in the above embodiments, is described. This process may specifically include the following two cases:
[0216] In the first method, under the fourth mode, the correlation between each intent in all intent classification sets and preset historical intent data is analyzed, and the intent type with the highest correlation with the historical intent data is determined as the target intent of the voice information.
[0217] Understandably, the fourth mode can indicate that the output of these speech intent classifiers is the most unreliable, and the output is unreliable, requiring other conditions (such as historical intent) to assist in the analysis.
[0218] Specifically, the preset historical intent data contains various intents. These intents can be sorted according to the number of times they were identified as the final intent type in history. Intentions ranked higher (i.e., those identified more frequently in history) have higher weight scores, and vice versa. The intent score of each intent output from all intent classification sets is then multiplied by the weight score of the intent that matches it in the historical intent data to obtain the relevance score of that intent. Finally, the relevance scores of various intents are obtained. Sorting these relevance scores from high to low yields a relevance ranking of the various intents. The intent type with the highest relevance score is identified as the intent result of the voice information, indicating that this intent type has the highest (or strongest) relevance.
[0219] The second method, S1, in the fourth mode, takes the intent with the highest intent score in each intent classification set as the basic intent, and obtains at least one basic intent.
[0220] It is understandable that, since there may be multiple intentions with the same score in the same intention category set, multiple basic intentions can be obtained when there are multiple intentions with the same score.
[0221] S2. In the preset history, find the intent with the highest intent score that has a similarity greater than the preset similarity threshold to each basic intent, and use it as the reference intent corresponding to that basic intent.
[0222] For example, when it comes to eating, you can search the history to find out that you want to eat snacks; when it comes to reading, you can search the history to find out that you want to read literature; and when it comes to drinking tea, you can search the history to find out that you want to drink soup.
[0223] S3. Based on each basic intent and its corresponding reference intent, determine the extended intent corresponding to that basic intent.
[0224] Specifically, the extended intent can be an intent stored in the history.
[0225] For example, based on eating and having snacks, we can determine that the extended intention is eating vegetables; based on reading books and reading documents, we can determine that the extended intention is reading articles; based on drinking tea and drinking soup, we can determine that the extended intention is drinking porridge.
[0226] Among them, the three intentions of eating vegetables, reading articles, and drinking porridge can all be intentions stored in the history.
[0227] S4. For each extended intent, determine the intent score of the extended intent based on the intent score of the basic intent corresponding to the extended intent and the intent score of the reference intent.
[0228] Specifically, the intent score of an extended intent can be the average or weighted average of the intent scores of the basic intent corresponding to the extended intent and the reference intent corresponding to the extended intent.
[0229] S5. Among the various extended intentions, the extended intention with the highest intention score is determined as the intention result of the voice information.
[0230] Specifically, the extended intent with the highest intent score can be represented as the intent that is closest to the user's true intent when the outputs of various voice intent classifiers differ greatly and are unreliable, by combining the intents in the historical records.
[0231] The voice intent recognition method provided in this application embodiment can obtain the intent result of voice information by combining the intent in the historical record in the fourth mode, thereby weakening the unreliable results output by each voice intent classifier and strengthening the intent result obtained from the analysis of the historical record, so that the result is closer to the user's real intent and more realistic and reliable.
[0232] In some embodiments of this application, when the analysis mode for the target intent of filtering the voice information mentioned in the above embodiments is the fourth mode, the voice intent recognition method provided by this application may further include a process of referencing user historical behavior information to analyze the target intent, which may include:
[0233] S1. Extract user behavior information after a preset date from the pre-stored user history behavior information.
[0234] Specifically, the preset date can be represented as a reasonable reference date for analyzing user behavior information. The preset date can be customized, such as one month ago from the current date.
[0235] It is understandable that user behavior information after a preset date is recent user behavior information, which can represent some behaviors that the user has recently performed. When the voice intent classifier fails or the output results are unreliable, it has a major reference role in analyzing the target intent.
[0236] S2. Analyze the frequency of each user behavior in the user behavior information to determine the target intent of the voice information.
[0237] Specifically, the frequency of each behavior performed by the user can be statistically analyzed in the user behavior information after a preset date. The behaviors performed more frequently by the user in the historical behavior information can be used as a prediction of the current user's voice intent, so as to reveal that the user is more likely to perform the behavior, thereby determining the target intent of the voice information.
[0238] The voice intent recognition method provided in this application embodiment can analyze the user's recently executed behavior information from the user's historical behavior information in the fourth mode, analyze the behavior that the user is more likely to execute (the corresponding intent), and determine the target intent of the voice information. Compared with the unreliable output results of each voice intent classifier, it is more reliable.
[0239] The apparatus for implementing voice intent recognition provided in the embodiments of this application will be described below. The apparatus for implementing voice intent recognition described below can be referred to in correspondence with the method for implementing voice intent recognition described above.
[0240] See Figure 2 , Figure 2 This is a schematic diagram of a device structure for implementing voice intent recognition disclosed in an embodiment of this application.
[0241] like Figure 2 As shown, the device may include:
[0242] The intent classification set acquisition unit 11 is used to input voice information into several preset voice intent classifiers to obtain several intent classification sets. Each intent classification set is output by one of the voice intent classifiers. Each intent classification set includes at least one intent and an intent score for each intent.
[0243] The analysis mode determination unit 12 is used to determine the analysis mode for filtering the voice information based on the degree of difference between all the intent classification sets in intent type, intent quantity, and intent score.
[0244] The target intent determination unit 13 is used to determine the target intent of the voice information based on each intent in all intent classification sets and / or the intent score of each intent in the analysis mode.
[0245] Optionally, the analysis mode determination unit includes:
[0246] The first mode determination unit is used to determine the analysis mode of the target intent for filtering the voice information as the first mode if the first condition and the second condition are both met in all the intent classification sets. The first condition is that the intents with the highest intent scores in each intent classification set are of the same type, and the second condition is that the highest intent scores are all greater than a first preset score.
[0247] The second mode determination unit is used to determine the analysis mode of the target intent for filtering the voice information as the second mode if the first condition is not met and both the second and third conditions are met in all the intent classification sets. The third condition is that the number of intents under each intent category is evenly distributed and the intent score under each intent category is evenly distributed.
[0248] The third mode determination unit is used to determine the analysis mode of the target intent for filtering the voice information as the third mode if neither the first condition nor the fourth condition is met, and the second condition and the third condition are not met simultaneously. The fourth condition is that the score of each intent in all intent classification sets is less than the second preset score, and the second preset score is less than the first preset score.
[0249] The fourth mode determination unit is used to determine the analysis mode of the target intent for filtering the voice information as the fourth mode if the fourth condition is met.
[0250] Optionally, the analysis mode includes a first mode;
[0251] The target intent determination unit includes:
[0252] The first target intent determination subunit is used to determine, in the first mode, the intent with the highest intent score in each intent category set among all intent category sets, as the target intent of the voice information.
[0253] Optionally, the analysis mode includes a second mode;
[0254] The target intent determination unit includes:
[0255] The second target intent determination subunit is used to determine, in the second mode, intents whose intent scores under each intent category in all intent classification sets are higher than a preset score threshold, and to identify them as candidate intents for that type of intent.
[0256] The third target intent determination subunit is used to accumulate the intent scores of each candidate intent in each intent to obtain the total intent score of that intent.
[0257] The fourth target intent determination subunit is used to determine the intent type with the highest total intent score as the target intent of the voice information.
[0258] Optionally, all intent types appearing in the intent classification set are included in the intent labels already labeled in the total sample data used by the speech intent classifier during training, and one intent type corresponds to one intent label;
[0259] The device also includes:
[0260] The first sample proportion statistics unit is used to calculate the proportion of sample data under each intent label in the total sample data used by the voice intent classifier during training for each intent classification set.
[0261] The first compensation coefficient determination unit is used to calculate the compensation coefficient for each intent type based on the ratio.
[0262] The first compensation score determination unit is used to multiply the total intention score of each intention by the compensation coefficient of that intention to obtain the compensation score of that intention, and to take the intention type with the highest compensation score as the target intention of the voice information.
[0263] Optionally, the analysis mode includes a third mode;
[0264] The target intent determination unit includes:
[0265] The fifth target intent determination subunit is used to determine the intent number difference coefficient for each intent based on the number of each intent in all intent classification sets in the third mode;
[0266] The sixth target intent determination subunit is used to calculate the average score of each intent across all intent classification sets based on the intent score of each intent within each intent.
[0267] The seventh target intent determination subunit is used to multiply the intent number difference coefficient of each intent by the average score of that intent to obtain the weighted score of that intent, and take the intent type with the highest weighted score among all intents as the target intent of the speech information.
[0268] Optionally, the sixth target intent determination subunit includes:
[0269] The intent total score determination unit is used to accumulate the intent scores of each intent of the same intent in all intent classification sets to obtain the cumulative score of each intent.
[0270] The average score calculation unit is used to divide the cumulative score of each intent by the number of intents of that type across all intent classification sets to obtain the average score of that intent.
[0271] Optionally, the device may also include:
[0272] The intent score deviation score determination unit is used to determine the intent score deviation score of each intent based on the maximum intent score and the minimum intent score of each intent in all intent classification sets.
[0273] The weighted score correction unit is used to add the intention score deviation score of each intention to the weighted score of that intention to obtain the corrected score of that intention, and to take the intention type with the highest corrected score as the target intention of the speech information.
[0274] Optionally, all intent types appearing in the intent classification set are included in the intent labels already labeled in the total sample data used by the speech intent classifier during training, and one intent type corresponds to one intent label;
[0275] The device also includes:
[0276] The second sample proportion statistics unit is used to calculate the proportion of sample data under each intent label in the total sample data used by the voice intent classifier during training for each intent classification set.
[0277] The second compensation coefficient determination unit is used to calculate the compensation coefficient for each intent type based on the ratio.
[0278] The second compensation score determination unit is used to multiply the weighted score of each intention by the compensation coefficient of that intention to obtain the compensation score of that intention, and to take the intention type with the highest compensation score as the target intention of the voice information.
[0279] Optionally, all intent types appearing in the intent classification set are included in the intent labels already labeled in the total sample data used by the speech intent classifier during training, and one intent type corresponds to one intent label;
[0280] The device also includes:
[0281] The third sample proportion statistics unit is used to calculate the proportion of sample data under each intent label in the total sample data used by the speech intent classifier during training for each intent classification set.
[0282] The third compensation coefficient determination unit is used to calculate the compensation coefficient for each intent type based on the ratio.
[0283] The third compensation score determination unit is used to multiply the correction score of each intention by the compensation coefficient of that intention to obtain the compensation score of that intention, and to take the intention type with the highest compensation score as the target intention of the speech information.
[0284] Optionally, the analysis mode includes a fourth mode;
[0285] The target intent determination unit includes:
[0286] The eighth target intent determination subunit is used in the fourth mode to analyze the correlation between each intent in all intent classification sets and preset historical intent data, and to determine the intent type with the highest correlation with the historical intent data as the target intent of the voice information.
[0287] Optionally, the analysis mode includes a fourth mode;
[0288] The target intent determination unit includes:
[0289] The ninth target intent determination subunit is used in the fourth mode to take the intent with the highest intent score in each intent classification set as the basic intent to obtain at least one basic intent;
[0290] The tenth target intent determination subunit is used to find the intent with the highest intent score that has a similarity greater than a preset similarity threshold to each basic intent in the preset history, and use it as the reference intent corresponding to that basic intent.
[0291] The eleventh target intent determination subunit is used to determine the extended intent corresponding to each basic intent based on each basic intent and its corresponding reference intent.
[0292] The twelfth target intent determination subunit is used to determine the intent score of each extended intent based on the intent score of the basic intent corresponding to the extended intent and the intent score of the reference intent.
[0293] The thirteenth target intent determination subunit is used to determine the extended intent with the highest intent score among the various extended intents as the intent result of the speech information.
[0294] Optionally, the device may also include:
[0295] The historical information extraction unit is used to extract user behavior information after a preset date from pre-stored user historical behavior information in the fourth mode;
[0296] The behavior information analysis unit is used to analyze the frequency of each user behavior in the user behavior information and determine the target intent of the voice information.
[0297] The voice intent recognition apparatus provided in this application embodiment can be applied to devices for voice intent recognition, such as terminals: mobile phones, computers, etc. Optionally, Figure 3 The hardware structure block diagram for voice intent recognition is shown below. Figure 3 The hardware structure of a voice intent recognition device may include: at least one processor 1, at least one communication interface 2, at least one memory 3, and at least one communication bus 4;
[0298] In this embodiment of the application, the number of processor 1, communication interface 2, memory 3, and communication bus 4 is at least one, and processor 1, communication interface 2, and memory 3 communicate with each other through communication bus 4;
[0299] Processor 1 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention.
[0300] Memory 3 may include high-speed RAM, and may also include non-volatile memory, such as at least one disk storage device;
[0301] The memory stores a program, which the processor can call. The program is used for:
[0302] Voice information is input into several preset voice intent classifiers to obtain several intent classification sets. Each intent classification set is output by one of the voice intent classifiers. Each intent classification set includes at least one intent and an intent score for each intent.
[0303] Based on the degree of difference among all the aforementioned intent classification sets in terms of intent type, intent quantity, and intent score, an analysis pattern for the target intent to filter the voice information is determined.
[0304] In the analysis mode, the target intent of the voice information is determined based on each intent in all intent classification sets, and / or the intent score of each intent.
[0305] Optionally, the refined and extended functions of the program can be found in the description above.
[0306] This application embodiment also provides a storage medium that can store a program suitable for execution by a processor, the program being used for:
[0307] Voice information is input into several preset voice intent classifiers to obtain several intent classification sets. Each intent classification set is output by one of the voice intent classifiers. Each intent classification set includes at least one intent and an intent score for each intent.
[0308] Based on the degree of difference among all the aforementioned intent classification sets in terms of intent type, intent quantity, and intent score, an analysis pattern for the target intent to filter the voice information is determined.
[0309] In the analysis mode, the target intent of the voice information is determined based on each intent in all intent classification sets, and / or the intent score of each intent.
[0310] Optionally, the refined and extended functions of the program can be found in the description above.
[0311] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0312] The various embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can be referred to each other.
[0313] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for speech intent recognition, characterized in that, include: Voice information is input into several preset voice intent classifiers to obtain several intent classification sets. Each intent classification set is output by one of the voice intent classifiers. Each intent classification set includes at least one intent and an intent score for each intent. Based on the degree of difference among all the aforementioned intent classification sets in terms of intent type, intent quantity, and intent score, an analysis pattern for the target intent to filter the voice information is determined. In the analysis mode, the target intent of the voice information is determined based on each intent in all intent classification sets, and / or the intent score of each intent; The step of determining the analysis pattern for filtering the voice information based on the degree of difference among all the intent classification sets in intent type, intent quantity, and intent score includes: In all the intent classification sets, if the first condition and the second condition are both met, then the analysis mode for the target intent of the voice information is determined to be the first mode. The first condition is that the intents with the highest intent scores in each intent classification set are of the same type, and the second condition is that the highest intent scores are all greater than a first preset score. In all the intent classification sets, if the first condition is not met, and both the second and third conditions are met, then the analysis mode for filtering the target intent of the voice information is determined to be the second mode. The third condition is that the number of intents under each intent category is evenly distributed, and the intent score under each intent category is evenly distributed. If neither the first condition nor the fourth condition is met, and the second condition and the third condition are not met simultaneously, then the analysis mode for the target intent of the voice information is determined to be the third mode. The fourth condition is that the score of each intent in all intent classification sets is less than the second preset score, and the second preset score is less than the first preset score. If the fourth condition is met, then the analysis mode for the target intent of the voice information is determined to be the fourth mode.
2. The method according to claim 1, characterized in that, The analysis mode includes a first mode; In the analysis mode, the target intent of the voice information is determined based on each intent in all intent classification sets, and / or the intent score of each intent, including: In the first mode, the intent with the highest intent score in each intent category set is determined as the target intent of the voice information.
3. The method according to claim 1, characterized in that, The analysis mode includes a second mode; In the analysis mode, the target intent of the voice information is determined based on each intent in all intent classification sets, and / or the intent score of each intent, including: In the second mode, intentions whose intention scores are higher than a preset score threshold under each intention category in all intention classification sets are identified as candidate intentions for that type of intention; The intent scores of each candidate intent in each intent are summed to obtain the total intent score for that intent. The intent type with the highest total intent score is determined as the target intent of the voice information.
4. The method according to claim 3, characterized in that, All intent types appearing in the intent classification set are included in the intent labels already labeled in the total sample data used by the speech intent classifier during training, and one intent type corresponds to one intent label; The method also includes: The proportion of sample data under each intent label in the total sample data used during training of the speech intent classifier corresponding to each intent classification set is calculated. The compensation coefficient for each intent type is calculated based on the aforementioned ratio. The total intention score for each intention is multiplied by the compensation coefficient for that intention to obtain the compensation score for that intention, and the intention type with the highest compensation score is taken as the target intention of the speech information.
5. The method according to claim 1, characterized in that, The analysis mode includes a third mode; In the analysis mode, the target intent of the voice information is determined based on each intent in all intent classification sets, and / or the intent score of each intent, including: In the third mode, the number of intents difference coefficients for each intent are determined based on the number of each intent in all intent classification sets; Calculate the average score of each intent across all intent categories based on the intent score of each intent within each intent category; The intention number difference coefficient for each intention is multiplied by the average score of that intention to obtain the weighted score of that intention, and the intention type with the highest weighted score among all intentions is taken as the target intention of the speech information.
6. The method according to claim 5, characterized in that, The step of calculating the average score of each intent across all intent categories based on the intent score of each intent within each intent category includes: The intent scores of each intent of the same type in all intent classification sets are summed to obtain the cumulative score for each intent. In all intent categories, the cumulative score for each intent is divided by the number of intents of that type to obtain the average score for that intent.
7. The method according to claim 5 or 6, characterized in that, Also includes: Based on the maximum and minimum intent scores for each intent in all intent classification sets, determine the intent score deviation score for that intent. The intention score deviation score of each intention is added to the weighted score of that intention to obtain the corrected score of that intention, and the intention type with the highest corrected score is taken as the target intention of the speech information.
8. The method according to claim 5 or 6, characterized in that, All intent types appearing in the intent classification set are included in the intent labels already labeled in the total sample data used by the speech intent classifier during training, and one intent type corresponds to one intent label; The method also includes: The proportion of sample data under each intent label in the total sample data used during training of the speech intent classifier corresponding to each intent classification set is calculated. The compensation coefficient for each intent type is calculated based on the aforementioned ratio. The weighted score of each intent is multiplied by the compensation coefficient of that intent to obtain the compensation score of that intent, and the intent type with the highest compensation score is taken as the target intent of the speech information.
9. The method according to claim 7, characterized in that, All intent types appearing in the intent classification set are included in the intent labels already labeled in the total sample data used by the speech intent classifier during training, and one intent type corresponds to one intent label; The method also includes: The proportion of sample data under each intent label in the total sample data used during training of the speech intent classifier corresponding to each intent classification set is calculated. The compensation coefficient for each intent type is calculated based on the aforementioned ratio. The correction score for each intent is multiplied by the compensation coefficient for that intent to obtain the compensation score for that intent, and the intent type with the highest compensation score is taken as the target intent of the speech information.
10. The method according to claim 1, characterized in that, The analysis mode includes a fourth mode; In the analysis mode, the target intent of the voice information is determined based on each intent in all intent classification sets, and / or the intent score of each intent, including: In the fourth mode, the correlation between each intent in all intent classification sets and preset historical intent data is analyzed, and the intent type with the highest correlation with the historical intent data is determined as the target intent of the voice information.
11. The method according to claim 1, characterized in that, The analysis mode includes a fourth mode; In the analysis mode, the target intent of the voice information is determined based on each intent in all intent classification sets, and / or the intent score of each intent, including: In the fourth mode, the intent with the highest intent score in each intent category set is taken as the basic intent, resulting in at least one basic intent; In the preset history, find the intent with the highest intent score that has a similarity greater than a preset similarity threshold to each basic intent, and use it as the reference intent corresponding to that basic intent; Based on each basic intent and its corresponding reference intent, determine the extended intent corresponding to that basic intent; For each extended intent, the intent score of the extended intent is determined based on the intent score of the basic intent corresponding to the extended intent and the intent score of the reference intent. Among the various extended intents, the extended intent with the highest intent score is determined as the intent result of the speech information.
12. The method according to claim 1, characterized in that, Also includes: In the fourth mode, user behavior information after a preset date is extracted from pre-stored user historical behavior information; Analyze the frequency of each user behavior in the user behavior information to determine the target intent of the voice information.
13. A device for voice intent recognition, characterized in that, The apparatus, applied to the speech intent recognition method as described in claim 1, comprises: The intent classification set acquisition unit is used to input voice information into several preset voice intent classifiers to obtain several intent classification sets. Each intent classification set is output by one of the voice intent classifiers. Each intent classification set includes at least one intent and an intent score for each intent. The analysis pattern determination unit is used to determine the analysis pattern of the target intent for filtering the voice information based on the degree of difference between all the intent classification sets in intent type, intent quantity, and intent score. The target intent determination unit is used to determine the target intent of the voice information based on each intent in all intent classification sets, or the intent score of each intent, in the analysis mode.
14. An electronic device for voice intent recognition, characterized in that, Including memory and processor; The memory is used to store programs; The processor is configured to execute the program to implement the steps of the voice intent recognition method as described in any one of claims 1-12.
15. A readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the speech intent recognition method as described in any one of claims 1-12.
Citation Information
Patent Citations
Intention identification method and device based on text classification, equipment and storage medium
CN110147445A
Intention recognition method and device and electronic equipment
CN112101044A