Speech recognition text error correction method, device, terminal equipment and storage medium
By building weighted vectors and pre-trained Bert models to train error correction models, the problems of insufficient recognition accuracy and poor error correction effects in automatic speech recognition are solved, and more efficient error correction effects are achieved.
Patent Information
- Application Number
- CN202411024763.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-29
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2044-07-29
AI Technical Summary
The existing automatic speech recognition technology has insufficient recognition accuracy during the recognition process, especially under the influence of complex language environments and noise, and the existing error correction methods are not effective.
By constructing weighted vectors and using the pre-trained Bert model for error correction, combining the recognition results of the speech recognition model and the annotated text data for training, an error correction model is generated to improve error correction accuracy.
The error correction rate of the error correction model is improved, the error correction rate is reduced, the error correction results are more in line with the practical application scenarios, and the prior information utilization of the speech recognition model is enhanced.
Smart Images

Figure CN118692470B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of speech and text error correction, and in particular to a speech recognition text error correction method, apparatus, terminal device and storage medium. Background Art
[0002] Automatic speech recognition technology uses computer programs to convert natural human speech into text, which can then be processed further using other programs. As a new input method for human-computer interaction, automatic speech recognition replaces conventional input methods like keyboards and mice, freeing up human hands and gaining increasing application.
[0003] With the application of technologies such as deep neural networks, the accuracy of automatic speech recognition is increasing. However, due to the complexity of language and the influence of the sound propagation environment, some errors may still occur in the recognition results. Generally, the recognition results are corrected through text post-processing. Summary of the Invention
[0004] In view of this, the embodiments of the present application provide a speech recognition text error correction method, apparatus, terminal device and storage medium, which can effectively solve problems such as rapid error correction.
[0005] In a first aspect, an embodiment of the present application provides a method for correcting speech recognition text errors, comprising:
[0006] Obtaining a first recognition result of the deployed speech recognition model for the input speech data, and calculating a weighted vector of the first recognition result;
[0007] Inputting the weighted vector into an error correction model and outputting a first character recognition probability distribution matrix after error correction; the error correction model is trained using the recognition results of a pre-trained speech recognition model as training data;
[0008] An error correction result of the speech data is obtained according to the first character recognition probability distribution matrix.
[0009] In one embodiment, calculating the weighted vector of the first recognition result includes:
[0010] Obtaining a second character recognition probability distribution matrix obtained by the speech recognition model from recognizing the speech data; wherein the rows of the second character recognition probability distribution matrix are used to describe character IDs, the columns are used to describe time, and each element of the second character recognition probability distribution matrix is used to record characters and corresponding recognition probabilities;
[0011] The sum of the product of the character ID and the corresponding probability of each element in each column is calculated to obtain the weighted value of each column. The weighted values of each column form a weighted vector in chronological order.
[0012] In one embodiment, the error correction model training method includes:
[0013] After dynamically enhancing the speech data with the annotated text, the data is input into the pre-trained speech recognition model to obtain a second recognition result;
[0014] Calculating a weighted vector for each of the second recognition results, and determining a correct text for each of the second recognition results;
[0015] The correct text and each weighted vector are used as training data to train the pre-trained Bert model to obtain a speech error correction model.
[0016] In one embodiment, dynamically enhancing the speech data with the annotated text includes:
[0017] Adding multiple or single noises to the speech data with the annotated text to change the speech data with the annotated text.
[0018] In one embodiment, the correct text and each weighted vector are used as training data to train the pre-trained Bert model to obtain a speech error correction model, including:
[0019] Input the training data as input layer data into the pre-trained Bert model to obtain output data;
[0020] Using the correct text as output layer data of the pre-trained BERT model to calculate the cross entropy loss between the correct text and the output data;
[0021] The pre-trained Bert model is adjusted according to the cross entropy loss until the cross entropy loss is within a preset loss range, or the number of iterations of the Bert model reaches a preset number, then training is stopped to obtain a speech error correction model.
[0022] In one embodiment, after inputting the training data as input layer data into the pre-trained BERT model, the method further includes:
[0023] The second recognition result is input into the network as a residual and input into the Bert model to locate the position of the error information in the second recognition result in the weighted vector.
[0024] In one embodiment, the rows of the first character recognition probability distribution matrix are used to describe the ID of the characters, the columns are used to describe the time, and each element of the first character recognition probability distribution matrix is used to record the characters and the corresponding recognition probability;
[0025] Obtaining an error correction result according to the first character recognition probability distribution matrix includes:
[0026] Sort the elements in each column of the first character recognition probability distribution matrix in descending order of probability to obtain the character with the highest probability in each column;
[0027] In chronological order, the words with the highest probability in each column are arranged to form a text to obtain the error correction result.
[0028] In a second aspect, the present application further provides a speech recognition text error correction device, comprising:
[0029] a weighted calculation module, configured to obtain a first recognition result of the input speech data recognized by the deployed speech recognition model, and calculate a weighted vector of the first recognition result;
[0030] A probability analysis module, configured to input the weighted vector into an error correction model and output a first character recognition probability distribution matrix after error correction; the error correction model is trained using the recognition results of a pre-trained speech recognition model as training data;
[0031] An error correction module is used to obtain an error correction result of the speech data according to the first character recognition probability distribution matrix.
[0032] In a third aspect, the present application also provides a terminal device, which includes a processor and a memory, wherein the memory stores a computer program, and the processor is used to execute the computer program to implement the speech recognition text error correction method.
[0033] In a fourth aspect, the present application also provides a computer-readable storage medium storing a computer program, which, when executed on a processor, implements the speech recognition text error correction method.
[0034] The embodiments of the present application have the following beneficial effects:
[0035] This application utilizes a speech recognition model to construct audio data that simulates a real-world environment, and then generates recognition results that are more consistent with actual application scenarios. The error correction model, as a post-processing step of the speech recognition model, better integrates with the speech recognition model output and better utilizes the prior information of the speech recognition model, improving the error correction rate of the error correction model while reducing the false correction rate. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without creative work.
[0037] Figure 1 A flow chart of a speech recognition text error correction method according to an embodiment of the present application is shown;
[0038] Figure 2 A flowchart of a speech recognition text error correction model training method according to an embodiment of the present application is shown;
[0039] Figure 3 A schematic structural diagram of a speech recognition text error correction device according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0040] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments.
[0041] The components of the embodiments of the present application generally described and illustrated in the drawings herein may be arranged and designed in a variety of different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the claimed application, but rather merely represents selected embodiments of the present application. All other embodiments obtained by those skilled in the art based on the embodiments of the present application without creative effort are within the scope of protection of the present application.
[0042] Hereinafter, the terms "including", "having" and their cognates used in various embodiments of the present application are intended only to indicate specific features, numbers, steps, operations, elements, components or combinations of the aforementioned items, and should not be understood as excluding the existence of one or more other features, numbers, steps, operations, elements, components or combinations of the aforementioned items or adding the possibility of one or more features, numbers, steps, operations, elements, components or combinations of the aforementioned items. In addition, the terms "first", "second", "third" and the like are only used to distinguish descriptions and should not be understood as indicating or implying relative importance.
[0043] Unless otherwise defined, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by those skilled in the art to which the various embodiments of the present application belong. The terms (such as those defined in generally used dictionaries) will be interpreted as having the same meaning as in the context of the relevant technical field and will not be interpreted as having an idealized meaning or an overly formal meaning unless clearly defined in the various embodiments of the present application.
[0044] This application processes the data recognized by a practical speech recognition model, calculates the corresponding weighted vector, and performs error correction operations on the output of the speech recognition model through the error correction model trained by the weighted vector, so that the data used for training and the data during actual error correction are closer, and uses the weighted vector as training data to train the error correction model, and performs error correction operations through the error correction model.
[0045] Next, the technical solution of this application is described with specific embodiments.
[0046] Example 1
[0047] Figure 1 A flow chart of a method for correcting speech recognition text errors according to an embodiment of the present application is shown. Exemplarily, the method for correcting speech recognition text errors includes the following steps:
[0048] Step S100: Obtain a first recognition result of the deployed speech recognition model for the input speech data, and calculate a weighted vector of the first recognition result.
[0049] The speech recognition model performs recognition based on the received speech data and then outputs a recognition model of the corresponding text, wherein the first recognition result is the text corresponding to the speech data.
[0050] Generally speaking, the speech recognition model needs to be trained based on a text library. Then, during recognition, the recognition probability of each word at each moment will be obtained. Based on this probability, a recognition result can be obtained.
[0051] For example, if the voice message "Nice to meet you, please take care of me" is received, a text probability distribution matrix will be generated to represent the recognition results of the model's speech recognition at each moment. The table is as follows:
[0052] Table 1
[0053]
[0054] The meaning in Table 1 is that for the character "的" with ID = 1, its probability at the first moment is 0.017, at the second moment is 0.06, and at the third moment is 0.048. Among them, the probability of "的" at the first moment is 0.017, the probability of "一" is 0.01, and the probability of "国" is 0.05. Table 1 only exemplarily shows 3 rows of data. In reality, at each moment, the probabilities of each character will be recognized. For example, if the speech recognition model is trained with a database of 7000 characters, then at each moment, the probabilities of 7000 characters will be recognized, thereby obtaining the probability distribution of 7000 characters.
[0055] By performing a sorting operation on Table 1 above, arranging the characters with higher probabilities to the upper row, the several characters with the highest recognition probabilities can be obtained, and thus the recognition result can be obtained, as specifically shown in Table 2 below.
[0056] Table 2
[0057]
[0058] Among them, the rows of this table are characters and the corresponding probabilities, and the columns represent time. Therefore, the position of the first row and the first column of this table indicates that the recognition probability of the initial character with ID = 15 at the first moment is 0.7. Among them, in front of each character is the ID of each character. This ID can be shown in the table or not shown. This ID is set by the database for training this speech recognition model. In this embodiment, for the convenience of understanding, it is示范性标注 (should be a specific term in Chinese, which is not clear here. Maybe it's a misspelling or a specific jargon. If it's a misspelling, it needs to be corrected according to the correct content).
[0059] The speech recognition model can sort the recognized probabilities to find the characters with the highest probabilities at each moment, and use the characters with the highest probabilities as the recognition results, thereby obtaining the final recognition result.
[0060] Based on the recognition result, the weighted vector of this recognition result can be calculated.
[0061] This weighted vector is calculated as the sum of the products of the ID of each character and the corresponding probability in each column, obtaining the weighted value of each column. The weighted values of each column are arranged in chronological order to form a weighted vector.
[0062] Taking the above table as an example, let the probability of the i-th row and the j-th column be denoted as P i,j , and the character ID of the i-th row and the j-th column be denoted as e i,j , and so on. Calculate the sum of the products of the character ID and the corresponding probability in each column. Then, denote the product sum of the j-th column as etj, and its calculation expression is.
[0063]
[0064] The above ID needs to be mapped to a vector value first, and then the vector value is used for calculation. For example, the ID is mapped through the embedding mapping model to obtain a 512-dimensional vector. i,j It is a 512-dimensional vector after mapping.
[0065] It is understandable that the length of the vector will be determined by the number of recognized words. For example, for the sentence "Nice to meet you, please take care of me," the calculated vector is a 512-dimensional weighted vector with a length of 8. This weighted vector will be the input data for the error correction model.
[0066] The IDs of the above characters are positive integers such as 1, 2, and 3. Each ID is associated with a character. Therefore, a numerical value corresponds to a character, and the vector value obtained by ID mapping also has this unique correspondence. The weighted value calculated at each moment and the character corresponding to the actual pronunciation are related features. A weighted vector represents the feature of a sentence, and the error correction model can perform error correction operations based on this feature.
[0067] Step S200: input the weighted vector into an error correction model, and output a first character recognition probability distribution matrix after error correction.
[0068] The error correction model of this embodiment is an error correction model obtained by training based on a pre-trained Bert model. The model takes the aforementioned weighted vector as input and, after analysis, can directly output the first text recognition probability distribution matrix after error correction processing.
[0069] The first character recognition probability distribution matrix has a similar structure to Table 1 shown in step S100 and will not be described in detail here.
[0070] Step S300: Obtain an error correction result of the speech data according to the first text recognition probability distribution matrix.
[0071] That is, first, sort the elements in each column of the first character recognition probability distribution matrix from highest to lowest probability to obtain the character with the highest probability in each column. The character with the highest probability in each column is the character that has been re-recognized after error correction by the error correction model. The character with the highest probability can be considered the recognition result after error correction.
[0072] The text with the highest probability in each column is arranged in chronological order to form a text, and the correction result is obtained. If the original recognition result is correct, the correction result here will be the same as the original recognition result. If the original recognition result is wrong, the correction result will show the correct result.
[0073] It should be noted that the weighted vector input by the error correction model of this embodiment is derived from the recognition result of the speech recognition model. The recognition result may be wrong or correct. For the error correction model, it needs to correct the wrong one and cannot correct the correct one. The weighted vector input by the error correction model of this embodiment is derived from the recognition result of the speech recognition model, so that its training data is more in line with the actual scenario, so that its training effect is better, and the prior information of the speech recognition model is better utilized, which improves the error correction rate of the error correction model and reduces the false correction rate.
[0074] Example 2
[0075] This embodiment provides a method for training an error correction model, where the error correction model is trained by using a pre-trained speech recognition model to recognize annotated speech data and obtain recognition results.
[0076] Specifically, if Figure 2 As shown, the training method of the error correction model of this embodiment includes:
[0077] In step S400 , the speech data with the annotated text is dynamically enhanced and then input into a pre-trained speech recognition model to obtain a second recognition result.
[0078] The training data in this embodiment is obtained by dynamically enhancing the speech data with annotated text, inputting the data into a pre-trained speech recognition model, and using the obtained recognition results as the training data.
[0079] Dynamic enhancement refers to adding interference to speech data by applying one or more noises, etc., so that the speech recognition model can more easily identify errors, thereby obtaining speech data that is easy for the speech recognition model to recognize erroneous results. This data can be used as input to train the error correction model.
[0080] The annotated text is a label of the voice data. In this embodiment, the annotated text is the true and correct text expressed by the voice data.
[0081] By building a database of multiple voice data with annotated text, multiple second recognition results are obtained. The second recognition results are the data used for training in this embodiment.
[0082] The pre-trained speech recognition model in this embodiment is a model that has been trained and has speech recognition function. The model and the speech recognition model in the aforementioned steps can be models of the same type or models that are not completely the same.
[0083] Step S500: Calculate the weighted vector of each second recognition result, and determine the correct text of each second recognition result.
[0084] The method for calculating the weighted vector of the second recognition result is the same as that in the aforementioned step S100, which will not be elaborated here. In addition, the correct text is the annotated text of the voice data of each second recognition result, and these two are corresponding data and are both used as training data.
[0085] Among them, determining the correct text of each second recognition result is to use it as a comparison for calculating the cross-entropy loss to adjust the parameters of the Bert model. Therefore, the correct text is actually the ID corresponding to each character, and this ID is determined by the character database. That is, the correct text is a string of numbers. For example, the IDs of the two characters "hello" in the character database are 23 and 45, then the correct text is "23 45".
[0086] Step S600: Use each weighted vector as training data, input it into the pre-trained Bert model, and combine with the correct text to train a voice error correction model.
[0087] In this embodiment, the pre-trained Bert model is a model that is first pre-trained on a large-scale unlabeled text data to learn language knowledge. Through pre-training, it helps the model learn to understand the relationships between words and sentences and obtain basic language recognition capabilities.
[0088] How to pre-train in the pre-training stage is not the focus of this embodiment. This embodiment mainly focuses on the fine-tuning stage, and uses the training data obtained above to train the pre-trained Bert model into an error correction model.
[0089] The weighted vector will be used as the input layer of the Bert model and input into the Bert model. Then the Bert model will obtain the corresponding output data. Here, the output data is the character recognition probability distribution matrix corresponding to the weighted vector.
[0090] And the above correct text will also be used as the output layer data of the Bert model to calculate the cross-entropy loss with the output data. According to the cross-entropy loss, adjust the parameters of the Bert model, and then perform the next round of iterative operations. Repeat several rounds to train the error correction model.
[0091] It can be understood that since the correct text is a string of numbers composed of IDs, it can be used to calculate the cross-entropy loss with the output data, thereby calculating the cross-entropy loss.
[0092] In an optional embodiment, the second recognition result can also be used as a residual input network to locate the position of the error information in the second recognition result in the weighted vector. It can be understood that for the model, the output data is the probability distribution of text, and the second recognition result is the text data of the training data. It corresponds to the input weighted vector itself. Combined with the correct text of the output layer, the position of the wrong weighted value on the input weighted vector can be located by comparison, thereby achieving the effect of error positioning. Obviously, this positioning can increase the training efficiency and the accuracy of the trained model.
[0093] It should be noted that the second recognition result may be a correct result, and because the output layer data is correct text, it can also prevent the correction model from modifying the correct text into an incorrect one.
[0094] According to the cross entropy loss, the BERT model is adjusted until the cross entropy loss is within a preset ideal range, or the number of iterations of the BERT model reaches a preset number, then the training is completed and a speech error correction model is obtained.
[0095] The smaller the cross-entropy loss, the better the error correction results. The larger the cross-entropy loss, the further the error correction results deviate from the true text. Therefore, a range can be set. When the cross-entropy loss value is within the preset range, the training is considered successful. At the same time, an iteration limit can also be set. If the number of model iterations reaches the iteration limit during training, the training can be stopped to avoid falling into an infinite loop.
[0096] The error correction model in this embodiment uses the speech recognition model to construct audio data that simulates a real-world environment before generating recognition results, which are more consistent with actual application scenarios. As a post-processing step for the speech recognition model, the error correction model is better integrated with the speech recognition model output and better utilizes the prior information of the speech recognition model, thereby improving the error correction rate of the error correction model and reducing the false correction rate.
[0097] Example 3
[0098] Figure 3 The present invention shows a speech recognition text error correction device according to an embodiment of the present application, comprising:
[0099] A weighted calculation module 10 is configured to obtain a first recognition result of the input speech data by the deployed speech recognition model, and calculate a weighted vector of the first recognition result;
[0100] The probability analysis module 20 is used to input the weighted vector into the error correction model and output the first character recognition probability distribution matrix after error correction; the error correction model is trained using the recognition results of the pre-trained speech recognition model as training data;
[0101] The error correction module 30 is used to obtain an error correction result of the speech data according to the first character recognition probability distribution matrix.
[0102] The present application also provides a terminal device, which includes a processor and a memory, wherein the memory stores a computer program, and the processor is used to execute the computer program to implement the speech recognition text error correction method.
[0103] The present application also provides a computer-readable storage medium storing a computer program, which, when executed on a processor, implements the speech recognition text error correction method.
[0104] It can be understood that the device of this embodiment corresponds to the speech recognition text error correction method of the above embodiment, and the optional items in the above embodiment are also applicable to this embodiment, so they will not be repeated here.
[0105] The present application also provides a terminal device. Exemplarily, the terminal device includes a processor and a memory, wherein the memory stores a computer program, and the processor runs the computer program to enable the terminal device to execute the functions of each module in the above-mentioned speech recognition text correction method or the above-mentioned speech recognition text correction device.
[0106] Among them, the processor can be an integrated circuit chip with signal processing capabilities. The processor can be a general-purpose processor, including a central processing unit (CPU), a graphics processing unit (GPU) and a network processor (NP), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or at least one of other programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc., which can implement or execute the disclosed methods, steps and logic block diagrams in the embodiments of the present application.
[0107] The memory may be, but is not limited to, a random access memory (RAM), a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), etc. The memory is used to store a computer program, and the processor may execute the computer program accordingly after receiving an execution instruction.
[0108] The present application also provides a computer-readable storage medium for storing the computer program used in the terminal device. For example, the computer-readable storage medium may include, but is not limited to, various media capable of storing program code, such as a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0109] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and structure diagrams in the accompanying drawings show the possible architectures, functions and operations of the devices, methods and computer program products according to the multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and the module, program segment or a part of the code contains one or more executable instructions for implementing the specified logical functions. It should also be noted that in an alternative implementation, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the structure diagram and / or flowchart, and the combination of boxes in the structure diagram and / or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or action, or can be implemented using a combination of dedicated hardware and computer instructions.
[0110] In addition, the functional modules or units in the various embodiments of the present application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0111] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a computer device (which can be a smart phone, personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application.
[0112] The above is only a specific implementation method of the present application, but the scope of protection of the present application is not limited thereto. Any technician familiar with this technical field can easily think of changes or replacements within the technical scope disclosed in this application, which should be covered by the scope of protection of the present application.
Claims
1. A speech recognition text error correction method, characterized in that: include: Obtaining a first recognition result of the deployed speech recognition model for the input speech data, and calculating a weighted vector of the first recognition result; Inputting the weighted vector into an error correction model and outputting a first character recognition probability distribution matrix after error correction; The error correction model is trained using the recognition results of the pre-trained speech recognition model as training data; Obtaining an error correction result for the speech data according to the first character recognition probability distribution matrix; The calculating the weighted vector of the first recognition result includes: Obtaining a second character recognition probability distribution matrix obtained by the speech recognition model from recognizing the speech data; wherein the rows of the second character recognition probability distribution matrix are used to describe character IDs, the columns are used to describe time, and each element of the second character recognition probability distribution matrix is used to record characters and corresponding recognition probabilities; The sum of the product of the character ID and the corresponding probability of each element in each column is calculated to obtain the weighted value of each column. The weighted values of each column form a weighted vector in chronological order.
2. The speech recognition text error correction method according to claim 1, characterized in that: The training method of the error correction model includes: After dynamically enhancing the speech data with the annotated text, the data is input into the pre-trained speech recognition model to obtain a second recognition result; Calculating a weighted vector for each of the second recognition results, and determining a correct text for each of the second recognition results; The correct text and each weighted vector are used as training data to train the pre-trained Bert model to obtain a speech error correction model.
3. The speech recognition text error correction method according to claim 2, characterized in that: The method of dynamically enhancing the speech data with the annotated text includes: Adding multiple or single noises to the speech data with the annotated text to change the speech data with the annotated text.
4. The speech recognition text error correction method according to claim 2, characterized in that: The correct text and each weighted vector are used as training data to train the pre-trained Bert model to obtain a speech error correction model, including: Input the training data as input layer data into the pre-trained Bert model to obtain output data; Using the correct text as output layer data of the pre-trained BERT model to calculate the cross entropy loss between the correct text and the output data; The pre-trained Bert model is adjusted according to the cross entropy loss until the cross entropy loss is within a preset loss range, or the number of iterations of the Bert model reaches a preset number, then training is stopped to obtain a speech error correction model.
5. The speech recognition text error correction method according to claim 4, characterized in that: After the training data is input as input layer data into the pre-trained Bert model, the following steps are also included: The second recognition result is input into the network as a residual and input into the Bert model to locate the position of the error information in the second recognition result in the weighted vector.
6. The speech recognition text error correction method according to claim 1, characterized in that: The rows of the first character recognition probability distribution matrix are used to describe the character ID, the columns are used to describe the time, and each element of the first character recognition probability distribution matrix is used to record the character and the corresponding recognition probability; Obtaining an error correction result according to the first character recognition probability distribution matrix includes: Sort the elements in each column of the first character recognition probability distribution matrix in descending order of probability to obtain the character with the highest probability in each column; In chronological order, the words with the highest probability in each column are arranged to form a text to obtain the error correction result.
7. A speech recognition text error correction device, characterized in that: include: a weighted calculation module, configured to obtain a first recognition result of the input speech data recognized by the deployed speech recognition model, and calculate a weighted vector of the first recognition result; A probability analysis module, configured to input the weighted vector into an error correction model and output a first character recognition probability distribution matrix after error correction; The error correction model is trained using the recognition results of the pre-trained speech recognition model as training data; an error correction module, configured to obtain an error correction result of the speech data according to the first character recognition probability distribution matrix; The calculating the weighted vector of the first recognition result includes: Obtaining a second character recognition probability distribution matrix obtained by the speech recognition model from recognizing the speech data; wherein the rows of the second character recognition probability distribution matrix are used to describe character IDs, the columns are used to describe time, and each element of the second character recognition probability distribution matrix is used to record characters and corresponding recognition probabilities; The sum of the product of the character ID and the corresponding probability of each element in each column is calculated to obtain the weighted value of each column. The weighted values of each column form a weighted vector in chronological order.
8. A terminal device, characterized in that: The terminal device includes a processor and a memory, the memory stores a computer program, and the processor is configured to execute the computer program to implement the speech recognition text error correction method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that The device stores a computer program, which, when executed on a processor, implements the speech recognition text error correction method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Chinese speech recognition error correction method and device and electronic equipment
CN114822519A