Path score optimization method and device, equipment and medium

By improving the CTC algorithm, the normalized path length is dynamically adjusted and corrected, the problem of inaccurate path score calculation in speech recognition is solved, and the accuracy and robustness of the recognition are improved.

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

Patent Information

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

AI Technical Summary

Technical Problem

The existing speech recognition is inaccurate in the calculation of the path score, resulting in a decrease in the accuracy of the recognition.

Method used

By improving the CTC algorithm, the sum of all possible command word sequence path scores is calculated and the normalized path length is calculated based on this. If the normalized path length is less than the phoneme sequence length, it is corrected and the path score is recalculated.

Benefits of technology

Improve the accuracy and robustness of speech recognition, adapt to different accents and noise environments, simplify the computing process, reduce resource consumption, and enhance voice recognition performance on embedded devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119601019A_ABST
    Figure CN119601019A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of speech recognition, in particular to a path score optimization method and device, equipment and a medium, and the method comprises the steps: calculating the sum of all possible command word sequence path scores based on a CTC algorithm; calculating a 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, and determining whether the normalized path length needs to be corrected; and if the path length needs to be corrected, calculating a path score based on the corrected normalized path length. According to the method and the device, the accuracy and the robustness of speech recognition can be effectively improved under the condition that the phoneme score of the command word is relatively low due to 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 in particular to a path score optimization method, device, equipment and medium. Background Art

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

[0003] Therefore, the technical problem that the calculation score of the existing speech recognition in the path score calculation process is inaccurate, resulting in reduced recognition accuracy, needs to be solved urgently. Summary of the invention

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

[0005] In order to achieve the above-mentioned invention object, the present application proposes a path score optimization method, which comprises:

[0006] Based on the CTC algorithm, the sum of all possible command word sequence path scores is calculated;

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

[0008] Get the length of the phoneme sequence 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 required, the path score is calculated based on the corrected normalized path length.

[0011] Furthermore, the step of calculating the sum of all possible command word sequence path scores based on the CTC algorithm includes:

[0012] Construct a CTC matrix, where the rows of the CTC matrix represent the feature sequences of the input audio and the columns represent the possible output labels;

[0013] For each time step, calculate the score of each possible output label, where the possible output label includes the blank label;

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

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

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

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

[0018] The contribution of the blank label is subtracted from the length of the recognition frame sequence to obtain the normalized path length.

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

[0020] Determine the text information of the command word, and convert the text information of the command word into a corresponding phoneme sequence;

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

[0022] Furthermore, 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 includes:

[0023] Compare the phoneme sequence length to the normalized path length;

[0024] If the normalized path length is greater than the phoneme sequence length, there is no need to correct the normalized path length;

[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 the corrected normalized path length.

[0026] Furthermore, if correction is required, the step of calculating the path score based on the corrected normalized path length includes:

[0027] If correction is required, the path score is calculated and output based on the following formula:

[0028] Among them, 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.

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

[0030] A calculation module, used for calculating the sum of all possible command word sequence path scores based on the CTC algorithm;

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

[0032] An acquisition module, used for acquiring the length of the phoneme sequence of the command word;

[0033] A comparison module, used for comparing the phoneme sequence length of the command word with the normalized path length, and determining whether the normalized path length needs to be corrected;

[0034] The output module is used to calculate the path score based on the corrected normalized path length if correction is required.

[0035] Furthermore, the comparison module comprises:

[0036] A first comparison unit, used for comparing the phoneme sequence length with the normalized path length;

[0037] A first judgment unit, configured to determine that if the normalized path length is greater than the phoneme sequence length, then no correction is required to the normalized path length;

[0038] The correction unit is used to correct the normalized path length if the normalized path length is less than the phoneme sequence length, and correct the value corresponding to the normalized path length to the value corresponding to the phoneme sequence length to obtain the corrected normalized path length.

[0039] The third aspect of the present application also includes a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of any one of the above methods when executing the computer program.

[0040] The fourth aspect of the present application also includes a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the steps of any of the above methods when executed by a processor.

[0041] Beneficial Effects

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

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

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

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

[0046] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

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

[0048] It will be understood by those skilled in the art that, unless expressly stated, the singular forms "a", "an", "above", and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present invention refers to 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 we refer to an element as being "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may be an intermediate element. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein includes all or any module and all combinations of one or more associated listed items.

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

[0050] Reference Figure 1 The embodiment of the present invention provides a path score optimization method, including 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 length of the phoneme sequence of the command word;

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

[0055] S5. If correction is required, the path score is calculated based on the corrected normalized path length.

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

[0057] As described in step S2 above, the normalized path length (normlen) is a key parameter used in the CTC algorithm to normalize the path score. 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 among audio inputs of different lengths. The purpose of this step is to ensure that the comparison of scores is not biased by different path lengths. 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 the score calculation, so that the score can more fairly reflect the accuracy of the recognition results.

[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, thereby 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 obtain a total score, ie, the sum.

[0066] In this embodiment, it is first necessary to extract features from 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 sequences of the input audio, and the columns represent possible output tags, including the phonemes of the command word and a special blank tag. Each cell of the CTC matrix will be used to store the score of the corresponding tag 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 tag (including the blank tag). The calculation of the score usually depends on a trained acoustic model, which outputs the probability of each tag based on the input feature vector. For each time step, the algorithm will calculate the score of each tag and fill it into the corresponding cell of the CTC matrix. After completing the construction of the CTC matrix and the score calculation, the algorithm will start to calculate 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 score of each tag in the path, while taking into account the influence of the blank tag. 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 normalized path length calculation and score correction in subsequent steps to ensure the accuracy and reliability of the entire speech recognition process.

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

[0068] S20, calculating the sum of the scores of the positions corresponding to the blank labels in each frame in the CTC matrix;

[0069] S21. Subtract the contribution of the blank label from the length of the recognition frame sequence to obtain the normalized path length.

[0070] In this embodiment, the algorithm will traverse each column of the CTC matrix (representing each time step) and accumulate the scores corresponding to the blank tags in each time step. Since the CTC algorithm allows blank tags to be inserted into the sequence to represent time periods without output, it is necessary to calculate the contribution of these blank tags to the total score. This step involves summing the blank tag scores for all time steps in the CTC matrix. By calculating the sum of the scores of the blank tags, the algorithm can determine the time period without valid output in the audio sequence. After obtaining the sum of the blank tag scores, the algorithm will subtract the sum of the blank tag scores from the length of the entire audio input sequence (i.e., the total number of all time steps) to obtain the normalized path length (normlen). This step involves a simple subtraction operation, but the result is of great significance for subsequent score correction and calculation of the final score. It ensures that audio inputs of different lengths are comparable in the score calculation, so that the score can more fairly reflect the accuracy of the recognition results. It ensures that the speech recognition system can effectively handle various input conditions and improve recognition accuracy, especially in the presence of noise or accent changes. This length reflects the time period in the audio sequence that actually contains valid output. In this way, the normalized path length can provide a fair comparison benchmark for audio inputs of different lengths, ensuring that the score comparison will not be biased due to different path lengths. It aims to improve the robustness and reliability of speech recognition and provide a better user experience for practical applications.

[0071] In one embodiment, 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 includes:

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

[0073] S31, if the normalized path length is greater than the phoneme sequence length, there is no need to correct the normalized path length;

[0074] S32. If the normalized path length is smaller 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.

[0075] In this embodiment, the system first determines the length of the phoneme sequence of the command word, which generally involves converting the text form of the command word into a phoneme sequence and calculating 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 a basis for subsequent decisions. By comparing the phoneme sequence length and the normalized path length, the system can evaluate 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 because the recognition of the command word requires at least the 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 because it contains at least the frames of all phonemes of the command word. In this case, the system does not need to make any correction to the normalized path length and can directly use this value for the next score calculation. The role of this step is to avoid unnecessary corrections and ensure that adjustments are only made when the normalized path length is unreasonable. This can maintain the efficiency of the calculation and ensure that corrections are only made when necessary. If the comparison result shows that the normalized path length is less than the phoneme sequence length, 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 system needs to correct the normalized path length, that is, correct the value of the normalized path length to the value of the phoneme sequence length. This correction process ensures that the normalized path length is at least as long as the phoneme sequence length, thus ensuring the reasonableness of the score calculation. Ensure that even under adverse conditions, such as poor audio quality or the speaker having a special accent, the score calculation can maintain accuracy. By correcting the normalized path length, the system can improve the recognition accuracy, especially when the phoneme scores are low. For example: using the CTC algorithm to recognize a Chinese command word "ni hao" (any command word can be used in the actual recognition process, such as "open the refrigerator", "turn off the fan", etc.), its phoneme sequence is "n-i-h-ao", and the phoneme sequence length is 4. Calculate the normalized path length (normlen) according to the previous steps. Suppose in a specific audio input, after being processed by the CTC algorithm, the normalized path length we obtain is 3. Since the normalized path length 3 is less than the phoneme sequence length 4, we determine that the normalized path length needs to be corrected, and correct the normalized path length to the value of the phoneme sequence length, that is, normlen = 4. The corrected normalized path length is 4, which means that when calculating the final path score, we will use this corrected value to normalize the total score. Doing so can ensure that even when the normalized path length is underestimated, we can obtain a more accurate score, thereby improving the recognition accuracy.

[0076] In one embodiment, if correction is required, the step of calculating the path score based on the corrected normalized path length includes:

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

[0078] Among them, 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.

[0079] In this embodiment, the path score is calculated and output based on the following formula: Among them, 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. First, take the natural logarithm of the total score (score). This step converts the multiplication operation into an 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 take into account the impact of the path length. Next, take the exponent of the result of the previous step to convert the value of 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 that the input audio represents a specific command word. By using the corrected normalized path length, we can ensure that a relatively reasonable score is obtained even when the audio quality is poor or the speaker has a special accent.

[0080] Reference Figure 2 , is a structural block diagram of a path score optimization device in an embodiment of the present application, the device comprising:

[0081] A calculation module 100, used for calculating the sum of all possible command word sequence path scores based on the CTC algorithm;

[0082] A normalization module 200, configured to calculate a normalized path length based on the sum;

[0083] An acquisition module 300 is used to acquire the length of the phoneme sequence of the command word;

[0084] A comparison module 400, used to compare the phoneme sequence length of the command word with the normalized path length, and determine whether the normalized path length needs to be corrected;

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

[0086] In one embodiment, the computing module 100 includes:

[0087] A construction unit for constructing a CTC matrix, where the rows of the CTC matrix represent feature sequences of the input audio and the columns represent possible output labels;

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

[0089] The total score calculation unit is used to calculate the scores of all possible command word sequence paths and sum them up to obtain the total score, that is, the sum.

[0090] In one embodiment, the normalization module 200 includes:

[0091] A sequence length determination unit, used to determine the length of the current audio input sequence;

[0092] Blank calculation unit, used to calculate the sum of the scores of the positions corresponding to the blank labels in each frame in the CTC matrix;

[0093] The operation unit is used to subtract the contribution of the blank label from the length of the recognition frame sequence to obtain the normalized path length.

[0094] In one embodiment, the acquisition module 300 includes:

[0095] Determine the text information of the command word, and convert the text information of the command word into a corresponding phoneme sequence;

[0096] Determine the number of phonemes contained in the phoneme sequence to obtain the phoneme sequence length of the command word. In one embodiment, the comparison module 400 includes:

[0097] A first comparison unit, used for comparing the phoneme sequence length with the normalized path length;

[0098] A first judgment unit, configured to determine that if the normalized path length is greater than the phoneme sequence length, then no correction is required to the normalized path length;

[0099] The correction unit is used to correct the normalized path length if the normalized path length is less than the phoneme sequence length, and correct the value corresponding to the normalized path length to the value corresponding to the phoneme sequence length to obtain the corrected normalized path length.

[0100] In one embodiment, the output module 500 includes:

[0101] The formula calculation unit is used to calculate and output the path score based on the following formula if correction is required:

[0102] Among them, 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] Reference Figure 3 In an embodiment of the present application, a computer device is also provided. The computer device may be a server, and its internal structure may be as follows: Figure 3 As shown. The computer device includes a processor, an internal memory, a storage medium (non-volatile storage medium) and a network interface connected via a system bus. Among them, the processor designed by the computer is used to provide computing and control capabilities. The memory of the computer device includes the above-mentioned storage medium (non-volatile storage medium) and the internal memory. The storage medium (non-volatile storage medium) stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and computer program in the storage medium (non-volatile storage medium). The database of the computer device is used to store usage data in a path score optimization method process, etc. The network interface of the computer device is used to communicate with an external terminal through a network connection. Furthermore, the above-mentioned computer device can also be provided with an input device and a display screen, etc. When the above computer program is executed by a processor, a path score optimization method is implemented, including the following steps: based on the CTC algorithm, the sum of all possible command word sequence path scores is calculated; based on the sum, the normalized path length is calculated; the phoneme sequence length of the command word is obtained; the phoneme sequence length of the command word is compared with the normalized path length to determine whether the normalized path length needs to be corrected; if correction is required, the path score is calculated based on the corrected normalized path length. Those skilled in the art can understand that Figure 3 The structure shown in is merely a block diagram of a portion of the structure related to the present application solution and does not constitute a limitation on the computer device to which the present application solution is applied.

[0104] An embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, a path score optimization method is implemented, including the following steps: based on the CTC algorithm, the sum of all possible command word sequence path scores is calculated; based on the sum, the normalized path length is calculated; the phoneme sequence length of the command word is obtained; the phoneme sequence length of the command word is compared with the normalized path length to determine whether the normalized path length needs to be corrected; if correction is required, the path score is calculated 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 of ordinary skill 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, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media provided in this application and used in the embodiments may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct RAMbus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.

[0106] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, device, article or method including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, device, article or method. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the existence of other identical elements in the process, device, article or method including the element.

[0107] The above description is only a preferred embodiment of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A path score optimization method, characterized in that: The method comprises: Based on the CTC algorithm, the sum of all possible command word sequence path scores is calculated; calculating a normalized path length based on the sum; Get the length of the phoneme sequence 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; If correction is required, the path score is calculated based on the corrected normalized path length.

2. The path score optimization method according to claim 1, characterized in that: The step of calculating the sum of all possible command word sequence path scores based on the CTC algorithm includes: Construct a CTC matrix, where the rows of the CTC matrix represent the feature sequences of the input audio and the columns represent the possible output labels; For each time step, calculate the score of each possible output label, where the possible output label includes the blank label; The scores of all possible command word sequence paths are calculated and summed up to obtain a total score, namely the sum.

3. The path score optimization method according to claim 1, characterized in that: The step of calculating the normalized path length based on the sum comprises: Determine the length of the current audio input sequence; Calculate the sum of the scores of the positions corresponding to the blank labels in each frame in the CTC matrix; The contribution of the blank label is subtracted from the length of the recognition frame sequence to obtain the normalized path length.

4. The path score optimization method according to claim 1, characterized in that: The step of obtaining the length of the phoneme sequence of the command word comprises: Determine the text information of the command word, and convert the text information of the command word into a corresponding phoneme sequence; The number of phonemes contained in the phoneme sequence is determined to obtain the phoneme sequence length of the command word.

5. The path score optimization method according to claim 1, characterized in that: 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 includes: Compare the phoneme sequence length to the normalized path length; If the normalized path length is greater than the phoneme sequence length, there is no need to correct the normalized path length; 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.

6. The path score optimization method according to claim 1, characterized in that: If correction is required, the step of calculating the path score based on the corrected normalized path length includes: If correction is required, the path score is calculated and output based on the following formula: Among them, 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.

7. A path score optimization device, characterized in that: include: A calculation module, used for calculating the sum of all possible command word sequence path scores based on the CTC algorithm; a normalization module, configured to calculate a normalized path length based on the sum; An acquisition module, used for acquiring the length of the phoneme sequence of the command word; A comparison module, used for comparing the phoneme sequence length of the command word with the normalized path length, and determining whether the normalized path length needs to be corrected; The output module is used to calculate the path score based on the corrected normalized path length if correction is required.

8. The path score optimization device according to claim 7, characterized in that: The comparison module comprises: A first comparison unit, used for comparing the phoneme sequence length with the normalized path length; A first judgment unit, configured to determine that if the normalized path length is greater than the phoneme sequence length, then no correction is required to the normalized path length; The correction unit is used to correct the normalized path length if the normalized path length is less than the phoneme sequence length, and correct the value corresponding to the normalized path length to the value corresponding to the phoneme sequence length to obtain the corrected normalized path length.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

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

  • Command word score calculation method and device, equipment and medium

    CN118098206A

  • Methods, devices and computer-readable storage media for real-time speech recognition

    US20200219486A1

  • Transformer-based voice recognition technology using improved voice as conditioning feature

    US20230386457A1