Speech recognition method and device, readable storage medium and computer program product
By using the target language model updated based on the command thesaurus in the voice recognition system, the acoustic score matrix of the voice control instructions is processed, the problem of low pronunciation similar to the accuracy of the pronunciation of the pronunciation, and the higher voice control instruction recognition accuracy accuracy Essence
Patent Information
- Application Number
- CN202411524407.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-29
- Publication Date
- 2025-01-24
AI Technical Summary
In the prior art, when facing command words with similar pronunciation, the recognition accuracy of voice control instructions is low.
This paper proposes a speech recognition method that obtains the acoustic score matrix of voice control instructions and inputs it into the target language model based on the command vocabulary update, obtains the acoustic score and language score of the candidate syllable string, and finally identifies the target command word.
The accuracy of recognition of voice control instructions has been improved, especially when facing similar command words, the target command words can be recognized more accurately.
Smart Images

Figure CN119360850A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of speech recognition technology, and in particular to a speech recognition method, device, readable storage medium and computer program product. Background Art
[0002] With the progress of society and the development of technology, more and more home appliances have voice control functions, and home appliances with voice control functions can perform corresponding actions in response to user's voice control instructions.
[0003] In the related art, acoustic models are used in electrical devices with voice control functions to implement voice control, but the recognition accuracy is low when faced with command words with similar pronunciations. Summary of the invention
[0004] The present application aims to solve one of the technical problems existing in the prior art or related technology.
[0005] To this end, the first aspect of the present application proposes a speech recognition method.
[0006] A second aspect of the present application provides a speech recognition device.
[0007] The third aspect of the present application proposes another speech recognition device.
[0008] A fourth aspect of the present application provides a readable storage medium.
[0009] A fifth aspect of the present application proposes a computer program product.
[0010] In view of this, according to the first aspect of the present application, a speech recognition method is proposed, the speech recognition method comprising: upon receiving a voice control instruction, obtaining an acoustic score matrix of the voice control instruction; inputting the acoustic score matrix into a target language model to obtain at least one candidate syllable string matching the acoustic score matrix, wherein the target language model is a language model that updates model weights based on a command vocabulary, and the command vocabulary includes at least two preset command words; determining an acoustic score and a language score corresponding to at least one candidate syllable string based on the target language model and the acoustic score matrix; and identifying a target command word from at least one candidate syllable string based on the acoustic score and the language score.
[0011] In the technical solution, the speech recognition method is applied to electrical devices, including but not limited to household appliances. When the electrical device receives a speech control instruction, an acoustic score matrix is obtained.
[0012] Specifically, the acoustic features of the voice control command are calculated and input into the acoustic model to obtain the acoustic score. Since the acoustic score contains multiple frames, for example, a frame of data is output every 40 milliseconds of voice control command, each frame contains a fixed number of floating point numbers, and each floating point number corresponds to a syllable score. For example, if there are 410 syllables in the voice control command, the floating point number is a fixed number of 410. Among them, the number of frames is not fixed, and the number of frames depends on the time length of the voice control command.
[0013] In the technical solution, after obtaining the acoustic score matrix, the acoustic score matrix is input into the target language model. Specifically, the acoustic score matrix is sent to the wfst decoder for decoding to obtain at least one candidate syllable string. The at least one candidate syllable string is a syllable string corresponding to the voice control instruction determined according to the voice control instruction. Exemplarily, the candidate syllable string can be a string of pinyin.
[0014] It should be noted that the target language model is a language model obtained by updating the model weight of the constructed initial language model based on the command word library. Since the command word library includes at least two preset command words, the target language model can distinguish the at least two preset command words. After the first language score of the voice control instruction is recognized by the target language model, the corresponding target command word can be found in the at least two preset command words based on the first language score.
[0015] In this technical solution, after obtaining at least one candidate syllable string, it is necessary to screen the target syllable string from the at least one candidate syllable string, and determine the command word corresponding to the target syllable string as the target command word. When the wfst decoder decodes the acoustic score matrix, the acoustic score and language score of the candidate syllable string are calculated by the target language model. According to the acoustic score and language score, the target command word can be screened from at least one candidate syllable string.
[0016] In the technical solution of the present application, after receiving the voice control instruction, the acoustic score matrix of the voice control instruction is obtained, and the acoustic score matrix is sent to the target language model to obtain at least one candidate syllable string matched by the acoustic score matrix. After obtaining at least one candidate syllable string, the acoustic score and language score of at least one candidate syllable string can be determined according to the target language model, and the acoustic score and language score are used as the basis for determining the target command word. The target command word can be identified in at least one candidate syllable string through the acoustic score and language score, so that the electrical device can perform corresponding actions based on the target command word, thereby improving the accuracy of voice control instruction recognition.
[0017] In some technical schemes, optionally, a target command word is identified from at least one candidate syllable string based on an acoustic score and a language score, including: obtaining acoustic scores and language scores corresponding to multiple candidate syllable strings; performing weighted calculations on the acoustic scores and language scores corresponding to each obtained candidate syllable string to obtain a candidate recognition score corresponding to the candidate syllable string; and identifying a preset command word corresponding to the candidate syllable string corresponding to the candidate recognition score with the highest score as the target command word.
[0018] In this technical solution, when there are multiple candidate syllable strings, the acoustic scores and language scores corresponding to at least some of the candidate syllable strings are obtained. The candidate recognition score corresponding to each obtained candidate syllable string is calculated, wherein the candidate recognition score is a score obtained by weighted calculation of the acoustic score and language score corresponding to each candidate syllable string. After the candidate recognition scores corresponding to multiple candidate syllable strings are calculated, the preset command word corresponding to the candidate with the highest score is used as the target command word.
[0019] Specifically, the calculation formula of the candidate recognition score includes: candidate recognition score = acoustic score + alpha × language score, where alpha is a parameter for adjusting the proportion of the language score in the total score. The above calculation formula can be used to calculate the candidate recognition score corresponding to each candidate syllable string by weighted calculation, and by adjusting the size of alpha, the proportion of the language score in the candidate recognition score can be adjusted.
[0020] In the technical solution of the present application, the candidate recognition score corresponding to the candidate syllable string is calculated by weighting the acoustic score and language score corresponding to the candidate syllable string, and the preset command word corresponding to the highest candidate recognition score is used as the target command word, thereby further improving the accuracy of voice control command recognition.
[0021] In some technical solutions, optionally, when a voice control instruction is received, before obtaining the acoustic score matrix of the voice control instruction, the speech recognition method also includes: generating a training data set based on a command vocabulary, the training data set including multiple training data; when an initial language model is obtained, determining a first correspondence between multiple training data and model weights in the initial language model; and updating the model weights in the initial language model based on the first correspondence and multiple training data.
[0022] In this technical solution, the training data set includes a positive data set and a negative data set. It should be noted that each piece of data in the training data set can be a sequence of multiple words, and the word can be any one of an English word, a single Chinese character, a Chinese word segmentation, and a syllable.
[0023] In this technical solution, a traditional method is used to obtain an initial language model. Specifically, all command words are copied twice as training corpus. It is necessary to ensure that each command word is repeated 3 times or more in the training corpus to prevent it from being ignored due to insufficient frequency during statistics. A statistical combination smoothing algorithm is provided to obtain the initial language model.
[0024] In this technical solution, the trained initial language model includes multiple weights. Before updating the weights of the initial language model, it is necessary to determine the first correspondence between each weight in the initial language model and the training data in the training data set, so as to facilitate the subsequent search for the weight corresponding to the training data in the initial language model based on the first correspondence.
[0025] It should be noted that since the weighted finite state machine is converted from the arpa (a file format) format file of the initial language model, the weight of the transition edge in the weighted finite state machine corresponds to the probability log value of the transition probability of the n-th word in the n-tuple initial language model, which is a word string composed of n-1 words. In order to limit the scale, the initial language model will not record some uncommon high-order tuples, but will use the probability logarithm of the more common low-order tuple plus the corresponding first backoff weight to replace the probability log value of the high-order tuple. The model weight in the initial language model includes the probability log value and the first backoff weight.
[0026] In this technical solution, after determining the first correspondence between the weights in the initial language model and the training data set, the model weights in the initial language model can be updated according to the multiple training data in the training data set. Through the first correspondence, the model weight corresponding to each training data in the training data set in the initial language model can be found, that is, the probability logarithm and the first fallback weight corresponding to the training data can be found, and the probability logarithm and fallback weight in the initial language model are updated, thereby improving the recognition accuracy of the initial language model.
[0027] In the technical solution of the present application, after generating a training data set, the model weights that affect the training data are searched in the initial language model, thereby determining the first correspondence between each training data in the training data set and the model weights. Then, the model weights in the initial language model are updated according to the first correspondence and the training data. The weighted initial language model updated by the updating method has a higher accuracy and a lower misrecognition rate than the weighted initial language model obtained by using a statistical smoothing algorithm.
[0028] In some technical solutions, optionally, the model weight includes a probability logarithm and a first backoff weight;
[0029] Determining a first correspondence between a plurality of training data and a model weight in an initial language model includes:
[0030] Extracting first training data from a plurality of training data, where the first training data is data that has not been extracted;
[0031] Determine a weight expression of the first training data according to the initial language model, wherein the weight expression is used to express a corresponding relationship between the first training data, the probability logarithm, and the first backoff weight;
[0032] The step of extracting the first training data from the plurality of training data is returned to execution until the first training data does not exist in the plurality of training data.
[0033] In this technical solution, the model weight includes a probability logarithm and a first back-off weight, and the first corresponding relationship includes a corresponding relationship between the training data and the probability logarithm and the first back-off weight, wherein the first corresponding relationship can be expressed by a calculated weight expression, that is, the first corresponding relationship can be determined after determining the weight expression.
[0034] Specifically, in the process of determining the first corresponding relationship, it is necessary to extract the first training data that have not been extracted from multiple training data in turn, and determine the weight expression of the first training data according to the initial language model. After determining the weight expression of the first training data, return to the step of extracting the first training data until there is no unextracted first training data in the training data set, thereby determining the first corresponding relationship between each training data in the training data set and the model weight.
[0035] In the technical solution of the present application, by traversing each first training data in the training data set, the weight of the first training data is calculated according to the initial language model, and the probability logarithm and the first fallback weight that affect the recognition probability of the first training data in the initial language model are saved, so as to obtain the first corresponding relationship between the first training data and the model weight, thereby improving the accuracy and completeness of the first corresponding relationship.
[0036] In some technical schemes, optionally, according to the initial language model, a weight expression of the first training data is determined, including: splitting the first training data into at least two n-order tuples, where n is a positive integer; based on the initial language model, determining a first n-order tuple of the at least two n-order tuples, wherein the first n-order tuple is an n-order tuple whose probability logarithm is found in the initial language model; and using the first probability logarithm of the first n-order tuple as at least part of the weight expression.
[0037] In this technical solution, after the first training data is extracted, the first training data is split into multiple n-order tuples. Multiple n-order tuples are searched in sequence in the initial language model, and when the n-order tuple is found in the initial language model, the n-order tuple is determined as the first n-order tuple.
[0038] It should be noted that the order of the n-order tuple is n, and the value range of n is 1 to 5. After the first training data is split into multiple n-order tuples, after the first n-order tuple in at least two n-order tuples is determined, the first probability logarithm corresponding to the first n-order tuple is obtained. Since the first n-order tuple is an n-order tuple whose probability logarithm can be found in the initial language model, the sum of the first probability logarithms is used as the probability logarithm of the training data.
[0039] In this technical solution, if the probability logarithm of the first n-th order tuple can be found in the initial language model, the found probability logarithm is directly used as the first probability logarithm, and the first probability logarithm is used as at least part of the weight expression.
[0040] In the technical solution of the present application, the first training data is split into multiple n-order tuples, and when the probability logarithm is found, the n-order tuple is used as the first n-order tuple, the first probability logarithm corresponding to the first n-order tuple is obtained, and the first probability logarithm is used as at least a part of the weight expression, thereby determining the first corresponding relationship between the first training data and the model weight, thereby ensuring the accuracy of the first corresponding relationship.
[0041] In some technical schemes, the speech recognition method also includes: determining a second n-order tuple among at least two n-order tuples based on an initial language model, wherein the second n-order tuple is an n-order tuple whose probability logarithm is not found in the initial language model; reducing the order of the second n-order tuple to obtain two sub-tuples; obtaining the second probability logarithms and first back-off weights corresponding to the two sub-tuples; and determining a weight expression based on the first probability logarithm, the second probability logarithm and the first back-off weight.
[0042] In this technical solution, after the first training data is extracted, the first training data is split into multiple n-order tuples. Multiple n-order tuples are searched in sequence in the initial language model. If the n-order tuple is found in the initial language model, the n-order tuple is determined as the first n-order tuple. If the n-order tuple is not found in the initial language model, the n-order tuple is determined as the second n-order tuple. When the second n-order tuple is determined, it is determined that the second n-order tuple does not exist in the initial language model. Since the lower the order, the greater the probability of existing in the initial language model, the second n-order tuple is further reduced in order to obtain two sub-tuples of the second n-order tuple. Among them, the second probability logarithm and the first back-off weight are the probability logarithm and back-off weight of the sub-tuple after the second n-order tuple that has not been found is reduced in order.
[0043] It should be noted that when a sub-tuple is a first-order tuple, the sub-tuple must exist in the initial language model.
[0044] In the technical solution of the present application, by splitting the first training data into multiple n-order tuples, the n-order tuple whose probability logarithm is found in the initial language model is taken as the first n-order tuple, and the n-order tuple whose probability logarithm is not found in the initial language model is taken as the second n-order tuple, the second n-order tuple is reduced in order to obtain two sub-tuples, and the second probability logarithms and first back-off weights corresponding to the two sub-tuples are obtained. According to the first probability logarithm corresponding to the first n-order tuple, the second probability logarithm and the first back-off weight, the first corresponding relationship between the first training data and the model weight can be determined, thereby further ensuring the accuracy of the first corresponding relationship.
[0045] In some technical solutions, optionally, according to the first correspondence, the model weights in the initial language model are updated according to multiple training data, including: obtaining a target weight range corresponding to each training data; determining, according to the first correspondence, the model weights corresponding to the training data corresponding to the first correspondence; determining, according to the model weights corresponding to the multiple training data, the actual weight values of the multiple training data; and updating the model weights corresponding to each training data according to the target weight range and the actual weight value.
[0046] In this technical solution, the target weight range is the expected weight range, wherein the actual value range of the actual weight value of the sentence is from negative infinity to 0, and the target weight range is the expected weight range in the actual value range. If all training data are within the target weight range, it means that the language model is more accurate, and the WFST decoding effect is better using the language model.
[0047] In this technical solution, according to the first corresponding relationship, the model weight of the training data corresponding to the first corresponding relationship can be determined, and according to the model weights corresponding to the multiple training data in the training data set, the actual weight values of the multiple training data can be determined.
[0048] In the technical solution of the present application, after determining the target weight range and the actual weight value, the model weight corresponding to the training data can be determined according to the first corresponding relationship, and the model weight corresponding to each training data can be updated according to the difference relationship between the target weight range and the actual weight value, thereby improving the recognition accuracy of the updated initial language model.
[0049] In some technical solutions, optionally, the model weight corresponding to each training data is updated according to the target weight range and the actual weight value, including:
[0050] Determine the weight difference based on the target weight range and the actual weight value;
[0051] The model weights are updated according to the weight difference and the learning rate.
[0052] In this technical solution, after determining the target weight range and the actual weight value of the training data in the initial language model, the weight difference can be calculated, which can reflect the error of the probability logarithm and the first backoff weight in the initial language model. Therefore, the model weight corresponding to the training data can be updated according to the calculated weight difference and learning rate.
[0053] It should be noted that when updating the model weights, if the first fallback weight is blank, it will remain blank without updating. The first fallback weights of tuples ending with in the initial language model and the highest-order tuples are usually blank.
[0054] In the technical solution of the present application, based on the weight difference between the target weight range and the actual weight value found in the initial language model, since the weight difference can reflect the error of the model weight in the initial language model, the model weight is updated by the weight difference and the learning rate, thereby further improving the recognition accuracy of the initial language model after the model weight is updated.
[0055] In some technical solutions, optionally, when the actual weight value is greater than the maximum value of the target weight range, the difference between the actual weight value and the maximum value of the target weight range is determined as the weight difference;
[0056] When the actual weight value is less than the minimum value of the target weight range, the difference between the actual weight value and the minimum value of the target weight range is determined as the weight difference;
[0057] When the actual weight value is greater than or equal to the minimum value of the target weight range and less than or equal to the maximum value of the target weight range, the weight difference is determined to be 0.
[0058] In this technical solution, in the process of calculating the weight difference, it is necessary to select a corresponding calculation method according to the numerical relationship between the actual weight value and the boundary value in the target weight range.
[0059] In the technical solution of the present application, the corresponding calculation method is determined by comparing the numerical relationship between the actual weight value and the target weight range, and the weight difference is calculated by the corresponding calculation method, thereby improving the processing efficiency on the basis of achieving the accuracy of the weight difference.
[0060] In some technical solutions, optionally, after updating the model weights in the initial language model according to multiple training data based on the first corresponding relationship, the speech recognition method also includes: returning to execute the step of updating the model weights in the initial language model according to multiple training data based on the first corresponding relationship until the initial language model reaches the expected target, wherein the expected target is associated with the target weight range and / or weight difference.
[0061] In the technical solution of the present application, after the model weights in the initial language model are updated in sequence according to a plurality of training data, it is necessary to return to the step of updating the model weights in the initial language model according to the training data set, that is, to repeatedly iteratively update the updated initial language model until the expected goal of the initial language model is achieved. When the initial language model achieves the expected goal, it is determined that the model weights in the initial language model have been updated to the best, and at this time, it is not necessary to continue iteratively updating the model weights, and the updated initial language model has a higher accuracy rate and a lower misrecognition rate.
[0062] In some technical solutions, optionally, the expected goal includes: the actual weight value of each training data is within the target weight range.
[0063] In this technical solution, during the iterative update of the model weights in the initial language model, it is continuously recorded whether the actual weight value of each training data found in the initial language model is within the target weight range. When the actual weight value corresponding to each training data is within the target weight range, it is determined that the initial language model has achieved the expected goal.
[0064] In this technical solution, during the iterative update of the model weights in the initial language model, the weight difference corresponding to each training data is continuously recorded, and after each update iteration of the model weights, the sum of the weight difference corresponding to each training data is calculated.
[0065] In the technical solution of the present application, in the process of repeatedly iteratively updating the model weights of the initial language model, it is determined whether the initial language model has achieved the expected goal, thereby ensuring the recognition accuracy of the target language model obtained by finally updating the weights.
[0066] In some technical solutions, optionally, the training data includes positive example data and negative example data, and the target weight range includes a first weight range and a second weight range, the first weight range is a range of the positive example data, and the second weight range is a range of the negative example data;
[0067] Obtaining the target weight range corresponding to each training data includes: determining the first weight range according to the preset weight range and the first error value; determining the second weight range according to the preset weight range, the second error value and the preset range difference, wherein the second error value is greater than the first error value.
[0068] In this technical solution, the training data includes positive data and negative data, and the positive data and the negative data correspond to different target weight ranges, wherein the positive data corresponds to a first weight range and the negative data corresponds to a second weight range.
[0069] In the technical solution of the present application, the training data set includes positive example data and negative example data. By setting the corresponding first weight range and second weight range for the positive example data and the negative example data respectively, not only the recognition accuracy of the initial language model after updating the model weight can be improved, but also the speed at which the model weight updating process reaches the expected goal can be improved.
[0070] In some technical solutions, optionally, generating a training data set includes: determining at least two target command words as at least two positive example data in the training data set; randomly extracting words from a word list to form a word sequence, the word list containing multiple words; if the word sequence is not in the at least two positive example data, using the word sequence as negative example data in the training data set.
[0071] In this technical solution, all target command words are used as positive data sets in the training data set, and each command word is used as the first positive data set. The negative data in the negative data set is a data set obtained based on a word list. The words in the word list are matched with the words in the target command words, and words are randomly selected from the word list to form a word sequence of random length. When the randomly composed word sequence is not in the positive data set, the randomly composed word sequence is set as negative data.
[0072] In some technical solutions, optionally, the number of positive example data is X, and the number of negative example data is Y, where 10X≤Y≤1000X.
[0073] In the technical solution of the present application, by setting the number of negative data in the training data set to be greater than or equal to ten times the number of positive data, the number of negative data is sufficient, thereby improving the recognition accuracy of the initial language model after updating the model weight. By setting the number of negative data in the training data set to be less than or equal to one thousand times the number of positive data, the number of negative data is not too much, which makes it difficult to train to achieve the expected goal, that is, the expected goal is too high and difficult to achieve under the condition of a limited-scale language model.
[0074] In some technical solutions, optionally, after updating the model weights in the initial language model according to multiple training data based on the first corresponding relationship, it also includes: obtaining the corresponding third probability logarithm and second back-off weight in each model weight; when the numerical relationship between the third probability logarithm, the probability logarithm after the tuple corresponding to the third probability logarithm is upgraded, and the second back-off weight satisfies a preset inequality, the initial language model is determined as the target language model; when the numerical relationship between the third probability logarithm and the second back-off weight does not satisfy the preset inequality, updating the second back-off weight based on the correction coefficient.
[0075] In this technical solution, the third probability logarithm and the second back-off weight are the probability logarithm and the back-off weight of the initial language model after the weights are updated.
[0076] In this technical solution, after the model weights in the initial language model are updated, the third probability logarithm and the second fallback weight in each model weight are obtained, the training data corresponding to the third probability logarithm and the second fallback weight are the same, and the third probability logarithm and the second fallback weight are both updated model weights.
[0077] In the case where the numerical relationship between the third probability logarithm, the probability logarithm of the tuple corresponding to the third probability logarithm after the order is raised, and the second fallback weight satisfies the preset inequality, it is determined that the model weights in the initial language model are appropriate, and there is no need to correct the initial language model after the weight is updated. In the case where the numerical relationship between the third probability logarithm, the probability logarithm of the tuple corresponding to the third probability logarithm after the order is raised, and the second fallback weight does not satisfy the preset inequality, it is determined that there are inappropriate model weights in the initial language model, and the second fallback weight needs to be corrected based on the correction coefficient.
[0078] In the technical solution of the present application, after the model weights in the initial language model are updated, it is necessary to detect whether each model weight in the initial language model is appropriate. By using a preset inequality, it is possible to detect whether there are inappropriate model weights in the initial language model. When there are inappropriate model weights, the second fallback weights therein can be corrected based on the correction coefficient, thereby improving the accuracy of the final initial language model.
[0079] According to a second aspect of the present application, a speech recognition device is provided, the speech recognition device comprising:
[0080] An acquisition module, configured to acquire an acoustic score matrix of a voice control instruction upon receiving the voice control instruction;
[0081] an acquisition module, configured to input the acoustic score matrix into a target language model, and acquire at least one candidate syllable string matching the acoustic score matrix, wherein the target language model is a language model for updating model weights based on a command vocabulary, and the command vocabulary includes at least two preset command words;
[0082] A determination module, configured to determine an acoustic score and a language score corresponding to at least one candidate syllable string according to a target language model and an acoustic score matrix;
[0083] The recognition module is used to recognize a target command word from at least one candidate syllable string according to the acoustic score and the language score.
[0084] In the technical solution of the present application, after receiving the voice control instruction, the acoustic score matrix of the voice control instruction is obtained, and the acoustic score matrix is sent to the target language model to obtain at least one candidate syllable string matched by the acoustic score matrix. After obtaining at least one candidate syllable string, the acoustic score and language score of at least one candidate syllable string can be determined according to the target language model, and the acoustic score and language score are used as the basis for determining the target command word. The target command word can be identified in at least one candidate syllable string through the acoustic score and language score, so that the electrical device can perform corresponding actions based on the target command word, thereby improving the accuracy of voice control instruction recognition.
[0085] According to the third aspect of the present application, a speech recognition device is provided, the speech recognition device includes a processor and a memory, the memory stores a program or instruction, and when the program or instruction is executed by the processor, the steps of the speech recognition method in any of the above technical solutions are implemented. Therefore, the speech recognition device has all the beneficial effects of the speech recognition method in any of the above technical solutions, which will not be repeated here.
[0086] According to the fourth aspect of the present application, a readable storage medium is proposed, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the speech recognition method in any of the above-mentioned technical solutions are implemented, thereby having all the beneficial technical effects of the speech recognition method in any of the above-mentioned technical solutions.
[0087] According to the fifth aspect of the present application, a computer program product is proposed. The program product is stored in a storage medium. The program product is executed by at least one processor to implement the steps of the speech recognition method in any of the above-mentioned technical solutions, and thus has all the beneficial technical effects of the speech recognition method in any of the above-mentioned technical solutions.
[0088] Additional aspects and advantages of the present application will become apparent in the following description or will be learned through practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0089] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:
[0090] Figure 1 A flow chart of a speech recognition method provided in some embodiments of the present application is shown;
[0091] Figure 2 A schematic diagram showing a speech recognition method provided in some embodiments of the present application is shown;
[0092] Figure 3 A schematic diagram of iterative update of a speech recognition method provided in some embodiments of the present application is shown;
[0093] Figure 4 One of the structural block diagrams of a speech recognition device is shown in some embodiments of the present application;
[0094] Figure 5 A second structural block diagram of a speech recognition device provided in some embodiments of the present application is shown. DETAILED DESCRIPTION
[0095] In order to more clearly understand the above-mentioned objectives, features and advantages of the present application, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods. It should be noted that, in the absence of conflict, the present embodiment and the features in the embodiment can be combined with each other.
[0096] In the following description, many specific details are set forth to facilitate a full understanding of the present application. However, the present application may also be implemented in other ways different from those described herein. Therefore, the scope of protection of the present application is not limited to the specific embodiments disclosed below.
[0097] Refer to the following Figures 1 to 5 The present invention describes a speech recognition method, an apparatus, a readable storage medium, and a computer program product according to some embodiments of the present application.
[0098] According to one embodiment of the present application, Figure 1 A flow chart of a speech recognition method provided in some embodiments of the present application is shown. Figure 1 As shown, a speech recognition method is proposed, and the speech recognition method includes:
[0099] Step 102, when a voice control instruction is received, obtaining an acoustic score matrix of the voice control instruction;
[0100] In this embodiment, the speech recognition method is applied to an electrical device, including but not limited to a household appliance. When the electrical device receives a speech control instruction, an acoustic score matrix is obtained.
[0101] Exemplarily, the speech recognition method is applied to air conditioners, microwave ovens, sweepers, and the like.
[0102] Specifically, the acoustic features of the voice control command are calculated and input into the acoustic model to obtain the acoustic score. Since the acoustic score contains multiple frames, for example, a frame of data is output every 40 milliseconds of voice control command, each frame contains a fixed number of floating point numbers, and each floating point number corresponds to a syllable score. For example, if there are 410 syllables in the voice control command, the floating point number is a fixed number of 410. Among them, the number of frames is not fixed, and the number of frames depends on the time length of the voice control command.
[0103] Step 104, inputting the acoustic score matrix into a target language model to obtain at least one candidate syllable string matching the acoustic score matrix, wherein the target language model is a language model whose model weights are updated based on a command vocabulary, and the command vocabulary includes at least two preset command words;
[0104] In this embodiment, after obtaining the acoustic score matrix, the acoustic score matrix is input into the target language model. Specifically, the acoustic score matrix is sent to the wfst decoder for decoding to obtain at least one candidate syllable string. The at least one candidate syllable string is a syllable string corresponding to the voice control instruction determined according to the voice control instruction. Exemplarily, the candidate syllable string can be a string of pinyin.
[0105] Exemplarily, the preset command words include at least "turn on the air conditioner", and accordingly, there is a non-preset command word "turn on the air conditioner". The second acoustic scores of the preset command word and the non-preset command word are very close to the first acoustic score of the actually received voice control instruction. It may also happen that the second acoustic score of "turn on the air conditioner" is closer to the first acoustic score.
[0106] Step 106, determining an acoustic score and a language score corresponding to at least one candidate syllable string according to the target language model and the acoustic score matrix;
[0107] In this embodiment, the target language model is a language model obtained by updating the model weight of the constructed initial language model based on the command word library. Since the command word library includes at least two preset command words, the target language model can distinguish the at least two preset command words. After the first language score of the voice control instruction is recognized by the target language model, the corresponding target command word can be found in the at least two preset command words based on the first language score.
[0108] Exemplarily, at least two preset command words include "turn on the air conditioner" and "punch in the air conditioner", and the second acoustic scores of the two preset command words are relatively close to the first acoustic scores of the actually received voice control instructions, and after the initial language model before the weight is updated is used to recognize the two preset command words, the language scores obtained are not much different, and it is still difficult to distinguish the target command word corresponding to the voice control instruction. After the initial language model is updated with the model weight based on the command word library including the above two command words, the target language model is obtained, and the corresponding second language scores obtained by inputting the two preset command words into the target language model are quite different, thereby improving the recognition accuracy of the voice control instruction. When the user says "turn on the air conditioner", the pronunciations of "punch in the air conditioner" and "turn on the air conditioner" are very similar. If only the acoustic score is looked at, it may be mistakenly recognized as "punch in the air conditioner", but because one is a positive example and the other is a negative example, their language scores are very different, and the final score (the weighted sum of the acoustic score and the language score) is very different, that is, the score of the positive example is significantly greater than the score of the negative example, so that the command word "turn on the air conditioner" can be correctly recognized.
[0109] Step 108 : identifying a target command word from at least one candidate syllable string according to the acoustic score and the language score.
[0110] In this embodiment, after obtaining at least one candidate syllable string, it is necessary to screen a target syllable string from the at least one candidate syllable string, and determine the command word corresponding to the target syllable string as the target command word. When the wfst decoder decodes the acoustic score matrix, the acoustic score and language score of the candidate syllable string are calculated by the target language model. According to the acoustic score and language score, the target command word can be screened from the at least one candidate syllable string.
[0111] In an embodiment of the present application, after receiving a voice control instruction, an acoustic score matrix of the voice control instruction is obtained, and the acoustic score matrix is sent to the target language model to obtain at least one candidate syllable string matched by the acoustic score matrix. After obtaining at least one candidate syllable string, the acoustic score and language score of at least one candidate syllable string can be determined according to the target language model, and the acoustic score and language score are used as the basis for determining the target command word. The target command word can be identified in at least one candidate syllable string through the acoustic score and language score, so that the electrical device can perform corresponding actions based on the target name example word, thereby improving the accuracy of voice control instruction recognition.
[0112] In some embodiments, optionally, a target command word is identified from at least one candidate syllable string based on an acoustic score and a language score, including: obtaining acoustic scores and language scores corresponding to multiple candidate syllable strings; performing weighted calculations on the acoustic scores and language scores corresponding to each obtained candidate syllable string to obtain a candidate recognition score corresponding to the candidate syllable string; and identifying a preset command word corresponding to the candidate syllable string corresponding to the candidate recognition score with the highest score as the target command word.
[0113] In this embodiment, when there are multiple candidate syllable strings, the acoustic scores and language scores corresponding to at least some of the candidate syllable strings are obtained. The candidate recognition score corresponding to each obtained candidate syllable string is calculated, wherein the candidate recognition score is a score obtained by weighted calculation of the acoustic score and language score corresponding to each candidate syllable string. After the candidate recognition scores corresponding to multiple candidate syllable strings are calculated, the preset command word corresponding to the candidate with the highest score is used as the target command word.
[0114] Specifically, the calculation formula of the candidate recognition score includes: candidate recognition score = acoustic score + alpha × language score, where alpha is a parameter for adjusting the proportion of the language score in the total score. The above calculation formula can be used to calculate the candidate recognition score corresponding to each candidate syllable string by weighted calculation, and by adjusting the size of alpha, the proportion of the language score in the candidate recognition score can be adjusted.
[0115] In an embodiment of the present application, the candidate recognition score corresponding to the candidate syllable string is calculated by weighting the acoustic score and language score corresponding to the candidate syllable string, and the preset command word corresponding to the highest candidate recognition score is used as the target command word, thereby further improving the accuracy of voice control command recognition.
[0116] In some embodiments, optionally, when a voice control instruction is received, before acquiring the acoustic score matrix of the voice control instruction, the voice recognition method further includes:
[0117] A training data set is generated according to a command vocabulary, wherein the training data set includes a plurality of training data; when an initial language model is obtained, a first correspondence between the plurality of training data and a model weight in the initial language model is determined; and according to the first correspondence, the model weight in the initial language model is updated according to the plurality of training data to obtain a target language model.
[0118] In this embodiment, a training data set is generated according to a command word library including at least two preset command words, and the generated training data set includes a positive example data set and a negative example data set. It should be noted that each piece of data in the training data set can be a sequence composed of multiple words, and the words can be any one of English words, single Chinese characters, Chinese word segmentation, and syllables.
[0119] In this embodiment, a traditional method is used to obtain an initial language model. Specifically, all command words are copied twice as training corpus, and it is necessary to ensure that each command word appears 3 times or more in the training corpus to prevent it from being ignored due to insufficient occurrence frequency during statistics, and an initial language model is obtained by providing statistical combination smoothing algorithm.
[0120] In this embodiment, the initial language model obtained by training includes multiple weights. Before updating the weights of the initial language model, it is necessary to determine the first correspondence between each weight in the initial language model and the training data in the training data set, which is convenient for subsequently finding the weight corresponding to the training data in the initial language model based on this first correspondence.
[0121] It should be noted that since the weighted finite state transducer is converted from the arpa format file of the initial language model, the weight of the transition edge in the weighted finite state transducer corresponds to the probability logarithm value of the probability of the word string composed of an n - 1 - word group in the n - gram initial language model followed by the nth word. In order to limit the scale, for some uncommon high - order n - grams, the initial language model does not record them, but uses the probability logarithm of more common low - order n - grams plus the corresponding first back - off weight to replace the probability logarithm value of the high - order n - grams. The model weights in the initial language model include probability logarithm values and first back - off weights.
[0122] Exemplarily, taking the n - gram as 2 - gram as an example for illustration, the 2 - grams are as follows:
[0123] - 1.2 power on - 1.0;
[0124] - 0.9 start - 2.0;
[0125] Among them, - 1.2 and - 0.9 are probability logarithms, indicating that the probability logarithm value of "power on" followed by "machine" is - 1.2, and the probability logarithm value of "power on" followed by "start" is - 0.9. - 1.0 and - 2.0 are the first back - off weights.
[0126] In this embodiment, after determining the first correspondence between the weights in the initial language model and the training data set, the model weights in the initial language model can be updated according to the multiple training data in the training data set. Through the first correspondence, the model weight corresponding to each training data in the training data set in the initial language model can be found, that is, the probability logarithm and the first fallback weight corresponding to the training data can be found, and the probability logarithm and fallback weight in the initial language model are updated, thereby improving the recognition accuracy of the initial language model.
[0127] In an embodiment of the present application, after generating a training data set, the model weights that affect the training data are searched in the initial language model, thereby determining the first correspondence between each training data in the training data set and the model weights. The model weights in the initial language model are then updated according to the first correspondence and the training data. The weighted initial language model updated by the updating method has a higher accuracy and a lower misrecognition rate than the weighted initial language model obtained by using a statistical smoothing algorithm.
[0128] In some embodiments, optionally, the model weights include a probability logarithm and a first backoff weight;
[0129] Determining a first correspondence between a plurality of training data and a model weight in an initial language model includes:
[0130] Extracting first training data from a plurality of training data, where the first training data is data that has not been extracted;
[0131] Determine a weight expression of the first training data according to the initial language model, wherein the weight expression is used to express a corresponding relationship between the first training data, the probability logarithm, and the first backoff weight;
[0132] The step of extracting the first training data from the plurality of training data is returned to execution until the first training data does not exist in the plurality of training data.
[0133] In this embodiment, the model weight includes a probability logarithm and a first back-off weight, and the first correspondence includes a correspondence between the training data and the probability logarithm and the first back-off weight, wherein the first correspondence can be expressed by a calculated weight expression, i.e., the first correspondence can be determined after determining the weight expression.
[0134] Specifically, in the process of determining the first corresponding relationship, it is necessary to extract the first training data that have not been extracted from multiple training data in turn, and determine the weight expression of the first training data according to the initial language model. After determining the weight expression of the first training data, return to the step of extracting the first training data until there is no unextracted first training data in the training data set, thereby determining the first corresponding relationship between each training data in the training data set and the model weight.
[0135] In an embodiment of the present application, by traversing each first training data in the training data set, calculating the weight of the first training data according to the initial language model, and saving the probability logarithm and the first fallback weight in the initial language model that affect the recognition probability of the first training data, the first corresponding relationship between the first training data and the model weight is obtained, thereby improving the accuracy and completeness of determining the first corresponding relationship.
[0136] In some embodiments, optionally, according to the initial language model, determining the weight expression of the first training data includes: splitting the first training data into at least two n-order tuples, where n is a positive integer; based on the initial language model, determining a first n-order tuple and a second n-order tuple of the at least two n-order tuples, wherein the first n-order tuple is an n-order tuple whose probability logarithm is found in the initial language model; and using the first probability logarithm of the first n-order tuple as at least part of the weight expression.
[0137] In this embodiment, after the first training data is extracted, the first training data is split into multiple n-order tuples. The multiple n-order tuples are searched in sequence in the initial language model, and when the n-order tuple is found in the initial language model, the n-order tuple is determined as the first n-order tuple.
[0138] It should be noted that the order of the n-order tuple is n, and the value range of n is 1 to 5. After the first training data is split into multiple n-order tuples, after determining the first n-order tuple in at least two n-order tuples, the first probability logarithm corresponding to the first n-order tuple is obtained. Since the first n-order tuple is an n-order tuple whose probability logarithm can be found in the initial language model, the sum of the probability logarithms of multiple n-order tuples is taken as the probability logarithm of the training data.
[0139] In this embodiment, if the probability logarithm of the first n-th order tuple can be found in the initial language model, the found probability logarithm is directly used as the first probability logarithm, and the weight expression is determined according to the first probability logarithm.
[0140] In an embodiment of the present application, the first training data is split into multiple n-order tuples, and when the probability logarithm is found, the n-order tuple is used as the first n-order tuple, the first probability logarithm corresponding to the first n-order tuple is obtained, and the first probability logarithm is used as at least a part of the weight expression, thereby determining the first corresponding relationship between the first training data and the model weight, thereby ensuring the accuracy of the first corresponding relationship.
[0141] In some technical schemes, the speech recognition method also includes: determining a second n-order tuple among at least two n-order tuples based on an initial language model, wherein the second n-order tuple is an n-order tuple whose probability logarithm is not found in the initial language model; reducing the order of the second n-order tuple to obtain two sub-tuples; obtaining the second probability logarithms and first back-off weights corresponding to the two sub-tuples; and determining a weight expression based on the first probability logarithm, the second probability logarithm and the first back-off weight.
[0142] In this technical solution, after the first training data is extracted, the first training data is split into multiple n-order tuples. Multiple n-order tuples are searched in sequence in the initial language model. If the n-order tuple is found in the initial language model, the n-order tuple is determined as the first n-order tuple. If the n-order tuple is not found in the initial language model, the n-order tuple is determined as the second n-order tuple. When the second n-order tuple is determined, it is determined that the second n-order tuple does not exist in the initial language model. Since the lower the order, the greater the probability of existing in the initial language model, the second n-order tuple is further reduced in order to obtain two sub-tuples of the second n-order tuple. Among them, the second probability logarithm and the first back-off weight are the probability logarithm and back-off weight of the sub-tuple after the second n-order tuple that has not been found is reduced in order.
[0143] It should be noted that when a sub-tuple is a first-order tuple, the sub-tuple must exist in the initial language model.
[0144] For example, an n-order tuple is represented as That is, a sequence of n words w1, w2, ... wn, where The subscript 1 in the sequence indicates that the sequence starts from w1, and the superscript n indicates that it ends at wn. First, we check whether this n-order tuple exists in the initial language model. If it exists, we directly get its probability logarithm. If it does not exist, the order is reduced to obtain 2 (n-1) tuples, that is, as well as Take this n-order tuple The probability logarithm of is replaced by the sum of the corresponding probability logarithms of the two n-1 order tuples and the first backoff weight. The weight expression (1) of the n-1 order tuple is as follows:
[0145]
[0146] Among them, the LP() function represents the probability logarithm, and the B() function represents obtaining the first backoff weight. is an n-order tuple, is the reduced n-1 order tuple.
[0147] If (n-1) tuples If it still does not exist in the initial language model, continue to reduce the order and replace it with the probability logarithm and the first backoff weight sum of the lower order tuple. does not exist in the initial language model, its first fallback weight is treated as 0, that is: if does not exist,
[0148] For example, the sentence "fan hui ji zhan" consists of four syllables. First add the start symbol before and after. <s> and end character< / s> , get the complete sequence " <s> fan hui ji zhan< / s> ". The highest order of the initial language model is 4. The sentence is split into multiple n-order tuples, where the first one starts from 2 tuples, gradually increases to the highest order 4, and then maintains the highest order 4, including: <s>fan, <s>fan hui, <s> fan hui ji,fan hui ji zhan,hui ji zhan< / s> . Check whether these n-order tuples exist in the initial language model one by one. If they exist, obtain the corresponding probability logarithm calculation formula items by looking up the table. Assuming that the first two n-order tuples exist, their probability logarithm values LP ( <s>fan)、LP( <s>fan hui). Assume that the 4th order tuple is " <s>fan hui ji" does not exist, then it is reduced to <s>fanhui, and fan hui ji are two third-order tuples, and the first backoff weight of the former is taken, and the sum of the probability logarithms of the latter is taken as the fourth-order tuple" <s>The expression (2) for the probability logarithm of "fan hui ji" is as follows:
[0149] LP( <s>fan hui ji)=B( <s>fan hui) +LP( fan hui ji); (2)
[0150] Among them, the LP() function represents taking the logarithm of probability, and the B() function represents obtaining the first backoff weight.
[0151] If the third-order tuple" <s>fan hui” still does not exist, then let B( <s>fan hui)=0. If the third-order tuple "fan hui ji" does not exist, it is further reduced to two binary tuples: "fan hui", "hui ji". Similarly, the sum of the first backoff weight of the former and the probability logarithm of the latter is taken as the probability logarithm of "fan hui ji". The expression (3) is as follows:
[0152] LP(fan hui ji)=B(fan hui)+LP(hui ji); (3)
[0153] Among them, the LP() function represents the probability logarithm, and the B() function represents obtaining the first backoff weight.
[0154] Finally, the sum of the probability logarithms and backoff weights corresponding to all existing n-tuples is " <s> fan huiji zhan< / s> "The probability logarithm of ", thus obtaining the weight expression (4) for the training data "fan hui ji zhan", as follows:
[0155] Y=LP( <s>fan)+LP( <s>fan hui)+B( <s> fan hui)+B(fan hui)+LP(hui ji)+LP(fan hui ji zhan)+LP(hui ji zhan< / s> ); (4)
[0156] Among them, Y is the word sequence, LP() function represents the probability logarithm, and B() function represents obtaining the first backoff weight.
[0157] In the technical solution of the present application, by splitting the first training data into multiple n-order tuples, the n-order tuple whose probability logarithm is found in the initial language model is taken as the first n-order tuple, and the n-order tuple whose probability logarithm is not found in the initial language model is taken as the second n-order tuple, the second n-order tuple is reduced in order to obtain two sub-tuples, and the second probability logarithms and first back-off weights corresponding to the two sub-tuples are obtained. According to the first probability logarithm corresponding to the first n-order tuple, the second probability logarithm and the first back-off weight, the first corresponding relationship between the first training data and the model weight can be determined, thereby further ensuring the accuracy of the first corresponding relationship.
[0158] In some embodiments, optionally, according to the first correspondence, the model weights in the initial language model are updated according to multiple training data, including: obtaining a target weight range corresponding to each training data; determining, according to the first correspondence, the model weights corresponding to the training data corresponding to the first correspondence; determining, according to the model weights corresponding to the multiple training data, actual weight values of the multiple training data; and updating the model weights corresponding to each training data according to the target weight range and the actual weight value.
[0159] In this embodiment, after determining the first corresponding relationship between each training data and the model weight in the training data set, the target weight range corresponding to each training data is determined. It should be noted that the target weight range is the expected weight range, wherein the actual value range of the actual weight value of the sentence is negative infinity to 0, and the target weight range is the expected weight range in the actual value range. If all training data are within the target weight range, it means that the accuracy of the language model is high, and the wfst decoding effect is better using the language model.
[0160] Exemplarily, the target weight range for positive data is -3.05 to -2.95, and the target weight range for negative data is -28 to -8.
[0161] In this technical solution, according to the first corresponding relationship, the model weight of the training data corresponding to the first corresponding relationship can be determined, and according to the model weights corresponding to the multiple training data in the training data set, the actual weight values of the multiple training data can be determined.
[0162] In an embodiment of the present application, after determining the target weight range and the actual weight value, the model weight corresponding to the training data can be determined according to the first corresponding relationship, and the model weight corresponding to each training data can be updated according to the difference relationship between the target weight range and the actual weight value, thereby improving the recognition accuracy of the updated initial language model.
[0163] In some embodiments, optionally, the model weight corresponding to each training data is updated according to the target weight range and the actual weight value, including:
[0164] Determine the weight difference based on the target weight range and the actual weight value;
[0165] The model weights are updated according to the weight difference and the learning rate.
[0166] In this embodiment, after determining the target weight range and the actual weight value of the training data in the initial language model, the weight difference can be calculated, which can reflect the error of the probability logarithm and the first backoff weight in the initial language model. Therefore, the model weight corresponding to the training data can be updated according to the calculated weight difference and learning rate.
[0167] Exemplarily, the model weight is updated by the following relation (5):
[0168] weight_i=weight_i–delta×lr; (5)
[0169] Among them, weight_i on the left side of the equation is the updated model weight, weight_i on the right side of the equation is the model weight before the update, delta is the weight difference, lr is the learning rate, and the learning rate range is 0.005 to 0.02. Among them, i represents the i-th weight in the weight expression. When updating the weight, all weights in the weight expression need to be updated.
[0170] It should be noted that when updating the model weights, if the first fallback weight is blank, the first fallback weight is kept blank without updating.< / s> The trailing tuple, and the first fallback weight of the highest-order tuple are usually blank.
[0171] Exemplarily, in the process of updating the weights, each weight in the weight expression corresponding to the sentence needs to be updated one by one, including the probability logarithm and the first backoff weight.
[0172] In an embodiment of the present application, based on the weight difference between the target weight range and the actual weight value found in the initial language model, since the weight difference can reflect the error of the model weight in the initial language model, the model weight is updated by the weight difference and the learning rate, thereby further improving the recognition accuracy of the initial language model after the model weight is updated.
[0173] In some embodiments, optionally, when the actual weight value is greater than the maximum value of the target weight range, the difference between the actual weight value and the maximum value of the target weight range is determined as the weight difference;
[0174] When the actual weight value is less than the minimum value of the target weight range, the difference between the actual weight value and the minimum value of the target weight range is determined as the weight difference;
[0175] When the actual weight value is greater than or equal to the minimum value of the target weight range and less than or equal to the maximum value of the target weight range, the weight difference is determined to be 0.
[0176] In this embodiment, in the process of calculating the weight difference, it is necessary to select a corresponding calculation method according to the numerical relationship between the actual weight value and the boundary value in the target weight range.
[0177] When the actual weight value is greater than the maximum value of the target weight range, the weight difference is calculated by the following equation (6):
[0178] delta=XY max ; (6)
[0179] Among them, delta is the weight difference, X is the actual weight value, and Y is max is the maximum value of the target weight range.
[0180] When the actual weight value is less than the minimum value of the target weight range, the weight difference is calculated by the following equation (7):
[0181] delta=XY min ; (7)
[0182] Among them, delta is the weight difference, X is the actual weight value, and Y is min is the minimum value of the target weight range.
[0183] In an embodiment of the present application, a corresponding calculation method is determined by comparing the numerical relationship between the actual weight value and the target weight range, and the weight difference is calculated by a corresponding calculation method, thereby improving the processing efficiency while achieving the accuracy of the weight difference.
[0184] In some embodiments, optionally, after updating the model weights in the initial language model according to multiple training data based on the first corresponding relationship, the speech recognition method further includes: returning to execute the step of updating the model weights in the initial language model according to multiple training data based on the first corresponding relationship until the initial language model reaches the expected target, wherein the expected target is associated with the target weight range and / or weight difference.
[0185] In the embodiment of the present application, after the model weights in the initial language model are updated in sequence according to a plurality of training data, it is necessary to return to the step of updating the model weights in the initial language model according to the training data set, that is, to repeatedly iteratively update the updated initial language model until the expected goal of the initial language model is achieved. When the initial language model achieves the expected goal, it is determined that the model weights in the initial language model have been updated to the best, and at this time, it is not necessary to continue iteratively updating the model weights, and the updated initial language model has a higher accuracy rate and a lower misrecognition rate.
[0186] In some embodiments, optionally, the expected goal includes: the actual weight value of each training data is within the target weight range.
[0187] In this embodiment, during the iterative update of the model weights in the initial language model, it is continuously recorded whether the actual weight value of each training data found in the initial language model is within the target weight range. When the actual weight value corresponding to each training data is within the target weight range, it is determined that the initial language model has achieved the expected goal.
[0188] In this embodiment, during the iterative update of the model weights in the initial language model, the weight difference corresponding to each training data is continuously recorded, and after each update iteration of the model weights, the sum of the absolute values of the weight differences corresponding to the training data is calculated. When the sum of the absolute values of the weight differences is 0, it is determined that the actual weight value of each training data is within the target weight range.
[0189] It should be noted that, during multiple training processes, if the sum of the absolute values of the weight differences is greater than 0 and does not decrease any more, the training is determined to have failed, and the training needs to be terminated and the parameters need to be adjusted before continuing the training.
[0190] In the technical solution of the present application, in the process of repeatedly iteratively updating the model weights of the initial language model, it is determined whether the initial language model has achieved the expected goal, thereby ensuring the recognition accuracy of the target language model obtained by finally updating the weights.
[0191] In some embodiments, optionally, the training data includes positive example data and negative example data, and the target weight range includes a first weight range and a second weight range, the first weight range is a range of the positive example data, and the second weight range is a range of the negative example data;
[0192] Obtaining the target weight range corresponding to each training data includes: determining the first weight range according to the preset weight range and the first error value; determining the second weight range according to the preset weight range, the second error value and the preset range difference, wherein the second error value is greater than the first error value.
[0193] In this embodiment, the training data includes positive data and negative data, and the positive data and the negative data correspond to different target weight ranges, wherein the positive data corresponds to a first weight range and the negative data corresponds to a second weight range.
[0194] For example, the first weight range of the positive data is a higher value target_pos, plus or minus an error tolerance tol. If the error is too small, it is not easy to achieve the expected goal, and if it is too large, the effect is not good. Set target_pos = -3.0, tol = 0.05, that is, the target value range of the positive example is [target_pos-tol, target_pos+tol] = [-3.0-0.05, -3.0+0.05].
[0195] For example, the upper limit of the second weight range of negative data should be significantly larger than the first weight range of positive data, and the gap is gap. The tolerance tol2 between the lower limit and the upper limit is set larger, which makes it easier to achieve the expected goal. Set gap = 5.0, tol2 = 20.0. That is, the negative target value range [target_pos-gap-tol2, target_pos-gap] = [-3.0-5-20, -3.0-5].
[0196] In an embodiment of the present application, the training data set includes positive example data and negative example data. By setting corresponding first weight ranges and second weight ranges for the positive example data and the negative example data, respectively, not only can the recognition accuracy of the initial language model after updating the model weights be improved, but also the speed at which the updated model weights reach the expected goal can be improved.
[0197] In some embodiments, optionally, generating a training data set includes: determining at least two target command words as at least two positive example data in the training data set; randomly extracting words from a word list to form a word sequence, wherein the word list contains multiple words; if the word sequence is not in the at least two positive example data, using the word sequence as negative example data in the training data set.
[0198] In this embodiment, all target command words are used as positive data sets in the training data set, and each command word is used as a positive data set. The negative data in the negative data set is a data set obtained based on a word list. The words in the word list are split in the target command words, and the words are obtained after deduplication, and random syllables are extracted from the word list to form a word sequence of random length. When the randomly composed word sequence is not in the positive data set, the randomly composed word sequence is set as negative data.
[0199] In the embodiment of the present application, negative example data is generated by a word list related to the target command word, so that the negative example data is strongly correlated with the positive example data, thereby improving the accuracy of updating the initial language model weights through the training data set.
[0200] In some embodiments, optionally, the number of positive example data is X, and the number of negative example data is Y, where 10X≤Y≤1000X.
[0201] In the embodiment of the present application, by setting the number of negative data in the training data set to be greater than or equal to ten times the number of positive data, the number of negative data is sufficient, thereby improving the recognition accuracy of the initial language model after updating the model weight. By setting the number of negative data in the training data set to be less than or equal to one thousand times the number of positive data, the number of negative data is not too much, which makes it difficult to train to achieve the expected goal, that is, the expected goal is too high and difficult to achieve under the condition of a limited-scale language model.
[0202] In some embodiments, optionally, according to the first corresponding relationship, after updating the model weights in the initial language model according to multiple training data, it also includes: obtaining the corresponding third probability logarithm and second back-off weight in each model weight; when the numerical relationship between the third probability logarithm, the probability logarithm after the tuple corresponding to the third probability logarithm is upgraded, and the second back-off weight satisfies a preset inequality, the initial language model is determined as the target language model; when the numerical relationship between the third probability logarithm and the second back-off weight does not satisfy the preset inequality, updating the second back-off weight based on the correction coefficient.
[0203] In this embodiment, after the model weights in the initial language model are updated, the third probability logarithm and the second fallback weight in each model weight are obtained, the training data corresponding to the third probability logarithm and the second fallback weight are the same, and the third probability logarithm and the second fallback weight are both updated model weights. Specifically, the third probability logarithm and the second fallback function include each probability logarithm or fallback weight in the initial language model after the weight is updated.
[0204] In the case where the numerical relationship between the third probability logarithm, the probability logarithm of the tuple corresponding to the third probability logarithm after the order is raised, and the second fallback weight satisfies the preset inequality, it is determined that the model weights in the initial language model are appropriate, and there is no need to correct the initial language model after the weight is updated. In the case where the numerical relationship between the third probability logarithm, the probability logarithm of the tuple corresponding to the third probability logarithm after the order is raised, and the second fallback weight does not satisfy the preset inequality, it is determined that there are inappropriate model weights in the initial language model, and the second fallback weight needs to be corrected based on the correction coefficient.
[0205] Exemplarily, the inequality (8) is preset as follows:
[0206]
[0207] in, is the third probability logarithm, is the second backoff weight, is the probability logarithm of the tuple corresponding to the third probability logarithm after the order is raised.
[0208] Exemplarily, the second backoff weight is modified by the following relation (9):
[0209]
[0210] in, is the second backoff weight, is the probability logarithm of the tuple corresponding to the third probability logarithm after the order is raised, is the third probability logarithm, z is the correction coefficient, the correction coefficient ranges from 0.01 to 0.1, and can be specifically selected as 0.05.
[0211] In an embodiment of the present application, after the model weights in the initial language model are updated, it is necessary to detect whether each model weight in the initial language model is appropriate. By preset inequalities, it is possible to detect whether there are inappropriate model weights in the initial language model. When there are inappropriate model weights, the second fallback weights therein can be corrected based on the correction coefficient, thereby improving the accuracy of the final initial language model.
[0212] Figure 2 A schematic diagram of a speech recognition method provided in some embodiments of the present application is shown. Figure 2 As shown, based on the positive data, the initial language model is trained by statistics + smoothing + initialization weights. Negative data is randomly generated based on the positive data to obtain a training data set. The target weight range is determined according to the target weight. The actual weight values of the positive data and the negative data in the initial language model are obtained, and the weight difference between the actual weight value and the target weight range is obtained by comparison. After the weight difference is calculated, the model weight of the initial language model is updated according to the weight difference, and the inappropriate model weight is corrected.
[0213] Figure 3 FIG. 4 shows an iterative update schematic diagram of a speech recognition method provided in some embodiments of the present application, such as Figure 3 As shown in the figure, take a piece of training data from the training data set. Split the training data into multiple n-order tuples, search for the initial language model, and if a certain n-order tuple does not exist, reduce the order of the n-order tuple. Calculate the weight difference between the actual weight value and the target weight range. Adjust the model weight of the initial language model according to the weight difference, check whether the model weight meets the inequality requirements, and if not, correct it based on the correction coefficient, and repeat until the weight error of all training data is 0.
[0214] According to one embodiment of the present application, Figure 4 One of the structural block diagrams of a speech recognition device provided in some embodiments of the present application is shown. Figure 4 As shown, a speech recognition device 400 is proposed, and the speech recognition device 400 includes:
[0215] An acquisition module 402 is used to acquire an acoustic score matrix of the voice control instruction when a voice control instruction is received;
[0216] An acquisition module 402 is used to input the acoustic score matrix into a target language model to acquire at least one candidate syllable string matching the acoustic score matrix, wherein the target language model is a language model whose model weights are updated based on a command vocabulary, and the command vocabulary includes at least two preset command words;
[0217] A determination module 404, configured to determine an acoustic score and a language score corresponding to at least one candidate syllable string according to the target language model and the acoustic score matrix;
[0218] The recognition module 406 is configured to recognize a target command word from at least one candidate syllable string according to the acoustic score and the language score.
[0219] In the technical solution of the present application, after receiving the voice control instruction, the acoustic score matrix of the voice control instruction is obtained, and the acoustic score matrix is sent to the target language model to obtain at least one candidate syllable string matched by the acoustic score matrix. After obtaining at least one candidate syllable string, the acoustic score and language score of at least one candidate syllable string can be determined according to the target language model, and the acoustic score and language score are used as the basis for determining the target command word. The target command word can be identified in at least one candidate syllable string through the acoustic score and language score, so that the electrical device can perform corresponding actions based on the target command word, thereby improving the accuracy of voice control instruction recognition.
[0220] In some embodiments, optionally, the acquisition module 402 is used to acquire acoustic scores and language scores corresponding to the plurality of candidate syllable strings;
[0221] The speech recognition device 400 further includes:
[0222] A calculation module, used for performing weighted calculation on the acoustic score and language score corresponding to each candidate syllable string obtained, so as to obtain a candidate recognition score corresponding to the candidate syllable string;
[0223] The recognition module 406 is used to recognize the preset command word corresponding to the candidate syllable string corresponding to the candidate recognition score with the highest score as the target command word.
[0224] In this embodiment, when there are multiple candidate syllable strings, the acoustic scores and language scores corresponding to at least some of the candidate syllable strings are obtained. The candidate recognition score corresponding to each obtained candidate syllable string is calculated, wherein the candidate recognition score is a score obtained by weighted calculation of the acoustic score and language score corresponding to each candidate syllable string. After the candidate recognition scores corresponding to multiple candidate syllable strings are calculated, the preset command word corresponding to the candidate with the highest score is used as the target command word.
[0225] In an embodiment of the present application, the candidate recognition score corresponding to the candidate syllable string is calculated by weighting the acoustic score and language score corresponding to the candidate syllable string, and the preset command word corresponding to the highest candidate recognition score is used as the target command word, thereby further improving the accuracy of voice control command recognition.
[0226] In some embodiments, optionally, the speech recognition device 400 further includes:
[0227] A generating module, used for generating a training data set according to a command vocabulary, wherein the training data set includes a plurality of training data;
[0228] A determination module 404 is used to determine a first correspondence between a plurality of training data and a model weight in the initial language model when the initial language model is acquired;
[0229] An updating module is used to update the model weights in the initial language model according to the first corresponding relationship and the plurality of training data to obtain a target language model.
[0230] In an embodiment of the present application, after generating a training data set, the model weights that affect the training data are searched in the initial language model, thereby determining the first correspondence between each training data in the training data set and the model weights. The model weights in the initial language model are then updated according to the first correspondence and the training data. The weighted initial language model updated by the updating method has a higher accuracy and a lower misrecognition rate than the weighted initial language model obtained by using a statistical smoothing algorithm.
[0231] In some embodiments, optionally, the model weights include a probability logarithm and a first backoff weight;
[0232] The speech recognition device also includes:
[0233] An extraction module, used to extract first training data from a plurality of training data, where the first training data is data that has not been extracted;
[0234] A determination module 404 is used to determine a weight expression of the first training data according to the initial language model, wherein the weight expression is used to express the corresponding relationship between the first training data and the probability logarithm and the first backoff weight;
[0235] The execution module is used to return to the step of extracting the first training data from the multiple training data until the first training data does not exist in the multiple training data.
[0236] In an embodiment of the present application, by traversing each first training data in the training data set, the weight of the first training data is calculated according to the initial language model, and the probability logarithm and the first back-off weight that affect the recognition probability of the first training data in the initial language model are saved, that is, the first corresponding relationship between the first training data and the model weight is obtained, thereby improving the accuracy and completeness of the first corresponding relationship.
[0237] In some embodiments, optionally, the speech recognition device further includes:
[0238] A splitting module, used for splitting the first training data into at least two n-order tuples, where n is a positive integer;
[0239] A determination module 404 is configured to determine, based on the initial language model, a first n-th order tuple of at least two n-th order tuples, wherein the first n-th order tuple is an n-th order tuple for which a probability logarithm is found in the initial language model;
[0240] The determination module 404 is configured to use a first probability logarithm of the first n-th order tuple as at least a part of the weight expression.
[0241] In an embodiment of the present application, the first training data is split into multiple n-order tuples, and when the probability logarithm is found, the n-order tuple is used as the first n-order tuple, the first probability logarithm corresponding to the first n-order tuple is obtained, and the first probability logarithm is used as at least a part of the weight expression, thereby determining the first corresponding relationship between the first training data and the model weight, thereby ensuring the accuracy of the first corresponding relationship.
[0242] In some embodiments, the determination module 404 is configured to determine, based on the initial language model, a second n-th order tuple of the at least two n-th order tuples, wherein the second n-th order tuple is an n-th order tuple for which no probability logarithm is found in the initial language model;
[0243] An order reduction module, used for performing order reduction processing on the second n-th order tuple to obtain two sub-tuples;
[0244] An acquisition module 402 is used to acquire a second probability logarithm and a first backoff weight corresponding to two sub-tuples;
[0245] The determination module 404 is used to determine a weight expression according to the first probability logarithm, the second probability logarithm and the first back-off weight.
[0246] In an embodiment of the present application, by splitting the first training data into multiple n-order tuples, the n-order tuple whose probability logarithm is found in the initial language model is taken as the first n-order tuple, and the n-order tuple whose probability logarithm is not found in the initial language model is taken as the second n-order tuple, the second n-order tuple is reduced in order to obtain two sub-tuples, and the second probability logarithms and first back-off weights corresponding to the two sub-tuples are obtained. According to the first probability logarithm corresponding to the first n-order tuple, the second probability logarithm and the first back-off weight, the first corresponding relationship between the first training data and the model weight can be determined, thereby further ensuring the accuracy of the first corresponding relationship.
[0247] In some embodiments, optionally, the acquisition module 402 is used to acquire a target weight range corresponding to each training data;
[0248] A determination module 404 is used to determine, according to the first corresponding relationship, a model weight corresponding to the training data corresponding to the first corresponding relationship;
[0249] A determination module 404 is used to determine actual weight values of the plurality of training data according to the model weights corresponding to the plurality of training data;
[0250] The update module is used to update the model weight corresponding to each training data according to the target weight range and the actual weight value.
[0251] In an embodiment of the present application, after determining the target weight range and the actual weight value, the model weight corresponding to the training data can be determined according to the first corresponding relationship, and the model weight corresponding to each training data can be updated according to the difference relationship between the target weight range and the actual weight value, thereby improving the recognition accuracy of the updated initial language model.
[0252] In some embodiments, optionally, the determination module 404 is used to determine the weight difference according to the target weight range and the actual weight value;
[0253] The update module is used to update the model weights according to the weight difference and learning rate.
[0254] In an embodiment of the present application, based on the weight difference between the target weight range and the actual weight value found in the initial language model, since the weight difference can reflect the error of the model weight in the initial language model, the model weight is updated by the weight difference and the learning rate, thereby further improving the recognition accuracy of the initial language model after the model weight is updated.
[0255] In some embodiments, optionally, the determination module 404 is configured to determine the difference between the actual weight value and the maximum value of the target weight range as the weight difference value when the actual weight value is greater than the maximum value of the target weight range;
[0256] A determination module 404 is used to determine the difference between the actual weight value and the minimum value of the target weight range as a weight difference when the actual weight value is less than the minimum value of the target weight range;
[0257] The determination module 404 is configured to determine the weight difference as 0 when the actual weight value is greater than or equal to the minimum value of the target weight range and less than or equal to the maximum value of the target weight range.
[0258] In an embodiment of the present application, a corresponding calculation method is determined by comparing the numerical relationship between the actual weight value and the target weight range, and the weight difference is calculated by a corresponding calculation method, thereby improving the processing efficiency while achieving the accuracy of the weight difference.
[0259] In some embodiments, optionally, the execution module is also used to return to execute the step of updating the model weights in the initial language model according to the first correspondence and multiple training data until the initial language model reaches the expected target, wherein the expected target is associated with the target weight range and / or the weight difference.
[0260] In an embodiment of the present application, after the model weights in the initial language model are updated in sequence according to a plurality of training data, it is necessary to return to the step of updating the model weights in the initial language model according to the training data set, that is, to repeatedly iteratively update the updated initial language model until the expected goal of the initial language model is achieved. When the initial language model achieves the expected goal, it is determined that the model weights in the initial language model have been updated to the best, and at this time, it is not necessary to continue iteratively updating the model weights, and the updated initial language model has a higher accuracy rate and a lower misrecognition rate.
[0261] In some embodiments, optionally, the expected goal includes: the actual weight value of each training data is within the target weight range.
[0262] In the embodiment of the present application, in the process of repeatedly iteratively updating the model weights of the initial language model, it is determined whether the initial language model reaches the expected goal, thereby ensuring the recognition accuracy of the target language model obtained by the final updated weights.
[0263] In some embodiments, optionally, the training data includes positive example data and negative example data, and the target weight range includes a first weight range and a second weight range, the first weight range is a range of the positive example data, and the second weight range is a range of the negative example data;
[0264] The determination module 404 is used to determine the first weight range according to the preset weight range and the first error value; determine the second weight range according to the preset weight range, the second error value and the preset range difference, wherein the second error value is greater than the first error value.
[0265] In an embodiment of the present application, the training data set includes positive example data and negative example data. By setting the corresponding first weight range and second weight range for the positive example data and the negative example data, respectively, not only can the recognition accuracy of the initial language model after the model weight is updated be improved, but also the speed at which the updated model weight reaches the expected target can be improved.
[0266] In some embodiments, optionally, the determination module 404 is configured to determine at least two target command words as at least two positive example data in the training data set;
[0267] The speech recognition device further comprises:
[0268] An extraction module, used for randomly extracting words from a word list to form a word sequence, where the word list contains multiple words;
[0269] The determination module 404 is used to use the word sequence as negative example data in the training data set when the word sequence is not in at least two positive example data.
[0270] In the embodiment of the present application, negative example data is generated by a word list related to the target command word, so that the negative example data is strongly correlated with the positive example data, thereby improving the accuracy of updating the initial language model weights through the training data set.
[0271] In some embodiments, optionally, the number of positive example data is X, and the number of negative example data is Y, where 10X≤Y≤1000X.
[0272] In the embodiment of the present application, by setting the number of negative data in the training data set to be greater than or equal to ten times the number of positive data, the number of negative data is sufficient, thereby improving the recognition accuracy of the initial language model after updating the model weight. By setting the number of negative data in the training data set to be less than or equal to one thousand times the number of positive data, the number of negative data is not too much, which makes it difficult to train to achieve the expected goal, that is, the expected goal is too high and difficult to achieve under the condition of a limited-scale language model.
[0273] In some embodiments, optionally, the acquisition module 402 is used to acquire the corresponding third probability logarithm and the second backoff weight in each model weight;
[0274] A determination module 404 is configured to determine the initial language model as the target language model when a numerical relationship between the third probability logarithm, the probability logarithm of the tuple after the tuple corresponding to the third probability logarithm is raised, and the second backoff weight satisfies a preset inequality;
[0275] An updating module is used to update the second backoff weight based on a correction coefficient when the numerical relationship between the third probability logarithm and the second backoff weight does not satisfy a preset inequality.
[0276] In an embodiment of the present application, after the model weights in the initial language model are updated, it is necessary to detect whether each model weight in the initial language model is appropriate. By preset inequalities, it is possible to detect whether there are inappropriate model weights in the initial language model. When there are inappropriate model weights, the second fallback weights therein can be corrected based on the correction coefficient, thereby improving the accuracy of the final initial language model.
[0277] According to one embodiment of the present application, Figure 5 FIG. 2 shows a second structural block diagram of a speech recognition device provided in some embodiments of the present application. Figure 5 As shown, the speech recognition device 500 includes a processor 502 and a memory 504. The memory 504 stores a program or instruction. When the program or instruction is executed by the processor 502, the steps of the speech recognition method in any of the above embodiments are implemented. Therefore, the speech recognition device 500 has all the beneficial effects of the speech recognition method in any of the above embodiments, which will not be repeated here.
[0278] According to one embodiment of the present application, optionally, a readable storage medium is provided, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the speech recognition method in any of the above embodiments are implemented, thereby having all the beneficial technical effects of the speech recognition method in any of the above embodiments.
[0279] According to one embodiment of the present application, optionally, a computer program product is provided, which is stored in a storage medium and is executed by at least one processor to implement the steps of the speech recognition method in any of the above embodiments, thereby having all the beneficial technical effects of the speech recognition method in any of the above embodiments.
[0280] The readable storage medium includes a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0281] A computer readable storage medium may be a tangible device that can retain and store instructions for use by an instruction execution device. A computer readable storage medium may be an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the above devices, but is not limited thereto. A non-exhaustive list of more specific examples of computer readable storage media includes: portable computer floppy disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disk read-only memory (CD-ROM), digital versatile disk (DVD), memory card, floppy disk, encoding mechanical device (such as a punch card or a groove with a raised structure with instructions recorded) and any suitable combination of the above devices. The computer readable storage medium used herein should not be understood as a transmission signal itself, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium, or an electrical signal transmitted through a wire, etc.
[0282] According to one embodiment of the present application, optionally, a computer program product is proposed, which is stored in a storage medium, and the program product is executed by at least one processor to implement the steps of the speech recognition method in any of the above embodiments, thereby having all the beneficial technical effects of the speech recognition method in any of the above embodiments.
[0283] It should be clarified that in the claims, specification and drawings of the present application, the term "multiple" refers to two or more than two. Unless otherwise clearly defined, the orientation or position relationship indicated by the terms "upper" and "lower" is based on the orientation or position relationship shown in the drawings, which is only for the purpose of more conveniently describing the present application and making the description process easier, rather than indicating or implying that the device or element referred to must have the specific orientation described, be constructed and operated in a specific orientation, so these descriptions cannot be understood as limiting the present application; the terms "connect", "install", "fix" and the like should be understood in a broad sense. For example, "connection" can be a fixed connection between multiple objects, or a detachable connection between multiple objects, or an integral connection; it can be a direct connection between multiple objects, or an indirect connection between multiple objects through an intermediate medium. For ordinary technicians in this field, the specific meanings of the above terms in this application can be understood based on the specific circumstances of the above data.
[0284] In the claims, specification and drawings of the present application, the description of the terms "one embodiment", "some embodiments", "specific embodiments" and the like means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In the claims, specification and drawings of the present application, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0285] The above are only preferred embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.< / s> < / s> < / s> < / s> < / s> < / s> < / s> < / s> < / s> < / s> < / s> < / s>
Claims
1. A speech recognition method, characterized in that: The speech recognition method comprises: When receiving a voice control instruction, obtaining an acoustic score matrix of the voice control instruction; Inputting the acoustic score matrix into a target language model to obtain at least one candidate syllable string matching the acoustic score matrix, wherein the target language model is a language model that updates model weights based on a command vocabulary, and the command vocabulary includes at least two preset command words; Determining an acoustic score and a language score corresponding to the at least one candidate syllable string according to the target language model and the acoustic score matrix; A target command word is identified from the at least one candidate syllable string according to the acoustic score and the language score.
2. The speech recognition method according to claim 1, characterized in that: According to the acoustic score and the language score, identifying a target command word from the at least one candidate syllable string comprises: Obtaining acoustic scores and language scores corresponding to multiple candidate syllable strings respectively; Performing weighted calculation on the acoustic score and language score corresponding to each of the candidate syllable strings obtained to obtain a candidate recognition score corresponding to the candidate syllable string; The preset command word corresponding to the candidate syllable string corresponding to the candidate recognition score with the highest score is identified as the target command word.
3. The speech recognition method according to claim 1, characterized in that: In the case where the voice control instruction is received, before obtaining the acoustic score matrix of the voice control instruction, the voice recognition method further includes: Generate a training data set according to the command vocabulary, wherein the training data set includes a plurality of training data; When the initial language model is obtained, determining a first correspondence between a plurality of the training data and a model weight in the initial language model; According to the first corresponding relationship, the model weight in the initial language model is updated according to the plurality of training data to obtain the target language model.
4. The speech recognition method according to claim 3, characterized in that: The model weights include probability logarithms and first backoff weights; The determining of a first correspondence between the plurality of training data and the model weights in the initial language model comprises: Extracting first training data from the plurality of training data, where the first training data is data that has not been extracted; Determine a weight expression for the first training data according to the initial language model, wherein the weight expression is used to express a corresponding relationship between the first training data, the probability logarithm, and the first backoff weight; The step of extracting the first training data from the plurality of training data is performed again until the first training data does not exist in the plurality of training data.
5. The speech recognition method according to claim 4, characterized in that: The step of determining a weight expression of the first training data according to the initial language model includes: Splitting the first training data into at least two n-order tuples, where n is a positive integer; Based on the initial language model, determining a first n-order tuple of at least two n-order tuples, wherein the first n-order tuple is an n-order tuple for which the probability logarithm is found in the initial language model; A first probability logarithm of the first n-th order tuple is used as at least part of the weight expression.
6. The speech recognition method according to claim 5, characterized in that: The speech recognition method further comprises: Based on the initial language model, determining a second n-order tuple among the at least two n-order tuples, wherein the second n-order tuple is an n-order tuple for which no probability logarithm is found in the initial language model; Performing order reduction processing on the second n-th order tuple to obtain two sub-tuples; Obtaining a second probability logarithm and a first back-off weight corresponding to the two sub-tuples; A weight expression is determined according to the first probability logarithm, the second probability logarithm, and the first back-off weight.
7. The speech recognition method according to any one of claims 3 to 6, characterized in that: The updating of the model weight in the initial language model according to the first corresponding relationship and the plurality of training data includes: Obtaining a target weight range corresponding to each of the training data; and determining, according to the first corresponding relationship, the model weight corresponding to the training data corresponding to the first corresponding relationship; Determining actual weight values of the plurality of training data according to the model weights corresponding to the plurality of training data; The model weight corresponding to each training data is updated according to the target weight range and the actual weight value.
8. The speech recognition method according to claim 7, characterized in that: The updating of the model weight corresponding to each training data according to the target weight range and the actual weight value includes: Determining a weight difference according to the target weight range and the actual weight value; The model weight is updated according to the weight difference and the learning rate.
9. The speech recognition method according to claim 8, characterized in that: The determining the weight difference according to the target weight range and the actual weight value includes: In a case where the actual weight value is greater than the maximum value of the target weight range, determining the difference between the actual weight value and the maximum value of the target weight range as the weight difference; When the actual weight value is less than the minimum value of the target weight range, the difference between the actual weight value and the minimum value of the target weight range is determined as the weight difference; When the actual weight value is greater than or equal to the minimum value of the target weight range and less than or equal to the maximum value of the target weight range, the weight difference is determined to be 0.
10. The speech recognition method according to claim 8, characterized in that: After updating the model weight in the initial language model according to the first corresponding relationship and the plurality of training data, the speech recognition method further comprises: Return to the step of updating the model weights in the initial language model according to the first corresponding relationship and according to the plurality of training data until the initial language model reaches an expected target, wherein the expected target is associated with the target weight range and / or the weight difference.
11. The speech recognition method according to claim 10, characterized in that: The expected goals include: The actual weight value of each training data is within the target weight range.
12. The speech recognition method according to claim 7, characterized in that: The training data includes positive example data and negative example data, the target weight range includes a first weight range and a second weight range, the first weight range is the range of the positive example data, and the second weight range is the range of the negative example data; The obtaining of the target weight range corresponding to each of the training data includes: Determining the first weight range according to a preset target weight and a first error tolerance value; The second weight range is determined according to the preset target weight, a second error tolerance value and a preset range difference, wherein the second error tolerance value is greater than the first error tolerance value.
13. The speech recognition method according to claim 12, characterized in that: The step of generating a training data set according to the command vocabulary includes: Determine the command words in the command word library as at least two of the positive example data in the training data set; Randomly extract words from a word list to form a word sequence, wherein the word list includes a plurality of words; In the case that the word sequence is not in at least two of the positive example data, the word sequence is used as the negative example data in the training data set.
14. The speech recognition method according to claim 13, characterized in that: The number of the positive example data is X, and the number of the negative example data is Y, wherein 10X≤Y≤1000X.
15. The speech recognition method according to claim 4 or 5, characterized in that: After updating the model weight in the initial language model according to the first corresponding relationship and the plurality of training data, the speech recognition method further comprises: Obtaining a corresponding third probability logarithm and a second backoff weight in each of the model weights; In the case where a numerical relationship between the third probability logarithm, the probability logarithm of the tuple corresponding to the third probability logarithm after the order is raised, and the second backoff weight satisfies a preset inequality, determining the initial language model as the target language model; When the numerical relationship between the third probability logarithm, the probability logarithm of the tuple corresponding to the third probability logarithm after the order is raised, and the second backoff weight does not satisfy a preset inequality, the second backoff weight is updated based on a correction coefficient.
16. A speech recognition device, characterized in that: include: An acquisition module, configured to acquire an acoustic score matrix of a voice control instruction upon receiving the voice control instruction; The acquisition module is used to input the acoustic score matrix into a target language model to acquire at least one candidate syllable string matching the acoustic score matrix, wherein the target language model is a language model that updates model weights based on a command vocabulary, and the command vocabulary includes at least two preset command words; A determination module, configured to determine an acoustic score and a language score corresponding to the at least one candidate syllable string according to the target language model and the acoustic score matrix; A recognition module is used to recognize a target command word from the at least one candidate syllable string according to the acoustic score and the language score.
17. A speech recognition device, characterized in that: include: processor; A memory, wherein a program or instruction is stored in the memory, and the processor implements the steps of the speech recognition method according to any one of claims 1 to 15 when executing the program or instruction in the memory.
18. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by a processor, the steps of the speech recognition method according to any one of claims 1 to 15 are implemented.
19. A computer program product, the computer program product being stored in a storage medium, characterized in that: The computer program product is executed by at least one processor to implement the steps of the speech recognition method according to any one of claims 1 to 15.