Speech recognition error correction model training method, electronic equipment, medium and program product

By preset marking and loss function optimization of the training text of the speech recognition error correction model, the problem of low training efficiency of speech recognition error correction model is solved, and more efficient error correction accuracy is achieved.

CN119229850APending Publication Date: 2024-12-31WEBANK (CHINA)
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411342687.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-25
Publication Date
2024-12-31

AI Technical Summary

Technical Problem

The existing speech recognition error correction model is inefficient during training and cannot effectively correct errors caused by different homophones or pronouns, resulting in wasted computing resources and time.

Method used

Through the preset large language model, mark text types that cannot be corrected by context, generate tagged training text and real text, ignore tagged text in the loss function calculation, and focus on correcting correctable errors and improving the model Training efficiency.

Benefits of technology

The training efficiency and error correction accuracy of the speech recognition error correction model are improved, and the computing resources and time waste for uncorrected errors are avoided.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119229850A_ABST
    Figure CN119229850A_ABST
Patent Text Reader

Abstract

The invention discloses a speech recognition error correction model training method, an electronic device, a medium and a program product, and relates to the technical field of speech recognition, and the speech recognition error correction model training method comprises the steps: obtaining a first training text, respectively inserting marks into character positions of a preset type of text in the first training text and the corresponding first real text through a preset large language model to obtain a second training text and a second real text; inputting the second training text into the initial speech recognition error correction model to obtain a prediction error correction text; a loss function value is calculated according to the prediction error correction text and the second real text, and the marked text is ignored in the calculation process of the loss function value; and performing iterative training on the initial speech recognition error correction model based on the second training text and the loss function value to obtain a target speech recognition error correction model. According to the technical scheme, the situation that the speech recognition error correction model wastes computing resources and time on errors which cannot be corrected is avoided, and the training efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of speech recognition technology, and in particular to a speech recognition error correction model training method, electronic equipment, computer-readable storage medium and computer program product. Background Art

[0002] Since Automatic Speech Recognition (ASR) technology may generate errors in the process of converting speech to text during speech recognition, the need for speech recognition error correction arises. Some of the speech recognition errors are caused by homophones (such as names of people, places, companies, etc.) or pronouns (such as she, it, he, etc.). These errors are usually difficult to correct without context.

[0003] At present, when training large language models for speech error correction, these uncorrectable errors are usually included in the training data, and the model cannot effectively learn and correct such errors. However, during the model training process, these errors are counted as model losses and iterative training is performed, wasting unnecessary computing resources and time, affecting the efficiency of model training.

[0004] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention

[0005] The main purpose of this application is to provide a speech recognition error correction model training method, electronic device, computer-readable storage medium and computer program product, aiming to solve the technical problem of low training efficiency of current speech recognition error correction models.

[0006] To achieve the above objectives, the present application proposes a speech recognition error correction model training method, the speech recognition error correction model training method comprising:

[0007] Obtain a first training text, and insert marks at character positions of a preset type of text in the first training text and a corresponding first real text respectively through a preset large language model to obtain a second training text and a second real text, wherein the preset type is a text type that cannot be corrected by context in speech recognition error correction;

[0008] Inputting the second training text into an initial speech recognition error correction model to obtain a predicted error correction text;

[0009] Calculating a loss function value according to the predicted error-corrected text and the second true text, wherein in the process of calculating the loss function value, the marked text of the preset type is ignored;

[0010] The initial speech recognition error correction model is iteratively trained based on the second training text and the loss function value to obtain a target speech recognition error correction model.

[0011] In one embodiment, the step of inserting marks at character positions of preset type texts in the first training text and the corresponding first real text respectively by using a preset large language model to obtain a second training text and a second real text comprises:

[0012] Inputting the first training text and the corresponding prompt word into the large language model, and outputting the second training text through the large language model;

[0013] Inputting the first real text and the corresponding prompt word into the large language model, and outputting a second real text through the large language model;

[0014] The prompt word is used to instruct the large language model to insert a mark at a character position of the preset type of text.

[0015] In one embodiment, the step of outputting the second training text through the large language model includes:

[0016] Identify the character positions of the preset type of text in the first training text by using the large language model;

[0017] The large language model is used to insert preset marks before and after the characters of the preset type of text to obtain and output a second training text.

[0018] In one embodiment, the step of calculating the loss function value according to the predicted error-corrected text and the second true text comprises:

[0019] Inputting the predicted error-corrected text and the second true text into a preset loss function to determine corresponding loss function values;

[0020] The loss function at least includes a marking matrix, which is used to characterize the positions of marked texts of preset types and to ignore the influence of marked texts of preset types when calculating the loss function value.

[0021] In one embodiment, before the step of inputting the predicted error-corrected text and the second true text into a preset loss function to determine the corresponding loss function values, the method further includes:

[0022] Obtaining the marking status of each position in the predicted error-corrected text or the second true text;

[0023] A marking matrix is ​​generated according to the marking situation, wherein in the marking matrix, the marked positions are marked as 0 and the unmarked positions are marked as 1.

[0024] In one embodiment, after the step of obtaining the first training text, the method further includes:

[0025] Determining whether the first training text includes a text of a preset type;

[0026] If yes, the step of inserting marks at the character positions of the preset type text in the first training text and the corresponding first real text respectively through the preset large language model to obtain the second training text and the second real text is performed;

[0027] If not, the initial speech recognition error correction model is trained according to the first training text and the first real text to obtain a target speech recognition error correction model.

[0028] In one embodiment, the step of iteratively training the initial speech recognition error correction model based on the second training text and the loss function value to obtain a target speech recognition error correction model includes:

[0029] Adjusting the model parameters of the initial speech recognition error correction model, and inputting the training set text in the second training text into the adjusted initial speech recognition error correction model to obtain a new predicted error correction text;

[0030] Determining a loss function value of the adjusted initial speech recognition error correction model based on a second true text corresponding to the new predicted error correction text;

[0031] If the loss function value has not converged, the step of adjusting the model parameters of the initial speech recognition error correction model is returned to execute until the loss function value converges, and the initial speech recognition error correction model is set as the target speech recognition error correction model.

[0032] In addition, to achieve the above-mentioned purpose, the present application also proposes an electronic device, which includes: a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the computer program is configured to implement the steps of the speech recognition error correction model training method as described above.

[0033] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the speech recognition error correction model training method described above are implemented.

[0034] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements the steps of the speech recognition error correction model training method described above.

[0035] The present application proposes a speech recognition error correction model training method. In the speech recognition error correction model training method, a first training text is first obtained, and a preset large language model is used to insert marks at the character positions of the preset type text in the first training text and the corresponding first real text, respectively, to obtain a second training text and a second real text, wherein the preset type is a text type that cannot be corrected by context in speech recognition error correction. The technical solution of the present application adopts a large language model to mark the text type that cannot be corrected by context in the text, which effectively improves the efficiency of text marking compared to the manual marking method, and then the second training text is input into the initial speech recognition error correction model to obtain a predicted error correction text, and then the predicted error correction text and the second real text are calculated. The loss function value is used, wherein in the calculation process of the loss function value, the marked preset type of text is ignored. Since the preset type of text is ignored when calculating the loss function value, the function loss when an error occurs in the preset type of text is also ignored. Finally, the initial speech recognition error correction model is iteratively trained based on the second training text and the loss function value to obtain the target speech recognition error correction model. The calculation of the loss function will not be affected by the marked text, thereby avoiding the back propagation of gradients to these parts, so that the model training can focus more on correcting errors that can be corrected and meaningful errors, and tilt more computing resources and time to the part that can improve the correction accuracy, thereby achieving full utilization of computing resources and improving the training efficiency and error correction accuracy of the speech recognition error correction model. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0037] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0038] Figure 1 A flowchart of the first embodiment of the speech recognition error correction model training method of the present application is provided;

[0039] Figure 2 This is a flow chart of determining whether to perform text marking in an embodiment of the speech recognition error correction model training method of the present application;

[0040] Figure 3This is a schematic diagram of the process of iteratively training a speech recognition error correction model in an embodiment of the speech recognition error correction model training method of the present application;

[0041] Figure 4 A flowchart of a feasible speech recognition error correction model training method is shown;

[0042] Figure 5 This is a schematic diagram of the device structure of the hardware operating environment involved in the speech recognition error correction model training method in the embodiment of the present application.

[0043] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0044] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0045] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0046] The execution subject of this embodiment may be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, a server, etc., or an electronic device or a control device capable of realizing the above functions. The following takes the server as an execution subject as an example to illustrate this embodiment and the following embodiments.

[0047] The present application embodiment provides a method for training a speech recognition error correction model, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the speech recognition error correction model training method of the present application, and the speech recognition error correction model training method includes:

[0048] Step S10, obtaining a first training text, inserting marks at character positions of a preset type of text in the first training text and the corresponding first real text respectively through a preset large language model, to obtain a second training text and a second real text, wherein the preset type is a text type that cannot be corrected by context in speech recognition error correction;

[0049] It should be noted that the first training text is collected from speech recognition texts output by a large number of ASR systems, and the first real text is the correctly corrected text corresponding to the first training text, which is used as the real label of the first training text so that the model can perform supervised learning.

[0050] In addition, the embodiment of the present application uses a large language model to insert marks at the character positions of the preset type of text in the first training text and the corresponding first real text. The preset type of text can be a name text, a pronoun text, and other texts that cannot be corrected by context. Since the large language model has a strong semantic understanding ability, it can efficiently and high-quality complete tasks such as recognizing name texts and recognizing pronoun texts. Exemplarily, by further adopting the one-shot prompt technology, the pre-processing large model can stably add marks to the recognized name text, pronoun text and other contents without special training, and output the marked text in a fixed format, effectively improving the efficiency of text marking. In addition, the text after the first training text is marked is the second training text, and the text after the first real text is marked is the second real text.

[0051] Step S20, inputting the second training text into the initial speech recognition error correction model to obtain a predicted error correction text;

[0052] It should be noted that before the second training text is input into the initial speech recognition error correction model, data division is performed first, including dividing the second training text into a training set, a verification set and a test set, wherein the training set is divided into multiple groups. A group of training texts in the training set can be first input into the pre-built initial speech recognition error correction model to be trained. After the initial speech recognition error correction model performs error correction processing, the corresponding predicted error correction text is output for further calculation of the loss function value and iterative training.

[0053] Step S30, calculating a loss function value according to the predicted error correction text and the second true text, wherein in the process of calculating the loss function value, the marked preset type of text is ignored;

[0054] It can be understood that in the embodiment of the present application, when calculating the loss function value of the model, it is necessary to compare the differences between each position in the predicted error correction text and the second real text respectively, while the marked preset type of text is ignored, that is, there is no need to compare the differences between the predicted error correction text and the marked preset type of text in the second real text, so that the final loss function value does not need to consider the errors in the types of text that are difficult to correct (such as name text and pronoun text), so that the model training process is based on the loss function values ​​corresponding to other easily correctable error parts, avoiding the model from wasting computing resources and time on errors that cannot be corrected, thereby improving the training efficiency of the model.

[0055] Step S40, iteratively training the initial speech recognition error correction model based on the second training text and the loss function value to obtain a target speech recognition error correction model.

[0056] After determining the loss function value of the initial speech recognition model, the model parameters of the initial speech recognition error correction model are optimized and adjusted based on the preset model parameters, and steps S20 to S30 are repeated to obtain the adjusted loss function value of the initial speech recognition error correction model. The model parameters of the initial speech recognition error correction model are optimized so that the loss function value is gradually reduced during the training process until convergence. The initial speech recognition error correction model is then performance evaluated and tested using a validation set and a test set. After the error correction accuracy of the initial speech recognition error correction model reaches a preset threshold, the iterative training is stopped, and the latest initial speech recognition error correction model is set as the target speech recognition error correction model. The target speech recognition error correction model is a model that is trained and can be deployed in the ASR system to perform error correction tasks.

[0057] Exemplarily, the trained target speech recognition error correction model can be integrated into the ASR system for real-time error correction, and the performance of the model in actual applications can be continuously monitored, and the training data and model can be regularly updated to maintain the best error correction effect.

[0058] In the speech recognition error correction model training method provided in the embodiment of the present application, a first training text is first obtained, and a preset large language model is used to insert marks at the character positions of the preset type text in the first training text and the corresponding first real text, respectively, to obtain a second training text and a second real text, wherein the preset type is a text type that cannot be corrected through context in speech recognition error correction. In the technical solution of the embodiment of the present application, a large language model is used to mark the text of the text type that cannot be corrected through context in the text, which effectively improves the efficiency of text marking compared to the manual marking method, and then the second training text is input into the initial speech recognition error correction model to obtain a predicted error correction text, and then the loss function value is calculated based on the predicted error correction text and the second real text, wherein the loss function value is calculated based on the loss function value. In the process of calculating the loss function value, the marked preset type of text is ignored. Since the preset type of text is ignored when calculating the loss function value, the function loss when an error occurs in the preset type of text is also ignored. Finally, the initial speech recognition error correction model is iteratively trained based on the second training text and the loss function value to obtain the target speech recognition error correction model. The calculation of the loss function will not be affected by the marked text, thereby avoiding the back propagation of gradients to these parts, so that the model training can focus more on correcting errors that can be corrected and meaningful errors, and tilt more computing resources and time to the parts that can improve the correction accuracy, so as to achieve full utilization of computing resources and reduce unnecessary overhead of computer performance, thereby improving the training efficiency and error correction accuracy of the speech recognition error correction model.

[0059] Further, in a feasible implementation manner, the step of inserting marks at character positions of preset type texts in the first training text and the corresponding first real text respectively through a preset large language model to obtain a second training text and a second real text comprises:

[0060] Step S11, inputting the first training text and the corresponding prompt word into the large language model, and outputting the second training text through the large language model;

[0061] Step S12, inputting the first real text and the corresponding prompt word into the large language model, and outputting a second real text through the large language model;

[0062] The prompt word is used to instruct the large language model to insert a mark at a character position of the preset type of text.

[0063] The embodiment of the present application provides a method of using an existing large language model to understand a preset type of text in a first training text and a first real text, mainly using the language understanding ability of the large language model itself, and inputting the first training text, the first real text and the prompt word into the large language model. The large language model can understand the meaning of the prompt word and insert marks before and after the character positions of the preset type of text in the first training text and the first real text, thereby outputting a second training text and a second real text.

[0064] Further, in a feasible embodiment, the step of outputting the second training text through the large language model includes:

[0065] Step S111, identifying the character positions of the preset type of text in the first training text by using the large language model;

[0066] Step S112: inserting preset marks before and after the characters of the preset type of text through the large language model to obtain and output a second training text.

[0067] The large language model can understand the task content indicated in the prompt word and the meaning of each phrase in the text, thereby identifying the position of the preset type of text (including name text and pronoun text) in the first training text and the first real text, and then insert preset marks before and after the position of the preset type of text according to the requirements of the prompt word, thereby obtaining the corresponding second training text and second real text.

[0068] The preset tags can be unified, or different tags can be inserted according to the type of text. For example, the tag corresponding to the name text is " <name>", the corresponding token for the pronoun text is " <pron>”.

[0069] For example, the prompt words may include: Please identify the names of people, places, companies, etc. in the following text, and add <name>Mark; please identify the pronoun text in the following text and add <pron>mark.

[0070] The first training text is: Li Xiaoming is a student who has just entered middle school.

[0071] The marked text is: <name>Li Xiaoming <name> <pron>he <pron>He is a student who has just entered middle school.

[0072] Similarly, in step S12, the step of preprocessing the first real text by the large language model to insert preset marks before and after the character positions of the preset type of text is similar to steps S111 to S112, and will not be repeated here.

[0073] In another feasible embodiment, the step of calculating the loss function value according to the predicted error-corrected text and the second true text includes:

[0074] Step S31, inputting the predicted error correction text and the second true text into a preset loss function to determine the corresponding loss function value;

[0075] The loss function at least includes a marking matrix, which is used to characterize the corresponding positions of the marked texts of the preset type and to ignore the influence of the marked texts of the preset type when calculating the loss function value.

[0076] The loss function in the embodiment of the present application can adopt a cross entropy loss function. Compared with the traditional cross entropy loss function, the technical solution in the embodiment of the present application has been modified. The cross entropy loss function can make the content marked with preset marks in the predicted error correction text and the second real text ignored. Specifically, the position of the content of the preset mark is represented by the mark matrix in the loss function. Further, the mark matrix includes the eigenvalues ​​corresponding to the positions of the tokens (divided text units) of the predicted error correction text and the second real text respectively. There are two different values ​​of the eigenvalue, one for representing that it has not been marked, and the other for representing that it has been marked. The specially marked token is ignored when calculating the function loss, and only the function loss of the unmarked token is calculated, so that the speech recognition error correction model ignores the preset type of text that cannot be corrected during the training process, and improves the training efficiency and training effect.

[0077] Furthermore, in a feasible embodiment, before the step of inputting the predicted error-corrected text and the second true text into a preset loss function to determine the corresponding loss function value, the method further includes:

[0078] Step A10, obtaining the marking status of each position in the predicted error correction text or the second true text;

[0079] Step A20, generating a marking matrix according to the marking situation, wherein in the marking matrix, the marked positions are recorded as 0, and the unmarked positions are recorded as 1.

[0080] An embodiment of the present application provides a method for generating a marking matrix, wherein the marking positions in the predicted error correction text or the second real text are consistent, so the marking matrix can be generated according to the marking situation of each position in the predicted error correction text or the second real text.

[0081] Furthermore, each position in the predicted error correction text or the second true text refers to the position of the corresponding token, and the position of the token is represented by (i, j), which refers to the position of the i-th row and j-th column. If all the positions of the predicted error correction text or the second true text can be represented by a matrix of I rows and J columns, the corresponding marking matrix is ​​also I rows and J columns. Specifically, the marked position is recorded as 0 in the marking matrix, which is used to multiply the loss function value of the position in the loss function to obtain 0, so that the function loss value of the position is ignored; while the unmarked position is recorded as 1 in the marking matrix, which is multiplied by the loss function value of the position, indicating that the function loss value of the position is accumulated with the function loss values ​​of other positions and included in the final function loss value.

[0082] For example, the labeling matrix is ​​denoted as m ij , the loss function in the embodiment of the present application is a cross entropy loss function, which is defined as:

[0083]

[0084] Among them, L mod Refers to the loss function value, y ij Refers to the data at the position of the i-th row and j-th column in the second real text, Refers to the data for predicting the position of the i-th row and j-th column in the error correction text.

[0085] In a feasible embodiment, after the step of obtaining the first training text, referring to Figure 2 , the method further comprises:

[0086] Step B10, determining whether the first training text includes a text of a preset type;

[0087] Step B20: If yes, then inserting marks into the character positions of the preset type text in the first training text and the corresponding first real text by using the preset large language model to obtain the second training text and the second real text;

[0088] Step B30: If not, train an initial speech recognition error correction model based on the first training text and the first real text to obtain a target speech recognition error correction model.

[0089] It can be understood that after obtaining the first training text, it is first determined whether it needs to be marked. The condition for determining whether marking is needed can be: whether the first training text includes a preset type of text, wherein step A10 can be executed by a large language model, that is, the first training text and the corresponding prompt word are input into the large language model. If the large language model recognizes that the first training text includes a preset type of text (such as a name text or a pronoun text), the step of inserting marks into the character positions of the preset type of text in the first training text and the corresponding first real text respectively through the preset large language model to obtain the second training text and the second real text will be executed. If the large language model does not recognize the preset type of text in the first training text, the unmarked first training text and the first real text are output, or a prompt message that the preset type of text is not recognized is output.

[0090] In the absence of labeling, the initial application recognition and correction model can be trained directly based on the first training text and the first real text, because the text type that cannot be corrected by context in speech recognition error correction is not included, so it will not bring invalid computing resource overhead and time overhead to the model training process. It should be noted that when the unlabeled first training text and the first real text are used for model training, the same loss function as step S30 can also be used. In this case, the label matrix is ​​all 1, which is equivalent to the traditional cross entropy loss function, and will not bring additional impact.

[0091] In one possible embodiment, referring to Figure 3 The step of iteratively training the initial speech recognition error correction model based on the second training text and the loss function value to obtain a target speech recognition error correction model comprises:

[0092] Step S41, adjusting the model parameters of the initial speech recognition error correction model, and inputting the training set text in the second training text into the adjusted initial speech recognition error correction model to obtain a new predicted error correction text;

[0093] Step S42, determining the loss function value of the adjusted initial speech recognition error correction model based on the second real text corresponding to the new predicted error correction text;

[0094] Step S43, if the loss function value has not converged, return to the step of adjusting the model parameters of the initial speech recognition error correction model until the loss function value converges, and then set the initial speech recognition error correction model as the target speech recognition error correction model.

[0095] The embodiment of the present application provides a method for iterative training of an initial speech recognition error correction model. Specifically, the second training text can be divided into three parts: a training set, a validation set, and a test set. The training set is used for iterative training of the model, the validation set is used to evaluate the performance of the model and adjust and optimize the model parameters, and the test set is used to test whether the application effect of the model meets expectations. In the iterative training process of the model, first, a set of data in the training set can be input into a pre-built initial speech recognition error correction model, and the model performs a preliminary prediction and outputs the corresponding predicted error correction text, and then calculates the current loss function value of the initial speech recognition error correction model, and then adjusts and optimizes the model parameters based on a preset neural network training algorithm (such as a gradient back propagation algorithm). The optimization goal can be the convergence of the loss function value. Before the convergence of the loss function value, the process of adjusting the model parameters, inputting the training set text to obtain the predicted error correction text, and calculating the loss function value is executed cyclically.

[0096] In another feasible embodiment, after the model is iteratively trained, the model performance is evaluated through the validation set, the model parameters are adjusted to optimize the error correction effect, and the final model is evaluated using the test set to ensure its effect in practical applications. After the performance indicators of the model (such as accuracy, precision, etc.) meet expectations, the entire training process of the model is stopped, and the current initial speech recognition error correction model is determined as the final target speech recognition error correction model. Furthermore, after determining the target speech recognition error correction model that has passed verification and testing, the trained target speech recognition error correction model is integrated into the ASR system for real-time error correction of the speech recognition text output by the ASR system, and the performance of the model in practical applications is continuously monitored, and the training data and model are regularly updated to maintain the best error correction effect.

[0097] For ease of understanding, based on the various application embodiments, a feasible method for training a speech recognition error correction model is described as follows: Figure 4 As shown, firstly, data collection and preparation are performed to obtain the first training text and the first real text, and then the large language model is used to determine whether the first training text and the first real text need to be marked. If so, the mark is inserted, if not, the step of inserting the mark is skipped, and data segmentation is performed to divide the training set, the validation set and the test set. The modified cross entropy loss function is used to calculate the loss function value of the model, and the speech recognition error correction model is trained based on the loss function value. After passing the model verification and testing, the model deployment and application steps are entered, and the performance of the model is continuously monitored to regularly update the training data and model.

[0098] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the speech recognition error correction model training method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.

[0099] The present application provides an electronic device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the speech recognition error correction model training method in the above-mentioned embodiment one.

[0100] Reference below Figure 5 , which shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present application. The electronic devices in the embodiments of the present application may include but are not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0101] like Figure 5 As shown, the electronic device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the electronic device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows an electronic device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.

[0102] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0103] The electronic device provided by the present application adopts the speech recognition error correction model training method in the above embodiment, which can solve the technical problem of low training efficiency of the current speech recognition error correction model. Compared with the prior art, the beneficial effects of the electronic device provided by the present application are the same as the beneficial effects of the speech recognition error correction model training method provided by the above embodiment, and other technical features in the electronic device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0104] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0105] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0106] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the speech recognition error correction model training method in the above-mentioned embodiment.

[0107] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.

[0108] The computer-readable storage medium may be included in the electronic device, or may exist independently without being installed in the electronic device.

[0109] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by an electronic device, the electronic device executes: obtaining a first training text, inserting marks into the character positions of the preset type text in the first training text and the corresponding first real text respectively through a preset large language model, to obtain a second training text and a second real text, wherein the preset type is a text type that cannot be corrected by context in speech recognition error correction; inputting the second training text into an initial speech recognition error correction model to obtain a predicted error correction text; calculating a loss function value based on the predicted error correction text and the second real text, wherein in the process of calculating the loss function value, the marked preset type of text is ignored; iteratively training the initial speech recognition error correction model based on the second training text and the loss function value to obtain a target speech recognition error correction model.

[0110] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0111] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession 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 square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0112] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0113] The readable storage medium provided in the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned speech recognition error correction model training method, and can solve the technical problem of low training efficiency of the current speech recognition error correction model. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in the present application are the same as the beneficial effects of the speech recognition error correction model training method provided in the above-mentioned embodiment, and will not be repeated here.

[0114] The present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the above-mentioned speech recognition error correction model training method.

[0115] The computer program product provided by the present application can solve the technical problem of low training efficiency of the current speech recognition error correction model. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as the beneficial effects of the speech recognition error correction model training method provided by the above embodiment, which will not be repeated here.

[0116] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.< / pron> < / pron> < / name> < / name> < / pron> < / name> < / pron> < / name>

Claims

1. A speech recognition error correction model training method, characterized in that: The speech recognition error correction model training method comprises: Obtain a first training text, and insert marks at character positions of a preset type of text in the first training text and a corresponding first real text respectively through a preset large language model to obtain a second training text and a second real text, wherein the preset type is a text type that cannot be corrected by context in speech recognition error correction; Inputting the second training text into an initial speech recognition error correction model to obtain a predicted error correction text; Calculating a loss function value according to the predicted error-corrected text and the second true text, wherein in the process of calculating the loss function value, the marked text of the preset type is ignored; The initial speech recognition error correction model is iteratively trained based on the second training text and the loss function value to obtain a target speech recognition error correction model.

2. The speech recognition error correction model training method according to claim 1, characterized in that: The step of inserting marks at character positions of preset type texts in the first training text and the corresponding first real text respectively by using a preset large language model to obtain a second training text and a second real text comprises: Inputting the first training text and the corresponding prompt word into the large language model, and outputting the second training text through the large language model; Inputting the first real text and the corresponding prompt word into the large language model, and outputting a second real text through the large language model; The prompt word is used to instruct the large language model to insert a mark at a character position of the preset type of text.

3. The speech recognition error correction model training method according to claim 2, characterized in that: The step of outputting the second training text through the large language model comprises: Identify the character positions of the preset type of text in the first training text by using the large language model; The large language model is used to insert preset marks before and after the characters of the preset type of text to obtain and output a second training text.

4. The speech recognition error correction model training method according to claim 1, characterized in that: The step of calculating the loss function value according to the predicted error-corrected text and the second true text comprises: Inputting the predicted error-corrected text and the second true text into a preset loss function to determine corresponding loss function values; The loss function at least includes a marking matrix, which is used to characterize the positions of marked texts of preset types and to ignore the influence of marked texts of preset types when calculating the loss function value.

5. The speech recognition error correction model training method according to claim 4, characterized in that: Before the step of inputting the predicted error-corrected text and the second true text into a preset loss function to determine the corresponding loss function values, the method further includes: Obtaining the marking status of each position in the predicted error-corrected text or the second true text; A marking matrix is ​​generated according to the marking situation, wherein in the marking matrix, the marked positions are marked as 0 and the unmarked positions are marked as 1.

6. The speech recognition error correction model training method according to claim 1, characterized in that: After the step of obtaining the first training text, the method further includes: Determining whether the first training text includes a text of a preset type; If yes, the step of inserting marks at the character positions of the preset type text in the first training text and the corresponding first real text respectively through the preset large language model to obtain the second training text and the second real text is performed; If not, the initial speech recognition error correction model is trained according to the first training text and the first real text to obtain a target speech recognition error correction model.

7. The speech recognition error correction model training method according to any one of claims 1 to 6, characterized in that: The step of iteratively training the initial speech recognition error correction model based on the second training text and the loss function value to obtain a target speech recognition error correction model comprises: Adjusting the model parameters of the initial speech recognition error correction model, and inputting the training set text in the second training text into the adjusted initial speech recognition error correction model to obtain a new predicted error correction text; Determining a loss function value of the adjusted initial speech recognition error correction model based on a second true text corresponding to the new predicted error correction text; If the loss function value has not converged, the step of adjusting the model parameters of the initial speech recognition error correction model is returned to execute until the loss function value converges, and the initial speech recognition error correction model is set as the target speech recognition error correction model.

8. An electronic device, characterized in that: The device comprises: a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the speech recognition error correction model training method as described in any one of claims 1 to 7.

9. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the speech recognition error correction model training method as described in any one of claims 1 to 7 are implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Cited By

  • Speech recognition method and device, electronic equipment and storage medium

    CN121053967A

  • Battery voltage difference detection method, device, equipment, medium and product

    CN121541089A