WO2022143058A1 - 语音识别方法、装置、存储介质及电子设备 - Google Patents

语音识别方法、装置、存储介质及电子设备 Download PDF

Info

Publication number
WO2022143058A1
WO2022143058A1 PCT/CN2021/136431 CN2021136431W WO2022143058A1 WO 2022143058 A1 WO2022143058 A1 WO 2022143058A1 CN 2021136431 W CN2021136431 W CN 2021136431W WO 2022143058 A1 WO2022143058 A1 WO 2022143058A1
Authority
WO
WIPO (PCT)
Prior art keywords
sample
punctuation
text
characters
character
Prior art date
Application number
PCT/CN2021/136431
Other languages
English (en)
French (fr)
Inventor
田垚
边俐菁
蔡猛
Original Assignee
北京有竹居网络技术有限公司
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 北京有竹居网络技术有限公司 filed Critical 北京有竹居网络技术有限公司
Publication of WO2022143058A1 publication Critical patent/WO2022143058A1/zh

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/04Segmentation; Word boundary detection
    • 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/08Speech classification or search
    • G10L15/16Speech classification or search using artificial neural networks
    • 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/0631Creating reference templates; Clustering

Definitions

  • the present disclosure relates to the technical field of speech recognition, and in particular, to a speech recognition method, apparatus, storage medium and electronic device.
  • Punctuation prediction is an indispensable part of the speech recognition system.
  • speech recognition will convert continuous audio signals into text sequences, and then the punctuation prediction function will punctuate the text to achieve the function of sentence segmentation.
  • the result of the speech recognition system is usually a plain text sequence "The weather is fine today, let's go climbing.” After processing by the punctuation prediction model, we get "The weather is fine today, let's go climbing.” Punctuation prediction can keep the semantic integrity.
  • the text is segmented to improve the fluency of reading, and it is more conducive to subsequent tasks such as machine translation after the sentence is segmented.
  • the present disclosure provides a speech recognition method, the method comprising:
  • Feature extraction is performed on the target audio to obtain a speech feature sequence
  • the speech recognition model Inputting the speech feature sequence into a speech recognition model to obtain a punctuated target text corresponding to the target audio, the speech recognition model is a sample text with punctuation marked with punctuation information and a sample corresponding to the punctuated sample text audio training.
  • the present disclosure provides a speech recognition device, the device comprising:
  • an acquisition module for acquiring the target audio to be identified
  • an extraction module for performing feature extraction on the target audio to obtain a speech feature sequence
  • the recognition module is used to input the speech feature sequence into the speech recognition model to obtain the punctuated target text corresponding to the target audio, and the speech recognition model is to use the punctuated sample text marked with punctuation information and the punctuated sample text with the punctuation.
  • the sample audio corresponding to the sample text is obtained by training.
  • the present disclosure provides a training method for a speech recognition model, including:
  • For each of the predicted text with punctuation calculate a loss function according to the predicted text with punctuation and the sample audio with punctuation corresponding to the sample audio and marked with punctuation information, to obtain a target loss function;
  • the parameters of the speech recognition model are adjusted according to the objective loss function.
  • a computer-readable medium has a computer program stored thereon, and when the program is executed by a processing apparatus, implements the steps of the method described in the first aspect.
  • the present disclosure provides an electronic device, comprising:
  • a processing device is configured to execute the computer program in the storage device to implement the steps of the method in the first aspect.
  • the end-to-end model training is performed through the punctuated sample text marked with punctuation information and the sample audio corresponding to the punctuated sample text, so that the speech recognition model can automatically learn the mapping from speech to punctuated text.
  • the speech recognition model can directly obtain the target text with punctuation, that is, speech recognition and punctuation prediction can be performed at the same time, which can reduce system complexity, system power consumption and delay, and improve speech recognition efficiency.
  • the speech recognition model makes full use of the emotion, tone and other information contained in acoustic features to predict punctuation by combining acoustic and linguistic information to output speech recognition results, which can improve the accuracy of punctuation prediction to a certain extent.
  • FIG. 1 is a flowchart of a speech recognition method according to an exemplary embodiment of the present disclosure
  • FIG. 2 is a schematic diagram of a training and application process of a speech recognition model in a speech recognition method according to an exemplary embodiment of the present disclosure
  • FIG. 3 is a schematic structural diagram of a speech recognition model in a speech recognition method according to an exemplary embodiment of the present disclosure
  • FIG. 4 is a block diagram of a speech recognition apparatus according to an exemplary embodiment of the present disclosure.
  • FIG. 5 is a block diagram of an electronic device according to an exemplary embodiment of the present disclosure.
  • the term “including” and variations thereof are open-ended inclusions, 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 additional embodiment”; the term “some embodiments” means “at least some embodiments”. Relevant definitions of other terms will be given in the description below.
  • Punctuation prediction is an indispensable part of the speech recognition system.
  • speech recognition will convert continuous audio signals into text sequences, and then the punctuation prediction function will punctuate the text to achieve the function of sentence segmentation.
  • the result of the speech recognition system is usually a plain text sequence "The weather is fine today, let's go climbing.” After processing by the punctuation prediction model, we get "The weather is fine today, let's go climbing.” Punctuation prediction can keep the semantic integrity.
  • the text is segmented to improve the fluency of reading, and it is more conducive to subsequent tasks such as machine translation after the sentence is segmented.
  • the punctuation prediction model is usually called for punctuation processing after the speech recognition is completed.
  • the inventor's research found that such a design increases the complexity of the entire system, and increases both power consumption and delay.
  • the input of the punctuation prediction model is usually only the text sequence output by the speech recognition model, and the features that can help punctuation prediction cannot be used in the speech pauses.
  • the present disclosure provides a speech recognition method, apparatus, storage medium and electronic device to simplify the complexity of a speech recognition system, reduce power consumption and time delay in the speech recognition process, and improve speech recognition efficiency.
  • FIG. 1 is a flowchart of a speech recognition method according to an exemplary embodiment of the present disclosure. 1, the speech recognition method includes:
  • Step 101 acquiring target audio to be identified.
  • Step 102 perform feature extraction on the target audio to obtain a speech feature sequence.
  • Step 103 input the speech feature sequence into the speech recognition model to obtain the punctuated target text corresponding to the target audio, the speech recognition model is obtained by training the punctuated sample text with punctuation information and the sample audio corresponding to the punctuated sample text. .
  • the target audio may be input by the user in real time, or may be acquired from the memory of the electronic device in response to a voice recognition instruction triggered by the user, or may be downloaded from the network, etc.
  • the embodiments of the present disclosure This is not limited. It should be understood that the process of performing feature extraction on the target audio to obtain the speech feature sequence is similar to that in the related art, and will not be repeated here.
  • the voice features in the voice feature sequence are the features of the time dimension, and each moment may correspond to one voice feature.
  • the speech recognition model may be a streaming end-to-end model Recurrent Neural Network Transducer (RNN-T).
  • RNN-T Recurrent Neural Network Transducer
  • end-to-end learning can show better performance than traditional hybrid models in speech recognition. It can remove the dependence on pronunciation dictionaries and integrate the acoustic model and language model into one model, which not only simplifies the modeling process, but also simplifies the modeling process. Improve system performance.
  • the speech recognition model may be obtained by training sample text with punctuation marked with punctuation information and sample audio corresponding to the sample text with punctuation.
  • the embodiments of the present disclosure can train an end-to-end speech recognition model through paired sample audio and punctuated sample text, realize the fusion of the speech recognition model and the punctuation prediction model into one model, reduce the overall system power consumption and Delay, improve system performance, thereby improving speech recognition efficiency.
  • the speech recognition model can combine acoustic and linguistic information to output speech recognition results, and can make full use of information such as emotion, tone and other information contained in the acoustic features for punctuation prediction, thereby improving the accuracy of punctuation prediction.
  • the sample text with punctuation and the sample audio can be obtained by the following methods: in the case of obtaining the sample audio and the sample text corresponding to the sample audio but not marked with punctuation information, through a pre-trained offline punctuation model Add punctuation information to the sample text corresponding to the sample audio but not marked with punctuation information to obtain the punctuated sample text; or, in the case of obtaining the punctuated sample text, synthesize the punctuated sample text corresponding to sample audio.
  • the speech recognition model can model the acoustic model and the language model at the same time, so the model needs to be trained with paired sample audio and sample text with punctuation.
  • the training data for speech recognition includes audio and text data without punctuation
  • the training data for the punctuation prediction model includes text data with punctuation, but does not include audio. Therefore, in this embodiment of the present disclosure, in order to obtain pairs of sample audio and punctuated sample text, the following two methods may be adopted:
  • a pre-trained speech synthesis model such as the Tactron model, can be used to synthesize sample audio corresponding to the sample text with punctuation.
  • FIG. 2 a schematic diagram of the training and application process of the speech recognition model in the embodiment of the present disclosure may be as shown in FIG. 2 .
  • ASR automatic speech recognition
  • training data that is, the sample text corresponding to the sample audio and not marked with punctuation information
  • the text punctuation system so as to obtain the punctuated text-voice pair training data, that is, we can obtain Paired sample audio and punctuated sample text.
  • text training data ie, punctuated sample text
  • TTS Text To Speech, text-to-speech
  • the RNN-T model can be trained on the training data through the punctuated text and speech, so that speech recognition can be performed through the trained speech recognition model to reduce system power consumption and delay and improve speech recognition efficiency.
  • the speech recognition model can be used to process the speech feature sequence in the following manner to obtain the punctuated target text corresponding to the target audio: With the character recognition result determined at the previous moment, determine the character probability value corresponding to the speech feature, wherein the character probability value includes the punctuation probability value corresponding to the punctuation mark; if the target character probability value in the character probability value is greater than the preset threshold value, then determine the target The character corresponding to the character probability value is the target character recognition result of the speech feature.
  • the preset threshold may be set according to different service conditions, which is not limited in this embodiment of the present disclosure.
  • the recognition result output by the speech recognition model is corresponding output at each moment, for example, the recognition result A is output at the first moment, the recognition result B is output at the second moment, and so on, the recognition result output at each moment can be obtained,
  • the recognition results output at each moment are combined according to the output order, and the final speech recognition result can be obtained.
  • the speech recognition model can process punctuation marks as output characters and directly output punctuated target text.
  • the character probability value corresponding to the voice feature may be determined based on the voice feature and the character recognition result determined at the previous moment. It should be understood that, multiple characters that may correspond to the voice feature can be determined according to the voice feature, so that multiple character probability values can be obtained. Then, a target character probability value greater than a preset threshold may be selected from the plurality of character probability values, so that the character corresponding to the target character probability value is determined as the target character recognition result output at the current moment.
  • the speech recognition model is an RNN-T model, which may include an encoder (Encoder) network, a prediction network (prediction network) and a joint network (joint network).
  • the input of the encoder network is speech features (ie, acoustic features), which mainly model human pronunciation.
  • the input of the prediction network is the character recognition result determined at the previous moment, and it mainly models the language information.
  • the joint network can combine acoustic and linguistic features to predict the target character recognition result output at the next moment. For example, referring to Fig.
  • the voice feature x t can be input into the encoder, and the voice feature obtained after feature transformation is obtained through the encoder network Input the character recognition result y t-1 determined at the previous moment into the prediction network, and obtain the character features obtained after feature conversion through the prediction network
  • the joint network can combine the input speech features and character features Feature processing is performed to obtain a new fusion feature z t,u .
  • the speech recognition model can predict the character probability through the softmax layer to obtain the character probability value, so as to determine the target character recognition result to be output. It should be understood that the specific structure of each module in the speech recognition model is similar to the RNN-T model in the related art, and details are not repeated here.
  • the speech recognition model can process punctuation marks as output characters in the process of outputting speech recognition, so as to directly output the target text with punctuation, without the need to use the punctuation prediction model to perform subsequent processing on the punctuation-free text obtained by speech recognition. Punctuation is added to reduce system power consumption and latency and improve speech recognition efficiency.
  • the punctuation position in the punctuated sample text may have a position offset, and the position offset is used to represent the number of characters that differ between the actual position of the punctuation in the punctuated sample text and the marked position.
  • the speech recognition model can be used to determine the target text with punctuation corresponding to the target audio in the following manner: the punctuation position is determined before the initial punctuation position identified by the speech feature sequence, and the punctuation position is between the initial punctuation position.
  • the number of interval characters is the number of characters represented by the position offset.
  • the speech recognition model can delay the position of the punctuation by N (N can be 1 or 2) characters, that is, let the speech recognition model look at a few more characters and then judge the previous character position to make a punctuation judgment.
  • N can be 1 or 2 characters
  • the position offset refers to the number of delayed characters. For example, if the position offset is 1 or 2, it means that the speech recognition model will look at 1 or 2 more characters before making punctuation judgment.
  • punctuation with a position offset may be performed on the sample text with punctuation. For example, if the position offset is 1, the actual position of each punctuation in the sample text with punctuation is delayed by one character position. In this case, the trained speech recognition model can predict punctuation after seeing one more character. In the application stage of the speech recognition model, since the speech recognition model performs punctuation prediction after reading a few more characters, it is necessary to move the predicted punctuation position forward by the corresponding payment amount to obtain accurate punctuation prediction results.
  • the speech recognition model can perform punctuation prediction after seeing two more characters, that is, punctuation prediction can be performed after recognizing the two characters "tomorrow”.
  • a comma may be added after the word "day” in “tomorrow”. This comma can then be moved forward 2 characters to get accurate punctuation predictions. It should be understood that, in the embodiment of the present disclosure, 0 may be added to the end of a sentence.
  • a solution of punctuation prediction after reading a few more characters can also be implemented. For example, in the above example, for the period at the end, you can look at two more characters of 0 and then perform punctuation prediction, that is, add a period at the second 0 at the end of the sentence, and then move the period forward by 2 characters to get Accurate punctuation prediction results.
  • character delay can be performed on the punctuation position, so that the speech recognition model can judge the previous position after reading a few more characters, so as to improve the accuracy of punctuation prediction.
  • the training step of the speech recognition model may include: inputting a sample speech feature sequence corresponding to the sample audio into the speech recognition model to determine a plurality of punctuation prediction texts corresponding to the sample speech feature sequence, wherein each punctuation prediction The text corresponds to a correspondence between the text information and the time information in the sample audio, and then for each of the predicted text with punctuation, the loss can be calculated according to the sample text with punctuation corresponding to the predicted text with punctuation and the sample audio and marked with punctuation information. function to obtain the target loss function, and finally adjust the parameters of the speech recognition model according to the target loss function.
  • the speech recognition model cannot identify which 2 of the 3 seconds these 2 words correspond to, then the speech recognition model can target the 3 seconds. All possible occurrences of the two words bell are used for speech recognition, thereby obtaining 6 predicted texts with punctuation. Then, for each predicted text with punctuation, a loss function may be calculated respectively according to the predicted text with punctuation and the sample text with punctuation corresponding to the sample audio and marked with punctuation information, so as to obtain the target loss function.
  • the specific type of the loss function is not limited in the embodiment of the present disclosure, and may be set according to the actual business situation, which is not limited in the embodiment of the present disclosure.
  • the calculation result of the target loss function can be used to characterize the difference between the predicted text with punctuation and the sample text with punctuation.
  • the difference is large, so that the calculation result of the objective loss function can be reduced by adjusting the parameters of the speech recognition model, so as to improve the accuracy of the result of the speech recognition model.
  • the calculation result of the target loss function is small, it means that the difference between the predicted text with punctuation and the sample text with punctuation is small, and the parameters of the speech recognition model may not be adjusted, or the speech recognition model can be adjusted by adjusting the The parameters of the model are used to further reduce the calculation result of the target loss function, so as to further improve the accuracy of the results of the speech recognition model.
  • the training objective function of the speech recognition model may be to maximize the character probability value of the character recognition result output by a given speech feature sequence, that is, the calculation result of the objective loss function is the smallest.
  • the formula of the training objective function can be:
  • x) represents the character probability value of the character recognition result output by the speech feature sequence
  • T represents the duration of the sample audio
  • U represents the number of characters included in the sample audio
  • U represents the speech feature of the i-th moment
  • determining a plurality of predicted texts with punctuation corresponding to the sample speech feature sequence may be: for each corresponding situation of text information and time information in the sample audio, determining each sample speech feature in the sample speech feature sequence The corresponding sample character probability value, and according to the sample character probability value corresponding to the sample speech feature sequence, the predicted text with punctuation is determined.
  • the training step of the speech recognition model may further include: adding a probability penalty value to the sample character probability values corresponding to the sentence-ending character in the predicted text with punctuation and a plurality of characters before the sentence-ending character, so as to reduce the sentence-ending character.
  • the embodiments of the present disclosure may penalize the punctuation probability values of several frames at the end of a sentence to reduce the probability values.
  • the speaker said two words in the sample audio
  • the duration of the sample audio is 3 seconds.
  • the sample audio can be determined.
  • the sample character probability value corresponding to each sample speech feature in the sample character probability value so as to determine a punctuation prediction text according to the sample character probability value.
  • the sample character probability value corresponding to each sample speech feature in the sample audio can be determined, so as to determine another sample character probability value according to the sample character probability value.
  • a probability penalty value may be added to the sample character probability values corresponding to the sentence-ending character in the punctuation-predicted text and the multiple characters located before the sentence-ending character, so as to reduce the sentence-ending characters and Probability values of sample characters corresponding to multiple characters before the end-of-sentence character.
  • the multiple characters located before the end-of-sentence character may be determined according to the actual business situation, which is not limited in this embodiment of the present disclosure.
  • the same probability penalty value may be added to the sample character probability values corresponding to the sentence-ending characters in the punctuation-predicted text and multiple characters located before the sentence-ending characters;
  • the probability values of the sample characters corresponding to the end-of-sentence characters and the multiple characters before the end-of-sentence character can be added with different probability penalty values, so that the probability values of the sample characters corresponding to the end-of-sentence characters and the multiple characters before the end-of-sentence characters In descending order of characters in predicted text with punctuation.
  • the same constant penalty a can be added to the character probability values of the M characters at the end of a sentence in the punctuation-predicted text.
  • different penalties can also be added to the character probability values of the M characters at the end of the sentence in the text with punctuation prediction, so that the probability values of the sample characters corresponding to the sentence end character and the multiple characters before the sentence end character are based on the corresponding characters.
  • the order in the predicted text with punctuation decreases sequentially.
  • P'(x t ) represents the probability value of the character corresponding to the speech feature x t with the probability penalty value added
  • P represents the character probability value corresponding to the speech feature x t without the probability penalty value added, that is, obtained through the speech recognition model
  • the initial character probability value of , t T-n+1,...,T-1,T, where T represents the speech feature length corresponding to the sample audio, and b represents a preset constant.
  • an embodiment of the present disclosure also provides a voice recognition apparatus, which can become part or all of an electronic device through software, hardware, or a combination of the two.
  • the speech recognition apparatus 400 may include:
  • Obtaining module 401 for obtaining target audio to be identified
  • Extraction module 402 for performing feature extraction on the target audio to obtain a speech feature sequence
  • the recognition module 403 is used to input the speech feature sequence into a speech recognition model to obtain a punctuated target text corresponding to the target audio, and the speech recognition model is to use the punctuated sample text marked with punctuation information and the It is obtained by training the sample audio corresponding to the punctuation sample text.
  • the speech recognition model is used to process the speech feature sequence through the following modules to obtain the punctuated target text corresponding to the target audio:
  • the first determination module is configured to, for the voice feature corresponding to each moment in the voice feature sequence, determine the character probability value corresponding to the voice feature based on the voice feature and the character recognition result determined at the previous moment, wherein The character probability value includes a punctuation probability value corresponding to the punctuation symbol;
  • the second determining module is configured to determine, when the probability value of the target character in the character probability value is greater than a preset threshold, the character corresponding to the probability value of the target character is the target character recognition result of the voice feature.
  • the punctuation position in the punctuated sample text has a position offset
  • the position offset is used to characterize the difference between the actual position of the punctuation in the punctuated sample text and the marked position.
  • the speech recognition model is used to determine the punctuated target text corresponding to the target audio through the following modules:
  • a third determining module configured to determine the punctuation position before the initial punctuation position identified by the speech feature sequence, and the number of characters in the interval between the punctuation position and the initial punctuation position is represented by the position offset number of characters.
  • the apparatus 400 further includes the following modules for training the speech recognition model:
  • the input module is used to input the sample speech feature sequence corresponding to the sample audio into the speech recognition model to determine a plurality of punctuation prediction texts corresponding to the sample speech feature sequence, wherein each of the punctuation prediction texts corresponds to A correspondence between text information and time information in the sample audio;
  • a calculation module configured to calculate a loss function according to the punctuation-predicted text and the sample audio with punctuation corresponding to the punctuation-predicted text and marked with punctuation information, so as to obtain a target loss function
  • An adjustment module configured to adjust parameters of the speech recognition model according to the target loss function.
  • the input module is used to:
  • the apparatus 400 also includes the following modules for training the speech recognition model:
  • the first adding module is used to add a probability penalty value to the sample character probability values corresponding to the sentence-ending characters in the punctuation-predicted text and the multiple characters before the sentence-ending characters, so as to reduce the sentence endings character and the sample character probability values corresponding to the characters before the sentence-ending character.
  • the first addition module is used to:
  • Different probability penalty values are added to the sample character probability values corresponding to the sentence-ending characters in the predicted text with punctuation and multiple characters located before the sentence-ending characters, so that the sentence-ending characters and the sentence-ending characters located in the sentence
  • the probability values of the sample characters corresponding to the multiple characters before the tail character are sequentially decreased according to the order of the corresponding characters in the predicted text with punctuation.
  • the apparatus 400 further includes the following means for determining the punctuated sample text and the sample audio:
  • the second addition module is configured to use a pre-trained offline punctuation model to perform a pre-trained offline punctuation model for the sample audio corresponding to the sample audio without punctuation in the case of obtaining the sample audio and the sample text corresponding to the sample audio and not marked with punctuation information. adding punctuation information to the sample text of the information to obtain the punctuated sample text; or
  • the synthesis module is used for synthesizing sample audio corresponding to the punctuated sample text through the pre-trained speech synthesis model when the punctuated sample text is obtained.
  • an embodiment of the present disclosure also provides a computer-readable medium on which a computer program is stored, and when the program is executed by a processing apparatus, implements the steps of any of the above speech recognition methods.
  • an electronic device including:
  • a processing device is configured to execute the computer program in the storage device, so as to implement the steps of any one of the above speech recognition methods.
  • Terminal devices in the embodiments of the present disclosure may include, but are not limited to, such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablets), PMPs (portable multimedia players), vehicle-mounted terminals (eg, mobile terminals such as in-vehicle navigation terminals), etc., and stationary terminals such as digital TVs, desktop computers, and the like.
  • the electronic device shown in FIG. 5 is only an example, and should not impose any limitation on the function and scope of use of the embodiments of the present disclosure.
  • an electronic device 500 may include a processing device (eg, a central processing unit, a graphics processor, etc.) 501 that may be loaded into random access according to a program stored in a read only memory (ROM) 502 or from a storage device 508 Various appropriate actions and processes are executed by the programs in the memory (RAM) 503 . In the RAM 503, various programs and data required for the operation of the electronic device 500 are also stored.
  • the processing device 501, the ROM 502, and the RAM 503 are connected to each other through a bus 504.
  • An input/output (I/O) interface 505 is also connected to bus 504 .
  • I/O interface 505 input devices 506 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; including, for example, a liquid crystal display (LCD), speakers, vibration
  • An output device 507 such as a computer
  • a storage device 508 including, for example, a magnetic tape, a hard disk, etc.
  • Communication means 509 may allow electronic device 500 to communicate wirelessly or by wire with other devices to exchange data. While FIG. 5 shows electronic device 500 having various means, it should be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
  • embodiments of the present disclosure include a computer program product comprising a computer program carried on a non-transitory computer readable medium, the computer program containing program code for performing the method illustrated in the flowchart.
  • the computer program may be downloaded and installed from the network via the communication device 509, or from the storage device 508, or from the ROM 502.
  • the processing apparatus 501 When the computer program is executed by the processing apparatus 501, the above-mentioned functions defined in the methods of the embodiments of the present disclosure are executed.
  • the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the above two.
  • the computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or a combination of any of the above. More specific examples of computer readable storage media may include, but are not limited to, electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read only memory (ROM), erasable Programmable read only memory (EPROM or flash memory), fiber optics, portable compact disk read only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
  • 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 with computer-readable program code embodied thereon. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing.
  • a computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device .
  • Program code embodied on a computer readable medium may be transmitted using any suitable medium including, but not limited to, electrical wire, optical fiber cable, RF (radio frequency), etc., or any suitable combination of the foregoing.
  • any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol)
  • HTTP HyperText Transfer Protocol
  • communication networks include local area networks (“LAN”), wide area networks (“WAN”), the Internet (eg, the Internet), and peer-to-peer networks (eg, ad hoc peer-to-peer networks), as well as any currently known or future development network of.
  • the above-mentioned computer-readable medium may be included in the above-mentioned electronic device; or may exist alone 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: acquires the target audio to be identified; performs feature extraction on the target audio to obtain Voice feature sequence; input the voice feature sequence into a voice recognition model to obtain a punctuated target text corresponding to the target audio, and the voice recognition model is a sample text with punctuation marked with punctuation information and the sample with punctuation.
  • the sample audio corresponding to the text is obtained by training.
  • Computer program code for performing operations of the present disclosure may be written in one or more programming languages, including but not limited to object-oriented programming languages—such as Java, Smalltalk, C++, and This includes conventional procedural programming languages - such as the "C" language 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's 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 (eg, using an Internet service provider to via Internet connection).
  • LAN local area network
  • WAN wide area network
  • each block in the flowchart or block diagrams may represent a module, segment, or portion of code that contains one or more logical functions for implementing the specified functions executable instructions.
  • the functions noted in the blocks 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 the blocks 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 in dedicated hardware-based systems that perform the specified functions or operations , or can be implemented in a combination of dedicated hardware and computer instructions.
  • the modules involved in the embodiments of the present disclosure may be implemented in software or hardware. Among them, the name of the module does not constitute a limitation of the module itself under certain circumstances.
  • exemplary types of hardware logic components include: Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), Systems on Chips (SOCs), Complex Programmable Logical Devices (CPLDs) and more.
  • FPGAs Field Programmable Gate Arrays
  • ASICs Application Specific Integrated Circuits
  • ASSPs Application Specific Standard Products
  • SOCs Systems on Chips
  • CPLDs Complex Programmable Logical Devices
  • a machine-readable medium may be a tangible medium that may contain or store a program for use by or in connection with the instruction execution system, apparatus or device.
  • the machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium.
  • Machine-readable media may include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or devices, or any suitable combination of the foregoing.
  • machine-readable storage media would include one or more wire-based electrical connections, portable computer disks, hard disks, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM or flash memory), fiber optics, 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 speech recognition method, comprising:
  • Feature extraction is performed on the target audio to obtain a speech feature sequence
  • the speech recognition model Inputting the speech feature sequence into a speech recognition model to obtain a punctuated target text corresponding to the target audio, the speech recognition model is a sample text with punctuation marked with punctuation information and a sample corresponding to the punctuated sample text audio training.
  • Example 2 provides the method of Example 1, where the speech recognition model is configured to process the speech feature sequence in the following manner to obtain a punctuated target corresponding to the target audio text:
  • the character probability value corresponding to the voice feature For the voice feature corresponding to each moment in the voice feature sequence, based on the voice feature and the character recognition result determined at the previous moment, determine the character probability value corresponding to the voice feature, wherein the character probability value includes punctuation The punctuation probability value corresponding to the symbol;
  • the probability value of the target character in the character probability value is greater than the preset threshold, it is determined that the character corresponding to the probability value of the target character is the target character recognition result of the voice feature.
  • Example 3 provides the method of Example 1, the punctuation position in the punctuated sample text has a position offset that is used to characterize the punctuated sample The number of characters that differ between the actual position of the punctuation in the text and the marked position, and the speech recognition model is used to determine the punctuated target text corresponding to the target audio in the following manner:
  • the punctuation position is determined before the initial punctuation position identified through the speech feature sequence, and the number of characters spaced between the punctuation position and the initial punctuation position is the number of characters represented by the position offset.
  • Example 4 provides the method of any one of Examples 1-3, wherein the training step of the speech recognition model includes:
  • For each of the predicted text with punctuation calculate a loss function according to the predicted text with punctuation and the sample audio with punctuation corresponding to the sample audio and marked with punctuation information, to obtain a target loss function;
  • the parameters of the speech recognition model are adjusted according to the objective loss function.
  • Example 5 provides the method of Example 4, wherein the determining a plurality of predicted texts with punctuation corresponding to the sample speech feature sequence includes:
  • the training steps of the speech recognition model also include:
  • a probability penalty value is added to the sample character probability values corresponding to the sentence-ending characters in the predicted text with punctuation and a plurality of characters located before the sentence-ending characters, so as to reduce the sentence-ending characters and the sentence-ending characters.
  • the sample character probability values corresponding to multiple characters preceding the character are added to the sample character probability values corresponding to the sentence-ending characters in the predicted text with punctuation and a plurality of characters located before the sentence-ending characters, so as to reduce the sentence-ending characters and the sentence-ending characters.
  • Example 6 provides the method of Example 5, of predicting a sentence-ending character in the punctuated text and samples corresponding to a plurality of characters before the sentence-ending character Character probability values add probability penalty values, including:
  • Different probability penalty values are added to the sample character probability values corresponding to the sentence-ending characters in the predicted text with punctuation and multiple characters located before the sentence-ending characters, so that the sentence-ending characters and the sentence-ending characters located in the sentence
  • the probability values of the sample characters corresponding to the multiple characters before the tail character are sequentially decreased according to the order of the corresponding characters in the predicted text with punctuation.
  • Example 7 provides the method of any one of Examples 1-3, wherein the punctuated sample text and the sample audio are obtained in the following manner:
  • the sample audio corresponding to the punctuated sample text is synthesized by the pre-trained speech synthesis model.
  • Example 8 provides a speech recognition apparatus, the apparatus comprising:
  • an acquisition module for acquiring the target audio to be identified
  • an extraction module for performing feature extraction on the target audio to obtain a speech feature sequence
  • the recognition module is used to input the speech feature sequence into the speech recognition model to obtain the punctuated target text corresponding to the target audio, and the speech recognition model is to use the punctuated sample text marked with punctuation information and the punctuated sample text with the punctuation.
  • the sample audio corresponding to the sample text is obtained by training.
  • Example 9 provides the apparatus of Example 8, where the speech recognition model is configured to process the speech feature sequence through the following modules to obtain a punctuated target corresponding to the target audio text:
  • the first determination module is configured to, for the voice feature corresponding to each moment in the voice feature sequence, determine the character probability value corresponding to the voice feature based on the voice feature and the character recognition result determined at the previous moment, wherein The character probability value includes a punctuation probability value corresponding to the punctuation symbol;
  • the second determining module is configured to determine, when the probability value of the target character in the character probability value is greater than a preset threshold, the character corresponding to the probability value of the target character is the target character recognition result of the voice feature.
  • Example 10 provides the apparatus of Example 8, the punctuation position in the punctuated sample text has a position offset that is used to characterize the punctuated sample The number of characters that differ between the actual position of the punctuation in the text and the marked position, and the speech recognition model is used to determine the punctuated target text corresponding to the target audio through the following modules:
  • a third determining module configured to determine the punctuation position before the initial punctuation position identified by the speech feature sequence, and the number of characters in the interval between the punctuation position and the initial punctuation position is represented by the position offset number of characters.
  • Example 11 provides the apparatus of any one of Examples 8-10, the apparatus further comprising the following modules for training the speech recognition model:
  • the input module is used to input the sample speech feature sequence corresponding to the sample audio into the speech recognition model to determine a plurality of punctuation prediction texts corresponding to the sample speech feature sequence, wherein each of the punctuation prediction texts corresponds to A correspondence between text information and time information in the sample audio;
  • a calculation module configured to calculate a loss function for each of the punctuated predicted texts according to the punctuated sample texts with punctuation information corresponding to the punctuated predicted texts and the sample audio, to obtain a target loss function
  • An adjustment module configured to adjust parameters of the speech recognition model according to the target loss function.
  • Example 12 provides the apparatus of Example 11, the input module for:
  • the apparatus also includes the following modules for training the speech recognition model:
  • the first adding module is used to add a probability penalty value to the sample character probability values corresponding to the sentence-ending characters in the punctuation-predicted text and the multiple characters before the sentence-ending characters, so as to reduce the sentence endings character and the sample character probability values corresponding to the characters before the sentence-ending character.
  • Example 13 provides the apparatus of Example 12, the first addition module for:
  • Different probability penalty values are added to the sample character probability values corresponding to the sentence-ending characters in the predicted text with punctuation and multiple characters located before the sentence-ending characters, so that the sentence-ending characters and the sentence-ending characters located in the sentence
  • the probability values of the sample characters corresponding to the multiple characters before the tail character are sequentially decreased according to the order of the corresponding characters in the predicted text with punctuation.
  • Example 14 provides the apparatus of any one of Examples 8-10, the apparatus further comprising the following means for determining the punctuated sample text and the sample audio:
  • the second addition module is configured to use a pre-trained offline punctuation model to perform a pre-trained offline punctuation model for the sample audio corresponding to the sample audio without punctuation in the case of obtaining the sample audio and the sample text corresponding to the sample audio and not marked with punctuation information. adding punctuation information to the sample text of the information to obtain the punctuated sample text; or
  • the synthesis module is used for synthesizing sample audio corresponding to the punctuated sample text through the pre-trained speech synthesis model when the punctuated sample text is obtained.
  • Example 15 provides a computer-readable medium having stored thereon a computer program that, when executed by a processing apparatus, implements the steps of the method of any one of Examples 1-7.
  • Example 16 provides an electronic device comprising:
  • a processing device configured to execute the computer program in the storage device, to implement the steps of the method in any one of Examples 1-7.

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)
  • Evolutionary Computation (AREA)
  • Machine Translation (AREA)

Abstract

一种语音识别方法、装置(400)、存储介质及电子设备(500),以降低语音识别系统的复杂度,提高语音识别效率。语音识别方法包括:获取待识别的目标音频(101);对目标音频进行特征提取,以得到语音特征序列(102);将语音特征序列输入语音识别模型,以得到目标音频对应的带标点目标文本,语音识别模型是通过标注有标点信息的带标点样本文本以及带标点样本文本对应的样本音频训练得到的(103)。

Description

语音识别方法、装置、存储介质及电子设备
相关申请的交叉引用
本申请是以中国申请号为202110004489.X,申请日为2021年1月4日的申请为基础,并主张其优先权,该中国申请的公开内容在此作为整体引入本申请中。
技术领域
本公开涉及语音识别技术领域,具体地,涉及一种语音识别方法、装置、存储介质及电子设备。
背景技术
标点预测是语音识别系统中不可缺少的一个部分,通常语音识别会将连续的音频信号转化成文字序列,然后标点预测功能会对文字打上标点,实现断句的功能。比如语音识别系统出来的结果通常是纯文字序列“今天天气很好我们去爬山吧”,经过标点预测模型处理后得到“今天天气很好,我们去爬山吧。”标点预测可以在保持语义的完整性上将文字进行切分,提升阅读的流畅性,并且断句后更有利于后续机器翻译等任务的进行。
相关技术中,语音识别和标点预测作为两个独立的子模块单独运行,通常需要等到语音识别结束后,才会调用标点预测模型做标点处理。这样的设计增加了整个系统的复杂度,功耗和延迟都有所增加。
发明内容
提供该发明内容部分以便以简要的形式介绍构思,这些构思将在后面的具体实施方式部分被详细描述。该发明内容部分并不旨在标识要求保护的技术方案的关键特征或必要特征,也不旨在用于限制所要求的保护的技术方案的范围。
第一方面,本公开提供一种语音识别方法,所述方法包括:
获取待识别的目标音频;
对所述目标音频进行特征提取,以得到语音特征序列;
将所述语音特征序列输入语音识别模型,以得到所述目标音频对应的带标点目标文本,所述语音识别模型是通过标注有标点信息的带标点样本文本以及所述带标点样本文本对应的样本音频训练得到的。
第二方面,本公开提供一种语音识别装置,所述装置包括:
获取模块,用于获取待识别的目标音频;
提取模块,用于对所述目标音频进行特征提取,以得到语音特征序列;
识别模块,用于将所述语音特征序列输入语音识别模型,以得到所述目标音频对应的带标点目标文本,所述语音识别模型是通过标注有标点信息的带标点样本文本以及所述带标点样本文本对应的样本音频训练得到的。
第三方面,本公开提供一种语音识别模型的训练方法,包括:
获取成对的样本音频和带标点样本文本;
将所述样本音频对应的样本语音特征序列输入语音识别模型,以确定所述样本语音特征序列对应的多个带标点预测文本,其中每一所述带标点预测文本对应所述样本音频中文字信息与时间信息的一种对应情况;
针对每一所述带标点预测文本,根据所述带标点预测文本和所述样本音频对应的、标注有标点信息的带标点样本文本计算损失函数,以得到目标损失函数;
根据所述目标损失函数调整所述语音识别模型的参数。
第四方面,一种计算机可读介质,其上存储有计算机程序,该程序被处理装置执行时实现第一方面中所述方法的步骤。
第五方面,本公开提供一种电子设备,包括:
存储装置,其上存储有计算机程序;
处理装置,用于执行所述存储装置中的所述计算机程序,以实现第一方面中所述方法的步骤。
按照上述技术方案,通过标注有标点信息的带标点样本文本以及带标点样本文本对应的样本音频进行端到端的模型训练,从而语音识别模型可以自动学习语音到带标点文本的映射,后续过程将语音输入语音识别模型则可以直接得到带标点目标文本,即语音识别和标点预测可以同时进行,进而可以降低系统复杂度、系统功耗和延迟,提高语音识别效率。并且,语音识别模型通过结合声学和语言信息输出语音识别结果的方式,充分利用了声学特征中包含的情绪、语气等信息进行标点预测,一定程度上可以提高标点预测的准确性。
本公开的其他特征和优点将在随后的具体实施方式部分予以详细说明。
附图说明
结合附图并参考以下具体实施方式,本公开各实施例的上述和其他特征、优点及方面将变得更加明显。贯穿附图中,相同或相似的附图标记表示相同或相似的元素。应当理解 附图是示意性的,原件和元素不一定按照比例绘制。在附图中:
图1是根据本公开一示例性实施例示出的一种语音识别方法的流程图;
图2是根据本公开一示例性实施例示出的一种语音识别方法中语音识别模型的训练及应用过程示意图;
图3是根据本公开一示例性实施例示出的一种语音识别方法中语音识别模型的结构示意图;
图4是根据本公开一示例性实施例示出的一种语音识别装置的框图;
图5是根据本公开一示例性实施例示出的一种电子设备的框图。
具体实施方式
下面将参照附图更详细地描述本公开的实施例。虽然附图中显示了本公开的某些实施例,然而应当理解的是,本公开可以通过各种形式来实现,而且不应该被解释为限于这里阐述的实施例,相反提供这些实施例是为了更加透彻和完整地理解本公开。应当理解的是,本公开的附图及实施例仅用于示例性作用,并非用于限制本公开的保护范围。
应当理解,本公开的方法实施方式中记载的各个步骤可以按照不同的顺序执行,和/或并行执行。此外,方法实施方式可以包括附加的步骤和/或省略执行示出的步骤。本公开的范围在此方面不受限制。
本文使用的术语“包括”及其变形是开放性包括,即“包括但不限于”。术语“基于”是“至少部分地基于”。术语“一个实施例”表示“至少一个实施例”;术语“另一实施例”表示“至少一个另外的实施例”;术语“一些实施例”表示“至少一些实施例”。其他术语的相关定义将在下文描述中给出。
需要注意,本公开中提及的“第一”、“第二”等概念仅用于对不同的装置、模块或单元进行区分,并非用于限定这些装置、模块或单元所执行的功能的顺序或者相互依存关系。另外需要注意,本公开中提及的“一个”、“多个”的修饰是示意性而非限制性的,本领域技术人员应当理解,除非在上下文另有明确指出,否则应该理解为“一个或多个”。
本公开实施方式中的多个装置之间所交互的消息或者信息的名称仅用于说明性的目的,而并不是用于对这些消息或信息的范围进行限制。
标点预测是语音识别系统中不可缺少的一个部分,通常语音识别会将连续的音频信号转化成文字序列,然后标点预测功能会对文字打上标点,实现断句的功能。比如语音识别系统出来的结果通常是纯文字序列“今天天气很好我们去爬山吧”,经过标点预测模型处理后得到“今天天气很好,我们去爬山吧。”标点预测可以在保持语义的完整性上将文字进行 切分,提升阅读的流畅性,并且断句后更有利于后续机器翻译等任务的进行。
相关技术中,语音识别和标点预测作为两个独立的子模块单独运行,通常需要等到语音识别结束后,才会调用标点预测模型做标点处理。发明人研究发现这样的设计增加了整个系统的复杂度,功耗和延迟都有所增加。此外,标点预测模型的输入通常仅为语音识别模型输出的文本序列,在语音中人的语气停顿这些可以帮助标点预测的特征都无法被利用到。
有鉴于此,本公开提供一种语音识别方法、装置、存储介质及电子设备,以简化语音识别系统的复杂度,减少语音识别过程中的功耗和时延,提高语音识别效率。
图1是根据本公开一示例性实施例示出的一种语音识别方法的流程图。参照图1,该语音识别方法包括:
步骤101,获取待识别的目标音频。
步骤102,对目标音频进行特征提取,以得到语音特征序列。
步骤103,将语音特征序列输入语音识别模型,以得到目标音频对应的带标点目标文本,该语音识别模型是通过标注有标点信息的带标点样本文本以及带标点样本文本对应的样本音频训练得到的。
示例地,目标音频可以是用户实时输入的,或者也可以是响应于用户触发的语音识别指令从电子设备的存储器中获取到的,或者还可以是从网络下载的,等等,本公开实施例对此不作限定。应当理解的是,对目标音频进行特征提取,以得到语音特征序列的过程与相关技术中类似,这里不再赘述。其中,语音特征序列中的语音特征为时间维度的特征,每一时刻可以对应有一个语音特征。
示例地,语音识别模型可以是流式端到端模型循环神经网络转换机(recurrent neural network transducer,RNN-T)。其中,端到端学习在语音识别可以表现出比传统混合模型更好的性能,可以去掉对发音辞典的依赖,将声学模型和语言模型整合到一个模型中,既简化了建模的流程,也提升系统的性能。本公开实施例中,语音识别模型可以通过标注有标点信息的带标点样本文本以及带标点样本文本对应的样本音频训练得到。也即是说,本公开实施例可以通过成对的样本音频和带标点样本文本训练端到端的语音识别模型,实现将语音识别模型和标点预测模型融合到一个模型中,降低整体系统功耗和延迟,提升系统性能,从而提高语音识别效率。并且,语音识别模型可以结合声学和语言信息输出语音识别结果,可以充分利用声学特征中包含的情绪、语气等信息进行标点预测,从而提高标点预测的准确性。
在可能的方式中,带标点样本文本与样本音频可以是通过如下方式得到的:在获得样 本音频以及样本音频对应的、未标注有标点信息的样本文本的情况下,通过预训练的离线标点模型对样本音频对应的、未标注有标点信息的样本文本添加标点信息,以得到带标点样本文本;或者,在获得带标点样本文本的情况下,通过预训练的语音合成模型合成带标点样本文本对应的样本音频。
在本公开实施例中,语音识别模型可以同时对声学模型和语言模型建模,因此需要成对的样本音频和带标点样本文本对模型进行训练。相关技术中,语音识别的训练数据包括音频和不带标点的文本数据,标点预测模型的训练数据包括带标点的文本数据,但是不包括音频。因此在本公开实施例中,为了获得成对的样本音频和带标点样本文本,可以采用以下两种方式:
第一种方式,在获得样本音频以及该样本音频对应的、未标注有标点信息的样本文本的情况下,可以通过预训练的离线标点模型,比如BLSTM模型,Bert模型等,对样本音频对应的、未标注有标点信息的样本文本添加标点信息,以得到带标点样本文本。
第二种方式,在获得带标点样本文本的情况下,可以通过预训练的语音合成模型,比如Tactron模型等,合成带标点样本文本对应的样本音频。
以语音识别模型为RNN-T模型为例,本公开实施例中语音识别模型的训练及应用过程示意图可以如图2所示。参照图2,可以将ASR(自动语音识别)训练数据(即样本音频对应的、未标注有标点信息的样本文本)输入文本标点系统中,从而得到带标点的文本语音对训练数据,即可以得到成对的样本音频和带标点样本文本。另一方面,可以将文本训练数据(即带标点样本文本)输入TTS(Text To Speech,从文本到语音)合成系统中,从而得到带标点的文本语音对训练数据。之后,则可以通过该带标点的文本语音对训练数据进行RNN-T模型训练,从而可以通过训练后的语音识别模型进行语音识别,以降低系统功耗和延迟,提高语音识别效率。
在可能的方式中,语音识别模型可以用于通过如下方式对语音特征序列进行处理,以得到目标音频对应的带标点目标文本:先针对语音特征序列中每一时刻对应的语音特征,基于语音特征与上一时刻所确定的字符识别结果,确定语音特征对应的字符概率值,其中字符概率值包括标点符号对应的标点概率值;若字符概率值中目标字符概率值大于预设阈值,则确定目标字符概率值对应的字符为语音特征的目标字符识别结果。其中,预设阈值可以根据不同的业务情况进行设定,本公开实施例对此不作限定。
应当理解的是,语音识别模型输出识别结果是每个时刻进行对应输出,比如第一时刻输出识别结果A,第二时刻输出识别结果B,以此类推,可以得到每一时刻输出的识别结果,从而将每一时刻输出的识别结果按照输出顺序进行组合,即可得到最终的语音识别结 果。
在本公开实施例中,由于通过成对的样本音频和带标点样本文本训练得到语音识别模型,因此语音识别模型可以将标点符号作为输出字符进行处理,直接输出带标点目标文本。具体的,针对语音特征序列中每一时刻对应的语音特征,可以基于语音特征与上一时刻所确定的字符识别结果,确定语音特征对应的字符概率值。应当理解的是,可以根据语音特征确定该语音特征可能对应的多个字符,从而可以得到多个字符概率值。然后可以在该多个字符概率值中选取大于预设阈值的目标字符概率值,从而将目标字符概率值对应的字符确定为当前时刻输出的目标字符识别结果。
例如,参照图3,语音识别模型为RNN-T模型,可以包括编码器(Encoder)网络,预测网络(prediction network)和联合网络(joint network)。其中,编码器网络的输入是语音特征(即声学特征),主要对人的发音进行建模。预测网络的输入是上一时刻所确定的字符识别结果,主要对语言信息进行建模。联合网络可以同时结合声学和语言特性,预测下一时刻输出的目标字符识别结果。比如,参照图3,可以将语音特征x t输入编码器,得到通过编码器网络进行特征转换后得到的语音特征
Figure PCTCN2021136431-appb-000001
并将上一时刻所确定的字符识别结果y t-1输入预测网络,得到通过预测网络进行特征转换后得到的字符特征
Figure PCTCN2021136431-appb-000002
联合网络可以结合输入的语音特征
Figure PCTCN2021136431-appb-000003
和字符特征
Figure PCTCN2021136431-appb-000004
进行特征处理,以得到新的融合特征z t,u。然后,语音识别模型可以通过softmax层进行字符概率预测,以得到字符概率值,从而确定待输出的目标字符识别结果。应当理解的是,该语音识别模型中各模块的具体结构与相关技术中的RNN-T模型类似,这里不再赘述。
通过上述方式,语音识别模型在输出语音识别的过程中,可以将标点符号作为输出字符进行处理,从而直接输出带标点目标文本,而无需后续再通过标点预测模型对语音识别得到的无标点文本进行标点添加,以降低系统功耗和延迟,提高语音识别效率。
在可能的方式中,带标点样本文本中的标点位置可以具有位置偏移量,该位置偏移量用于表征带标点样本文本中标点的实际位置与标注位置之间相差的字符数。相应地,语音识别模型可以用于通过如下方式确定目标音频对应的带标点目标文本:将标点位置确定在通过语音特征序列识别到的初始标点位置之前,且标点位置与所述初始标点位置之间的间隔字符数为位置偏移量表征的字符数。
也即是说,语音识别模型可以对标点的位置进行N个(N可以取1或者2)字符的延迟,即让语音识别模型多看几个字符后对之前的字符位置做标点的判断,以提升标点预测的准确性。其中,位置偏移量即指延迟的字符数,比如位置偏移量为1或2,则表明语音 识别模型会多看1个或2个字符后进行标点判断。
示例地,可以针对带标点样本文本进行带位置偏移量的标点标注,比如位置偏移量为1,则对带标点样本文本中每一标点的实际位置往后延迟1个字符位置。在此种情况下,训练后的语音识别模型则可以多看1个字符后进行标点预测。在语音识别模型的应用阶段,由于语音识别模型是多看几个字符后再进行的标点预测,因此需要将预测得到的标点位置往前移动相应的支付数,以得到准确的标点预测结果。
例如,位置偏移量为2,对于“今天天气很好明天我想要出去玩”,实际情况可以在中间“好”字后面添加逗号,在末尾“玩”字后面添加句号。按照本公开实施例中的方案,语音识别模型可以多看2个字符之后再进行标点预测,即可以在识别“明天”这两个字符之后进行标点预测。此种情况下,可能将逗号添加在“明天”的“天”字后面。然后,可以把这个逗号往前移动2个字符,以得到准确的标点预测结果。应当理解的是,本公开实施例中对于一句话的末尾,可以添0,因此对于句子的末尾字符,同样可以实现多看几个字符后再进行标点预测的方案。比如,上述举例中,对于末尾的句号,可以多看两个字符0之后进行标点预测,即在句子末尾的第2个0处添加句号,然后再将该句号往前移动2个字符,以得到准确的标点预测结果。
通过上述方式,可以对标点位置进行字符延迟,使语音识别模型多看几个字符后对之前的位置做标点的判断,以提升标点预测的准确性。
在可能的方式中,语音识别模型的训练步骤可以包括:可以将样本音频对应的样本语音特征序列输入语音识别模型,以确定样本语音特征序列对应的多个带标点预测文本,其中每一带标点预测文本对应样本音频中文字信息与时间信息的一种对应情况,然后针对每一所述带标点预测文本,可以根据带标点预测文本和样本音频对应的、标注有标点信息的带标点样本文本计算损失函数,以得到目标损失函数,最后根据目标损失函数调整语音识别模型的参数。
例如,样本音频中发音人说了2个字,样本音频的时长为3秒,语音识别模型无法识别这2个字对应的是3秒中的哪2秒,则语音识别模型可以针对该3秒钟这2个字的所有可能的出现情况进行语音识别,从而得到6个带标点预测文本。然后,可以针对每一带标点预测文本,根据带标点预测文本和该样本音频对应的、标注有标点信息的带标点样本文本分别计算损失函数,以得到目标损失函数。其中,损失函数的具体类型本公开实施例对此不作限定,可以根据实际业务情况进行设定,本公开实施例对此不作限定。
示例地,目标损失函数的计算结果可以用于表征带标点预测文本与带标点样本文本之间的差异,若目标损失函数的计算结果较大,则说明带标点预测文本与带标点样本文本之 间的差异较大,从而可以通过调整语音识别模型的参数来减小目标损失函数的计算结果,以提高语音识别模型的结果准确性。另一种情况下,若目标损失函数的计算结果较小,则说明带标点预测文本与带标点样本文本之间的差异较小,可以不调整语音识别模型的参数,或者也可以通过调整语音识别模型的参数来进一步减小目标损失函数的计算结果,以进一步提高语音识别模型的结果准确性。
以图3所示的语音识别模型为例,语音识别模型的训练目标函数可以是要最大化给定语音特征序列输出的字符识别结果的字符概率值,即目标损失函数的计算结果最小。其中,训练目标函数的公式可以是:
Figure PCTCN2021136431-appb-000005
其中,P(y|x)表示语音特征序列输出的字符识别结果的字符概率值,T表示样本音频的时长,U表示样本音频中包括的文字数量,
Figure PCTCN2021136431-appb-000006
表示第i时刻的语音特征,
Figure PCTCN2021136431-appb-000007
表示第i时刻的语音特征所对应的字符概率值。
在可能的方式中,确定样本语音特征序列对应的多个带标点预测文本,可以是:针对样本音频中文字信息与时间信息的每一种对应情况,确定样本语音特征序列中每一样本语音特征对应的样本字符概率值,并根据样本语音特征序列对应的样本字符概率值,确定带标点预测文本。相应地,语音识别模型的训练步骤还可以包括:针对带标点预测文本中的句尾字符以及位于该句尾字符之前的多个字符所对应的样本字符概率值添加概率惩罚值,以减小句尾字符以及位于句尾字符之前的多个字符所对应的样本字符概率值。
样本文本中句子的尾部通常有较长静音,并且训练的时候不同长度的特征会补0到相同长度,因此句尾的标点很有可能对齐到这些静音或特征0上面,从而会造成语音识别的延迟增大,即造成标点预测结果与实际标点位置不符。为了解决该问题,本公开实施例可以对句尾若干帧的标点概率值进行惩罚,减少概率值。
比如,在上述举例中,样本音频中发音人说了2个字,样本音频的时长为3秒,针对该2个字在样本音频中第1秒和第2秒的情况,可以确定该样本音频中每一样本语音特征对应的样本字符概率值,从而根据该样本字符概率值,确定一个带标点预测文本。类似的,针对该2个字在样本音频中第2秒和第3秒的情况,可以确定该样本音频中每一样本语音特征对应的样本字符概率值,从而根据该样本字符概率值,确定另一个带标点预测文本,以此类推,可以得到多个带标点预测文本。
然后,针对每一带标点预测文本,可以对该带标点预测文本中的句尾字符以及位于句尾字符之前的多个字符所对应的样本字符概率值添加概率惩罚值,以减小句尾字符以及位 于句尾字符之前的多个字符所对应的样本字符概率值。其中,位于句尾字符之前的多个字符可以根据实际业务情况确定,本公开实施例对此不作限定。
在可能的方式中,针对带标点预测文本中的句尾字符以及位于句尾字符之前的多个字符所对应的样本字符概率值可以添加相同的概率惩罚值;或者,针对带标点预测文本中的句尾字符以及位于句尾字符之前的多个字符所对应的样本字符概率值可以添加不同的概率惩罚值,以使句尾字符以及位于句尾字符之前的多个字符所对应的样本字符概率值按照在带标点预测文本中的字符顺序依次减小。
示例地,可以对带标点预测文本中句尾的M个字符的字符概率值添加相同的常数惩罚a。在此种情况下,带标点预测文本中句尾M个字符的字符概率值为:P'(x t)=P-a,其中,P'(x t)表示语音特征x t对应的添加有概率惩罚值的字符概率值,P表示语音特征x t对应的未添加有概率惩罚值的字符概率值,即通过语音识别模型得到的初始字符概率值,t=T-M+1,…,T-1,T,T表示样本音频对应的语音特征长度。
或者,还可以对带标点预测文本中句尾的M个字符的字符概率值添加不同的惩罚,以使句尾字符以及位于句尾字符之前的多个字符所对应的样本字符概率值按照对应字符在带标点预测文本中的顺序依次减小。比如,按照如下公式,确定带标点预测文本中句尾M个字符的字符概率值:P'(x t)=P-(M-(T-t))·b。其中,P'(x t)表示语音特征x t对应的添加有概率惩罚值的字符概率值,P表示语音特征x t对应的未添加有概率惩罚值的字符概率值,即通过语音识别模型得到的初始字符概率值,t=T-n+1,…,T-1,T,T表示样本音频对应的语音特征长度,b表示预设常数。
通过上述方式,可以避免将句尾的标点对齐到句尾静音或特征0上面,减少语音识别结果的延迟,使得语音识别中的标点预测结果与实际标点位置更相符,从而在提高语音识别效率的同时,提高语音识别的准确性。
基于同一发明构思,本公开实施例还提供一种语音识别装置,该装置可以通过软件、硬件或两者结合的方式成为电子设备的部分或全部。参照图4,该语音识别装置400可以包括:
获取模块401,用于获取待识别的目标音频;
提取模块402,用于对所述目标音频进行特征提取,以得到语音特征序列;
识别模块403,用于将所述语音特征序列输入语音识别模型,以得到所述目标音频对应的带标点目标文本,所述语音识别模型是通过标注有标点信息的带标点样本文本以及所述带标点样本文本对应的样本音频训练得到的。
在一些实施例中,所述语音识别模型用于通过如下模块对所述语音特征序列进行处理,以得到所述目标音频对应的带标点目标文本:
第一确定模块,用于针对所述语音特征序列中每一时刻对应的语音特征,基于所述语音特征与上一时刻所确定的字符识别结果,确定所述语音特征对应的字符概率值,其中所述字符概率值包括标点符号对应的标点概率值;
第二确定模块,用于当所述字符概率值中目标字符概率值大于预设阈值时,确定所述目标字符概率值对应的字符为所述语音特征的目标字符识别结果。
在一些实施例中,所述带标点样本文本中的标点位置具有位置偏移量,所述位置偏移量用于表征所述带标点样本文本中标点的实际位置与标注位置之间相差的字符数,所述语音识别模型用于通过如下模块确定所述目标音频对应的带标点目标文本:
第三确定模块,用于将标点位置确定在通过语音特征序列识别到的初始标点位置之前,且所述标点位置与所述初始标点位置之间的间隔字符数为所述位置偏移量表征的字符数。
在一些实施例中,所述装置400还包括用于训练所述语音识别模型的如下模块:
输入模块,用于将所述样本音频对应的样本语音特征序列输入所述语音识别模型,以确定所述样本语音特征序列对应的多个带标点预测文本,其中每一所述带标点预测文本对应所述样本音频中文字信息与时间信息的一种对应情况;
计算模块,用于针对每一所述带标点预测文本,根据所述带标点预测文本和所述样本音频对应的、标注有标点信息的带标点样本文本计算损失函数,以得到目标损失函数;
调整模块,用于根据所述目标损失函数调整所述语音识别模型的参数。
在一些实施例中,所述输入模块用于:
针对所述样本音频中文字信息与时间信息的每一种对应情况,确定所述样本语音特征序列中每一样本语音特征对应的样本字符概率值,并根据所述样本语音特征序列对应的所述样本字符概率值,确定所述带标点预测文本;
所述装置400还包括用于训练所述语音识别模型的如下模块:
第一添加模块,用于针对所述带标点预测文本中的句尾字符以及位于所述句尾字符之前的多个字符所对应的样本字符概率值添加概率惩罚值,以减小所述句尾字符以及位于所述句尾字符之前的多个字符所对应的样本字符概率值。
在一些实施例中,所述第一添加模块用于:
针对所述带标点预测文本中的句尾字符以及位于所述句尾字符之前的多个字符所对应的样本字符概率值添加相同的概率惩罚值;或者
针对所述带标点预测文本中的句尾字符以及位于所述句尾字符之前的多个字符所对应的样本字符概率值添加不同的概率惩罚值,以使所述句尾字符以及位于所述句尾字符之前的多个字符所对应的样本字符概率值按照对应字符在所述带标点预测文本中的顺序依次减小。
在一些实施例中,所述装置400还包括用于确定带标点样本文本与所述样本音频的如下模块:
第二添加模块,用于在获得样本音频以及所述样本音频对应的、未标注有标点信息的样本文本的情况下,通过预训练的离线标点模型对所述样本音频对应的、未标注有标点信息的样本文本添加标点信息,以得到所述带标点样本文本;或者
合成模块,用于在获得带标点样本文本的情况下,通过预训练的语音合成模型合成带标点样本文本对应的样本音频。
关于上述实施例中的装置,其中各个模块执行操作的具体方式已经在有关该方法的实施例中进行了详细描述,此处将不做详细阐述说明。
基于同一发明构思,本公开实施例还提供一种计算机可读介质,其上存储有计算机程序,该程序被处理装置执行时实现上述任一语音识别方法的步骤。
基于同一发明构思,本公开实施例还提供一种电子设备,包括:
存储装置,其上存储有计算机程序;
处理装置,用于执行所述存储装置中的所述计算机程序,以实现上述任一语音识别方法的步骤。
下面参考图5,其示出了适于用来实现本公开实施例的电子设备500的结构示意图。本公开实施例中的终端设备可以包括但不限于诸如移动电话、笔记本电脑、数字广播接收器、PDA(个人数字助理)、PAD(平板电脑)、PMP(便携式多媒体播放器)、车载终端(例如车载导航终端)等等的移动终端以及诸如数字TV、台式计算机等等的固定终端。图5示出的电子设备仅仅是一个示例,不应对本公开实施例的功能和使用范围带来任何限制。
如图5所示,电子设备500可以包括处理装置(例如中央处理器、图形处理器等)501,其可以根据存储在只读存储器(ROM)502中的程序或者从存储装置508加载到随机访问存储器(RAM)503中的程序而执行各种适当的动作和处理。在RAM 503中,还存储有电子设备500操作所需的各种程序和数据。处理装置501、ROM 502以及RAM 503通过总线504彼此相连。输入/输出(I/O)接口505也连接至总线504。
通常,以下装置可以连接至I/O接口505:包括例如触摸屏、触摸板、键盘、鼠标、摄像头、麦克风、加速度计、陀螺仪等的输入装置506;包括例如液晶显示器(LCD)、扬 声器、振动器等的输出装置507;包括例如磁带、硬盘等的存储装置508;以及通信装置509。通信装置509可以允许电子设备500与其他设备进行无线或有线通信以交换数据。虽然图5示出了具有各种装置的电子设备500,但是应理解的是,并不要求实施或具备所有示出的装置。可以替代地实施或具备更多或更少的装置。
特别地,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在非暂态计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信装置509从网络上被下载和安装,或者从存储装置508被安装,或者从ROM 502被安装。在该计算机程序被处理装置501执行时,执行本公开实施例的方法中限定的上述功能。
需要说明的是,本公开上述的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读信号介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:电线、光缆、RF(射频)等等,或者上述的任意合适的组合。
在一些实施方式中,可以利用诸如HTTP(HyperText Transfer Protocol,超文本传输协议)之类的任何当前已知或未来研发的网络协议进行通信,并且可以与任意形式或介质的数字数据通信(例如,通信网络)互连。通信网络的示例包括局域网(“LAN”),广域网(“WAN”),网际网(例如,互联网)以及端对端网络(例如,ad hoc端对端网络),以及任何当前已知或未来研发的网络。
上述计算机可读介质可以是上述电子设备中所包含的;也可以是单独存在,而未装配 入该电子设备中。
上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该电子设备执行时,使得该电子设备:获取待识别的目标音频;对所述目标音频进行特征提取,以得到语音特征序列;将所述语音特征序列输入语音识别模型,以得到所述目标音频对应的带标点目标文本,所述语音识别模型是通过标注有标点信息的带标点样本文本以及所述带标点样本文本对应的样本音频训练得到的。
可以以一种或多种程序设计语言或其组合来编写用于执行本公开的操作的计算机程序代码,上述程序设计语言包括但不限于面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言——诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)——连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。
附图中的流程图和框图,图示了按照本公开各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。
描述于本公开实施例中所涉及到的模块可以通过软件的方式实现,也可以通过硬件的方式来实现。其中,模块的名称在某种情况下并不构成对该模块本身的限定。
本文中以上描述的功能可以至少部分地由一个或多个硬件逻辑部件来执行。例如,非限制性地,可以使用的示范类型的硬件逻辑部件包括:现场可编程门阵列(FPGA)、专用集成电路(ASIC)、专用标准产品(ASSP)、片上系统(SOC)、复杂可编程逻辑设备(CPLD)等等。
在本公开的上下文中,机器可读介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的程序。机器可读 介质可以是机器可读信号介质或机器可读储存介质。机器可读介质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的任何合适组合。机器可读存储介质的更具体示例会包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM或快闪存储器)、光纤、便捷式紧凑盘只读存储器(CD-ROM)、光学储存设备、磁储存设备、或上述内容的任何合适组合。
根据本公开的一个或多个实施例,示例1提供了一种语音识别方法,包括:
获取待识别的目标音频;
对所述目标音频进行特征提取,以得到语音特征序列;
将所述语音特征序列输入语音识别模型,以得到所述目标音频对应的带标点目标文本,所述语音识别模型是通过标注有标点信息的带标点样本文本以及所述带标点样本文本对应的样本音频训练得到的。
根据本公开的一个或多个实施例,示例2提供了示例1的方法,所述语音识别模型用于通过如下方式对所述语音特征序列进行处理,以得到所述目标音频对应的带标点目标文本:
针对所述语音特征序列中每一时刻对应的语音特征,基于所述语音特征与上一时刻所确定的字符识别结果,确定所述语音特征对应的字符概率值,其中所述字符概率值包括标点符号对应的标点概率值;
若所述字符概率值中目标字符概率值大于预设阈值,则确定所述目标字符概率值对应的字符为所述语音特征的目标字符识别结果。
根据本公开的一个或多个实施例,示例3提供了示例1的方法,所述带标点样本文本中的标点位置具有位置偏移量,所述位置偏移量用于表征所述带标点样本文本中标点的实际位置与标注位置之间相差的字符数,所述语音识别模型用于通过如下方式确定所述目标音频对应的带标点目标文本:
将标点位置确定在通过语音特征序列识别到的初始标点位置之前,且所述标点位置与所述初始标点位置之间的间隔字符数为所述位置偏移量表征的字符数。
根据本公开的一个或多个实施例,示例4提供了示例1-3任一项的方法,所述语音识别模型的训练步骤包括:
将所述样本音频对应的样本语音特征序列输入所述语音识别模型,以确定所述样本语音特征序列对应的多个带标点预测文本,其中每一所述带标点预测文本对应所述样本音频中文字信息与时间信息的一种对应情况;
针对每一所述带标点预测文本,根据所述带标点预测文本和所述样本音频对应的、标注有标点信息的带标点样本文本计算损失函数,以得到目标损失函数;
根据所述目标损失函数调整所述语音识别模型的参数。
根据本公开的一个或多个实施例,示例5提供了示例4的方法,所述确定所述样本语音特征序列对应的多个带标点预测文本,包括:
针对所述样本音频中文字信息与时间信息的每一种对应情况,确定所述样本语音特征序列中每一样本语音特征对应的样本字符概率值,并根据所述样本语音特征序列对应的所述样本字符概率值,确定所述带标点预测文本;
所述语音识别模型的训练步骤还包括:
针对所述带标点预测文本中的句尾字符以及位于所述句尾字符之前的多个字符所对应的样本字符概率值添加概率惩罚值,以减小所述句尾字符以及位于所述句尾字符之前的多个字符所对应的样本字符概率值。
根据本公开的一个或多个实施例,示例6提供了示例5的方法,所述针对所述带标点预测文本中的句尾字符以及位于所述句尾字符之前的多个字符所对应的样本字符概率值添加概率惩罚值,包括:
针对所述带标点预测文本中的句尾字符以及位于所述句尾字符之前的多个字符所对应的样本字符概率值添加相同的概率惩罚值;或者
针对所述带标点预测文本中的句尾字符以及位于所述句尾字符之前的多个字符所对应的样本字符概率值添加不同的概率惩罚值,以使所述句尾字符以及位于所述句尾字符之前的多个字符所对应的样本字符概率值按照对应字符在所述带标点预测文本中的顺序依次减小。
根据本公开的一个或多个实施例,示例7提供了示例1-3任一项的方法,所述带标点样本文本与所述样本音频是通过如下方式得到的:
在获得样本音频以及所述样本音频对应的、未标注有标点信息的样本文本的情况下,通过预训练的离线标点模型对所述样本音频对应的、未标注有标点信息的样本文本添加标点信息,以得到所述带标点样本文本;或者
在获得带标点样本文本的情况下,通过预训练的语音合成模型合成带标点样本文本对应的样本音频。
根据本公开的一个或多个实施例,示例8提供了一种语音识别装置,所述装置包括:
获取模块,用于获取待识别的目标音频;
提取模块,用于对所述目标音频进行特征提取,以得到语音特征序列;
识别模块,用于将所述语音特征序列输入语音识别模型,以得到所述目标音频对应的带标点目标文本,所述语音识别模型是通过标注有标点信息的带标点样本文本以及所述带标点样本文本对应的样本音频训练得到的。
根据本公开的一个或多个实施例,示例9提供了示例8的装置,所述语音识别模型用于通过如下模块对所述语音特征序列进行处理,以得到所述目标音频对应的带标点目标文本:
第一确定模块,用于针对所述语音特征序列中每一时刻对应的语音特征,基于所述语音特征与上一时刻所确定的字符识别结果,确定所述语音特征对应的字符概率值,其中所述字符概率值包括标点符号对应的标点概率值;
第二确定模块,用于当所述字符概率值中目标字符概率值大于预设阈值时,确定所述目标字符概率值对应的字符为所述语音特征的目标字符识别结果。
根据本公开的一个或多个实施例,示例10提供了示例8的装置,所述带标点样本文本中的标点位置具有位置偏移量,所述位置偏移量用于表征所述带标点样本文本中标点的实际位置与标注位置之间相差的字符数,所述语音识别模型用于通过如下模块确定所述目标音频对应的带标点目标文本:
第三确定模块,用于将标点位置确定在通过语音特征序列识别到的初始标点位置之前,且所述标点位置与所述初始标点位置之间的间隔字符数为所述位置偏移量表征的字符数。
根据本公开的一个或多个实施例,示例11提供了示例8-10任一项的装置,所述装置还包括用于训练所述语音识别模型的如下模块:
输入模块,用于将所述样本音频对应的样本语音特征序列输入所述语音识别模型,以确定所述样本语音特征序列对应的多个带标点预测文本,其中每一所述带标点预测文本对应所述样本音频中文字信息与时间信息的一种对应情况;
计算模块,用于针对每一所述带标点预测文本,根据所述带标点预测文本和所述样本音频对应的、标注有标点信息的带标点样本文本计算损失函数,以得到目标损失函数;
调整模块,用于根据所述目标损失函数调整所述语音识别模型的参数。
根据本公开的一个或多个实施例,示例12提供了示例11的装置,所述输入模块用于:
针对所述样本音频中文字信息与时间信息的每一种对应情况,确定所述样本语音特征序列中每一样本语音特征对应的样本字符概率值,并根据所述样本语音特征序列对应的所述样本字符概率值,确定所述带标点预测文本;
所述装置还包括用于训练所述语音识别模型的如下模块:
第一添加模块,用于针对所述带标点预测文本中的句尾字符以及位于所述句尾字符之前的多个字符所对应的样本字符概率值添加概率惩罚值,以减小所述句尾字符以及位于所述句尾字符之前的多个字符所对应的样本字符概率值。
根据本公开的一个或多个实施例,示例13提供了示例12的装置,所述第一添加模块用于:
针对所述带标点预测文本中的句尾字符以及位于所述句尾字符之前的多个字符所对应的样本字符概率值添加相同的概率惩罚值;或者
针对所述带标点预测文本中的句尾字符以及位于所述句尾字符之前的多个字符所对应的样本字符概率值添加不同的概率惩罚值,以使所述句尾字符以及位于所述句尾字符之前的多个字符所对应的样本字符概率值按照对应字符在所述带标点预测文本中的顺序依次减小。
根据本公开的一个或多个实施例,示例14提供了示例8-10任一项的装置,所述装置还包括用于确定带标点样本文本与所述样本音频的如下模块:
第二添加模块,用于在获得样本音频以及所述样本音频对应的、未标注有标点信息的样本文本的情况下,通过预训练的离线标点模型对所述样本音频对应的、未标注有标点信息的样本文本添加标点信息,以得到所述带标点样本文本;或者
合成模块,用于在获得带标点样本文本的情况下,通过预训练的语音合成模型合成带标点样本文本对应的样本音频。
根据本公开的一个或多个实施例,示例15提供了一种计算机可读介质,其上存储有计算机程序,该程序被处理装置执行时实现示例1-7任一项所述方法的步骤。
根据本公开的一个或多个实施例,示例16提供了一种电子设备,包括:
存储装置,其上存储有计算机程序;
处理装置,用于执行所述存储装置中的所述计算机程序,以实现示例1-7任一项所述方法的步骤。
以上描述仅为本公开的较佳实施例以及对所运用技术原理的说明。本领域技术人员应当理解,本公开中所涉及的公开范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离上述公开构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。例如上述特征与本公开中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成的技术方案。
此外,虽然采用特定次序描绘了各操作,但是这不应当理解为要求这些操作以所示出的特定次序或以顺序次序执行来执行。在一定环境下,多任务和并行处理可能是有利的。 同样地,虽然在上面论述中包含了若干具体实现细节,但是这些不应当被解释为对本公开的范围的限制。在单独的实施例的上下文中描述的某些特征还可以组合地实现在单个实施例中。相反地,在单个实施例的上下文中描述的各种特征也可以单独地或以任何合适的子组合的方式实现在多个实施例中。
尽管已经采用特定于结构特征和/或方法逻辑动作的语言描述了本主题,但是应当理解所附权利要求书中所限定的主题未必局限于上面描述的特定特征或动作。相反,上面所描述的特定特征和动作仅仅是实现权利要求书的示例形式。关于上述实施例中的装置,其中各个模块执行操作的具体方式已经在有关该方法的实施例中进行了详细描述,此处将不做详细阐述说明。

Claims (17)

  1. 一种语音识别方法,包括:
    获取待识别的目标音频;
    对所述目标音频进行特征提取,以得到语音特征序列;
    将所述语音特征序列输入语音识别模型,以得到所述目标音频对应的带标点目标文本,所述语音识别模型是通过标注有标点信息的带标点样本文本以及所述带标点样本文本对应的样本音频训练得到的。
  2. 根据权利要求1所述的语音识别方法,其中,所述语音识别模型用于通过如下方式对所述语音特征序列进行处理,以得到所述目标音频对应的带标点目标文本:
    针对所述语音特征序列中每一时刻对应的语音特征,基于所述语音特征与上一时刻所确定的字符识别结果,确定所述语音特征对应的字符概率值,其中所述字符概率值包括标点符号对应的标点概率值;
    若所述字符概率值中目标字符概率值大于预设阈值,则确定所述目标字符概率值对应的字符为所述语音特征的目标字符识别结果。
  3. 根据权利要求1所述的语音识别方法,其中,所述带标点样本文本中的标点位置具有位置偏移量,所述位置偏移量用于表征所述带标点样本文本中标点的实际位置与标注位置之间相差的字符数,所述语音识别模型用于通过如下方式确定所述目标音频对应的带标点目标文本:
    将标点位置确定在通过语音特征序列识别到的初始标点位置之前,且所述标点位置与所述初始标点位置之间的间隔字符数为所述位置偏移量表征的字符数。
  4. 根据权利要求1-3任一项所述的语音识别方法,其中,所述语音识别模型的训练步骤包括:
    将所述样本音频对应的样本语音特征序列输入所述语音识别模型,以确定所述样本语音特征序列对应的多个带标点预测文本,其中每一所述带标点预测文本对应所述样本音频中文字信息与时间信息的一种对应情况;
    针对每一所述带标点预测文本,根据所述带标点预测文本和所述样本音频对应的、标注有标点信息的带标点样本文本计算损失函数,以得到目标损失函数;
    根据所述目标损失函数调整所述语音识别模型的参数。
  5. 根据权利要求4所述的语音识别方法,其中,所述确定所述样本语音特征序列对应的多个带标点预测文本,包括:
    针对所述样本音频中文字信息与时间信息的每一种对应情况,确定所述样本语音特征序列中每一样本语音特征对应的样本字符概率值,并根据所述样本语音特征序列对应的所述样本字符概率值,确定所述带标点预测文本;
    所述语音识别模型的训练步骤还包括:
    针对所述带标点预测文本中的句尾字符以及位于所述句尾字符之前的多个字符所对应的样本字符概率值添加概率惩罚值,以减小所述句尾字符以及位于所述句尾字符之前的多个字符所对应的样本字符概率值。
  6. 根据权利要求5所述的语音识别方法,其中,所述针对所述带标点预测文本中的句尾字符以及位于所述句尾字符之前的多个字符所对应的样本字符概率值添加概率惩罚值,包括:
    针对所述带标点预测文本中的句尾字符以及位于所述句尾字符之前的多个字符所对应的样本字符概率值添加相同的概率惩罚值;或者
    针对所述带标点预测文本中的句尾字符以及位于所述句尾字符之前的多个字符所对应的样本字符概率值添加不同的概率惩罚值,以使所述句尾字符以及位于所述句尾字符之前的多个字符所对应的样本字符概率值按照对应字符在所述带标点预测文本中的顺序依次减小。
  7. 根据权利要求1-3任一项所述的语音识别方法,其中,所述带标点样本文本与所述样本音频是通过如下方式得到的:
    在获得样本音频以及所述样本音频对应的、未标注有标点信息的样本文本的情况下,通过预训练的离线标点模型对所述样本音频对应的、未标注有标点信息的样本文本添加标点信息,以得到所述带标点样本文本;或者
    在获得带标点样本文本的情况下,通过预训练的语音合成模型合成带标点样本文本对应的样本音频。
  8. 一种语音识别装置,其中,所述装置包括:
    获取模块,用于获取待识别的目标音频;
    提取模块,用于对所述目标音频进行特征提取,以得到语音特征序列;
    识别模块,用于将所述语音特征序列输入语音识别模型,以得到所述目标音频对应的带标点目标文本,所述语音识别模型是通过标注有标点信息的带标点样本文本以及所述带标点样本文本对应的样本音频训练得到的。
  9. 一种语音识别模型的训练方法,包括:
    获取成对的样本音频和带标点样本文本;
    将所述样本音频对应的样本语音特征序列输入语音识别模型,以确定所述样本语音特征序列对应的多个带标点预测文本,其中每一所述带标点预测文本对应所述样本音频中文字信息与时间信息的一种对应情况;
    针对每一所述带标点预测文本,根据所述带标点预测文本和所述样本音频对应的、标注有标点信息的带标点样本文本计算损失函数,以得到目标损失函数;
    根据所述目标损失函数调整所述语音识别模型的参数。
  10. 根据权利要求9所述的训练方法,其中,确定所述样本语音特征序列对应的多个带标点预测文本包括:
    针对所述样本音频中文字信息与时间信息的每一种对应情况,确定所述样本语音特征序列中每一样本语音特征对应的样本字符概率值,并根据所述样本语音特征序列对应的所述样本字符概率值,确定所述带标点预测文本。
  11. 根据权利要求10所述的训练方法,还包括:
    针对所述带标点预测文本中的句尾字符以及位于所述句尾字符之前的多个字符所对应的样本字符概率值添加概率惩罚值,以减小所述句尾字符以及位于所述句尾字符之前的多个字符所对应的样本字符概率值。
  12. 根据权利要求11所述的训练方法,其中,所述针对所述带标点预测文本中的句尾字符以及位于所述句尾字符之前的多个字符所对应的样本字符概率值添加概率惩罚值,包括:
    针对所述带标点预测文本中的句尾字符以及位于所述句尾字符之前的多个字符所对应的样本字符概率值添加相同的概率惩罚值;或者
    针对所述带标点预测文本中的句尾字符以及位于所述句尾字符之前的多个字符所对 应的样本字符概率值添加不同的概率惩罚值,以使所述句尾字符以及位于所述句尾字符之前的多个字符所对应的样本字符概率值按照对应字符在所述带标点预测文本中的顺序依次减小。
  13. 根据权利要求9至12任一项所述的训练方法,其中,所述带标点样本文本中的标点位置具有位置偏移量,所述位置偏移量用于表征所述带标点样本文本中标点的实际位置与标注位置之间相差的字符数,确定所述样本语音特征序列对应的多个带标点预测文本包括:
    将标点位置确定在通过样本语音特征序列识别到的初始标点位置之前,且所述标点位置与所述初始标点位置之间的间隔字符数为所述位置偏移量表征的字符数。
  14. 根据权利要求9至13任一项所述的训练方法,其中,获取成对的样本音频和带标点样本文本包括:
    在获得样本音频以及所述样本音频对应的、未标注有标点信息的样本文本的情况下,通过预训练的离线标点模型对所述样本音频对应的、未标注有标点信息的样本文本添加标点信息,以得到所述带标点样本文本;或者
    在获得带标点样本文本的情况下,通过预训练的语音合成模型合成带标点样本文本对应的样本音频。
  15. 根据权利要求9-14任一项所述的训练方法,其中,所述语音识别模型包括编码器网络、预测网络和联合网络。
  16. 一种计算机可读介质,其上存储有计算机程序,其中,该程序被处理装置执行时实现权利要求1-15中任一项所述方法的步骤。
  17. 一种电子设备,其中,包括:
    存储装置,其上存储有计算机程序;
    处理装置,用于执行所述存储装置中的所述计算机程序,以实现权利要求1-15中任一项所述方法的步骤。
PCT/CN2021/136431 2021-01-04 2021-12-08 语音识别方法、装置、存储介质及电子设备 WO2022143058A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110004489.X 2021-01-04
CN202110004489.XA CN112634876B (zh) 2021-01-04 2021-01-04 语音识别方法、装置、存储介质及电子设备

Publications (1)

Publication Number Publication Date
WO2022143058A1 true WO2022143058A1 (zh) 2022-07-07

Family

ID=75291318

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/136431 WO2022143058A1 (zh) 2021-01-04 2021-12-08 语音识别方法、装置、存储介质及电子设备

Country Status (2)

Country Link
CN (1) CN112634876B (zh)
WO (1) WO2022143058A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117113941A (zh) * 2023-10-23 2023-11-24 新声科技(深圳)有限公司 标点符号恢复方法、装置、电子设备及存储介质

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114694636A (zh) * 2020-12-31 2022-07-01 华为技术有限公司 语音识别方法及装置
CN112634876B (zh) * 2021-01-04 2023-11-10 北京有竹居网络技术有限公司 语音识别方法、装置、存储介质及电子设备
CN113129935B (zh) * 2021-06-16 2021-08-31 北京新唐思创教育科技有限公司 音频打点数据获取方法、装置、存储介质及电子设备
CN113362811B (zh) * 2021-06-30 2023-03-24 北京有竹居网络技术有限公司 语音识别模型的训练方法、语音识别方法和装置
CN113436620B (zh) * 2021-06-30 2022-08-30 北京有竹居网络技术有限公司 语音识别模型的训练方法、语音识别方法、装置、介质及设备
CN114154459A (zh) * 2021-10-28 2022-03-08 北京搜狗科技发展有限公司 语音识别文本处理方法、装置、电子设备及存储介质
CN113936643B (zh) * 2021-12-16 2022-05-17 阿里巴巴达摩院(杭州)科技有限公司 语音识别方法、语音识别模型、电子设备和存储介质
CN114495993A (zh) * 2021-12-24 2022-05-13 北京梧桐车联科技有限责任公司 进度调节方法、装置、设备及计算机可读存储介质
CN117392985A (zh) * 2023-12-11 2024-01-12 飞狐信息技术(天津)有限公司 语音处理方法、装置、终端和存储介质

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160027433A1 (en) * 2014-07-24 2016-01-28 Intrnational Business Machines Corporation Method of selecting training text for language model, and method of training language model using the training text, and computer and computer program for executing the methods
CN108831481A (zh) * 2018-08-01 2018-11-16 平安科技(深圳)有限公司 语音识别中符号添加方法、装置、计算机设备及存储介质
CN109829163A (zh) * 2019-02-01 2019-05-31 浙江核新同花顺网络信息股份有限公司 一种语音识别结果处理方法及相关装置
CN110245334A (zh) * 2019-06-25 2019-09-17 北京百度网讯科技有限公司 用于输出信息的方法和装置
CN110827825A (zh) * 2019-11-11 2020-02-21 广州国音智能科技有限公司 语音识别文本的标点预测方法、系统、终端及存储介质
CN111640418A (zh) * 2020-05-29 2020-09-08 数据堂(北京)智能科技有限公司 一种韵律短语识别方法、装置及电子设备
CN112466277A (zh) * 2020-10-28 2021-03-09 北京百度网讯科技有限公司 韵律模型训练方法、装置、电子设备及存储介质
CN112634876A (zh) * 2021-01-04 2021-04-09 北京有竹居网络技术有限公司 语音识别方法、装置、存储介质及电子设备

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105609107A (zh) * 2015-12-23 2016-05-25 北京奇虎科技有限公司 一种基于语音识别的文本处理方法和装置
CN110310626A (zh) * 2019-05-23 2019-10-08 平安科技(深圳)有限公司 语音训练数据生成方法、装置、设备及可读存储介质

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160027433A1 (en) * 2014-07-24 2016-01-28 Intrnational Business Machines Corporation Method of selecting training text for language model, and method of training language model using the training text, and computer and computer program for executing the methods
CN108831481A (zh) * 2018-08-01 2018-11-16 平安科技(深圳)有限公司 语音识别中符号添加方法、装置、计算机设备及存储介质
CN109829163A (zh) * 2019-02-01 2019-05-31 浙江核新同花顺网络信息股份有限公司 一种语音识别结果处理方法及相关装置
CN110245334A (zh) * 2019-06-25 2019-09-17 北京百度网讯科技有限公司 用于输出信息的方法和装置
CN110827825A (zh) * 2019-11-11 2020-02-21 广州国音智能科技有限公司 语音识别文本的标点预测方法、系统、终端及存储介质
CN111640418A (zh) * 2020-05-29 2020-09-08 数据堂(北京)智能科技有限公司 一种韵律短语识别方法、装置及电子设备
CN112466277A (zh) * 2020-10-28 2021-03-09 北京百度网讯科技有限公司 韵律模型训练方法、装置、电子设备及存储介质
CN112634876A (zh) * 2021-01-04 2021-04-09 北京有竹居网络技术有限公司 语音识别方法、装置、存储介质及电子设备

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117113941A (zh) * 2023-10-23 2023-11-24 新声科技(深圳)有限公司 标点符号恢复方法、装置、电子设备及存储介质
CN117113941B (zh) * 2023-10-23 2024-02-06 新声科技(深圳)有限公司 标点符号恢复方法、装置、电子设备及存储介质

Also Published As

Publication number Publication date
CN112634876A (zh) 2021-04-09
CN112634876B (zh) 2023-11-10

Similar Documents

Publication Publication Date Title
WO2022143058A1 (zh) 语音识别方法、装置、存储介质及电子设备
CN111583900B (zh) 歌曲合成方法、装置、可读介质及电子设备
WO2022105545A1 (zh) 语音合成方法、装置、可读介质及电子设备
WO2022095743A1 (zh) 语音合成方法、装置、存储介质及电子设备
CN111899720B (zh) 用于生成音频的方法、装置、设备和介质
WO2022151931A1 (zh) 语音合成方法、合成模型训练方法、装置、介质及设备
CN111369971B (zh) 语音合成方法、装置、存储介质和电子设备
WO2022151930A1 (zh) 语音合成方法、合成模型训练方法、装置、介质及设备
WO2022105553A1 (zh) 语音合成方法、装置、可读介质及电子设备
CN111798821B (zh) 声音转换方法、装置、可读存储介质及电子设备
WO2022095754A1 (zh) 语音合成方法、装置、存储介质及电子设备
CN111046677B (zh) 一种翻译模型的获取方法、装置、设备和存储介质
CN111489735B (zh) 语音识别模型训练方法及装置
WO2022156413A1 (zh) 语音风格的迁移方法、装置、可读介质和电子设备
CN111597825B (zh) 语音翻译方法、装置、可读介质及电子设备
CN111339789B (zh) 一种翻译模型训练方法、装置、电子设备及存储介质
US20240029709A1 (en) Voice generation method and apparatus, device, and computer readable medium
CN111354343B (zh) 语音唤醒模型的生成方法、装置和电子设备
WO2022237665A1 (zh) 语音合成方法、装置、电子设备和存储介质
WO2022042418A1 (zh) 音乐合成方法、装置、设备和计算机可读介质
CN112906381B (zh) 对话归属的识别方法、装置、可读介质和电子设备
WO2023082931A1 (zh) 用于语音识别标点恢复的方法、设备和存储介质
CN111785247A (zh) 语音生成方法、装置、设备和计算机可读介质
CN113421550A (zh) 语音合成方法、装置、可读介质及电子设备
CN112364653A (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: 21913799

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: 21913799

Country of ref document: EP

Kind code of ref document: A1