WO2023273612A1 - 语音识别模型的训练方法、语音识别方法、装置、介质及设备 - Google Patents

语音识别模型的训练方法、语音识别方法、装置、介质及设备 Download PDF

Info

Publication number
WO2023273612A1
WO2023273612A1 PCT/CN2022/091481 CN2022091481W WO2023273612A1 WO 2023273612 A1 WO2023273612 A1 WO 2023273612A1 CN 2022091481 W CN2022091481 W CN 2022091481W WO 2023273612 A1 WO2023273612 A1 WO 2023273612A1
Authority
WO
WIPO (PCT)
Prior art keywords
symbol
character
training
speech
speech recognition
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2022/091481
Other languages
English (en)
French (fr)
Inventor
董林昊
梁镇麟
蔡猛
马泽君
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Youzhuju Network Technology Co Ltd
Original Assignee
Beijing Youzhuju Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Youzhuju Network Technology Co Ltd filed Critical Beijing Youzhuju Network Technology Co Ltd
Publication of WO2023273612A1 publication Critical patent/WO2023273612A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
    • G10L15/00Speech recognition
    • G10L15/06Creation of reference templates; Training of speech recognition systems, e.g. adaptation to the characteristics of the speaker's voice
    • G10L15/063Training
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
    • G10L15/00Speech recognition
    • G10L15/26Speech to text systems
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
    • G10L15/00Speech recognition
    • G10L15/06Creation of reference templates; Training of speech recognition systems, e.g. adaptation to the characteristics of the speaker's voice
    • G10L15/063Training
    • G10L2015/0635Training updating or merging of old and new templates; Mean values; Weighting
    • G10L2015/0636Threshold criteria for the updating

Definitions

  • the present disclosure relates to the field of computer technology, and in particular, to a model training method, speech recognition method, device, medium and equipment.
  • ASR automatic speech recognition
  • the original speech data can be directly converted into corresponding text results.
  • punctuation marks in the text result.
  • a post-processing method of offline marking points may be used, that is, after the speech recognition is completed, punctuation processing is performed on the obtained recognition results.
  • the recognition result is input into a post-processing model for processing, so that the delay of the final recognition result is relatively large.
  • the present disclosure provides a training method of a speech recognition model, the speech recognition model includes an encoder, a prediction sub-model, a speech decoder, and a symbol decoder, and the method includes:
  • the model parameters of the speech recognition model are updated according to the target loss.
  • the target symbol feature is a one-hot encoding feature
  • determining the target loss according to the symbol probability distribution and the target symbol feature corresponding to the predicted character in the training speech data includes:
  • the determined cross-entropy loss is used as the target loss.
  • the updating the model parameters of the speech recognition model according to the target loss includes:
  • model parameters of the symbol decoder are updated according to the target loss.
  • the target symbol feature is a one-hot encoding feature
  • determining the target loss according to the symbol probability distribution and the target symbol feature corresponding to the predicted character in the training speech data includes:
  • the target loss is determined according to the first cross-entropy loss and the second cross-entropy loss.
  • the symbol features corresponding to each character in the text corresponding to the training speech data are determined in the following manner:
  • the punctuation mark is used as the label symbol corresponding to the character; if there is no punctuation mark adjacent to the character, the preset symbol As the label symbol corresponding to the character;
  • the symbol feature corresponding to the character is generated.
  • the present disclosure provides a speech recognition method, the method comprising:
  • the speech recognition model determine the symbol to be added and the recognized text corresponding to the speech data, wherein the speech recognition model is obtained by training based on the speech recognition model training method described in the first aspect ;
  • a text result corresponding to the voice data to be recognized is generated according to the symbol to be added and the recognized text.
  • the present disclosure provides a training device for a speech recognition model
  • the speech recognition model includes an encoder, a prediction sub-model, a speech decoder, and a symbol decoder
  • the device includes:
  • a first processing module configured to obtain character acoustic vectors corresponding to the training speech data according to the encoder and the prediction sub-model, wherein each character acoustic vector corresponds to a predicted character of the training speech data;
  • the second processing module is used to obtain the corresponding output text and language feature vector of the predicted character according to the character acoustic vector and the speech decoder;
  • a first determining module configured to determine a symbol probability distribution corresponding to the predicted character according to the character acoustic vector, the language feature vector, and the symbol decoder;
  • the second determination module is used to determine the target loss according to the symbol probability distribution and the target symbol features corresponding to the predicted characters in the training speech data;
  • An update module configured to update the model parameters of the speech recognition model according to the target loss when an update condition is met.
  • the present disclosure provides a speech recognition device, the device comprising:
  • a receiving module configured to receive voice data to be recognized
  • a third determination module configured to determine the symbol to be added and the recognized text corresponding to the voice data according to the voice data and the voice recognition model, wherein the voice recognition model is based on the voice recognition model described in the first aspect Obtained by training with the training method;
  • a generating module configured to generate a text result corresponding to the voice data to be recognized according to the symbol to be added and the recognized text when the symbol to be added is a target symbol.
  • the present disclosure provides a computer-readable medium on which a computer program is stored, and when the program is executed by a processing device, the steps of the method described in the first aspect or the second aspect are implemented.
  • an electronic device including:
  • a processing device configured to execute the computer program in the storage device to implement the steps of the method in the first aspect or in the second aspect.
  • the character acoustic vector corresponding to the training speech data is obtained according to the encoder and the prediction sub-model, so that the output text and language corresponding to the predicted character can be obtained according to the character acoustic vector and the speech decoder feature vector, and according to the character acoustic vector, the language feature vector and the symbol decoder, determine the symbol probability distribution corresponding to the predicted character, and then according to the symbol probability distribution and the training speech data
  • the feature of the target symbol corresponding to the character is predicted, and the target loss is determined, so as to update the model parameters of the speech recognition model according to the target loss when an update condition is met.
  • the acoustic vector of the predicted character in the speech data is processed, and by combining the symbol decoder to perform speech recognition and punctuation prediction for each predicted character, the processing accuracy of the speech recognition model can be improved on the one hand, On the other hand, it can effectively reduce the delay in determining punctuation marks in the speech recognition process, so that the trained speech recognition model can be applied to the streaming data processing process, providing support for the user experience of streaming recognition products.
  • the character acoustic vector in the prediction sub-model and the language feature vector in the speech decoder can be reused, so that the acoustic information and language information can be used comprehensively to predict punctuation marks, and further training can be obtained.
  • the accuracy of the speech recognition model improves the user experience.
  • Fig. 1 is the flowchart of the training method of the speech recognition model provided according to an embodiment of the present disclosure
  • FIG. 2 is a flow chart of a speech recognition method provided according to an embodiment of the present disclosure
  • FIG. 3 is a flowchart of a training method for a speech recognition model provided according to an embodiment of the present disclosure
  • Fig. 4 is a block diagram of a speech recognition device provided according to an embodiment of the present disclosure.
  • FIG. 5 shows a schematic structural diagram of an electronic device suitable for implementing the embodiments of the present disclosure.
  • the term “comprise” and its variations are open-ended, ie “including but not limited to”.
  • the term “based on” is “based at least in part on”.
  • the term “one embodiment” means “at least one embodiment”; the term “another embodiment” means “at least one further embodiment”; the term “some embodiments” means “at least some embodiments.” Relevant definitions of other terms will be given in the description below.
  • the speech recognition model includes an encoder, a prediction sub-model, a speech decoder and a symbol decoder, as shown in Fig. 1
  • the method includes:
  • step 11 according to coder and prediction sub-model, obtain the character acoustic vector corresponding to training speech data, wherein, each described character acoustic vector corresponds to a prediction character of described training speech data.
  • the training speech data may be coded according to an encoder to obtain an acoustic vector of an audio frame of the training speech data.
  • the voice data per second can be divided into multiple audio frames, so as to perform data processing based on the audio frames.
  • the voice data per second can be divided into 100 audio frames for processing.
  • the audio frame of the training speech data is encoded by the encoder, and the obtained acoustic vector sequence H can be expressed as:
  • H ⁇ H 1 ,H 2 ,...,H U ⁇ , where U is used to represent the number of audio frames in the input training speech data, that is, the length of the acoustic vector sequence.
  • the character acoustic vector corresponding to the training speech data can be obtained.
  • the acoustic vector can be input into the predicting sub-model, and the predicting sub-model can predict the amount of information on the acoustic vector to obtain the amount of information corresponding to the audio frame.
  • the acoustic vectors of the audio frames may be combined according to the information amount of the multiple audio frames to obtain a character acoustic vector sequence.
  • the prediction sub-model can be a CIF (Continuous Integrate-and-Fire, continuous integration and distribution) model.
  • the amount of information corresponding to each predicted character is the same by default, so the corresponding audio frame can be The amount of information is accumulated from left to right.
  • the amount of information is accumulated to a preset threshold, it is considered that the audio frame corresponding to the accumulated amount of information is formed as a predicted character, and a predicted character corresponds to one or more audio frames.
  • the preset threshold may be set according to actual application scenarios and experience, for example, the preset threshold may be set to 1, which is not limited in the present disclosure.
  • the acoustic vectors of the audio frames may be combined according to the amount of information of multiple audio frames in the following manner:
  • the information volume of the second audio frame can be divided into two parts, that is, a part of the information volume belongs to the current predicted character, and the remaining part of the information volume belongs to the next predicted character.
  • Then continue to traverse the information volume of the audio frame, and continue to accumulate the information volume from the information volume of the remaining part of the second audio frame, that is, the information volume W 22 in the second audio frame and the information volume in the third audio frame.
  • the information amount W3 is accumulated until it reaches the preset threshold ⁇ , and the audio frame corresponding to the next predicted character is obtained.
  • the amount of information of the subsequent audio frames can be deduced by analogy, and combined in the above manner to obtain each predicted character corresponding to the plurality of audio frames.
  • the weighted sum of the acoustic vectors of each audio frame corresponding to the predicted character can be determined as the corresponding Acoustic vector.
  • the weight of the acoustic vector of each audio frame corresponding to the predicted character is the corresponding information amount of the audio frame in the predicted character. If the audio frame all belongs to the predicted character, the weight of the acoustic vector of the audio frame is the information amount of the audio frame, and if the audio frame part belongs to the predicted character, the weight of the acoustic vector of the audio frame is the audio frame The amount of information in this section.
  • the acoustic vector C1 corresponding to the predicted character can be expressed as:
  • the acoustic vector C2 corresponding to the predicted character can be expressed as:
  • step 12 according to the character acoustic vector and the speech decoder, the output text and language feature vector corresponding to the predicted character are obtained.
  • feature extraction can be performed on the acoustic vector of each input predicted character, so as to perform softmax processing based on the extracted features, and obtain the probability that the predicted character corresponds to each real character, that is, the predicted character corresponds to text probability distribution. Then, based on the text probability distribution, the recognition character corresponding to each predicted character can be determined through a Greedy Search algorithm or a Beam Search algorithm, so as to obtain the output text.
  • the language feature vector may be a feature vector output by a certain feature layer in the middle of the speech decoder, for example, it may be a corresponding feature when softmax processing is performed.
  • step 13 the symbol probability distribution corresponding to the predicted character is determined according to the character acoustic vector, the language feature vector and the symbol decoder.
  • the corresponding input when decoding symbols, includes character acoustic vectors and language feature vectors of predicted characters, so punctuation marks can be predicted in combination with phonetic features and language features, ensuring that the determined symbol probability distribution is accurate accuracy.
  • step 14 the target loss is determined according to the symbol probability distribution and the corresponding target symbol features in the training speech data.
  • the training voice data can be pre-labeled, so that the target text corresponding to the training voice data and the symbol features corresponding to the training voice data can be obtained, wherein, the symbol features of the symbols corresponding to the training voice data can be used to represent the training voice
  • the punctuation mark that follows each character in the punctuated text to which the data corresponds.
  • step 15 in the case of satisfying the update condition, the model parameters of the speech recognition model are updated according to the target loss.
  • the update condition may be that the target loss is greater than a preset loss threshold, which means that the recognition accuracy of the speech recognition model is insufficient.
  • the update condition may be that the number of iterations is less than a preset number threshold, and at this time it is considered that the number of iterations of the speech recognition model is relatively small, and its recognition accuracy is insufficient.
  • the model parameters of the speech recognition model can be updated according to the target loss.
  • the method of updating the model parameters based on the determined loss may adopt a commonly used updating method in the field, such as the gradient descent method, which will not be repeated here.
  • the update condition is not satisfied, it can be considered that the recognition accuracy of the speech recognition model meets the training requirements, and at this time the training process can be stopped to obtain a trained speech recognition model.
  • the character acoustic vector corresponding to the training speech data is obtained according to the encoder and the prediction sub-model, so that the output text and language corresponding to the predicted character can be obtained according to the character acoustic vector and the speech decoder feature vector, and according to the character acoustic vector, the language feature vector and the symbol decoder, determine the symbol probability distribution corresponding to the predicted character, and then according to the symbol probability distribution and the training speech data
  • the feature of the target symbol corresponding to the character is predicted, and the target loss is determined, so as to update the model parameters of the speech recognition model according to the target loss when an update condition is met.
  • the acoustic vector of the predicted character in the speech data is processed, and by combining the symbol decoder to perform speech recognition and punctuation prediction for each predicted character, the processing accuracy of the speech recognition model can be improved on the one hand, On the other hand, it can effectively reduce the delay in determining punctuation marks in the speech recognition process, so that the trained speech recognition model can be applied to the streaming data processing process, providing support for the user experience of streaming recognition products.
  • the character acoustic vector in the prediction sub-model and the language feature vector in the speech decoder can be reused, so that the acoustic information and language information can be used comprehensively to predict punctuation marks, and further training can be obtained.
  • the accuracy of the speech recognition model improves the user experience.
  • the symbol feature corresponding to each character in the text corresponding to the training speech data may be determined in the following manner:
  • the punctuation mark is used as the label symbol corresponding to the character; if there is no punctuation mark adjacent to the character, the preset symbol As the label symbol corresponding to the character.
  • the text data may be: Hello, it's the first time we meet, please take care of us. Then for the characters in the text data, there are punctuation marks adjacent to the characters "good”, “face” and "photo”, then for the character "good”, the adjacent punctuation marks ",” can be used as For the corresponding label symbol, for the character “face”, the adjacent punctuation mark ",” can be used as its corresponding label symbol, and for the character “Zhao", the subsequent adjacent punctuation mark ".” can be used as its corresponding label symbol. For other characters in the text data, preset symbols such as "*” can be used as their corresponding label symbols, and for the text data, the label symbol sequence "**, ****, *** can be obtained **.”
  • the symbol feature corresponding to the character is generated.
  • the symbol space may contain commonly used punctuation marks and the preset symbols, and after determining the label symbols corresponding to the characters, the label symbols can be determined in the form of one-hot one-hot encoding to map the label symbols to the Symbolic features in symbolic spaces.
  • the punctuation points in the text data with punctuation marks can be separately encoded, thereby obtaining training speech data that supports joint training of punctuation prediction and speech recognition, which is similar to the training process of the speech recognition model.
  • Matching provides data support for joint training of speech recognition models.
  • the target symbol feature is a one-hot encoding feature
  • an exemplary implementation of the target loss is determined according to the symbol probability distribution and the target symbol feature corresponding to the predicted character in the training speech data
  • this step may include:
  • a cross-entropy loss is determined according to the symbol probability distribution and the target symbol feature corresponding to the predicted character.
  • decoding by a symbol decoder can obtain the probability that the symbols adjacent to the current predicted character are each punctuation mark, and the target symbol feature corresponding to the predicted character is a one-hot encoding feature, that is, the predicted character in the training speech data
  • the value of the dimension of the corresponding punctuation mark is 1, and the value of other dimensions is 0, which is equivalent to the special probability distribution corresponding to the mark symbol.
  • the cross-entropy loss can be calculated based on the symbol probability distribution corresponding to the predicted character and the special probability distribution corresponding to the labeled symbol.
  • the cross-entropy loss is used to measure the difference between two probability distributions. The smaller the cross-entropy loss, the more similar the predicted probability distribution and the real probability distribution are, that is, the better the prediction effect of the trained speech recognition model. .
  • the determined cross-entropy loss is used as the target loss.
  • the corresponding target loss can be directly determined according to the symbol probability distribution output by the symbol decoder, so that the cross-entropy loss corresponding to the symbol decoder can be directly optimized, and the accuracy of the symbol decoder can be effectively improved, thereby Improve the accuracy of the punctuation mark prediction of the trained speech recognition model, improve the readability of the output text results of the speech recognition model to a certain extent, and improve the user experience.
  • step 15 when the cross-entropy loss determined based on the output of the symbol decoder is used as the target loss, in step 15, the model parameters of the speech recognition model are updated according to the target loss
  • the model parameters of the speech recognition model are updated according to the target loss
  • model parameters of the symbol decoder are updated according to the target loss.
  • the corresponding target loss is determined according to the symbol probability distribution output by the symbol decoder, that is, when performing model optimization, only the model parameters of the symbol decoder in the speech recognition model can be optimized, The parameters of other parts in the speech recognition model remain unchanged.
  • a symbol decoder can be added to the existing trained model, and the model can be trained by training speech data to obtain the speech recognition model, so as to add symbol recognition to the existing trained model Ability, while ensuring that the text recognition ability remains unchanged, thereby improving the scope of application and training efficiency of the training method for the speech recognition model.
  • the target symbol feature is a one-hot encoding feature
  • an exemplary implementation of the target loss is determined according to the symbol probability distribution and the target symbol feature corresponding to the predicted character in the training speech data
  • this step may include:
  • a first cross-entropy loss is determined according to the symbol probability distribution and the target symbol feature corresponding to the predicted character. Wherein, the method of determining the first cross-entropy loss has been described in detail above, and will not be repeated here.
  • a second cross-entropy loss corresponding to the speech decoder is determined according to the target text corresponding to the predicted character and the output text.
  • the speech recognition model includes a speech decoder for converting speech into text, so that the recognition accuracy of speech-to-text conversion in the speech recognition model can be improved by optimizing the second cross-entropy loss.
  • the target loss is determined according to the first cross-entropy loss and the second cross-entropy loss.
  • the target loss can be determined by weighting and summing the first cross-entropy loss and the second cross-entropy loss, wherein the weights corresponding to the first cross-entropy loss and the second cross-entropy loss can be determined according to actual application scenarios setting, which is not limited in the present disclosure.
  • the target loss when determining the target loss of the speech recognition model, the target loss can be determined based on the cross-entropy losses corresponding to the speech decoder and the symbol decoder respectively, and the language decoder and the language decoder can be determined by constructing multi-task learning.
  • the joint training of the symbol decoder can improve the accuracy of the text and symbols recognized by the trained speech recognition model to a certain extent, and improve the user experience.
  • the present disclosure also provides a speech recognition method, as shown in FIG. 2, the method may include:
  • step 21 voice data to be recognized is received.
  • step 22 according to the voice data and the voice recognition model, the symbols to be added and the recognized text corresponding to the voice data are determined, wherein the voice recognition model is trained based on any of the voice recognition model training methods described above acquired.
  • the input speech data can be stream-processed, that is, character-level symbol probability distribution and recognition text can be determined for the speech data.
  • the speech data is stream-input to the speech recognition model, and is encoded by the encoder.
  • the prediction sub-model determines the character acoustic vector of a predicted character
  • the character acoustic vector can be respectively passed through the speech decoder and the symbol decoder. Decode to obtain the matching and recognition text to be added.
  • the symbol with the highest corresponding probability in its corresponding symbol probability distribution may be determined as the symbol to be added.
  • step 23 if the symbol to be added is the target symbol, a text result corresponding to the voice data to be recognized is generated according to the symbol to be added and the recognized text, and the text result is a text containing punctuation mark information.
  • the symbol decoded may be a preset symbol "*", which means that there is no adjacent punctuation mark after the predicted character. Therefore, in this embodiment, the target symbol can be Any symbol in the symbol space other than the preset symbol.
  • the symbol to be added can be added after the text corresponding to the predicted character in the recognized text , so as to obtain the text result corresponding to the speech data to be recognized.
  • the speech recognition model can be applied to the streaming data processing process.
  • the input speech data can be processed at the character level, so that it can be determined in real time whether punctuation needs to be added after each character Symbols can improve the accuracy and real-time performance of punctuation predictions, and can also improve the accuracy of text results obtained. It can be applied to online speech recognition scenarios, effectively reducing the delay in displaying text results and improving user experience.
  • FIG. 3 is a block diagram of a training device for a speech recognition model provided according to an embodiment of the present disclosure.
  • the speech recognition model includes an encoder, a prediction sub-model, a speech decoder and a symbol decoder, and the device 30 includes:
  • the first processing module 31 is configured to obtain character acoustic vectors corresponding to the training speech data according to the encoder and the prediction sub-model, wherein each character acoustic vector corresponds to a predicted character of the training speech data ;
  • the second processing module 32 is used to obtain the output text and language feature vector corresponding to the predicted character according to the character acoustic vector and the speech decoder;
  • the first determination module 33 is configured to determine the symbol probability distribution corresponding to the predicted character according to the character acoustic vector, the language feature vector and the symbol decoder;
  • the second determination module 34 is used to determine the target loss according to the symbol probability distribution and the target symbol feature corresponding to the predicted character in the training speech data;
  • An update module 35 configured to update the model parameters of the speech recognition model according to the target loss when an update condition is met.
  • the target symbol feature is a one-hot encoding feature
  • the second determination module includes:
  • the first determining submodule is configured to determine a cross-entropy loss according to the symbol probability distribution and the target symbol feature corresponding to the predicted character, and use the determined cross-entropy loss as the target loss.
  • the update module includes:
  • An updating submodule configured to update model parameters of the symbol decoder in the speech recognition model according to the target loss.
  • the target symbol feature is a one-hot encoding feature
  • the second determination module includes:
  • the second determining submodule is used to determine the first cross-entropy loss according to the symbol probability distribution and the target symbol feature corresponding to the predicted character;
  • the second determining submodule is used to determine the second cross-entropy loss corresponding to the speech decoder according to the target text corresponding to the predicted character and the output text;
  • a third determining submodule configured to determine the target loss according to the first cross-entropy loss and the second cross-entropy loss.
  • the punctuation mark is used as the label symbol corresponding to the character; if there is no punctuation mark adjacent to the character, the preset symbol As the label symbol corresponding to the character;
  • the symbol feature corresponding to the character is generated.
  • FIG. 4 is a block diagram of a speech recognition device provided according to an embodiment of the present disclosure.
  • the device 40 includes:
  • Receiving module 41 is used for receiving the voice data to be recognized
  • the third determination module 42 is used to determine the symbols to be added and the recognized text corresponding to the voice data according to the voice data and the voice recognition model, wherein the voice recognition model is based on any of the voices described above Obtained by training with the training method of the recognition model;
  • the generating module 43 is configured to generate a text result corresponding to the voice data to be recognized according to the symbol to be added and the recognized text when the symbol to be added is a target symbol.
  • FIG. 5 it shows a schematic structural diagram of an electronic device 600 suitable for implementing the embodiments of the present disclosure.
  • the terminal equipment in the embodiment of the present disclosure may include but not limited to such as mobile phone, notebook computer, digital broadcast receiver, PDA (personal digital assistant), PAD (tablet computer), PMP (portable multimedia player), vehicle terminal (such as mobile terminals such as car navigation terminals) and fixed terminals such as digital TVs, desktop computers and the like.
  • the electronic device shown in FIG. 5 is only an example, and should not limit the functions and scope of use of the embodiments of the present disclosure.
  • an electronic device 600 may include a processing device (such as a central processing unit, a graphics processing unit, etc.) 601, which may be randomly accessed according to a program stored in a read-only memory (ROM) 602 or loaded from a storage device 608. Various appropriate actions and processes are executed by programs in the memory (RAM) 603 . In the RAM 603, various programs and data necessary for the operation of the electronic device 600 are also stored.
  • the processing device 601, ROM 602, and RAM 603 are connected to each other through a bus 604.
  • An input/output (I/O) interface 605 is also connected to the bus 604 .
  • the following devices can be connected to the I/O interface 605: input devices 606 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; including, for example, a liquid crystal display (LCD), speaker, vibration an output device 607 such as a computer; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609.
  • the communication means 609 may allow the electronic device 600 to perform wireless or wired communication with other devices to exchange data. While FIG. 5 shows electronic device 600 having various means, it should be understood that implementing or having all of the means shown is not a requirement. More or fewer means may alternatively be implemented or provided.
  • embodiments of the present disclosure include a computer program product, which includes a computer program carried on a non-transitory computer readable medium, where the computer program includes program code for executing the method shown in the flowchart.
  • the computer program may be downloaded and installed from a network via communication means 609, or from storage means 608, or from ROM 602.
  • the processing device 601 When the computer program is executed by the processing device 601, the above-mentioned functions defined in the methods of the embodiments of the present disclosure are performed.
  • the above-mentioned computer-readable medium in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two.
  • a computer readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, electrical connections with one or more wires, portable computer diskettes, hard disks, random access memory (RAM), read-only memory (ROM), erasable Programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
  • a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
  • a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave carrying computer-readable program code therein. Such propagated data signals may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing.
  • a computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which can transmit, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device .
  • Program code embodied on a computer readable medium may be transmitted by any appropriate medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
  • the client and the server can communicate using any currently known or future-developed network protocols such as HTTP (HyperText Transfer Protocol, Hypertext Transfer Protocol), and can communicate with digital data in any form or medium
  • HTTP HyperText Transfer Protocol
  • the communication eg, communication network
  • Examples of communication networks include local area networks ("LANs”), wide area networks (“WANs”), internetworks (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network of.
  • the above-mentioned computer-readable medium may be included in the above-mentioned electronic device, or may exist independently without being incorporated into the electronic device.
  • the above-mentioned computer-readable medium carries one or more programs, and when the above-mentioned one or more programs are executed by the electronic device, the electronic device is made to execute the training method of the speech recognition model, and the speech recognition model includes an encoder, a predictor model, a speech decoder, and a symbol decoder, the method comprising: obtaining character acoustic vectors corresponding to the training speech data according to the encoder and the prediction sub-model, wherein each character acoustic vector corresponds to the A predicted character of the training voice data; according to the character acoustic vector and the speech decoder, obtain the corresponding output text and language feature vector of the predicted character; according to the character acoustic vector, the language feature vector and the A symbol decoder, determining a symbol probability distribution corresponding to the predicted character; determining a target loss according to the symbol probability distribution and the target symbol feature corresponding to the predicted character in the training speech data; when
  • the above-mentioned computer-readable medium carries one or more programs, and when the above-mentioned one or more programs are executed by the electronic device, the electronic device is made to execute a voice recognition method, the method comprising: receiving voice data to be recognized; According to the speech data and the speech recognition model, determine the symbol to be added and the recognition text corresponding to the speech data, wherein the speech recognition model is obtained by training based on any of the speech recognition model training methods described above if the symbol to be added is a target symbol, generate a text result corresponding to the voice data to be recognized according to the symbol to be added and the recognized text.
  • Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, or combinations thereof, including but not limited to object-oriented programming languages—such as Java, Smalltalk, C++, and Includes conventional procedural programming languages - such as "C" or similar programming languages.
  • the program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server.
  • the remote computer may be connected to the user computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (for example, using an Internet service provider to connected via the Internet).
  • LAN local area network
  • WAN wide area network
  • Internet service provider for example, using an Internet service provider to connected via the Internet.
  • each block in a flowchart or block diagram may represent a module, program segment, or portion of code that contains one or more logical functions for implementing specified executable instructions.
  • the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or they may sometimes be executed in the reverse order, depending upon the functionality involved.
  • each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations can be implemented by a dedicated hardware-based system that performs the specified functions or operations , or may be implemented by a combination of dedicated hardware and computer instructions.
  • the modules involved in the embodiments described in the present disclosure may be implemented by software or by hardware. Wherein, the name of the module does not constitute a limitation on the module itself under certain circumstances.
  • the first processing module can also be described as "according to the encoder and the prediction sub-model, obtain the corresponding A module of character acoustic vectors".
  • FPGAs Field Programmable Gate Arrays
  • ASICs Application Specific Integrated Circuits
  • ASSPs Application Specific Standard Products
  • SOCs System on Chips
  • CPLD Complex Programmable Logical device
  • a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device.
  • a machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium.
  • a machine-readable medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing.
  • machine-readable storage media would include one or more wire-based electrical connections, portable computer discs, hard drives, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM or flash memory), optical fiber, compact disk read only memory (CD-ROM), optical storage, magnetic storage, or any suitable combination of the foregoing.
  • RAM random access memory
  • ROM read only memory
  • EPROM or flash memory erasable programmable read only memory
  • CD-ROM compact disk read only memory
  • magnetic storage or any suitable combination of the foregoing.
  • Example 1 provides a training method of a speech recognition model, the speech recognition model includes an encoder, a prediction sub-model, a speech decoder, and a symbol decoder, and the method includes:
  • the model parameters of the speech recognition model are updated according to the target loss.
  • Example 2 provides the method of Example 1, wherein the target symbol feature is a one-hot encoded feature, and the predicted character in the training speech data according to the symbol probability distribution The corresponding target symbol features determine the target loss, including:
  • the determined cross-entropy loss is used as the target loss.
  • Example 3 provides the method of Example 2, the updating the model parameters of the speech recognition model according to the target loss, including:
  • model parameters of the symbol decoder are updated according to the target loss.
  • Example 4 provides the method of Example 1, wherein the target symbol feature is a one-hot encoded feature, and the predicted character in the training speech data according to the symbol probability distribution The corresponding target symbol features determine the target loss, including:
  • the target loss is determined according to the first cross-entropy loss and the second cross-entropy loss.
  • Example 5 provides the method of any one of Examples 1-4, and determines the symbol features corresponding to each character in the text corresponding to the training speech data in the following manner:
  • the punctuation mark is used as the label symbol corresponding to the character; if there is no punctuation mark adjacent to the character, the preset symbol As the label symbol corresponding to the character;
  • the symbol feature corresponding to the character is generated.
  • Example 6 provides a speech recognition method, the method comprising:
  • the speech recognition model determine the symbol to be added and the recognition text corresponding to the speech data, wherein the speech recognition model is based on the training of the speech recognition model described in any example in Examples 1-5 obtained through training;
  • a text result corresponding to the voice data to be recognized is generated according to the symbol to be added and the recognized text.
  • Example 7 provides a training device for a speech recognition model, the speech recognition model includes an encoder, a prediction sub-model, a speech decoder, and a symbol decoder, and the device includes:
  • a first processing module configured to obtain character acoustic vectors corresponding to the training speech data according to the encoder and the prediction sub-model, wherein each character acoustic vector corresponds to a predicted character of the training speech data;
  • the second processing module is used to obtain the output text and language feature vector corresponding to the predicted character according to the character acoustic vector and the speech decoder;
  • a first determining module configured to determine a symbol probability distribution corresponding to the predicted character according to the character acoustic vector, the language feature vector, and the symbol decoder;
  • the second determination module is used to determine the target loss according to the symbol probability distribution and the target symbol features corresponding to the predicted characters in the training speech data;
  • An update module configured to update the model parameters of the speech recognition model according to the target loss when an update condition is met.
  • Example 8 provides a speech recognition device, the device comprising:
  • a receiving module configured to receive voice data to be recognized
  • the third determination module is used to determine the symbol to be added and the recognized text corresponding to the voice data according to the voice data and the voice recognition model, wherein the voice recognition model is based on any one of Examples 1-5
  • the training method of the above-mentioned speech recognition model carries out training and obtains;
  • a generating module configured to generate a text result corresponding to the voice data to be recognized according to the symbol to be added and the recognized text when the symbol to be added is a target symbol.
  • Example 9 provides a computer-readable medium on which a computer program is stored, and when the program is executed by a processing device, the steps of the method described in any one of Examples 1-6 are implemented. .
  • Example 10 provides an electronic device, comprising:
  • a processing device configured to execute the computer program in the storage device, so as to implement the steps of the method in any one of examples 1-6.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computational Linguistics (AREA)
  • Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • Acoustics & Sound (AREA)
  • Multimedia (AREA)
  • Artificial Intelligence (AREA)
  • Machine Translation (AREA)

Abstract

一种语音识别模型的训练方法、语音识别方法、装置、介质及设备,该训练方法包括:根据编码器和预测子模型,获得训练语音数据对应的字符声学向量(11);根据字符声学向量和语音解码器,获得预测字符对应的输出文本和语言特征向量(12);根据字符声学向量、语言特征向量和符号解码器,确定预测字符对应的符号概率分布(13);根据符号概率分布和训练语音数据中对应的目标符号特征,确定目标损失(14);在满足更新条件的情况下,根据目标损失对语音识别模型的模型参数进行更新(15)。

Description

[根据细则37.2由ISA制定的发明名称] 语音识别模型的训练方法、语音识别方法、装置、介质及设备
相关申请的交叉引用
本申请要求于2021年06月30日提交的,申请名称为“模型的训练方法、语音识别方法、装置、介质及设备”的、中国专利申请号为“202110735675.0”的优先权,该中国专利申请的全部内容通过引用结合在本申请中。
技术领域
本公开涉及计算机技术领域,具体地,涉及一种模型的训练方法、语音识别方法、装置、介质及设备。
背景技术
随着深度学习的兴起,各种完全依赖于神经网络进行端到端建模的方法逐渐兴起,逐步发展为自动语音识别(ASR)技术中的主流。通过自动语音识别,可直接将原始的语音数据转换为对应的文本结果。为了进一步提高文本结果的可读性,通常需要该文本结果中增加标点符号。相关技术中,可以采用离线打标点的后处理方式,即在完成语音识别后,对获得的识别结果进行标点处理。该方式需要等识别结果识别完成后,将识别结果输入一个后处理模型进行处理,使得最终的识别结果的延时较大。
技术解决方案
提供该公开内容部分以便以简要的形式介绍构思,这些构思将在后面的具体实施方式部分被详细描述。该公开内容部分并不旨在标识要求保护的技术方案的关键特征或必要特征,也不旨在用于限制所要求的保护的技术方案的范围。
[根据细则91更正 20.07.2022] 
第一方面,本公开提供一种语音识别模型的训练方法,所述语音识别模型包括编码器、预测子模型、语音解码器以及符号解码器,所述方法包括:
根据所述编码器和所述预测子模型,获得训练语音数据对应的字符声学向量,其中,每一所述字符声学向量对应于所述训练语音数据的一个预测字符;
根据所述字符声学向量和所述语音解码器,获得所述预测字符对应的输出文本和语言特征向量;
根据所述字符声学向量、所述语言特征向量和所述符号解码器,确定所述预测字符对应的符号概率分布;
根据所述符号概率分布和所述训练语音数据中所述预测字符对应的目标符号特征,确定目标损失;
在满足更新条件的情况下,根据所述目标损失对所述语音识别模型的模型参数进行更新。
可选地,所述目标符号特征为独热编码特征,所述根据所述符号概率分 布和所述训练语音数据中所述预测字符对应的目标符号特征,确定目标损失,包括:
根据所述符号概率分布和所述预测字符对应的目标符号特征,确定交叉熵损失;
将确定出的所述交叉熵损失作为所述目标损失。
可选地,所述根据所述目标损失对所述语音识别模型的模型参数进行更新,包括:
根据所述目标损失对所述语音识别模型中、所述符号解码器的模型参数进行更新。
可选地,所述目标符号特征为独热编码特征,所述根据所述符号概率分布和所述训练语音数据中所述预测字符对应的目标符号特征,确定目标损失,包括:
根据所述符号概率分布和所述预测字符对应的目标符号特征,确定第一交叉熵损失;
[根据细则91更正 20.07.2022] 
根据所述预测字符对应的目标文本与所述输出文本,确定所述语音解码器对应的第二交叉熵损失;
根据所述第一交叉熵损失和所述第二交叉熵损失确定所述目标损失。
可选地,通过以下方式确定所述训练语音数据对应的文本中每一字符对应的符号特征:
获取所述训练语音数据对应的包含标点符号的文本数据;
针对所述文本数据中的每一字符,若该字符后相邻存在标点符号,则将该标点符号作为该字符对应的标注符号;若该字符后相邻未存在标点符号,则将预设符号作为该字符对应的标注符号;
针对所述文本数据中的每一字符,根据该字符对应的标注符号与符号空间,生成该字符对应的符号特征。
第二方面,本公开提供一种语音识别方法,所述方法包括:
接收待识别的语音数据;
根据所述语音数据和语音识别模型,确定所述语音数据对应的待添加的符号和识别文本,其中,所述语音识别模型是基于第一方面所述的语音识别模型的训练方法进行训练获得的;
在所述待添加的符号为目标符号的情况下,根据所述待添加的符号和所述识别文本生成所述待识别的语音数据对应的文本结果。
[根据细则91更正 20.07.2022] 
第三方面,本公开提供一种语音识别模型的训练装置,所述语音识别模型包括编码器、预测子模型、语音解码器以及符号解码器,所述装置包括:
第一处理模块,用于根据所述编码器和所述预测子模型,获得训练语音数据对应的字符声学向量,其中,每一所述字符声学向量对应于所述训练语音数据的一个预测字符;
第二处理模块,用于根据所述字符声学向量和所述语音解码器,获得所 述预测字符对应的输出文本和语言特征向量;
第一确定模块,用于根据所述字符声学向量、所述语言特征向量和所述符号解码器,确定所述预测字符对应的符号概率分布;
第二确定模块,用于根据所述符号概率分布和所述训练语音数据中所述预测字符对应的目标符号特征,确定目标损失;
更新模块,用于在满足更新条件的情况下,根据所述目标损失对所述语音识别模型的模型参数进行更新。
第四方面,本公开提供一种语音识别装置,所述装置包括:
接收模块,用于接收待识别的语音数据;
第三确定模块,用于根据所述语音数据和语音识别模型,确定所述语音数据对应的待添加的符号和识别文本,其中,所述语音识别模型是基于第一方面所述的语音识别模型的训练方法进行训练获得的;
生成模块,用于在所述待添加的符号为目标符号的情况下,根据所述待添加的符号和所述识别文本生成所述待识别的语音数据对应的文本结果。
第五方面,本公开提供一种计算机可读介质,其上存储有计算机程序,该程序被处理装置执行时实现第一方面或第二方面所述方法的步骤。
第六方面,本公开提供一种电子设备,包括:
存储装置,其上存储有计算机程序;
处理装置,用于执行所述存储装置中的所述计算机程序,以实现第一方面或第二方面所述方法的步骤。
[根据细则91更正 20.07.2022] 
在上述技术方案中,根据编码器和预测子模型,获得训练语音数据对应的字符声学向量,从而可以根据所述字符声学向量和所述语音解码器,获得所述预测字符对应的输出文本和语言特征向量,并根据所述字符声学向量、所述语言特征向量和所述符号解码器,确定所述预测字符对应的符号概率分布,之后根据所述符号概率分布和所述训练语音数据中所述预测字符对应的目标符号特征,确定目标损失,以在满足更新条件的情况下,根据所述目标损失对所述语音识别模型的模型参数进行更新。由此,通过上述技术方案,针对语音数据中预测字符的声学向量进行处理,并且通过结合符号解码器以对每一预测字符进行语音识别及标点预测,一方面可以提高语音识别模型的处理精度,另一方面可以有效降低语音识别过程中确定标点符号的时延,使得训练所得的语音识别模型可以应用于流式数据处理过程,为流式识别产品的用户体验提供支撑。并且,在符号解码器进行解码的过程中可以复用预测子模型中的字符声学向量以及语音解码器中的语言特征向量,从而可以综合利用声学信息和语言信息进行标点符号的预测,进一步训练所得的语音识别模型的准确性,提升用户使用体验。
本公开的其他特征和优点将在随后的具体实施方式部分予以详细说明。
附图说明
结合附图并参考以下具体实施方式,本公开各实施例的上述和其他特征、优点及方面将变得更加明显。贯穿附图中,相同或相似的附图标记表示相同或相似的元素。应当理解附图是示意性的,原件和元素不一定按照比例绘制。在附图中:
图1是根据本公开的一种实施方式提供的语音识别模型的训练方法的流程图;
图2是根据本公开的一种实施方式提供的语音识别方法的流程图;
图3为根据本公开的一种实施方式提供的语音识别模型的训练方法的流程图;
图4是根据本公开的一种实施方式提供的语音识别装置的框图;
图5示出了适于用来实现本公开实施例的电子设备的结构示意图。
具体实施方式
下面将参照附图更详细地描述本公开的实施例。虽然附图中显示了本公开的某些实施例,然而应当理解的是,本公开可以通过各种形式来实现,而且不应该被解释为限于这里阐述的实施例,相反提供这些实施例是为了更加透彻和完整地理解本公开。应当理解的是,本公开的附图及实施例仅用于示例性作用,并非用于限制本公开的保护范围。
应当理解,本公开的方法实施方式中记载的各个步骤可以按照不同的顺序执行,和/或并行执行。此外,方法实施方式可以包括附加的步骤和/或省略执行示出的步骤。本公开的范围在此方面不受限制。
本文使用的术语“包括”及其变形是开放性包括,即“包括但不限于”。术语“基于”是“至少部分地基于”。术语“一个实施例”表示“至少一个实施例”;术语“另一实施例”表示“至少一个另外的实施例”;术语“一些实施例”表示“至少一些实施例”。其他术语的相关定义将在下文描述中给出。
需要注意,本公开中提及的“第一”、“第二”等概念仅用于对不同的装置、模块或单元进行区分,并非用于限定这些装置、模块或单元所执行的功能的顺序或者相互依存关系。
需要注意,本公开中提及的“一个”、“多个”的修饰是示意性而非限制性的,本领域技术人员应当理解,除非在上下文另有明确指出,否则应该理解为“一个或多个”。
本公开实施方式中的多个装置之间所交互的消息或者信息的名称仅用于说明性的目的,而并不是用于对这些消息或信息的范围进行限制。
[根据细则91更正 20.07.2022] 
图1所示,为根据本公开的一种实施方式提供的语音识别模型的训练方法的流程图,所述语音识别模型包括编码器、预测子模型、语音解码器以及符号解码器,如图1所示,所述方法包括:
在步骤11中,根据编码器和预测子模型,获得训练语音数据对应的字 符声学向量,其中,每一所述字符声学向量对应于所述训练语音数据的一个预测字符。
在该实施例中,可以根据编码器对所述训练语音数据进行编码,获得所述训练语音数据的音频帧的声学向量。
通常情况下,可以将每秒的语音数据切分为多个音频帧,从而基于音频帧进行数据处理,示例地,可以将每秒的语音数据切分为100个音频帧进行处理。相应地,通过该编码器对该训练语音数据的音频帧进行编码,获得的声学向量序列H可以表示为:
H:{H 1,H 2,…,H U},其中,U用于表示该输入训练语音数据中的音频帧的数量,即该声学向量序列的长度。
之后,可以根据声学向量和所述预测子模型,获得训练语音数据对应的字符声学向量。
示例地,可以将所述声学向量输入预测子模型,则该预测子模型可以对声学向量进行信息量预测,获得该音频帧对应的信息量。之后可以根据多个音频帧的信息量对音频帧的声学向量进行合并,获得字符声学向量序列。
示例地,该预测子模型可以为CIF(Continuous Integrate-and-Fire,连续整合发放)模型,在本公开实施例中默认每一预测字符对应的信息量是相同的,因此可以将音频帧对应的信息量从左到右的方式进行累加,信息量累加至预设阈值时,认为此时该累加的信息量对应的音频帧形成为一个预测字符,一个预测字符对应于一个或多个音频帧。其中,该预设阈值可以根据实际应用场景和经验进行设置,示例地该预设阈值可以设置为1,本公开对此不进行限定。
在一种可能的实施例中,可以通过如下方式根据多个音频帧的信息量对音频帧的声学向量进行合并:
按照信息量的顺序,依次获取一音频帧i的信息量W i
若W i小于预设阈值β,则获取下一音频帧作为当前的音频帧,即i=i+1,并对遍历到的音频帧的信息量进行累加,若累加和大于该预设阈值,可以认为此时出现了字符边界,即该当前遍历到的音频帧中部分属于当前的预测字符,另一部分属于下一预测字符。
示例地,若W 1+W 2大于β,则可以认为此时出现了字符边界,即第1个音频帧和第2个音频帧的部分可以对应于一个预测字符,该预测字符的边界处于第2个音频帧中。此时可以将该第2个音频帧的信息量切分为两部分,即一部分信息量属于当前的预测字符,剩余一部分的信息量属于下一预测字符。
相应地,第2个音频帧的信息量W 2中属于当前的预测字符的信息量W 21可以表示为:W 21=β-W 1;属于下一预测字符的信息量W 22可以表示为:W 22=W 1-W 21
之后继续遍历音频帧的信息量,并从该第2个音频帧的剩余一部分的信 息量继续进行信息量的累加,即将第2个音频帧中的信息量W 22和第3个音频帧中的信息量W 3进行累加,直至累加至预设阈值β,获得下一预测字符对应的音频帧。针对后续的音频帧的信息量以此类推,通过上述方式进行合并,获得该多个音频帧对应的各个预测字符。
基于此,在确定出该语音数据中预测字符和音频帧的对应关系后,针对每一预测字符,可以将该预测字符对应的每一音频帧的声学向量的加权和确定为该预测字符对应的声学向量。其中,该预测字符对应的每一音频帧的声学向量的权重为该音频帧在该预测字符中对应的信息量。若该音频帧全部属于该预测字符,则该音频帧的声学向量的权重为该音频帧的信息量,若该音频帧部分属于该预测字符,则该音频帧的声学向量的权重为该音频帧中该部分的信息量。
如上文所述示例,针对第一个预测字符,其包含第1个音频帧和第2个音频帧的部分,则该预测字符对应的声学向量C 1可以表示为:
C 1=W 1*H 1+W 21*H 2
又如示例,针对第二个预测字符,其包含第2个音频帧的部分和第3个音频帧,则该预测字符对应的声学向量C 2可以表示为:
C 2=W 22*H 2+W 3*H 3
转回图1,在步骤12中,根据字符声学向量和语音解码器,获得预测字符对应的输出文本和语言特征向量。
其中,在语音解码器中可以对输入的每一预测字符的声学向量进行特征提取,从而基于提取出的特征进行softmax处理,获得该预测字符对应于各个真实字符的概率,即该预测字符对应的文本概率分布。之后,则可以基于该文本概率分布,通过贪心搜索(Greedy Search)的算法或者集束搜索(Beam Search)的算法确定出每一预测字符对应的识别字符,以获得该输出文本。
[根据细则91更正 20.07.2022] 
在该实施例中,该语言特征向量可以是该语音解码器中间某一特征层输出的特征向量,如可以是进行softmax处理时对应的特征。
在步骤13中,根据字符声学向量、语言特征向量和符号解码器,确定预测字符对应的符号概率分布。
[根据细则91更正 20.07.2022] 
在该步骤中,在对符号进行解码时,其对应的输入包含预测字符的字符声学向量以及语言特征向量,因此可以结合语音特征和语言特征对标点符号进行预测,保证确定出的符号概率分布的准确性。
在步骤14中,根据符号概率分布和训练语音数据中对应的目标符号特征,确定目标损失。
其中,可以对训练语音数据进行预先标注,从而可以获得该训练语音数据对应的目标文本,以及该训练语音数据对应的符号特征,其中,训练语音数据对应的符号的符号特征可以用于表征训练语音数据对应的带标点符号的文本中各个字符后相邻的标点符号。
在步骤15中,在满足更新条件的情况下,根据目标损失对语音识别模 型的模型参数进行更新。
作为示例,该更新条件可以为目标损失大于预设的损失阈值,此时表示语音识别模型的识别准确性不足。作为另一示例,该更新条件可以是迭代次数小于预设的次数阈值,此时认为语音识别模型迭代次数较少,其识别准确性不足。相应地,在满足更新条件的情况下,可以根据该目标损失对该语音识别模型的模型参数进行更新。其中,基于确定出的损失对模型参数进行更新的方式可以采用本领域中常用的更新方式,如梯度下降法,在此不再赘述。
在不满足该更新条件的情况下,则可以认为该语音识别模型的识别精确性达到训练要求,此时可以停止训练过程,获得训练完成的语音识别模型。
[根据细则91更正 20.07.2022] 
在上述技术方案中,根据编码器和预测子模型,获得训练语音数据对应的字符声学向量,从而可以根据所述字符声学向量和所述语音解码器,获得所述预测字符对应的输出文本和语言特征向量,并根据所述字符声学向量、所述语言特征向量和所述符号解码器,确定所述预测字符对应的符号概率分布,之后根据所述符号概率分布和所述训练语音数据中所述预测字符对应的目标符号特征,确定目标损失,以在满足更新条件的情况下,根据所述目标损失对所述语音识别模型的模型参数进行更新。由此,通过上述技术方案,针对语音数据中预测字符的声学向量进行处理,并且通过结合符号解码器以对每一预测字符进行语音识别及标点预测,一方面可以提高语音识别模型的处理精度,另一方面可以有效降低语音识别过程中确定标点符号的时延,使得训练所得的语音识别模型可以应用于流式数据处理过程,为流式识别产品的用户体验提供支撑。并且,在符号解码器进行解码的过程中可以复用预测子模型中的字符声学向量以及语音解码器中的语言特征向量,从而可以综合利用声学信息和语言信息进行标点符号的预测,进一步训练所得的语音识别模型的准确性,提升用户使用体验。
在一种可能的实施例中,可以通过以下方式确定所述训练语音数据对应的文本中每一字符对应的符号特征:
获取所述训练语音数据对应的包含标点符号的文本数据。
针对所述文本数据中的每一字符,若该字符后相邻存在标点符号,则将该标点符号作为该字符对应的标注符号;若该字符后相邻未存在标点符号,则将预设符号作为该字符对应的标注符号。
示例地,所述文本数据可以为:你好,初次见面,请多多关照。则针对所述文本数据中的字符,在字符“好”、“面”、“照”后相邻存在标点符号,则针对字符“好”,可以将其后相邻的标点符号“,”作为其对应的标注符号,针对字符“面”,可以将其后相邻的标点符号“,”作为其对应的标注符号,针对字符“照”,可以将其后相邻的标点符号“。”作为其对应的标注符号。针对文本数据中的其他字符,则可以将预设符号,如“*”,作为其对应的标注符号,则针对该文本数据,可以获得标注符号序列“**,****,*****。”。
针对所述文本数据中的每一字符,根据该字符对应的标注符号与符号空 间,生成该字符对应的符号特征。
其中,符号空间中可以包含常用的标点符号以及该预设符号,则在确定出字符对应的标注符号后,则可以将该标注符号以one-hot独热编码的形式确定出标注符号映射到该符号空间中的符号特征。
由此,通过上述技术方案,可以通过对带有标点符号的文本数据中的标点进行单独编码,从而可以获得支持标点预测与语音识别进行联合训练的训练语音数据,与语音识别模型的训练过程相匹配,为进行语音识别模型的联合训练提供数据支持。
在一种可能的实施例中,所述目标符号特征为独热编码特征,在步骤14中,根据符号概率分布和训练语音数据中预测字符对应的目标符号特征,确定目标损失的示例性实现方式如下,该步骤可以包括:
根据所述符号概率分布和所述预测字符对应的目标符号特征,确定交叉熵损失。
其中,通过符号解码器进行解码可以获得当前预测字符后相邻的符号为各个标点符号的概率,所述预测字符对应的目标符号特征为独热编码特征,即该预测字符在训练语音数据中的对应的标点符号的维度的取值为1,其他维度的取值为0,相当于标注符号对应的特殊概率分布。
因此,在该实施例中,可以基于预测字符对应的符号概率分布和标注符号对应的特殊概率分布,计算交叉熵损失。其中,交叉熵损失用于度量两个概率分布间的差异性,交叉熵损失越小,表征预测的概率分布和真实概率分布之间则更相似,即训练所得的语音识别模型的预测效果越好。
之后,将确定出的所述交叉熵损失作为所述目标损失。
由此,通过上述技术方案,可以直接根据符号解码器输出的符号概率分布确定对应的目标损失,从而可以直接对符号解码器对应的交叉熵损失进行优化,有效提高符号解码器的准确性,从而提高训练所得的语音识别模型对标点符号预测的准确性,在一定程度上提高语音识别模型输出文本结果的可读性,提升用户使用体验。
在一种可能的实施例中,在将基于符号解码器的输出确定出的交叉熵损失作为所述目标损失的情况下,在步骤15中,根据目标损失对语音识别模型的模型参数进行更新的示例性实现方式如下,该步骤可以包括:
根据所述目标损失对所述语音识别模型中、所述符号解码器的模型参数进行更新。
如上文所示,在该实施例中,根据符号解码器输出的符号概率分布确定对应的目标损失,即在进行模型优化时,可以仅对语音识别模型中的符号解码器的模型参数进行优化,而语音识别模型中的其他部分的参数保持不变。
由此,通过上述方案,可以在现有训练完成的模型中增加符号解码器,并通过训练语音数据对该模型进行训练以获得该语音识别模型,以在现有训练完成的模型中增加符号识别能力,同时保证文本识别能力不变,从而提高 该语音识别模型的训练方法的适用范围和训练效率。
在一种可能的实施例中,所述目标符号特征为独热编码特征,在步骤14中,根据符号概率分布和训练语音数据中预测字符对应的目标符号特征,确定目标损失的示例性实现方式如下,该步骤可以包括:
根据所述符号概率分布和所述预测字符对应的目标符号特征,确定第一交叉熵损失。其中,第一交叉熵损失的确定方式已在上文进行详述,在此不再赘述。
[根据细则91更正 20.07.2022] 
根据所述预测字符对应的目标文本与所述输出文本,确定所述语音解码器对应的第二交叉熵损失。
[根据细则91更正 20.07.2022] 
其中,语音识别模型中包含用于将语音转换成文本的语音解码器,从而可以通过优化该第二交叉熵损失,以提高该语音识别模型中语音转换成文本的识别准确性。
根据所述第一交叉熵损失和所述第二交叉熵损失确定所述目标损失。
其中,可以将第一交叉熵损失和所述第二交叉熵损失进行加权求和的方式确定该目标损失,其中第一交叉熵损失和第二交叉熵损失分别对应的权重可以根据实际应用场景进行设置,本公开对此不进行限定。
[根据细则91更正 20.07.2022] 
由此,通过上述技术方案,在确定语音识别模型的目标损失时,可以基于语音解码器和符号解码器分别对应的交叉熵损失确定目标损失,通过构建多任务学习的方式对该语言解码器和符号解码器进行联合训练,从而可以在一定程度上提高训练所得的语音识别模型识别出的文本和符号的准确性,提升用户使用体验。
本公开还提供一种语音识别方法,如图2所示,所述方法可以包括:
在步骤21中,接收待识别的语音数据。
在步骤22中,根据语音数据和语音识别模型,确定语音数据对应的待添加的符号和识别文本,其中,所述语音识别模型是基于上文任一所述的语音识别模型的训练方法进行训练获得的。
[根据细则91更正 20.07.2022] 
如上文所述,基于该语音识别模型可以对输入的语音数据进行流式处理,即针对该语音数据进行字符级别的符号概率分布和识别文本的确定。其中,语音数据流式输入该语音识别模型,则经过编码器进行编码,在预测子模型确定出一个预测字符的字符声学向量时,则可以分别通过语音解码器和符号解码器对该字符声学向量进行解码,进而获得待添加的符合和识别文本。在该实施例中,针对语音数据中确定出的每一字符,可以将其对应的符号概率分布中对应概率最大的符号确定为该待添加的符号。
在步骤23中,在待添加的符号为目标符号的情况下,根据待添加的符号和识别文本生成待识别的语音数据对应的文本结果,该文本结果为包含标点符号信息的文本。
在语音识别模型的符号解码器中,其解码出的符号可能是预设符号“*”,其表示在该预测字符后无相邻的标点符号,因此,在该实施例中,目标符号 可以为符号空间中除该预设符号之外的任一符号。在确定出待添加的符号为目标符号的情况下,表示该预测字符对应的文本后应存在相邻的标点符号,则可以将该待添加的符号添加至识别文本中该预测字符对应的文本之后,从而获得待识别的语音数据对应的文本结果。
由此,通过上述技术方案,语音识别模型可以应用于流式数据处理过程,基于该语音识别模型可以在字符级别对输入的语音数据进行处理,从而可以实时确定出每一字符后是否需要添加标点符号,提升标点符号预测的准确性和实时性,同时也可以提高获得的文本结果的准确性,可以应用于在线语音识别场景中,有效降低文本结果显示的时延,提升用户使用体验。
[根据细则91更正 20.07.2022] 
图3所示,为根据本公开的一种实施方式提供的语音识别模型的训练装置的框图。所述语音识别模型包括编码器、预测子模型、语音解码器以及符号解码器,所述装置30包括:
第一处理模块31,用于根据所述编码器和所述预测子模型,获得训练语音数据对应的字符声学向量,其中,每一所述字符声学向量对应于所述训练语音数据的一个预测字符;
第二处理模块32,用于根据所述字符声学向量和所述语音解码器,获得所述预测字符对应的输出文本和语言特征向量;
第一确定模块33,用于根据所述字符声学向量、所述语言特征向量和所述符号解码器,确定所述预测字符对应的符号概率分布;
第二确定模块34,用于根据所述符号概率分布和所述训练语音数据中所述预测字符对应的目标符号特征,确定目标损失;
更新模块35,用于在满足更新条件的情况下,根据所述目标损失对所述语音识别模型的模型参数进行更新。
可选地,所述目标符号特征为独热编码特征,所述第二确定模块包括:
第一确定子模块,用于根据所述符号概率分布和所述预测字符对应的目标符号特征,确定交叉熵损失,并将确定出的所述交叉熵损失作为所述目标损失。
可选地,所述更新模块包括:
更新子模块,用于根据所述目标损失对所述语音识别模型中、所述符号解码器的模型参数进行更新。
可选地,所述目标符号特征为独热编码特征,所述第二确定模块包括:
第二确定子模块,用于根据所述符号概率分布和所述预测字符对应的目标符号特征,确定第一交叉熵损失;
[根据细则91更正 20.07.2022] 
第二确定子模块,用于根据所述预测字符对应的目标文本与所述输出文本,确定所述语音解码器对应的第二交叉熵损失;
第三确定子模块,用于根据所述第一交叉熵损失和所述第二交叉熵损失确定所述目标损失。
可选地,通过以下方式确定所述训练语音数据对应的文本中每一字符对 应的符号特征:
获取所述训练语音数据对应的包含标点符号的文本数据;
针对所述文本数据中的每一字符,若该字符后相邻存在标点符号,则将该标点符号作为该字符对应的标注符号;若该字符后相邻未存在标点符号,则将预设符号作为该字符对应的标注符号;
针对所述文本数据中的每一字符,根据该字符对应的标注符号与符号空间,生成该字符对应的符号特征。
图4所示,为根据本公开的一种实施方式提供的语音识别装置的框图。所述装置40包括:
接收模块41,用于接收待识别的语音数据;
第三确定模块42,用于根据所述语音数据和语音识别模型,确定所述语音数据对应的待添加的符号和识别文本,其中,所述语音识别模型是基于上文任一所述的语音识别模型的训练方法进行训练获得的;
生成模块43,用于在所述待添加的符号为目标符号的情况下,根据所述待添加的符号和所述识别文本生成所述待识别的语音数据对应的文本结果。
下面参考图5,其示出了适于用来实现本公开实施例的电子设备600的结构示意图。本公开实施例中的终端设备可以包括但不限于诸如移动电话、笔记本电脑、数字广播接收器、PDA(个人数字助理)、PAD(平板电脑)、PMP(便携式多媒体播放器)、车载终端(例如车载导航终端)等等的移动终端以及诸如数字TV、台式计算机等等的固定终端。图5示出的电子设备仅仅是一个示例,不应对本公开实施例的功能和使用范围带来任何限制。
如图5所示,电子设备600可以包括处理装置(例如中央处理器、图形处理器等)601,其可以根据存储在只读存储器(ROM)602中的程序或者从存储装置608加载到随机访问存储器(RAM)603中的程序而执行各种适当的动作和处理。在RAM 603中,还存储有电子设备600操作所需的各种程序和数据。处理装置601、ROM 602以及RAM 603通过总线604彼此相连。输入/输出(I/O)接口605也连接至总线604。
通常,以下装置可以连接至I/O接口605:包括例如触摸屏、触摸板、键盘、鼠标、摄像头、麦克风、加速度计、陀螺仪等的输入装置606;包括例如液晶显示器(LCD)、扬声器、振动器等的输出装置607;包括例如磁带、硬盘等的存储装置608;以及通信装置609。通信装置609可以允许电子设备600与其他设备进行无线或有线通信以交换数据。虽然图5示出了具有各种装置的电子设备600,但是应理解的是,并不要求实施或具备所有示出的装置。可以替代地实施或具备更多或更少的装置。
特别地,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在非暂态计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通 过通信装置609从网络上被下载和安装,或者从存储装置608被安装,或者从ROM 602被安装。在该计算机程序被处理装置601执行时,执行本公开实施例的方法中限定的上述功能。
需要说明的是,本公开上述的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读信号介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:电线、光缆、RF(射频)等等,或者上述的任意合适的组合。
在一些实施方式中,客户端、服务器可以利用诸如HTTP(HyperText Transfer Protocol,超文本传输协议)之类的任何当前已知或未来研发的网络协议进行通信,并且可以与任意形式或介质的数字数据通信(例如,通信网络)互连。通信网络的示例包括局域网(“LAN”),广域网(“WAN”),网际网(例如,互联网)以及端对端网络(例如,ad hoc端对端网络),以及任何当前已知或未来研发的网络。
上述计算机可读介质可以是上述电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。
[根据细则91更正 20.07.2022] 
上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该电子设备执行时,使得该电子设备执行语音识别模型的训练方法,所述语音识别模型包括编码器、预测子模型、语音解码器以及符号解码器,所述方法包括:根据所述编码器和所述预测子模型,获得训练语音数据对应的字符声学向量,其中,每一所述字符声学向量对应于所述训练语音数据的一个预测字符;根据所述字符声学向量和所述语音解码器,获得所述预测字符对应的输出文本和语言特征向量;根据所述字符声学向量、所述语言特征向量和所述符号解码器,确定所述预测字符对应的符号概率分布;根据所述符号概率分布和所述训练语音数据中所述预测字符对应的目标符号特征,确定 目标损失;在满足更新条件的情况下,根据所述目标损失对所述语音识别模型的模型参数进行更新。
或者,上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该电子设备执行时,使得该电子设备执行语音识别方法,所述方法包括:接收待识别的语音数据;根据所述语音数据和语音识别模型,确定所述语音数据对应的待添加的符号和识别文本,其中,所述语音识别模型是基于上文任一所述的语音识别模型的训练方法进行训练获得的;在所述待添加的符号为目标符号的情况下,根据所述待添加的符号和所述识别文本生成所述待识别的语音数据对应的文本结果。
可以以一种或多种程序设计语言或其组合来编写用于执行本公开的操作的计算机程序代码,上述程序设计语言包括但不限于面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言——诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)——连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。
附图中的流程图和框图,图示了按照本公开各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。
描述于本公开实施例中所涉及到的模块可以通过软件的方式实现,也可以通过硬件的方式来实现。其中,模块的名称在某种情况下并不构成对该模块本身的限定,例如,第一处理模块还可以被描述为“根据所述编码器和所述预测子模型,获得训练语音数据对应的字符声学向量的模块”。
本文中以上描述的功能可以至少部分地由一个或多个硬件逻辑部件来执行。例如,非限制性地,可以使用的示范类型的硬件逻辑部件包括:现场可编程门阵列(FPGA)、专用集成电路(ASIC)、专用标准产品(ASSP)、片上系统(SOC)、复杂可编程逻辑设备(CPLD)等等。
在本公开的上下文中,机器可读介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结 合地使用的程序。机器可读介质可以是机器可读信号介质或机器可读储存介质。机器可读介质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的任何合适组合。机器可读存储介质的更具体示例会包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM或快闪存储器)、光纤、便捷式紧凑盘只读存储器(CD-ROM)、光学储存设备、磁储存设备、或上述内容的任何合适组合。
[根据细则91更正 20.07.2022] 
根据本公开的一个或多个实施例,示例1提供了一种语音识别模型的训练方法,所述语音识别模型包括编码器、预测子模型、语音解码器以及符号解码器,所述方法包括:
根据所述编码器和所述预测子模型,获得训练语音数据对应的字符声学向量,其中,每一所述字符声学向量对应于所述训练语音数据的一个预测字符;
根据所述字符声学向量和所述语音解码器,获得所述预测字符对应的输出文本和语言特征向量;
根据所述字符声学向量、所述语言特征向量和所述符号解码器,确定所述预测字符对应的符号概率分布;
根据所述符号概率分布和所述训练语音数据中所述预测字符对应的目标符号特征,确定目标损失;
在满足更新条件的情况下,根据所述目标损失对所述语音识别模型的模型参数进行更新。
根据本公开的一个或多个实施例,示例2提供了示例1的方法,所述目标符号特征为独热编码特征,所述根据所述符号概率分布和所述训练语音数据中所述预测字符对应的目标符号特征,确定目标损失,包括:
根据所述符号概率分布和所述预测字符对应的目标符号特征,确定交叉熵损失;
将确定出的所述交叉熵损失作为所述目标损失。
根据本公开的一个或多个实施例,示例3提供了示例2的方法,所述根据所述目标损失对所述语音识别模型的模型参数进行更新,包括:
根据所述目标损失对所述语音识别模型中、所述符号解码器的模型参数进行更新。
根据本公开的一个或多个实施例,示例4提供了示例1的方法,所述目标符号特征为独热编码特征,所述根据所述符号概率分布和所述训练语音数据中所述预测字符对应的目标符号特征,确定目标损失,包括:
根据所述符号概率分布和所述预测字符对应的目标符号特征,确定第一交叉熵损失;
[根据细则91更正 20.07.2022] 
根据所述预测字符对应的目标文本与所述输出文本,确定所述语音解码器对应的第二交叉熵损失;
根据所述第一交叉熵损失和所述第二交叉熵损失确定所述目标损失。
根据本公开的一个或多个实施例,示例5提供了示例1-4中任一示例的方法,通过以下方式确定所述训练语音数据对应的文本中每一字符对应的符号特征:
获取所述训练语音数据对应的包含标点符号的文本数据;
针对所述文本数据中的每一字符,若该字符后相邻存在标点符号,则将该标点符号作为该字符对应的标注符号;若该字符后相邻未存在标点符号,则将预设符号作为该字符对应的标注符号;
针对所述文本数据中的每一字符,根据该字符对应的标注符号与符号空间,生成该字符对应的符号特征。
根据本公开的一个或多个实施例,示例6提供了一种语音识别方法,所述方法包括:
接收待识别的语音数据;
根据所述语音数据和语音识别模型,确定所述语音数据对应的待添加的符号和识别文本,其中,所述语音识别模型是基于示例1-5中任一示例所述的语音识别模型的训练方法进行训练获得的;
在所述待添加的符号为目标符号的情况下,根据所述待添加的符号和所述识别文本生成所述待识别的语音数据对应的文本结果。
[根据细则91更正 20.07.2022] 
根据本公开的一个或多个实施例,示例7提供了一种语音识别模型的训练装置,所述语音识别模型包括编码器、预测子模型、语音解码器以及符号解码器,所述装置包括:
第一处理模块,用于根据所述编码器和所述预测子模型,获得训练语音数据对应的字符声学向量,其中,每一所述字符声学向量对应于所述训练语音数据的一个预测字符;
第二处理模块,用于根据所述字符声学向量和所述语音解码器,获得所述预测字符对应的输出文本和语言特征向量;
第一确定模块,用于根据所述字符声学向量、所述语言特征向量和所述符号解码器,确定所述预测字符对应的符号概率分布;
第二确定模块,用于根据所述符号概率分布和所述训练语音数据中所述预测字符对应的目标符号特征,确定目标损失;
更新模块,用于在满足更新条件的情况下,根据所述目标损失对所述语音识别模型的模型参数进行更新。
根据本公开的一个或多个实施例,示例8提供了一种语音识别装置,所述装置包括:
接收模块,用于接收待识别的语音数据;
第三确定模块,用于根据所述语音数据和语音识别模型,确定所述语音数据对应的待添加的符号和识别文本,其中,所述语音识别模型是基于示例1-5中任一示例所述的语音识别模型的训练方法进行训练获得的;
生成模块,用于在所述待添加的符号为目标符号的情况下,根据所述待添加的符号和所述识别文本生成所述待识别的语音数据对应的文本结果。
根据本公开的一个或多个实施例,示例9提供了一种计算机可读介质,其上存储有计算机程序,该程序被处理装置执行时实现示例1-6中任一示例所述方法的步骤。
根据本公开的一个或多个实施例,示例10提供了一种电子设备,包括:
存储装置,其上存储有计算机程序;
处理装置,用于执行所述存储装置中的所述计算机程序,以实现示例1-6中任一示例所述方法的步骤。
以上描述仅为本公开的较佳实施例以及对所运用技术原理的说明。本领域技术人员应当理解,本公开中所涉及的公开范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离上述公开构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。例如上述特征与本公开中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成的技术方案。
此外,虽然采用特定次序描绘了各操作,但是这不应当理解为要求这些操作以所示出的特定次序或以顺序次序执行来执行。在一定环境下,多任务和并行处理可能是有利的。同样地,虽然在上面论述中包含了若干具体实现细节,但是这些不应当被解释为对本公开的范围的限制。在单独的实施例的上下文中描述的某些特征还可以组合地实现在单个实施例中。相反地,在单个实施例的上下文中描述的各种特征也可以单独地或以任何合适的子组合的方式实现在多个实施例中。
尽管已经采用特定于结构特征和/或方法逻辑动作的语言描述了本主题,但是应当理解所附权利要求书中所限定的主题未必局限于上面描述的特定特征或动作。相反,上面所描述的特定特征和动作仅仅是实现权利要求书的示例形式。关于上述实施例中的装置,其中各个模块执行操作的具体方式已经在有关该方法的实施例中进行了详细描述,此处将不做详细阐述说明。

Claims (10)

  1. [根据细则91更正 20.07.2022]一种语音识别模型的训练方法,所述语音识别模型包括编码器、预测子模型、语音解码器以及符号解码器,所述方法包括:
    根据所述编码器和所述预测子模型,获得训练语音数据对应的字符声学向量,其中,每一所述字符声学向量对应于所述训练语音数据的一个预测字符;
    根据所述字符声学向量和所述语音解码器,获得所述预测字符对应的输出文本和语言特征向量;
    根据所述字符声学向量、所述语言特征向量和所述符号解码器,确定所述预测字符对应的符号概率分布;
    根据所述符号概率分布和所述训练语音数据中所述预测字符对应的目标符号特征,确定目标损失;
    在满足更新条件的情况下,根据所述目标损失对所述语音识别模型的模型参数进行更新。
  2. 根据权利要求1所述的方法,其中,所述目标符号特征为独热编码特征,所述根据所述符号概率分布和所述训练语音数据中所述预测字符对应的目标符号特征,确定目标损失,包括:
    根据所述符号概率分布和所述预测字符对应的目标符号特征,确定交叉熵损失;
    将确定出的所述交叉熵损失作为所述目标损失。
  3. 根据权利要求2所述的方法,其中,所述根据所述目标损失对所述语音识别模型的模型参数进行更新,包括:
    根据所述目标损失对所述语音识别模型中、所述符号解码器的模型参数进行更新。
  4. [根据细则91更正 20.07.2022]
    根据权利要求1所述的方法,其中,所述目标符号特征为独热编码特征,所述根据所述符号概率分布和所述训练语音数据中所述预测字符对应的目标符号特征,确定目标损失,包括:
    根据所述符号概率分布和所述预测字符对应的目标符号特征,确定第一交叉熵损失;
    根据所述预测字符对应的目标文本与所述输出文本,确定所述语音解码器对应的第二交叉熵损失;
    根据所述第一交叉熵损失和所述第二交叉熵损失确定所述目标损失。
  5. 根据权利要求1-4中任一项所述的方法,其中,通过以下方式确定所述训练语音数据对应的文本中每一字符对应的符号特征:
    获取所述训练语音数据对应的包含标点符号的文本数据;
    针对所述文本数据中的每一字符,若该字符后相邻存在标点符号,则将该标点符号作为该字符对应的标注符号;若该字符后相邻未存在标点符号,则将预设符号作为该字符对应的标注符号;
    针对所述文本数据中的每一字符,根据该字符对应的标注符号与符号空间,生成该字符对应的符号特征。
  6. 一种语音识别方法,所述方法包括:
    接收待识别的语音数据;
    根据所述语音数据和语音识别模型,确定所述语音数据对应的待添加的符号和识别文本,其中,所述语音识别模型是基于权利要求1-5中任一项所述的语音识别模型的训练方法进行训练获得的;
    在所述待添加的符号为目标符号的情况下,根据所述待添加的符号和所述识别文本生成所述待识别的语音数据对应的文本结果。
  7. [根据细则91更正 20.07.2022]一种语音识别模型的训练装置,所述语音识别模型包括编码器、预测子模型、语音解码器以及符号解码器,所述装置包括:
    第一处理模块,用于根据所述编码器和所述预测子模型,获得训练语音数据对应的字符声学向量,其中,每一所述字符声学向量对应于所述训练语音数据的一个预测字符;
    第二处理模块,用于根据所述字符声学向量和所述语音解码器,获得所述预测字符对应的输出文本和语言特征向量;
    第一确定模块,用于根据所述字符声学向量、所述语言特征向量和所述符号解码器,确定所述预测字符对应的符号概率分布;
    第二确定模块,用于根据所述符号概率分布和所述训练语音数据中所述预测字符对应的目标符号特征,确定目标损失;
    更新模块,用于在满足更新条件的情况下,根据所述目标损失对所述语音识别模型的模型参数进行更新。
  8. 一种语音识别装置,所述装置包括:
    接收模块,用于接收待识别的语音数据;
    第三确定模块,用于根据所述语音数据和语音识别模型,确定所述语音数据对应的待添加的符号和识别文本,其中,所述语音识别模型是基于权利要求1-5中任一项所述的语音识别模型的训练方法进行训练获得的;
    生成模块,用于在所述待添加的符号为目标符号的情况下,根据所述待添加的符号和所述识别文本生成所述待识别的语音数据对应的文本结果。
  9. 一种计算机可读介质,其上存储有计算机程序,该程序被处理装置 执行时实现权利要求1-6中任一项所述方法的步骤。
  10. 一种电子设备,包括:
    存储装置,其上存储有计算机程序;
    处理装置,用于执行所述存储装置中的所述计算机程序,以实现权利要求1-6中任一项所述方法的步骤。
PCT/CN2022/091481 2021-06-30 2022-05-07 语音识别模型的训练方法、语音识别方法、装置、介质及设备 Ceased WO2023273612A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110735675.0A CN113362811B (zh) 2021-06-30 2021-06-30 语音识别模型的训练方法、语音识别方法和装置
CN202110735675.0 2021-06-30

Publications (1)

Publication Number Publication Date
WO2023273612A1 true WO2023273612A1 (zh) 2023-01-05

Family

ID=77537438

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/091481 Ceased WO2023273612A1 (zh) 2021-06-30 2022-05-07 语音识别模型的训练方法、语音识别方法、装置、介质及设备

Country Status (2)

Country Link
CN (1) CN113362811B (zh)
WO (1) WO2023273612A1 (zh)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116071758A (zh) * 2023-01-31 2023-05-05 北京百度网讯科技有限公司 图像识别模型的训练方法、图像识别方法、装置及设备
CN116137149A (zh) * 2023-04-18 2023-05-19 杰创智能科技股份有限公司 语音识别方法、装置和设备
CN116451773A (zh) * 2023-04-21 2023-07-18 北京达佳互联信息技术有限公司 动作生成模型的训练方法、动作生成方法及装置
CN116781417A (zh) * 2023-08-15 2023-09-19 北京中电慧声科技有限公司 一种基于语音识别的抗破译语音交互方法及系统
CN119479646A (zh) * 2024-11-08 2025-02-18 北京邮电大学 一种基于bert预训练语言模型的语音指令识别方法
CN119741918A (zh) * 2023-09-25 2025-04-01 荣耀终端股份有限公司 语音识别方法和电子设备

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113362811B (zh) * 2021-06-30 2023-03-24 北京有竹居网络技术有限公司 语音识别模型的训练方法、语音识别方法和装置
CN114049885B (zh) * 2022-01-12 2022-04-22 阿里巴巴达摩院(杭州)科技有限公司 标点符号识别模型构建方法和装置
CN114724589B (zh) * 2022-04-14 2025-10-21 标贝(青岛)科技有限公司 语音质检的方法、装置、电子设备和存储介质
CN115062613B (zh) * 2022-07-12 2024-09-06 阿里巴巴(中国)有限公司 文本处理方法、电子设备及计算机存储介质
CN115713938B (zh) * 2022-11-10 2025-10-24 阿里巴巴达摩院(杭州)科技有限公司 语音识别的置信度估计方法、存储介质及电子设备
CN119741917B (zh) * 2023-09-25 2025-12-16 荣耀终端股份有限公司 语音识别方法和电子设备
CN119647490B (zh) * 2024-11-26 2025-10-17 平安科技(深圳)有限公司 基于人工智能的语音翻译方法、装置、计算机设备及介质

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180174589A1 (en) * 2016-12-19 2018-06-21 Samsung Electronics Co., Ltd. Speech recognition method and apparatus
CN111199727A (zh) * 2020-01-09 2020-05-26 厦门快商通科技股份有限公司 语音识别模型训练方法、系统、移动终端及存储介质
CN111916067A (zh) * 2020-07-27 2020-11-10 腾讯科技(深圳)有限公司 语音识别模型的训练方法、装置、电子设备及存储介质
WO2020242580A1 (en) * 2019-05-28 2020-12-03 Google Llc Large-scale multilingual speech recognition with a streaming end-to-end model
CN112634876A (zh) * 2021-01-04 2021-04-09 北京有竹居网络技术有限公司 语音识别方法、装置、存储介质及电子设备
CN112712804A (zh) * 2020-12-23 2021-04-27 哈尔滨工业大学(威海) 语音识别方法、系统、介质、计算机设备、终端及应用
CN112927679A (zh) * 2021-02-07 2021-06-08 虫洞创新平台(深圳)有限公司 一种语音识别中添加标点符号的方法及语音识别装置
CN113012701A (zh) * 2021-03-16 2021-06-22 联想(北京)有限公司 一种识别方法、装置、电子设备及存储介质
CN113362811A (zh) * 2021-06-30 2021-09-07 北京有竹居网络技术有限公司 模型的训练方法、语音识别方法、装置、介质及设备

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106782518A (zh) * 2016-11-25 2017-05-31 深圳市唯特视科技有限公司 一种基于分层循环神经网络语言模型的语音识别方法
KR102449842B1 (ko) * 2017-11-30 2022-09-30 삼성전자주식회사 언어 모델 학습 방법 및 이를 사용하는 장치
CN110942763B (zh) * 2018-09-20 2023-09-12 阿里巴巴集团控股有限公司 语音识别方法及装置
CN109410949B (zh) * 2018-10-11 2021-11-16 厦门大学 基于加权有限状态转换器的文本内容添加标点方法
CN110751945A (zh) * 2019-10-17 2020-02-04 成都三零凯天通信实业有限公司 一种端到端的语音识别方法
CN114787913A (zh) * 2019-12-13 2022-07-22 谷歌有限责任公司 训练语音合成以生成不同的语音声音
CN111816165A (zh) * 2020-07-07 2020-10-23 北京声智科技有限公司 语音识别方法、装置及电子设备

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180174589A1 (en) * 2016-12-19 2018-06-21 Samsung Electronics Co., Ltd. Speech recognition method and apparatus
WO2020242580A1 (en) * 2019-05-28 2020-12-03 Google Llc Large-scale multilingual speech recognition with a streaming end-to-end model
CN111199727A (zh) * 2020-01-09 2020-05-26 厦门快商通科技股份有限公司 语音识别模型训练方法、系统、移动终端及存储介质
CN111916067A (zh) * 2020-07-27 2020-11-10 腾讯科技(深圳)有限公司 语音识别模型的训练方法、装置、电子设备及存储介质
CN112712804A (zh) * 2020-12-23 2021-04-27 哈尔滨工业大学(威海) 语音识别方法、系统、介质、计算机设备、终端及应用
CN112634876A (zh) * 2021-01-04 2021-04-09 北京有竹居网络技术有限公司 语音识别方法、装置、存储介质及电子设备
CN112927679A (zh) * 2021-02-07 2021-06-08 虫洞创新平台(深圳)有限公司 一种语音识别中添加标点符号的方法及语音识别装置
CN113012701A (zh) * 2021-03-16 2021-06-22 联想(北京)有限公司 一种识别方法、装置、电子设备及存储介质
CN113362811A (zh) * 2021-06-30 2021-09-07 北京有竹居网络技术有限公司 模型的训练方法、语音识别方法、装置、介质及设备

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116071758A (zh) * 2023-01-31 2023-05-05 北京百度网讯科技有限公司 图像识别模型的训练方法、图像识别方法、装置及设备
CN116137149A (zh) * 2023-04-18 2023-05-19 杰创智能科技股份有限公司 语音识别方法、装置和设备
CN116137149B (zh) * 2023-04-18 2023-07-14 杰创智能科技股份有限公司 语音识别方法、装置和设备
CN116451773A (zh) * 2023-04-21 2023-07-18 北京达佳互联信息技术有限公司 动作生成模型的训练方法、动作生成方法及装置
CN116781417A (zh) * 2023-08-15 2023-09-19 北京中电慧声科技有限公司 一种基于语音识别的抗破译语音交互方法及系统
CN116781417B (zh) * 2023-08-15 2023-11-17 北京中电慧声科技有限公司 一种基于语音识别的抗破译语音交互方法及系统
CN119741918A (zh) * 2023-09-25 2025-04-01 荣耀终端股份有限公司 语音识别方法和电子设备
CN119479646A (zh) * 2024-11-08 2025-02-18 北京邮电大学 一种基于bert预训练语言模型的语音指令识别方法

Also Published As

Publication number Publication date
CN113362811A (zh) 2021-09-07
CN113362811B (zh) 2023-03-24

Similar Documents

Publication Publication Date Title
CN113362811B (zh) 语音识别模型的训练方法、语音识别方法和装置
CN113470619B (zh) 语音识别方法、装置、介质及设备
CN113436620B (zh) 语音识别模型的训练方法、语音识别方法、装置、介质及设备
CN112634876B (zh) 语音识别方法、装置、存储介质及电子设备
CN113327599B (zh) 语音识别方法、装置、介质及电子设备
CN112183120A (zh) 语音翻译方法、装置、设备和存储介质
CN111583903A (zh) 语音合成方法、声码器训练方法、装置、介质及电子设备
CN112883967B (zh) 图像字符识别方法、装置、介质及电子设备
CN114765025A (zh) 语音识别模型的生成方法、识别方法、装置、介质及设备
CN112509562B (zh) 用于文本后处理的方法、装置、电子设备和介质
CN113902838A (zh) 动画生成方法、装置、存储介质及电子设备
CN111653261A (zh) 语音合成方法、装置、可读存储介质及电子设备
CN113986958B (zh) 文本信息的转换方法、装置、可读介质和电子设备
CN111597825B (zh) 语音翻译方法、装置、可读介质及电子设备
CN111312223A (zh) 语音分割模型的训练方法、装置和电子设备
CN116258657A (zh) 模型训练方法、图像处理方法、装置、介质及电子设备
CN111312224A (zh) 语音分割模型的训练方法、装置和电子设备
CN111581455B (zh) 文本生成模型的生成方法、装置和电子设备
WO2023185896A1 (zh) 一种文本生成方法、装置、计算机设备及存储介质
CN114399991A (zh) 语音合成方法、装置、存储介质及电子设备
CN111582456A (zh) 用于生成网络模型信息的方法、装置、设备和介质
CN116884402A (zh) 语音转文本的方法、装置、电子设备及存储介质
CN113593527B (zh) 一种生成声学特征、语音模型训练、语音识别方法及装置
CN116167433A (zh) 用于训练图像特征提取模型的方法、图像识别方法及介质
CN116504269A (zh) 发音评价方法、装置、可读介质及电子设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22831439

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 22831439

Country of ref document: EP

Kind code of ref document: A1