Out-of-vocabulary word rejection method and device, equipment and medium
By combining dynamic programming and the Viterbi algorithm with the CTC criterion for out-of-set word recognition, the problem of misidentification of similar out-of-set words by low-resource smart home devices is solved, achieving efficient and accurate recognition on low-resource devices and improving the accuracy of voice interaction.
Patent Information
- Application Number
- CN202511319906.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-16
- Publication Date
- 2025-11-25
- Estimated Expiration
- 2045-09-16
AI Technical Summary
Low-resource smart home devices are prone to misidentifying similar out-of-listed words when using fixed command words, affecting the accuracy of interaction and making it difficult to meet users' needs for precise voice control.
Forced alignment is achieved by combining dynamic programming and Viterbi algorithm with CTC criteria. By comprehensively judging the alignment path, key interval determination, error line count, and positional distance of key phonemes, words outside the set are identified and rejected.
It achieves efficient and accurate recognition of out-of-set words on low-resource devices, reduces the false recognition rate, improves the accuracy of voice interaction, and meets users' needs for precise control of smart home devices.
Smart Images

Figure CN120808765B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of speech recognition technology, and more specifically, to a method, apparatus, device, and medium for rejecting out-of-set words. Background Technology
[0002] Command word recognition is a key application area in speech recognition, widely used in the smart home field. Typical scenarios include voice interaction control of devices such as smart speakers, smart headphones, smart lights, and smart fans. Currently, low-resource smart home devices, limited by hardware performance, typically use a fixed list of command words for recognition. However, this approach has significant drawbacks: devices are prone to misrecognizing words outside the command word list, especially those with similar pronunciation or semantics. For example, when the command word list only contains "time for 20 minutes," words that should not be recognized, such as "time for 25 minutes" or "time for 28 minutes," are often incorrectly recognized as "time for 20 minutes," severely impacting the accuracy of device interaction and failing to meet users' needs for precise voice control of smart home devices. Summary of the Invention
[0003] The main purpose of this application is to provide a method for identifying out-of-set words, which aims to solve the technical problem that when low-resource smart home devices use a fixed command word list for identification, the misidentification rate of similar out-of-set words is high, affecting the accuracy of interaction and making it difficult to meet the requirements of precise control.
[0004] The first aspect of this application proposes a method for rejecting out-of-set words, including:
[0005] The current speech segment recognition result is forcibly aligned with the target command word in the command word list to obtain the alignment path. The forced alignment is based on dynamic programming and Viterbi algorithm, combined with CTC criterion to align the decoding matrix generated by speech segment decoding with the standard phoneme path of the target command word.
[0006] Based on the alignment path, key intervals are determined and the alignment results within the intervals are judged according to different cases. The number of erroneous lines is counted. When the alignment result is a blank phoneme or a target command word phoneme, the proportion is judged respectively.
[0007] Based on the alignment path and the phoneme sequence features of the target command word, at least one pair of key phonemes is located, and each pair of key phonemes contains two key phonemes with positional association.
[0008] Calculate the positional distance between two key phonemes in each pair of key phonemes, and determine whether the positional distance is abnormal.
[0009] If the error line count exceeds the set threshold or the location distance is abnormal, the current speech segment is determined to be an out-of-collection word and rejection is performed; otherwise, it is determined to be a valid command word.
[0010] Furthermore, the step of forcibly aligning the current speech segment recognition result with the target command word in the command word list to obtain the alignment path includes the following steps:
[0011] Extract the standard phoneme path corresponding to the target command word, and obtain the decoding matrix generated by decoding the current speech segment;
[0012] Based on the CTC criterion, a modified forward algorithm is used to calculate the maximum probability and source position of each position in the decoding matrix, and the maximum probability path is determined by backtracking.
[0013] Within a preset recognition window, based on dynamic programming and the Viterbi algorithm, the maximum probability path is mapped and aligned with the standard phoneme path of the target command word to generate an aligned path.
[0014] Furthermore, the step of calculating the maximum probability and source position of each position in the decoding matrix based on the CTC criterion using a modified forward algorithm, and determining the maximum probability path through backtracking, includes the following steps:
[0015] Based on the CTC criterion, the probability summation operation in the traditional CTC forward algorithm is replaced with a maximum value operation to obtain the modified forward algorithm;
[0016] The modified forward algorithm is used to perform dynamic programming calculations on the decoding matrix to determine the maximum probability of reaching each position;
[0017] Record the source location of the highest probability at the previous time to form path information;
[0018] Starting from the end of the decoding matrix, backtracking is performed based on the path information to the beginning. The coherent path obtained from the backtracking is matched with the standard phoneme path of the target command word to determine the path with the highest probability.
[0019] Furthermore, the step of determining key intervals based on the alignment path, classifying the alignment results within the intervals according to different cases, and counting erroneous lines includes:
[0020] Based on the alignment path, determine the range of the key interval;
[0021] The alignment results within the key intervals are classified as blank phoneme alignment results or target command word phoneme alignment results.
[0022] If the result is a blank phoneme alignment, determine whether it occupies a dominant position. If not, increment the error line count by 1. If the result is a target command word phoneme alignment, determine whether the phoneme occupies a dominant position and whether non-target command word phonemes do not occupy a dominant position. If either determination is negative, increment the error line count by 1.
[0023] The total number of alignment results that do not meet the judgment criteria within the key interval is counted as the error row count.
[0024] Furthermore, the step of locating at least one pair of key phonemes based on the alignment path and the phoneme sequence features of the target command word, wherein each pair of key phonemes contains two positionally related key phonemes, includes:
[0025] Extract phoneme sequence features of the target command word to determine the type and positional relationship of the key phonemes to be located;
[0026] Based on the phoneme sequence features, the uniqueness or repetition of each key phoneme in the sequence is identified.
[0027] Traverse the alignment path, directly locate the position of the unique key phoneme, and filter and locate the repeated key phonemes by combining the feature phoneme sequences before and after them.
[0028] Two key phonemes that are located and have a positional relationship are combined to form a key phoneme pair.
[0029] Furthermore, the step of calculating the positional distance between two key phonemes in each pair of key phonemes and determining whether the positional distance is abnormal includes the following steps:
[0030] Obtain the location of the two key phonemes in each key phoneme pair in the alignment path;
[0031] Based on the location, calculate the positional distance between the two key phonemes;
[0032] Based on the phoneme sequence features of the target command word, determine the judgment criteria corresponding to the positional distance;
[0033] The location distance is compared with the judgment criteria. If it does not meet the judgment criteria, the location distance is determined to be abnormal.
[0034] Further, the step of determining the current speech segment as an out-of-collection word and performing rejection if the error line count exceeds a set threshold or the position distance is abnormal, and otherwise determining it as a valid command word, includes the following steps:
[0035] Obtain the error line count and the position distance determination results of each key phoneme pair;
[0036] Determine whether the error line count exceeds a set threshold, or whether the positional distance of any of the key phoneme pairs is abnormal;
[0037] If any of the above conditions are met, the current speech segment is determined to be an out-of-collection word and a rejection operation is performed; otherwise, it is determined to be a valid command word.
[0038] A second aspect of this application also proposes a device for rejecting out-of-set words, comprising:
[0039] The alignment module is used to force alignment between the current speech segment recognition result and the target command word in the command word list to obtain the alignment path. The forced alignment is based on dynamic programming and Viterbi algorithm, combined with CTC criterion to align the decoding matrix generated by speech segment decoding with the standard phoneme path of the target command word.
[0040] The statistics module is used to determine key intervals based on the alignment path and to judge the alignment results within the intervals according to different cases, and to count the number of erroneous lines. Specifically, when the alignment result is a blank phoneme or a target command word phoneme, the proportion is judged respectively.
[0041] The positioning module is used to locate at least one pair of key phonemes based on the alignment path and the phoneme sequence features of the target command word, wherein each pair of key phonemes contains two key phonemes that are positionally related.
[0042] The distance judgment module is used to calculate the positional distance between two key phonemes in each pair of key phonemes and to determine whether the positional distance is abnormal.
[0043] The determination module is used to determine that the current speech segment is an out-of-set word and perform rejection recognition if the error line count exceeds a set threshold or the position distance is abnormal; otherwise, it is determined to be a valid command word.
[0044] A third aspect of this application proposes a device for rejecting out-of-set words, comprising:
[0045] processor;
[0046] Memory, used to store computer programs;
[0047] The processor executes the computer program to implement the method for rejecting out-of-set words as described in any of the above embodiments.
[0048] A fourth aspect of this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method for rejecting out-of-set words as described in any of the above embodiments.
[0049] The first aspect of this plan brings the following benefits:
[0050] This application employs dynamic programming, the Viterbi algorithm, and the CTC criterion for forced alignment, eliminating the need for model retraining. It adapts to the hardware limitations of low-resource devices, reducing deployment costs. Simultaneously, key interval alignment judgment and error line statistics can accurately identify similar out-of-set words with alignment anomalies. Furthermore, key phoneme pair positioning and position distance verification further pinpoint the positional deviation of semantically related phonemes, providing double protection to reduce misjudgments. As a result, the overall process is computationally simple, consumes few resources, and can run efficiently on low-configuration devices, significantly reducing the misrecognition rate of similar out-of-set words, improving the accuracy of voice interaction, and meeting users' needs for precise control of smart homes. Attached Figure Description
[0051] Figure 1 This is a flowchart illustrating a method for rejecting out-of-set words according to an embodiment of this application;
[0052] Figure 2 This is a schematic diagram of the structure of a rejection device for out-of-set words according to an embodiment of this application;
[0053] Figure 3 This is a schematic diagram of the structure of a computer device according to an embodiment of this application;
[0054] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0055] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0056] Those skilled in the art will understand that, unless explicitly stated otherwise, the singular forms “a,” “an,” “the,” and “the” used herein may also include the plural forms. It should be further understood that the term “comprising” as used in the specification of this application means the presence of features, integers, steps, operations, elements, modules, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, modules, components, and / or groups thereof. It should be understood that when an element is “connected” or “coupled” to another element, it may be directly connected or coupled to the other element, or there may be intermediate elements. Furthermore, “connected” or “coupled” as used herein may include wireless connections or wireless coupling. The term “and / or” as used herein includes all or any modules and all combinations of one or more associated listed items.
[0057] Those skilled in the art will understand that, unless otherwise defined, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains. It should also be understood that terms such as those defined in general dictionaries should be understood to have the same meaning as in the context of the prior art, and should not be interpreted in an idealized or overly formal sense unless specifically defined as herein.
[0058] Reference Figure 1 This application provides a method for rejecting out-of-set words, including:
[0059] S1: Force alignment is performed between the current speech segment recognition result and the target command word in the command word list to obtain the alignment path. The forced alignment is based on dynamic programming and Viterbi algorithm, combined with CTC criterion to align the decoding matrix generated by speech segment decoding with the standard phoneme path of the target command word.
[0060] S2: Based on the alignment path, determine the key interval and judge the alignment result within the interval according to different cases, and count the number of erroneous lines. Among them, when the alignment result is a blank phoneme or a target command word phoneme, the proportion is judged respectively.
[0061] S3: Based on the alignment path and the phoneme sequence features of the target command word, locate at least one pair of key phonemes, each pair of key phonemes containing two key phonemes with positional association;
[0062] S4: Calculate the positional distance between two key phonemes in each pair of key phonemes and determine whether the positional distance is abnormal;
[0063] S5: If the error line count exceeds the set threshold or the position distance is abnormal, the current speech segment is determined to be an out-of-collection word and rejection is performed; otherwise, it is determined to be a valid command word.
[0064] In step S1, dynamic programming and the Viterbi algorithm, combined with the CTC (Connectionist Temporal Classification) criterion, are used to forcibly align the recognition result of the current speech segment with the target command word in the command word list, ultimately generating an alignment path. Taking the target command word "time 20 minutes" as an example, its standard phoneme path is 'd', 'ing', 'sh', 'ix', 'ee', 'er', 'sh', 'ix', 'f', 'en', 'zh', 'ong'. When a user inputs a speech segment (such as "time 25 minutes," which might be misrecognized), the system first decodes the speech segment, generating a decoding matrix—each element in the matrix represents the probability value of that position belonging to a certain phoneme (vertical axis) at the corresponding time step (horizontal axis). Subsequently, based on the CTC criterion, the system performs a decoding process on the transmitted speech segment. The forward algorithm is optimized by replacing the original algorithm's "summing the probabilities of all possible paths" with "retaining only the maximum probability at each position" and recording the source position of the previous time step corresponding to the maximum probability. This reduces computational load to adapt to low-resource devices while accurately identifying the optimal path. Dynamic programming is used to traverse the decoding matrix, calculating step-by-step from the initial time step to the final time step to determine the maximum probability and path information for each position. Then, a backtracking algorithm is used to trace back from the end of the matrix to the beginning, obtaining the maximum probability path that best matches the standard phoneme path for the "twenty-minute timer". Finally, within a preset recognition window, the Viterbi algorithm is used to force a mapping between the maximum probability path and the standard phoneme path, clarifying whether each time step corresponds to a specific phoneme in the standard phoneme path (such as 'd', 'ing', etc.) or a blank phoneme (a phoneme without actual semantic meaning), forming a complete alignment path. This step processes the output of the existing model without retraining, adapting to low-resource devices. By combining dynamic programming and the Viterbi algorithm, efficiency is improved while ensuring alignment accuracy, providing reliable data for subsequent judgments and laying the foundation for rejection detection.
[0065] In step S2, based on the alignment path generated in step S1, the key interval determination and error line count statistics are completed, which is the core verification step for out-of-set word determination. First, the key interval needs to be determined: based on the phoneme sequence features, the subsequences carrying the key semantics are extracted—"ee, er, sh, ix" corresponding to "twenty" and "f, en, zh, ong" corresponding to "minutes". Then, the continuous column intervals in the alignment path that map to these two subsequences (assuming they correspond to columns 5-8 and 9-12 of the alignment path) are the key intervals.
[0066] Subsequently, the alignment results within the key interval are judged in different cases: If the alignment result of a certain column is a blank phoneme, it is necessary to judge whether the proportion of its probability in the total probability of this column is ≥ 60% (occupying the main position). If not satisfied, it is recorded as 1 line error; If the alignment result is a target command word phoneme (such as "ee"), it is necessary to simultaneously meet the conditions that the proportion of the probability of this phoneme is ≥ 60% and the proportion of the highest probability of non-target phonemes is ≤ 30%. If either condition is not satisfied, it is recorded as 1 line error. For example, if the alignment result of the 6th column in the interval corresponding to the subsequence "twenty" is "er", but the probability of this phoneme is only 55% (lower than 60%), then this column is counted as an error line. Finally, the total number of all error lines within the key interval is statistically calculated to provide a quantitative basis for subsequent judgment. By focusing on the key semantic interval, reducing the interference of non-core regions, and improving the judgment accuracy; The proportion judgment rules in different cases achieve quantitative capture of alignment anomalies, provide reliable data support for out-of-vocabulary word recognition, and are adapted to the computing power of low-resource devices.
[0067] In step S3, based on the alignment path generated in step S1 and the phoneme sequence features of the target command word, at least one group of key phoneme pairs is located to provide a basis for subsequent position distance verification. First, analyze the phoneme sequence features to determine the key phoneme pairs with position associations: The "ix" (the eighth phoneme) in "twenty" and the "f" (the ninth phoneme) in "minute" have semantic associations. The former is the core phoneme of the time value, and the latter is the starting phoneme of the time unit, forming a group of key phoneme pairs (ix, f); During the positioning process, for phonemes like "ix" that appear repeatedly in the path (appearing in the fourth and eighth positions respectively), distinguish them by combining the features of the previous and subsequent phonemes: The fourth "ix" corresponds to "shi", and its previous phoneme is "sh"; The eighth "ix" corresponds to "twenty", and its previous phoneme is "sh" and there are "ee, er" in a more forward position. Therefore, by traversing the alignment path, find the "ix" after "ee, er, sh" and determine its position as the target "ix". For unique phonemes like "f", directly traverse the alignment path to find its corresponding position. Finally, lock the specific column indexes of "ix" and "f" in the alignment path to complete the positioning of this group of key phoneme pairs. At the same time, other associated phoneme pairs (such as the "ix" of "shi" and the "er" of "two") can be located as needed. By accurately positioning the key phoneme pairs, capturing the position association features between phonemes, and providing a core basis for distinguishing similar out-of-vocabulary words; The positioning method combined with phoneme sequence features improves the accuracy of key phoneme recognition and is adapted to various command word scenarios.
[0068] In step S4, the core of step S4 is to calculate the position distance of the key phoneme pairs located in step S3 in the alignment path, and to determine whether the distance is abnormal based on the standard phoneme sequence characteristics of the target command word. This is the key verification step for distinguishing valid command words from out-of-vocabulary words. First, it is necessary to clarify the reference information of this phoneme pair in the standard phoneme sequence: the standard phoneme path of "set a timer for twenty minutes" is 'd', 'ing','sh', 'ix', 'ee', 'er','sh', 'ix', 'f', 'en', 'zh', 'ong'. Among them, the 'ix' of "twenty" corresponds to the 8th phoneme (index 7, counting from 0), and the 'f' of "minutes" corresponds to the 9th phoneme (index 8). The difference in the number of phonemes between the two in the standard sequence is 1. Therefore, the determination threshold for the position distance is 1±2, that is, the effective range is from -1 to 3 (since the actual position distance is non-negative, the effective range is from 0 to 3);
[0069] Next, obtain the positioning positions of the key phoneme pairs in the alignment path: Assume that through step S3, in the alignment path, it is determined that the 'ix' of "twenty" corresponds to the 15th column (time step), and the 'f' corresponds to the 18th column (time step). Calculate the position distance between the two as 18 - 15 = 3. Compare this actual distance with the determination threshold (0 - 3). Since 3 is within the effective range, it is determined that the position distance of this key phoneme pair is normal. If the user inputs an out-of-vocabulary word "set a timer for twenty-five minutes", after its speech segment is processed through steps S1 - S3, in the alignment path, the 'ix' of "twenty-five" may correspond to the 14th column, and the 'f' corresponds to the 20th column, and the position distance is 6, which exceeds the effective range of 0 - 3. At this time, it is determined that the position distance of this key phoneme pair is abnormal. If there are multiple groups of key phoneme pairs (such as the 'ix' of "when" and the 'er' of "two"), then it is necessary to calculate the position distance of each group separately and judge whether it is abnormal one by one. By using a dynamic threshold (based on the standard phoneme sequence difference ±2) to judge the position distance, it takes into account the differences in the phoneme sequences of command words and the accuracy of verification; the quantitative distance verification method can accurately capture the phoneme position deviation between out-of-vocabulary words and valid command words, provide an objective basis for subsequent rejection recognition, and has a simple calculation logic, which is suitable for low-resource devices.
[0070] In step S5, which is the final determination step for out-of-collection word rejection, the error line count in step S2 and the positional distance judgment result in step S4 are combined to determine whether the current speech segment is an out-of-collection word. Taking the target command word "time twenty minutes" as an example, its key interval contains 8 aligned paths (columns 5-12) corresponding to "twenty" and "minutes". According to the rule, the length of the phoneme subsequence is ≤5, and the error line count threshold is set to 50% of the total number of columns in the key interval, i.e., 8 × 50% = 4 rows. If the user inputs the valid command word "time twenty minutes", the error line count in the key interval is 1 (not exceeding the threshold of 4) as determined in step S2; the positional distance of the key phoneme pair (ix, f) in step S4 is 3 (within the valid range of 1±2), so it is determined to be a valid command word, and the device performs the timing operation.
[0071] If the user inputs the out-of-collection word "time 25 minutes", in step S2, due to the phonemic difference between "25" and "20", the error line count in the key interval reaches 5 (exceeding the threshold of 4); simultaneously, in step S4, the position distance of (ix, f) is 6 (exceeding the range of 1±2). Meeting either of these abnormal conditions, it is determined to be an out-of-collection word and is rejected. If another out-of-collection word, "time 20 minutes", has an error line count of 3 (not exceeding the threshold), but the position distance of the key phoneme pair (ix, f) is 5 (exceeding the range), it is still determined to be an out-of-collection word. It is only valid when the error line count does not exceed the threshold and the position distance of all key phoneme pairs is normal. Through dual judgment conditions (error line count + position distance), the accuracy of out-of-collection word recognition is significantly improved; the dynamic threshold adapts to different command word features, balancing flexibility and rigor, and the logic is simple, adapting to efficient operation on low-resource devices.
[0072] In one embodiment, the step of forcibly aligning the current speech segment recognition result with the target command word in the command word list to obtain the alignment path includes the following steps:
[0073] S10. Extract the standard phoneme path corresponding to the target command word, and obtain the decoding matrix generated by decoding the current speech segment;
[0074] S11. Based on the CTC criterion, the modified forward algorithm is used to calculate the maximum probability and source position of each position in the decoding matrix, and the maximum probability path is determined by backtracking.
[0075] S12. Within the preset recognition window range, based on dynamic programming and Viterbi algorithm, the maximum probability path is mapped and aligned with the standard phoneme path of the target command word to generate an aligned path.
[0076] In this embodiment, in the scenario of out-of-set word rejection recognition for the phrase "time 20 minutes", the implementation steps complete forced alignment and generate an alignment path in three steps. First, the standard phoneme path of the target command word "time 20 minutes" is extracted as 'd', 'ing', 'sh', 'ix', 'ee', 'er', 'sh', 'ix', 'f', 'en', 'zh', 'ong'. At the same time, the decoding matrix generated by decoding the current speech segment (such as the user saying "time 25 minutes") is obtained. The horizontal axis of the matrix represents the time steps (assuming 20 time steps), and the vertical axis represents the phonemes (including all possible phonemes and blank). The value of each cell represents the recognition probability of the phoneme corresponding to that time step. Second, the forward algorithm is modified based on the CTC criterion: the traditional forward algorithm calculates the sum of probabilities at each position, but here it is changed to calculate the maximum value, and at the same time, the position of the maximum value from the previous time step is recorded. Taking the 5th time step of the decoding matrix as an example, if the probability of the phoneme "ee" is 0.8, which is the maximum value, and it comes from "ix" in the 4th time step, then record the maximum probability of 0.8 at that position and the source position 4. After traversing the complete matrix, backtrack from the last time step (step 20) to step 1, trace the source of the maximum probability at each position, and determine the maximum probability path that best matches the standard phoneme path (e.g., time steps 1-3 correspond to 'd', 'ing', 'sh', time steps 4-8 correspond to 'ix', 'ee', 'er', 'sh', 'ix', etc.).
[0077] Finally, within the preset recognition window (e.g., time steps 1-20), the highest probability path is mapped and aligned with the standard phoneme path using dynamic programming and the Viterbi algorithm. Dynamic programming calculates the path matching degree, and the Viterbi algorithm optimizes path selection, ultimately clarifying the specific phoneme or blank in the standard phoneme path corresponding to each time step (e.g., time step 5 corresponds to 'ee', time step 9 corresponds to 'f'). This generates an aligned path containing the mapping relationship between time steps and phonemes, providing accurate data for subsequent key interval determination and phoneme localization. Through step-by-step extraction, optimized calculation, and accurate mapping, aligned paths are efficiently generated on low-resource devices. The modified forward algorithm reduces computational load, and the combination of dynamic programming and the Viterbi algorithm improves alignment accuracy, providing a reliable foundation for subsequent rejection recognition.
[0078] In one embodiment, the step of calculating the maximum probability and source position of each position in the decoding matrix based on the CTC criterion using a modified forward algorithm, and determining the maximum probability path by backtracking, includes the following steps:
[0079] S110. Based on the CTC criterion, the probability summation operation in the traditional CTC forward algorithm is replaced with the maximum value operation to obtain the modified forward algorithm.
[0080] S111. The modified forward algorithm is used to perform dynamic programming calculations on the decoding matrix to determine the maximum probability of reaching each position.
[0081] S112. Record the source location of the previous time corresponding to the highest probability to form path information;
[0082] S113. Starting from the end of the decoding matrix, backtrack to the beginning based on the path information, match the backtracked coherent path with the standard phoneme path of the target command word, and determine the path with the highest probability.
[0083] In this embodiment, the forward algorithm is first modified based on the CTC criterion: the traditional CTC forward algorithm sums the probabilities of all possible paths at each position, while here it is modified to find the maximum value, retaining only the maximum probability of a single path (e.g., for phoneme x at time step t, only the highest probability among all paths reaching that position is recorded), significantly reducing the computational load on low-resource devices; secondly, the modified forward algorithm is used to dynamically program the decoding matrix: taking a decoding matrix with a "twenty-minute timer" (20 time steps) as an example, starting from time step 1, the maximum probability of each position is calculated sequentially. For example, when time step 4 corresponds to the phoneme "ix", all preceding paths that can reach that position ("sh" or blank at time step 3) are compared. If the probability of coming from time step 3 "sh" is 0.7, then the maximum probability of time step 4 "ix" is recorded as 0.7. This process continues until time step 20, completing the maximum probability calculation for the entire matrix;
[0084] Next, the source position of each highest probability is recorded: continuing the example above, if the highest probability of time step 4 "ix" comes from time step 3 "sh", then its source position is recorded as 3; if the highest probability of time step 5 "ee" comes from time step 4 "ix", then its source position is recorded as 4, forming a complete path information chain; finally, backtracking is performed from the end of the decoding matrix (time step 20): first, the highest probability phoneme of time step 20 (such as "ong") is determined, and its source is found to be "zh" of time step 19 through the path information, then traced back to "en" of time step 18... until the starting end (time step 1). The backtracked path (such as 1→2→3→4→…→20 corresponding to 'd'→'ing'→'sh'→'ix'→…→'ong') is matched with the standard phoneme path of "timed for twenty minutes", and finally the path is determined to be the highest probability path. The modified forward algorithm reduces the amount of computation and is adapted to low-resource devices; the combination of dynamic programming and backtracking accurately locks the highest probability path that matches the standard phoneme path, providing highly reliable basic data for subsequent alignment.
[0085] In one embodiment, the step of determining the key interval based on the alignment path, judging the alignment results within the interval according to different cases, and counting the number of erroneous lines includes:
[0086] S20. Based on the alignment path, determine the range of the key interval;
[0087] S21. Classify the alignment results within the key interval as blank phoneme alignment results or target command word phoneme alignment results.
[0088] S22. If the result is a blank phoneme alignment, determine whether it occupies a dominant position. If not, increment the error line count by 1. If the result is a target command word phoneme alignment, determine whether the phoneme occupies a dominant position and whether non-target command word phonemes do not occupy a dominant position. If either determination is negative, increment the error line count by 1.
[0089] S23. Count the total number of alignment results that do not meet the judgment criteria within the key interval, and use them as the error row count.
[0090] In this embodiment, firstly, the key interval range is determined based on the alignment path generated in step S1. Taking the target command word "time twenty minutes" as an example, the subsequences corresponding to "twenty" ("ee, er, sh, ix") and "minutes" ("f, en, zh, ong") in its standard phoneme path are subsequences carrying key semantics. These are mapped to columns 5-8 and 9-12 (a total of 8 columns) in the alignment path, and this continuous column interval is the key interval. Secondly, the alignment results within the key interval are classified. Columns 5-12 are traversed. If the alignment result of a column is a blank phoneme (without actual semantics), it is classified as a blank phoneme alignment result. If the alignment result is a target command word phoneme such as "ee," "er," or "f," it is classified as a target command word phoneme alignment result. For example, if the alignment result of column 5 is "ee," it belongs to the target command word phoneme alignment result; if the alignment result of column 7 is blank, it belongs to the blank phoneme alignment result.
[0091] Then, the two types of alignment results are judged and error rows are counted separately. For blank phoneme alignment results (such as column 7), the proportion of its probability to the total probability of all phonemes in that column is calculated. If the proportion is 55% (<60%), it is judged as not being dominant, and the error row count is incremented by 1. For target command word phoneme alignment results (such as column 5 "ee"), two conditions must be met simultaneously: the probability of "ee" is ≥60% and the highest probability of non-target phonemes is ≤30%. If the probability of "ee" is 58% (<60%), or the probability of the non-target phoneme "eh" is 35% (>30%), and either condition is not met, the error row count is incremented by 1. Finally, the total number of alignment results that do not meet the judgment conditions within the key interval is counted. Assuming that columns 5, 7, and 10 do not meet the conditions, the error row count is 3, and this value will serve as an important basis for subsequent non-target word judgment. By determining key intervals step by step and classifying and judging alignment results, the semantic core area is accurately focused; the quantitative proportion judgment rules ensure that the error line count is objective and reliable, providing accurate data for out-of-set word recognition and adapting to the computing needs of low-resource devices.
[0092] In one embodiment, the step of locating at least one set of key phoneme pairs based on the alignment path and the phoneme sequence features of the target command word, each set of key phoneme pairs comprising two positionally related key phonemes, includes:
[0093] S30. Extract the phoneme sequence features of the target command word and determine the type and positional relationship of the key phonemes to be located;
[0094] S31. Based on the phoneme sequence features, identify the uniqueness or repetition of each key phoneme in the sequence;
[0095] S32. Traverse the alignment path, directly locate the position of the unique key phoneme, and filter and locate the repeated key phonemes by combining the preceding and following feature phoneme sequences.
[0096] S33. Combine the two key phonemes that are located and have a positional relationship to form a key phoneme pair.
[0097] In this embodiment, first, the phoneme sequence features of the target command word are extracted, and the key phoneme types and their positional association relationships are determined. The standard phoneme path of "set a timer for twenty minutes" is 'd', 'ing','sh', 'ix', 'ee', 'er','sh', 'ix', 'f', 'en', 'zh', 'ong'. By extracting its phoneme sequence features, it can be seen that: "twenty" is the core of the time value, corresponding to the phonemes "ee, er, sh, ix"; "minutes" is the core of the time unit, corresponding to the phonemes "f, en, zh, ong". From the semantic logic perspective, the "ix" (the eighth phoneme) of "twenty" is the semantic precondition of the "f" (the ninth phoneme) of "minutes" - only by clarifying the value of "twenty", the unit of "minutes" makes sense. The two form a positional association relationship, and the key phoneme types to be located are determined as "numerical core phoneme (ix)" and "unit starting phoneme (f)".
[0098] Then, based on the phoneme sequence features, the uniqueness attributes of the key phonemes are recognized. By traversing the standard phoneme path, it is found that "f" appears only once (in the ninth position) in the entire sequence, belonging to the unique key phoneme; "ix" appears twice (the fourth position corresponds to "hour", and the eighth position corresponds to "twenty"), belonging to the repeatedly occurring key phoneme. Secondly, traverse the alignment path to locate the positions of the key phonemes. For the unique key phoneme "f", directly traverse the alignment path generated in step S1 (assuming there are 20 columns of time steps), and find the column index mapped to "f" (such as the 18th column) to complete the positioning. For the repeated key phoneme "ix", filter it by combining the front and back characteristic phoneme sequences: the previous phoneme of the fourth "ix" is "sh" (corresponding to "hour"), without "ee, er"; the previous phoneme of the eighth "ix" is "sh", and the more forward columns (such as the 12th - 13th columns) correspond to "ee, er". Therefore, when traversing the alignment path, find the column (such as the 15th column) that maps "ix" after "ee, er, sh" (such as the 12th - 14th columns), and determine it as the position of "ix" corresponding to "twenty".
[0099] Finally, combine the key phonemes with positional associations to form key phoneme pairs. Combine the located "ix" (the 15th column) with "f" (the 18th column) to obtain a set of key phoneme pairs (ix, f); if additional verification dimensions are required, the "ix" of "hour" (such as the 8th column) and the "er" of "two" (such as the 13th column) can also be located, and the two form another set of key phoneme pairs (ix, er) to complete the positioning of the key phoneme pairs. Determine the phoneme association relationship through semantic logic to ensure that the association of the key phoneme pairs conforms to the semantic rules of the command words; combine the uniqueness attributes for differential positioning to improve the accuracy of the key phoneme positions; the positioning of multiple groups of phoneme pairs provides multi - dimensional basis for subsequent verification and adapts to the high - efficiency operation requirements of low - resource devices.
[0100] In one embodiment, the step of calculating the position distance between two key phonemes in each group of key phoneme pairs and determining whether the position distance is abnormal includes the following steps:
[0101] S40. Obtain the positioning positions of two key phonemes in each group of key phoneme pairs in the alignment path;
[0102] S41. Calculate the position distance between the two key phonemes based on the positioning positions;
[0103] S42. Determine the determination criterion corresponding to the position distance according to the phoneme sequence characteristics of the target command word;
[0104] S43. Compare the position distance with the determination criterion. If it does not meet the determination criterion, determine that the position distance is abnormal.
[0105] In this embodiment, first, obtain the positioning positions of each group of key phoneme pairs in the alignment path. Taking the target command word "set a timer for twenty minutes" and its key phoneme pair (ix, f) as an example, combined with the positioning results in step S3 above, it can be seen that: the column index mapped by ix corresponding to "twenty" in the alignment path is 15 (i.e., the 15th time step), and the column index mapped by f corresponding to "minutes" in the alignment path is 18 (i.e., the 18th time step); if there is another group of key phoneme pairs (ix_ for "when", er) (ix of "when" and er of "two"), then the positioning column index of ix of "when" is 8, and the positioning column index of er of "two" is 13. The specific positioning positions of the two phonemes in each group of key phoneme pairs need to be recorded respectively. Secondly, calculate the position distance between the two key phonemes based on the positioning positions. For the key phoneme pair (ix, f), subtract the positioning column index of the previous phoneme from the positioning column index of the latter phoneme, that is, 18 - 15 = 3, to obtain the position distance of this group of key phoneme pairs as 3; for the key phoneme pair (ix_ for "when", er), calculate (13 - 8 = 5) to obtain its position distance as 5. During the calculation process, it is necessary to ensure that the index order is consistent with the semantic order of the phonemes in the command word (such as first "ix" then "f", first "ix_ for "when" then "er") to avoid incorrect distance calculation due to reversed order.
[0106] Then, based on the phoneme sequence characteristics of the target command word, the criteria for determining the positional distance are determined. First, the standard phoneme path of "time twenty minutes" is examined ('d', 'ing', 'sh', 'ix', 'ee', 'er', 'sh', 'ix', 'f', 'en', 'zh', 'ong'). The position index of each key phoneme pair in the standard sequence is determined: the ix of "twenty" corresponds to index 7, and the f of "minutes" corresponds to index 9. The difference between the two indices is 9-7=2. According to the rule, the judgment standard is "difference ±2", that is, 2-2=0 to 2+2=4. The effective range of the positional distance of this key phoneme pair is 0-4. The ix of "hour" corresponds to index 3, and the er of "two" corresponds to index 5. The difference between the indices is 5-3=2. The judgment standard is also 0-4, and the effective range is also 0-4.
[0107] Finally, the calculated positional distances are compared with the judgment criteria to determine whether they are abnormal. For the key phoneme pair (ix, f), a positional distance of 3 is within the valid range of 0-4, and is judged as normal. If the user inputs the out-of-collection word "time 25 minutes", the calculated positional distance of the key phoneme pair (ix, f) is 6, which exceeds the range of 0-4, and is judged as abnormal. For the key phoneme pair (ix_time, er), a positional distance of 5 exceeds the valid range of 0-4, and is also judged as abnormal. If there is an abnormal distance for any pair of key phoneme pairs, the speech segment must be marked as a suspicious out-of-collection word. By obtaining the position step by step, calculating the distance, determining the criteria, and comparing the judgment, the accurate verification of the positional relationship of key phonemes is achieved. The judgment threshold is dynamically set based on the standard phoneme sequence, taking into account the feature differences of different command words, improving the accuracy of anomaly judgment, and adapting to the lightweight computing needs of low-resource devices.
[0108] In one embodiment, the step of determining the current speech segment as an out-of-collection word and performing rejection if the error line count exceeds a set threshold or the location distance is abnormal, and otherwise determining it as a valid command word, includes the following steps:
[0109] S50. Obtain the error line count and the position distance determination result of each key phoneme pair;
[0110] S51. Determine whether the error line count exceeds a set threshold, or whether the positional distance of any of the key phoneme pairs is abnormal;
[0111] S52. If any of the above conditions are met, the current speech segment is determined to be an out-of-collection word and a rejection operation is performed; otherwise, it is determined to be a valid command word.
[0112] In this embodiment, the error line count and the position distance determination results of each key phoneme pair are first obtained. Taking the target command word "time 20 minutes" as an example, its key interval is 8 columns (columns 5-12). According to the rule that the length of the phoneme subsequence is ≤5, the error line count threshold is set to 8 × 50% = 4 rows. Assuming that the error line count is 3 after step S2, the position distance of the key phoneme pair (ix, f) is 3 (within the 0-4 valid range, judged as normal) and the position distance of another key phoneme pair (ix_, er) is 5 (outside the 0-4 range, judged as abnormal). These results need to be summarized as the judgment basis. Secondly, it is determined whether the error line count exceeds the set threshold, or any Whether the positional distance of key phoneme pairs is abnormal is determined by the following criteria: For the error line count, 3 does not exceed the threshold of 4, so this condition is not met; For the positional distance, the key phoneme pair (ix_, er) is determined to be abnormal, satisfying the condition of "any key phoneme pair positional distance is abnormal". If the user inputs the valid command word "time twenty minutes", the error line count is 1 (not exceeding the threshold), and the positional distance of all key phoneme pairs is within the valid range (e.g., (ix, f) distance 3, (ix_, er) distance 4), then both conditions are not met. If the user inputs the out-of-collection word "time twenty-eight minutes", the error line count is 5 (exceeding the threshold of 4), and the key phoneme pair (ix, f) distance is 6 (abnormal), then both conditions are met.
[0113] Then, based on the judgment result, the corresponding operation is executed. When any condition is met, the current speech segment is determined to be an out-of-collection word and is rejected. For example, in the "timed for twenty minutes" example above, due to the existence of key phoneme pairs with abnormal positional distances, it is determined to be an out-of-collection word, and the device does not respond. If neither condition is met (such as a valid command word), it is determined to be a valid command word, and the device executes the timed operation. If only the error line count exceeds the limit (such as an error line count of 5 and all positional distances are normal), it is still determined to be an out-of-collection word and is rejected. This logic ensures that out-of-collection words can be effectively filtered as long as there is a key semantic deviation or phoneme positional abnormality. By using dual-condition judgment, it covers two out-of-collection word features: semantic deviation and positional abnormality, which greatly improves the recognition accuracy. The dynamic threshold adapts to different command word features, taking into account both flexibility and rigor, and the logic is simple, adapting to the efficient operation of low-resource devices.
[0114] refer to Figure 2 A device for rejecting out-of-set words, comprising:
[0115] Alignment module 100 is used to force alignment between the current speech segment recognition result and the target command word in the command word list to obtain an alignment path. The forced alignment is based on dynamic programming and Viterbi algorithm, combined with CTC criterion to align the decoding matrix generated by speech segment decoding with the standard phoneme path of the target command word.
[0116] The statistics module 200 is used to determine key intervals based on the alignment path and to judge the alignment results within the intervals according to different cases, and to count the number of erroneous lines. Specifically, when the alignment result is a blank phoneme or a target command word phoneme, the proportion is judged respectively.
[0117] The positioning module 300 is used to locate at least one pair of key phonemes based on the phoneme sequence features of the alignment path and the target command word, wherein each pair of key phonemes contains two key phonemes with positional association.
[0118] The distance judgment module 400 is used to calculate the positional distance between two key phonemes in each pair of key phonemes and to determine whether the positional distance is abnormal.
[0119] The determination module 500 is used to determine that the current speech segment is an out-of-set word and perform rejection recognition if the error line count exceeds a set threshold or the position distance is abnormal; otherwise, it is determined to be a valid command word.
[0120] Furthermore, the alignment module 100 mentioned above includes:
[0121] The standard phoneme and decoding matrix acquisition unit is used to extract the standard phoneme path corresponding to the target command word and acquire the decoding matrix generated by decoding the current speech segment;
[0122] The maximum probability path determination unit is used to calculate the maximum probability and source position of each position in the decoding matrix based on the CTC criterion and using a modified forward algorithm, and to determine the maximum probability path by backtracking.
[0123] The alignment path generation unit is used to map and align the maximum probability path with the standard phoneme path of the target command word within a preset recognition window interval, based on dynamic programming and Viterbi algorithm, to generate an alignment path.
[0124] Furthermore, the aforementioned maximum probability path determination unit includes:
[0125] The forward algorithm generation unit is modified to replace the probability summation operation in the traditional CTC forward algorithm with a maximum value operation based on the CTC criterion, resulting in the modified forward algorithm.
[0126] The maximum probability calculation unit of the matrix is used to perform dynamic programming calculation on the decoding matrix using the modified forward algorithm to determine the maximum probability of reaching each position.
[0127] The path information recording unit is used to record the source location of the previous time corresponding to the highest probability, thus forming path information;
[0128] The maximum probability path matching unit is used to backtrack from the end of the decoding matrix to the beginning based on the path information, match the backtracked coherent path with the standard phoneme path of the target command word, and determine the maximum probability path.
[0129] Furthermore, the aforementioned statistical module 200 includes:
[0130] The key interval range determination unit is used to determine the range of the key interval based on the alignment path;
[0131] The alignment result classification unit is used to classify the alignment results within the key interval into blank phoneme alignment results or target command word phoneme alignment results.
[0132] The alignment result determination and error counting unit is used to determine whether the blank phoneme alignment result is dominant if it is not, and increment the error line count by 1 if it is a target command word phoneme alignment result.
[0133] The error row count unit is used to count the total number of alignment results that do not meet the judgment criteria within the key interval, and use this count as the error row count.
[0134] Furthermore, the aforementioned positioning module 300 includes:
[0135] The phoneme feature and association determination unit is used to extract the phoneme sequence features of the target command word and determine the type and positional association of the key phonemes to be located.
[0136] A key phoneme attribute identification unit is used to identify the uniqueness or repetition attribute of each key phoneme in the sequence based on the phoneme sequence features.
[0137] The key phoneme location unit is used to traverse the alignment path, directly locate the position of a unique key phoneme, and filter and locate repeated key phonemes by combining the feature phoneme sequences before and after them.
[0138] The key phoneme pair combination unit is used to combine two key phonemes that are located and have a positional relationship to form a key phoneme pair.
[0139] Furthermore, the aforementioned distance determination module 400 includes:
[0140] The key phoneme location acquisition unit is used to acquire the location of two key phonemes in each key phoneme pair in the alignment path.
[0141] A location distance calculation unit is used to calculate the location distance between two key phonemes based on the location;
[0142] The judgment criterion determination unit is used to determine the judgment criterion corresponding to the positional distance based on the phoneme sequence features of the target command word;
[0143] The location distance anomaly determination unit is used to compare the location distance with the determination criteria. If it does not meet the determination criteria, the location distance is determined to be abnormal.
[0144] Furthermore, the aforementioned determination module 500 includes:
[0145] The judgment basis acquisition unit is used to acquire the error line count and the position distance judgment result of each key phoneme pair;
[0146] The judgment condition judgment unit is used to determine whether the error line count exceeds a set threshold, or whether the positional distance of any of the key phoneme pairs is abnormal;
[0147] The out-of-collection word and valid command word determination unit is used to determine that the current speech segment is an out-of-collection word and perform a rejection operation if any of the above conditions are met; otherwise, it is determined to be a valid command word.
[0148] Reference Figure 3 This application also provides a computer device, which may be a server, and its internal structure may be as follows: Figure 3As shown, this computer device includes a processor, memory, network interface, and database connected via a bus. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores operations, computer programs, and the database. The internal memory provides an environment for the operation and execution of the computer programs stored in the non-volatile storage media. The database stores data such as methods for identifying out-of-series words. The network interface allows communication with external terminals via a network connection. When executed by a processor, this computer program implements a method for rejecting out-of-vocabulary words, comprising: forcibly aligning the recognition result of the current speech segment with the target command word in the command word list to obtain an alignment path, wherein the forced alignment is based on dynamic programming and Viterbi algorithm, combined with the CTC criterion to align the decoding matrix generated by decoding the speech segment with the standard phoneme path of the target command word; based on the alignment path, determining key intervals and judging the alignment results within the intervals according to different cases, and counting the number of error lines, wherein the proportion of alignment results being blank phonemes or target command word phonemes is judged respectively; based on the alignment path and the phoneme sequence features of the target command word, locating at least one set of key phoneme pairs, each set of key phoneme pairs containing two key phonemes with positional association; calculating the positional distance between the two key phonemes in each set of key phoneme pairs, and judging whether the positional distance is abnormal; if the number of error lines exceeds a set threshold or the positional distance is abnormal, then the current speech segment is determined to be an out-of-vocabulary word and rejection is performed, otherwise it is determined to be a valid command word.
[0149] One embodiment of this application also provides a computer-readable storage medium storing a computer program. When executed by a processor, the computer program implements a method for rejecting out-of-vocabulary words, comprising: forcibly aligning the recognition result of the current speech segment with a target command word in a command word list to obtain an alignment path, wherein the forced alignment is based on dynamic programming and Viterbi algorithm, combined with the CTC criterion to align the decoding matrix generated by decoding the speech segment with the standard phoneme path of the target command word; based on the alignment path, determining key intervals and judging the alignment results within the intervals according to different cases, and counting the number of error lines, wherein the proportion of alignment results being blank phonemes or target command word phonemes is judged respectively; based on the alignment path and the phoneme sequence features of the target command word, locating at least one set of key phoneme pairs, each set of key phoneme pairs containing two key phonemes with positional association; calculating the positional distance between the two key phonemes in each set of key phoneme pairs, and judging whether the positional distance is abnormal; if the number of error lines exceeds a set threshold or the positional distance is abnormal, then the current speech segment is determined to be an out-of-vocabulary word and rejection is performed; otherwise, it is determined to be a valid command word.
[0150] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the methods described above. Any references to memory, storage, databases, or other media provided in this application and used in the embodiments can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual-speed SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0151] The above description is only a preferred embodiment of this application and does not limit the patent scope of this application. Any equivalent structural or procedural changes made based on the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A method for rejecting out-of-set words, characterized in that, include: The current speech segment recognition result is forcibly aligned with the target command word in the command word list to obtain the alignment path. The forced alignment is based on dynamic programming and Viterbi algorithm, combined with CTC criterion to align the decoding matrix generated by speech segment decoding with the standard phoneme path of the target command word. Based on the alignment path, key intervals are determined and the alignment results within the intervals are judged according to different cases. The number of erroneous lines is counted. When the alignment result is a blank phoneme or a target command word phoneme, the proportion is judged respectively. Based on the alignment path and the phoneme sequence features of the target command word, at least one pair of key phonemes is located, and each pair of key phonemes contains two key phonemes with positional association. Calculate the positional distance between two key phonemes in each pair of key phonemes, and determine whether the positional distance is abnormal. If the error line count exceeds the set threshold or the location distance is abnormal, the current speech segment is determined to be an out-of-collection word and rejection is performed; otherwise, it is determined to be a valid command word.
2. The method for rejecting out-of-set words according to claim 1, characterized in that, The step of forcibly aligning the current speech segment recognition result with the target command word in the command word list to obtain the alignment path includes the following steps: Extract the standard phoneme path corresponding to the target command word, and obtain the decoding matrix generated by decoding the current speech segment; Based on the CTC criterion, a modified forward algorithm is used to calculate the maximum probability and source position of each position in the decoding matrix, and the maximum probability path is determined by backtracking. Within a preset recognition window, based on dynamic programming and the Viterbi algorithm, the maximum probability path is mapped and aligned with the standard phoneme path of the target command word to generate an aligned path.
3. The method for rejecting out-of-set words according to claim 2, characterized in that, The step of calculating the maximum probability and source position of each position in the decoding matrix based on the CTC criterion using a modified forward algorithm, and determining the maximum probability path through backtracking, includes the following steps: Based on the CTC criterion, the probability summation operation in the traditional CTC forward algorithm is replaced with a maximum value operation to obtain the modified forward algorithm; The modified forward algorithm is used to perform dynamic programming calculations on the decoding matrix to determine the maximum probability of reaching each position; Record the source location of the highest probability at the previous time to form path information; Starting from the end of the decoding matrix, backtracking is performed based on the path information to the beginning. The coherent path obtained from the backtracking is matched with the standard phoneme path of the target command word to determine the path with the highest probability.
4. The method for rejecting out-of-set words according to claim 1, characterized in that, The steps of determining key intervals based on the alignment path, classifying the alignment results within the intervals according to different scenarios, and counting erroneous rows include: Based on the alignment path, determine the range of the key interval; The alignment results within the key intervals are classified as blank phoneme alignment results or target command word phoneme alignment results. If the result is a blank phoneme alignment, determine whether it occupies a dominant position. If not, increment the error line count by 1. If the result is a target command word phoneme alignment, determine whether the phoneme occupies a dominant position and whether non-target command word phonemes do not occupy a dominant position. If either determination is negative, increment the error line count by 1. The total number of alignment results that do not meet the judgment criteria within the key interval is counted as the error row count.
5. The method for rejecting out-of-set words according to claim 1, characterized in that, The step of locating at least one pair of key phonemes based on the alignment path and the phoneme sequence features of the target command word, wherein each pair of key phonemes contains two positionally related key phonemes, includes: Extract phoneme sequence features of the target command word to determine the type and positional relationship of the key phonemes to be located; Based on the phoneme sequence features, the uniqueness or repetition of each key phoneme in the sequence is identified. Traverse the alignment path, directly locate the position of the unique key phoneme, and filter and locate the repeated key phonemes by combining the feature phoneme sequences before and after them. Two key phonemes that are located and have a positional relationship are combined to form a key phoneme pair.
6. The method for rejecting out-of-set words according to claim 1, characterized in that, The step of calculating the positional distance between two key phonemes in each pair of key phonemes and determining whether the positional distance is abnormal includes the following steps: Obtain the location of the two key phonemes in each key phoneme pair in the alignment path; Based on the location, calculate the positional distance between the two key phonemes; Based on the phoneme sequence features of the target command word, determine the judgment criteria corresponding to the positional distance; The location distance is compared with the judgment criteria. If it does not meet the judgment criteria, the location distance is determined to be abnormal.
7. The method for rejecting out-of-set words according to claim 1, characterized in that, The step of determining the current speech segment as an out-of-collection word and performing rejection if the error line count exceeds a set threshold or the position distance is abnormal, and otherwise determining it as a valid command word, includes the following steps: Obtain the error line count and the position distance determination results of each key phoneme pair; Determine whether the error line count exceeds a set threshold, or whether the positional distance of any of the key phoneme pairs is abnormal; If any of the above conditions are met, the current speech segment is determined to be an out-of-collection word and a rejection operation is performed; otherwise, it is determined to be a valid command word.
8. A device for rejecting out-of-set words, characterized in that, include: The alignment module is used to force alignment between the current speech segment recognition result and the target command word in the command word list to obtain the alignment path. The forced alignment is based on dynamic programming and Viterbi algorithm, combined with CTC criterion to align the decoding matrix generated by speech segment decoding with the standard phoneme path of the target command word. The statistics module is used to determine key intervals based on the alignment path and to judge the alignment results within the intervals according to different cases, and to count the number of erroneous lines. Specifically, when the alignment result is a blank phoneme or a target command word phoneme, the proportion is judged respectively. The positioning module is used to locate at least one pair of key phonemes based on the alignment path and the phoneme sequence features of the target command word, wherein each pair of key phonemes contains two key phonemes that are positionally related. The distance judgment module is used to calculate the positional distance between two key phonemes in each pair of key phonemes and to determine whether the positional distance is abnormal. The determination module is used to determine that the current speech segment is an out-of-set word and perform rejection recognition if the error line count exceeds a set threshold or the position distance is abnormal; otherwise, it is determined to be a valid command word.
9. A device for identifying out-of-set words, characterized in that, include: processor; Memory, used to store computer programs; The processor, when executing the computer program, implements the method for rejecting out-of-set words as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method for rejecting out-of-set words according to any one of claims 1 to 7.
Citation Information
Patent Citations
Decoding processing method and device, equipment and storage medium
CN117409778A
Voice command word recognition post-processing method, system and equipment and storage medium
CN120431904A