Speech recognition error correction method, device and storage medium
By obtaining the Chinese character and pinyin sequences after speech recognition, and using the error correction model to extract feature vectors for error correction, the problem of speech recognition error accumulation is solved and the error correction accuracy is improved.
Patent Information
- Application Number
- CN202110163752.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-02-05
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2041-02-05
AI Technical Summary
Existing speech recognition technology is prone to errors when converting speech into text, and the cascade error correction method leads to error accumulation and the error correction accuracy is not high.
By obtaining the Chinese character sequence and pinyin sequence after automatic speech recognition, the pre-trained error correction model is used to extract feature vectors, error correction is performed based on the Chinese character and pinyin features, and the target text is output to avoid the accumulation of errors in the cascade error correction method.
It improves the accuracy of speech recognition error correction, corrects Chinese characters through pinyin constraints, and directly outputs the corrected target text, avoiding the problem of error accumulation.
Smart Images

Figure CN112735396B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to speech recognition technology, and in particular to a speech recognition error correction method, device and storage medium. Background Art
[0002] Automatic Speech Recognition (ASR) is a technology that converts human speech into text. With the development of terminal technology, the computing power and storage capacity of various intelligent terminals have greatly improved, making speech recognition technology widely used in intelligent terminals.
[0003] In speech recognition technology, it is necessary to accurately identify speech factors, and only based on the accurately identified speech factors can it be converted into text. However, no matter what language it is, there will be various factors that cause ASR to make mistakes in speech recognition.
[0004] Furthermore, how to convert speech into accurate text is a problem that needs to be solved urgently. Summary of the invention
[0005] In order to overcome the problems existing in the related art, the present disclosure provides a speech recognition error correction method, device and storage medium.
[0006] According to a first aspect of an embodiment of the present disclosure, a speech recognition error correction method is provided, the speech recognition error correction method comprising:
[0007] Obtaining a Chinese character sequence obtained after automatic speech recognition of the speech to be recognized;
[0008] Obtaining a pinyin sequence corresponding to the Chinese character sequence;
[0009] The Chinese character sequence and the Pinyin sequence are input into a pre-trained error correction model, feature vectors of the Chinese character sequence and the Pinyin sequence are extracted through the error correction model, and a target Chinese character sequence is output based on the feature vectors of the Chinese character sequence and the Pinyin sequence.
[0010] Optionally, obtaining a pinyin sequence corresponding to the Chinese character sequence includes:
[0011] Searching for the pinyins corresponding to the Chinese characters in the Chinese character sequence from a predetermined mapping table of Chinese characters to pinyins;
[0012] Based on the pinyins corresponding to the Chinese characters, the pinyin sequence is obtained.
[0013] Optionally, the mapping table of Chinese characters to pinyin includes a first Chinese character and a second Chinese character with similar pronunciation, and a first pinyin corresponding to the first Chinese character and a second pinyin corresponding to the second Chinese character, wherein the edit distance between the first pinyin and the second pinyin is less than a preset edit distance threshold, and the edit distance represents the minimum number of edits required to convert the first pinyin into the second pinyin.
[0014] Optionally, the error correction model includes a Chinese character encoding sub-model and a pinyin encoding sub-model;
[0015] The extracting the feature vectors of the Chinese character sequence and the pinyin sequence by using the error correction model includes:
[0016] The Chinese characters included in the Chinese character sequence are encoded by the Chinese character encoding sub-model to obtain the feature vector of each Chinese character, and
[0017] Encoding the pinyin included in the pinyin sequence by the pinyin encoding sub-model to obtain each pinyin feature vector;
[0018] Outputting a target Chinese character sequence according to the feature vectors of the Chinese character sequence and the pinyin sequence comprises:
[0019] Concatenating the Chinese character feature vectors and the pinyin feature vectors to obtain Chinese character concatenated vectors;
[0020] Predict each of the Chinese character concatenation vectors, and output a target Chinese character sequence including the target Chinese character.
[0021] Optionally, the error correction model is pre-trained in the following manner:
[0022] The error correction model is obtained by pre-training based on a Chinese character error correction sample set;
[0023] The Chinese character error correction sample set includes multiple pairs of training samples, each pair of training samples includes a misrecognized Chinese character sample and a correct Chinese character sample corresponding to the misrecognized Chinese character sample, and the misrecognized Chinese character sample includes a misrecognized Chinese character sequence and a pinyin sequence of the misrecognized Chinese character sequence.
[0024] Optionally, the error correction model is obtained by pre-training based on a Chinese character error correction sample set, including:
[0025] Encode each Chinese character in the misrecognized Chinese character sequence to obtain a misrecognized Chinese character feature vector sequence, and
[0026] Encoding each pinyin in the misrecognized pinyin sequence to obtain a misrecognized pinyin feature vector sequence;
[0027] splicing each Chinese character feature vector included in the misrecognized Chinese character feature vector sequence and each pinyin feature vector included in the misrecognized pinyin feature vector sequence to obtain a misrecognized spliced vector sequence;
[0028] Predicting each splicing vector in the sequence of misidentified splicing vectors to obtain each predicted Chinese character;
[0029] According to each of the predicted Chinese characters, determining a loss value of each of the predicted Chinese characters;
[0030] Determining the total loss value of the misrecognized Chinese character sequence according to the loss value of each Chinese character;
[0031] The model is trained according to the total loss value until the total loss value meets the training end condition, and the model at the end of training is determined as the error correction model.
[0032] According to a second aspect of an embodiment of the present disclosure, a speech recognition error correction device is provided, the speech recognition error correction device comprising:
[0033] An acquisition module, used to acquire a Chinese character sequence obtained after automatic speech recognition is performed on the speech to be recognized, and to acquire a pinyin sequence corresponding to the Chinese character sequence;
[0034] A processing module is used to input the Chinese character sequence and the pinyin sequence into a pre-trained error correction model, extract feature vectors of the Chinese character sequence and the pinyin sequence through the error correction model, and output a target Chinese character sequence based on the feature vectors of the Chinese character sequence and the pinyin sequence.
[0035] Optionally, the acquisition module acquires the pinyin sequence corresponding to the Chinese character sequence in the following manner:
[0036] Searching for the pinyins corresponding to the Chinese characters in the Chinese character sequence from a predetermined mapping table of Chinese characters to pinyins;
[0037] Based on the pinyins corresponding to the Chinese characters, the pinyin sequence is obtained.
[0038] Optionally, the mapping table of Chinese characters to pinyin includes a first Chinese character and a second Chinese character with similar pronunciation, and a first pinyin corresponding to the first Chinese character and a second pinyin corresponding to the second Chinese character, wherein the edit distance between the first pinyin and the second pinyin is less than a preset edit distance threshold, and the edit distance represents the minimum number of edits required to convert the first pinyin into the second pinyin.
[0039] Optionally, the error correction model includes a Chinese character encoding sub-model and a pinyin encoding sub-model;
[0040] The processing module extracts the feature vectors of the Chinese character sequence and the pinyin sequence through the error correction model in the following manner:
[0041] The Chinese characters included in the Chinese character sequence are encoded by the Chinese character encoding sub-model to obtain the feature vector of each Chinese character, and
[0042] Encoding the pinyin included in the pinyin sequence by the pinyin encoding sub-model to obtain each pinyin feature vector;
[0043] The processing module outputs a target Chinese character sequence according to the feature vectors of the Chinese character sequence and the pinyin sequence in the following manner, including:
[0044] Concatenating the Chinese character feature vectors and the pinyin feature vectors to obtain Chinese character concatenated vectors;
[0045] Predict each of the Chinese character concatenation vectors, and output a target Chinese character sequence including the target Chinese character.
[0046] Optionally, the processing module is further used to pre-train the error correction model in the following manner:
[0047] The error correction model is obtained by pre-training based on a Chinese character error correction sample set;
[0048] The Chinese character error correction sample set includes multiple pairs of training samples, each pair of training samples includes a misrecognized Chinese character sample and a correct Chinese character sample corresponding to the misrecognized Chinese character sample, and the misrecognized Chinese character sample includes a misrecognized Chinese character sequence and a pinyin sequence of the misrecognized Chinese character sequence.
[0049] Optionally, the processing module obtains the error correction model by pre-training based on a Chinese character error correction sample set:
[0050] Encode each Chinese character in the misrecognized Chinese character sequence to obtain a misrecognized Chinese character feature vector sequence, and
[0051] Encoding each pinyin in the misrecognized pinyin sequence to obtain a misrecognized pinyin feature vector sequence;
[0052] splicing each Chinese character feature vector included in the misrecognized Chinese character feature vector sequence and each pinyin feature vector included in the misrecognized pinyin feature vector sequence to obtain a misrecognized spliced vector sequence;
[0053] Predicting each splicing vector in the sequence of misidentified splicing vectors to obtain each predicted Chinese character;
[0054] According to each of the predicted Chinese characters, determining a loss value of each of the predicted Chinese characters;
[0055] Determining the total loss value of the misrecognized Chinese character sequence according to the loss value of each Chinese character;
[0056] The model is trained according to the total loss value until the total loss value meets the training end condition, and the model at the end of training is determined as the error correction model.
[0057] According to a third aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, on which computer program instructions are stored. When the program instructions are executed by a processor, the steps of the speech recognition error correction method provided in the first aspect of the present disclosure are implemented.
[0058] The technical solution provided by the embodiments of the present disclosure may include the following beneficial effects: performing pinyin conversion on the text obtained after automatic speech recognition to obtain the pinyin corresponding to the text, inputting the text and the pinyin into the error correction model, and the error correction model outputs the target text obtained after the error correction by the error correction model based on the characteristics of the text and the characteristics of the pinyin. In the present disclosure, the error correction model obtains the pinyin characteristics of the text, and when correcting the text, it can effectively constrain the Chinese characters in the text according to the pinyin of the text, thereby improving the accuracy of error correction. And in the present disclosure, the target text after the text is corrected can be directly output through the error correction model, avoiding the problem of error accumulation caused by the cascade error correction method adopted by the first model and the second model, and causing the second model to output an erroneous error correction result due to the recognition error of the first model.
[0059] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0061] Figure 1 The figure is a flow chart of a speech recognition error correction method according to an exemplary embodiment.
[0062] Figure 2 The figure is a flow chart of a speech recognition error correction method according to an exemplary embodiment.
[0063] Figure 3 The figure is a flow chart of a speech recognition error correction method according to an exemplary embodiment.
[0064] Figure 4 The figure is a flowchart of a training error correction model according to an exemplary embodiment.
[0065] Figure 5 The figure is a block diagram of a speech recognition error correction device according to an exemplary embodiment.
[0066] Figure 6 It is a block diagram of a device according to an exemplary embodiment. DETAILED DESCRIPTION
[0067] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0068] In the related art, after the user's voice is generated into text through ASR recognition technology, the generated text is checked and possible errors are corrected based on natural language understanding technology (NLU).
[0069] When checking the generated text based on NLU and correcting possible errors, one way is to input the generated text into the trained error correction model, obtain the features of the Chinese characters in the text, check whether there are misrecognized Chinese characters in the text, and output the predicted correct text. Since the model in this method mainly uses the features of Chinese characters for error correction, and does not use the pinyin of Chinese characters to constrain Chinese characters, the error correction accuracy is not high. For example, the misrecognized text is "help me sing a train ticket to Beijing", in which the character "sing" is misrecognized, and the correct original text should be "grab". If the pronunciation of Chinese characters is ignored, "sing" may be corrected to "buy" or "order".
[0070] Another way is to input the generated text into the first model, detect and output the misidentified positions in the text through the first model, use the output of the first model as the input of the second model, and correct the misidentified positions through the second model. Since this method is to correct the text, if the first model fails to find the correct error position, then based on the result output by the first model, the second model will correct the error, which will cause the problem of error accumulation.
[0071] Therefore, the present disclosure provides a method for correcting speech recognition errors. In the speech recognition error correction method of the present disclosure, the text obtained after automatic speech recognition is subjected to pinyin conversion to obtain the pinyin corresponding to the text. The text and the pinyin corresponding to the text are input into an error correction model. Based on the features of the text and the features of the pinyin, the error correction model outputs the target text obtained after error correction by the error correction model. In the present disclosure, when the error correction model corrects the text by obtaining the pinyin features of the text, the Chinese characters in the text can be effectively constrained according to the pinyin of the text, improving the accuracy of error correction. And in the present disclosure, the error correction model can directly output the target text after correcting the text, avoiding the problem of error accumulation caused by the incorrect error correction result output by the second model due to the recognition error of the first model when using the cascade error correction method through the first model and the second model.
[0072] Figure 1 is a flowchart of a speech recognition error correction method shown according to an exemplary embodiment, as Figure 1 shown, the speech recognition error correction method includes the following steps.
[0073] In step S11, a Chinese character sequence obtained after performing automatic speech recognition on the speech to be recognized is acquired.
[0074] In the present disclosure, the speech to be recognized may be the user speech collected by the terminal in a speech interaction scenario.
[0075] In one implementation, various techniques may be used to perform automatic speech recognition on the text to be recognized. For example, it may include ASR recognition, etc. Among them, the ASR recognition technology is a technology for recognizing user audio as text in an automatic speech interaction. The process of automatic speech recognition using the ASR recognition technology is: speech acquisition, speech feature annotation, training a model based on deep learning algorithms (RNN, CNN), deploying the model and performing real-time recognition through the model, and converting speech into text.
[0076] In step S12, a pinyin sequence corresponding to the Chinese character sequence is acquired.
[0077] In the present disclosure, the pinyin corresponding to each Chinese character included in the Chinese character sequence can be found from a pre-established mapping table from Chinese characters to pinyin, and based on the pinyin corresponding to each Chinese character, the pinyin sequence of the Chinese character sequence is obtained.
[0078] In order to obtain the pinyin corresponding to the text, in one implementation, the present disclosure may pre-establish a mapping table from Chinese characters to standard pinyin according to the standard pinyin of Chinese characters. For example, a mapping relationship is established between the Chinese character "月" and the pinyin "yue", a mapping relationship is established between the Chinese character "外" and the pinyin "wai", and so on. Thus, a mapping table from Chinese characters to pinyin is obtained.
[0079] In the present disclosure, by acquiring a speech to be recognized, automatic speech recognition is performed on the speech to be recognized to obtain text, that is, after obtaining a Chinese character sequence, the pinyin corresponding to each Chinese character in the Chinese character sequence is searched according to a pre-established mapping table of Chinese characters to pinyin, and based on the pinyin corresponding to each Chinese character, a pinyin sequence of the Chinese character sequence is obtained.
[0080] In step S13, the Chinese character sequence and the Pinyin sequence are input into a pre-trained error correction model, feature vectors of the Chinese character sequence and the Pinyin sequence are extracted through the error correction model, and a target Chinese character sequence is output based on the feature vectors of the Chinese character sequence and the Pinyin sequence.
[0081] In an exemplary embodiment of the present disclosure, the text obtained after automatic speech recognition is converted into pinyin to obtain the pinyin corresponding to the text, and the text and the pinyin are input into an error correction model, which outputs a target text based on the characteristics of the text and the characteristics of the pinyin. In the present disclosure, the error correction model obtains the pinyin characteristics of the text, and when correcting the text, it can effectively constrain the Chinese characters in the text according to the pinyin of the text, thereby improving the accuracy of error correction. In addition, in the present disclosure, the target text after the text is corrected can be directly output through the error correction model, avoiding the problem of error accumulation caused by the second model outputting an erroneous error correction result due to the recognition error of the first model.
[0082] Figure 2 is a flow chart of a speech recognition error correction method according to an exemplary embodiment. Figure 2 As shown, the speech recognition error correction method includes the following steps.
[0083] In step S21, a mapping table from Chinese characters to pinyin is determined.
[0084] In step S22, a Chinese character sequence obtained after automatic speech recognition is performed on the speech to be recognized is obtained.
[0085] In step S23, the pinyins corresponding to the Chinese characters included in the Chinese character sequence are searched from a predetermined mapping table of Chinese characters to pinyins, and a pinyin sequence is obtained based on the pinyins corresponding to the Chinese characters.
[0086] In step S24, the Chinese character sequence and the Pinyin sequence are input into a pre-trained error correction model, feature vectors of the Chinese character sequence and the Pinyin sequence are extracted through the error correction model, and the target Chinese character sequence is output based on the feature vectors of the Chinese character sequence and the Pinyin sequence.
[0087] Usually, when the edit distance between pinyins is small, it indicates that the pronunciations of the pinyins are very similar, such as the pinyins "hao", "lao", "pao", or the pinyins "huang", "guang", "kuang", etc.
[0088] However, in current Chinese pinyin, there are still some Chinese characters with similar pronunciations but dissimilar pinyin, and the edit distance between the pinyin is relatively large. For example, the pinyin "yao" and "xiao" are similar in pronunciation, but their pinyins are dissimilar. When converting one pinyin to the other, an edit distance of 2 is required, and the edit distance is relatively large.
[0089] For such cases, in order to make the spelling of Chinese pinyin better reflect the pronunciation of Chinese characters, that is, to meet the characteristics that Chinese characters with similar pronunciations also have similar pinyins, and to ensure that the error correction model can quickly and accurately identify misidentifications in the Chinese character sequence, the present disclosure can reconstruct the pinyin that meets the rules according to the preset rules, so that the edit distance between the pinyins with similar pronunciations after construction is less than the preset edit distance threshold, where the edit distance represents the minimum number of edits required to convert one pinyin to another, that is, the minimum number of operations.
[0090] In one implementation, the present disclosure can determine the mapping relationship from Chinese characters to pinyins, and obtain the mapping table from Chinese characters to pinyins, for example, through the following rules:
[0091] Rule 1: For the first pinyin without an initial consonant, reconstruct the spelling of the first pinyin according to the way of adding an initial consonant and a final consonant to obtain the reconstructed first pinyin.
[0092] In one implementation, for the pinyin without an initial consonant in the pinyin, a separate character that can be distinguished from the 26 English letters can be used to represent "without an initial consonant". For the convenience of expression and without loss of generality, for example, the character representing "without an initial consonant" can be denoted as "#". For example, the standard pinyin of the Chinese character "安" is "an". After reconstructing the pinyin of "安", the new pinyin corresponding to "安" is denoted as "#an". The standard pinyin of the Chinese character "挖" is "wa". After reconstructing the pinyin of "挖", the new pinyin corresponding to "挖" is "#ua". The standard pinyin of the Chinese character "一" is "yi", and the new pinyin corresponding to "一" is denoted as "#i". The standard pinyin of the Chinese character "要" is "yao". After reconstructing the pronunciation of "要", the new pinyin corresponding to "要" is "#iao".
[0093] Rule 2: For the second pinyin with inconsistent spelling and pronunciation, reconstruct the spelling of the second pinyin according to the preset final consonant to obtain the reconstructed second pinyin.
[0094] In one implementation, for example, for the "ü" in standard pinyin, when there is no initial consonant or the initial consonants are j, q, or x, it is recorded as "u". For example, the standard pinyin of the Chinese character "雨" is "yu" instead of "yü", and the standard pinyin of the Chinese character "女" is "nü" instead of "nu". Thus, to facilitate the error correction model's recognition of pinyin features, a uniquely determined symbol is used to represent this pronunciation. Without loss of generality, for example, "u" and "ü" are replaced with the symbol "v".
[0095] Rule three: For the third pinyin of a preset pronunciation, reconstruct the spelling of the third pinyin to obtain the reconstructed third pinyin.
[0096] For example, for the compound vowels "iu", "ui", and "un" in standard pinyin, they can be recorded as "iou", "uei", and "uen" respectively.
[0097] For the vowel "i" in the standard pinyin ri, zi, ci, si, zhi, chi, shi, to distinguish it from the "i" in other pinyins, for example, the "i" above can be recorded as "!".
[0098] After the above rules, the Chinese characters corresponding to the pronunciations of the first pinyin, the second pinyin, and the third pinyin are respectively associated with the reconstructed first pinyin, the reconstructed second pinyin, and the reconstructed third pinyin to obtain a mapping table from Chinese characters to pinyins. Among them, for the pinyins with similar pronunciations in the mapping table from Chinese characters to pinyins, the edit distance between the pinyins is less than a preset edit distance threshold.
[0099] For example, in the example of the pinyins "yao" and "xiao", for example, the preset edit distance threshold is 2. By reconstructing the "y" in the standard pinyin "yao" and recording it as "#i", a new pinyin, namely "#iao", is obtained. The edit distance between "#iao" and "xiao" is 1, satisfying that when the pronunciations of the pinyins are very similar, the edit distance between the pinyins is less than the preset edit distance threshold.
[0100] Table 1 is a partial mapping example table of Chinese characters to pinyins applying the pinyin rules of the present disclosure according to the above rules. As shown in Table 1, the mapping relationships between the following Chinese characters and the standard pinyins, and the mapping relationships between the following Chinese characters and the pinyins applying the pinyin rules of the present disclosure.
[0101]
[0102]
[0103]
[0104] Table 1
[0105] In an exemplary embodiment of the present disclosure, a mapping table of Chinese characters to pinyin is obtained by reconstructing the standard pinyin, so that the pinyins with similar pronunciations in the mapping table of Chinese characters to pinyin satisfy the edit distance between the pinyins less than a preset edit distance threshold. Through the present disclosure, the spelling of Chinese pinyin in the mapping table of Chinese characters to pinyin can better reflect the pronunciation of Chinese characters, and improve the accuracy of the error correction model in identifying misrecognition in Chinese character sequences.
[0106] Figure 3 is a flow chart of a speech recognition error correction method according to an exemplary embodiment. Figure 3 As shown, the speech recognition error correction method includes the following steps.
[0107] In step S31, a Chinese character sequence obtained after automatic speech recognition is performed on the speech to be recognized is obtained.
[0108] In step S32, the pinyin corresponding to each Chinese character included in the Chinese character sequence is searched from a predetermined mapping table of Chinese characters to pinyins, and the pinyin sequence of the Chinese character sequence is obtained based on the pinyin corresponding to each Chinese character.
[0109] In step S33, the Chinese characters included in the Chinese character sequence are encoded by the Chinese character encoding sub-model to obtain a Chinese character feature vector sequence of the Chinese character sequence, and the pinyin included in the pinyin sequence is encoded by the pinyin encoding sub-model to obtain a pinyin feature vector sequence of the pinyin sequence.
[0110] In the present disclosure, the error correction model may include a Chinese character encoding sub-model and a pinyin encoding sub-model. The Chinese character encoding sub-model and the pinyin encoding sub-model may be, for example, based on a long short-term memory network (LSTM), or a translation (Transformer) model, an embedded language model (ELMO) model, or a bidirectional encoder representation from transformers (BERT) model.
[0111] According to the Chinese character sequence of the input error correction model, the Chinese character encoding sub-model encodes each Chinese character included in the Chinese character sequence to obtain a Chinese character feature vector sequence. Similarly, according to the pinyin sequence of the input error correction model, the pinyin encoding sub-model encodes each pinyin included in the pinyin sequence to obtain a pinyin feature vector sequence.
[0112] In step S34, each Chinese character feature vector included in the Chinese character feature vector sequence and each pinyin feature vector included in the pinyin feature vector sequence are concatenated to obtain a concatenated vector sequence including each Chinese character concatenated vector.
[0113] In the present disclosure, after obtaining the feature vector and pinyin vector of each Chinese character, the Chinese character vector and the pinyin vector are concatenated for each Chinese character to obtain the concatenated vector of the corresponding Chinese character.
[0114] For example, the length of the Chinese character sequence input into the Chinese character encoding sub-model is 20, and the dimension of the Chinese character vector is 512, then the Chinese character vector sequence output by the Chinese character encoding sub-model can be a matrix with a size of (512, 20). Similarly, the Pinyin sequence of the above Chinese character sequence is input into the Pinyin encoding sub-model, the length of the Pinyin sequence is also 20, and the dimension of the Pinyin vector is 256, then the Pinyin vector sequence output by the Pinyin encoding sub-model can be a matrix with a size of (256, 20). The Chinese character feature vectors contained in the Chinese character feature vector sequence and the Pinyin feature vectors contained in the Pinyin feature vector sequence are spliced to obtain a spliced vector sequence including the spliced vectors of each Chinese character, that is, the matrix size of the spliced vector sequence is (768, 20).
[0115] In step S35, each Chinese character splicing vector in the splicing vector sequence is predicted, and a target Chinese character sequence is output.
[0116] In an exemplary embodiment of the present disclosure, the text obtained after automatic speech recognition is converted into pinyin to obtain the pinyin corresponding to the text, and the text and the pinyin are input into an error correction model. The error correction model outputs the target text obtained after the error correction by the error correction model based on the characteristics of the text and the characteristics of the pinyin. In the present disclosure, the error correction model obtains the pinyin characteristics of the text, and when correcting the text, it can effectively constrain the Chinese characters in the text according to the pinyin of the text, thereby improving the accuracy of error correction. And in the present disclosure, the target text after the text is corrected can be directly output through the error correction model, avoiding the cascade error correction method through the first model and the second model, and the error correction result output by the second model due to the recognition error of the first model, resulting in the problem of error accumulation.
[0117] In the present disclosure, before using the error correction model to identify whether there is a recognition error in each Chinese character in the Chinese character sequence, it also includes training the error correction model.
[0118] Figure 4 is a flowchart of a training error correction model according to an exemplary embodiment. Figure 4 As shown, the following steps are included.
[0119] In step S41, a Chinese character error correction sample set is obtained.
[0120] In order to enable the trained error correction model to accurately identify whether there are Chinese characters with recognition errors in the Chinese character sequence, in one embodiment, the present disclosure can train the error correction model based on the Chinese character error correction sample set to obtain a trained error correction model. For example, 70% of the data in the Chinese character error correction sample set can be used as a training data set to train the error correction model, and 30% of the data in the Chinese character error correction sample set can be used as a test data set to verify the error correction model.
[0121] The Chinese character error correction sample set includes multiple pairs of training samples, each pair of training samples includes a misrecognized Chinese character sample and a correct Chinese character sample corresponding to the misrecognized Chinese character sample, and the misrecognized Chinese character sample includes a misrecognized Chinese character sequence and a pinyin sequence of the misrecognized Chinese character sequence.
[0122] In step S42, the error correction model is trained and optimized.
[0123] In one implementation, a Chinese character error correction sample set is input into a model, and each Chinese character in a misrecognized Chinese character sequence is encoded by a Chinese character encoding sub-model included in the model to obtain a misrecognized Chinese character feature vector sequence, and each pinyin in a misrecognized pinyin sequence is encoded by a pinyin encoding sub-model included in the model to obtain a misrecognized pinyin feature vector sequence. Each Chinese character feature vector included in the misrecognized Chinese character feature vector sequence and each pinyin feature vector included in the misrecognized pinyin feature vector sequence are spliced to obtain a misrecognized spliced vector sequence.
[0124] The loss value between each predicted Chinese character and the corresponding actual Chinese character, that is, the error between the predicted Chinese character and the actual Chinese character, is calculated through a loss function such as the cross entropy function. The loss value of each Chinese character is summed up to obtain the total loss value of the predicted Chinese character sequence.
[0125] According to the total loss value, the model is trained until the total loss value is lower than the preset threshold, and the trained error correction model is obtained.
[0126] After obtaining the trained error correction model, the test data set is input into the error correction model for verification. After all the verification data sets pass the verification, the verified error correction model is used in practical applications.
[0127] In step S43, the test data set is input into the trained error correction model for verification to obtain a verified error correction model.
[0128] In an exemplary embodiment of the present disclosure, by obtaining a Chinese character error correction sample set including misrecognized Chinese character samples and correct Chinese character samples corresponding to the misrecognized Chinese character samples, and the misrecognized Chinese character samples include misrecognized Chinese character sequences and pinyin sequences of misrecognized Chinese character sequences, an error correction model capable of recognizing Chinese character features and pinyin features can be trained, so that when the error correction model corrects text errors, it can effectively constrain the Chinese characters in the text according to the pinyin of the text, thereby improving the accuracy of error correction. In addition, in the present disclosure, the target text after the text error correction can be directly output through the error correction model, avoiding the problem of error accumulation caused by the second model outputting an incorrect error correction result due to the recognition error of the first model, by adopting a cascaded error correction method through the first model and the second model.
[0129] Figure 5 FIG. 5 is a block diagram of a speech recognition error correction device according to an exemplary embodiment. Figure 5 The device includes an acquisition module 501 and a processing module 502.
[0130] The acquisition module 501 is used to acquire a Chinese character sequence obtained after automatic speech recognition is performed on the speech to be recognized, and acquire a pinyin sequence corresponding to the Chinese character sequence;
[0131] Processing module 502 is used to input the Chinese character sequence and the pinyin sequence into a pre-trained error correction model, extract feature vectors of the Chinese character sequence and the pinyin sequence through the error correction model, and output a target Chinese character sequence based on the feature vectors of the Chinese character sequence and the pinyin sequence.
[0132] Optionally, the acquisition module 501 acquires the pinyin sequence corresponding to the Chinese character sequence in the following manner:
[0133] Searching for the pinyins corresponding to the Chinese characters in the Chinese character sequence from a predetermined mapping table of Chinese characters to pinyins;
[0134] Based on the pinyins corresponding to the Chinese characters, the pinyin sequence is obtained.
[0135] Optionally, the Chinese character to pinyin mapping table includes a first Chinese character and a second Chinese character with similar pronunciation, and a first pinyin corresponding to the first Chinese character and a second pinyin corresponding to the second Chinese character, wherein the edit distance between the first pinyin and the second pinyin is less than a preset edit distance threshold.
[0136] Optionally, the error correction model includes a Chinese character encoding sub-model and a pinyin encoding sub-model;
[0137] The processing module 502 extracts the feature vectors of the Chinese character sequence and the pinyin sequence through the error correction model in the following manner:
[0138] The Chinese characters included in the Chinese character sequence are encoded by the Chinese character encoding sub-model to obtain the feature vector of each Chinese character, and
[0139] Encoding the pinyin included in the pinyin sequence by the pinyin encoding sub-model to obtain each pinyin feature vector;
[0140] The processing module 502 outputs a target Chinese character sequence according to the feature vectors of the Chinese character sequence and the pinyin sequence in the following manner, including:
[0141] Concatenating the Chinese character feature vectors and the pinyin feature vectors to obtain Chinese character concatenated vectors;
[0142] Predict each of the Chinese character concatenation vectors, and output a target Chinese character sequence including the target Chinese character.
[0143] Optionally, the processing module 502 is further used to pre-train the error correction model in the following manner:
[0144] The error correction model is obtained by pre-training based on a Chinese character error correction sample set;
[0145] The Chinese character error correction sample set includes multiple pairs of training samples, each pair of training samples includes a misrecognized Chinese character sample and a correct Chinese character sample corresponding to the misrecognized Chinese character sample, and the misrecognized Chinese character sample includes a misrecognized Chinese character sequence and a pinyin sequence of the misrecognized Chinese character sequence.
[0146] Optionally, the processing module 502 obtains the error correction model by pre-training based on a Chinese character error correction sample set:
[0147] Encode each Chinese character in the misrecognized Chinese character sequence to obtain a misrecognized Chinese character feature vector sequence, and
[0148] Encoding each pinyin in the misrecognized pinyin sequence to obtain a misrecognized pinyin feature vector sequence;
[0149] splicing each Chinese character feature vector included in the misrecognized Chinese character feature vector sequence and each pinyin feature vector included in the misrecognized pinyin feature vector sequence to obtain a misrecognized spliced vector sequence;
[0150] Predicting each splicing vector in the sequence of misidentified splicing vectors to obtain each predicted Chinese character;
[0151] According to each of the predicted Chinese characters, determining a loss value of each of the predicted Chinese characters;
[0152] Determining the total loss value of the misrecognized Chinese character sequence according to the loss value of each Chinese character;
[0153] The model is trained according to the total loss value until the total loss value meets the training end condition, and the model at the end of training is determined as the error correction model.
[0154] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0155] The present disclosure also provides a computer-readable storage medium having computer program instructions stored thereon, which, when executed by a processor, implement the steps of the speech recognition error correction method provided by the present disclosure.
[0156] Figure 6 6 is a block diagram of a device 600 for speech recognition error correction according to an exemplary embodiment. For example, the device 600 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0157] Reference Figure 6 , the device 600 may include one or more of the following components: a processing component 602 , a memory 604 , a power component 606 , a multimedia component 608 , an audio component 610 , an input / output (I / O) interface 612 , a sensor component 614 , and a communication component 616 .
[0158] The processing component 602 generally controls the overall operation of the device 600, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 602 may include one or more processors 620 to execute instructions to complete all or part of the steps of the above-mentioned speech recognition error correction method. In addition, the processing component 602 may include one or more modules to facilitate the interaction between the processing component 602 and other components. For example, the processing component 602 may include a multimedia module to facilitate the interaction between the multimedia component 608 and the processing component 602.
[0159] The memory 604 is configured to store various types of data to support operations on the device 600. Examples of such data include instructions for any application or method operating on the device 600, contact data, phone book data, messages, pictures, videos, etc. The memory 604 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0160] The power component 606 provides power to the various components of the device 600. The power component 606 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 600.
[0161] The multimedia component 608 includes a screen that provides an output interface between the device 600 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 608 includes a front camera and / or a rear camera. When the device 600 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0162] The audio component 610 is configured to output and / or input audio signals. For example, the audio component 610 includes a microphone (MIC), and when the device 600 is in an operating mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 604 or sent via the communication component 616. In some embodiments, the audio component 610 also includes a speaker for outputting audio signals.
[0163] I / O interface 612 provides an interface between processing component 602 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.
[0164] The sensor assembly 614 includes one or more sensors for providing various aspects of status assessment for the device 600. For example, the sensor assembly 614 can detect the open / closed state of the device 600, the relative positioning of components, such as the display and keypad of the device 600, the sensor assembly 614 can also detect the position change of the device 600 or a component of the device 600, the presence or absence of user contact with the device 600, the orientation or acceleration / deceleration of the device 600 and the temperature change of the device 600. The sensor assembly 614 can include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 614 can also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 614 can also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor or a temperature sensor.
[0165] The communication component 616 is configured to facilitate wired or wireless communication between the device 600 and other devices. The device 600 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 616 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 616 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0166] In an exemplary embodiment, the device 600 can be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to perform the above-mentioned speech recognition error correction method.
[0167] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 604 including instructions, and the instructions can be executed by a processor 620 of the device 600 to complete the above-mentioned speech recognition error correction method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0168] In another exemplary embodiment, a computer program product is also provided. The computer program product includes a computer program that can be executed by a programmable device. The computer program has a code portion for executing the above-mentioned speech recognition error correction method when executed by the programmable device.
[0169] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the present disclosure. This application is intended to cover any variations, uses or adaptations of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The specification and examples are to be considered as exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0170] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A speech recognition error correction method, characterized in that: include: Obtaining a Chinese character sequence obtained after automatic speech recognition of the speech to be recognized; Obtaining a pinyin sequence corresponding to the Chinese character sequence; Inputting the Chinese character sequence and the Pinyin sequence into a pre-trained error correction model, extracting feature vectors of the Chinese character sequence and the Pinyin sequence through the error correction model, and outputting a target Chinese character sequence according to the feature vectors of the Chinese character sequence and the Pinyin sequence; Wherein, obtaining the pinyin sequence corresponding to the Chinese character sequence includes: Searching for pinyins corresponding to the Chinese characters in the Chinese character sequence from a predetermined Chinese character to pinyin mapping table, wherein the Chinese character to pinyin mapping table includes a first Chinese character and a second Chinese character with similar pronunciations, and a first pinyin corresponding to the first Chinese character and a second pinyin corresponding to the second Chinese character, wherein an edit distance between the first pinyin and the second pinyin is less than a preset edit distance threshold, and the edit distance represents a minimum number of edits required to convert the first pinyin into the second pinyin; Based on the pinyins corresponding to the Chinese characters, the pinyin sequence is obtained; The mapping table is constructed by determining the mapping relationship between Chinese characters and pinyin according to the following rules: For the standard pinyin without initial consonants, reconstruct the spelling of the standard pinyin according to the method of adding initial consonants to finals to obtain the reconstructed pinyin; For the standard pinyin whose spelling and pronunciation are inconsistent, reconstruct the spelling of the standard pinyin according to the preset finals to obtain the reconstructed pinyin; For the standard pinyin of the preset pronunciation, the spelling of the standard pinyin is reconstructed to obtain the reconstructed pinyin.
2. The speech recognition error correction method according to claim 1, characterized in that: The error correction model includes a Chinese character encoding sub-model and a pinyin encoding sub-model; The extracting the feature vectors of the Chinese character sequence and the pinyin sequence by using the error correction model includes: The Chinese characters included in the Chinese character sequence are encoded by the Chinese character encoding sub-model to obtain the feature vector of each Chinese character, and Encoding the pinyin included in the pinyin sequence by the pinyin encoding sub-model to obtain each pinyin feature vector; Outputting a target Chinese character sequence according to the feature vectors of the Chinese character sequence and the pinyin sequence comprises: Concatenating the Chinese character feature vectors and the pinyin feature vectors to obtain Chinese character concatenated vectors; Predict each of the Chinese character concatenation vectors, and output a target Chinese character sequence including the target Chinese character.
3. The speech recognition error correction method according to claim 1, characterized in that: The error correction model is obtained by pre-training in the following manner: The error correction model is obtained by pre-training based on a Chinese character error correction sample set; The Chinese character error correction sample set includes multiple pairs of training samples, each pair of training samples includes a misrecognized Chinese character sample and a correct Chinese character sample corresponding to the misrecognized Chinese character sample, and the misrecognized Chinese character sample includes a misrecognized Chinese character sequence and a pinyin sequence of the misrecognized Chinese character sequence.
4. The speech recognition error correction method according to claim 3, characterized in that: The error correction model is obtained by pre-training based on the Chinese character error correction sample set, including: Encode each Chinese character in the misrecognized Chinese character sequence to obtain a misrecognized Chinese character feature vector sequence, and Encoding each pinyin in the misrecognized pinyin sequence to obtain a misrecognized pinyin feature vector sequence; splicing each Chinese character feature vector included in the misrecognized Chinese character feature vector sequence and each pinyin feature vector included in the misrecognized pinyin feature vector sequence to obtain a misrecognized spliced vector sequence; Predicting each splicing vector in the sequence of misidentified splicing vectors to obtain each predicted Chinese character; According to each of the predicted Chinese characters, determining a loss value of each of the predicted Chinese characters; Determining the total loss value of the misrecognized Chinese character sequence according to the loss value of each Chinese character; The model is trained according to the total loss value until the total loss value meets the training end condition, and the model at the end of training is determined as the error correction model.
5. A speech recognition error correction device, characterized in that: include: An acquisition module is configured to acquire a Chinese character sequence obtained after automatic speech recognition is performed on the speech to be recognized, and acquire a pinyin sequence corresponding to the Chinese character sequence; A processing module is configured to input the Chinese character sequence and the pinyin sequence into a pre-trained error correction model, extract feature vectors of the Chinese character sequence and the pinyin sequence through the error correction model, and output a target Chinese character sequence according to the feature vectors of the Chinese character sequence and the pinyin sequence; The acquisition module acquires the pinyin sequence corresponding to the Chinese character sequence in the following manner: Searching for pinyins corresponding to the Chinese characters in the Chinese character sequence from a predetermined Chinese character to pinyin mapping table, wherein the Chinese character to pinyin mapping table includes a first Chinese character and a second Chinese character with similar pronunciations, and a first pinyin corresponding to the first Chinese character and a second pinyin corresponding to the second Chinese character, wherein an edit distance between the first pinyin and the second pinyin is less than a preset edit distance threshold, and the edit distance represents a minimum number of edits required to convert the first pinyin into the second pinyin; Based on the pinyins corresponding to the Chinese characters, the pinyin sequence is obtained; The mapping table is constructed by determining the mapping relationship between Chinese characters and pinyin according to the following rules: For the standard pinyin without initial consonants, reconstruct the spelling of the standard pinyin according to the method of adding initial consonants to finals to obtain the reconstructed pinyin; For the standard pinyin whose spelling and pronunciation are inconsistent, reconstruct the spelling of the standard pinyin according to the preset finals to obtain the reconstructed pinyin; For the standard pinyin of the preset pronunciation, the spelling of the standard pinyin is reconstructed to obtain the reconstructed pinyin.
6. A speech recognition error correction device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to: execute the instructions to perform the speech recognition error correction method according to any one of claims 1 to 4 on the collected image to be translated.
7. A computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the program instructions are executed by a processor, the steps of the method described in any one of claims 1 to 4 are implemented.
