Streaming speech recognition method combined with text error correction
By combining the streaming speech recognition method with text error correction, through block processing and edge compensation, the error problem of the streaming speech recognition system in homophone and near-synonym recognition is solved, achieving higher accuracy and real-time performance. Enhanced language modeling capabilities.
Patent Information
- Application Number
- CN202410973987.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-19
- Publication Date
- 2024-10-25
- Estimated Expiration
- 2044-07-19
AI Technical Summary
Existing streaming speech recognition systems have recognition errors when processing homophones and near-synonyms, and existing text error correction models cannot be effectively applied in real-time scenarios, resulting in limitations in the real-time performance and accuracy of the system.
Using a streaming speech recognition method combined with text error correction, the audio data is input into the streaming speech recognition system through block processing, and the error correction model is used for block-by-block decoding and edge compensation to achieve the integration of the error correction model and the streaming speech recognition system. Cascading combination reduces block edge errors and ensures real-time performance of the system.
It improves the accuracy and readability of the output text of the streaming speech recognition system, reduces homophone and near-synonym recognition errors, ensures the low latency and real-time performance of the system, and enhances language modeling capabilities.
Smart Images

Figure CN118841003A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of speech recognition, and in particular to a streaming speech recognition method combined with text error correction. Background Art
[0002] With the popularity of smart terminals, Automatic Speech Recognition (ASR) technology has gradually been integrated into our work and life. Speech recognition technology can help us convert speech into text, but usually the ASR system needs to receive the entire sentence before it can start processing the audio. Therefore, the recognition of any character in each speech segment requires waiting for the entire speech to be recorded. In order to reduce the delay caused by waiting to an acceptable range, researchers have proposed streaming speech recognition technology. In recent years, streaming speech recognition technology has been applied to various scenarios, including video conferencing, live broadcasts of sports or game events, voice input methods, and terminal intelligent voice assistants.
[0003] Compared with non-streaming speech recognition, streaming speech recognition has lower latency and higher memory efficiency, and is more suitable for tasks that require real-time feedback or real-time processing. Through streaming block processing, the audio is divided into shorter speech segments, each of which can be recognized independently to achieve fast response, so the streaming speech recognition system can output recognition results in real time. Although the current streaming speech recognition system has achieved good recognition results, there are still many recognition errors caused by confusion between homophones and near-phonetic words. In order to improve the language modeling ability of the speech recognition system and reduce the confusion between homophones and near-phonetic words through context and context information, a common practice is to add a language model or increase attention re-scoring decoding to the speech recognition system, and re-score its results after completing streaming decoding to improve the quality of the output text. However, this will bring higher latency, and since the speech model re-scoring or attention re-scoring needs to be performed after the entire sentence is stream-decoded, the above method destroys the real-time performance of the system to a certain extent. The non-autoregressive text error correction model has lower latency and can enhance the language modeling ability of the speech recognition system, but it does not have real-time performance and needs to be improved by streaming.
[0004] Since the pronunciation of homophones and near-phonetic words is the same or similar to that of the original word, their phoneme composition is usually the same, which brings great interference to the speech recognition task. The acoustic features of homophones and near-phonetic words are usually less distinguishable. Even if the speech recognition system correctly recognizes the phonemes, there is a risk of recognizing them as homophones or near-phonetic words of the correct text.
[0005] Non-autoregressive text error correction models have low latency, can learn language knowledge in large-scale texts, and detect and correct text errors in speech recognition output based on context and contextual relevance. However, existing text error correction models can only take entire sentences as input. When a streaming strategy is used to correct the input in blocks, insertion and deletion errors will occur because words are segmented at the block boundaries.
[0006] End-to-end streaming models can be divided into three categories: CTC (Connectionist temporal classification), RNN-T (Recurrent Neural Network Transducer), and attention encoding and decoding streaming models. Among them, CTC and RNN-T are natural streaming speech recognition systems.
[0007] A streaming speech recognition solution combined with a language model in the prior art includes: a streaming speech recognition system combined with a language model mainly consists of three parts: an encoder, a decoder and a language model.
[0008] Encoder. The encoder is responsible for converting the input speech signal into a high-level representation that represents speech features. The encoder consists of multiple layers of Transformers or Conformers to extract speech features and capture the timing information of the speech signal. To achieve streaming output, the method divides the input frames into non-overlapping blocks and feeds them into the encoder sequentially.
[0009] Decoder. The decoder receives the input feature sequence from the encoder and maps the input feature sequence to the output sequence through a neural network model. First, the decoder uses the CTC loss function to calculate the difference between the network output and the label sequence, and uses the prefix beam search algorithm to generate the most likely output sequence. The algorithm considers the probability distribution of the output sequence and searches for the optimal path through dynamic programming; then, the language model predicts the next possible character based on the generated partial output sequence and context information. The mainstream language models are divided into statistical n-gram models and neural network-based models, such as recurrent neural network language models (RNNLM) or Transformer language models.
[0010] Language model. The language model is trained with large-scale text data. It estimates the probability of the next character appearing in a given context based on the statistical laws of the language and contextual information. According to different ways of combination, the current language model can be divided into internal language model and external language model. As part of the end-to-end speech recognition model, the internal language model is trained on the corpus of a specific field along with the end-to-end speech recognition model. Although the model is smaller in scale, the learned language knowledge is limited. The external language model can be trained independently on a large-scale multi-domain text corpus, thereby providing the speech recognition model with language knowledge and context-dependent information beyond the training corpus. However, it brings higher latency, which affects the feedback experience of real-time speech recognition.
[0011] The disadvantages of the above-mentioned streaming speech recognition solution combined with the language model in the prior art include:
[0012] The use of language models can effectively improve the accuracy of streaming speech recognition, but it will significantly increase the computational complexity and delay. At the same time, the scale of the model will increase, raising the deployment threshold of the streaming speech recognition system.
[0013] Since the language model decoding stage needs to wait for the complete CTC decoded text output, this undermines the real-time performance of streaming speech recognition to a certain extent.
[0014] A method of streaming speech recognition combined with attention re-scoring in the prior art includes: this method usually uses Conformer or Transformer to directly label the input sequence, outputs the probability distribution of the label sequence based on the input sequence through the network, and then outputs the label sequence with the highest probability. Suppose the input sequence is x=(x 1 ,x 2 ,…,x T ), the output label sequence is L * ={L, blank}, where L is a character set and (blank) is a blank label. Given a training set The goal of CTC model training is to make the network map x to z as realistically as possible. The length of the input feature sequence of the speech recognition system is usually greater than the length of the output text sequence. For this reason, the CTC model inserts empty labels between the output labels and allows labels to be repeated, so that the length of the input and output sequences are consistent. During decoding, many-to-one alignment is achieved through path aggregation. The CTC model can be used to calculate the conditional probability of each possible path in the output sequence, similar to the calculation of the hidden Markov model. When CTC calculates the conditional probability, the CTC loss can be effectively calculated through the forward-backward algorithm. It can still predict the target of each frame, and assumes that the output is independent, thereby simplifying the calculation process.
[0015] The non-autoregressive low-latency feature of CTC is very consistent with the characteristics of streaming speech recognition. The streaming speech recognition framework combined with attention rescoring uses the CTC decoder for streaming output in the first round, and the attention rescoring technology is used in the second round to improve the quality of the complete sentence recognition output text.
[0016] Attention rescoring is a technique that uses the attention mechanism to rescore the N-best candidate results of CTC prefix beam search decoding to obtain more accurate results. Attention rescoring decoding is non-autoregressive, so its latency is relatively low, and it can significantly reduce the word error rate of CTC results, so it can be applied to streaming scenarios to repair the results after the streaming decoding is completed. In U2++, in order to model the left context and the right context, a bidirectional attention rescoring decoder (Left2Right / Right2Left attention decoder) is introduced.
[0017] The streaming speech recognition system combined with attention re-scoring requires joint training. Its loss functions include three types: CTC loss, L2R AED loss, and R2L AED loss. The three losses are weighted and the final loss is obtained:
[0018] Loss final =λL CTC +αL AED―L2R +(1―λ―α)L AED―R2L (1-1)
[0019] Among them, λ and α are used to balance the weights of CTC loss and attention loss. Through joint training, the convergence speed of speech recognition model training can be accelerated and the stability of training can be improved.
[0020] The disadvantages of a method of streaming speech recognition combined with attention re-scoring in the prior art include:
[0021] The attention decoder is trained as a whole with the end-to-end streaming speech recognition system, so it cannot obtain language knowledge outside the training data set of the streaming speech recognition system. When it comes to areas not included in the training data set, the recognition accuracy of the streaming speech recognition system based on this method will drop significantly.
[0022] Attention re-scoring also needs to wait for the complete CTC decoded text output, which to some extent destroys the real-time performance of streaming speech recognition. Summary of the invention
[0023] The embodiment of the present invention provides a streaming speech recognition method combined with text error correction, so as to effectively improve the accuracy and readability of the text output by the streaming speech recognition system.
[0024] In order to achieve the above object, the present invention adopts the following technical scheme.
[0025] A streaming speech recognition method combined with text error correction, comprising:
[0026] After the audio data to be recognized is processed into blocks, the audio data of each block is input into a streaming speech recognition system, and the streaming speech recognition system outputs the recognized text of each block;
[0027] Dividing the recognized text of each block into equal-length text blocks, and inputting the equal-length text blocks into the error correction model;
[0028] The error correction model outputs the coded representation of each block through the encoding module, and then decodes the coded representation of each block block by block through the decoding module, calculates the correlation between the current frame and the historical frame using the memory library, and outputs each block after error correction processing;
[0029] Each block after the error correction process is sent to the edge compensation module, and the edge compensation module uses the common decoding result of the historical blocks to correct and compensate the right edge of each block to obtain the final recognition text of the audio data of each block.
[0030] Preferably, after the audio data to be recognized is processed into blocks, the audio data of each block is input into a streaming speech recognition system, and the streaming speech recognition system outputs the recognized text of each block, including:
[0031] Set the streaming speech recognition system to use the Conformer-CTC architecture, and set the text error correction model to use the Transformer codec architecture;
[0032] The acoustic feature sequence X = (x 1 ,x 2 ,...,x L ) is input to the convolutional downsampling module in the streaming speech recognition system. The convolutional downsampling module obtains the feature sequence in the acoustic feature sequence X, and sends the feature sequence to the Conformer encoder in blocks. The Conformer encoder uses the self-attention mechanism to model the correlation between frames in the feature block. The encoding block output by the Conformer encoder is fed into the CTC decoder and converted into a text sequence. The above operation is expressed by the following formula:
[0033] X 1 =Conv2d(X)(2-1)
[0034] H=Conformer(X 1 )(2-2)
[0035] Y=CTC(H)(2-3)
[0036] Where Conv2d represents a two-dimensional convolutional neural network, H is the encoding representation, and Y is the CTC decoding output sequence.
[0037] Preferably, the step of dividing the recognized text of each block into equal-length text blocks and inputting the equal-length text blocks into the error correction model comprises:
[0038] The text sequence output by the streaming speech recognition system is divided into equal-length text blocks through the streaming speech recognition framework SACM, and the equal-length text blocks are input into the error correction model;
[0039] Assume that the text sequence output by automatic speech recognition ASR is S. Before feeding it to the error correction model, replan the text sequence and divide it into S equal-length text blocks. Each block contains a fixed number of characters. Assume that there are n blocks, then the block sequence is s 1 ,s 2 ,...,s n .
[0040] Preferably, the error correction model outputs the coded representation of each block through the encoding module, and then decodes the coded representation of each block block by block through the decoding module, calculates the correlation between the current frame and the historical frame using the memory library, and outputs each block after error correction processing, including:
[0041] After the text block sequence is fed into the error correction module, the error correction module outputs a hidden sequence H through the Transformer encoder. The hidden sequence H is input into the error detector to obtain the error mark sequence L. Then H and L are fed into the Transformer decoder together to complete the correction process and obtain the output text O. 1 ;
[0042] S = re-chunk (Y) (2-4)
[0043] H=Transformer Encoder(S)(2-5)
[0044] L = error detection (H) (2-6)
[0045] O 1 =TransformerDecoder(H,L)(2-7)
[0046] Where re-chunk means re-chunking, H is the encoding representation, L is the error detector output sequence, O 1 For decoding output;
[0047] The memory bank stores the blocks that the error correction model has calculated. When processing the next block, the error correction model takes out the intermediate variables required for the attention operation from the memory bank. Each Transformer layer caches the historical blocks. The cache operation after the nth Transformer layer is expressed as:
[0048] B n =B n ∪{s i,n ′} (2-9)
[0049] Among them B n represents the memory bank of the nth layer, which stores the processing results of all historical blocks of the nth layer and caches them after the Transformer layer outputs the hidden representation of the current block. i,n ′ represents the result obtained after the i-th coding block passes through the n-th Transformer layer. The calculation formula of the attention part in the n-th Transformer layer is as follows:
[0050] Q n,i =W q X n―1,i (2-10)
[0051] K n,i =W k [X n―1,i ,X n―1,cache ] (2-11)
[0052] V n,i =W v [X n―1,i ,X n―1,cache ] (2-12)
[0053] A n, i=Attention(Q n,i ,K n,i ,V n,i ) (2-13)
[0054] W represents the weight matrix, Q, K, V represent the query, key and value matrices respectively, and A is the attention output;
[0055] Where Q is the query tensor, K and V are key-value tensors respectively. After passing through the feedforward layer, the output of the i-th block of the n-th Transformer layer is obtained:
[0056] s i,n ′=feed_forward(A n,i ) (2-14)
[0057] Among them A n,i′ represents the normalized output of the attention layer, and the error-corrected block s is obtained i,n ' will be put into cache library B n middle.
[0058] Preferably, the blocks after the error correction processing are sent to an edge compensation module, and the edge compensation module uses the common decoding result of the historical blocks to correct and compensate the right edge of each block to obtain the final recognition text of the audio data of each block, including:
[0059] Each time the edge compensation module performs error correction on the current block, the encoded representations of the historical block and the current block are decoded together, the characters that are mistakenly deleted, replaced or inserted on the right edge of the adjacent historical block are restored, and the characters on the right edge of the current block are deleted to obtain the final output of the current block. At this time, the final recognized text of the audio data of each block is:
[0060] Y i =f(s 1 ,s 2 ,...,s i )―S i―1 ―π i,edge (2-15)
[0061] where Y i represents the output sequence of the i-th block, f(·) represents the error correction model, S i―1 represents the output sequence of the history block, π i,edge Indicates the right edge characters of the decoding result of the i-th block. When characters are inserted on the right edge, the two characters on the right edge need to be deleted. When characters are deleted, the characters on the right edge do not need to be deleted.
[0062] It can be seen from the technical solutions provided by the above-mentioned embodiments of the present invention that the method of the present invention realizes the streaming output of the error correction model, realizes the cascade combination of the error correction model and the streaming speech recognition system through re-block processing, and at the same time uses the edge compensation mechanism to solve the problem of edge error correction, thereby solving the problem that the existing methods cannot fully guarantee the real-time performance of the system.
[0063] Additional aspects and advantages of the present invention will be given in part in the following description, which will become obvious from the following description, or may be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0065] Figure 1 A structural diagram of a novel streaming speech recognition framework combined with a text error correction model, SACM (Streaming ASR with Correction Model), provided in an embodiment of the present invention;
[0066] Figure 2 A processing flow chart of a streaming speech recognition method combined with text error correction provided by an embodiment of the present invention;
[0067] Figure 3 A schematic diagram of a streaming error correction process provided by an embodiment of the present invention;
[0068] Figure 4 A schematic diagram of performing edge compensation on an audio data block provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0069] The embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be interpreted as limiting the present invention.
[0070] It will be understood by those skilled in the art that, unless expressly stated, the singular forms "one", "said", and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present invention refers to the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof. It should be understood that when we refer to an element as being "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may be intermediate elements. In addition, the "connection" or "coupling" used herein may include wireless connection or coupling. The term "and / or" used herein includes any unit and all combinations of one or more associated listed items.
[0071] It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as those generally understood by those skilled in the art in the art to which the present invention belongs. It should also be understood that terms such as those defined in common dictionaries should be understood to have meanings consistent with the meanings in the context of the prior art, and will not be interpreted with idealized or overly formal meanings unless defined as herein.
[0072] To facilitate understanding of the embodiments of the present invention, several specific embodiments will be further explained below with reference to the accompanying drawings, and each embodiment does not constitute a limitation on the embodiments of the present invention.
[0073] The embodiment of the present invention proposes a streaming speech recognition method combined with text error correction to improve the language modeling capability of the Chinese streaming speech recognition system. First, the present invention proposes a novel SACM (Streaming ASR with Correction Model, streaming speech recognition framework) structure combined with text error correction model. Figure 1 As shown, by re-blocking the output text of the streaming speech recognition, a cascade combination of the streaming speech recognition system and the text error correction model is realized, wherein the streaming speech recognition system and the text error correction module are trained independently, so that the text error correction model can learn richer language knowledge from a large amount of text data. Secondly, the present invention also proposes a method of block input and multi-block edge compensation error correction, which reduces the phenomenon of erroneous deletion and insertion at the edge of the block, realizes the streaming output of the error correction model, ensures the real-time performance of the streaming speech recognition system, and reduces the recognition errors of homophones and near-phonetic words in Chinese streaming speech recognition.
[0074] A processing flow chart of a streaming speech recognition method combined with text error correction provided by an embodiment of the present invention is as follows: Figure 2 As shown, the process includes the following steps:
[0075] Step S10: After the audio data to be recognized is divided into blocks, the audio data of each block is input into the streaming speech recognition system, and the streaming speech recognition system outputs the recognition text of each block.
[0076] Step S20: Divide the recognized text of each block into text blocks of equal length, and input the text blocks of equal length into the error correction model.
[0077] Step S30: The error correction model outputs the coded representation of each block through TransformerEncoder, and then decodes the coded representation of each block block by block through TransformerDecoder, calculates the correlation between the current frame and the historical frame using the memory library, and outputs each block after error correction processing.
[0078] Step S40: Send each block after error correction to the edge compensation module. The edge compensation module uses the common decoding result of the historical blocks to correct and compensate the right edge of each block to obtain the final recognition text of the audio data of each block.
[0079] Specifically, the above step S10 includes: the streaming speech recognition system adopts the Conformer-CTC architecture, and the text error correction model adopts the Transformer codec architecture, and the two are trained independently so that the text error correction model can learn richer language knowledge from a large amount of paired text data.
[0080] For the streaming speech recognition system, first the acoustic feature sequence X = (x 1 ,x 2 ,...,x L ) is input into the convolutional downsampling module to capture local feature information and reduce the size of the feature spectrogram, reducing the amount of computation for subsequent networks. The feature sequence is then fed into the Conformer encoder in blocks, and the correlation between frames in the feature block is modeled using the self-attention mechanism. Finally, the encoding block is fed into the CTC (Connectionist temporal classification) decoder to be converted into a text sequence representation. The above operation can be expressed by the following formula:
[0081] X 1 =Conv2d(X)(2-1)
[0082] H=Conformer(X 1 )(2-2)
[0083] Y=CTC(H)(2-3)
[0084] Among them, Conv2d represents a two-dimensional convolutional neural network, H is the encoding representation, and Y is the CTC decoding output sequence.
[0085] Specifically, the above step S20 includes: the output text sequence of the streaming speech recognition system needs to be regrouped before being fed to the text error correction module. The output text blocks of the streaming speech recognition system are of different lengths, and the error correction model needs to receive text blocks of the same length as input, so the SACM re-plans the output of the speech recognition into text blocks of equal length and then inputs them into the text error correction module.
[0086] The actual input of streaming speech recognition is speech segments of the same length. Due to the difference in the length of pronunciation of different Chinese characters and the phenomenon of delayed label emission, the lengths of different output text blocks of streaming speech recognition are also different. Therefore, SACM re-blocks the output of streaming speech recognition, such as Figure 3 shown.
[0087] Let the ASR (Automatic Speech Recognition) output stream be S. Replan it before feeding it to the error correction model. Each block contains a fixed number of characters. Let it be divided into n blocks, then we can get s 1 ,s 2 ,...,s n By analyzing the recording file data, it is found that the average duration corresponding to Chinese characters is about 180ms. The present invention sets the length of the block to 4, corresponding to a block delay of about 720ms, which meets the real-time requirement.
[0088] S = re-chunk (Y) (2-4)
[0089] re-chunk means re-chunking.
[0090] Specifically, the above step S30 includes: after the text block is fed to the error correction module, the error correction module first outputs a hidden sequence H through the Transformer encoder, the hidden sequence H is input to the error detector to obtain an error marker sequence L, and then H and L are fed together to the Transformer decoder to complete the correction process to obtain O 1 ,Finally, the final output text is obtained through the edge compensation module.
[0091] H=Transformer Encoder(S)(2-5)
[0092] L = error detection (H) (2-6)
[0093] O 1 =TransformerDecoder(H,L)(2-7)
[0094] H is the encoding representation, L is the error detector output sequence, O 1 is the decoded output, O 2 This is the output after edge compensation.
[0095] The existing error correction model needs to accept complete text input, which does not meet the real-time requirements. Therefore, the present invention proposes a text error correction model streaming method. In order to achieve streaming encoding and decoding, block processing will limit the attention within the block. In order to improve the global modeling ability and not introduce dependence on future context, the proposed streaming error correction model uses a cache library to save the processed historical blocks for subsequent calculations; in response to the phenomenon of miscorrection at the edge of the block, the present invention proposes a multi-block edge compensation error correction method.
[0096] After the input is divided into blocks, the error correction model does not correct each block individually, but corrects the current block in combination with the previous blocks, so that the correlation between the current time step and the historical time step can be modeled. In order to reduce the amount of calculation, the memory bank will save the blocks that have been calculated, and take out the intermediate variables required for the attention operation from the memory bank when processing the next block.
[0097] Figure 3 A schematic diagram of a streaming error correction process provided by an embodiment of the present invention. Each Transformer layer needs to cache the historical blocks, and the cache operation after the nth Transformer layer can be expressed as:
[0098] B n =B n ∪{s i,n ′} (2-9)
[0099] Among them B n represents the memory bank of the nth layer, which stores the processing results of all historical blocks of the nth layer and caches them after the Transformer layer outputs the hidden representation of the current block. i,n ′ represents the result obtained after the i-th coding block passes through the n-th Transformer layer. The calculation formula of the attention part in the n-th Transformer layer is as follows:
[0100] Q n,i =W q X n―1,i (2-10)
[0101] K n,i =W k [X n―1,i ,X n―1,cache ] (2-11)
[0102] V n,i =W v [X n―1,i ,X n―1,cache ] (2-12)
[0103] A n,i =Attention(Q n,i ,K n,i ,V n,i ) (2-13)
[0104] Where W represents the weight matrix, Q, K, V represent the query, key and value matrices respectively, and A is the attention output.
[0105] Where Q is the query tensor, K and V are key-value tensors respectively. After passing through the feedforward layer, the output of the ith block of the nth Transformer layer is obtained:
[0106] s i,n ′=feed_forward(A n,i ) (2-14)
[0107] Among them A n,i ′ represents the normalized output of the attention layer, and the error-corrected block s is obtained i,n ' will be put into cache library B n middle.
[0108] Specifically, the above step S40 includes: since the input text blocks accepted by the error correction model may have word segmentation, for example, "multi-block recognition" may be segmented into "multi-block identification" and "differentiation", resulting in "recognition" or "differentiation" being deleted by the error correction model, the present invention adds an edge compensation module to the streaming text error correction model.
[0109] Figure 4 A schematic diagram of edge compensation for an audio data block provided by an embodiment of the present invention. Figure 4 As shown, each time the current block is corrected, the coded representations of the historical block and the current block are decoded together to restore the characters that are mistakenly deleted, replaced or inserted at the right edge of the adjacent historical block to avoid error correction caused by segmentation. At the same time, in order to prevent the output of the characters that are mistakenly corrected at the right edge of the current block, the characters at the right edge of the current block are deleted, thereby obtaining the final output of the current block. At this time, the final recognized text of the audio data of each block is:
[0110] Y i =f(s 1 ,s 2 ,...,s i )―S i―1 ―π i,edge (2-15)
[0111] where Y i represents the output sequence of the i-th block, f(·) represents the error correction model, S i―1 represents the output sequence of the history block, π i,edge Indicates the right edge characters of the decoding result of the i-th block. When characters are inserted on the right edge, the two characters on the right edge need to be deleted. When characters are deleted, the characters on the right edge do not need to be deleted.
[0112] The present invention can be applied to conference scenarios, game or sports event live broadcast scenarios, terminal smart assistants, etc., and is used to record conference information in real time, transcribe live subtitles, and output transcribed text in real time during human-computer interaction.
[0113] In summary, the embodiment of the present invention proposes a streaming speech recognition method combined with an error correction model, which effectively improves the language modeling capability of the streaming speech recognition system and reduces recognition errors caused by confusion between homophones and near-phonetic words. Compared with the existing methods for improving language modeling capabilities, the present invention uses a lightweight text error correction model to learn rich language knowledge in large-scale text data, which improves the domain adaptation capability of the model while ensuring the low latency characteristics of the system.
[0114] The present invention realizes the streaming output of the error correction model, realizes the cascade combination of the error correction model and the streaming speech recognition system through heavy block processing, and simultaneously uses the edge compensation mechanism to solve the problem of edge error correction, thus solving the problem that the existing method cannot fully guarantee the real-time performance of the system.
[0115] The present invention realizes the streaming output of the error correction model, combines text error correction with streaming speech recognition, and improves the language modeling capability of streaming speech recognition. The cascade combination of the error correction model and the streaming speech recognition system is realized by using the re-blocking method, and an edge compensation module is added at the end of the error correction model to delete the Chinese characters on the right edge of the current text block and perform compensation output when the next block is output to avoid the occurrence of miscorrection.
[0116] Those skilled in the art can understand that the accompanying drawings are only schematic diagrams of an embodiment, and the modules or processes in the accompanying drawings are not necessarily required to implement the present invention.
[0117] It can be known from the description of the above implementation methods that those skilled in the art can clearly understand that the present invention can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which can be stored in a storage medium such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in the various embodiments of the present invention or certain parts of the embodiments.
[0118] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device or system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. The device and system embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0119] The above is only a preferred specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A streaming speech recognition method combined with text error correction, characterized in that: include: After the audio data to be recognized is processed into blocks, the audio data of each block is input into a streaming speech recognition system, and the streaming speech recognition system outputs the recognized text of each block; Dividing the recognized text of each block into equal-length text blocks, and inputting the equal-length text blocks into the error correction model; The error correction model outputs the coded representation of each block through the encoding module, and then decodes the coded representation of each block block by block through the decoding module, calculates the correlation between the current frame and the historical frame using the memory library, and outputs each block after error correction processing; Each block after the error correction process is sent to the edge compensation module, and the edge compensation module uses the common decoding result of the historical blocks to correct and compensate the right edge of each block to obtain the final recognition text of the audio data of each block.
2. The method according to claim 1, characterized in that After the audio data to be recognized is processed into blocks, the audio data of each block is input into a streaming speech recognition system, and the streaming speech recognition system outputs the recognized text of each block, including: Set the streaming speech recognition system to use the Conformer-CTC architecture, and set the text error correction model to use the Transformer codec architecture; The acoustic feature sequence X = (x1, x2, ..., x L ) is input to the convolutional downsampling module in the streaming speech recognition system. The convolutional downsampling module obtains the feature sequence in the acoustic feature sequence X, and sends the feature sequence to the Conformer encoder in blocks. The Conformer encoder uses the self-attention mechanism to model the correlation between frames in the feature block. The encoding block output by the Conformer encoder is fed into the CTC decoder and converted into a text sequence. The above operation is expressed by the following formula: X1=Conv2d(X)(2-1) H=Conformer(X1)(2-2) Y=CTC(H)(2-3) Where Conv2d represents a two-dimensional convolutional neural network, H is the encoding representation, and Y is the CTC decoding output sequence.
3. The method according to claim 2, characterized in that The step of dividing the recognized text of each block into equal-length text blocks and inputting the equal-length text blocks into the error correction model includes: The text sequence output by the streaming speech recognition system is divided into equal-length text blocks through the streaming speech recognition framework SACM, and the equal-length text blocks are input into the error correction model; Suppose the automatic speech recognition ASR output text sequence is S. Before feeding it to the error correction model, replan the text sequence and divide it into S equal-length text blocks. Each block contains a fixed number of characters. Suppose it is divided into n blocks, then the block sequence is s1, s2, ..., s n .
4. The method according to claim 3, characterized in that The error correction model outputs the coded representation of each block through the encoding module, and then decodes the coded representation of each block block by block through the decoding module, calculates the correlation between the current frame and the historical frame using the memory bank, and outputs each block after error correction processing, including: After the text block sequence is fed to the error correction module, the error correction module outputs a hidden sequence H through the Transformer encoder. The hidden sequence H is input to the error detector to obtain the error mark sequence L. Then H and L are fed together to the Transformer decoder to complete the correction process and obtain the output text O1. S = re-chunk (Y) (2-4) H=Transformer Encoder(S)(2-5) L = error detection (H) (2-6) O1=TransformerDecoder(H,L)(2-7) Where re-chunk means re-chunking, H is the encoding representation, L is the error detector output sequence, and O1 is the decoding output; The memory bank stores the blocks that the error correction model has calculated. When processing the next block, the error correction model takes out the intermediate variables required for the attention operation from the memory bank. Each Transformer layer caches the historical blocks. The cache operation after the nth Transformer layer is expressed as: B n =B n ∪{s i,n′ } (2-9) Among them B n represents the memory bank of the nth layer, which stores the processing results of all historical blocks of the nth layer and caches them after the Transformer layer outputs the hidden representation of the current block. i,n′ It represents the result obtained after the i-th coding block passes through the n-th Transformer layer. The calculation formula of the attention part in the n-th Transformer layer is as follows: Q n,i =W q X n-1,i (2-10) K n,i =W k [X n-1,i ,X n-1,cache ] (2-11) V n,i =W v [X n-1,i ,X n-1,cache ] (2-12) A n,i =Attention(Q n,i ,K n,i ,V n,i ) (2-13) W represents the weight matrix, Q, K, V represent the query, key and value matrices respectively, and A is the attention output; Where Q is the query tensor, K and V are key-value tensors respectively. After passing through the feedforward layer, the output of the i-th block of the n-th Transformer layer is obtained: s i,n′ =feed_forward(A n,i ) (2-14) Among them A n,i ′ represents the normalized output of the attention layer, and the error-corrected block s is obtained i,n ' will be put into cache library B n middle.
5. The method according to claim 4, characterized in that The said sending each block after the error correction processing to the edge compensation module, the edge compensation module uses the historical block common decoding result to correct and compensate the right edge of each block to obtain the final recognition text of the audio data of each block, including: Each time the edge compensation module performs error correction on the current block, the encoded representations of the historical block and the current block are decoded together, the characters that are mistakenly deleted, replaced or inserted on the right edge of the adjacent historical block are restored, and the characters on the right edge of the current block are deleted to obtain the final output of the current block. At this time, the final recognized text of the audio data of each block is: Y i =f(s1,s2,..,s i )-S i-1 -π i,edge (2-15) where Y i represents the output sequence of the i-th block, f(·) represents the error correction model, S i-1 represents the output sequence of the history block, π i,edge Indicates the right edge characters of the decoding result of the i-th block. When characters are inserted on the right edge, the two characters on the right edge need to be deleted. When characters are deleted, the characters on the right edge do not need to be deleted.
Citation Information
Patent Citations
Text error correction model generation method and system, text error correction method and system, equipment and medium
CN113066494A
Streaming speech recognition method and device, electronic equipment and storage medium
CN115019785A
Streaming speech recognition and model training method, device and equipment
CN115273830A
Text error correction method and related device
CN117408244A
Text error correction method, system, device, and storage medium
US20240135089A1
Cited By
AI voice recognition method and tablet computer
CN119380704A
Power grid dispatching voice information checking method and system
CN119673156A
Speech recognition method and device, model training method and device, electronic equipment and medium
CN121331105A
Speech recognition method and device
CN121983061A
A speech recognition method and apparatus
CN121983061B
