Path score optimization method, apparatus, device, and medium

By calculating and correcting the path score in the speech recognition algorithm, the problem of inaccurate path score calculation is solved, the accuracy and robustness of speech recognition are improved, it adapts to different accents and noisy environments, simplifies the calculation process, and enhances the performance and user experience of embedded devices.

CN119601019BActive Publication Date: 2025-11-25深圳市友杰智新科技有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411726486.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-28
Publication Date
2025-11-25
Estimated Expiration
2044-11-28

AI Technical Summary

Technical Problem

Existing speech recognition methods often fail to calculate path scores accurately, leading to reduced recognition accuracy.

Method used

The path score is calculated by summing the path scores of all possible command word sequences based on the CTC algorithm. The phoneme sequence length of the command word is obtained, and the phoneme sequence length is compared with the normalized path length to determine whether the normalized path length needs to be corrected. After correction, the path score is calculated.

Benefits of technology

It improves the accuracy and robustness of speech recognition, adapts to different accents and noisy environments, simplifies the calculation process, reduces resource consumption, enhances speech recognition performance on embedded devices, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119601019B_ABST
    Figure CN119601019B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of speech recognition, in particular to a path score optimization method and device, equipment and a medium, wherein the method comprises the following steps: based on a CTC algorithm, calculating the sum of all possible command word sequence path scores; based on the sum, calculating a normalized path length; obtaining the phoneme sequence length of a command word; comparing the phoneme sequence length of the command word with the normalized path length to determine whether the normalized path length needs to be corrected; and if the normalized path length needs to be corrected, calculating the path score based on the corrected normalized path length. The application can effectively improve the accuracy and robustness of speech recognition in the case that the phoneme score of a command word is low due to an accent and noise.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of speech recognition, and particularly relates to a path score optimization method and device, equipment and medium. BACKGROUND

[0002] In the traditional CTC decoding process, the path score is the sum of the scores of all possible paths mapped to the target command word sequence, and then divided by a normalization factor (normlen). Generally, normlen is calculated by subtracting the score corresponding to "blank" (space or meaningless phonemes) in each frame from the total number of recognition frames. This method can cause normlen to be small when the score of some phonemes of the command word is low, thereby making the final calculated score lower than the actual score.

[0003] Therefore, the technical problem of inaccurate calculation of scores in the path score calculation process of the existing speech recognition, resulting in reduced recognition accuracy, needs to be solved. SUMMARY

[0004] The main purpose of the present application is to provide a path score optimization method, device, equipment and medium, which aims to solve the technical problem of inaccurate calculation of scores in the path score calculation process of the existing speech recognition, resulting in reduced recognition accuracy.

[0005] In order to achieve the above-mentioned purpose of the application, the present application provides a path score optimization method, which comprises:

[0006] calculating the sum of the scores of all possible command word sequence paths based on the CTC algorithm;

[0007] calculating the normalized path length based on the sum;

[0008] obtaining the phoneme sequence length of the command word;

[0009] comparing the phoneme sequence length of the command word with the normalized path length to determine whether the normalized path length needs to be corrected;

[0010] if correction is needed, calculating the path score based on the corrected normalized path length.

[0011] Further, the step of calculating the sum of the scores of all possible command word sequence paths based on the CTC algorithm comprises:

[0012] constructing a CTC matrix, wherein the rows of the CTC matrix represent the feature sequence of the input audio, and the columns represent the possible output labels;

[0013] for each time step, calculating the score of each possible output label, wherein the possible output labels include blank labels;

[0014] The scores of all possible command word sequence paths are calculated and summed to obtain a total score, i.e., the total sum.

[0015] Further, the step of calculating the normalized path length based on the total sum comprises:

[0016] determining the length of the current audio input sequence;

[0017] calculating the total sum of scores of positions corresponding to blank labels in each frame in the CTC matrix;

[0018] subtracting the contribution of the blank labels from the length of the recognized frame sequence to obtain the normalized path length.

[0019] Further, the step of obtaining the phoneme sequence length of the command word comprises:

[0020] determining the text information of the command word and converting the text information of the command word into a corresponding phoneme sequence;

[0021] determining the number of phonemes contained in the phoneme sequence to obtain the phoneme sequence length of the command word.

[0022] Further, the step of comparing the phoneme sequence length of the command word with the normalized path length to determine whether the normalized path length needs to be corrected comprises:

[0023] comparing the phoneme sequence length with the normalized path length;

[0024] if the normalized path length is greater than the phoneme sequence length, the normalized path length does not need to be corrected;

[0025] if the normalized path length is less than the phoneme sequence length, the normalized path length needs to be corrected, and the value corresponding to the normalized path length is corrected to the value corresponding to the phoneme sequence length to obtain a corrected normalized path length.

[0026] Further, the step of calculating the path score based on the corrected normalized path length if the normalized path length needs to be corrected comprises:

[0027] if the normalized path length needs to be corrected, the path score is calculated based on the following formula and output:

[0028] wherein y is the finally calculated path score, score is the total sum of all possible path scores, and normlen is the value corresponding to the normalized path length.

[0029] A second aspect of the present application provides a path score optimization device, comprising:

[0030] a calculating module configured to calculate a sum of scores of all possible command word sequence paths based on a CTC algorithm;

[0031] a normalizing module configured to calculate a normalized path length based on the sum;

[0032] an obtaining module configured to obtain a phoneme sequence length of the command word;

[0033] a comparing module configured to compare the phoneme sequence length of the command word and the normalized path length to determine whether the normalized path length needs to be corrected;

[0034] an outputting module configured to calculate the path score based on the corrected normalized path length if the normalized path length needs to be corrected.

[0035] Further, the comparing module comprises:

[0036] a first comparing unit configured to compare the phoneme sequence length and the normalized path length;

[0037] a first judging unit configured to determine that the normalized path length does not need to be corrected if the normalized path length is greater than the phoneme sequence length;

[0038] a correcting unit configured to correct the normalized path length if the normalized path length is less than the phoneme sequence length, correct a value corresponding to the normalized path length to a value corresponding to the phoneme sequence length to obtain a corrected normalized path length.

[0039] A third aspect of the present application further includes a computer device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method according to any one of the preceding aspects when executing the computer program.

[0040] A fourth aspect of the present application further includes a computer readable storage medium having a computer program stored thereon, wherein the computer program is executed by a processor to implement the steps of the method according to any one of the preceding aspects.

[0041] Advantages

[0042] The path score optimization method of the present application effectively improves the accuracy and robustness of speech recognition by improving the score calculation in the CTC algorithm. It adjusts the normalized path length dynamically to adapt to different accents and noise environments, simplifies the calculation process, does not require complex post-processing logic, and reduces resource consumption. In addition, the scheme enhances the performance of speech recognition on embedded devices, improves user experience, and has good scalability, can be easily integrated into existing systems, reduces misrecognition rate, and improves the overall reliability of the system. BRIEF DESCRIPTION OF DRAWINGS

[0043] Figure 1 A flowchart of a path score optimization method according to an embodiment of the present application;

[0044] Figure 2 A structural schematic block diagram of a path score optimization device according to an embodiment of the present application;

[0045] Figure 3 A structural schematic block diagram of a computer device according to an embodiment of the present application.

[0046] The implementation, functional features and advantages of the present application will be further described with reference to the embodiments and the accompanying drawings. DETAILED DESCRIPTION

[0047] In order to make the purpose, technical solutions and advantages of the present application more clear, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and not intended to limit the present application.

[0048] Those skilled in the art can understand that, unless specifically stated otherwise, the singular forms "a", "an" and "the" as used herein include plural references unless specifically stated otherwise. It should be further understood that the use of the term "comprise" in the specification of the present application means that a feature, integer, step, operation, element, module and / or assembly is present, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, modules, assemblies and / or groups thereof. It should be understood that when we say that an element is "connected" or "coupled" to another element, it can be directly connected or coupled to the other element, or there can be intermediate elements. In addition, the use of "connected" or "coupled" herein can include wireless connection or wireless coupling. The phrase "and / or" as used herein includes all or any of the associated listed items and all combinations thereof.

[0049] Those skilled in the art can understand that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as that generally understood by those skilled in the art to which the present application belongs. It should also be understood that terms such as those defined in a general dictionary should be understood to have meanings consistent with those in the context of the prior art, and unless specifically defined as such, should not be interpreted in an idealized or overly formal sense.

[0050] Reference Figure 1 , the embodiment of the present application provides a path score optimization method, comprising steps S1-S5, specifically:

[0051] S1, based on the CTC algorithm, calculate the sum of all possible command word sequence path scores;

[0052] S2, calculating a normalized path length based on the sum;

[0053] S3, obtaining the phoneme sequence length of the command word;

[0054] S4, comparing the phoneme sequence length of the command word and the normalized path length, and determining whether the normalized path length needs to be corrected;

[0055] S5, if correction is needed, calculating the path score based on the corrected normalized path length.

[0056] As described in step S1 above, the first step is to perform feature extraction on the input audio signal to obtain a series of feature vectors. Then, specifically, a CTC matrix is constructed, where each cell represents the score of outputting a particular label at a specific time step. These scores are usually determined jointly by an acoustic model and a language model. The algorithm needs to consider all possible paths, including those containing blank labels, to ensure coverage of all possible command word sequences. That is, a score is calculated for each possible label (including the phonemes of the command word and the blank label) at each time step. These scores reflect the probability of outputting a particular label at a specific time step. Since the CTC algorithm allows sequence prediction without relying on label alignment, all possible label sequence paths need to be considered, including those containing multiple blank labels. The scores of all these paths are accumulated to form a total score. The total score is the basis for normalization and score correction in subsequent steps. It reflects the model's confidence in representing a particular command word from the input audio without considering the path length. The role of this step is to provide the basis data for subsequent normalization and score correction.

[0057] As described in step S2 above, the normalized path length (normlen) is a key parameter in the CTC algorithm for normalizing path scores. In step S2, based on the total score calculated in step S1, the algorithm calculates the normalized path length. This usually involves subtracting the scores corresponding to blank labels from the total recognition frame sequence length. The calculation of normlen is to provide a fair comparison benchmark for audio inputs of different lengths. The purpose of this step is to ensure that the comparison of scores will not be biased by the difference in path length. The normalized path length is used to adjust the total score to take into account audio inputs of different lengths. It ensures that audio inputs of different lengths are comparable in score calculation, so that the score can more fairly reflect the accuracy of the recognition result.

[0058] As described in step S3 above, it is necessary to convert the text form of the command word into a phoneme sequence. This usually involves linguistic knowledge. For example, for the Chinese command word "你好" (Hello), its phoneme sequence is "n-i-h-ao", with a length of 4. The length of the phoneme sequence is a key indicator for evaluating whether the normalized path length is reasonable. It provides a benchmark for comparing and correcting the normalized path length in subsequent steps.

[0059] As described in step S4 above, compare the length of the phoneme sequence obtained in step S3 with the normalized path length calculated in step S2. If the normalized path length is less than the length of the phoneme sequence, this may mean that the score is low due to noise in the audio or the speaker's accent, resulting in an inaccurate normlen value. In this case, the algorithm needs to correct normlen to ensure the accuracy of the score. The role of this step is to ensure the reliability of the recognition result even under adverse conditions.

[0060] As described in step S5 above, if step S4 determines that the normalized path length needs to be corrected, the algorithm will use the length of the phoneme sequence as the corrected normlen value and recalculate the path score. This correction ensures that even when the original audio quality is poor, a more accurate score can be obtained. The corrected score is closer to the real situation, thus improving the accuracy of recognition. The purpose of this step is to output an optimized and corrected score for the final command word recognition decision.

[0061] Steps S1 - S5 optimize the calculation of the path score in the speech recognition system based on the CTC algorithm through a systematic method, thereby improving the accuracy and robustness of recognition. This method is particularly suitable for processing audio inputs with noise or speakers with special accents, and can significantly improve the performance of the recognition system. Precise calculation and correction of the path score improve the recognition accuracy and robustness of the speech recognition system under various conditions. By considering the relationship between the length of the phoneme sequence and the normalized path length, the present invention can adapt to different audio qualities and speaking habits, ensuring the reliability of the recognition result.

[0062] In one embodiment, the step of calculating the sum of the path scores of all possible command word sequences based on the CTC algorithm includes:

[0063] S10. Construct a CTC matrix, where the rows of the CTC matrix represent the feature sequence of the input audio, and the columns represent the possible output labels;

[0064] S11. For each time step, calculate the score of each possible output label, where the possible output labels include the blank label;

[0065] S12, calculate the scores of all possible command word sequence paths and sum them up to get a total score, i.e. the total sum.

[0066] In this embodiment, feature extraction is first needed for the input audio signal, usually using Mel Frequency Cepstral Coefficients (MFCC) or other acoustic features. When constructing the CTC matrix, the rows represent the feature sequence of the input audio, and the columns represent possible output labels, including the phonemes of command words and a special blank label. Each cell of the CTC matrix will be used to store the score of the corresponding label at a specific time step. The algorithm will traverse each row of the CTC matrix (i.e. each time step) and calculate the score for each possible output label (including the blank label). The calculation of the score usually relies on a trained acoustic model, which outputs the probability of each label given the input feature vector. For each time step, the algorithm will calculate the score of each label and fill it into the corresponding cell of the CTC matrix. After completing the construction and score calculation of the CTC matrix, the algorithm will start calculating the scores of all possible command word sequence paths. This step involves traversing all possible paths in the CTC matrix and calculating the score of each path. The calculation of the path score is usually achieved by multiplying the scores of each label in the path, taking into account the influence of the blank label. Finally, the scores of all valid paths will be accumulated to get a total score. This score represents the overall confidence of the model that the input audio represents a specific command word. The total score will serve as the basis for the subsequent steps of normalized path length calculation and score correction, ensuring the accuracy and reliability of the entire speech recognition process.

[0067] In an embodiment, the step of calculating the normalized path length based on the total sum comprises: determining the length of the current audio input sequence.

[0068] S20, calculate the total sum of the scores of the positions corresponding to the blank label in each frame in the CTC matrix.

[0069] S21, subtract the contribution of the blank label from the length of the recognized frame sequence to get the normalized path length.

[0070] In this embodiment, the algorithm will iterate through each column of the CTC matrix, representing each time step, and accumulate the scores corresponding to blank labels in each time step. Since the CTC algorithm allows for the insertion of blank labels in the sequence to represent periods of time with no output, it is necessary to calculate the contribution of these blank labels to the total score. This step involves summing the scores of blank labels across all time steps in the CTC matrix. By calculating the total sum of blank label scores, the algorithm is able to determine the periods of time in the audio sequence where there was no valid output. After obtaining the total sum of blank label scores, the algorithm will subtract this sum from the length of the entire audio input sequence (i.e., the total number of time steps) to obtain the normalized path length. This step involves a simple subtraction operation, but the result is significant for the subsequent score modification and final score calculation. It ensures that audio inputs of different lengths are comparable in the score calculation, making the score a more fair reflection of the accuracy of the recognition result. This ensures that the speech recognition system can effectively handle various input conditions, improving recognition accuracy, especially in the presence of noise or accent variations. This length reflects the period of time in the audio sequence that actually contains valid output. In this way, the normalized path length provides a fair comparison basis for audio inputs of different lengths, ensuring that the score comparison is not biased by the difference in path length. The goal is to improve the robustness and reliability of speech recognition, providing a better user experience for practical applications.

[0071] In an embodiment, the step of comparing the phoneme sequence length and the normalized path length to determine whether the normalized path length needs to be modified comprises:

[0072] S30, comparing the phoneme sequence length and the normalized path length;

[0073] S31, if the normalized path length is greater than the phoneme sequence length, no modification is needed for the normalized path length;

[0074] S32, if the normalized path length is less than the phoneme sequence length, the normalized path length needs to be modified, and the value corresponding to the normalized path length is modified to the value corresponding to the phoneme sequence length to obtain the modified normalized path length.

[0075] In this embodiment, the system first determines the phoneme sequence length of the command word, which typically involves converting the textual form of the command word into a phoneme sequence and counting the number of phonemes. Then, the system compares this phoneme sequence length with the previously calculated normalized path length (normlen). This step is the basis of the comparison process and provides the basis for subsequent decision-making. By comparing the phoneme sequence length and the normalized path length, the system can assess whether the normalized path length is reasonable. If the normalized path length is reasonable, it should be at least as long as the phoneme sequence length, as the recognition of the command word at least needs to include frames containing all phonemes. If the comparison result shows that the normalized path length is greater than or equal to the phoneme sequence length, it means that the normalized path length is reasonable, as it at least contains frames of all phonemes of the command word. In this case, the system does not need to make any modifications to the normalized path length and can directly use this value for the next step of score calculation. The purpose of this step is to avoid unnecessary modifications and ensure that adjustments are only made when the normalized path length is unreasonable. This way, the efficiency of the calculation is maintained, and adjustments are only made when necessary. If the comparison result shows that the normalized path length is less than the phoneme sequence length, it may mean that the score is biased low due to noise in the audio or the speaker's accent, resulting in an inaccurate normlen value. In this case, the system needs to modify the normalized path length, i.e., modify the value of the normalized path length to the value of the phoneme sequence length. This modification process ensures that the normalized path length is at least as long as the phoneme sequence length, thereby ensuring the reasonableness of the score calculation. This ensures that the score calculation remains accurate even in unfavorable conditions, such as poor audio quality or a speaker with a special accent. By modifying the normalized path length, the system can improve recognition accuracy, especially when the phoneme score is low. For example: using the CTC algorithm to recognize a Chinese command word "Hello" (the actual recognition process can be any command word, such as "Turn on the refrigerator" or "Turn off the fan"), its phoneme sequence is "n-i-h-ao", and the phoneme sequence length is 4. According to the previous steps, the normalized path length (normlen) is calculated. Suppose in a specific audio input, after processing by the CTC algorithm, we get a normalized path length of 3, and since the normalized path length 3 is less than the phoneme sequence length 4, we judge that the normalized path length needs to be modified to the value of the phoneme sequence length, i.e., normlen = 4. The modified normalized path length is 4, which means that when calculating the final path score, we will use this modified value to normalize the total score. This ensures that even in the case of underestimated normalized path length, we can obtain a more accurate score, thereby improving recognition accuracy.

[0076] In an embodiment, if correction is needed, the step of calculating the path score based on the corrected normalized path length comprises:

[0077] S50, if correction is needed, the path score is calculated based on the following formula and output:

[0078] Where y is the final calculated path score, score is the sum of all possible path scores, and normlen is the value corresponding to the normalized path length.

[0079] In this embodiment, the path score is calculated based on the following formula and output, Where y is the final calculated path score, score is the sum of all possible path scores, and normlen is the value corresponding to the normalized path length. First, take the natural logarithm of the total score (score). This step converts multiplication operation to addition operation, simplifying the calculation process. Then, divide the logarithm of the total score by the normalized path length (normlen). This step is to normalize the score to consider the influence of path length. Next, take the exponential of the result of the previous step to convert the value in the logarithmic space back to the original score space. Finally, multiply the result of the exponential operation by a quantization factor (such as 256) to obtain the final path score. After normalization and correction of the path score, the score can more accurately reflect the model's confidence in recognizing the specific command word from the input audio representation. By using the corrected normalized path length, we can ensure that even in cases of poor audio quality or speakers with special accents, we can obtain relatively reasonable scores.

[0080] Referring to Figure 2 is the structure block diagram of the path score optimization device in an embodiment of the present application, the device comprises:

[0081] The calculation module 100 is configured to calculate the sum of all possible command word sequence path scores based on the CTC algorithm.

[0082] The normalization module 200 is configured to calculate the normalized path length based on the sum.

[0083] The acquisition module 300 is configured to acquire the phoneme sequence length of the command word.

[0084] The comparison module 400 is configured to compare the phoneme sequence length of the command word with the normalized path length, and determine whether correction of the normalized path length is needed.

[0085] The output module 500 is configured to calculate the path score based on the corrected normalized path length if correction is needed.

[0086] In one embodiment, the above-mentioned computing module 100 comprises:

[0087] a constructing unit configured to construct a CTC matrix, wherein a row of the CTC matrix represents a feature sequence of the input audio, and a column of the CTC matrix represents a possible output label;

[0088] a score calculating unit configured to calculate, for each time step, a score of each possible output label, wherein the possible output label comprises a blank label;

[0089] a total score calculating unit configured to calculate a score of all possible command word sequence paths and sum up the scores to obtain a total score, i.e., the sum.

[0090] In one embodiment, the above-mentioned normalization module 200 comprises:

[0091] a sequence length determining unit configured to determine a length of a current audio input sequence;

[0092] a blank calculating unit configured to calculate a sum of scores of positions corresponding to the blank label in each frame in the CTC matrix;

[0093] a calculating unit configured to subtract a contribution of the blank label from the length of the identified frame sequence to obtain a normalized path length.

[0094] In one embodiment, the above-mentioned obtaining module 300 comprises:

[0095] determining text information of the command word and converting the text information of the command word into a corresponding phoneme sequence;

[0096] determining a number of phonemes contained in the phoneme sequence to obtain a phoneme sequence length of the command word. In one embodiment, the above-mentioned comparison module 400 comprises:

[0097] a first comparing unit configured to compare the phoneme sequence length with the normalized path length;

[0098] a first judging unit configured to, if the normalized path length is greater than the phoneme sequence length, determine that the normalized path length does not need to be corrected;

[0099] a correcting unit configured to, if the normalized path length is less than the phoneme sequence length, determine that the normalized path length needs to be corrected, correct a value corresponding to the normalized path length to a value corresponding to the phoneme sequence length to obtain a corrected normalized path length.

[0100] In one embodiment, the above-mentioned output module 500 comprises:

[0101] a formula calculating unit configured to, if correction is needed, calculate and output the path score based on the following formula:

[0102] wherein, y is the final calculated path score; score is the sum of all possible path scores; normlen is the value corresponding to the normalized path length.

[0103] With reference to Figure 3 The computer device can be a server, and the internal structure thereof can be as shown in Figure 3 The computer device includes a processor, a memory, a storage medium (non-volatile storage medium) and a network interface connected through a system bus. The processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes the storage medium (non-volatile storage medium) and the memory. The storage medium (non-volatile storage medium) stores an operating system, a computer program and a database. The memory provides an environment for the operating system and the computer program in the storage medium (non-volatile storage medium) to run. The database of the computer device is configured to store data used in the process of the path score optimization method. The network interface of the computer device is configured to communicate with an external terminal through a network connection. Further, the computer device can be further provided with an input device and a display screen, etc. The computer program is executed by the processor to implement the path score optimization method, which includes the following steps: calculating the sum of all possible command word sequence path scores based on the CTC algorithm; calculating the normalized path length based on the sum; obtaining the phoneme sequence length of the command word; comparing the phoneme sequence length of the command word with the normalized path length to determine whether the normalized path length needs to be corrected; and if the normalized path length needs to be corrected, calculating the path score based on the corrected normalized path length. Those skilled in the art can understand that Figure 3 The structure shown in

[0104] The computer readable storage medium stores a computer program, and the computer program is executed by the processor to implement the path score optimization method, which includes the following steps: calculating the sum of all possible command word sequence path scores based on the CTC algorithm; calculating the normalized path length based on the sum; obtaining the phoneme sequence length of the command word; comparing the phoneme sequence length of the command word with the normalized path length to determine whether the normalized path length needs to be corrected; and if the normalized path length needs to be corrected, calculating the path score based on the corrected normalized path length. It can be understood that the computer readable storage medium in this embodiment can be a volatile readable storage medium or a non-volatile readable storage medium.

[0105] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when executed, can include the processes of the above-mentioned embodiment methods. Any reference to memory, storage, database, or other medium provided by the present 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. As an illustration but not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchl ink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0106] It should be noted that in this document, the terms "comprising", "including", or any other variant thereof are intended to cover a non-exclusive inclusion, such that a process, device, article, or method that comprises a list of elements does not only include those elements, but can also include other elements not expressly listed or inherent to such process, device, article, or method. Without more limitations, the element defined by the statement "comprising a" does not exclude the presence of additional identical elements in the process, device, article, or method that includes the element.

[0107] The above description is only the preferred embodiment of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation using the content of the present application specification and drawings, or direct or indirect application in other related technical fields, is also included in the patent protection scope of the present application.

Claims

1. A path score optimization method, characterized by, The method comprises: calculating a sum of scores of all possible command word sequence paths based on a CTC algorithm; calculating a normalized path length based on the sum; obtaining a phoneme sequence length of a command word; comparing the phoneme sequence length of the command word and the normalized path length to determine whether the normalized path length needs to be corrected; if correction is needed, calculating a path score based on the corrected normalized path length; the step of calculating the sum of scores of all possible command word sequence paths based on the CTC algorithm comprises: constructing a CTC matrix, wherein the rows of the CTC matrix represent feature sequences of input audio, and the columns represent possible output labels; for each time step, calculating a score of each possible output label, wherein the possible output labels include a blank label; calculating scores of all possible command word sequence paths and summing to obtain a total score, i.e., the sum; the step of calculating the normalized path length based on the sum comprises: determining the length of the current audio input sequence; calculating the sum of scores of positions corresponding to blank labels in each frame in the CTC matrix; subtracting the contribution of the blank labels from the length of the identified frame sequence to obtain the normalized path length; the step of comparing the phoneme sequence length of the command word and the normalized path length to determine whether the normalized path length needs to be corrected comprises: comparing the phoneme sequence length and the normalized path length; if the normalized path length is greater than the phoneme sequence length, the normalized path length does not need to be corrected; if the normalized path length is less than the phoneme sequence length, the normalized path length needs to be corrected, and the value corresponding to the normalized path length is corrected to the value corresponding to the phoneme sequence length to obtain the corrected normalized path length.

2. The path score optimization method of claim 1, wherein, the step of obtaining the phoneme sequence length of the command word comprises: determining text information of the command word and converting the text information of the command word into a corresponding phoneme sequence; determining the number of phonemes contained in the phoneme sequence to obtain the phoneme sequence length of the command word.

3. The path score optimization method of claim 1, wherein, the step of calculating the path score based on the corrected normalized path length if correction is needed comprises: if correction is needed, calculating the path score based on the following formula and outputting: ; where y is the final computed path score; score is the sum of all possible path scores; normlen is the value corresponding to the normalized path length.

4. A path score optimization apparatus characterized by comprising: comprise: a calculation module configured to calculate a sum of scores of all possible command word sequence paths based on a CTC algorithm; a normalization module configured to calculate a normalized path length based on the sum; an obtaining module configured to obtain a phoneme sequence length of a command word; a comparison module configured to compare the phoneme sequence length of the command word and the normalized path length to determine whether the normalized path length needs to be corrected; an output module configured to calculate a path score based on the corrected normalized path length if correction is needed. the calculation module comprises: a construction unit configured to construct a CTC matrix, wherein the rows of the CTC matrix represent feature sequences of input audio, and the columns represent possible output labels; a score calculation unit configured to calculate a score of each possible output label for each time step, wherein the possible output labels include a blank label; A total score calculation unit is configured to calculate scores of all possible command word sequence paths and sum the scores to obtain a total score, i.e., the total sum. The normalization module comprises: A sequence length determination unit is configured to determine a length of the current audio input sequence. A blank calculation unit is configured to calculate a total sum of scores of positions corresponding to blank labels in each frame in the CTC matrix. An operation unit is configured to subtract a contribution of the blank label from the length of the identified frame sequence to obtain a normalized path length. The comparison module comprises: A first comparison unit is configured to compare the phoneme sequence length with the normalized path length. A first judgment unit is configured to determine that the normalized path length does not need to be corrected if the normalized path length is greater than the phoneme sequence length. A correction unit is configured to determine that the normalized path length needs to be corrected if the normalized path length is less than the phoneme sequence length, correct a value corresponding to the normalized path length to a value corresponding to the phoneme sequence length to obtain a corrected normalized path length. 5.A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer device is configured to perform the method according to any one of claims 1-4 when the computer program is executed by the processor. The processor executes the computer program to implement the steps of the method in any one of claims 1 to 3.

6. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method in any one of claims 1 to 3.

Citation Information

Patent Citations

  • User-defined command word recognition method and device, and computer equipment

    CN113506574A

  • Speech recognition post-processing method and device and computer equipment

    CN113724688A