Speech recognition text error correction method, device and equipment based on long-distance context
Through the speech recognition text error correction method based on long-distance context, combined with pseudo-paired data and real paired data training model, the problem of low error correction efficiency of traditional speech recognition text is solved, and more efficient and accurate error correction processing is achieved.
Patent Information
- Application Number
- CN202411032590.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-30
- Publication Date
- 2024-12-13
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Traditional speech recognition text error correction methods rely on manual auditing and are inefficient and cannot efficiently handle errors in speech recognition text.
Using a long-distance context-based speech recognition text error correction method, a speech recognition text error correction model is constructed by obtaining training data, combining pseudo-paired data and real paired data for model training, and using the target speech recognition text error correction model to the original speech Identify text for error information identification and error correction processing.
The efficiency and accuracy of speech recognition text error correction are improved. By combining different types of data training models, the ability to identify various error messages is enhanced, and the need for manual review is reduced.
Smart Images

Figure CN119132290A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of natural language processing, and in particular to a method, apparatus, computer device, computer-readable storage medium and computer program product for speech recognition text error correction based on long-distance context. Background Art
[0002] With the development of natural language processing, speech recognition technology has important applications in many fields. How to efficiently perform speech recognition text error correction has become an important research direction.
[0003] Traditional technology usually performs speech recognition text error correction through manual review; however, performing speech recognition text error correction through this method requires a lot of manual processing time, resulting in low efficiency of speech recognition text error correction. Summary of the invention
[0004] Based on this, it is necessary to provide a long-distance context-based speech recognition text correction method, device, computer equipment, computer-readable storage medium and computer program product that can improve the efficiency of speech recognition text correction in response to the above technical problems.
[0005] In a first aspect, the present application provides a method for correcting speech recognition text based on long-distance context. The method comprises:
[0006] Acquire training data and construct a speech recognition text error correction model to be trained; the training data includes pseudo paired data and real paired data;
[0007] Using the training data to train the speech recognition text error correction model to be trained to obtain a target speech recognition text error correction model;
[0008] Using the target speech recognition text error correction model, error information recognition is performed on the original speech recognition text of the current speech data to obtain an error information recognition result of the original speech recognition text;
[0009] According to the error information recognition result, error correction processing is performed on the original speech recognition text to obtain the target speech recognition text of the current speech data.
[0010] In one embodiment, the step of training the speech recognition text error correction model to be trained using the training data to obtain a target speech recognition text error correction model includes:
[0011] Using the pseudo paired data to perform model training processing on the speech recognition text error correction model to be trained, to obtain the speech recognition text error correction model to be updated;
[0012] The real paired data is used to perform model update processing on the speech recognition text error correction model to be updated to obtain the target speech recognition text error correction model.
[0013] In one embodiment, the error information recognition of the original speech recognition text of the current speech data is performed by the target speech recognition text error correction model to obtain the error information recognition result of the original speech recognition text, including:
[0014] For each text segment in the original speech recognition text, the target speech recognition text error correction model is used to identify error information of the text segment based on feature information of the text segment and feature information of context sentence information corresponding to the text segment, so as to obtain an error information identification sub-result of the text segment;
[0015] The error information recognition result is determined according to the obtained error information recognition sub-results of each text segment.
[0016] In one embodiment, the method further comprises:
[0017] Get the first correct text;
[0018] Replacing the candidate word in the first correct text with the incorrect word corresponding to the candidate word to obtain the incorrect text corresponding to the first correct text;
[0019] The first correct text and the erroneous text are combined to obtain the pseudo paired data.
[0020] In one embodiment, the method further comprises:
[0021] Acquire real voice data and a second correct text corresponding to the real voice data;
[0022] Performing speech recognition on the real speech data through a speech recognition model to obtain a speech recognition text of the real speech data;
[0023] The second correct text and the speech recognition text of the real speech data are combined to obtain the real paired data.
[0024] In one embodiment, before performing error information recognition on the original speech recognition text of the current speech data by using the target speech recognition text error correction model to obtain the error information recognition result of the original speech recognition text, the method further includes:
[0025] Acquire the current voice data;
[0026] The current voice data is subjected to voice recognition through a voice recognition model to obtain an original voice recognition text of the current voice data.
[0027] In a second aspect, the present application also provides a speech recognition text error correction device based on long-distance context. The device comprises:
[0028] A data acquisition module, used to acquire training data and construct a speech recognition text error correction model to be trained; the training data includes pseudo paired data and real paired data;
[0029] A model training module, used to train the speech recognition text error correction model to be trained using the training data to obtain a target speech recognition text error correction model;
[0030] A text recognition module, used to perform error information recognition on the original speech recognition text of the current speech data through the target speech recognition text error correction model to obtain an error information recognition result of the original speech recognition text;
[0031] The text processing module is used to perform error correction processing on the original speech recognition text according to the error information recognition result to obtain the target speech recognition text of the current speech data.
[0032] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
[0033] Acquire training data and construct a speech recognition text error correction model to be trained; the training data includes pseudo paired data and real paired data;
[0034] Using the training data to train the speech recognition text error correction model to be trained to obtain a target speech recognition text error correction model;
[0035] Using the target speech recognition text error correction model, error information recognition is performed on the original speech recognition text of the current speech data to obtain an error information recognition result of the original speech recognition text;
[0036] According to the error information recognition result, error correction processing is performed on the original speech recognition text to obtain the target speech recognition text of the current speech data.
[0037] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0038] Acquire training data and construct a speech recognition text error correction model to be trained; the training data includes pseudo paired data and real paired data;
[0039] Using the training data to train the speech recognition text error correction model to be trained to obtain a target speech recognition text error correction model;
[0040] Using the target speech recognition text error correction model, error information recognition is performed on the original speech recognition text of the current speech data to obtain an error information recognition result of the original speech recognition text;
[0041] According to the error information recognition result, error correction processing is performed on the original speech recognition text to obtain the target speech recognition text of the current speech data.
[0042] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0043] Acquire training data and construct a speech recognition text error correction model to be trained; the training data includes pseudo paired data and real paired data;
[0044] Using the training data to train the speech recognition text error correction model to be trained to obtain a target speech recognition text error correction model;
[0045] Using the target speech recognition text error correction model, error information recognition is performed on the original speech recognition text of the current speech data to obtain an error information recognition result of the original speech recognition text;
[0046] According to the error information recognition result, error correction processing is performed on the original speech recognition text to obtain the target speech recognition text of the current speech data.
[0047] The above-mentioned speech recognition text error correction method, device, computer equipment, computer-readable storage medium and computer program product based on long-distance context obtain training data and construct a speech recognition text error correction model to be trained; the training data includes pseudo-paired data and real paired data; the speech recognition text error correction model to be trained is trained using the training data to obtain a target speech recognition text error correction model; the original speech recognition text of the current speech data is subjected to error information recognition through the target speech recognition text error correction model to obtain an error information recognition result of the original speech recognition text; according to the error information recognition result, the original speech recognition text is subjected to error correction processing to obtain the target speech recognition text of the current speech data. This scheme trains the speech recognition text error correction model by combining pseudo-paired data and real paired data, which is conducive to improving the model's ability to recognize various error information, thereby helping to improve the efficiency and accuracy of speech recognition text error correction. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0049] Figure 1 A flowchart of a method for correcting speech recognition text errors based on long-distance context in one embodiment;
[0050] Figure 2 A schematic diagram of a flow chart of a method for correcting speech recognition text based on long-distance context in another embodiment;
[0051] Figure 3 A schematic diagram of the structure of a speech recognition text error correction model to be trained in one embodiment;
[0052] Figure 4 It is a structural block diagram of a speech recognition text error correction device based on long-distance context in one embodiment;
[0053] Figure 5 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0054] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0055] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0056] In an exemplary embodiment, Figure 1 As shown, a method for speech recognition text error correction based on long-distance context is provided. This embodiment takes the method applied to a terminal as an example; it can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. Among them, the terminal can be but is not limited to various personal computers, laptops, smart phones, tablet computers, etc.; the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud computing services. In this embodiment, the method includes the following steps:
[0057] Step S101, obtaining training data and constructing a speech recognition text error correction model to be trained; the training data includes pseudo paired data and real paired data.
[0058] Step S102, using the training data to train the speech recognition text error correction model to be trained, to obtain a target speech recognition text error correction model.
[0059] Step S103, using the target speech recognition text error correction model, error information recognition is performed on the original speech recognition text of the current speech data to obtain an error information recognition result of the original speech recognition text.
[0060] Step S104, performing error correction processing on the original speech recognition text according to the error information recognition result to obtain the target speech recognition text of the current speech data.
[0061] The long-distance context may refer to a longer text range considered in the speech recognition process, for example, the long-distance context may refer to text content exceeding one sentence or paragraph.
[0062] Among them, speech recognition text error correction can refer to the process of error detection and correction of speech recognition results.
[0063] The training data may refer to a data set used to train a speech recognition text error correction model.
[0064] The pseudo-paired data may refer to a data pair constructed to simulate speech recognition errors. For example, the pseudo-paired data may be a data pair generated by introducing errors into correct text.
[0065] The real paired data may refer to data pairs containing errors collected from an actual speech recognition system. For example, the real paired data may be a data pair consisting of an actual speech recognition result and a corrected correct text.
[0066] The speech recognition text error correction model to be trained may refer to an untrained initial model structure. For example, the speech recognition text error correction model to be trained may be a model of a predefined neural network structure.
[0067] Among them, the target speech recognition text error correction model may refer to a model that can perform text error correction tasks after training, for example, the target speech recognition text error correction model may be a neural network model optimized by training data.
[0068] The current voice data may refer to the voice input that needs to be recognized and corrected. For example, the current voice data may be the voice input by the user in real time or a pre-recorded voice file.
[0069] The original speech recognition text may refer to the text result directly output by the speech recognition system. For example, the original speech recognition text may be the initial recognition result that has not been processed by error correction.
[0070] Among them, the error information recognition result may refer to the detection result of the target speech recognition text error correction model on the error information in the original speech recognition text. For example, the error information recognition result may include the location, type and correct form of the error.
[0071] The target speech recognition text may refer to the final text result after error correction processing.
[0072] Optionally, the terminal obtains pseudo-paired data and real paired data as training data; designs and initializes a neural network model as the speech recognition text error correction model to be trained; uses the prepared training data to iteratively train the speech recognition text error correction model to be trained through a back propagation algorithm until the performance of the speech recognition text error correction model to be trained reaches a preset standard, thereby obtaining a target speech recognition text error correction model; in actual applications, the current speech data is input into a speech recognition system (or a speech recognition model) to obtain the original speech recognition text of the current speech data, and then the original speech recognition text is input into the target speech recognition text error correction model for error information detection to obtain an error information recognition result of the original speech recognition text, and according to the detected error information recognition result, the original speech recognition text is error corrected to generate the final target speech recognition text.
[0073] In the above-mentioned speech recognition text correction method based on long-distance context, training data is obtained, and a speech recognition text correction model to be trained is constructed; the training data includes pseudo-paired data and real paired data; the speech recognition text correction model to be trained is trained using the training data to obtain a target speech recognition text correction model; the original speech recognition text of the current speech data is subjected to error information recognition through the target speech recognition text correction model to obtain an error information recognition result of the original speech recognition text; according to the error information recognition result, the original speech recognition text is subjected to error correction processing to obtain the target speech recognition text of the current speech data. This scheme trains the speech recognition text correction model by combining pseudo-paired data and real paired data, which is conducive to improving the model's ability to recognize various error information, thereby helping to improve the efficiency and accuracy of speech recognition text correction.
[0074] In an exemplary embodiment, a speech recognition text error correction model to be trained is trained using training data to obtain a target speech recognition text error correction model, which specifically includes the following contents: using pseudo paired data to perform model training processing on the speech recognition text error correction model to be trained to obtain a speech recognition text error correction model to be updated; using real paired data to perform model update processing on the speech recognition text error correction model to be updated to obtain a target speech recognition text error correction model.
[0075] Among them, the model training process can refer to the process of using pseudo-paired data to update the parameters of the speech recognition text error correction model to be trained. For example, the model training process can be the process of adjusting the weights of the speech recognition text error correction model to be trained using the back propagation algorithm and the gradient descent method.
[0076] Among them, the speech recognition text error correction model to be updated may refer to an intermediate model that has been trained with pseudo paired data. For example, the speech recognition text error correction model to be updated may be a model that has completed preliminary training but has not yet been fine-tuned with real paired data.
[0077] Among them, the model update processing can refer to the process of further updating the speech recognition text error correction model to be updated using real paired data. For example, the model update processing can be the process of fine-tuning the model through real speech recognition error samples.
[0078] Optionally, the terminal adopts a two-stage training strategy to optimize the speech recognition text error correction model. The terminal uses a large amount of pseudo-paired data to perform preliminary training on the speech recognition text error correction model to be trained. These pseudo-paired data cover various error types and patterns. Through this stage of training, the model can learn a wide range of error correction rules and patterns, forming a speech recognition text error correction model to be updated with certain generalization capabilities. The terminal uses relatively less but more real paired data (real paired data) to fine-tune the model to be updated. This step can make the model better adapt to the error characteristics that appear in the actual speech recognition system, improve the error correction performance of the model in real scenarios, and thus obtain the target speech recognition text error correction model.
[0079] The technical solution provided in this embodiment uses pseudo-paired data to train the model and then uses real paired data to update the model, which is conducive to making full use of the advantages of different types of data, improving the generalization ability and practical application effect of the model, and ultimately achieving more accurate speech recognition text error correction.
[0080] In an exemplary embodiment, error information recognition is performed on the original speech recognition text of the current speech data through a target speech recognition text error correction model to obtain an error information recognition result of the original speech recognition text, which specifically includes the following contents: for each text segment in the original speech recognition text, error information recognition is performed on the text segment through a target speech recognition text error correction model based on feature information of the text segment and feature information of context sentence information corresponding to the text segment to obtain an error information recognition sub-result of the text segment; and the error information recognition result is determined based on the error information recognition sub-results obtained for each text segment.
[0081] The text segment may be a continuous sentence unit in the original speech recognition text, for example, the text segment may be a complete sentence, a phrase or a text segment of a fixed length.
[0082] The feature information may be data describing characteristics, for example, the feature information may include word frequency statistics, part-of-speech tagging and / or semantic vector information.
[0083] The context sentence information may be the relevant text content around the text segment, for example, the context sentence information may be the content of the preceding and following sentences of the text segment.
[0084] The error information identification sub-result may be an error detection output for a single text segment, for example, the error information identification sub-result may be a data structure including an error type, an error location, and correction content.
[0085] The error information recognition result may be a comprehensive error detection output of the entire original speech recognition text, for example, the error information recognition result may be a collection or summary of the error information recognition sub-results of all text segments.
[0086] Optionally, the terminal divides the original speech recognition text into multiple text segments; for each text segment, extracts feature information of the text segment, and simultaneously obtains context sentence information of the text segment and extracts feature information corresponding to the context sentence information; through the target speech recognition text error correction model, based on the feature information of the text segment and the feature information of the context sentence information corresponding to the text segment, performs error information recognition on the current text segment to generate an error information recognition sub-result of the text segment; after completing the processing of all text segments, combines the error information recognition sub-results of each text segment to form an overall error information recognition result.
[0087] The technical solution provided in this embodiment combines text segment features and context information to perform segmentation error recognition, which is conducive to making full use of context information to improve recognition accuracy, thereby facilitating more comprehensive recognition of error information in speech recognition text and achieving more accurate error information recognition and subsequent error correction processing.
[0088] In an exemplary embodiment, the following contents are also included: obtaining a first correct text; replacing the candidate words in the first correct text with the incorrect words corresponding to the candidate words, to obtain incorrect text corresponding to the first correct text; and combining the first correct text and the incorrect text to obtain pseudo paired data.
[0089] The first correct text may be an original text that is grammatically correct and semantically correct.
[0090] Among them, the candidate words may be preset words in the first correct text, for example, the candidate words may be words with corresponding homophones, near-phonetic characters, etc. that are easily misrecognized.
[0091] The erroneous word may be a word corresponding to the candidate word and simulating a speech recognition error. For example, the erroneous word may be a homonym, near-phonetic word or a common erroneous recognition result of the candidate word.
[0092] The error text may be a text containing errors generated by replacing candidate words in the first correct text.
[0093] The combination process may be a process of pairing the first correct text with the erroneous text. For example, the combination process may be a process of creating a data pair including the original correct text and the corresponding erroneous text.
[0094] Optionally, the terminal obtains a first correct text from a corpus; identifies candidate words in the first correct text, which are usually words that are easily misrecognized by a speech recognition system; replaces these candidate words with preset error words to generate an error text corresponding to the first correct text; and pairs the original first correct text with the generated error text to form pseudo-paired data.
[0095] The technical solution provided in this embodiment, by generating pseudo-paired data, is conducive to quickly generating a large amount of training data that simulates real speech recognition errors, thereby helping to enhance the training effect of the speech recognition text error correction model and achieve more accurate speech recognition text error correction.
[0096] In an exemplary embodiment, the method further includes the following contents: obtaining real voice data and a second correct text corresponding to the real voice data; performing voice recognition on the real voice data through a voice recognition model to obtain a voice recognition text of the real voice data; and combining the second correct text and the voice recognition text of the real voice data to obtain real paired data.
[0097] The real voice data may be the original voice signal of the user.
[0098] The second correct text may be an accurate text record corresponding to the real voice data.
[0099] The speech recognition model may be an algorithm or system that converts speech signals into text. For example, the speech recognition model may be a neural network model based on deep learning.
[0100] The speech recognition text of the real speech data may be a text result outputted after the speech recognition model processes the real speech data. For example, the speech recognition text may be a text record containing potential recognition errors.
[0101] The real paired data may be a pairing of correct text and recognition results generated by an actual speech recognition process.
[0102] Optionally, the terminal obtains real voice data and obtains a second correct text corresponding to the real voice data; processes the obtained real voice data through a voice recognition model to generate a voice recognition text of the real voice data; and pairs the proofread second correct text with the voice recognition text of the real voice data to form real paired data.
[0103] The technical solution provided in this embodiment, by generating real paired data, is conducive to improving the actual application effect of the speech recognition text error correction model, enhancing the model's adaptability to various complex scenarios and real errors, and ultimately achieving more accurate speech recognition text error correction.
[0104] In an exemplary embodiment, before performing error information recognition on the original speech recognition text of the current speech data through the target speech recognition text error correction model to obtain the error information recognition result of the original speech recognition text, it also includes the following contents: acquiring the current speech data; performing speech recognition on the current speech data through the speech recognition model to obtain the original speech recognition text of the current speech data.
[0105] Optionally, the terminal obtains current voice data; calls a pre-trained voice recognition model to perform voice recognition on the current voice data, converts the current voice data into text, and outputs original voice recognition text of the current voice data.
[0106] The technical solution provided in this embodiment obtains the current voice data and performs preliminary voice recognition to obtain the original voice recognition text as the input of the target voice recognition text error correction model, which is beneficial to improving the accuracy of the overall voice recognition.
[0107] The following is an application example to illustrate the speech recognition text error correction method based on long-distance context provided by this application. This application example uses the method applied to a terminal as an example.
[0108] This application example is used to detect whether there are typos in a text and correct them. It is generally used in the text post-processing stage. It can also significantly alleviate the problem of inaccurate automatic speech recognition (ASR) in scenarios such as intelligent customer service.
[0109] With the development of end-to-end speech recognition technology, the word error rate of speech recognition has been greatly reduced. It has been widely used in many fields, such as smart customer service, smart home, smart car, etc. Speech recognition can better assist human-computer interaction and make people's lives more convenient. For human-computer interaction systems, speech recognition is part of the interaction system. Speech recognition is to process speech signals, transcribe speech signals into corresponding text, and then process them through natural language processing technology to enable machines to understand human language.
[0110] Although the word error rate of speech recognition has been greatly reduced, for some proper nouns, such as place names and professional vocabulary, speech recognition cannot correctly recognize these proper nouns because it fails to learn the pronunciation features corresponding to these specific words. These proper nouns usually play a key role in the subsequent natural language understanding module. Through the analysis of the recognition results, such proper nouns are usually recognized as words with the same or similar pronunciations. This error may lead to serious deviations in semantic understanding. Therefore, under the bottleneck of speech recognition technology, text error correction has become a very critical technology. The text can be post-processed through natural language processing technology to improve the accuracy of speech recognition.
[0111] The text error correction technology solution mainly adopts the deep neural network method. The models are mainly divided into autoregressive (AR) models and non-autoregressive (NAR) models. While the autoregressive model has good performance, it also has the problem of slow inference speed. Compared with the autoregressive model, the non-autoregressive model can generate target sequences in parallel and improve the decoding speed. The Chinese spelling error correction model based on BERT (deep bidirectional language representation model) occupies a dominant position in the research of non-autoregressive generation paradigm. Unlike spelling errors, most errors in speech recognition are caused by substitution errors of the same or similar pronunciations. Therefore, this application example focuses on proposing a new solution to the substitution error problem of the same or similar pronunciations in speech recognition.
[0112] Based on the pre-trained BERT model, this application example uses the current sentence and context sentence information to correct the recognized text. By using long-distance context semantic information, the semantic information of the current sentence can be understood more accurately, and the errors in the current sentence can be corrected. By correcting the speech recognition text, the accuracy of the speech recognition text can be improved, and the user experience can be improved.
[0113] Overall flow chart reference Figure 2 , including obtaining voice signals, performing voice recognition, obtaining recognition results, performing text error correction, and obtaining recognition results after error correction. This application example can improve voice recognition performance and enhance user experience.
[0114] In this application example, training data for model training is first constructed, including pseudo-paired data constructed using a large amount of text data and real paired data consisting of transcription results from a speech recognition system and real transcription data; secondly, an error correction model based on long-distance context is built. The backbone network of this model uses a pre-trained BERT model. The model input includes the current sentence and context sentences. The model output predicts the probability of the output label at each position of the current sentence, and corrects the current sentence through context semantics; finally, in order to alleviate the inconsistency between the pre-trained BERT model and the current task, a two-stage training method based on pseudo-paired data pre-training and real paired data fine-tuning is designed and implemented to further improve the error correction performance of the model.
[0115] The specific plan is introduced as follows.
[0116] 1. Construction of training data.
[0117] The text error correction method based on neural network requires a large amount of text paired data for training. However, this kind of data is difficult to obtain in practical applications, and the amount of data is relatively small. Therefore, this application example proposes two methods for constructing training data. The following will introduce the two data construction methods in detail.
[0118] (1) Pseudo-paired data construction method.
[0119] In order to alleviate the sparsity of training data, this application example uses a large amount of text data to construct training data. The specific method is as follows:
[0120] Count the probability of substitution errors with the same or similar pronunciation in a real speech recognition system, denoted as P;
[0121] Construct a list of easy-to-error words with the same or similar pronunciations. This can be collected from real speech recognition systems or from open-source word lists from other research works, denoted as Dic.
[0122] The text data is processed, and each group of three sentences is processed. The text of the middle sentence is processed, and the character in the current sentence is selected with probability P. Then the error-prone word list Dic is queried, and the character is randomly replaced with a replaceable candidate word in the word list to form pseudo-paired training data.
[0123] (2) Method for constructing real paired data.
[0124] In order to better correct the errors of the speech recognition system and make the error distribution of the training data consistent with that of the actual speech recognition system, this application example uses real paired data consisting of the transcription results of the speech recognition system and the real transcription data. The specific method is as follows:
[0125] Use the speech recognition system to transcribe the training data and keep the transcription result, recorded as R;
[0126] The transcription result R is processed, and the sentences of each recording are sorted. Three sentences are grouped together, and the transcription result of the current sentence is aligned with the real transcription result to form real paired data.
[0127] 2. Error correction model based on long-distance context.
[0128] This application example uses a long-distance context-based error correction model (a speech recognition text error correction model to be trained). The backbone network of this model uses a pre-trained BERT model. The model input includes the current sentence and the context sentence. The model output predicts the probability of the output label at each position of the current sentence, and corrects the current sentence through context semantics. The model structure is referenced in Figure 3 , including a tokenization module, an embedding module, a long-distance context module, residual information, an encoder and a classifier. By inputting the speech recognition result (including the previous context, the sentence before correction and the following context), the corrected sentence output by the model can be obtained.
[0129] The model inputs a set of training data consisting of three sentences each, and the output is the predicted probability of the output character of the current sentence. The model is implemented based on the pre-trained BERT model. Before the BERT network, a long-distance context module is added. This module is mainly implemented based on the attention mechanism, with the input features corresponding to the current sentence as the query (Q), and the input features corresponding to the context and the current sentence as the key (K) and value (V). Its feature dimension is d k , by scaling the dot product attention function, the global attention output of the current sentence can be calculated as follows:
[0130] .
[0131] Among them, Attention represents the attention function, which is used to calculate the degree of association between different positions in the input sequence; softmax represents the normalized exponential function, which is used to convert the input into a probability distribution; T represents the matrix transpose operation.
[0132] After a linear layer and a non-activation function, the module output is sent to the BERT network to predict the output of the current sentence.
[0133] 3. Training methods.
[0134] The training method of the pre-trained BERT model is to predict the output of the masked position and the context sentence relationship, while the method used in this application example is not dependent on the masking mechanism. It directly predicts the characters at each output position through the obtained context information. Therefore, in order to alleviate the inconsistency problem with the pre-trained BERT training method, this application example proposes a two-stage training method. Based on the pre-trained BERT model, the model is pre-trained and fine-tuned using pseudo-paired data and real paired data.
[0135] For example, the process of this application example is as follows:
[0136] 1. Training data construction:
[0137] 1.1 Use large-scale text data to construct pseudo-paired data;
[0138] 1.2 Use the transcription results of the speech recognition system and the real transcription to construct real paired data;
[0139] 2. Build an error correction model based on long-distance context;
[0140] 3. Training:
[0141] 3.1 Use pseudo-paired data to pre-train the error correction model;
[0142] 3.2 Fine-tune the error correction model using real paired data;
[0143] 4. Application:
[0144] 4.1 Based on the speech recognition transcription results, the error correction model is used to correct the recognition results;
[0145] 4.2 The final output is the character with the highest probability at each position to form the output sequence as the final result of the model.
[0146] The technical solution provided in this application example realizes the correction of speech recognition erroneous text based on long-distance context. It designs an error correction network based on the pre-trained BERT model that can utilize long-distance context. It uses large-scale text data to construct pseudo-paired data and uses the transcription results of the speech recognition system to construct real paired data to pre-train and fine-tune the error correction model, which can improve the effect of the speech recognition system and improve the efficiency and accuracy of speech recognition text error correction.
[0147] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0148] Based on the same inventive concept, the embodiment of the present application also provides a long-distance context-based speech recognition text correction device for implementing the long-distance context-based speech recognition text correction method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more embodiments of the long-distance context-based speech recognition text correction device provided below can refer to the above limitations on the long-distance context-based speech recognition text correction method, which will not be repeated here.
[0149] In an exemplary embodiment, Figure 4 As shown, a speech recognition text error correction device based on long-distance context is provided. The speech recognition text error correction device based on long-distance context 400 may include:
[0150] The data acquisition module 401 is used to acquire training data and construct a speech recognition text error correction model to be trained; the training data includes pseudo paired data and real paired data;
[0151] A model training module 402 is used to train the speech recognition text error correction model to be trained using the training data to obtain a target speech recognition text error correction model;
[0152] The text recognition module 403 is used to perform error information recognition on the original speech recognition text of the current speech data through the target speech recognition text error correction model to obtain the error information recognition result of the original speech recognition text;
[0153] The text processing module 404 is used to perform error correction processing on the original speech recognition text according to the error information recognition result to obtain the target speech recognition text of the current speech data.
[0154] In an exemplary embodiment, the model training module 402 is also used to use pseudo paired data to perform model training processing on the speech recognition text error correction model to be trained, so as to obtain the speech recognition text error correction model to be updated; and use real paired data to perform model update processing on the speech recognition text error correction model to be updated, so as to obtain the target speech recognition text error correction model.
[0155] In an exemplary embodiment, the text recognition module 403 is also used to identify error information for each text segment in the original speech recognition text through a target speech recognition text error correction model based on feature information of the text segment and feature information of context sentence information corresponding to the text segment, so as to obtain an error information identification sub-result of the text segment; and determine the error information identification result based on the error information identification sub-results obtained for each text segment.
[0156] In an exemplary embodiment, the device 400 also includes: a text acquisition module, used to obtain a first correct text; replace the candidate words in the first correct text with the incorrect words corresponding to the candidate words, to obtain incorrect text corresponding to the first correct text; and combine the first correct text and the incorrect text to obtain pseudo-paired data.
[0157] In an exemplary embodiment, the device 400 also includes: a text combination module, which is used to obtain real voice data and a second correct text corresponding to the real voice data; perform voice recognition on the real voice data through a voice recognition model to obtain a voice recognition text of the real voice data; and combine the second correct text and the voice recognition text of the real voice data to obtain real paired data.
[0158] In an exemplary embodiment, the device 400 further includes: a data recognition module, configured to obtain current voice data; and perform voice recognition on the current voice data through a voice recognition model to obtain an original voice recognition text of the current voice data.
[0159] Each module in the above-mentioned speech recognition text error correction device based on long-distance context can be implemented in whole or in part by software, hardware and their combination. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0160] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. Figure 5 As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a speech recognition text error correction method based on a long-distance context is implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0161] Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0162] In an exemplary embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.
[0163] In an exemplary embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0164] In an exemplary embodiment, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in the above method embodiments are implemented.
[0165] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0166] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0167] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A speech recognition text error correction method based on long-distance context, It is characterized in that The method comprises: Acquire training data and construct a speech recognition text error correction model to be trained; the training data includes pseudo paired data and real paired data; Using the training data to train the speech recognition text error correction model to be trained to obtain a target speech recognition text error correction model; Using the target speech recognition text error correction model, error information recognition is performed on the original speech recognition text of the current speech data to obtain an error information recognition result of the original speech recognition text; According to the error information recognition result, error correction processing is performed on the original speech recognition text to obtain the target speech recognition text of the current speech data.
2. The method according to claim 1, It is characterized in that The method of training the speech recognition text error correction model to be trained by using the training data to obtain a target speech recognition text error correction model includes: Using the pseudo paired data to perform model training processing on the speech recognition text error correction model to be trained, to obtain the speech recognition text error correction model to be updated; The real paired data is used to perform model update processing on the speech recognition text error correction model to be updated to obtain the target speech recognition text error correction model.
3. The method according to claim 1, It is characterized in that The method of performing error information recognition on the original speech recognition text of the current speech data by using the target speech recognition text error correction model to obtain an error information recognition result of the original speech recognition text includes: For each text segment in the original speech recognition text, the target speech recognition text error correction model is used to identify error information of the text segment based on feature information of the text segment and feature information of context sentence information corresponding to the text segment, so as to obtain an error information identification sub-result of the text segment; The error information recognition result is determined according to the obtained error information recognition sub-results of each text segment.
4. The method according to claim 1, It is characterized in that The method further comprises: Get the first correct text; Replacing the candidate word in the first correct text with the incorrect word corresponding to the candidate word to obtain the incorrect text corresponding to the first correct text; The first correct text and the erroneous text are combined to obtain the pseudo paired data.
5. The method according to claim 1, It is characterized in that The method further comprises: Acquire real voice data and a second correct text corresponding to the real voice data; Performing speech recognition on the real speech data through a speech recognition model to obtain a speech recognition text of the real speech data; The second correct text and the speech recognition text of the real speech data are combined to obtain the real paired data.
6. The method according to claim 1, It is characterized in that Before performing error information recognition on the original speech recognition text of the current speech data by using the target speech recognition text error correction model to obtain the error information recognition result of the original speech recognition text, the method further includes: Acquire the current voice data; The current voice data is subjected to voice recognition through a voice recognition model to obtain an original voice recognition text of the current voice data.
7. A speech recognition text error correction device based on long-distance context, It is characterized in that The device comprises: A data acquisition module, used to acquire training data and construct a speech recognition text error correction model to be trained; the training data includes pseudo paired data and real paired data; A model training module, used to train the speech recognition text error correction model to be trained using the training data to obtain a target speech recognition text error correction model; A text recognition module, used to perform error information recognition on the original speech recognition text of the current speech data through the target speech recognition text error correction model to obtain an error information recognition result of the original speech recognition text; The text processing module is used to perform error correction processing on the original speech recognition text according to the error information recognition result to obtain the target speech recognition text of the current speech data.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program. It is characterized in that When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product comprising a computer program, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Text error correction method, device and system
CN111523305A
Data processing method and device and computer storage medium
CN112784611A
Text error correction method and text error correction device
CN113947072A
ASR text error correction method, model and device, electronic equipment and storage medium
CN115809641A
Speech recognition text revision method and device, computer equipment and storage medium
CN116129906A
