Speech recognition model training method and electronic equipment

Through a multi-stage training method, combined with word, phoneme and syllable loss functions, the phoneme and syllable recognition capabilities of the speech recognition model are improved, solving the problem of poor recognition performance in the existing technology, and achieving a more efficient speech recognition effect.

CN118538207APending Publication Date: 2024-08-23MASHANG CONSUMER FINANCE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310165745.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-02-23
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

The existing speech recognition model training methods result in poor recognition performance, especially poor performance in phoneme and syllable recognition.

Method used

Using a multi-stage training method, the initial speech recognition model is first trained using word loss, then phoneme loss is introduced based on word loss, and syllable loss is further introduced based on word and phoneme loss, and gradually through a variety of CTC and attention loss functions Improve the phoneme and syllable recognition capabilities of the model.

Benefits of technology

It significantly improves the speech recognition model's ability to recognize phonemes and syllables, improves the overall speech recognition performance, and enhances the robustness and accuracy of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118538207A
    Figure CN118538207A
Patent Text Reader

Abstract

The invention provides a voice recognition model training method and electronic equipment, and the method comprises the steps: inputting an initial feature of a training sample voice and a labeled text into an initial voice recognition model, carrying out the training through employing a first target loss, and obtaining a first voice recognition model, and the first target loss comprises a first word loss; the initial features and the labeled text are input into a first voice recognition model, training is performed by using second target loss, a second voice recognition model is obtained, and the second target loss comprises second word loss and first phoneme loss; and inputting the initial feature and the labeled text into a second speech recognition model, and training by using third target loss to obtain a target speech recognition model, the third target loss including third word loss, second phoneme loss and syllable loss. According to the method, the first word loss is firstly adopted for training, then phoneme loss training is added on the basis of the word loss, phoneme loss and syllable loss training is further added on the basis of the word loss, and the model speech recognition performance 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 machine learning technology, and in particular to a speech recognition model training method and electronic device. Background Art

[0002] Speech recognition has brought great convenience to users in life and work. The speech recognition process generally refers to acquiring speech, inputting the speech into a speech recognition model for speech recognition, and obtaining the corresponding text.

[0003] Before the speech recognition model is actually applied, it is necessary to train the model to improve the model's recognition ability. The common training method is to obtain sample speech with annotated text, train the model through the loss between the annotated text and the predicted text obtained by the model during the training process, and obtain the trained speech recognition model. However, the recognition performance of the speech recognition model obtained by the above training method is poor. Summary of the invention

[0004] The embodiments of the present application provide a speech recognition model training method and an electronic device to solve the problem that the recognition performance of the speech recognition model obtained by the existing training method is poor.

[0005] In order to solve the above technical problems, this application is implemented as follows:

[0006] In a first aspect, an embodiment of the present application provides a speech recognition model training method, comprising:

[0007] Acquire initial features of training sample speech and annotated text of the training sample speech;

[0008] Inputting the initial features and the annotated text into an initial speech recognition model, and training using a first target loss to obtain a first speech recognition model, wherein the first target loss includes a first word loss;

[0009] Inputting the initial features and the annotated text into the first speech recognition model, and training the model using a second target loss to obtain a second speech recognition model, wherein the second target loss includes a second word loss and a first phoneme loss;

[0010] The initial features and the annotated text are input into the second speech recognition model, and training is performed using a third target loss to obtain a target speech recognition model, wherein the third target loss includes a third word loss, a second phoneme loss, and a syllable loss.

[0011] In a second aspect, the present application also provides a speech recognition model training device, including:

[0012] A first acquisition module, used to acquire initial features of the training sample speech and annotated text of the training sample speech;

[0013] A first training module, configured to input the initial features and the annotated text into an initial speech recognition model, and perform training using a first target loss to obtain a first speech recognition model, wherein the first target loss includes a first word loss;

[0014] A second training module, configured to input the initial features and the annotated text into the first speech recognition model, and perform training using a second target loss to obtain a second speech recognition model, wherein the second target loss includes a second word loss and a first phoneme loss;

[0015] The third training module is used to input the initial features and the annotated text into the second speech recognition model, and train it using a third target loss to obtain a target speech recognition model. The third target loss includes a third word loss, a second phoneme loss, and a syllable loss.

[0016] In a third aspect, an embodiment of the present application further provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps in the above-mentioned speech recognition model training method when executing the computer program.

[0017] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps in the above-mentioned speech recognition model training method are implemented.

[0018] In the speech recognition model training method of the present embodiment, the first target loss is used in the process of training the initial speech recognition model, and the first target loss includes the first word loss. After the initial speech recognition model is trained to obtain the first speech recognition model, not only can the first speech recognition model be further trained, but also in the process of training the first speech recognition model, on the basis of word loss, phoneme loss is added, that is, training is performed using the second target loss including the second word loss and the first phoneme loss. After the first speech recognition model is trained to obtain the second speech recognition model, the second speech recognition model can be further trained, and in the process of training the second speech recognition model, on the basis of word loss, phoneme loss and syllable loss are added, that is, training is performed using the third target loss including the third word loss, the second phoneme loss and the syllable loss. In this way, the ability of the speech recognition model to recognize phonemes and syllables can be enhanced, the effect of speech recognition model training can be improved, and the speech recognition performance of the target speech recognition model obtained by training can be improved. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0020] Figure 1 is a flow chart of a speech recognition model training method provided in an embodiment of the present application;

[0021] Figure 2 It is an architecture diagram of a speech recognition model provided in an embodiment of the present application;

[0022] Figure 3 is a flow chart of a speech recognition method provided by an embodiment of the present application;

[0023] Figure 4 It is a structural schematic diagram of a speech recognition model training device provided in an embodiment of the present application;

[0024] Figure 5 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0025] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0026] See also Figure 1 , Figure 1 is a flow chart of a speech recognition model training method provided in an embodiment of the present application, such as Figure 1 As shown, the following steps are included:

[0027] Step 101: Obtain initial features of training sample speech and annotated text of the training sample speech.

[0028] Speech recognition is to recognize speech and obtain corresponding text. The speech data can be annotated in advance to obtain the annotated text corresponding to the speech data. The speech data with the annotated text can be used as the training sample speech of the embodiment of the present disclosure. It should be noted that the training sample speech can include multiple sample speech, each sample speech has a corresponding annotated text. In this embodiment, the initial feature can adopt FBank feature (i.e., Filter Bank feature), and multi-dimensional FBank feature of the training sample speech can be extracted. For example, 80-dimensional FBank feature can be extracted.

[0029] Step 102: Input the initial features and the annotated text into the initial speech recognition model, and train it using the first target loss to obtain a first speech recognition model, where the first target loss includes the first word loss.

[0030] The initial speech recognition model may be a pre-built speech recognition model to be trained, and the initial speech recognition model may be iteratively trained using the initial features of the training sample speech and the corresponding annotated text, and during the training process, the first target loss may be first used to train to obtain the first speech recognition model. It should be noted that the word loss may also be referred to as the text loss, and the first word loss may be used to represent the word recognition loss caused by the initial speech recognition model performing speech recognition on the training sample speech.

[0031] Step 103: input the initial features and the annotated text into the first speech recognition model, and train it using the second target loss to obtain a second speech recognition model, where the second target loss includes the second word loss and the first phoneme loss.

[0032] Phonemes are the smallest speech units divided according to the natural properties of speech. In Mandarin speech recognition, phonemes tend to be the underlying sound representation compared to characters. It should be noted that the second character loss can be used to represent the character recognition loss caused by the first speech recognition model performing speech recognition on the training sample speech, and the first phoneme loss can be used to represent the phoneme recognition loss caused by the first speech recognition model performing speech recognition on the training sample speech. In this embodiment, the first target loss can be used to train the initial speech recognition model to obtain the first speech recognition model, and then the second target loss can be used to train the first speech recognition model to obtain the second speech recognition model, that is, in the process of training the first speech recognition model, the phoneme loss is added on the basis of the character loss, which can enhance the speech recognition model's ability to recognize phonemes.

[0033] Step 104: Input the initial features and the annotated text into the second speech recognition model, and train it using the third target loss to obtain a target speech recognition model. The third target loss includes the third word loss, the second phoneme loss, and the syllable loss.

[0034] A syllable is the smallest speech unit of a single vowel phoneme and a consonant phoneme in a language. In this embodiment, a syllable can represent pinyin and add tones. Syllable loss can be used to represent the syllable recognition loss caused by the second speech recognition model performing speech recognition on the training sample speech. After the first speech recognition model is trained using the second target loss to obtain the second speech recognition model, the second speech recognition model can be further trained. In addition, in the process of training the second speech recognition model, byte loss is added on the basis of word loss and phoneme loss, which can enhance the speech recognition model's ability to recognize syllables, thereby improving the effect of speech recognition model training and improving the speech recognition performance of the obtained third speech recognition model.

[0035] In the speech recognition model training method of the present embodiment, the first target loss is used in the process of training the initial speech recognition model, and the first target loss includes the first word loss. After the initial speech recognition model is trained to obtain the first speech recognition model, not only the first speech recognition model can be further trained, but also in the process of training the first speech recognition model, on the basis of word loss, phoneme loss is added, that is, training is performed using the second target loss including the second word loss and the first phoneme loss. After the first speech recognition model is trained to obtain the second speech recognition model, the second speech recognition model can be further trained, and in the process of training the second speech recognition model, on the basis of word loss, phoneme loss and syllable loss are added, that is, training is performed using the third target loss including the third word loss, the second phoneme loss and the syllable loss. In this way, the ability of the speech recognition model to recognize phonemes and syllables can be enhanced, the effect of speech recognition model training can be improved, and the speech recognition performance of the target speech recognition model obtained by training can be improved.

[0036] In one embodiment, the initial speech recognition model includes an initial encoding network and an initial decoding network, the initial encoding network is used to encode the initial feature to obtain the first speech feature of the training sample speech, and the initial decoding network is used to decode the first speech feature to obtain the first target text (i.e., the first target word sequence);

[0037] The initial coding network includes N initial coding modules connected in sequence, N is an integer greater than 1, the first word loss is the first word connectionist temporal classification (CTC) loss, the first word CTC loss is the word loss of the first connectionist temporal classification CTC network, the first word CTC loss is used to represent the loss generated in the process of aligning the first input speech feature to annotate the text, the first input speech feature is the speech feature processed by the Nth initial coding module in the initial coding network, the first input speech feature is the feature obtained after the N-1th initial coding module in the initial coding network performs feature coding, and the Nth initial coding module in the initial coding network is used to perform feature coding on the first input speech feature to obtain the first speech feature.

[0038] It should be noted that the encoding network in the disclosed embodiment may adopt Conformer, that is, an encoder (Transform) based on convolution enhancement. The convolution module in the Conformer in this embodiment may adopt a hole convolution module. Conformer: Combining Transformer and CNN. The Transformer model is good at capturing content-based global interactions, while CNN effectively utilizes local features. In this way, the Conformer that combines Transformer and CNN has better modeling of long-term global interaction information and local features. Transformer: A timing model based on the self-attention mechanism, which can effectively encode timing information in the encoder part, and can be widely used in natural language processing, computer vision, machine translation, speech recognition and other fields.

[0039] The encoding network can perform feature encoding to obtain corresponding features. In this embodiment, during the training process, the initial features of the training sample speech and the corresponding annotated text are input into the initial speech recognition model. The initial encoding network encodes the initial features of the training sample speech to output the first speech feature. It can be understood that the last output layer of the initial encoding network outputs the first speech feature, that is, the Nth initial encoding module outputs the first speech feature. The first speech feature can be input into the initial decoding network for feature decoding to obtain the first target text, that is, the text recognized by the initial speech recognition model for the training sample speech during the training process.

[0040] It should be noted that CTC can also be understood as an alignment network that can be used for alignment learning. CTC is a way to avoid manual alignment of input and output. CTC loss can be understood as the loss generated between description sequences and sequences, and the word CTC loss function can be understood as the loss generated between description sequences and word sequences (which can be understood as annotated text), that is, the loss generated by the process of describing the alignment of speech features into annotated text. In this embodiment, the initial speech recognition model is trained using the first target loss including the first word loss to obtain a first speech recognition model. The first speech recognition model has the same structure as the initial recognition model, except that the model parameters are different, and the first speech recognition model includes a first encoding network and a first decoding network.

[0041] In addition, it can be understood that the first character CTC loss is the character loss obtained by the first CTC network after the first speech feature is input into the first CTC network. The first character CTC loss is used to represent the loss generated in the process of aligning the first input speech feature to the annotated text. It can also be understood as the character CTC loss caused by the initial encoding network. It can also be understood as being used to represent the difference between the initial recognized text and the annotated text obtained by the initial encoding network for speech recognition based on the CTC mechanism. For example, the first speech feature obtained by the Nth initial encoding module of the initial encoding network can be input into the first CTC, and the first CTC can be based on the first speech feature to obtain the above-mentioned initial recognition text.

[0042] The first input speech feature is input to the Nth initial coding module, and the Nth initial coding module can obtain the first speech feature by feature encoding the first input speech feature. The first input speech feature is the feature obtained after the N-1th initial coding module performs feature encoding processing on the feature obtained by the N-2th initial coding module in the initial coding network. It should be noted that the first initial coding module of the initial coding network performs feature encoding on the above-mentioned initial feature, and the feature obtained by the first initial coding module through feature encoding of the above-mentioned initial feature is input to the second initial coding module of the initial coding network for feature encoding processing, and so on. That is, in the initial coding network, the feature obtained by feature encoding by the previous initial coding module can be input to the next initial coding module for processing.

[0043] In this embodiment, during the training of the first speech recognition module, the first target loss used includes the first word CTC loss, which can improve the word recognition ability of the speech recognition model, thereby improving the recognition performance of the trained speech recognition model.

[0044] In one embodiment, the first word CTC loss is the negative value of the natural logarithm of the first probability, and the first probability is the probability of the annotated text obtained by the CTC network corresponding to the first word CTC loss when the Nth initial encoding module processes the first input speech feature; wherein, the first target loss also includes a first attention loss, and the first attention loss is the result of the first attention loss function based on the first target text and the annotated text.

[0045] The first word CTC loss can be calculated by the following formula:

[0046] L CTC1 = -logP CTC (y1|x1(N));

[0047] Among them, L CTC1 is the first word CTC loss, y1 represents the word label (annotated text), x1(N) represents the input of the Nth initial encoding module, that is, the first input speech feature, P CTC (y1|x1(N)) represents the first probability, which means that when the input of the Nth initial encoding module is x1(N), the first CTC network obtains the conditional probability of the word label y1, that is, the word label probability of CTC. It can also be understood that P CTC (y1|x1(N)) can represent the posterior probability between the first word sequence (i.e., the word sequence obtained by the first CTC processing the first speech feature, and the first speech feature is obtained by encoding the input x1(N) through the Nth initial encoding module in the initial encoding network) and the annotated text.

[0048] In the model training process of this embodiment, word CTC loss and attention loss are added. In this way, the initial speech recognition model is trained by the first target loss including the first word CTC loss and the first attention loss to obtain a first speech recognition model, which can improve the model training effect and the recognition performance of the trained speech recognition model.

[0049] In one embodiment, the first target loss is a weighted sum of a first word CTC loss and a first attention loss, and the first attention loss is a result of a first attention loss function based on the first target text and the annotated text.

[0050] It should be noted that the first attention loss function can be used to describe the loss generated by the attention mechanism in the initial speech recognition model. In one example, the attention loss in the embodiment of the present disclosure can adopt cross entropy loss or label smoothing loss.

[0051] It should be noted that the weighted weight of the first word CTC loss and the weighted weight of the first attention loss can be set in advance based on experience, and the weighted weight of the first word CTC loss and the weighted weight of the first attention loss are both greater than 0 and less than 1.

[0052] In the model training process of this embodiment, word CTC loss is added. In this way, the initial speech recognition model is trained with a first target loss value which is the weighted sum of the first word CTC loss and the first attention loss to obtain a first speech recognition model. This can improve the model training effect and the recognition performance of the trained speech recognition model.

[0053] In one embodiment, the first speech recognition model includes a first encoding network and a first decoding network, the first encoding network is used to encode the initial features to obtain the first speech phoneme features and the second speech features of the training sample speech, and the first decoding network is used to decode the second speech features to obtain the second target text (also called the second target word sequence);

[0054] The first encoding network includes N first encoding modules connected in sequence, N is an integer greater than 1, the second word loss is the second word CTC loss, the second word CTC loss is the word loss of the first connected temporal classification CTC network, the second word CTC loss is used to represent the loss generated in the process of aligning the second input speech feature to annotate the text, the second input speech feature is the speech feature processed by the Nth first encoding module in the first encoding network, the second input speech feature is the feature obtained after the N-1th first encoding module in the first encoding network performs feature encoding, and the Nth first encoding module in the first encoding network is used to perform feature encoding on the second input speech feature to obtain the second speech feature;

[0055] The first phoneme loss is the first phoneme CTC loss, the first phoneme CTC loss is the phoneme loss of the second CTC network, the first phoneme CTC loss is used to represent the loss generated in the process of aligning the third input speech feature to the labeled phoneme corresponding to the training sample speech, the third input speech feature is the feature obtained after the I-th first encoding module in the first encoding network performs feature encoding, the I+1-th first encoding module in the first encoding network is used to perform feature encoding on the third input speech feature to obtain the first speech phoneme feature, and I is a positive integer less than N-1.

[0056] It can be understood that the second word CTC loss is the word loss obtained by the first CTC network after the second speech feature is input into the first CTC network. The first word CTC loss is used to represent the loss generated in the process of aligning the second input speech feature to the annotated text. It can also be understood as the word CTC loss caused by the first encoding network. It can also be understood as being used to represent the difference between the first recognized text and the annotated text obtained by the first encoding network for speech recognition based on the CTC mechanism. For example, the second speech feature obtained by the Nth first encoding module of the first encoding network can be input into the first CTC, and the first CTC can be based on the second speech feature to obtain the above-mentioned first recognized text.

[0057] During the training process of the first speech recognition model, the first speech recognition model can not only encode the initial features of the training sample speech to output the second speech feature, which can be understood as the last output layer of the first encoding network outputting the second speech feature, but also use the first speech recognition model to encode the training sample speech to obtain the first speech phoneme feature. For example, the first encoding network may include N (an integer greater than 1) first encoding modules (i.e., Conformer modules) connected in sequence, the second speech feature is the speech feature output by the last encoding module among the N first encoding modules, the first speech phoneme feature can be a coding module among other first coding modules (for example, the I+1th first coding module) encoding the speech feature output by its previous coding module, and the other first coding modules are modules other than the last coding module among the N first coding modules.

[0058] It can be understood that the first phoneme CTC loss is the phoneme loss obtained by the first CTC network after the first speech phoneme feature is input into the second CTC network. The first phoneme CTC loss is used to represent the loss generated in the process of aligning the third input speech feature to the annotated phoneme. It can also be understood as the phoneme CTC loss caused by the first encoding network. It can also be understood as being used to represent the difference between the first recognized phoneme and the annotated phoneme obtained by the first encoding network for speech recognition based on the CTC mechanism. For example, the first speech phoneme feature obtained by the I+1th first encoding module of the first encoding network can be input into the second CTC, and the second CTC can be based on the first speech phoneme feature to obtain the above-mentioned first recognized phoneme.

[0059] In this embodiment, during the feature encoding process of the first encoding network, not only the second speech feature but also the intermediate speech feature, i.e., the first speech phoneme feature, can be obtained. During the training of the first speech recognition module, the second target loss used includes not only the second word CTC loss but also the first phoneme CTC loss on this basis, so as to improve the ability of the speech recognition model to recognize phonemes, thereby improving the recognition performance of the trained speech recognition model.

[0060] In one embodiment, the second word CTC loss is the negative value of the natural logarithm of the second probability, where the second probability is the probability of the annotated text obtained by the CTC corresponding to the second word CTC loss when the Nth first encoding module processes the third input speech feature;

[0061] The first phoneme CTC loss is the negative value of the natural logarithm of the third probability, and the third probability is the probability of the annotated phoneme obtained by the CTC network corresponding to the first phoneme CTC loss when the third input speech feature is processed by the I+1th first encoding module. The second target loss also includes a second attention loss, and the second attention loss is the result of the second attention loss function based on the second target text and the annotated text.

[0062] The second word CTC loss can be calculated by the following formula:

[0063] L CTC2 = -logP CTC (y1|x2(N));

[0064] Among them, L CTC2 is the second word CTC loss, y1 represents the word label (annotated text), x2(N) represents the input of the Nth first encoding module, that is, the second input speech feature, P CTC (y1|x2(N)) represents the second probability, which means that when the input of the Nth first encoding module is x2(N), the first CTC network obtains the conditional probability of the word label y1, that is, the word label probability of CTC. It can also be understood that P CTC (y1|x2(N)) can represent the posterior probability between the second word sequence (i.e., the word sequence obtained by the first CTC processing the second speech feature, and the second speech feature is obtained by encoding the input x2(N) through the Nth first encoding module in the first encoding network) and the annotated text.

[0065] The first phoneme CTC loss can be calculated by the following formula:

[0066] L CTC_phoneme1 = -logP CTC (y2|x3(I+1));

[0067] Wherein, y2 represents the phoneme label (labeled phoneme / labeled phoneme sequence), x3(I+1) represents the input of the I+1th first encoding module, that is, the feature obtained by the feature encoding of the Ith first encoding module, that is, the third input speech feature, P CTC(y2|x3(I+1)) represents the third probability, which means that when the input of the first encoding module is x3(I+1), the second CTC obtains the conditional probability of the phoneme label y2, that is, the phoneme label probability of CTC. It can also be understood that P CTC (y2|x3(I+1)) can represent the posterior probability between the first phoneme sequence (i.e., the phoneme sequence obtained by the second CTC processing the first speech phoneme feature, and the first speech phoneme feature is obtained by encoding the input x3(I+1) through the I+1th first encoding module in the first encoding network) and the annotated phoneme sequence.

[0068] In the model training process of this embodiment, word CTC loss and attention loss are added. In this way, the first speech recognition model is trained by the second target loss including the second word CTC loss, the first phoneme CTC loss and the second attention loss to obtain the second speech recognition model. This can improve the model training effect and the recognition performance of the trained speech recognition model.

[0069] In one embodiment, the second target loss is a weighted sum of the second word CTC loss, the first phoneme CTC loss, and the second attention loss, and the second attention loss is a result of the second attention loss function based on the second target text and the annotated text.

[0070] It should be noted that the second attention loss function can be used to describe the loss generated by the attention mechanism in the first speech recognition model. The weighted weight of the second word CTC loss, the weighted weight of the first phoneme CTC loss, and the weighted weight of the second attention loss can be set in advance based on experience, and the weighted weight of the second word CTC loss, the weighted weight of the first phoneme CTC loss, and the weighted weight of the second attention loss are all greater than 0 and less than 1.

[0071] In the model training process of this embodiment, word CTC loss and phoneme CTC loss are added. In this way, the first speech recognition model is trained by using a second target loss value which is a weighted sum of the weighted weights of the second word CTC loss, the first phoneme CTC loss and the second attention loss to obtain a second speech recognition model. This can improve the model training effect and the recognition performance of the trained speech recognition model.

[0072] In one embodiment, the second speech recognition model includes a second encoding network and a second decoding network, the second encoding network is used to encode the training sample speech to obtain the second speech phoneme feature, speech syllable feature and third speech feature of the training sample speech, and the second encoding network is used to decode the third speech feature to obtain a third target text (also called a third target word sequence);

[0073] The second encoding network includes N second encoding modules connected in sequence, N is an integer greater than 1, the third word loss is the third word CTC loss, the third word CTC loss is the word loss of the first connected temporal classification CTC network, the third word CTC loss is used to represent the loss generated in the process of aligning the fourth input speech feature to annotate the text, the fourth input speech feature is the speech feature processed by the Nth second encoding module in the second encoding network, the fourth input speech feature is the feature obtained after the N-1th second encoding module in the second encoding network performs feature encoding, and the Nth second encoding module in the second encoding network is used to perform feature encoding on the fourth input speech feature to obtain the third speech feature;

[0074] The second phoneme loss is the second phoneme CTC loss, the second phoneme CTC loss is the phoneme loss of the second CTC network, the second phoneme CTC loss is used to represent the loss generated in the process of aligning the fifth input speech feature to the annotated phoneme corresponding to the training sample speech, the fifth input speech feature is the feature obtained after the I-th second encoding module in the second encoding network performs feature encoding, the I+1-th second encoding module in the second encoding network is used to perform feature encoding on the fifth input speech feature to obtain the second speech phoneme feature, and I is a positive integer less than N-1;

[0075] The syllable loss is the syllable CTC loss. The syllable CTC loss is the syllable loss of the third CTC network. The syllable CTC loss is used to represent the loss generated in the process of aligning the sixth input speech feature to the labeled syllable corresponding to the training sample speech. The sixth input speech feature is the feature obtained after feature encoding by the Jth second encoding module in the second encoding network. The J+1th second encoding module in the second encoding network is used to feature encode the sixth input speech feature to obtain a speech syllable feature. J is an integer greater than I and less than N-1.

[0076] It should be noted that after the first speech recognition model is trained, the second speech recognition model is obtained, that is, after the first coding network is trained, the second coding network is obtained, the second coding network may include N second coding modules after training, the third speech feature is the speech feature output by the last coding module among the N second coding modules, the second speech phoneme feature may be the speech feature obtained by encoding the speech feature output by the I+1th second coding module among the other second coding modules (the Ith second coding module) of the previous coding module, the other second coding modules are the modules other than the last second coding module among the N second coding modules, the speech syllable feature may be the speech feature obtained by encoding the speech feature output by the J+1th second coding module among the other second coding modules, and J is an integer greater than I and less than N-1.

[0077] It can be understood that the third character CTC loss is the character loss obtained by the first CTC network after the third speech feature is input into the first CTC network. The third character CTC loss is used to represent the loss generated in the process of aligning the fourth input speech feature to the annotated text. It can also be understood as the character CTC loss caused by the second encoding network. It can also be understood as being used to represent the difference between the second recognized text obtained by the second encoding network based on the CTC mechanism for speech recognition and the annotated text. For example, the third speech feature obtained by the Nth second encoding module of the second encoding network can be input into the first CTC, and the first CTC can be based on the third speech feature to obtain the above-mentioned second recognized text by processing.

[0078] It can be understood that the second phoneme CTC loss is the phoneme loss obtained by the first CTC network after the second speech phoneme feature is input into the second CTC network. The second phoneme CTC loss is used to represent the loss generated in the process of aligning the fifth input speech feature to the annotated phoneme. It can also be understood as the phoneme CTC loss caused by the second encoding network. It can also be understood as being used to represent the difference between the second recognized phoneme and the annotated phoneme obtained by the second encoding network for speech recognition based on the CTC mechanism. For example, the second speech phoneme feature obtained by the I+1th second encoding module of the second encoding network can be input into the second CTC, and the second CTC can be based on the second speech phoneme feature to obtain the above-mentioned second recognized phoneme.

[0079] It can be understood that the syllable CTC loss is the syllable loss obtained by the third CTC network after the speech syllable features are input into the third CTC network. The syllable CTC loss is used to represent the loss generated in the process of aligning the sixth input speech features to the labeled syllables. It can also be understood as the syllable CTC loss caused by the second encoding network. It can also be understood as being used to represent the difference between the recognized syllable and the labeled syllable obtained by the second encoding network for speech recognition based on the CTC mechanism. For example, the speech syllable features obtained by the J+1th second encoding module of the second encoding network can be input into the third CTC, and the third CTC can be processed based on the speech syllable features to obtain the above-mentioned recognized syllables.

[0080] In this embodiment, during the feature encoding process of the second encoding network, not only the third speech feature but also the intermediate speech feature, namely the second speech phoneme feature and the speech syllable feature, can be obtained. During the training of the second speech recognition module, the third target loss adopted includes not only the third word CTC loss but also the second phoneme CTC loss and the syllable CTC loss on this basis, so as to improve the ability of the speech recognition model to recognize phonemes and syllables, thereby improving the recognition performance of the trained speech recognition model.

[0081] In one embodiment, the third word CTC loss is the negative value of the natural logarithm of the fourth probability, where the fourth probability is the probability of the annotated text obtained by the CTC network corresponding to the third word CTC loss when the Nth second encoding module processes the fourth input speech feature;

[0082] The second phoneme CTC loss is the negative value of the natural logarithm of the fifth probability, where the fifth probability is the probability of the annotated phoneme obtained by the CTC network corresponding to the second phoneme CTC loss when the fifth input speech feature is processed by the (I+1)th first encoding module;

[0083] The syllable CTC loss is the negative value of the natural logarithm of the sixth probability. The sixth probability is the probability of the labeled syllable obtained by the CTC network corresponding to the syllable CTC loss when the J+1th second encoding module processes the sixth input speech feature. The third target loss also includes a third attention loss, which is the result of the third attention loss function based on the third target text and the labeled text.

[0084] The third word CTC loss can be calculated by the following formula:

[0085] L CTC3 = -logP CTC (y1|x4(N));

[0086] Among them, L CTC3 is the third word CTC loss, y1 represents the word label (annotated text), x4(N) represents the input of the Nth second encoding module, that is, the fourth input speech feature, P CTC (y1|x4(N)) represents the fourth probability, which means that when the input of the Nth second encoding module is x4(N), the first CTC network obtains the conditional probability of the word label y1, that is, the word label probability of CTC. It can also be understood that P CTC (y1|x4(N)) can represent the posterior probability between the third word sequence (i.e., the word sequence obtained by the first CTC processing the third speech feature, and the third speech feature is obtained by encoding the input x4(N) through the Nth second encoding module in the second encoding network) and the annotated text.

[0087] The second phoneme CTC loss can be calculated by the following formula:

[0088] L CTC_phoneme2 = -logP CTC (y2|x5(I+1));

[0089] Wherein, y2 represents the phoneme label (annotated phoneme), x5(I+1) represents the input of the I+1th second encoding module, that is, the feature obtained by the feature encoding of the Ith second encoding module, that is, the fifth input speech feature, PCTC (y2|x5(I+1)) represents the fifth probability, which means that when the input of the I+1th second encoding module is x5(I+1), the second CTC obtains the conditional probability of the phoneme label y2, that is, the phoneme label probability of the CTC. It can also be understood that P CTC (y2|x5(I+1)) can represent the posterior probability between the second phoneme sequence (i.e., the phoneme sequence obtained by the second CTC processing the second speech phoneme feature, and the second speech phoneme feature is obtained by encoding the input x5(I+1) through the I+1th second encoding module in the second encoding network) and the annotated phoneme sequence.

[0090] The syllable CTC loss can be calculated by the following formula:

[0091] L CTC_syllable = -logP CTC (y3|x5(J+1));

[0092] Wherein, y3 represents the syllable label (labeled syllable / labeled syllable sequence), x5(J+1) represents the input of the J+1th second encoding module, that is, the feature obtained by the feature encoding of the Jth second encoding module, that is, the sixth input speech feature, P CTC (y3|x5(J+1)) represents the sixth probability, which means that when the input of the J+1th second encoding module is x5(J+1), the third CTC obtains the conditional probability of the syllable label y3, that is, the syllable label probability of the CTC. It can also be understood that P CTC (y2|x5(J+1)) can represent the posterior probability between the syllable sequence (i.e., the syllable sequence obtained by the third CTC processing the speech syllable features, and the speech syllable features are encoded by the J+1th second encoding module in the second encoding network to encode the input x5(J+1)) and the labeled syllable sequence.

[0093] In the model training process of this embodiment, word CTC loss, phoneme CTC loss and syllable CTC loss are added, and attention loss is added. In this way, the second speech recognition model is trained by the third target loss including the third word CTC loss, the second phoneme CTC loss, the syllable CTC loss and the third attention loss to obtain the target speech recognition model, which can improve the model training effect and the recognition performance of the trained speech recognition model.

[0094] In one embodiment, the third target loss is a weighted sum of a third character CTC loss, a second phoneme CTC loss, a syllable loss and a third attention loss, and the third attention loss is a result of a third attention loss function based on the third target text and the annotated text.

[0095] It should be noted that the third attention loss function can be used to describe the loss generated by the attention mechanism in the second speech recognition model. The weighted weight of the third word CTC loss, the weighted weight of the second phoneme CTC loss, the weighted weight of the syllable CTC loss, and the weighted weight of the third attention loss can be set in advance based on experience, and the weighted weight of the third word CTC loss, the weighted weight of the second phoneme CTC loss, the weighted weight of the syllable CTC loss, and the weighted weight of the third attention loss are all greater than 0 and less than 1.

[0096] In the model training process of this embodiment, word CTC loss, phoneme CTC loss and syllable CTC loss are added. In this way, the second speech recognition model is trained by using the third target loss value which is the weighted sum of the weighted weights of the third word CTC loss, the second phoneme CTC loss, the syllable CTC loss and the third attention loss to obtain the target speech recognition model, which can improve the model training effect and the recognition performance of the trained speech recognition model.

[0097] In one embodiment, the initial features and the annotated text are input into the second speech recognition model, and training is performed using the third target loss to obtain the target speech recognition model, and further includes:

[0098] Get the speech to be recognized;

[0099] Extracting initial features of the speech to be recognized;

[0100] The initial features of the speech to be recognized are input into the target speech recognition model for speech recognition to obtain the target recognition text.

[0101] After the training is completed and the target speech recognition model is obtained, it can be applied to the actual speech recognition scenario to obtain the speech to be recognized and extract its corresponding initial features. The initial features of the speech to be recognized are input into the target speech recognition model, and speech recognition is performed through the target speech recognition model to obtain the target recognition text corresponding to the speech to be recognized. In this embodiment, in the process of training to obtain the target speech recognition model, the first target loss is adopted in the process of training the initial speech recognition model, and the first target loss includes the first word loss. After the initial speech recognition model is trained to obtain the first speech recognition model, not only the first speech recognition model can be further trained, but also in the process of training the first speech recognition model, on the basis of word loss, phoneme loss is added, that is, the second target loss including the second word loss and the first phoneme loss is used for training. After the first speech recognition model is trained to obtain the second speech recognition model, the second speech recognition model can be further trained, and in the process of training the second speech recognition model, on the basis of word loss, phoneme loss and syllable loss are added, that is, the third target loss including the third word loss, the second phoneme loss and the syllable loss is used for training. In this way, the ability of the speech recognition model to recognize phonemes and syllables can be enhanced, the effect of speech recognition model training can be improved, and the speech recognition performance of the target speech recognition model obtained by training can be improved. In this way, the target speech recognition model obtained by this training method recognizes the speech to be recognized, and the speech recognition accuracy can be improved.

[0102] The process of the above method is described in detail below with a specific embodiment. Figure 2 As shown, an architecture diagram of a speech recognition model is provided in an embodiment of the present disclosure. The process of the method in this embodiment is as follows:

[0103] The voice data can be indexed (annotated) in advance to obtain the text index (i.e., annotated text, also known as annotated word sequence) corresponding to each voice call;

[0104] In the above module architecture, the convolution module in the Conformer model can adopt a dilated convolution module. Due to the subsequent use of phoneme modeling, the modeling granularity is more detailed, and the dilated convolution can capture a larger receptive field. When the speech duration is short, the above module architecture can effectively improve the recognition effect of short speech. First, use CTC loss and attention loss, that is, the first word loss and the first attention loss, to train the initial speech recognition model, in which the initial encoding network includes N (an integer greater than 1, such as 16) encoding modules (Conformerblock), and the initial decoding network includes L (an integer greater than 1, such as 6) decoding layers. When the training loss converges, the first speech recognition model is obtained, and the Conformer Encoder (encoding) and Transformer Decoder (decoding) network parameters are saved.

[0105] Load the first speech recognition model obtained by the above training, use all the above architectures, introduce the intermediate layer vector (i.e., intermediate speech features) of the encoding network, add the phoneme CTC loss to the i-th (greater than 1, i+1, for example, 8) encoding module, and perform weighted sum calculation according to the preset weights. When the loss converges, the training is completed, the second speech recognition model is obtained, and the model parameters are saved.

[0106] Load the second speech recognition model obtained by adding the phoneme CTC loss training, add the syllable CTC loss to the jth (greater than i, J+1, for example, 12) encoding module of the encoding network, perform weighted sum calculation according to the predetermined weights, and when the loss converges, complete the training, obtain the target speech recognition model, and save the model parameters.

[0107] Among them, the phoneme CTC loss is called the phoneme CTC loss L CTC_phoneme , in the process of training the second speech recognition model, the second phoneme CTC loss can be represented, and the syllable CTC loss is called L ATT_syllable .

[0108] Phoneme CTC loss L CTC_phoneme The expression is as follows:

[0109] L CTC_phoneme = -logP CTC (y2|x5(i));

[0110] Among them, y2 represents the phoneme label (annotated phoneme), x5(i) represents the input of the i-th encoding module in the second encoding network, and P CTC (y2|x5(i)) means the conditional probability of getting the phoneme label y2 when the input is x5(i), that is, the phoneme label probability of CTC. It can also be understood that PCTC (y2|x5(i)) can represent the posterior probability between the phoneme sequence (i.e., the phoneme sequence obtained by the second CTC processing the speech phoneme features, and the speech phoneme features are obtained by encoding the input x5(i) through the i-th encoding module in the second encoding network) and the annotated phoneme sequence.

[0111] Syllable CTC loss L CTC_syllable The expression is as follows:

[0112] L CTC_syllable = -logP CTC (y3|x5(j));

[0113] Among them, y3 represents the label, x5(j) represents the input of the jth encoding module in the second encoding network, and P CTC (y3|x5(j)) means the conditional probability of getting the syllable label y3 when the input is x5(j), that is, the syllable label probability of CTC. It can also be understood that P CTC (y3|x5(j)) can represent the posterior probability between the syllable sequence (i.e., the syllable sequence obtained by the third CTC processing the speech syllable features, and the speech syllable features are obtained by encoding the input x5(j) through the jth encoding module in the second encoding network) and the annotated syllable word sequence.

[0114] The total loss of CTC is expressed as follows:

[0115] L CTC_total =λ*L CTC_phoneme +w*L CTC_syllable +(1-λ-w)*L CTC ;

[0116] Among them, λ is the phoneme weight, w is the syllable weight, which can be determined in advance according to experiments or actual applications. For example, the value of λ can be 0.2, the value of w can be 0.2, L CTC is the word CTC loss, and can represent the third word CTC loss during the training of the second speech recognition model.

[0117] During training, the total loss is expressed as follows:

[0118] L total =k*L CTC_total +(1-k)*L ATT_total ;

[0119] The value of k can be determined in advance based on experiments or actual application conditions, and L ATT_total For attention loss, a third attention loss can be represented during the training of the second speech recognition model.

[0120] After the training is completed, the target speech recognition model is obtained. When the target speech recognition model is applied, Figure 3 As shown, the speech to be recognized can be obtained first, the initial features of the speech to be recognized (such as multi-dimensional (such as 80) fbank features) can be extracted, and sent to the target speech recognition model for speech recognition to obtain the speech recognition result, that is, the target recognition text.

[0121] In the training method of the embodiment of the present disclosure, phoneme information and syllable information are integrated into the intermediate coding module layer, and on this basis, the traditional convolution module is replaced with a hole convolution module to adapt to the modeling of phoneme and syllable information at different granularities. This makes the model more robust and effectively improves the accuracy of the model without affecting efficiency. In addition, in the training method, a three-stage training method is also used, that is, first training word loss, then training phoneme loss, and then training syllable loss, so that the convergence is more detailed, preventing the training process from oscillating and affecting the convergence effect, and improving the performance of the trained speech recognition model.

[0122] See also Figure 4 , Figure 4 A schematic diagram of the structure of a speech recognition model training device provided in an embodiment of the present application, the speech recognition model training device 400 comprises:

[0123] The first acquisition module 401 is used to acquire the initial features of the training sample speech and the annotated text of the training sample speech;

[0124] A first training module 402 is used to input the initial features and the annotated text into an initial speech recognition model, and train the model using a first target loss to obtain a first speech recognition model, wherein the first target loss includes a first word loss;

[0125] A second training module 403 is used to input the initial features and the annotated text into the first speech recognition model, and train the model using a second target loss to obtain a second speech recognition model, where the second target loss includes a second word loss and a first phoneme loss;

[0126] The third training module 404 is used to input the initial features and the annotated text into the second speech recognition model, and train it using the third target loss to obtain a target speech recognition model. The third target loss includes a third word loss, a second phoneme loss, and a syllable loss.

[0127] In one embodiment, the initial speech recognition model includes an initial encoding network and an initial decoding network, the initial encoding network is used to encode the initial feature to obtain the first speech feature of the training sample speech, and the initial decoding network is used to decode the first speech feature to obtain the first target text;

[0128] The initial coding network includes N initial coding modules connected in sequence, N is an integer greater than 1, the first word loss is the first word CTC loss, the first word CTC loss is the word loss of the first connected temporal classification CTC network, the first word CTC loss is used to represent the loss generated in the process of aligning the first input speech feature to annotate the text, the first input speech feature is the speech feature processed by the Nth initial coding module in the initial coding network, the first input speech feature is the feature obtained after the N-1th initial coding module in the initial coding network performs feature coding, and the Nth initial coding module in the initial coding network is used to perform feature coding on the first input speech feature to obtain the first speech feature.

[0129] In one embodiment, the first word CTC loss is the negative value of the natural logarithm of the first probability, where the first probability is the probability of the annotated text obtained by the CTC network corresponding to the first word CTC loss when the Nth initial encoding module processes the first input speech feature;

[0130] The first target loss also includes a first attention loss, which is a result of a first attention loss function based on the first target text and the annotated text.

[0131] In one embodiment, the first speech recognition model includes a first encoding network and a first decoding network, the first encoding network is used to encode the initial features to obtain the first speech phoneme features and the second speech features of the training sample speech, and the first decoding network is used to decode the second speech features to obtain the second target text;

[0132] The first encoding network includes N first encoding modules connected in sequence, N is an integer greater than 1, the second word loss is the second word CTC loss, the second word CTC loss is the word loss of the first connected temporal classification CTC network, the second word CTC loss is used to represent the loss generated in the process of aligning the second input speech feature to annotate the text, the second input speech feature is the speech feature processed by the Nth first encoding module in the first encoding network, the second input speech feature is the feature obtained after the N-1th first encoding module in the first encoding network performs feature encoding, and the Nth first encoding module in the first encoding network is used to perform feature encoding on the second input speech feature to obtain the second speech feature;

[0133] The first phoneme loss is the first phoneme CTC loss, the first phoneme CTC loss is the phoneme loss of the second CTC network, the first phoneme CTC loss is used to represent the loss generated in the process of aligning the third input speech feature to the labeled phoneme corresponding to the training sample speech, the third input speech feature is the feature obtained after the I-th first encoding module in the first encoding network performs feature encoding, the I+1-th first encoding module in the first encoding network is used to perform feature encoding on the third input speech feature to obtain the first speech phoneme feature, and I is a positive integer less than N-1.

[0134] In one embodiment, the second word CTC loss is the negative value of the natural logarithm of the second probability, where the second probability is the probability of the annotated text obtained by the CTC corresponding to the second word CTC loss when the Nth first encoding module processes the third input speech feature;

[0135] The first phoneme CTC loss is the negative value of the natural logarithm of the third probability, and the third probability is the probability of the annotated phoneme obtained by the CTC network corresponding to the first phoneme CTC loss when the third input speech feature is processed by the I+1th first encoding module. The second target loss also includes a second attention loss, and the second attention loss is the result of the second attention loss function based on the second target text and the annotated text.

[0136] In one embodiment, the second speech recognition model includes a second encoding network and a second decoding network, the second encoding network is used to encode the training sample speech to obtain the second speech phoneme feature, speech syllable feature and third speech feature of the training sample speech, and the second encoding network is used to decode the third speech feature to obtain the third target text;

[0137] The second encoding network includes N second encoding modules connected in sequence, N is an integer greater than 1, the third word loss is the third word CTC loss, the third word CTC loss is the word loss of the first connected temporal classification CTC network, the third word CTC loss is used to represent the loss generated in the process of aligning the fourth input speech feature to annotate the text, the fourth input speech feature is the speech feature processed by the Nth second encoding module in the second encoding network, the fourth input speech feature is the feature obtained after the N-1th second encoding module in the second encoding network performs feature encoding, and the Nth second encoding module in the second encoding network is used to perform feature encoding on the fourth input speech feature to obtain the third speech feature;

[0138] The second phoneme loss is the second phoneme CTC loss, the second phoneme CTC loss is the phoneme loss of the second CTC network, the second phoneme CTC loss is used to represent the loss generated in the process of aligning the fifth input speech feature to the annotated phoneme corresponding to the training sample speech, the fifth input speech feature is the feature obtained after the I-th second encoding module in the second encoding network performs feature encoding, the I+1-th second encoding module in the second encoding network is used to perform feature encoding on the fifth input speech feature to obtain the second speech phoneme feature, and I is a positive integer less than N-1;

[0139] The syllable loss is the syllable CTC loss. The syllable CTC loss is the syllable loss of the third CTC network. The syllable CTC loss is used to represent the loss generated in the process of aligning the sixth input speech feature to the labeled syllable corresponding to the training sample speech. The sixth input speech feature is the feature obtained after feature encoding by the Jth second encoding module in the second encoding network. The J+1th second encoding module in the second encoding network is used to feature encode the sixth input speech feature to obtain a speech syllable feature. J is an integer greater than I and less than N-1.

[0140] In one embodiment, the third word CTC loss is the negative value of the natural logarithm of the fourth probability, where the fourth probability is the probability of the annotated text obtained by the CTC network corresponding to the third word CTC loss when the Nth second encoding module processes the fourth input speech feature;

[0141] The second phoneme CTC loss is the negative value of the natural logarithm of the fifth probability, where the fifth probability is the probability of the annotated phoneme obtained by the CTC network corresponding to the second phoneme CTC loss when the fifth input speech feature is processed by the (I+1)th first encoding module;

[0142] The syllable CTC loss is the negative value of the natural logarithm of the sixth probability. The sixth probability is the probability of the labeled syllable obtained by the CTC network corresponding to the syllable CTC loss when the J+1th second encoding module processes the sixth input speech feature. The third target loss also includes a third attention loss, which is the result of the third attention loss function based on the third target text and the labeled text.

[0143] In one embodiment, the apparatus 400 further includes:

[0144] A second acquisition module is used to acquire the speech to be recognized;

[0145] An extraction module, used to extract initial features of the speech to be recognized;

[0146] The recognition module is used to input the initial features of the speech to be recognized into the target speech recognition model for speech recognition to obtain the target recognition text.

[0147] The speech recognition model training device provided in the embodiment of the present application can implement each process in the above-mentioned speech recognition model training method embodiment, and the technical features correspond one to one. In order to avoid repetition, they will not be repeated here.

[0148] like Figure 5 As shown, an embodiment of the present application also provides an electronic device 500, including a processor 510, a memory 520, and a computer program stored in the memory 520 and executable on the processor 510. When the computer program is executed by the processor 510, each process of the above-mentioned model training method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.

[0149] The embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, each process of the above-mentioned speech recognition model training method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. Among them, the computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.

[0150] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article 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, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0151] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0152] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. A speech recognition model training method, characterized in that: include: Acquire initial features of training sample speech and annotated text of the training sample speech; Inputting the initial features and the annotated text into an initial speech recognition model, and training using a first target loss to obtain a first speech recognition model, wherein the first target loss includes a first word loss; Inputting the initial features and the annotated text into the first speech recognition model, and training the model using a second target loss to obtain a second speech recognition model, wherein the second target loss includes a second word loss and a first phoneme loss; The initial features and the annotated text are input into the second speech recognition model, and training is performed using a third target loss to obtain a target speech recognition model, wherein the third target loss includes a third word loss, a second phoneme loss, and a syllable loss.

2. The method according to claim 1, characterized in that The initial speech recognition model includes an initial encoding network and an initial decoding network, wherein the initial encoding network is used to encode the initial feature to obtain a first speech feature of the training sample speech, and the initial decoding network is used to decode the first speech feature to obtain a first target text; The initial coding network includes N initial coding modules connected in sequence, N is an integer greater than 1, the first word loss is the first word CTC loss, the first word CTC loss is the word loss of the first connected temporal classification CTC network, the first word CTC loss is used to represent the loss generated in the process of aligning the first input speech feature to the annotated text, the first input speech feature is the speech feature processed by the Nth initial coding module in the initial coding network, the first input speech feature is the feature obtained after the N-1th initial coding module in the initial coding network performs feature coding, and the Nth initial coding module in the initial coding network is used to perform feature coding on the first input speech feature to obtain the first speech feature.

3. The method according to claim 2, characterized in that The first character CTC loss is a negative value of a natural logarithm of a first probability, where the first probability is a probability of the annotated text obtained by a CTC network corresponding to the first character CTC loss when the Nth initial encoding module processes the first input speech feature; The first target loss also includes a first attention loss, which is a result of a first attention loss function based on the first target text and the annotated text.

4. The method according to claim 1, characterized in that: The first speech recognition model includes a first encoding network and a first decoding network, the first encoding network is used to encode the initial features to obtain the first speech phoneme features and the second speech features of the training sample speech, and the first decoding network is used to decode the second speech features to obtain the second target text; The first encoding network includes N first encoding modules connected in sequence, N is an integer greater than 1, the second word loss is a second word CTC loss, the second word CTC loss is a word loss of the first connected temporal classification CTC network, the second word CTC loss is used to indicate that the second input speech feature is aligned to the loss generated in the process of annotating the text, the second input speech feature is a speech feature processed by the Nth first encoding module in the first encoding network, the second input speech feature is a feature obtained after the N-1th first encoding module in the first encoding network performs feature encoding, and the Nth first encoding module in the first encoding network is used to perform feature encoding on the second input speech feature to obtain the second speech feature; The first phoneme loss is the first phoneme CTC loss, the first phoneme CTC loss is the phoneme loss of the second CTC network, the first phoneme CTC loss is used to represent the loss generated in the process of aligning the third input speech feature to the labeled phoneme corresponding to the training sample speech, the third input speech feature is the feature obtained after the I-th first encoding module in the first encoding network performs feature encoding, the I+1-th first encoding module in the first encoding network is used to perform feature encoding on the third input speech feature to obtain the first speech phoneme feature, and I is a positive integer less than N-1.

5. The method according to claim 4, characterized in that The second word CTC loss is the negative value of the natural logarithm of the second probability, and the second probability is the probability of the annotated text obtained by the CTC corresponding to the second word CTC loss when the Nth first encoding module processes the third input speech feature; The first phoneme CTC loss is the negative value of the natural logarithm of the third probability, and the third probability is the probability of the annotated phoneme obtained by the CTC network corresponding to the first phoneme CTC loss when the I+1th first encoding module processes the third input speech feature, and the second target loss also includes a second attention loss, which is the result of a second attention loss function based on the second target text and the annotated text.

6. The method according to claim 1, characterized in that The second speech recognition model includes a second encoding network and a second decoding network, the second encoding network is used to encode the training sample speech to obtain a second speech phoneme feature, a speech syllable feature and a third speech feature of the training sample speech, and the second encoding network is used to decode the third speech feature to obtain a third target text; The second encoding network includes N second encoding modules connected in sequence, N is an integer greater than 1, the third word loss is the third word CTC loss, the third word CTC loss is the word loss of the first connected temporal classification CTC network, the third word CTC loss is used to represent the loss generated in the process of aligning the fourth input speech feature to the annotated text, the fourth input speech feature is the speech feature processed by the Nth second encoding module in the second encoding network, the fourth input speech feature is the feature obtained after the N-1th second encoding module in the second encoding network performs feature encoding, and the Nth second encoding module in the second encoding network is used to perform feature encoding on the fourth input speech feature to obtain the third speech feature; The second phoneme loss is a second phoneme CTC loss, the second phoneme CTC loss is a phoneme loss of a second CTC network, the second phoneme CTC loss is used to represent the loss generated in the process of aligning the fifth input speech feature to the annotated phoneme corresponding to the training sample speech, the fifth input speech feature is a feature obtained after the I-th second encoding module in the second encoding network performs feature encoding, the I+1-th second encoding module in the second encoding network is used to perform feature encoding on the fifth input speech feature to obtain the second speech phoneme feature, and I is a positive integer less than N-1; The syllable loss is a syllable CTC loss, which is the syllable loss of the third CTC network. The syllable CTC loss is used to represent the loss generated in the process of aligning the sixth input speech feature to the labeled syllable corresponding to the training sample speech. The sixth input speech feature is the feature obtained after feature encoding by the Jth second encoding module in the second encoding network. The J+1th second encoding module in the second encoding network is used to feature encode the sixth input speech feature to obtain the speech syllable feature, and J is an integer greater than I and less than N-1.

7. The method according to claim 6, characterized in that The third word CTC loss is the negative value of the natural logarithm of a fourth probability, and the fourth probability is the probability of the annotated text obtained by the CTC network corresponding to the third word CTC loss when the Nth second encoding module processes the fourth input speech feature; The second phoneme CTC loss is the negative value of the natural logarithm of the fifth probability, where the fifth probability is the probability of the annotated phoneme obtained by the CTC network corresponding to the second phoneme CTC loss when the (I+1)th first encoding module processes the fifth input speech feature; The syllable CTC loss is the negative value of the natural logarithm of the sixth probability, and the sixth probability is the probability of the annotated syllable obtained by the CTC network corresponding to the syllable CTC loss when the J+1th second encoding module processes the sixth input speech feature. The third target loss also includes a third attention loss, and the third attention loss is the result of a third attention loss function based on the third target text and the annotated text.

8. The method according to claim 1, characterized in that After inputting the initial features and the annotated text into the second speech recognition model and training using the third target loss to obtain the target speech recognition model, the method further includes: Get the speech to be recognized; Extracting initial features of the speech to be recognized; The initial features of the speech to be recognized are input into the target speech recognition model for speech recognition to obtain a target recognition text.

9. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps in the speech recognition model training method as described in any one of claims 1 to 8 when executing the computer program.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps in the speech recognition model training method as described in any one of claims 1 to 8.