Method, device and processor for determining confidence of command word
By classifying command words based on their number of characters and generating target confidence classifiers, the problem of excessive number of classifiers and complex training in existing technologies is solved, thus simplifying the training process and improving the accuracy of confidence calculation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GUANGZHOU SHIYUAN ELECTRONICS CO LTD
- Filing Date
- 2022-03-03
- Publication Date
- 2026-04-24
AI Technical Summary
Existing technologies require a large number of classifiers to calculate the confidence of command words, resulting in high computational cost and complex training processes.
A target confidence classifier is generated by classifying multiple command words according to the number of characters in the command words. The initial confidence classifier is then trained using command words and annotation information in the same category, and the confidence of the target command word is calculated.
The number of target confidence classifiers was reduced, simplifying the training process and improving the accuracy of command word confidence calculation, thus reducing the probability of false triggering.
Smart Images

Figure CN116778918B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of speech recognition technology, and more specifically, to a method, apparatus, computer-readable storage medium, and processor for determining the confidence level of a command word. Background Technology
[0002] Command word recognition is a subfield of speech recognition. Command word recognition systems are generally offline, requiring minimal computational resources, and are typically used for controlling terminal devices (including wake-up). In more complex situations, command word recognition is highly susceptible to the influence of objective phonemes such as microphone performance and ambient noise, leading to unreliable recognition results. Among these, false recognition is the most significant issue.
[0003] To reduce the probability of false triggering of command words, existing technologies calculate the confidence level of a command word after its recognition. The confidence level is then used to determine whether the command word is true. If the command word is true, the corresponding smart home device performs the corresponding action; if the command word is false, the smart home device does not perform the corresponding action. However, existing classifiers for calculating command word confidence levels are numerous and their training process is complex.
[0004] Therefore, there is an urgent need for a method that can reduce the number of classifiers required to calculate the confidence of command words.
[0005] The information disclosed above in the background section is only intended to enhance the understanding of the background art of the art described herein. Therefore, the background art may contain certain information that does not constitute prior art known to those skilled in the art in this country. Summary of the Invention
[0006] The main objective of this application is to provide a method, apparatus, computer-readable storage medium, and processor for determining the confidence level of command words, so as to solve the problem that the number of classifiers required to calculate the confidence level of command words in the prior art is too large.
[0007] According to one aspect of the present invention, a method for determining the confidence level of a command word is provided, comprising: classifying a plurality of command words at least according to the number of characters in each command word to obtain a classification result, the classification result including a plurality of target categories and the command words in each target category; training an initial confidence classifier using at least the command words in the same target category and corresponding annotation information to generate a target confidence classifier, the annotation information being used to characterize whether the command word is a predetermined command word, the predetermined command word being used to control a smart device to perform a corresponding action; receiving a target command word and determining the target category, and at least inputting the target command word into the corresponding target confidence classifier to calculate the confidence level of the target command word.
[0008] Optionally, at least based on the number of characters in each command word, multiple command words are classified to obtain classification results, including: determining the number of characters in each command word; classifying multiple command words with the same number of characters into the same category based on the number of characters in each command word to obtain multiple predetermined classification results, wherein the predetermined classification results include multiple predetermined categories and the command words in each predetermined category, and each predetermined category includes at least two command words; using a clustering algorithm, and classifying each predetermined classification result based on the similarity between any two command words in each predetermined category to obtain multiple classification results.
[0009] Optionally, at least one command word from the same target category and its corresponding annotation information are used to train an initial confidence classifier to generate a target confidence classifier. This includes: determining multiple initial and final duration features and multiple initial and final probability features for the command word, wherein one command word corresponds to multiple initial and final duration features and multiple initial and final probability features, the initial and final duration features being the duration of the initial and final within a predetermined time, the initial and final probability features being the posterior probability of the initial and final within the predetermined time, and the initial and final being either an initial or a final; and using the multiple initial and final duration features, the multiple initial and final probability features, and the corresponding annotation information to train the initial confidence classifier to obtain the target confidence classifier.
[0010] Optionally, a clustering algorithm is employed, and each predetermined classification result is classified according to the similarity between any two command words in each predetermined category to obtain multiple classification results, including: calculating the similarity between any two command words in each predetermined category to obtain multiple predetermined similarities; determining the predetermined number of categories for each predetermined category; and classifying the predetermined classification results based on the predetermined number of categories and the predetermined similarities, using a clustering algorithm to obtain the classification results.
[0011] Optionally, calculating the similarity between any two command words in each of the predetermined categories to obtain multiple predetermined similarities includes: determining multiple initial-final combinations between any two command words, wherein each character of the command word includes an initial and a final, and the multiple initial-final combinations include an initial combination and a final combination, wherein the initial combination is a combination of the initials of characters in the same position in the two command words, and the final combination is a combination of the finals of characters in the same position in the two command words; determining the pronunciation similarity of each initial-final combination, and averaging the multiple pronunciation similarities to obtain the predetermined similarity between any two command words, wherein the pronunciation similarity is the similarity between one initial or final in the initial-final combination and another initial or final.
[0012] Optionally, determining the pronunciation similarity of each of the initial and final combinations includes: determining the pronunciation similarity of each of the initial and final combinations according to an initial and final confusion matrix, wherein any element Cij of the initial and final confusion matrix is the similarity of the combination of the i-th element of the pinyin letter sequence and the j-th element of the pinyin letter sequence, and the pinyin letter sequence is formed by multiple initials and multiple finals.
[0013] Optionally, after at least inputting the target command word into the corresponding target confidence classifier and calculating the confidence of the target command word, the method further includes: determining that the target command word corresponding to the confidence is true if the confidence is greater than or equal to a predetermined value; and determining that the target command word corresponding to the confidence is false if the confidence is less than the predetermined value.
[0014] According to another aspect of the present invention, an apparatus for determining the confidence level of a command word is also provided, comprising: a classification unit, configured to classify a plurality of command words at least according to the number of characters in each command word, to obtain a classification result, the classification result including a plurality of target categories and the command words in each target category; a first generation unit, configured to train an initial confidence classifier using at least the command words in the same target category and corresponding annotation information to generate a target confidence classifier, the annotation information being used to characterize whether the command word is a predetermined command word, the predetermined command word being used to control a smart device to perform a corresponding action; and a first calculation unit, configured to receive a target command word, determine the target category, and at least input the target command word into the corresponding target confidence classifier to calculate the confidence level of the target command word.
[0015] According to another aspect of the present invention, a computer-readable storage medium is also provided, the computer-readable storage medium including a stored program, wherein the program executes any one of the methods described.
[0016] According to another aspect of the present invention, a processor is also provided, the processor being configured to run a program, wherein the program, when running, executes any one of the methods described.
[0017] In this embodiment of the invention, the method for determining the confidence level of the command word firstly classifies multiple command words based at least on the number of characters in each command word to obtain a classification result, wherein the classification result includes multiple target categories and the command words in each target category; then, the initial confidence classifier is trained based at least on the command words in the same target category and the corresponding annotation information to generate a target confidence classifier, wherein the annotation information characterizes whether the command word is a predetermined command word, and the predetermined command word is used to control the smart device to perform a corresponding action; finally, upon receiving a target command word, the target category of the target command word is determined, and the target command word is input into the corresponding target confidence classifier to calculate the confidence level of the target command word. In this scheme, multiple command words are classified based on at least the number of characters in each command word to obtain classification results. Then, the initial confidence classifier is trained using at least the command words in the same target category and their corresponding annotation information to obtain the target confidence classifier. That is, this scheme merges command words belonging to the same category and trains on command words belonging to the same category so that each command word in a target category corresponds to a target confidence classifier. Since existing technologies require training a target confidence classifier for each command word, this scheme only requires training one target confidence classifier for command words belonging to the same target category. This not only ensures a simpler training process, but also reduces the number of target confidence classifiers. Attached Figure Description
[0018] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:
[0019] Figure 1 A flowchart illustrating a method for determining the confidence level of command words according to an embodiment of this application is shown;
[0020] Figure 2 A schematic diagram of an apparatus for determining the confidence level of a command word according to an embodiment of this application is shown. Detailed Implementation
[0021] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.
[0022] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0023] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate for the embodiments of this application described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0024] As mentioned in the background section, existing technologies for calculating the confidence of command words involve a large number of classifiers and a large computational load. To address these issues, this application provides a method, apparatus, computer-readable storage medium, and processor for determining the confidence of command words in a typical embodiment.
[0025] According to an embodiment of this application, a method for determining the confidence level of a command word is provided.
[0026] Figure 1 This is a flowchart of a method for determining the confidence level of command words according to an embodiment of this application. For example... Figure 1 As shown, the method includes the following steps:
[0027] Step S101: Classify multiple command words based at least on the number of characters in each command word to obtain classification results. The classification results include multiple target categories and the command words in each target category.
[0028] Step S102: Train the initial confidence classifier using at least the command words and corresponding annotation information from the same target category to generate a target confidence classifier. The annotation information is used to characterize whether the command words are predetermined command words. The predetermined command words are used to control the smart device to perform corresponding actions.
[0029] Step S103: Receive the target command word, determine the target category, and input the target command word into the corresponding target confidence classifier to calculate the confidence of the target command word.
[0030] In the method for determining the confidence of the command words, firstly, multiple command words are classified according to at least the number of characters in each command word to obtain classification results, wherein the classification results include multiple target categories and the command words in each target category; then, the initial confidence classifier is trained based on at least the command words in the same target category and the annotation information corresponding to the command words to generate a target confidence classifier, wherein the annotation information is used to characterize whether the command word is a predetermined command word, and the predetermined command word is used to control the smart device to perform the corresponding action; finally, when a target command word is received, the target category of the target command word is determined, and the target command word is input into the corresponding target confidence classifier to calculate the confidence of the target command word. In this scheme, multiple command words are classified based on at least the number of characters in each command word to obtain classification results. Then, the initial confidence classifier is trained using at least the command words in the same target category and their corresponding annotation information to obtain the target confidence classifier. That is, this scheme merges command words belonging to the same category and trains on command words belonging to the same category so that each command word in a target category corresponds to a target confidence classifier. Since existing technologies require training a target confidence classifier for each command word, this scheme only requires training one target confidence classifier for command words belonging to the same target category. This not only ensures a simpler training process, but also reduces the number of target confidence classifiers.
[0031] Specifically, the command words mentioned above can be play, mute, exit, pause, previous episode, next episode, return to homepage, etc. When the command word mentioned above is "play", the number of characters in the command word is 2.
[0032] In this scheme, each command word is classified to obtain the classification results. Then, an initial confidence classifier is trained using command words of the same category, forming a one-to-one target confidence classifier for each category, thus ensuring a small number of target confidence classifiers. Furthermore, upon receiving a target command word, the target category of the target command word is determined, and this target command word is input into the corresponding target confidence classifier to calculate its confidence. This scheme not only ensures the accuracy of the calculated confidence of the target command word but also maintains a small number of target confidence classifiers, effectively balancing the accuracy of the target command word's confidence with the number of target confidence classifiers. Next, in this scheme, the confidence of the target command word is calculated using the target confidence classifier, and then the calculated confidence of the target command word is used to determine whether the target command word is true. If the target command word is true, the intelligent device is controlled to execute the corresponding action, thus reducing the probability of false triggering of the target command word.
[0033] In one specific embodiment of this application, the initial confidence classifier and the target confidence classifier can be neural network models. The smart device can be a smart speaker, a smart air conditioner, a smart washing machine, etc.
[0034] Specifically, the target command word can be a command word issued by the user. Of course, the target command word can also be a command word output by the higher-level "multi-command word recognition system".
[0035] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.
[0036] To ensure the accuracy of the classification results, in one embodiment of this application, multiple command words are classified based on at least the number of characters in each command word to obtain classification results. This includes: determining the number of characters in each command word; grouping multiple command words with the same number of characters into the same category based on the number of characters in each command word to obtain multiple predetermined classification results, wherein each predetermined classification result includes multiple predetermined categories and the command words in each predetermined category, and each predetermined category includes at least two command words; and using a clustering algorithm to classify each predetermined classification result based on the similarity between any two command words in each predetermined category to obtain multiple classification results. In this embodiment, each command word is divided according to its number of characters to obtain a predetermined classification result. Then, the command words in the predetermined category are classified according to the clustering algorithm and the similarity between any two command words in the same predetermined category to obtain multiple classification results. This not only ensures that the obtained classification results are relatively accurate, but also ensures that the division of command words is relatively reasonable. Subsequently, the initial confidence classifier is trained based on the command words in the target category, which further ensures that the obtained target confidence classifier is relatively accurate.
[0037] In one specific embodiment of this application, when the command words are play, mute, exit, pause, previous episode, next episode, and return to homepage, analysis shows that the number of characters in these seven command words are 2, 2, 2, 2, 3, 3, and 4, respectively. Then, based on the number of characters in each of the seven command words, they are classified into: a first predetermined category: play, mute, exit, pause; a second predetermined category: previous episode, next episode; and a third predetermined category: return to homepage. Since the first and second predetermined categories include at least two command words, clustering algorithms can be used to classify the first and second predetermined categories, resulting in multiple classification results. Subsequently, based on these classification results, the initial confidence classifier is trained using command words from the same category. This ensures that the obtained target confidence classifier is relatively accurate, and that the confidence calculated subsequently based on the target confidence classifier is also relatively accurate. In practical applications, if the third predefined category only includes one command word, there is no need to cluster the command word again. Of course, adjustments can be made according to the actual application. For example, if the number of command words in the predefined category is less than 3 or 4, the command words in that category will not be reclassified.
[0038] In another embodiment of this application, at least one command word from the same target category and its corresponding annotation information are used to train an initial confidence classifier to generate a target confidence classifier. This includes: determining multiple initial and final duration features and multiple initial and final probability features for the command word, wherein one command word corresponds to multiple initial and final duration features and multiple initial and final probability features, the initial and final duration features being the duration of the initial and final within a predetermined time, the initial and final probability features being the posterior probability of the initial and final within the predetermined time, and the initial and final being either an initial or a final; and using the multiple initial and final duration features, the multiple initial and final probability features, and the corresponding annotation information to train the initial confidence classifier to obtain the target confidence classifier. In this embodiment, the initial confidence classifier is trained using multiple initial and final vowel duration features and initial and final vowel probability features of the command word, as well as annotation information, to obtain the target confidence classifier. This ensures that the trained target confidence classifier is relatively accurate. At the same time, since the feature dimensions of the initial and final vowel duration features and initial and final vowel probability features are low, this ensures that the complexity of the initial confidence classifier is low, and thus the complexity of the obtained target confidence classifier is also low.
[0039] Specifically, the aforementioned duration characteristics of initials and finals can be determined based on a predetermined duration of the initial or final.
[0040] In addition, in this application, if a word in a command word is composed of an initial consonant, a medial vowel, and a final vowel, then the medial vowel and the final vowel together are both referred to as the final vowel.
[0041] To further ensure the accuracy of the classification results and the reasonable division of each predetermined command term, in another embodiment of this application, a clustering algorithm is used, and each predetermined classification result is classified according to the similarity between any two predetermined command terms in each predetermined category to obtain multiple classification results. This includes: calculating the similarity between any two predetermined command terms in each predetermined category to obtain multiple predetermined similarities; determining the predetermined number of categories for each predetermined category; and classifying the predetermined classification results based on the predetermined number of categories and the predetermined similarities, using a clustering algorithm to obtain the classification results.
[0042] In a specific embodiment of the present application, for command words such as play, mute, exit, pause, etc., a clustering algorithm is used for classification. By calculating the predetermined similarities of (play, mute), (play, exit), (play, pause), (mute, exit), (mute, pause), (exit, pause), six predetermined similarities can be obtained. Then, determine the predetermined classification quantity of the predetermined categories. Based on the above-mentioned predetermined classification quantity and the above-mentioned predetermined similarities, and using the clustering algorithm, classify the above-mentioned predetermined classification results. For example, when the predetermined classification quantity is 2, "play, mute, exit, pause" in the same predetermined category can be divided into two categories, that is, the first target category: play, mute, pause; the second target category: exit. That is to say, by clustering the command words in each predetermined category, multiple classification results can be obtained.
[0043] In the actual application process, the above-mentioned clustering algorithm can be a spectral clustering algorithm or other clustering algorithms.
[0044] In order to ensure that the predetermined similarity between any two command words calculated is relatively accurate, in another embodiment of the present application, calculate the above-mentioned similarity between any two of the above-mentioned command words in each of the above-mentioned predetermined categories, and obtain multiple predetermined similarities, including: determining multiple initial consonant and final combinations between any two of the above-mentioned command words. Each word of the above-mentioned command word includes an initial consonant and a final. The multiple above-mentioned initial consonant and final combinations include initial consonant combinations and final combinations. The above-mentioned initial consonant combination is the combination of the initial consonants of the words in the same position in the two above-mentioned command words, and the above-mentioned final combination is the combination of the finals of the words in the same position in the two above-mentioned command words; determine the pronunciation similarity of each of the above-mentioned initial consonant and final combinations, and average the multiple above-mentioned pronunciation similarities to obtain the above-mentioned predetermined similarity between any two of the above-mentioned command words.
[0045] Specifically, in the process of determining the multiple syllable combinations between any two command words, for example, the two above-mentioned predetermined command words are (play, mute). For "play", "bo" is the first word of the command word "play", and for "mute", "jing" is the first word of this command word. That is, "bo" and "jing" are the words in the same position in the two above-mentioned command words. "fang" is the second word of the command word "play", and "yin" is the second word of "mute". That is, "fang" and "yin" are the words in the same position in the two above-mentioned command words. That is to say, for (play, mute), the first syllable combinations of these two command words are (b, j) and (f, y), and the second syllable combinations are (o, ing) and (ang, in). Finally, by summing and averaging the target pronunciation probabilities of the multiple syllable combinations, that is, Sim(play, mute) = average(sim(b, j) + sim(o, ing) + sim(f, y) + sim(ang, in)) can be obtained.
[0046] Furthermore, in the above embodiments, for any two command words, multiple initial and final combinations can include one initial combination and one final combination, or multiple initial combinations and multiple final combinations. In practical applications, if a single character in a command word only has a final, a virtual initial will be added to that final, and this virtual initial will not resemble its actual final.
[0047] In order to efficiently determine the pronunciation similarity of each initial and final combination, in one embodiment of this application, determining the pronunciation similarity of each initial and final combination includes: determining the pronunciation similarity of each initial and final combination according to an initial and final confusion matrix, wherein any element Cij of the initial and final confusion matrix is the similarity of the combination of the i-th element and the j-th element of the pinyin letter sequence, and the pinyin letter sequence is formed by multiple initials and multiple finals.
[0048] Specifically, the above-mentioned pinyin letter sequence is formed by multiple initials and multiple finals. In actual application, the above-mentioned pinyin letter sequence can first arrange multiple initials in order, and then arrange multiple finals in order. Of course, it can also first arrange multiple finals in order, and then arrange multiple initials in order. It can also mix initials and finals together for arrangement.
[0049] In one specific embodiment of this application, the aforementioned initial and final confusion matrix can be a symmetric matrix.
[0050] In one embodiment of this application, before determining the pronunciation similarity of each of the above-mentioned initial and final combinations based on the initial and final confusion matrix, the method further includes: acquiring multiple audio clips and multiple annotation information, and forcibly aligning the multiple audio clips with the multiple annotation information to obtain multiple pronunciation times and the initials and finals corresponding to the pronunciation times, wherein the multiple annotation information are multiple initials and finals of the multiple audio clips; inputting the Mel-frequency cepstral coefficients of the initials and finals at each of the above-mentioned pronunciation times into an acoustic model to obtain multiple pronunciation probabilities of the initials and finals at the above-mentioned pronunciation times; summing and averaging the multiple pronunciation probabilities of the same initial and final at multiple different above-mentioned pronunciation times to obtain the pronunciation similarity of the initials and finals; and constructing the initial and final confusion matrix based on the multiple pronunciation similarities, wherein the initials and finals are initials or finals.
[0051] In one specific embodiment, the acquired multiple audio clips and multiple annotation information are forcibly aligned to obtain the true pronunciation of the initial consonant and final vowel (let's say zh) at each pronunciation moment. Furthermore, by inputting the audio information of the initial consonant and final vowel at that pronunciation moment into the acoustic model of speech recognition, the pronunciation probability of that pronunciation moment under all initial consonants and final vowels can be obtained, for example, p(zh|zh), p(ang|zh), p(x|zh), p(ing|zh)..., which can be used as a similarity metric sim(zh,zh), sim(ang,zh)... By accumulating multiple predetermined pronunciation similarities at multiple different pronunciation moments and averaging them, a relatively accurate similarity between zh and all initial consonants and final vowels can be obtained, i.e., pronunciation similarity. Multiple pronunciation similarities of multiple initial consonants and final vowels can form the initial consonant and final vowel confusion matrix shown in Table 1. Additionally, the audio information of the initial consonant and final vowel at the above pronunciation moments can be Mel Frequency Cepstrum Coefficient (MFCC) or Linear Predictive Cepstral Coefficient (LPCC).
[0052] Table 1
[0053] Zh Ang X Ing ... Zh 0.9 0.02 0.01 0.005 Ang 0.85 0.05 0.04 X 0.88 0.05 Ing 0.91 … ..
[0054] In practical applications, the aforementioned initial and final confusion matrix can also be manually set based on linguistic knowledge.
[0055] In another embodiment of this application, after receiving the target command word, determining the target category, and inputting the target command word into the corresponding target confidence classifier to calculate the confidence level of the target command word, the method further includes: determining the target command word corresponding to the confidence level as true if the confidence level is greater than or equal to a predetermined value; and determining the target command word corresponding to the confidence level as false if the confidence level is less than the predetermined value. In this embodiment, the calculated confidence level of the target command word is compared with a predetermined value. If the confidence level is greater than or equal to the predetermined value, the target command word is determined to be true, and the smart home device can be controlled to perform the corresponding action. If the confidence level is less than the predetermined value, the target command word is determined to be false, and the smart home device can be controlled not to perform the corresponding action. That is, this solution can further reduce the probability of false triggering of the target command word.
[0056] For example, the predetermined value could be 0.5. If the calculated confidence level is greater than or equal to 0.5, the target command is determined to be true; if the calculated confidence level is less than 0.5, the target command is determined to be false. Of course, the predetermined value can be adjusted according to the actual application scenario.
[0057] This application also provides a device for determining the confidence level of command words. It should be noted that the device for determining the confidence level of command words in this application can be used to execute the method for determining the confidence level of command words provided in this application. The following describes the device for determining the confidence level of command words provided in this application.
[0058] Figure 2 This is a schematic diagram of a device for determining the confidence level of command words according to an embodiment of this application. Figure 2 As shown, the device includes:
[0059] Classification unit 10 is used to classify multiple command words based at least on the number of characters in each command word to obtain a classification result, the classification result including multiple target categories and the command words in each of the target categories;
[0060] The first generation unit 20 is used to train an initial confidence classifier using at least the command words and corresponding annotation information from the same target category to generate a target confidence classifier. The annotation information is used to characterize whether the command words are predetermined command words. The predetermined command words are used to control the smart device to perform corresponding actions.
[0061] The first calculation unit 30 is used to receive the target command word, determine the target category, and at least input the target command word into the corresponding target confidence classifier to calculate the confidence of the target command word.
[0062] In the aforementioned command word confidence determination device, the classification unit is used to classify multiple command words based at least on the number of characters in each command word to obtain a classification result, the classification result including multiple target categories and the command words in each target category; the first generation unit is used to train an initial confidence classifier using at least the command words in the same target category and the corresponding annotation information to generate a target confidence classifier, the annotation information being used to characterize whether the command word is a predetermined command word, the predetermined command word being used to control the smart device to perform a corresponding action; the first calculation unit is used to receive the target command word, determine the target category, and at least input the target command word into the corresponding target confidence classifier to calculate the confidence of the target command word. In this device, multiple command words are classified based on at least the number of characters in each command word to obtain classification results. Then, an initial confidence classifier is trained using at least the command words in the same target category and their corresponding annotation information to obtain a target confidence classifier. That is, the device merges command words belonging to the same category and trains them so that each command word in a target category corresponds to a target confidence classifier. Since existing technologies require training a target confidence classifier for each command word, this solution only requires training one target confidence classifier for command words belonging to the same target category. This not only simplifies the training process but also reduces the number of target confidence classifiers.
[0063] Specifically, the command words mentioned above can be play, mute, exit, pause, previous episode, next episode, return to homepage, etc. When the command word mentioned above is "play", the number of characters in the command word is 2.
[0064] In this scheme, each command word is classified to obtain the classification results. Then, an initial confidence classifier is trained using command words of the same category, forming a one-to-one target confidence classifier for each category, thus ensuring a small number of target confidence classifiers. Furthermore, upon receiving a target command word, the target category of the target command word is determined, and this target command word is input into the corresponding target confidence classifier to calculate its confidence. This scheme not only ensures the accuracy of the calculated confidence of the target command word but also maintains a small number of target confidence classifiers, effectively balancing the accuracy of the target command word's confidence with the number of target confidence classifiers. Next, in this scheme, the confidence of the target command word is calculated using the target confidence classifier, and then the calculated confidence of the target command word is used to determine whether the target command word is true. If the target command word is true, the intelligent device is controlled to execute the corresponding action, thus reducing the probability of false triggering of the target command word.
[0065] In one specific embodiment of this application, the initial confidence classifier and the target confidence classifier can be neural network models. The smart device can be a smart speaker, a smart air conditioner, a smart washing machine, etc.
[0066] Specifically, the target command word can be a command word issued by the user. Of course, the target command word can also be a command word output by the higher-level "multi-command word recognition system".
[0067] To ensure the accuracy of the classification results, in one embodiment of this application, the classification unit further includes a first determining module, a partitioning module, and a classification module. The first determining module determines the number of characters in each command word. The partitioning module groups multiple command words with the same number of characters into the same category based on their character count, resulting in multiple predetermined classification results. Each predetermined classification result includes multiple predetermined categories and the command words within each predetermined category, with each predetermined category including at least two command words. The classification module employs a clustering algorithm and classifies each predetermined classification result based on the similarity between any two command words in each predetermined category, resulting in multiple classification results. In this embodiment, each command word is divided according to its number of characters to obtain a predetermined classification result. Then, the command words in the predetermined category are classified according to the clustering algorithm and the similarity between any two command words in the same predetermined category to obtain multiple classification results. This not only ensures that the obtained classification results are relatively accurate, but also ensures that the division of command words is relatively reasonable. Subsequently, the initial confidence classifier is trained based on the command words in the target category, which further ensures that the obtained target confidence classifier is relatively accurate.
[0068] In one specific embodiment of this application, when the command words are play, mute, exit, pause, previous episode, next episode, and return to homepage, analysis shows that the number of characters in these seven command words are 2, 2, 2, 2, 3, 3, and 4, respectively. Then, based on the number of characters in each of the seven command words, they are classified into: a first predetermined category: play, mute, exit, pause; a second predetermined category: previous episode, next episode; and a third predetermined category: return to homepage. Since the first and second predetermined categories include at least two command words, clustering algorithms can be used to classify the first and second predetermined categories, resulting in multiple classification results. Subsequently, based on these classification results, the initial confidence classifier is trained using command words from the same category. This ensures that the obtained target confidence classifier is relatively accurate, and that the confidence calculated subsequently based on the target confidence classifier is also relatively accurate. In practical applications, if the third predefined category only includes one command word, there is no need to cluster the command word again. Of course, adjustments can be made according to the actual application. For example, if the number of command words in the predefined category is less than 3 or 4, the command words in that category will not be reclassified.
[0069] In another embodiment of this application, the first generation unit includes a second determining module and a training module. The second determining module is used to determine multiple initial and final duration features and multiple initial and final probability features of the command word. Each command word corresponds to multiple initial and final duration features and multiple initial and final probability features. The initial and final duration features are the duration of the initial and final within a predetermined time. The initial and final probability features are the posterior probability of the initial and final within the predetermined time. The initial and final are either initials or finals. The training module is used to train the initial confidence classifier using the multiple initial and final duration features, the multiple initial and final probability features, and the corresponding annotation information to obtain the target confidence classifier. In this embodiment, the initial confidence classifier is trained using multiple initial and final vowel duration features and initial and final vowel probability features of the command word, as well as annotation information, to obtain the target confidence classifier. This ensures that the trained target confidence classifier is relatively accurate. At the same time, since the feature dimensions of the initial and final vowel duration features and initial and final vowel probability features are low, this ensures that the complexity of the initial confidence classifier is low, and thus the complexity of the obtained target confidence classifier is also low.
[0070] Specifically, the aforementioned duration characteristics of initials and finals can be determined based on a predetermined duration of the initial or final.
[0071] In addition, in this application, if a word in a command word is composed of an initial consonant, a medial vowel, and a final vowel, then the medial vowel and the final vowel together are both referred to as the final vowel.
[0072] To further ensure the accuracy of the classification results and the reasonable division of each command word, in another embodiment of this application, the classification module includes a calculation submodule, a first determination submodule, and a classification submodule. The calculation submodule is used to calculate the similarity between any two command words in each predetermined category to obtain multiple predetermined similarities. The first determination submodule is used to determine the predetermined number of categories for each predetermined category. The classification submodule is used to classify the predetermined classification results based on the predetermined number of categories and the predetermined similarities, using a clustering algorithm, to obtain the classification results.
[0073] In one specific embodiment of this application, a clustering algorithm is used to classify command words such as play, mute, exit, and pause. By calculating the predetermined similarity of (play, mute), (play, exit), (play, pause), (mute, exit), (mute, pause), and (exit, pause), six predetermined similarity scores can be obtained. Then, a predetermined number of categories is determined. Based on the predetermined number of categories and the predetermined similarity scores, and using a clustering algorithm, the predetermined classification results are classified. For example, when the predetermined number of categories is 2, "play, mute, exit, pause" in the same predetermined category can be divided into two categories, that is, the first target category: play, mute, pause; and the second target category: exit. In other words, clustering the command words in each predetermined category can yield multiple classification results.
[0074] In practical applications, the above clustering algorithms can be spectral clustering or other clustering algorithms.
[0075] To ensure the accuracy of the calculated predetermined similarity between any two command words, in another embodiment of this application, the calculation submodule includes a second determining submodule and a third determining submodule. The second determining submodule is used to determine multiple initial and final combinations between any two command words. Each character of the command word includes an initial and a final. The multiple initial and final combinations include an initial combination and a final combination. The initial combination is a combination of the initials of characters in the same position in the two command words, and the final combination is a combination of the finals of characters in the same position in the two command words. The third determining submodule is used to determine the pronunciation similarity of each initial and final combination and to average the multiple pronunciation similarities to obtain the predetermined similarity between any two command words.
[0076] Specifically, in the process of determining multiple syllable combinations between any two command words, for example, the above two predetermined command words are (play, mute). For "play", "bo" is the first character of the command word "play", and for "mute", "jing" is the first character of this command word. That is, "bo" and "jing" are characters in the same position of the two above command words. "fang" is the second character of the command word "play", and "yin" is the second character of the command word "mute". That is, "fang" and "yin" are characters in the same position of the two above command words. That is to say, for (play, mute), the first syllable combinations of these two command words are (b, j) and (f, y), and the second syllable combinations are (o, ing) and (ang, in). Finally, by summing and averaging the target pronunciation probabilities of multiple syllable combinations, we can obtain Sim(play, mute) = average(sim(b, j)+sim(o, ing)+sim(f, y)+sim(ang, in)).
[0077] In addition, in the above embodiments, for multiple initial-final combinations between any two command words, the multiple initial-final combinations may include one initial combination and one final combination. Of course, they may also include multiple initial combinations and multiple final combinations. Of course, in the actual application process, for a character in a command word that only has a final, a virtual initial will be added to this final, and this virtual initial will not be similar to its final.
[0078] In an embodiment of the present application, in order to more efficiently determine the pronunciation similarity of each initial-final combination, the above third determination sub-module further includes a fourth determination sub-module, which is used to determine the pronunciation similarity of each of the above initial-final combinations according to the initial-final confusion matrix. Any element Cij of the above initial-final confusion matrix is the similarity of the combination of the i-th element and the j-th element of the pinyin letter sequence, and the above pinyin letter sequence is formed by multiple initials and multiple finals.
[0079] Specifically, the above pinyin letter sequence is formed by multiple initials and multiple finals. In the actual application process, the above pinyin letter sequence can first arrange multiple initials in order, and then arrange multiple finals in order. Of course, it can also first arrange multiple finals in order, and then arrange multiple initials in order. It can also arrange initials and finals in a mixed way.
[0080] In a specific embodiment of the present application, the above initial-final confusion matrix may be a symmetric matrix.
[0081] In one embodiment of this application, the above-mentioned apparatus further includes an acquisition unit, an input unit, a second calculation unit, and a second generation unit. The acquisition unit is used to acquire multiple audio clips and multiple annotation information before determining the pronunciation similarity of each combination of initials and finals according to the initial-final confusion matrix, and to forcibly align the multiple audio clips with the multiple annotation information to obtain multiple pronunciation times and the initials and finals corresponding to the pronunciation times, wherein the multiple annotation information are multiple initials and finals of the multiple audio clips; the input unit is used to input the Mel-frequency cepstral coefficients of the audio clips corresponding to the initials and finals at each pronunciation time into the acoustic model to obtain multiple pronunciation probabilities of the initials and finals at the pronunciation times; the second calculation unit is used to add and average the multiple pronunciation probabilities of the same initial and final at multiple different pronunciation times to obtain the pronunciation similarity of the initials and finals; the second generation unit is used to construct the initial-final confusion matrix based on the multiple pronunciation similarities, wherein the initials and finals are initials or finals.
[0082] In one specific embodiment, the acquired multiple audio clips and multiple annotation information are forcibly aligned to obtain the true pronunciation of the initial consonant and final vowel (let's say zh) at each pronunciation moment. Furthermore, by inputting the audio information of the initial consonant and final vowel at that pronunciation moment into the acoustic model of speech recognition, the pronunciation probability of that pronunciation moment under all initial consonants and final vowels can be obtained, for example, p(zh|zh), p(ang|zh), p(x|zh), p(ing|zh)..., which can be used as a similarity metric sim(zh,zh), sim(ang,zh)... By accumulating multiple predetermined pronunciation similarities at multiple different pronunciation moments and averaging them, a relatively accurate similarity between zh and all initial consonants and final vowels can be obtained, i.e., pronunciation similarity. Multiple pronunciation similarities of multiple initial consonants and final vowels can form the initial consonant and final vowel confusion matrix shown in Table 1. Additionally, the audio information of the initial consonant and final vowel at the above pronunciation moments can be Mel Frequency Cepstrum Coefficient (MFCC) or Linear Predictive Cepstral Coefficient (LPCC).
[0083] Table 1
[0084] Zh Ang X Ing ... Zh 0.9 0.02 0.01 0.005 Ang 0.85 0.05 0.04 X 0.88 0.05 Ing 0.91 … ..
[0085] In practical applications, the aforementioned initial and final confusion matrix can also be manually set based on linguistic knowledge.
[0086] In another embodiment of this application, the determining device further includes a first determining unit and a second determining unit. The first determining unit is configured to, after receiving a target command word, determining the target category, and inputting the target command word into the corresponding target confidence classifier to calculate the confidence level of the target command word, determine that the target command word corresponding to the confidence level is true if the confidence level is greater than or equal to a predetermined value. The second determining unit is configured to determine that the target command word corresponding to the confidence level is false if the confidence level is less than the predetermined value. In this embodiment, the calculated confidence level of the target command word is compared with a predetermined value. If the confidence level is greater than or equal to the predetermined value, the target command word is determined to be true, allowing the smart home device to perform the corresponding action. If the confidence level is less than the predetermined value, the target command word is determined to be false, allowing the smart home device to not perform the corresponding action. Therefore, this solution can further reduce the probability of false triggering of the target command word.
[0087] For example, the predetermined value could be 0.5. If the calculated confidence level is greater than or equal to 0.5, the target command is determined to be true; if the calculated confidence level is less than 0.5, the target command is determined to be false. Of course, the predetermined value can be adjusted according to the actual application scenario.
[0088] The device for determining the confidence level of the command words includes a processor and a memory. The classification unit, the first generation unit, and the first calculation unit are all stored in the memory as program units, and the processor executes the program units stored in the memory to achieve the corresponding functions.
[0089] The processor contains a kernel, which retrieves the corresponding program units from memory. One or more kernels can be configured, and adjusting kernel parameters can address the problem of the large number of classifiers required to calculate the confidence scores of command words in existing technologies.
[0090] The memory may include non-permanent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0091] This invention provides a computer-readable storage medium storing a program that, when executed by a processor, implements a method for determining the confidence level of the aforementioned command words.
[0092] This invention provides a processor for running a program, wherein the program executes a method for determining the confidence level of the command word during runtime.
[0093] This invention provides a device including a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, it performs at least the following steps:
[0094] Step S101: Classify the multiple command words according to at least the number of characters in each command word to obtain a classification result. The classification result includes multiple target categories and the command words in each target category.
[0095] Step S102: Train the initial confidence classifier using at least the command words and corresponding annotation information from the same target category to generate a target confidence classifier. The annotation information is used to characterize whether the command words are predetermined command words. The predetermined command words are used to control the smart device to perform corresponding actions.
[0096] Step S103: Receive the target command word, determine the target category, and input the target command word into the corresponding target confidence classifier to calculate the confidence of the target command word.
[0097] The devices mentioned in this article can be servers, PCs, tablets, mobile phones, etc.
[0098] This application also provides a computer program product, which, when executed on a data processing device, is suitable for executing an initialization program having at least the following method steps:
[0099] Step S101: Classify the multiple command words according to at least the number of characters in each command word to obtain a classification result. The classification result includes multiple target categories and the command words in each target category.
[0100] Step S102: Train the initial confidence classifier using at least the command words and corresponding annotation information from the same target category to generate a target confidence classifier. The annotation information is used to characterize whether the command words are predetermined command words. The predetermined command words are used to control the smart device to perform corresponding actions.
[0101] Step S103: Receive the target command word, determine the target category, and input the target command word into the corresponding target confidence classifier to calculate the confidence of the target command word.
[0102] In the above embodiments of the present invention, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0103] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units described above can be a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.
[0104] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0105] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0106] If the aforementioned integrated units are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0107] As can be seen from the above description, the embodiments of this application achieve the following technical effects:
[0108] 1) In the method for determining the confidence of command words in this application, firstly, multiple command words are classified according to at least the number of characters in each command word to obtain a classification result, wherein the classification result includes multiple target categories and the command words in each target category; then, the initial confidence classifier is trained according to at least the command words in the same target category and the annotation information corresponding to the command words to generate a target confidence classifier, wherein the annotation information is used to characterize whether the command word is a predetermined command word, and the predetermined command word is used to control the smart device to perform a corresponding action; finally, when a target command word is received, the target category of the target command word is determined, and the target command word is input into the corresponding target confidence classifier to calculate the confidence of the target command word. In this scheme, multiple command words are classified based on at least the number of characters in each command word to obtain classification results. Then, the initial confidence classifier is trained using at least the command words in the same target category and their corresponding annotation information to obtain the target confidence classifier. That is, this scheme merges command words belonging to the same category and trains on command words belonging to the same category so that each command word in a target category corresponds to a target confidence classifier. Since existing technologies require training a target confidence classifier for each command word, this scheme only requires training one target confidence classifier for command words belonging to the same target category. This not only ensures a simpler training process, but also reduces the number of target confidence classifiers.
[0109] 2) In the command word confidence determination device of this application, the classification unit is used to classify multiple command words at least according to the number of characters of each command word to obtain a classification result, the classification result including multiple target categories and the command words in each target category; the first generation unit is used to train an initial confidence classifier using at least the command words in the same target category and the corresponding annotation information to generate a target confidence classifier, the annotation information being used to characterize whether the command word is a predetermined command word, the predetermined command word being used to control the smart device to perform a corresponding action; the first calculation unit is used to receive the target command word, determine the target category, and at least input the target command word into the corresponding target confidence classifier to calculate the confidence of the target command word. In this device, multiple command words are classified based on at least the number of characters in each command word to obtain classification results. Then, an initial confidence classifier is trained using at least the command words in the same target category and their corresponding annotation information to obtain a target confidence classifier. That is, the device merges command words belonging to the same category and trains them so that each command word in a target category corresponds to a target confidence classifier. Since existing technologies require training a target confidence classifier for each command word, this solution only requires training one target confidence classifier for command words belonging to the same target category. This not only simplifies the training process but also reduces the number of target confidence classifiers.
[0110] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A method for determining the confidence level of a command word, characterized in that, include: At least based on the number of characters in each command word, multiple command words are classified to obtain a classification result, which includes multiple target categories and the command words in each target category; The initial confidence classifier is trained using at least the command words and corresponding annotation information from the same target category to generate a target confidence classifier. The annotation information is used to characterize whether the command word is a predetermined command word, and the predetermined command word is used to control the smart device to perform the corresponding action. Receive the target command word, determine the target category, and at least input the target command word into the corresponding target confidence classifier to calculate the confidence of the target command word; The initial confidence classifier is trained using at least one command word from the same target category and its corresponding annotation information to generate a target confidence classifier. This includes: determining multiple initial and final vowel duration features and multiple initial and final vowel probability features for the command word, wherein one command word corresponds to multiple initial and final vowel duration features and multiple initial and final vowel probability features, the initial and final vowel duration features being the duration of the initial and final vowel within a predetermined time period, and the initial and final vowel probability features being the posterior probability of the initial and final vowel within the predetermined time period, wherein the initial and final vowel are either initials or finals; and training the initial confidence classifier using the multiple initial and final vowel duration features, the multiple initial and final vowel probability features, and the corresponding annotation information to obtain the target confidence classifier.
2. The method according to claim 1, characterized in that, Based at least on the number of characters in each command word, the multiple command words are classified to obtain classification results, including: Determine the number of characters for each of the command terms; Based on the number of characters in each command word, multiple command words with the same number of characters are grouped into the same category to obtain multiple predetermined classification results. The predetermined classification results include multiple predetermined categories and the command words in each predetermined category. Each predetermined category includes at least two command words. A clustering algorithm is used, and each predetermined classification result is classified according to the similarity between any two command words in each predetermined category, to obtain multiple classification results.
3. The method according to claim 2, characterized in that, A clustering algorithm is used, and each predetermined classification result is classified according to the similarity between any two command words in each predetermined category, resulting in multiple classification results, including: Calculate the similarity between any two command words in each of the predetermined categories to obtain multiple predetermined similarities; Determine the predetermined number of categories for the predetermined category; Based on the predetermined number of categories and the predetermined similarity, and using a clustering algorithm, the predetermined classification results are classified to obtain the classification results.
4. The method according to claim 3, characterized in that, Calculate the similarity between any two command words in each of the predetermined categories to obtain multiple predetermined similarities, including: Determine multiple initial and final combinations between any two command words, wherein each character of the command word includes an initial and a final, and the multiple initial and final combinations include an initial combination and a final combination, wherein the initial combination is a combination of the initials of characters in the same position in the two command words, and the final combination is a combination of the finals of characters in the same position in the two command words; Determine the pronunciation similarity of each of the said initial and final combinations, and average the multiple said pronunciation similarities to obtain the predetermined similarity between any two said command words, wherein the pronunciation similarity is the similarity between one initial or final in the said initial or final combination and another initial or final.
5. The method according to claim 4, characterized in that, Determining the pronunciation similarity of each of the aforementioned initial and final combinations includes: Based on the initial-final confusion matrix, the pronunciation similarity of each initial-final combination is determined. Any element Cij in the initial-final confusion matrix is the similarity between the i-th element and the j-th element of the pinyin letter sequence. The pinyin letter sequence is formed by multiple initials and multiple finals.
6. The method according to claim 1, characterized in that, After at least inputting the target command word into the corresponding target confidence classifier and calculating the confidence of the target command word, the method further includes: If the confidence level is greater than or equal to a predetermined value, the target command word corresponding to the confidence level is determined to be true; If the confidence level is less than the predetermined value, the target command word corresponding to the confidence level is determined to be false.
7. A device for determining the confidence level of a command word, characterized in that, include: A classification unit is configured to classify multiple command words based at least on the number of characters in each command word to obtain a classification result, the classification result including multiple target categories and the command words in each target category; The first generation unit is used to train an initial confidence classifier using at least the command words in the same target category and the corresponding annotation information to generate a target confidence classifier. The annotation information is used to characterize whether the command word is a predetermined command word. The predetermined command word is used to control the smart device to perform a corresponding action. The first calculation unit is configured to receive the target command word, determine the target category, and at least input the target command word into the corresponding target confidence classifier to calculate the confidence of the target command word; The first generation unit includes a second determining module and a training module. The second determining module is used to determine multiple initial and final duration features and multiple initial and final probability features of the command word. Each command word corresponds to multiple initial and final duration features and multiple initial and final probability features. The initial and final duration features are the duration of the initial and final within a predetermined time. The initial and final probability features are the posterior probabilities of the initial and final within the predetermined time. The initial and final are either initials or finals. The training module is used to train an initial confidence classifier using the multiple initial and final duration features, the multiple initial and final probability features, and the corresponding annotation information to obtain the target confidence classifier.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein the program performs the method according to any one of claims 1 to 6.
9. A processor, characterized in that, The processor is used to run a program, wherein the program executes the method according to any one of claims 1 to 6 when it runs.
Citation Information
Patent Citations
Automated speech recognition confidence classifier
CN113646834A