A speech recognition method, device and electronic equipment
By performing forward and reverse word sequence processing on the preliminary recognition text of speech recognition, the problem of difficulty in using context information of speech text in the existing technology is solved, and more accurate speech recognition is achieved.
Patent Information
- Application Number
- CN202111659706.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-30
- Publication Date
- 2025-01-21
- Estimated Expiration
- 2041-12-30
AI Technical Summary
The existing speech recognition process is difficult to effectively utilize the context information of the speech text, resulting in inaccurate recognition results and biased output text.
The preliminary recognition text of the speech data to be recognized is processed twice: the first processing mode is to process according to the forward word sequence of the text, and the second processing mode is to process according to the reverse word sequence of the text, and the target text is determined by combining the two.
It effectively utilizes the contextual information of the text, improves the accuracy of speech recognition, and reduces the deviation of the output text.
Smart Images

Figure CN114283813B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of information processing technology, and in particular to a speech recognition method, device and electronic device. Background Art
[0002] Speech recognition is the process of decoding speech signals and converting them into corresponding text. Usually, the context of speech text contains a lot of effective information. However, the existing speech recognition process cannot make good use of the context information, resulting in inaccurate recognition results and biased output text. Summary of the invention
[0003] In view of this, this application provides the following technical solutions:
[0004] A speech recognition method, comprising:
[0005] Obtaining preliminary recognition text corresponding to the voice data to be recognized;
[0006] Processing the preliminary recognized text in a first processing mode to obtain a first text;
[0007] Processing the first text in a second processing mode to obtain a second text;
[0008] Determining a target text corresponding to the speech data to be recognized based on the first text and the second text;
[0009] Among them, the first processing mode is a mode of performing text recognition according to a forward word sequence of the text, and the second processing mode is a mode of performing text recognition according to a reverse word sequence of the text.
[0010] Optionally, the processing the first text in a second processing mode to obtain a second text includes:
[0011] determining each phrase of the first text;
[0012] determining a reverse order corresponding to the original forward order of each phrase;
[0013] Based on each phrase and the reverse order, determining a reverse text corresponding to the first text;
[0014] The reverse text is processed to obtain a second text.
[0015] Optionally, the processing the reverse text to obtain a second text includes:
[0016] Inputting the reverse text into a second processing model to obtain a probability value corresponding to each reverse candidate word sequence;
[0017] Determine a second text in the reverse candidate word sequence based on the probability value corresponding to each reverse candidate word sequence;
[0018] The second processing model is a model for determining word sequence probabilities based on a second corpus, and the second corpus includes a plurality of pieces of corpus information in reverse order.
[0019] Optionally, the processing the preliminary recognized text in a first processing mode to obtain a first text includes:
[0020] Performing word segmentation processing on the preliminary recognized text to obtain a first word sequence, wherein the first word sequence includes a plurality of word groups, and each word group constitutes the first word sequence in a forward order;
[0021] Inputting the first word sequence into a first processing model to obtain a probability value corresponding to each candidate word sequence;
[0022] Determining a first text in the candidate word sequence based on a probability value corresponding to each candidate word sequence;
[0023] The first processing model is a model for determining word sequence probabilities based on a first corpus, and the first corpus includes a plurality of pieces of corpus information in a forward order.
[0024] Optionally, determining the target text corresponding to the to-be-recognized speech data based on the first text and the second text includes:
[0025] Respectively obtaining weight information corresponding to the first processing mode and the second processing mode;
[0026] The first text and the second text are processed based on the weight information to obtain a target text corresponding to the speech data to be recognized.
[0027] Optionally, respectively acquiring weight information corresponding to the first processing mode and the second processing mode includes:
[0028] Determining a target scene that matches the speech data to be recognized;
[0029] Detecting whether the first processing mode and the second processing mode include corpus information corresponding to the target scenario, and obtaining a detection result;
[0030] Based on the detection result, weight information corresponding to the first processing mode and the second processing mode is determined respectively.
[0031] Optionally, the step of obtaining preliminary recognition text of the speech data to be recognized includes:
[0032] Determining phoneme information corresponding to the speech data to be recognized based on an acoustic model, wherein the acoustic model is a model for performing phoneme recognition based on acoustic features of the speech data;
[0033] Acquire a target scene that matches the speech data to be recognized;
[0034] determining a target dictionary corresponding to the target scene;
[0035] The phoneme information is processed based on the target dictionary to obtain a preliminary recognition text.
[0036] Optionally, determining the target text corresponding to the to-be-recognized speech data based on the first text and the second text includes:
[0037] Determine a third text based on the first text and the second text;
[0038] The third text is post-processed based on the target dictionary to obtain a target text.
[0039] A speech recognition device, comprising:
[0040] An acquisition unit, used for acquiring a preliminary recognition text corresponding to the speech data to be recognized;
[0041] A first processing unit, configured to process the preliminary recognized text in a first processing mode information to obtain a first text;
[0042] A second processing unit, configured to process the first text in a second processing mode to obtain a second text;
[0043] A determination unit, configured to determine a target text corresponding to the speech data to be recognized based on the first text and the second text;
[0044] Among them, the first processing mode is a mode of performing text recognition according to a forward word sequence of the text, and the second processing mode is a mode of performing text recognition according to a reverse word sequence of the text.
[0045] An electronic device, comprising:
[0046] Memory, used to store programs;
[0047] A processor is used to call and execute the program in the memory, and implement each step of the speech recognition method as described above by executing the program.
[0048] It can be seen from the above technical scheme that the speech recognition method, device and electronic device disclosed in the present application processes the preliminary recognition text corresponding to the speech data to be recognized in a first processing mode to obtain a first text; processes the first text in a second processing mode to obtain a second text; and determines the target text corresponding to the speech data to be recognized based on the first text and the second text. Since the first processing mode is a mode for performing text recognition according to the forward word sequence of the text, and the second processing mode is a mode for performing text recognition according to the reverse word sequence of the text, the effective use of text context information can be achieved, and the accuracy of speech recognition can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0050] Figure 1 A flowchart of a speech recognition method provided in Example 1 of the present application;
[0051] Figure 2 A schematic diagram of a speech recognition method for a target scene provided in Embodiment 2 of the present application;
[0052] Figure 3 A schematic diagram of the structure of a speech recognition device provided in Embodiment 3 of the present application;
[0053] Figure 4 A schematic diagram of the structure of an electronic device provided in Example 4 of the present application. DETAILED DESCRIPTION
[0054] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0055] The embodiment of the present application provides a speech recognition method, which can be applied to the field of converting speech data into text data. In the conversion process, the corresponding context information can be fully utilized to improve the accuracy of converting speech data into text.
[0056] See also Figure 1 , is a flow chart of a speech recognition method provided in Embodiment 1 of the present application, the method may include the following steps:
[0057] S101, obtaining preliminary recognition text corresponding to the voice data to be recognized.
[0058] The speech data to be recognized refers to speech data that needs to be converted into text, for example, it can be audio data generated by a target object in a speech recognition scenario, or it can be audio data transmitted by an electronic device.
[0059] First, the speech data to be recognized is preprocessed, and the phonemes, intonations and other information in the speech data are recognized to obtain the preliminary recognition text. Since the same pronunciation may have different Chinese characters, the preliminary recognition text needs to be further processed to obtain the accurate text that matches the speech data to be recognized.
[0060] S102: Process the preliminary recognized text in a first processing mode to obtain a first text.
[0061] S103: Process the first text in a second processing mode to obtain a second text.
[0062] S104: Determine a target text corresponding to the speech data to be recognized based on the first text and the second text.
[0063] When the embodiment of the present application processes the preliminary recognition text, two processing modes are used to implement it, wherein the first processing mode is a mode for performing text recognition according to the forward word sequence of the text, and the second processing mode is a mode for performing text recognition according to the reverse order sequence of the text. When performing text recognition according to the forward word sequence of the text, the text that appears first is used to predict the subsequent text, while the mode for performing text recognition according to the reverse word sequence of the text is a mode for predicting the preceding text using the text that appears later. For example, the preliminary recognition text is a sentence consisting of three phrases, and the forward order is [Phrase 1, Phrase 2, Phrase 3]. If the sentence "Phrase 1 Phrase 2 Phrase 3" is predicted according to the first processing mode, the probability of the existence of phrase 2 is predicted by phrase 1, and the probability of the existence of phrase 3 is predicted by phrase 1 Phrase 2. The preliminary recognition text can be processed by the first processing mode to obtain the first text. Among them, the first text is the text predicted by the first processing mode, for example, it can be "Phrase 1 Phrase 2 Phrase 3", or it can be "Phrase 1 Phrase 2 Phrase 3'", etc. The second text is the text obtained by processing the first processed text with the reverse word sequence of the text. Specifically, it is completed by predicting the probability of the occurrence of phrase 2 through phrase 3, and predicting the probability of the existence of phrase 1 through phrase 3 and phrase 2. In this way, the first processing mode uses the previous information of the text, that is, the process of predicting the subsequent text through the previous text, and the second processing mode uses the following information of the text, that is, predicting the previous text through the subsequent text. Therefore, the first processing mode and the second processing mode make full use of the context information of the text word sequence when processing the preliminary recognition text.
[0064] After obtaining the first text, the second processing mode is used to perform a verification process on the obtained first text. For example, based on the weight value corresponding to the first processing mode and the weight value corresponding to the second processing mode, the first text and the second text can be weighted and analyzed to obtain the target text. Alternatively, the text with the highest priority in the second text can be simply determined as the final target text.
[0065] Embodiment 1 of the present application provides a speech recognition method, which processes the preliminary recognition text corresponding to the speech data to be recognized in a first processing mode to obtain a first text; processes the first text in a second processing mode to obtain a second text; and determines the target text corresponding to the speech data to be recognized based on the first text and the second text. Since the first processing mode is a mode for performing text recognition according to the forward word sequence of the text, and the second processing mode is a mode for performing text recognition according to the reverse word sequence of the text, the effective use of text context information can be achieved, thereby improving the accuracy of speech recognition.
[0066] The first processing mode and the second processing mode in the embodiments of the present application are described below.
[0067] In an implementation of the second embodiment of the present application, when the preliminary recognition text is processed in the first processing mode to obtain the first text, it can be specifically implemented by the following steps:
[0068] S201, performing word segmentation processing on the preliminary recognition text to obtain a first word sequence.
[0069] S202: Input the first word sequence into the first processing model to obtain a probability value corresponding to each candidate word sequence.
[0070] S203: Determine a first text in the candidate word sequence based on a probability value corresponding to each candidate word sequence.
[0071] Word segmentation is the basis of natural language processing. The sentences in the preliminary recognition text can be segmented according to the preset phrase length to obtain the first word sequence. The first word sequence includes multiple phrases, and each phrase forms the first word sequence in a forward order. Correspondingly, the phrase length can be determined according to the actual application scenario, wherein the word segmentation can be performed according to a preset word segmentation algorithm, for example, at least one of a word segmentation method based on string matching, a word segmentation method based on understanding, or a word segmentation method based on statistics can be used. For example, the sentence included in the preliminary recognition text is "I am working". If the word segmentation is performed with a length of one word, the first word sequence that can be obtained includes the phrases "I", "in", "work", and "work". If the word segmentation is performed with a length of two words, the first word sequence that can be obtained includes the phrases "I am" and "work". The forward order refers to the original order of arrangement of each phrase. For example, taking "I am" and "work" as examples, the forward order is that "I am" is located in front of "work".
[0072] The first processing model is a model for determining the probability of a word sequence based on the first corpus. Correspondingly, the first corpus includes multiple pieces of corpus information in a forward order. Specifically, the first processing model can be a statistical language model, for example, an N-gram model, which performs a sliding window operation of size N on the content of the text according to bytes, forming a sequence of byte segments of length N. Each byte segment is called a gram, and the occurrence frequency of all grams is counted, and filtered according to a pre-set threshold to form a key gram list, that is, the vector feature space of the text, and each gram in the list is a feature vector dimension. The model is based on the assumption that the appearance of the Nth word is only related to the previous N-1 words, but not to any other words, and the probability of the whole sentence is the product of the probability of occurrence of each word. These probabilities can be obtained by directly counting the number of times N words appear at the same time from the corpus. For example, there is a sentence consisting of m words in the preliminary recognition text. Assuming that the probability P(ω1, ω2, ..., ωm) of a sentence consisting of word 1, word 2... to word m in this order is to be predicted, then:
[0073] P(ω1,ω2,…,ωm)=P(ω1)*P(ω2|ω1)*P(ω3|ω1,ω2)…
[0074] *P(ωm|ω1,…,ω(m-1))
[0075] When obtaining the word probability of each phrase, it is determined based on the corresponding corpus, that is, the probability information of the phrase appearing in the corpus. The first processing model corresponds to the first corpus, which includes a plurality of corpus information in a forward order, that is, corpus based on the order of phrases that normally constitute a sentence. For example, the corpus information included in the first corpus may be sentences such as "I am working", "I am at school", "I am studying", "He goes to study", etc.
[0076] After the preliminary recognition text is recognized by the first processing mode, several sentences with high probability can be obtained, and these sentences are used as the first text. Then, the first text is processed by the second processing mode to obtain the second text.
[0077] In one implementation of the embodiment of the present application, processing a first text in a second processing mode to obtain a second text may include: determining each phrase of the first text; determining a reverse order corresponding to an original forward order between each phrase; determining a reverse text corresponding to the first text based on each phrase and the reverse order; and processing the reverse text to obtain a second text.
[0078] Since the second processing mode is a mode of text recognition according to the reverse word sequence of the text, while the first processing mode is a mode of processing according to the forward word sequence of the text, therefore, the first text obtained by processing through the first processing mode is also a forward text. Then, each phrase of the first text needs to be rearranged in reverse order to obtain a reverse text, and then processed by the second processing model for processing the reverse text.
[0079] For example, the sentence included in the first text is "I study at school". After word segmentation processing on this sentence, the obtained phrases are "I at", "school", "study". The reverse text obtained through the reverse order is "study school I at". Then, use the second processing model to process this reverse text to identify the probability of the sentence "I study at school", and then determine the second text according to the probability threshold range.
[0080] Specifically, in an implementation manner of the second embodiment of the present application, the processing the reverse text to obtain the second text may include the following steps:
[0081] S301. Input the reverse text into the second processing model to obtain a probability value corresponding to each reverse candidate word sequence.
[0082] S302. Based on the probability value corresponding to each reverse candidate word sequence, determine the second text in the reverse candidate word sequence.
[0083] Among them, the second processing model is a model for determining word probabilities based on the second corpus. The second corpus includes multiple pieces of corpus information in reverse order. The corpus information in the second corpus is obtained by segmenting the normal corpus and then arranging each phrase in reverse order. For example, the normal corpus information is "I am working", "I am studying", "He is at work", "She goes to the park to see the flowers", etc. If one character is used as a group for word segmentation, the phrases obtained after word segmentation of "I am working" are "I", "am", "work", and the reverse word sequence formed is "work am I". If two characters are used as a group for grouping, the phrases obtained after word segmentation of "I am working" are "I am", "working", and the reverse word sequence formed is "working I am". Similarly, "at work he is", "see the flowers park she goes" these form the corpus information in the second corpus.
[0084] Correspondingly, the second processing model can be a reverse N-gram model. When the reverse text is input into the second processing model, the second processing model will predict a probability value corresponding to each reverse candidate word sequence. Assuming the probability of the sentence "I am working" appearing is predicted, the reverse text obtained after word segmentation and reversing the order of "I am working" is "work am I". Using the reverse N-gram model to predict the probability of this sentence appearing is:
[0085] P’ = P’(work)*P’(work before “work”)*P’(I work before “work” in the second corpus)
[0086] Among them, P’(work) refers to the probability of “work” appearing in the second corpus, *P’(work before “work”) refers to the probability of “work” appearing before “work” in the second corpus, so as to obtain various probability information. In this way, the information of the subsequent words in the normal order can be fully utilized to predict the probability of the entire sentence appearing, meeting the application of the context and improving the accuracy of prediction.
[0087] After obtaining the corresponding first text and second text based on the first processing mode and the second processing mode, the text with the highest probability in the first text and the text with the highest probability in the second text can be used as the target text. It can also be to calculate the target text according to the pre-determined weight information corresponding to the first processing mode and the second processing mode. That is, based on the weight information, the first text and the second text are processed to obtain the target text corresponding to the speech data to be recognized. It should be noted that although the second mode is a processing mode based on the reverse text order, the obtained second text is a text converted into the normal order based on the probability information of each text in the processing result.
[0088] The weight information corresponding to the first processing mode and the second processing mode can be pre-set weight information, or can be determined based on the application scenarios targeted by the first processing mode and the second processing mode. In a possible implementation manner, the steps of respectively obtaining the weight information corresponding to the first processing mode and the second processing mode include: determining the target scenario matching the speech data to be recognized; detecting whether the first processing mode and the second processing mode include corpus information corresponding to the target scenario to obtain a detection result; based on the detection result, respectively determining the weight information corresponding to the first processing mode and the second processing mode.
[0089] There may be different corresponding homophones in different application scenarios, and the corpus information corresponding to the target scenario can determine a more accurate text when recognizing the corresponding text. The weight value of the processing mode with the corpus information corresponding to the target scenario will be relatively high. For example, the text recognized by the first processing mode is “Now need to store knowledge” and “Now need to store cheese”. Given that the target scenario is a food introduction scenario, and the second corpus corresponding to the second processing mode includes various food introduction corpora, the score of “Now need to store cheese” in the second text obtained through the second processing mode is higher than that of “Now need to store knowledge”, and the weight value of the second processing mode is greater than that of the first processing mode. Therefore, the finally recognized target text is “Now need to store cheese”.
[0090] It should be noted that the weight information corresponding to the first processing mode and the second processing mode can also be determined according to the weight parameters generated by the processing models corresponding to them during the training process. Correspondingly, the corpus corresponding to the respective processing models can be supplemented according to the corpus information corresponding to the actual application scenario, and then the model can be retrained and adjusted so that the model can be suitable for the current application scenario to ensure the accuracy of the target text outputted in the end.
[0091] In order to improve the accuracy of speech recognition, when obtaining the preliminary recognition text, it is also necessary to process it according to the corresponding acoustic model and target dictionary to improve the accuracy of the preliminary recognition text. Correspondingly, the preliminary recognition text of the speech data to be recognized includes: determining the phoneme information corresponding to the speech data to be recognized based on the acoustic model; obtaining the target scene matching the speech data to be recognized; determining the target dictionary corresponding to the target scene; processing the phoneme information based on the target dictionary to obtain the preliminary recognition text.
[0092] The acoustic model is a model for phoneme recognition based on the acoustic features of speech data, which converts the feature vectors of all frames extracted with features into ordered factor outputs. The target dictionary corresponding to the target scene can map the phoneme information to the corresponding text, and the dictionary corresponding to the scene can meet the accuracy requirements of special scene recognition, such as the recognition of speech information in special scenes such as chemistry, law and pharmacy.
[0093] Furthermore, after obtaining the first text based on the first processing mode and the second text based on the second processing mode, the corresponding third text is first determined based on the first text and the second text. The third text may be the corresponding text that is recognized, but does not meet the output conditions. The third text needs to be post-processed to obtain the target text. Post-processing may include adding punctuation, text error correction, etc. In order to further improve accuracy, the third text may be post-processed through the target dictionary of the corresponding scene, such as text error correction, homophone replacement, etc., so that the obtained target text better matches the current scene.
[0094] See also Figure 2 , which is a schematic diagram of a speech recognition method for a target scenario provided in an embodiment of the present application.
[0095] exist Figure 2In the application scenario shown, the first processing mode is implemented by the forward N-gram language model, and the second processing mode is implemented by the reverse N-gram language model. The speech signal refers to the speech data to be recognized that needs to be converted into text. After signal processing, the starting point and the end point of the speech can be located, the silent part and the noisy part can be removed, and the truly effective content of a speech can be identified, and the speech features can be extracted from it and input into the pre-trained acoustic model.
[0096] The acoustic model processes and calculates the predicted pronunciation sequence based on the input speech features. Then, according to the pronunciation dictionary, the pre-trained forward N-gram language model and the acoustic model, the word sequence with the highest probability is decoded. In order to make full use of the context information of the speech text data, the reverse N-gram language model is used to re-score the decoded output word sequence, that is, calculate the probability of N sentence sequences. Then, after punctuation and text error correction, the output text information can be obtained, that is, the output target text.
[0097] In the embodiment of the present application, the context information of the speech text data is fully utilized through the forward processing model and the reverse processing model, thereby improving the accuracy and reliability of online speech recognition while ensuring the real-time performance of the system.
[0098] In the third embodiment of the present application, a speech recognition device is also provided. Figure 3 , the device may include:
[0099] An acquisition unit 401 is used to acquire a preliminary recognition text corresponding to the speech data to be recognized;
[0100] A first processing unit 402 is used to process the preliminary recognized text in a first processing mode information to obtain a first text;
[0101] A second processing unit 403 is used to process the first text in a second processing mode to obtain a second text;
[0102] A determination unit 404, configured to determine a target text corresponding to the speech data to be recognized based on the first text and the second text;
[0103] Among them, the first processing mode is a mode of performing text recognition according to a forward word sequence of the text, and the second processing mode is a mode of performing text recognition according to a reverse word sequence of the text.
[0104] A speech recognition device disclosed in the third embodiment of the present application comprises a first processing unit that processes the preliminary recognition text corresponding to the speech data to be recognized obtained by the acquisition unit in a first processing mode to obtain a first text; a second processing unit processes the first text in a second processing mode to obtain a second text; and a determination unit determines the target text corresponding to the speech data to be recognized based on the first text and the second text. Since the first processing mode is a mode for performing text recognition according to a forward word sequence of the text, and the second processing mode is a mode for performing text recognition according to a reverse word sequence of the text, effective use of text context information can be achieved, thereby improving the accuracy of speech recognition.
[0105] In one embodiment, the second processing unit includes:
[0106] A first determining subunit, configured to determine each phrase of the first text;
[0107] A second determining subunit is used to determine a reverse order corresponding to the original forward order between each phrase;
[0108] A third determining subunit, configured to determine a reverse text corresponding to the first text based on each phrase and the reverse order;
[0109] The first processing subunit is used to process the reverse text to obtain a second text.
[0110] Optionally, the first processing subunit is specifically configured to:
[0111] Inputting the reverse text into a second processing model to obtain a probability value corresponding to each reverse candidate word sequence;
[0112] Determine a second text in the reverse candidate word sequence based on the probability value corresponding to each reverse candidate word sequence;
[0113] The second processing model is a model for determining word sequence probabilities based on a second corpus, and the second corpus includes a plurality of pieces of corpus information in reverse order.
[0114] In another embodiment, the first processing unit includes:
[0115] A second processing subunit is used to perform word segmentation processing on the preliminary recognition text to obtain a first word sequence, wherein the first word sequence includes a plurality of word groups, and each word group constitutes the first word sequence in a forward order;
[0116] a third processing subunit, configured to input the first word sequence into a first processing model to obtain a probability value corresponding to each candidate word sequence;
[0117] a fourth determination subunit, configured to determine a first text in the candidate word sequence based on a probability value corresponding to each candidate word sequence;
[0118] The first processing model is a model for determining word sequence probabilities based on a first corpus, and the first corpus includes a plurality of pieces of corpus information in a forward order.
[0119] Optionally, the determining unit includes:
[0120] A first acquisition subunit, used to respectively acquire weight information corresponding to the first processing mode and the second processing mode;
[0121] The third processing subunit is used to process the first text and the second text based on the weight information to obtain a target text corresponding to the speech data to be recognized.
[0122] Further, the first acquisition subunit is specifically used for:
[0123] Determining a target scene that matches the speech data to be recognized;
[0124] Detecting whether the first processing mode and the second processing mode include corpus information corresponding to the target scenario, and obtaining a detection result;
[0125] Based on the detection result, weight information corresponding to the first processing mode and the second processing mode is determined respectively.
[0126] Optionally, the acquiring unit is specifically used for:
[0127] Determining phoneme information corresponding to the speech data to be recognized based on an acoustic model, wherein the acoustic model is a model for performing phoneme recognition based on acoustic features of the speech data;
[0128] Acquire a target scene that matches the speech data to be recognized;
[0129] determining a target dictionary corresponding to the target scene;
[0130] The phoneme information is processed based on the target dictionary to obtain a preliminary recognition text.
[0131] Correspondingly, the determining unit is specifically used for:
[0132] Determine a third text based on the first text and the second text;
[0133] The third text is post-processed based on the target dictionary to obtain a target text.
[0134] It should be noted that the specific implementation of the processor in this embodiment can refer to the corresponding content in the previous text and will not be described in detail here.
[0135] In another embodiment of the present application, a readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, each step of the speech recognition method as described in any one of the above items is implemented.
[0136] See also Figure 4 , is a structural diagram of an electronic device provided in another embodiment of the present application. The technical solution in this embodiment is mainly used to improve the accuracy of converting speech to text.
[0137] Specifically, the electronic device in this embodiment may include the following structure:
[0138] Memory 501, used for storing programs;
[0139] The processor 502 is configured to call and execute the program in the memory, and to implement the following by executing the program:
[0140] Obtaining preliminary recognition text corresponding to the voice data to be recognized;
[0141] Processing the preliminary recognized text in a first processing mode to obtain a first text;
[0142] Processing the first text in a second processing mode to obtain a second text;
[0143] Determining a target text corresponding to the speech data to be recognized based on the first text and the second text;
[0144] Among them, the first processing mode is a mode of performing text recognition according to a forward word sequence of the text, and the second processing mode is a mode of performing text recognition according to a reverse word sequence of the text.
[0145] It should be noted that the specific implementation of the processor in this embodiment can refer to the corresponding content in the previous text and will not be described in detail here.
[0146] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0147] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0148] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0149] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A speech recognition method, comprising: Obtaining preliminary recognition text corresponding to the voice data to be recognized; Processing the preliminary recognized text in a first processing mode to obtain a first text; Processing the first text in a second processing mode to obtain a second text; Determining a target text corresponding to the speech data to be recognized based on the first text and the second text; Among them, the first processing mode is a mode of performing text recognition according to a forward word sequence of the text, and the second processing mode is a mode of performing text recognition according to a reverse word sequence of the text.
2. According to the method of claim 1, the processing the first text in a second processing mode to obtain a second text comprises: determining each phrase of the first text; Determine a reverse order corresponding to the original forward order between each phrase; Based on each phrase and the reverse order, determining a reverse text corresponding to the first text; The reverse text is processed to obtain a second text.
3. The method according to claim 2, wherein the processing of the reverse text to obtain the second text comprises: Inputting the reverse text into a second processing model to obtain a probability value corresponding to each reverse candidate word sequence; Determine a second text in the reverse candidate word sequence based on the probability value corresponding to each reverse candidate word sequence; The second processing model is a model for determining word sequence probabilities based on a second corpus, and the second corpus includes a plurality of pieces of corpus information in reverse order.
4. The method according to claim 1, wherein the processing of the preliminary recognized text in a first processing mode to obtain a first text comprises: Performing word segmentation processing on the preliminary recognized text to obtain a first word sequence, wherein the first word sequence includes a plurality of word groups, and each word group constitutes the first word sequence in a forward order; Inputting the first word sequence into a first processing model to obtain a probability value corresponding to each candidate word sequence; Determining a first text in the candidate word sequence based on a probability value corresponding to each candidate word sequence; The first processing model is a model for determining word sequence probabilities based on a first corpus, and the first corpus includes a plurality of pieces of corpus information in a forward order.
5. The method according to claim 1, wherein determining the target text corresponding to the speech data to be recognized based on the first text and the second text comprises: Respectively obtaining weight information corresponding to the first processing mode and the second processing mode; The first text and the second text are processed based on the weight information to obtain a target text corresponding to the speech data to be recognized.
6. The method according to claim 5, wherein the step of respectively obtaining weight information corresponding to the first processing mode and the second processing mode comprises: Determining a target scene that matches the speech data to be recognized; Detecting whether the first processing mode and the second processing mode include corpus information corresponding to the target scenario, and obtaining a detection result; Based on the detection result, weight information corresponding to the first processing mode and the second processing mode is determined respectively.
7. The method according to claim 1, wherein obtaining the preliminary recognized text of the speech data to be recognized comprises: Determining phoneme information corresponding to the speech data to be recognized based on an acoustic model, wherein the acoustic model is a model for performing phoneme recognition based on acoustic features of the speech data; Acquire a target scene that matches the speech data to be recognized; determining a target dictionary corresponding to the target scene; The phoneme information is processed based on the target dictionary to obtain a preliminary recognition text.
8. The method according to claim 7, wherein determining the target text corresponding to the speech data to be recognized based on the first text and the second text comprises: Determine a third text based on the first text and the second text; The third text is post-processed based on the target dictionary to obtain a target text.
9. A speech recognition device, comprising: An acquisition unit, used for acquiring a preliminary recognition text corresponding to the speech data to be recognized; A first processing unit, configured to process the preliminary recognized text in a first processing mode information to obtain a first text; A second processing unit, configured to process the first text in a second processing mode to obtain a second text; A determination unit, configured to determine a target text corresponding to the speech data to be recognized based on the first text and the second text; Among them, the first processing mode is a mode of performing text recognition according to a forward word sequence of the text, and the second processing mode is a mode of performing text recognition according to a reverse word sequence of the text.
10. An electronic device, comprising: Memory, used to store programs; A processor is used to call and execute the program in the memory, and implement the various steps of the speech recognition method as described in any one of claims 1 to 8 by executing the program.
Citation Information
Patent Citations
Text processing method and device based on voice identification
CN105609107A
Accurate correction of errors in text data based on learning via a neural network
US20200074180A1