Speech recognition text punctuation prediction model training method and prediction method

By dividing the audio into sub-audio and integrating word embeddings and pause duration vectors, the accuracy problem of speech recognition text punctuation prediction in scenarios with high noise and recognition error rates in the existing technology is solved, and the accuracy and stability of punctuation prediction are improved. .

CN115394298BActive Publication Date: 2024-09-06AISPEECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211034353.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-26
Publication Date
2024-09-06
Estimated Expiration
2042-08-26

AI Technical Summary

Technical Problem

Existing speech recognition text punctuation prediction methods are difficult to accurately predict punctuation in scenarios with large noise and high word recognition error rates, resulting in semantic confusion and word segmentation errors, which affect the final punctuation prediction effect.

Method used

By dividing the training audio or target audio into sub-audio, combining speech recognition and manual annotation, and fusing word embedding vectors and pause duration vectors as inputs to the model, the accuracy of punctuation prediction is improved.

Benefits of technology

It significantly improves the accuracy of speech recognition text punctuation prediction, enhances the capture of the speaker's pause characteristics, improves the accuracy and stability of punctuation prediction, and reduces additional overhead and delay.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115394298B
    Figure CN115394298B
Patent Text Reader

Abstract

The present invention discloses a speech recognition text punctuation prediction model training method, a speech recognition text punctuation prediction method, an electronic device and a storage medium. The punctuation prediction model training method includes: dividing the audio into a plurality of sub-audios according to the speech continuity of the audio; performing speech recognition on each sub-audio, and manually marking punctuation on the recognized text containing a plurality of words after recognition; determining the pause duration of each word in each sub-audio; fusing the word embedding vector of each word and the pause duration vector corresponding to the pause duration as the representation vector of each word; and training the punctuation prediction model using the representation vector of each word and the recognition text after the manual punctuation marking. The present invention can effectively avoid word segmentation errors by first segmenting the audio, and the obtained prediction model can be more accurate when the probability of punctuation insertion corresponding to each word is inferred by combining the pronunciation characteristics of the speaker when performing punctuation prediction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of speech recognition technology, and in particular to a speech recognition text punctuation prediction model training method, a speech recognition text punctuation prediction method, an electronic device and a storage medium. Background Art

[0002] At present, most of the intelligent voice devices on the market need to use the voice recognition text punctuation prediction function, such as smart speakers, conference recording to text equipment, intelligent dialogue robots, video subtitle generation software and other voice recognition related products or software. In the existing technology, these products or software mainly perform voice recognition on the target audio to obtain recognized text, and only use the recognized text as the input of the punctuation prediction model, classify each word in the recognized text, classify it into a specific punctuation type, and finally insert the corresponding punctuation marks into the recognized text according to the classification results.

[0003] In the prior art, the speech recognition text punctuation prediction method that uses the recognized text of the target audio as input needs to first segment the text obtained by speech recognition according to the context semantics before the input prediction model is input for prediction. When the usage scenario is complex, the noise is large, the speaker makes mistakes or pronunciation is not standard, etc., there will be many errors in the recognized text obtained by speech recognition, which can easily cause the semantics of the recognized text to be confused and unclear, resulting in word segmentation errors, which greatly reduces the punctuation prediction effect.

[0004] The current common solution to the above defects is to collect audio data in scenarios with high noise and high word error rate, and manually add punctuation to these data sets with unclear semantics or high word errors. Based on this collected data, add it to the training set of the neural network for model training to improve the model's punctuation prediction performance in scenarios with high word error rate.

[0005] However, the above solution is still imperfect. In fact, the real recognition environment is often manifested as the recognition text is generated in real time during people's oral communication, which inevitably has strong personal habits or colloquial characteristics, such as pauses in speech, long and short pauses, and alternating speech between multiple speakers. If you only care about the accuracy of the recognized text and use it as input, the feature information of pauses or alternating speech will be lost, resulting in poor punctuation prediction results.

[0006] For example, when the recognized text obtained by the voice recognition of the user's input is "The down payment for this house is about 150,000 yuan", the output result of the voice recognition text punctuation prediction method in the prior art may be "The down payment for this house is about 10%, 520,000 yuan", but the actual meaning expressed by the speaker may be "The down payment for this house is about 15%, 120,000 yuan". This is a word segmentation error caused by semantic confusion in the recognized text, which divides the original meanings of "15%" and "120,000 yuan" into "10%" and "520,000 yuan", thereby affecting the final voice recognition text punctuation prediction result. Summary of the invention

[0007] The embodiments of the present invention provide a speech recognition text punctuation prediction model training method, a speech recognition text punctuation prediction method, an electronic device and a storage medium to solve at least one technical problem in the above-mentioned prior art, effectively alleviate the inaccurate prediction of the speech recognition text punctuation prediction method in the prior art, and improve the accuracy of speech recognition text punctuation prediction.

[0008] In a first aspect, an embodiment of the present invention provides a method for training a speech recognition text punctuation prediction model, comprising:

[0009] Dividing the training audio into a plurality of sub-audios according to the speech continuity of the training audio;

[0010] Performing speech recognition on each sub-audio, and manually marking punctuation on the recognized text containing multiple words;

[0011] Determine the pause duration of each word in each sub-audio;

[0012] The word embedding vector of each word and the pause duration vector corresponding to the pause duration are merged to serve as the representation vector of each word;

[0013] The punctuation prediction model is trained using the representation vector of each word and the recognized text after the manual punctuation marking.

[0014] In a second aspect, an embodiment of the present invention provides a method for predicting punctuation in speech recognition text, comprising:

[0015] Dividing the target audio into a plurality of sub-audios according to the speech continuity of the target audio;

[0016] Performing speech recognition on each sub-audio to obtain a recognition text containing multiple words;

[0017] Determine the pause duration of each word in each sub-audio;

[0018] The word embedding vector of each word and the pause duration vector corresponding to the pause duration are merged to serve as the representation vector of each word;

[0019] According to the time sequence of the multiple sub-audios, the representation vectors of the words in the sub-audios are spliced ​​and input into the speech recognition text punctuation prediction model to infer the punctuation of the words in the recognized text.

[0020] In a third aspect, an embodiment of the present invention provides an electronic device, comprising: at least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the above-mentioned training method of the speech recognition text punctuation prediction model or the steps of the speech recognition text punctuation prediction method.

[0021] In a fourth aspect, an embodiment of the present invention provides a storage medium on which a computer program is stored, which, when executed by a processor, implements the above-mentioned training method of the speech recognition text punctuation prediction model or the steps of the speech recognition text punctuation prediction method.

[0022] The beneficial effect of the embodiment of the present invention is that the pause characteristics of the speaker's oral expression are combined with the recognized text, so that the prediction effect of the model is significantly improved compared with the pure text model. At the same time, the method does not introduce obvious additional overhead, and the memory overhead and delay of the entire module are not significantly different from the existing technology. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0024] Figure 1 A flowchart of a method for training a speech recognition text punctuation prediction model according to an embodiment of the present invention;

[0025] Figure 2 A flowchart of a method for training a speech recognition text punctuation prediction model that uses a speech endpoint detection model to divide training audio according to an embodiment of the present invention;

[0026] Figure 3 This is a flowchart of step S13 of a method for training a speech recognition text punctuation prediction model that uses a speech endpoint detection model to divide training audio according to an embodiment of the present invention;

[0027] Figure 4This is the method flow of step S14 in the method for training a speech recognition text punctuation prediction model in one embodiment of the present invention;

[0028] Figure 5 A flowchart of a method for training a speech recognition text punctuation prediction model using an alignment model to divide training audio according to an embodiment of the present invention;

[0029] Figure 6 A flowchart of a method for predicting punctuation in text with speech recognition according to an embodiment of the present invention;

[0030] Figure 7 It is an overall flow chart of the speech recognition text punctuation prediction model training method and prediction method of the present invention;

[0031] Figure 8 A functional block diagram of a speech recognition text punctuation prediction model training device according to an embodiment of the present invention;

[0032] Fig. 9 This is a functional block diagram of a device for predicting punctuation marks in texts by speech recognition according to an embodiment of the present invention;

[0033] Fig.10 It is a schematic structural diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0034] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0035] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application may be combined with each other.

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

[0037] In the present invention, "module", "device", "system" and the like refer to related entities applied to computers, such as hardware, a combination of hardware and software, software or software in execution, etc. In detail, for example, an element can be, but is not limited to, a process, a processor, an object, an executable element, an execution thread, a program and / or a computer running on a processor. In addition, an application or script program running on a server, a server can all be an element. One or more elements can be in an execution process and / or thread, and an element can be localized on a computer and / or distributed between two or more computers, and can be operated by various computer-readable media. An element can also communicate through local and / or remote processes according to a signal with one or more data packets, for example, a signal from a data that interacts with another element in a local system, a distributed system, and / or a network on the Internet through a signal to interact with other systems.

[0038] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include" and "comprise" include not only those elements, but also other elements that are not explicitly listed, or also include elements inherent to such processes, methods, articles or equipment. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the existence of other identical elements in the process, method, article or equipment that includes the elements.

[0039] Figure 1 The process of the training method of the speech recognition text punctuation prediction model according to an embodiment of the present invention is schematically shown, which can be applied to a server, a computer and other devices to train the punctuation prediction model, and can also be applied to a client device such as a smart phone and a personal computer to train the punctuation prediction model. Figure 1 As shown, the method comprises the following steps:

[0040] Step S11: dividing the training audio into a plurality of sub-audios according to the speech continuity of the training audio;

[0041] Step S12: performing speech recognition on each sub-audio, and manually marking punctuation on the recognized text containing multiple words;

[0042] Step S13: Determine the pause duration of each word in each sub-audio;

[0043] Step S14: fusing the word embedding vector of each word and the pause duration vector corresponding to the pause duration to serve as the representation vector of each word;

[0044] Step S15: training a punctuation prediction model using the representation vector of each word and the recognized text with manually annotated punctuations.

[0045] In step S11, the training audio needs to be divided first, wherein the division is based on the speech continuity of the training audio, so that the connected parts can be divided into the same sub-audio according to the speech continuity in the audio, which can effectively alleviate the situation of wrong segmentation caused by segmenting words only according to the speech of the recognized text in the prior art. The training audio can be an audio specifically used for training punctuation prediction models, which may contain various situations that are prone to errors. The training audio will not be described in detail here. When dividing the training audio, a speech endpoint detection model or an alignment model can be used to implement it. Corresponding to the two different methods, the subsequent processing steps also have certain differences. Here, the speech endpoint detection model is used as an example to explain in detail. The speech endpoint detection model, also known as Voice Activity Detection (VAD), can identify the start and end positions of the speech in the entire audio. Figure 2 The flowchart of the training method of the speech recognition text punctuation prediction model using the speech endpoint detection model to divide the training audio according to one embodiment of the present invention is schematically shown. Figure 2 As shown, step S11 can be implemented as follows:

[0046] Step S111A: using the speech endpoint detection model, dividing the training audio into multiple sub-audios in chronological order according to the non-speech segments as separators, each sub-audio being a speech segment;

[0047] Step S112A: Record the start time and end time of each sub-audio in the training audio.

[0048] In step S111A, the training audio is processed by the speech endpoint detection model to obtain speech segments and non-speech segments (such as silent segments) in the training audio, wherein the speech segments are segments with speech recognized by the speech endpoint detection model in the training audio, and the non-speech segments are the remaining segments in the training audio that are not recognized by the speech endpoint detection model as having speech. At this time, the obtained non-speech segments can be used as separators to divide the installation time information of the training audio into multiple sub-audios. It can be understood that each sub-audio obtained by dividing the training audio using the speech endpoint detection model is a speech segment recognized by the speech endpoint detection model. Then, the start time and end time of each sub-audio obtained by the division in the training audio are recorded in step S112A, and step S11 of the training method of the speech recognition text punctuation prediction model that divides the training audio using the speech endpoint detection model can be completed.

[0049] Step S12 is to perform speech recognition on each sub-audio divided in step S11, and manually mark punctuation on the corresponding recognized text to form the target output of the training punctuation prediction model. In step S12, after the speech recognition of each sub-audio, since each sub-audio is a speech part audio segment in the training audio, the speech recognition in S12 obtains the recognized text of the training audio containing multiple words, and then manually marks punctuation on the recognized text to obtain the target output result used as the training of the punctuation prediction model, so that the punctuation prediction model obtains a high-accuracy inference result after training.

[0050] Step S13 is a step of determining the pause duration corresponding to each word in the recognized text obtained after speech recognition, wherein the pause duration can be the pause duration before the word or the pause duration after the word. If the pause duration before the word is determined, the punctuation prediction model predicts whether punctuation is to be inserted in front of the word and what punctuation is to be inserted. At this time, the end of the last sub-audio needs to be supplemented with a method or model to calculate what punctuation should be used at the end of the last sub-audio; if the pause duration after the word is determined, the punctuation prediction model predicts whether punctuation is to be inserted in the back of the word and what punctuation is to be inserted. At this time, for the end of the last sub-audio, the punctuation prediction model obtained by the present invention can be continued to be used for punctuation prediction, without adding other methods or models to calculate, so in the embodiment of the present invention, the pause duration determined by step S13 is preferably the pause duration after the word. In step S13, when determining the pause duration corresponding to each word, it can be determined according to the start time and end time of each sub-audio obtained in step S11 in the training audio.

[0051] Specifically, in the training method of the speech recognition text punctuation prediction model that uses the speech endpoint detection model to divide the training audio, since in step S11, each sub-audio obtained after the division is a speech segment, the start time and end time of each recorded sub-audio in the training audio are also the start time and end time of the corresponding speech segment. Figure 3 The implementation method flow of step S13 in the training method of the speech recognition text punctuation prediction model using the speech endpoint detection model to divide the training audio according to one embodiment of the present invention is schematically shown. Figure 3 As shown, in the training method of the speech recognition text punctuation prediction model using the speech endpoint detection model to divide the training audio, step S13 can be implemented as including the following steps:

[0052] Step S131: taking the time difference between the end time of the i-th sub-audio and the start time of the (i+1)-th sub-audio as the pause duration of the last word in the i-th sub-audio;

[0053] Step S132: setting the pause duration of the last word in the last sub-audio in the training audio to infinity;

[0054] Step S133: setting the pause duration of each word except the last word in each sub-audio to 0.

[0055] In step S131, it can be understood that in this embodiment, the recognition text corresponding to the sub-audio contains multiple words, and the start time and end time of the recorded voice segment correspond to the start time of the first word and the end time of the last word in a certain sub-audio i. Therefore, the time difference between the end time of the i-th sub-audio and the start time of the i+1-th sub-audio can be determined as the pause duration of the last word in the i-th sub-audio.

[0056] In step S132, the last word in the last sub-audio is followed by the end position of the training audio, and punctuation must be added to the end position of the recognized text. On the one hand, in order to distinguish the pause duration of the last word from the previous sub-audio, and on the other hand, in order to highlight the particularity of the last sub-audio, the present invention sets the pause duration of the last word in the last sub-audio to infinity, thereby reducing the introduction of excessive punctuation judgment and weight design into the punctuation prediction model, and ensuring the accuracy of punctuation prediction.

[0057] In step S133, it can be understood that when the speech endpoint detection model is used, on the one hand, what is actually recorded is only the start time and end time of each sub-audio in the training audio, so for the words other than the last word in the sub-audio, there is no corresponding start time and end time to calculate the pause duration of these other words. On the other hand, the inventor actually uses the speech endpoint detection model for the purpose of reducing the duration of judging each word. Since each sub-audio is obtained by dividing using the speech endpoint detection model, in each sub-audio, each word is actually read together during the speaking process, and the pause during the period is very small. Therefore, in step S133, the pause duration of the other words other than the last word in each sub-audio can be set to 0. In other words, even if there is a slight pause between the other words except the last word in the real sub-audio, it can actually be regarded as continuous and uninterrupted, thereby reducing the complexity of the judgment steps and weight design of punctuation.

[0058] Step S14 is a step of determining the representation vector of each word according to the pause duration corresponding to each word obtained in step S13. In step S14, the representation vector corresponding to each word is finally obtained, wherein the representation vector is obtained by fusing the word embedding vector corresponding to each word and the corresponding pause duration vector. Figure 4 The method flow of step S14 in the training method of the speech recognition text punctuation prediction model in one embodiment of the present invention is schematically shown, referring to Figure 4 As shown, step S14 can be implemented as including the following steps:

[0059] Step S141: searching for word embedding vectors corresponding to each word according to a preset word embedding matrix;

[0060] Step S142: determining a discrete feature value reflecting the pause duration of each word according to a preset pause duration mapping function, and searching for a pause duration vector corresponding to the discrete feature value in a pause duration embedding matrix;

[0061] Step S143: concatenate the word embedding vector of each word with the pause duration vector to obtain a representation vector of each word.

[0062] In step S141, the preset word embedding matrix is ​​a matrix having each word and a word embedding vector corresponding to each word, so that the word embedding vector corresponding to each word can be found in the preset word embedding matrix according to each word. The word embedding vector is a vector corresponding to a word one by one, and according to the word embedding vector, it can be calculated whether punctuation is to be set after the word and what punctuation is to be set.

[0063] In step S142, the preset pause duration mapping function is a function that determines the discrete eigenvalues ​​reflecting the pause duration of each word according to the pause duration of each word, and the corresponding discrete eigenvalues ​​can be corresponded according to the pause duration interval into which the specific value of the pause duration falls. The preset pause duration embedding matrix is ​​a pause duration embedding vector having each discrete eigenvalue and each discrete eigenvalue. Thus, the pause duration vector corresponding to each word can be finally determined according to the pause duration corresponding to each word. For the preset pause duration mapping function, in the process of the training method of the speech recognition text punctuation prediction model that uses the speech endpoint detection model to divide the training audio, since the sub-audios divided according to the speech endpoint detection model are separated by non-speech segments, the pause duration of the words in the sub-audio except the last word is set to 0, and for the non-speech segments that are the pauses of the user's speech, the pause duration is generally not too short, so the number of pause duration intervals divided in the preset pause duration mapping function can be reduced, so as to be conducive to improving the robustness and stability of the trained punctuation prediction model, and reducing the impact of the result error of the speech endpoint detection model during recognition on the prediction effect of the punctuation prediction model. Therefore, in the process of the training method of the speech recognition text punctuation prediction model that uses the speech endpoint detection model to divide the training audio, the preset pause duration mapping function can be set to the following expression, so as to effectively improve the robustness and make the prediction result more stable.

[0064]

[0065] Here, x is the pause duration in milliseconds.

[0066] In step S143, it is only necessary to concatenate the word embedding vector corresponding to each word obtained in step S141 and the pause duration vector corresponding to each word obtained in step S142 to obtain a representation vector corresponding to each word.

[0067] In step S15, since the representation vector corresponding to each word has been obtained according to step S14, it is only necessary to splice the representation vector of each word in each sub-audio according to the time sequence of multiple sub-audios to form an input for the punctuation prediction model, and use the manually annotated recognition text obtained in step S12 as the target output of the punctuation prediction model to train the punctuation prediction model.

[0068] In other implementations, the training audio can be divided and implemented by using an alignment model, which can align the audio with the corresponding annotated text to obtain the pronunciation timestamp of each word in the entire audio, including the start time and the end time. Figure 5The flowchart of the training method of the speech recognition text punctuation prediction model using the alignment model to divide the training audio according to one embodiment of the present invention is schematically shown. Figure 5 As shown, step S11 can be implemented as follows:

[0069] Step S111B: using the alignment model, dividing the training audio into multiple sub-audios in chronological order, each sub-audio being a word;

[0070] Step S112B: Record the start time and end time of each sub-audio in the training audio.

[0071] In step S111B, the training audio is processed by the alignment model to obtain the pronunciation timestamp of each word in the training audio in the entire audio, so that the training audio can be directly divided into multiple sub-audios according to the pronunciation timestamp of each word in the entire audio. It can be understood that each sub-audio obtained by dividing the training audio using the alignment model is a word. After that, the start time and end time of each sub-audio in the training audio can be recorded in step S112B according to the pronunciation timestamp of each word in the training audio obtained by processing the training audio using the alignment model, and step S11 of the training method of the speech recognition text punctuation prediction model that divides the training audio using the alignment model is completed.

[0072] For step S12, its specific implementation method is the same as step S12 in the training method of the speech recognition text punctuation prediction model that uses a speech endpoint detection model to divide the training audio. Both steps involve performing speech recognition on each sub-audio and manually marking punctuation on the obtained recognized text to obtain the target output result for training the punctuation prediction model, which will not be explained again here.

[0073] Regarding step S13, it is different from step S13 in the training method of the speech recognition text punctuation prediction model that uses the speech endpoint detection model to divide the training audio, because in the training method of the speech recognition text punctuation prediction model that uses the alignment model to divide the training audio, in step S11, each sub-audio obtained by division is a word, and thus the pause duration corresponding to each word can be directly obtained according to the start time and end time corresponding to each word in the training audio, and step S13 can be completed. It should be noted that, similar to step S132, in the training method of the speech recognition text punctuation prediction model that uses the alignment model to divide the training audio, the pause duration of the last word (that is, the last sub-audio) can also be set to infinity, thereby effectively reducing the excessive punctuation judgment and weight design introduced by the punctuation prediction model, and ensuring the accuracy of punctuation prediction.

[0074] For step S14, its specific implementation method is similar to step S14 in the training method of the speech recognition text punctuation prediction model that uses the speech endpoint detection model to divide the training audio. The difference is that in the training method of the speech recognition text punctuation prediction model that uses the alignment model to divide the training audio, the pause duration corresponding to each word is obtained by processing according to the alignment model, and the pause duration varies and is not set to 0. Therefore, the number of pause duration intervals divided in the preset pause duration mapping function will be greater. Specifically, in the process of the training method of the speech recognition text punctuation prediction model that uses the alignment model to divide the training audio, the preset pause duration mapping function can be set to the following expression:

[0075]

[0076] Here, x is the pause duration in milliseconds.

[0077] The training method of the speech recognition text punctuation prediction model of the present invention first segments the training audio based on the speech continuity of the audio to obtain continuous sub-audio, and then performs speech recognition processing on each sub-audio, so as to effectively reduce the problem of punctuation prediction errors caused by word segmentation based only on the semantics of the recognized text in the prior art, and provides method flows corresponding to two different audio segmentation methods using an alignment model and a speech endpoint detection model. When determining the representation vector corresponding to each word, the overall method adds the pause characteristics of the speaker's oral expression as an influencing factor, combined with the pause duration corresponding to the word, so that the trained prediction model can be more accurate when inferring the probability of punctuation insertion corresponding to each word, and to a certain extent improves the punctuation prediction effect of some texts that are difficult to understand semantically.

[0078] Among them, compared with the background technology, the method process of dividing audio using an alignment model not only adds the pause duration, an expression feature of the speaker, to increase the accuracy of punctuation prediction, but also because its timestamp granularity is very fine, it can obtain the timestamp of each word, and can detect the pronunciation duration and pause duration of each word, and the punctuation prediction module is very sensitive.

[0079] When determining the pause duration of each sub-audio, the method flow of using the speech endpoint detection model to divide the audio sets the pause duration of the last word of the last sub-audio to infinity to ensure that punctuation marks can be added after the last word of the last sub-audio, and sets the pause duration corresponding to other words other than the last word in the sub-audio to 0. Compared with the alignment model, although it seems to sacrifice sensitivity and accuracy, the final experimental results show that the method flow of using the speech endpoint detection model to divide the audio, combined with the preset duration mapping function with a small number of pause duration intervals, while maintaining accuracy, avoids the potential impact of slight changes in pause duration causing the corresponding discrete feature values ​​to be different, which may cause a certain degree of disturbance to the results of the punctuation prediction model, and can more effectively improve the robustness and stability of the expression prediction model obtained by training. Finally, according to the obtained representation vectors of each word and the punctuation prediction model trained by the manually annotated recognition text corresponding to the training audio, a more accurate and stable punctuation prediction model is obtained.

[0080] Figure 6 The flow of the method for predicting punctuation marks in speech recognition text according to an embodiment of the present invention is schematically shown, which can be applied to devices such as servers and computers to predict punctuation marks in speech recognition text, and is particularly applied to speech recognition-related products or software client devices such as smart phones and personal computers to predict punctuation marks in speech recognition text. Figure 6 As shown, the method comprises the following steps:

[0081] Step S21: dividing the target audio into a plurality of sub-audios according to the speech continuity of the target audio;

[0082] Step S22: performing speech recognition on each sub-audio to obtain a recognition text containing multiple words;

[0083] Step S23: determining the pause duration of each word in each sub-audio;

[0084] Step S24: fusing the word embedding vector of each word and the pause duration vector corresponding to the pause duration as the representation vector of each word;

[0085] Step S25: according to the time sequence of the multiple sub-audios, the representation vectors of the words in the sub-audios are concatenated and input into the speech recognition text punctuation prediction model to infer the punctuation of the words in the recognized text.

[0086] In step S21, similar to step S11, the target audio also needs to be divided first, wherein the target audio refers to the audio input by the user when using the product or software for speech recognition text punctuation prediction. Specifically, when dividing the target audio, it can be implemented by a speech endpoint detection model or an alignment model, wherein the specific method of using a speech endpoint detection model to implement the division of the target audio and the method of using an alignment model to implement the division of the target audio can refer to the description of the corresponding part in the training method of the speech recognition text punctuation prediction model, which will not be repeated here. By dividing the target audio based on the speech continuity of the target audio, the connected parts can be divided into the same sub-audio according to the speech continuity in the audio, so as to effectively alleviate the situation of incorrect segmentation caused by segmenting words only based on the speech of the recognized text in the prior art.

[0087] Step S22 is similar to step S12. It is necessary to perform speech recognition on each sub-audio first to obtain a recognized text containing multiple words corresponding to the target audio. The difference from step S12 is that since this method is a speech recognition text punctuation prediction method, rather than a prediction model training method, there is no need to manually mark punctuation on the speech recognition text.

[0088] Step S23 and step S24 are similar to the corresponding steps S13 and S14. Therefore, the method of determining the pause duration of each word in each sub-audio in step S23 and the part of determining the representation vector of each word in step S24 can refer to the detailed description of the relevant parts of steps S13 and S14, and will not be repeated here.

[0089] Step S25 is to infer the punctuation of each word in the recognition text corresponding to the target audio according to the representation vector of each word and the punctuation prediction model obtained in step S24, and to splice the representation vector of each word in each sub-audio according to the time sequence of multiple sub-audios as the input of the punctuation prediction model, so as to input the punctuation prediction model to obtain the speech recognition text after the punctuation prediction corresponding to the target audio, thereby completing the punctuation prediction of the speech recognition text.

[0090] The speech recognition text punctuation prediction method of the present invention first divides the training audio based on the speech continuity of the audio to obtain continuous sub-audio, and then performs speech recognition processing on each sub-audio, so as to effectively reduce the problem of punctuation prediction errors caused by word segmentation based only on the semantics of the recognized text in the prior art, and adds pause duration as an influencing factor when determining the representation vector corresponding to each word, so as to combine the pronunciation characteristics of the speaker, so that when the punctuation insertion probability corresponding to each word is inferred according to the prediction model, it can be more accurate, and the punctuation prediction effect of some texts with difficult semantic understanding is improved to a certain extent. At the same time, when setting a preset duration mapping function, the divided pause duration interval is reduced to effectively improve the robustness and stability of speech recognition punctuation prediction, and the method of the present invention will not introduce obvious additional overhead, and the memory overhead and delay of the entire module will not be significantly different from the prior art.

[0091] In summary, the speech recognition text punctuation prediction model training method and the speech recognition text punctuation prediction method of the present invention can be integrated to form the following Figure 7 As shown in the flowchart in Figure 7 After receiving the target audio or training audio, the VAD model (i.e., voice endpoint detection model) can be used to segment the audio to obtain multiple sub-audios; then, speech recognition is performed on each audio to obtain a speech recognition text. If model training is to be performed, the speech recognition text is manually annotated to obtain the output part for training the punctuation prediction model; then the pause duration corresponding to each word in the speech recognition text is calculated; then, according to the pause duration of each word, the pause duration vector corresponding to each word is determined and the word embedding vector corresponding to each word is determined, and the two are combined to obtain each word pair. The corresponding representation vector is then concatenated for each word in order to obtain the part used as the input of the punctuation prediction model; finally, according to the purpose, if the punctuation prediction model needs to be trained, the manually annotated speech recognition text is used as the output part of the punctuation prediction model, and the concatenated representation vector is used as the input to train the punctuation prediction model; if punctuation prediction of the speech recognition text is needed, the concatenated representation vector only needs to be input into the punctuation prediction model as input to obtain the speech recognition text after punctuation prediction corresponding to the target audio, thus completing the punctuation prediction of the speech recognition text.

[0092] Figure 8 The present invention schematically shows a speech recognition text punctuation prediction model training device according to an embodiment of the present invention. Figure 8 As shown, the device comprises:

[0093] An audio division module 1, used for dividing the training audio into a plurality of sub-audios according to the speech continuity of the training audio;

[0094] A speech recognition module 2 is used to perform speech recognition on each sub-audio to obtain a recognition text containing multiple words;

[0095] A manual punctuation marking module 3 is used to manually mark punctuation on the recognized text recognized by the speech recognition module 2;

[0096] A pause duration determination module 4 is used to determine the pause duration of each word in each sub-audio;

[0097] A representation vector acquisition module 5, used to fuse the word embedding vector of each word and the pause duration vector corresponding to the pause duration as the representation vector of each word;

[0098] The model training module 6 is used to train a punctuation prediction model using the representation vector of each word obtained by the representation vector acquisition module 5 and the manually annotated recognition text obtained by the manual punctuation marking module 3 .

[0099] In some implementations, the audio division module 1 may be specifically used for:

[0100] Use the speech endpoint detection model to divide the training audio into multiple sub-audios in chronological order, using non-speech segments as separators. Each sub-audio is a speech segment.

[0101] Record the start and end time of each sub-audio in the training audio.

[0102] In some other implementations, the audio division module 1 may be specifically used for:

[0103] Use the alignment model to divide the training audio into multiple sub-audios in chronological order, where each sub-audio is a word.

[0104] Record the start and end time of each sub-audio in the training audio.

[0105] In some implementations, the pause duration determination module 4 may be specifically used to:

[0106] The time difference between the end time of the i-th sub-audio and the start time of the (i+1)-th sub-audio is used as the pause duration of the last word in the i-th sub-audio;

[0107] Setting the pause duration of the last word in the last sub-audio in the training audio to infinity;

[0108] The pause duration of each word except the last word in each sub-audio is set to 0.

[0109] In some implementations, the representation vector acquisition module 5 may be specifically used to:

[0110] Find the word embedding vector corresponding to each word according to a preset word embedding matrix;

[0111] According to the preset pause duration mapping function, a discrete feature value reflecting the pause duration of each word is determined, and a pause duration vector corresponding to the discrete feature value is searched in the pause duration embedding matrix, wherein the expression of the preset pause duration function is:

[0112]

[0113] Where x is the pause duration in milliseconds;

[0114] The word embedding vector of each word is concatenated with the pause duration vector to obtain the representation vector of each word.

[0115] It should be noted that the implementation process and implementation principle of the speech recognition text punctuation prediction model training device of the embodiment of the present invention can be specifically referred to in the corresponding description of the above method embodiment, so they are not repeated here. Exemplarily, the speech recognition text punctuation prediction model training device of the embodiment of the present invention can be any intelligent device, including but not limited to a server, a computer, a smart phone, a personal computer, a robot, etc., to train the punctuation prediction model.

[0116] Fig. 9 The present invention schematically shows a speech recognition text punctuation prediction device according to an embodiment of the present invention. Fig. 9 As shown, the device comprises:

[0117] An audio division module 1, used for dividing the training audio into a plurality of sub-audios according to the speech continuity of the training audio;

[0118] A speech recognition module 2 is used to perform speech recognition on each sub-audio to obtain a recognition text containing multiple words;

[0119] A pause duration determination module 4 is used to determine the pause duration of each word in each sub-audio;

[0120] A representation vector acquisition module 5, used to fuse the word embedding vector of each word and the pause duration vector corresponding to the pause duration as the representation vector of each word;

[0121] The punctuation prediction module 7 is used to concatenate the representation vectors of each word in each sub-audio obtained by the representation vector acquisition module 5 according to the time sequence of multiple sub-audios, input them into the punctuation prediction model, and infer the punctuation of each word in the recognized text.

[0122] In some implementations, the audio division module 1 may be specifically used for:

[0123] Use the speech endpoint detection model to divide the training audio into multiple sub-audios in chronological order, using non-speech segments as separators. Each sub-audio is a speech segment.

[0124] Record the start and end time of each sub-audio in the training audio.

[0125] In some other implementations, the audio division module 1 may be specifically used for:

[0126] Use the alignment model to divide the training audio into multiple sub-audios in chronological order, where each sub-audio is a word.

[0127] Record the start and end time of each sub-audio in the training audio.

[0128] In some implementations, the pause duration determination module 4 may be specifically used to:

[0129] The time difference between the end time of the i-th sub-audio and the start time of the (i+1)-th sub-audio is used as the pause duration of the last word in the i-th sub-audio;

[0130] Setting the pause duration of the last word in the last sub-audio in the training audio to infinity;

[0131] The pause duration of each word except the last word in each sub-audio is set to 0.

[0132] In some implementations, the representation vector acquisition module 5 may be specifically used to:

[0133] Find the word embedding vector corresponding to each word according to a preset word embedding matrix;

[0134] According to the preset pause duration mapping function, a discrete feature value reflecting the pause duration of each word is determined, and a pause duration vector corresponding to the discrete feature value is searched in the pause duration embedding matrix, wherein the expression of the preset pause duration function is:

[0135]

[0136] Where x is the pause duration in milliseconds;

[0137] The word embedding vector of each word is concatenated with the pause duration vector to obtain the representation vector of each word.

[0138] It should be noted that the implementation process and implementation principle of the speech recognition text punctuation prediction device of the embodiment of the present invention can be specifically referred to in the corresponding description of the above method embodiment, so they are not repeated here. Exemplarily, the speech recognition text punctuation prediction device of the embodiment of the present invention can be any intelligent device, including but not limited to servers, computers, etc., and in particular, it can be a smart phone, personal computer, robot and other speech recognition related products or software client devices to predict punctuation of speech recognition text.

[0139] In some embodiments, an embodiment of the present invention provides a non-volatile computer-readable storage medium, which stores one or more programs including execution instructions, and the execution instructions can be read and executed by an electronic device (including but not limited to a computer, a server, or a network device, etc.) to execute the speech recognition text punctuation prediction model training method or the speech recognition text punctuation prediction method of any of the above embodiments of the present invention.

[0140] In some embodiments, an embodiment of the present invention further provides a computer program product, which includes a computer program stored on a non-volatile computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer executes the speech recognition text punctuation prediction model training method or the speech recognition text punctuation prediction method of any one of the above embodiments.

[0141] In some embodiments, an embodiment of the present invention also provides an electronic device, comprising: at least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the speech recognition text punctuation prediction model training method or the speech recognition text punctuation prediction method of any of the above embodiments.

[0142] In some embodiments, an embodiment of the present invention further provides a storage medium having a computer program stored thereon, characterized in that when the program is executed by a processor, the speech recognition text punctuation prediction model training method or the speech recognition text punctuation prediction method of any of the above-mentioned embodiments is implemented.

[0143] Fig.10 is a hardware structure diagram of an electronic device for executing a speech recognition text punctuation prediction model training method or a speech recognition text punctuation prediction method provided by another embodiment of the present application, such as Fig.10 As shown, the device includes:

[0144] One or more processors 910 and memory 920, Fig.10 A processor 910 is taken as an example.

[0145] The device for executing the speech recognition text punctuation prediction model training method or the speech recognition text punctuation prediction method may further include: an input device 930 and an output device 940 .

[0146] The processor 910, the memory 920, the input device 930 and the output device 940 may be connected via a bus or other means. Fig.10 The example of connecting through bus is taken in the following.

[0147] The memory 920, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as the program instructions / modules corresponding to the speech recognition text punctuation prediction model training method or the speech recognition text punctuation prediction method in the embodiments of the present application. The processor 910 executes various functional applications and data processing of the server by running the non-volatile software programs, instructions and modules stored in the memory 920, that is, the speech recognition text punctuation prediction model training method or the speech recognition text punctuation prediction method in the above method embodiments.

[0148] The memory 920 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required by at least one function; the data storage area may store data created according to a speech recognition text punctuation prediction model training method or a speech recognition text punctuation prediction method, etc. In addition, the memory 920 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 920 may optionally include a memory remotely arranged relative to the processor 910, and these remote memories may be connected to the electronic device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0149] The input device 930 may receive input digital or character information and generate signals related to user settings and function control of the image processing device. The output device 940 may include a display device such as a display screen.

[0150] The one or more modules are stored in the memory 920, and when executed by the one or more processors 910, perform the speech recognition text punctuation prediction model training method or speech recognition text punctuation prediction method in any of the above method embodiments.

[0151] The above-mentioned product can execute the method provided in the embodiment of the present application, and has the functional modules and beneficial effects corresponding to the execution method. For technical details not fully described in this embodiment, please refer to the method provided in the embodiment of the present application.

[0152] The electronic devices of the embodiments of the present application exist in various forms, including but not limited to:

[0153] (1) Mobile communication devices: These devices are characterized by their mobile communication functions and their main purpose is to provide voice and data communications. These terminals include: smart phones (such as iPhone), multimedia phones, functional phones, and low-end phones.

[0154] (2) Ultra-mobile personal computer devices: These devices fall into the category of personal computers, have computing and processing capabilities, and generally also have mobile Internet access features. These terminals include: PDA, MID and UMPC devices, such as iPad.

[0155] (3) Portable entertainment devices: These devices can display and play multimedia content. They include audio and video players (such as iPods), handheld game consoles, e-books, as well as smart toys and portable car navigation devices.

[0156] (4) Server: A device that provides computing services. The server consists of a processor, hard disk, memory, system bus, etc. The server is similar to a general computer architecture, but because it needs to provide highly reliable services, it has higher requirements in terms of processing power, stability, reliability, security, scalability, and manageability.

[0157] (5) Other electronic devices with data interaction functions.

[0158] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0159] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0160] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for training a speech recognition text punctuation prediction model, characterized in that: include: Dividing the training audio into a plurality of sub-audios according to the speech continuity of the training audio; Performing speech recognition on each sub-audio, and manually marking punctuation on the recognized text containing multiple words; Determine the pause duration of each word in each sub-audio; The word embedding vector of each word and the pause duration vector corresponding to the pause duration are merged to serve as the representation vector of each word; Using the representation vector of each word and the recognized text after the manual punctuation marking to train a punctuation prediction model; The step of fusing the word embedding vector of each word and the pause duration vector corresponding to the pause duration as the representation vector of each word includes: Find the word embedding vector corresponding to each word according to a preset word embedding matrix; Determine a discrete characteristic value reflecting the pause duration of each word according to a preset pause duration mapping function, and search for a pause duration vector corresponding to the discrete characteristic value in a pause duration embedding matrix; The word embedding vector of each word is concatenated with the pause duration vector to obtain the representation vector of each word.

2. The method according to claim 1, characterized in that Dividing the training audio into multiple sub-audios according to the speech continuity of the training audio includes: Use the speech endpoint detection model to divide the training audio into multiple sub-audios in chronological order, using non-speech segments as separators. Each sub-audio is a speech segment. Record the start and end time of each sub-audio in the training audio.

3. The method according to claim 2, characterized in that Determining the pause duration of each word in each sub-audio includes: The time difference between the end time of the i-th sub-audio and the start time of the (i+1)-th sub-audio is used as the pause duration of the last word in the i-th sub-audio; The pause duration of the last word in the last sub-audio in the training audio is set to infinity.

4. The method according to claim 3, characterized in that Determining the pause duration of each word in each sub-audio also includes: The pause duration of each word except the last word in each sub-audio is set to 0.

5. The method according to claim 1, characterized in that Dividing the training audio into multiple sub-audios according to the speech continuity of the training audio includes: Use the alignment model to divide the training audio into multiple sub-audios in chronological order, where each sub-audio is a word. Record the start and end time of each sub-audio in the training audio.

6. The method according to claim 1, characterized in that The expression of the preset pause duration mapping function is: Here, x is the pause duration in milliseconds.

7. The method according to claim 1, characterized in that The method of training the punctuation prediction model by using the representation vector of each word and the recognized text after the manual punctuation marking includes: According to the time sequence of multiple sub-audios, the representation vectors of each word in each sub-audio are spliced ​​as the input of the punctuation prediction model, and the recognized text with manually marked punctuation is used as the target output to train the punctuation prediction model.

8. A method for predicting punctuation in speech recognition text, characterized in that: include: Dividing the target audio into a plurality of sub-audios according to the speech continuity of the target audio; Performing speech recognition on each sub-audio to obtain a recognition text containing multiple words; Determine the pause duration of each word in each sub-audio; The word embedding vector of each word and the pause duration vector corresponding to the pause duration are merged to serve as the representation vector of each word; According to the time sequence of the multiple sub-audios, the representation vectors of the words in the sub-audios are concatenated and input into a punctuation prediction model to infer the punctuation of the words in the recognized text; The step of fusing the word embedding vector of each word and the pause duration vector corresponding to the pause duration as the representation vector of each word includes: Find the word embedding vector corresponding to each word according to a preset word embedding matrix; Determine a discrete characteristic value reflecting the pause duration of each word according to a preset pause duration mapping function, and search for a pause duration vector corresponding to the discrete characteristic value in a pause duration embedding matrix; The word embedding vector of each word is concatenated with the pause duration vector to obtain the representation vector of each word.

9. The method according to claim 8, characterized in that Dividing the target audio into multiple sub-audios according to the speech continuity of the target audio includes: Use the speech endpoint detection model to divide the target audio into multiple sub-audios in chronological order according to the non-speech segments, and each sub-audio is a speech segment. Record the start time and end time of each sub-audio in the target audio.

10. The method according to claim 9, characterized in that Determining the pause duration of each word in each sub-audio includes: The time difference between the end time of the i-th sub-audio and the start time of the (i+1)-th sub-audio is used as the pause duration of the last word in the i-th sub-audio; The pause duration of the last word in the last sub-audio in the target audio is set to infinity.

11. The method according to claim 10, characterized in that Determining the pause duration of each word in each sub-audio also includes: The pause duration of each word except the last word in each sub-audio is set to 0.

12. The method according to claim 8, characterized in that Dividing the target audio into multiple sub-audios according to the speech continuity of the target audio includes: Use the alignment model to divide the target audio into multiple sub-audios in chronological order, each sub-audio being a word; Record the start time and end time of each sub-audio in the target audio.

13. The method according to claim 8, characterized in that The expression of the preset pause duration mapping function is: Here, x is the pause duration in milliseconds.

14. An electronic device, characterized in that: include: At least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the steps of the method described in any one of claims 1 to 13.

15. A storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method described in any one of claims 1 to 13 are implemented.