A speech recognition method, device, storage medium and electronic device

By combining the bidirectional language model with context prediction capabilities, it solves the problem of only using the upper left side information in existing speech recognition technology, and improves the accuracy and efficiency of speech recognition.

CN117351946BActive Publication Date: 2024-10-25ZHEJIANG LAB
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311413996.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-10-27
Publication Date
2024-10-25
Estimated Expiration
2043-10-27

AI Technical Summary

Technical Problem

Existing speech recognition technology only uses the above information on the left side for prediction, and fails to effectively consider the information of the entire speech, resulting in the accumulation of recognition errors and low accuracy.

Method used

Using a bidirectional language model, including forward prediction subnet, backward prediction subnet and fusion subnet, the bidirectional prediction ability is transferred to the speech recognition model through the idea of ​​​​teacher-student model, prediction is combined with the context, and more accurate text is generated.

Benefits of technology

It improves the accuracy and understanding of speech recognition, reduces the possibility of recognition errors, and improves prediction efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117351946B_ABST
    Figure CN117351946B_ABST
Patent Text Reader

Abstract

This specification discloses a speech recognition method, device, storage medium and electronic device. In the speech recognition method provided in this specification, a sample text is obtained; the sample text is input into a bidirectional language model to be trained, the bidirectional language model at least including a forward prediction subnet, a backward prediction subnet and a fusion subnet; a forward prediction result is obtained according to the sample text through the forward prediction subnet, and a backward prediction result is obtained according to the sample text through the backward prediction subnet; the forward prediction result and the backward prediction result are fused through the fusion subnet to obtain a bidirectional prediction result; the bidirectional language model is trained according to the difference between the bidirectional prediction result and the sample text; the knowledge of the speech recognition model is transferred using the bidirectional language model; and the speech recognition model after the knowledge transfer is used for speech recognition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a speech recognition method, device, storage medium and electronic device. Background Art

[0002] In recent years, speech recognition technology has developed rapidly. By understanding and analyzing the input speech signals, the machine can transform speech data into text data. Nowadays, speech recognition technology has been widely used in many fields.

[0003] However, speech recognition technology still has certain drawbacks. Existing speech recognition systems generally predict text according to the order of the sentence itself, that is, predict and generate sentences one word at a time from left to right. In other words, existing speech recognition technology only uses the context information on the left to make predictions, without considering the entire speech information for global predictions, which is likely to cause the accumulation of errors.

[0004] Therefore, how to further improve the accuracy of speech recognition and reduce the possibility of recognition errors is an urgent problem to be solved. Summary of the invention

[0005] The present specification provides a speech recognition method, device, storage medium and electronic device to at least partially solve the above-mentioned problems existing in the prior art.

[0006] This manual adopts the following technical solutions:

[0007] This specification provides a speech recognition method, including:

[0008] Get sample text;

[0009] Inputting the sample text into a bidirectional language model to be trained, wherein the bidirectional language model at least includes a forward prediction subnet, a backward prediction subnet, and a fusion subnet;

[0010] Obtaining a forward prediction result according to the sample text through the forward prediction subnet, and obtaining a backward prediction result according to the sample text through the backward prediction subnet;

[0011] The forward prediction result and the backward prediction result are fused through the fusion subnet to obtain a bidirectional prediction result;

[0012] Training the bidirectional language model according to the difference between the bidirectional prediction result and the sample text;

[0013] Using the bidirectional language model to perform knowledge transfer on a speech recognition model;

[0014] The speech recognition model after knowledge transfer is used for speech recognition.

[0015] Optionally, obtaining a forward prediction result according to the sample text by the forward prediction subnet specifically includes:

[0016] Inputting the sample text into the forward prediction subnet;

[0017] Each word in the forward prediction result is predicted by the forward prediction subnet in a left-to-right order to obtain the forward prediction result.

[0018] Optionally, obtaining a backward prediction result according to the sample text by the backward prediction subnet specifically includes:

[0019] Inputting the sample text into the backward prediction subnet;

[0020] Each word in the backward prediction result is predicted by the backward prediction subnet in order from right to left to obtain the backward prediction result.

[0021] Optionally, the speech recognition model includes at least an encoding subnet and a decoding subnet;

[0022] The bidirectional language model is used to transfer knowledge of the speech recognition model, specifically including:

[0023] Acquire sample speech and annotated text corresponding to the sample speech;

[0024] Inputting the annotated text into the bidirectional language model to obtain a bidirectional prediction result of the bidirectional language model input;

[0025] Inputting the sample speech into the coding subnet to obtain the coding features to be optimized output by the coding subnet;

[0026] Inputting the encoding feature to be optimized into the decoding subnet to obtain the prediction result to be optimized output by the decoding subnet;

[0027] The speech recognition model is trained according to the difference between the prediction result to be optimized and the bidirectional prediction result.

[0028] Optionally, the bidirectional prediction result and the prediction result to be optimized are both used to characterize the probability distribution of each word in the predicted text;

[0029] Taking the difference between the prediction result to be optimized and the bidirectional prediction result as the minimum as the optimization goal, training the speech recognition model specifically includes:

[0030] Determining a one-hot encoding of the annotated text;

[0031] Performing weighted fusion on the one-hot encoding and the bidirectional prediction result to obtain a weighted prediction result;

[0032] The speech recognition model is trained according to the difference between the weighted prediction result and the prediction result to be optimized.

[0033] Optionally, the forward prediction subnet, the backward prediction subnet, the encoding subnet, and the decoding subnet are subnets constructed based on a transformer model.

[0034] Optionally, the speech recognition model after knowledge transfer is used to perform speech recognition, specifically including:

[0035] Get the target voice;

[0036] Inputting the target speech into the speech model after knowledge transfer;

[0037] Encoding the target speech through the encoding subnet to obtain encoding features of the target speech;

[0038] Decoding the encoded features through the decoding subnet to obtain a target prediction result of the target speech;

[0039] The target text is determined according to the target prediction result.

[0040] This specification provides a speech recognition device, the device comprising:

[0041] An acquisition module is used to acquire sample text;

[0042] An input module, used for inputting the sample text into a bidirectional language model to be trained, wherein the bidirectional language model at least includes a forward prediction subnet, a backward prediction subnet, and a fusion subnet;

[0043] An output module, configured to obtain a forward prediction result based on the sample text through the forward prediction subnet, and obtain a backward prediction result based on the sample text through the backward prediction subnet;

[0044] A fusion module, used for fusing the forward prediction result and the backward prediction result through the fusion subnet to obtain a bidirectional prediction result;

[0045] A training module, used for training the bidirectional language model according to the difference between the bidirectional prediction result and the sample text;

[0046] A migration module, used for performing knowledge migration on a speech recognition model using the bidirectional language model;

[0047] The recognition module is used to perform speech recognition using the speech recognition model after knowledge transfer.

[0048] This specification provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned speech recognition method is implemented.

[0049] This specification provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned speech recognition method when executing the program.

[0050] At least one of the above technical solutions adopted in this specification can achieve the following beneficial effects:

[0051] In the speech recognition method provided in the present specification, a sample text is obtained; the sample text is input into a bidirectional language model to be trained, the bidirectional language model at least comprising a forward prediction subnet, a backward prediction subnet, and a fusion subnet; a forward prediction result is obtained according to the sample text by the forward prediction subnet, and a backward prediction result is obtained according to the sample text by the backward prediction subnet; the forward prediction result and the backward prediction result are fused by the fusion subnet to obtain a bidirectional prediction result; the bidirectional language model is trained according to the difference between the bidirectional prediction result and the sample text; the bidirectional language model is used to perform knowledge transfer on a speech recognition model; and speech recognition is performed using the speech recognition model after knowledge transfer.

[0052] When using the speech recognition method provided in this specification to convert speech data into text data, a bidirectional language model with bidirectional prediction capabilities can be pre-trained, and the ability of the bidirectional language model to predict in combination with the context can be transferred to the speech recognition model through the idea of ​​the teacher-student model, and finally the speech recognition model can be used to implement speech recognition. This method can generate each word in the predicted text in combination with the context of the speech data during speech recognition, greatly improving the ability to understand speech and the accuracy of prediction during speech recognition; at the same time, the use of knowledge transfer eliminates the need to process too much data during the prediction process, thereby ensuring the efficiency of speech recognition. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] The drawings described herein are used to provide a further understanding of this specification and constitute a part of this specification. The illustrative embodiments and descriptions of this specification are used to explain this specification and do not constitute an improper limitation on this specification. In the drawings:

[0054] Figure 1 A flowchart of a speech recognition method in this specification;

[0055] Figure 2 A schematic diagram of a speech recognition device provided in this specification;

[0056] Figure 3 A schematic diagram of the structure of a bidirectional language model provided in this specification;

[0057] Figure 4 A schematic diagram of the structure of a speech recognition model provided in this manual;

[0058] Figure 5 The corresponding Figure 1 Schematic diagram of electronic equipment. DETAILED DESCRIPTION

[0059] In order to make the purpose, technical solutions and advantages of this specification more clear, the technical solutions of this specification will be clearly and completely described below in combination with the specific embodiments of this specification and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0060] The technical solutions provided by the embodiments of this specification are described in detail below in conjunction with the accompanying drawings.

[0061] Figure 1 The following is a flow chart of a speech recognition method in this specification, which specifically includes the following steps:

[0062] S100: Obtain sample text.

[0063] All steps in the speech recognition method provided in this specification can be implemented by any electronic device with computing functions, such as a terminal, a server, and the like.

[0064] The main idea of ​​this method is to use a bidirectional language model that can perform bidirectional predictions at the same time, and transfer knowledge to the speech recognition model through the idea of ​​a teacher-student model, and finally obtain a speech recognition model that has the ability to simultaneously combine context to achieve text prediction. Based on this, the bidirectional language model can be trained first.

[0065] In this step, sample text for training the bidirectional language model may be obtained, wherein the sample text is in any form and is usually a complete sentence.

[0066] S102: Inputting the sample text into a bidirectional language model to be trained, wherein the bidirectional language model at least includes a forward prediction subnet, a backward prediction subnet, and a fusion subnet.

[0067] Figure 2 This is a model structure of a bidirectional language model used in the speech recognition method provided in this specification. Figure 2As shown, the bidirectional language model may include at least a forward prediction subnet, a backward prediction subnet and a fusion subnet. In this step, the sample text used to train the bidirectional language model may be input into the bidirectional language model.

[0068] S104: obtaining a forward prediction result according to the sample text through the forward prediction subnet, and obtaining a backward prediction result according to the sample text through the backward prediction subnet.

[0069] After the sample text is input into the bidirectional language model, the sample text can enter the forward prediction subnet and the backward prediction subnet at the same time, and obtain the forward prediction result output by the forward prediction subnet and the backward prediction result output by the backward prediction subnet respectively.

[0070] Among them, the forward prediction result is the prediction result obtained by the forward prediction subnet according to the above text after remodeling the sample text. Specifically, the sample text can be input into the forward prediction subnet; through the forward prediction subnet, each word in the forward prediction result is predicted in order from left to right to obtain the forward prediction result. The backward prediction result is the prediction result obtained by the backward prediction subnet according to the following text after remodeling the sample text. Specifically, the sample text can be input into the backward prediction subnet; through the backward prediction subnet, each word in the backward prediction result is predicted in order from right to left to obtain the backward prediction result.

[0071] In the forward prediction subnet, each word in the prediction result will be output from left to right, and the prediction of each word is predicted based on the known word on the left side of the word, that is, the previous context of the word; in the process of predicting each word by the forward prediction subnet, only the previous context of the word will be paid attention to, but not the subsequent context of the word. It can be considered that in this process, the subsequent context of the predicted word is obscured. In contrast, in the backward prediction subnet, each word in the prediction result will be output from right to left, and the prediction of each word is predicted based on the known word on the right side of the word, that is, the subsequent context of the word; in the process of predicting each word by the backward prediction subnet, only the subsequent context of the word will be paid attention to, but not the previous context of the word. It can be considered that in this process, the previous context of the predicted word is obscured.

[0072] S106: fusing the forward prediction result and the backward prediction result through the fusion subnet to obtain a bidirectional prediction result.

[0073] In this step, the forward prediction results output by the forward prediction subnet and the backward prediction results output by the backward prediction subnet can be fused through the fusion subnet to obtain a bidirectional prediction result. Generally, for the language model of the output text, its prediction result can be the probability distribution of the characters at each position in the predicted text. For example, at any position in the predicted text, the corresponding prediction result may be {character A: 70%, character B: 30%}, indicating that at this position, the possibility of taking character A is 70%, and the possibility of taking character B is 30%. Based on this, the forward prediction result and the backward prediction result can be fused to obtain a bidirectional prediction result that characterizes the probability distribution in combination with the context.

[0074] When the forward prediction result and the backward prediction result are fused, it can be regarded as fusing the probability distribution of the corresponding position in the predicted text. For example, assuming that at a position in the predicted text, the forward prediction result is {word X: 40%, word Y: 60%}, and the backward prediction result is {word Y: 70%, word Z: 30%}, then after fusing the forward prediction result and the backward prediction result, the bidirectional prediction result obtained can be {word X: 20%, word Y: 65%, word Z: 15%}.

[0075] For each position in the predicted text, the fusion of the bidirectional prediction results can be achieved in the above manner. Of course, in addition to the above fusion manner, other fusion methods such as weighted fusion can also be used for fusion, and this specification does not make specific restrictions on this.

[0076] S108: Training the bidirectional language model according to the difference between the bidirectional prediction result and the sample text.

[0077] In this step, the bidirectional language model can be trained based on the difference between the bidirectional prediction results and the sample text. In the process of training the bidirectional prediction results, the sample text can be both a training sample and a training label. Since the bidirectional prediction results are represented by probability distribution, the sample text can also be represented by probability distribution. Specifically, for the sample text, the probability of the original word at each position in the sample text can be set to 100%, and the probability of other words can be set to 0%, and the bidirectional language model can be trained with this as a label.

[0078] S110: Using the bidirectional language model to perform knowledge transfer on the speech recognition model.

[0079] After completing the training of the bidirectional language model, in this step, based on the idea of ​​the teacher-student model, the bidirectional prediction capability of the bidirectional language model can be transferred to the speech recognition model. Figure 3 This is a model structure of a speech recognition model used in the speech recognition method provided in this specification. Figure 3 As shown, the speech recognition model may include at least an encoding subnet and a decoding subnet.

[0080] When using a bidirectional language model to transfer knowledge to a speech recognition model, specifically,

[0081] Acquire sample speech and annotated text corresponding to the sample speech; input the annotated text into the bidirectional language model to obtain a bidirectional prediction result input by the bidirectional language model; input the sample speech into the encoding subnet to obtain the encoding features to be optimized output by the encoding subnet; input the encoding features to be optimized into the decoding subnet to obtain the prediction results to be optimized output by the decoding subnet; train the speech recognition model according to the difference between the prediction results to be optimized and the bidirectional prediction results.

[0082] Among them, the form of the encoded features is further set according to specific needs, such as 40 dimensions, 80 dimensions, etc., and this specification does not impose specific restrictions on this; similarly, the difference between the prediction result to be optimized and the bidirectional prediction result can also be determined in a variety of different ways, such as the cross entropy function, etc., and this specification also does not impose specific restrictions on this.

[0083] Similar to the bidirectional prediction results, the prediction results to be optimized output by the speech recognition model can also be represented in the form of probability distribution. Therefore, the process of knowledge transfer can actually be regarded as the process of using the probability distribution output by the bidirectional language model to guide the probability distribution output by the speech recognition model. Based on this, it is possible to further maximize the use of the annotated text through one-hot encoding to make the output of the speech recognition model more accurate. Specifically, the one-hot encoding of the annotated text can be determined; the one-hot encoding and the bidirectional prediction results are weighted and fused to obtain a weighted prediction result; and the speech recognition model is trained based on the difference between the weighted prediction result and the prediction result to be optimized.

[0084] In fact, one-hot encoding can be regarded as a kind of probability distribution. When determining the one-hot encoding of the annotated text, at each position of the annotated text, the original text is encoded as 1 and the other texts are encoded as 0. In other words, the probability corresponding to the original word is 100%, and the probability corresponding to other words is 0%. Based on this, the one-hot encoding can be weighted and fused with the bidirectional prediction result to obtain a weighted prediction result to guide the optimization of the prediction result. In the process of weighted fusion, the weight of the one-hot encoding and the weight of the bidirectional prediction result can be set according to specific needs, and this manual does not make specific restrictions on this.

[0085] S112: Perform speech recognition using the speech recognition model after knowledge transfer.

[0086] Finally, the speech recognition function can be realized by using a speech recognition model that has been trained, that is, after knowledge transfer of the bidirectional language model. Specifically, the target speech can be obtained; the target speech can be input into the speech model after knowledge transfer; the target speech can be encoded by the encoding subnet to obtain the encoding features of the target speech; the encoding features can be decoded by the decoding subnet to obtain the target prediction result of the target speech; and the target text can be determined according to the target prediction result.

[0087] In the bidirectional language model and speech recognition model used in the speech recognition method provided in this specification, the model structure and the structure of each subnet can be designed in a variety of different forms while ensuring that the model and each subnet function correctly. In this method, the forward prediction subnet, the backward prediction subnet, the encoding subnet, and the decoding subnet are constructed based on the Transformer model to achieve the optimal model effect.

[0088] When using the speech recognition method provided in this specification to convert speech data into text data, a bidirectional language model with bidirectional prediction capabilities can be pre-trained, and the ability of the bidirectional language model to predict in combination with the context can be transferred to the speech recognition model through the idea of ​​the teacher-student model, and finally the speech recognition model can be used to implement speech recognition. This method can generate each word in the predicted text in combination with the context of the speech data during speech recognition, greatly improving the ability to understand speech and the accuracy of prediction during speech recognition; at the same time, the use of knowledge transfer eliminates the need to process too much data during the prediction process, thereby ensuring the efficiency of speech recognition.

[0089] The above is the speech recognition method provided in this specification. Based on the same idea, this specification also provides a corresponding speech recognition device, such as Figure 4 shown.

[0090] Figure 4 A schematic diagram of a speech recognition device provided in this specification specifically includes:

[0091] An acquisition module 200 is used to acquire a sample text;

[0092] An input module 202, used to input the sample text into a bidirectional language model to be trained, wherein the bidirectional language model at least includes a forward prediction subnet, a backward prediction subnet, and a fusion subnet;

[0093] An output module 204, configured to obtain a forward prediction result based on the sample text through the forward prediction subnet, and obtain a backward prediction result based on the sample text through the backward prediction subnet;

[0094] A fusion module 206, configured to fuse the forward prediction result and the backward prediction result through the fusion subnet to obtain a bidirectional prediction result;

[0095] A training module 208, configured to train the bidirectional language model according to the difference between the bidirectional prediction result and the sample text;

[0096] A migration module 210, configured to perform knowledge migration on a speech recognition model using the bidirectional language model;

[0097] The recognition module 212 is used to perform speech recognition using the speech recognition model after knowledge transfer.

[0098] Optionally, the output module 204 is specifically configured to input the sample text into the forward prediction subnet; and predict each word in the forward prediction result in order from left to right through the forward prediction subnet to obtain the forward prediction result.

[0099] Optionally, the output module 204 is specifically configured to input the sample text into the backward prediction subnet; and predict each word in the backward prediction result in order from right to left through the backward prediction subnet to obtain the backward prediction result.

[0100] Optionally, the speech recognition model includes at least an encoding subnet and a decoding subnet;

[0101] The migration module 210 is specifically used to obtain a sample speech and an annotated text corresponding to the sample speech; input the annotated text into the bidirectional language model to obtain a bidirectional prediction result input by the bidirectional language model; input the sample speech into the encoding subnet to obtain the encoding features to be optimized output by the encoding subnet; input the encoding features to be optimized into the decoding subnet to obtain the prediction results to be optimized output by the decoding subnet; and train the speech recognition model according to the difference between the prediction results to be optimized and the bidirectional prediction results.

[0102] Optionally, the bidirectional prediction result and the prediction result to be optimized are both used to characterize the probability distribution of each word in the predicted text;

[0103] The migration module 210 is specifically used to determine the one-hot encoding of the annotated text; perform weighted fusion on the one-hot encoding and the bidirectional prediction result to obtain a weighted prediction result; and train the speech recognition model according to the difference between the weighted prediction result and the prediction result to be optimized.

[0104] Optionally, the forward prediction subnet, the backward prediction subnet, the encoding subnet, and the decoding subnet are subnets constructed based on a transformer model.

[0105] Optionally, the recognition module 212 is specifically used to obtain a target speech; input the target speech into the speech model after knowledge transfer; encode the target speech through the encoding subnet to obtain encoding features of the target speech; decode the encoding features through the decoding subnet to obtain a target prediction result of the target speech; and determine the target text according to the target prediction result.

[0106] This specification also provides a computer-readable storage medium, which stores a computer program, which can be used to execute the above Figure 1 Provides speech recognition methods.

[0107] This manual also provides Figure 5 The schematic structure diagram of the electronic device shown in FIG. Figure 5 As mentioned above, at the hardware level, the electronic device includes a processor, an internal bus, a network interface, a memory, and a non-volatile memory, and may also include other hardware required for the business. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it to achieve the above Figure 1 Of course, in addition to the software implementation, this specification does not exclude other implementations, such as logic devices or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0108] For the improvement of a technology, it can be clearly distinguished whether it is a hardware improvement (for example, improvement of the circuit structure of diodes, transistors, switches, etc.) or a software improvement (improvement of the method flow). However, with the development of technology, many improvements of the method flow today can be regarded as direct improvements of the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that the improvement of a method flow cannot be implemented with a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming themselves, without having to ask chip manufacturers to design and make dedicated integrated circuit chips. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed ​​Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages ​​and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.

[0109] The controller can be implemented in any appropriate manner, for example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) that can be executed by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in a purely computer-readable program code manner, the controller can be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, this controller can be considered as a hardware component, and the devices included therein for implementing various functions can also be regarded as structures within the hardware component. Or even, the devices for implementing various functions can be regarded as both software modules for implementing the method and structures within the hardware component.

[0110] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.

[0111] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.

[0112] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0113] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0114] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0115] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0116] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0117] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0118] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0119] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0120] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems or computer program products. Therefore, this specification may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0121] This specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. This specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.

[0122] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0123] The above description is only an embodiment of this specification and is not intended to limit this specification. For those skilled in the art, this specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this specification should be included in the scope of the claims of this application.

Claims

1. A speech recognition method, characterized in that: include: Get sample text; Inputting the sample text into a bidirectional language model to be trained, wherein the bidirectional language model at least includes a forward prediction subnet, a backward prediction subnet, and a fusion subnet; Obtaining a forward prediction result according to the sample text through the forward prediction subnet, and obtaining a backward prediction result according to the sample text through the backward prediction subnet; The forward prediction result and the backward prediction result are fused through the fusion subnet to obtain a bidirectional prediction result; Training the bidirectional language model according to the difference between the bidirectional prediction result and the sample text; Using the bidirectional language model to perform knowledge transfer on a speech recognition model; Use the speech recognition model after knowledge transfer for speech recognition; Wherein, the speech recognition model at least includes an encoding subnet and a decoding subnet; The bidirectional language model is used to transfer knowledge of the speech recognition model, specifically including: Acquire sample speech and annotated text corresponding to the sample speech; Inputting the annotated text into the bidirectional language model to obtain a bidirectional prediction result of the bidirectional language model input; Inputting the sample speech into the coding subnet to obtain the coding features to be optimized output by the coding subnet; Inputting the encoding feature to be optimized into the decoding subnet to obtain the prediction result to be optimized output by the decoding subnet; Training the speech recognition model according to the difference between the prediction result to be optimized and the bidirectional prediction result; The bidirectional prediction result and the prediction result to be optimized are both used to characterize the probability distribution of each word in the predicted text; Training the speech recognition model according to the difference between the prediction result to be optimized and the bidirectional prediction result specifically includes: Determining a one-hot encoding of the annotated text; Performing weighted fusion on the one-hot encoding and the bidirectional prediction result to obtain a weighted prediction result; Training the speech recognition model according to the difference between the weighted prediction result and the prediction result to be optimized; Wherein, determining the one-hot encoding of the annotated text specifically includes: For each position in the annotated text, the probability distribution of the word at the position is determined by taking the probability of the original text at the position in the annotated text as 1 and the probability of other texts as 0; Determine the probability distribution of the characters at each position in the annotated text as a one-hot encoding of the annotated text; The one-hot encoding and the bidirectional prediction result are weightedly fused, specifically comprising: For each position in the annotated text, a probability distribution of the word at the position is weightedly fused with the probability distribution of the word at the position corresponding to the position in the bidirectional prediction result.

2. The method according to claim 1, characterized in that Obtaining a forward prediction result according to the sample text by the forward prediction subnet specifically includes: Inputting the sample text into the forward prediction subnet; Each word in the forward prediction result is predicted by the forward prediction subnet in a left-to-right order to obtain the forward prediction result.

3. The method according to claim 1, characterized in that Obtaining a backward prediction result according to the sample text by the backward prediction subnet specifically includes: Inputting the sample text into the backward prediction subnet; Each word in the backward prediction result is predicted by the backward prediction subnet in order from right to left to obtain the backward prediction result.

4. The method according to claim 1, characterized in that The speech recognition model after knowledge transfer is used for speech recognition, including: Get the target voice; Inputting the target speech into the speech model after knowledge transfer; Encoding the target speech through the encoding subnet to obtain encoding features of the target speech; Decoding the encoded features through the decoding subnet to obtain a target prediction result of the target speech; The target text is determined according to the target prediction result.

5. A speech recognition device, characterized in that: include: An acquisition module is used to acquire sample text; An input module, used for inputting the sample text into a bidirectional language model to be trained, wherein the bidirectional language model at least includes a forward prediction subnet, a backward prediction subnet, and a fusion subnet; An output module, configured to obtain a forward prediction result based on the sample text through the forward prediction subnet, and obtain a backward prediction result based on the sample text through the backward prediction subnet; A fusion module, used for fusing the forward prediction result and the backward prediction result through the fusion subnet to obtain a bidirectional prediction result; A training module, used for training the bidirectional language model according to the difference between the bidirectional prediction result and the sample text; A migration module, used for performing knowledge migration on a speech recognition model using the bidirectional language model; A recognition module, used for performing speech recognition using the speech recognition model after knowledge transfer; Wherein, the speech recognition model at least includes an encoding subnet and a decoding subnet; The migration module is specifically used to obtain a sample speech and an annotated text corresponding to the sample speech; input the annotated text into the bidirectional language model to obtain a bidirectional prediction result input by the bidirectional language model; input the sample speech into the encoding subnet to obtain the encoding features to be optimized output by the encoding subnet; input the encoding features to be optimized into the decoding subnet to obtain the prediction results to be optimized output by the decoding subnet; and train the speech recognition model according to the difference between the prediction results to be optimized and the bidirectional prediction results; The bidirectional prediction result and the prediction result to be optimized are both used to characterize the probability distribution of each word in the predicted text; The migration module is specifically used to determine the probability distribution of the word at each position in the annotated text, with the probability of the original text at the position in the annotated text being 1 and the probability of other texts being 0; determine the probability distribution of the word at each position in the annotated text as the one-hot encoding of the annotated text; and for each position in the annotated text, perform weighted fusion of the probability distribution of the word at the position and the probability distribution of the word at the position corresponding to the position in the bidirectional prediction result.

6. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.

7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method according to any one of claims 1 to 4 is implemented.