Speech recognition method and device, electronic equipment, storage medium and product
By encoding the historical speech recognition results and integrating them with the encoding information of the speech to be recognized, the problem of low accuracy of long speech recognition in the existing technology is solved and the accuracy of speech recognition is improved.
Patent Information
- Application Number
- CN202410507643.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-25
- Publication Date
- 2024-09-27
AI Technical Summary
In a long speech recognition scenario, the existing technology uses the recognition results of historical speech as decoding reference information, which affects the accuracy of speech recognition and makes it difficult to achieve ideal recognition results.
By encoding the recognition results of historical speech, the encoding information is obtained, and the encoding information is fused with the encoding information of the speech to be recognized, and the above information is combined for encoding processing, thereby improving the accuracy of the speech encoding information of the speech to be recognized.
The accuracy of speech recognition is improved, especially in long speech recognition scenarios, by combining historical speech information during the encoding process.
Smart Images

Figure CN118711591A
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of natural language processing, and in particular to a speech recognition method, device, electronic device, storage medium and product. Background Art
[0002] In a long speech recognition scenario, combining context information can improve the accuracy of recognizing the current speech segment. Therefore, in the prior art, the recognition result of the historical speech of the current speech segment is usually used to assist the recognition of the current speech segment.
[0003] The existing conventional scheme usually uses the recognition results of historical speech as reference information for decoding when decoding the speech code after completing the encoding of the current speech segment. However, this method has little effect on improving the effect of long speech recognition and it is still difficult to achieve the ideal long speech recognition accuracy. Summary of the invention
[0004] Based on the above needs, the present application proposes a speech recognition method, device, electronic device, storage medium and product, which can improve the accuracy of speech recognition, especially the accuracy of long speech recognition.
[0005] To achieve the above objectives, this application proposes the following technical solutions:
[0006] According to a first aspect of an embodiment of the present application, there is provided a speech recognition method, comprising:
[0007] Performing encoding processing on the recognition result of the historical speech to obtain encoding information of the recognition result of the historical speech, and performing encoding processing on the speech to be recognized to obtain encoding information of the speech to be recognized;
[0008] Merging the encoding information of the recognition result of the historical speech with the encoding information of the speech to be recognized to obtain the speech encoding information of the speech to be recognized;
[0009] The speech coding information is decoded to obtain a recognition result of the speech to be recognized.
[0010] Optionally, the decoding the speech coding information to obtain a recognition result of the speech to be recognized includes:
[0011] Based on the recognition result of the historical speech, the speech coding information is decoded to obtain the recognition result of the speech to be recognized.
[0012] Optionally, encoding the historical speech recognition result to obtain encoding information of the historical speech recognition result includes:
[0013] Performing phoneme conversion on the recognized text in the recognition result of the historical speech to obtain a phoneme sequence corresponding to the recognized text, and performing phoneme granularity encoding processing on the phoneme sequence to obtain a phoneme-level granularity encoding of the recognized text;
[0014] and / or, performing character-level granularity encoding processing on the recognized text in the recognition result of the historical speech to obtain the character-level granularity encoding of the recognized text;
[0015] The coding information of the recognition result of the historical speech is merged with the coding information of the speech to be recognized to obtain the speech coding information of the speech to be recognized, including:
[0016] The word-level granularity coding and / or the phoneme-level granularity coding are merged with the coding information of the speech to be recognized to obtain the speech coding information of the speech to be recognized.
[0017] Optionally, in the case where the encoding information of the recognition result of the historical speech includes the word-level granularity encoding of the recognized text, the recognized text includes: a first recognized text and a second recognized text; the word-level granularity encoding of the recognized text includes: a first word-level granularity encoding corresponding to the first recognized text and a second word-level granularity encoding corresponding to the second recognized text; wherein the second recognized text is the text after the first recognized text;
[0018] The word-level granularity coding is merged with the coding information of the speech to be recognized to obtain the speech coding information of the speech to be recognized, including:
[0019] Performing fusion coding processing on the first character granularity code and the coding information of the speech to be recognized to obtain a first fusion code of the speech to be recognized;
[0020] Performing fusion coding processing on the second character granularity code and the first fusion code to obtain a second fusion code of the speech to be recognized;
[0021] The fused code obtained by the last fusion coding process is used as the speech coding information of the speech to be recognized.
[0022] Optionally, fusing the phoneme-level granularity coding with the coding information of the speech to be recognized to obtain the speech coding information of the speech to be recognized includes:
[0023] Performing a spatial alignment operation on the phoneme-level granularity code and the coding information of the speech to be recognized to obtain aligned phoneme-level granularity code and coding information of the speech to be recognized;
[0024] The aligned phoneme-level granularity coding and the coding information of the speech to be recognized are fused to obtain the speech coding information of the speech to be recognized.
[0025] Optionally, performing a spatial alignment operation on the phoneme-level granularity code and the coding information of the speech to be recognized to obtain the aligned phoneme-level granularity code and the coding information of the speech to be recognized includes:
[0026] Based on the distance between the phoneme-level granularity code and the coding information of the speech to be recognized, the phoneme-level granularity code and the coding information of the speech to be recognized are aligned in spatial representation to obtain aligned phoneme-level granularity code and coding information of the speech to be recognized.
[0027] Optionally, the word-level granularity coding and the phoneme-level granularity coding are merged with the coding information of the speech to be recognized to obtain the speech coding information of the speech to be recognized, including:
[0028] Fusion of the phoneme-level granularity code with the coding information of the speech to be recognized to obtain an intermediate fusion code of the speech to be recognized;
[0029] The word-level granularity code is fused with the intermediate fusion code to obtain speech coding information of the speech to be recognized.
[0030] Optionally, based on the recognition result of the historical speech, decoding the speech coding information to obtain the recognition result of the speech to be recognized includes:
[0031] Inputting the recognition result of the historical speech and the speech coding information into a pre-trained speech recognition model to obtain the recognition result of the speech to be recognized; the recognition result of the historical speech includes: the recognition text of the historical speech, the speech coding of the historical speech and the speaker of the historical speech;
[0032] The speech recognition model is obtained by performing speech recognition training on a pre-built large language model.
[0033] According to a second aspect of an embodiment of the present application, there is provided a speech recognition device, comprising:
[0034] The encoding module is used to encode the recognition result of the historical speech to obtain the encoding information of the recognition result of the historical speech, and to encode the speech to be recognized to obtain the encoding information of the speech to be recognized;
[0035] A fusion module, used for fusing the coding information of the recognition result of the historical speech with the coding information of the speech to be recognized, so as to obtain the speech coding information of the speech to be recognized;
[0036] The decoding module is used to decode the speech coding information to obtain the recognition result of the speech to be recognized.
[0037] According to a third aspect of an embodiment of the present application, there is provided an electronic device, including: a memory and a processor;
[0038] The memory is connected to the processor and is used to store programs;
[0039] The processor is used to implement the above-mentioned speech recognition method by running the program in the memory.
[0040] According to a fourth aspect of an embodiment of the present application, a storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the above-mentioned speech recognition method is implemented.
[0041] According to a fifth aspect of an embodiment of the present application, a computer program product is provided, comprising computer program instructions, which, when executed by a processor, enable the processor to implement the above-mentioned speech recognition method.
[0042] The speech recognition method proposed in the present application encodes the recognition results of historical speech to obtain the encoding information of the recognition results of historical speech, and encodes the speech to be recognized to obtain the encoding information of the speech to be recognized; fuses the encoding information of the recognition results of historical speech with the encoding information of the speech to be recognized to obtain the speech encoding information of the speech to be recognized; and decodes the speech encoding information to obtain the recognition result of the speech to be recognized. The technical solution of the present application is adopted to fuse the encoding information of the recognition results of historical speech with the encoding information of the speech to be recognized, so that the recognition results of historical speech are combined in the process of encoding the speech to be recognized, that is, the recognition results of historical speech are used to assist in the encoding of the current speech to be recognized, so that the above information can be combined in the encoding process of the speech to be recognized, so as to improve the accuracy of the speech encoding information of the speech to be recognized, thereby improving the accuracy of speech recognition. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0044] Figure 1 A flowchart of a speech recognition method provided in an embodiment of the present application;
[0045] Figure 2 A structural diagram of determining speech coding information provided in an embodiment of the present application;
[0046] Figure 3 A schematic diagram of another processing flow for determining speech coding information provided in an embodiment of the present application;
[0047] Figure 4 A schematic diagram of another structure for determining speech coding information provided in an embodiment of the present application;
[0048] Figure 5 A schematic diagram of another processing flow for determining speech coding information provided in an embodiment of the present application;
[0049] Figure 6 A schematic diagram of another structure for determining speech coding information provided in an embodiment of the present application;
[0050] Figure 7 A schematic diagram of another processing flow for determining speech coding information provided in an embodiment of the present application;
[0051] Figure 8 A schematic diagram of another structure for determining speech coding information provided in an embodiment of the present application;
[0052] Fig. 9 A schematic diagram of the structure of a speech recognition device provided in an embodiment of the present application;
[0053] Fig.10 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0054] The technical solution of the embodiment of the present application is applicable to the application scenario of speech recognition, and is specifically used in the application scenario of speech recognition of long-duration speech. The technical solution of the embodiment of the present application can improve the accuracy of the speech coding information of the speech to be recognized, thereby improving the accuracy of speech recognition.
[0055] Speech recognition aims to recognize and transcribe the text content of human speech signals. It is an important component of the human-computer interaction interface, allowing users to interact with computer systems through voice, thereby realizing functions such as voice commands, voice search, and voice transcription. When performing speech recognition, each speech segment needs to be recognized in turn. Different speech segments may have semantic correlations. Therefore, contextual information can affect the recognition accuracy of the current speech segment. Long-duration speech refers to speech signals or speech segments with a longer duration. In long-duration speech, the semantic correlation between different speech segments is stronger. Therefore, in the long-duration speech recognition scenario, contextual information is of great significance to the recognition of the current speech segment.
[0056] In the prior art, the historical speech corresponding to the current speech segment is used to assist the recognition of the current speech segment, so that when recognizing the current speech segment, the context information of the current speech segment can be combined to improve the speech recognition efficiency. However, the existing conventional solution is to use the recognition result of the historical speech as the reference information for decoding when decoding the speech coding after completing the encoding of the current speech segment. However, the recognition result of the historical speech is applied in the decoding process in the latter part of the speech recognition process, which will affect the accuracy of speech recognition.
[0057] Based on this, the present application proposes a speech recognition method. This technical solution can combine the recognition results of historical speech, so that the above information can be combined in the encoding process of the speech to be recognized, thereby improving the accuracy of the speech encoding information of the speech to be recognized, thereby solving the problem of low speech recognition accuracy in the prior art.
[0058] 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.
[0059] Exemplary Methods
[0060] See also Figure 1 As shown, the embodiment of the present application proposes a speech recognition method. The method includes:
[0061] S101, encoding the recognition result of the historical speech to obtain the encoding information of the recognition result of the historical speech, and encoding the speech to be recognized to obtain the encoding information of the speech to be recognized.
[0062] In this embodiment, the speech segment that needs to be recognized is used as the speech to be recognized, and the speech segment that has been recognized before the speech to be recognized is used as the historical speech corresponding to the speech to be recognized. In this embodiment, it is necessary to obtain the recognition result of the historical speech, and the recognition result of the historical speech includes the recognition text of the historical speech. Among them, the historical speech and the speech to be recognized can be speech segments in a long-term speech, so as to realize the speech recognition of the long-term speech.
[0063] In the process of speech recognition, the speech to be recognized needs to be encoded to obtain the encoding information of the speech to be recognized, wherein the encoding of the speech to be recognized is preferably performed by using several network layers in an existing encoder, and the obtained encoding information of the speech to be recognized contains the semantic information of the speech to be recognized. Since only the deep network layer of the encoder can encode the semantic information of the speech to be recognized, the encoder includes at least one shallow network layer and at least one deep network layer. The speech to be recognized needs to be encoded by all shallow network layers and at least one deep network layer in the encoder to obtain the encoding information of the speech to be recognized. Figure 2 As shown, v represents the speech to be recognized. The speech to be recognized v is input into the encoder, and the network layers Layer1 to Layer10 of the encoder encode the speech to be recognized. The network layer Layer10 of the encoder outputs the encoding information Ev of the speech to be recognized. Figure 2 In the figure, Layer 10 represents a deeper network layer in the encoder. Therefore, the encoded information Ev of the speech to be recognized output by the network layer Layer 10 already contains certain semantic information. In practical applications, it is not limited to which layer of the network layer outputs the information as the encoded information of the speech to be recognized, as long as the encoded information output by the deep network in the encoder contains certain semantic information.
[0064] In the process of speech recognition, it is also necessary to obtain the recognition result of the historical speech corresponding to the speech to be recognized, and encode the recognition text in the recognition result of the historical speech to obtain the encoding information of the recognition result of the historical speech. In this embodiment, the encoding process of the recognition text may include encoding the recognition text at different granularities, thereby obtaining at least one granularity of encoding as the encoding information of the recognition result of the historical speech. Among them, the different granularities include word-level granularity, phoneme-level granularity, etc.
[0065] Furthermore, encoding processing is performed on the recognition result of the historical speech to obtain encoding information of the recognition result of the historical speech, which specifically includes the following steps:
[0066] First, perform phoneme conversion on the recognized text in the recognition results of historical speech to obtain a phoneme sequence corresponding to the recognized text, and perform encoding processing on the phoneme sequence at phoneme granularity to obtain a phoneme-level granularity encoding of the recognized text; and / or perform character-level granularity encoding processing on the recognized text in the recognition results of historical speech to obtain a character-level granularity encoding of the recognized text.
[0067] For the encoding processing of the recognized text at the phoneme granularity in the recognition result of the historical speech, it is first necessary to perform phoneme conversion on the recognized text, that is, convert each word-level unit in the recognized text into a phoneme sequence composed of phoneme-level units, so as to obtain all phoneme sequences corresponding to the recognized text. In this embodiment, the word2phone sequence technology can be used to convert the characters or words in the recognized text into phoneme sequences. Among them, the word2phone sequence technology includes rule-based conversion, dictionary-based conversion, deep learning-based conversion, etc. The rule-based conversion is to map the word-level unit to the corresponding phoneme sequence by pre-establishing conversion rules; the dictionary-based conversion is to pre-build a dictionary, which contains word-level units and their corresponding phoneme sequences, so that the phoneme sequences corresponding to each word-level unit in the recognized text can be queried according to the pre-built dictionary; the conversion based on deep learning is to perform text-to-phoneme conversion training on the deep learning model (such as recurrent neural network RNN, long short-term memory network LSTM, etc.) through pre-collected samples, so that the deep learning model can map the word-level unit to the phoneme sequence.
[0068] For the encoding processing of the recognized text in the historical speech recognition results at the word level granularity, this embodiment can directly perform text encoding on the recognized text in the historical speech recognition results, that is, the encoding processing of the recognized text at the word level granularity is realized, and the word level granularity encoding of the recognized text can be obtained. Figure 2 As shown, s represents the recognized text in the recognition result of the historical speech. The recognized text can be encoded by using an existing language model, such as a pre-trained language model (PLM). The recognized text is encoded by the pre-trained language model to output the word-level granularity encoding Es of the recognized text.
[0069] S102: Merge the coding information of the historical speech recognition result with the coding information of the speech to be recognized to obtain the speech coding information of the speech to be recognized.
[0070] After obtaining the encoding information of the recognition result of the historical speech and the encoding information of the speech to be recognized, this embodiment fuses the encoding information of the recognition result of the historical speech and the encoding information of the speech to be recognized, thereby obtaining the speech encoding information of the speech to be recognized. Specifically, after the shallow network layer and at least one deep network layer in the encoder encode the speech to be recognized and output the encoding information of the speech to be recognized, a fusion module is set in the encoder to fuse the encoding information of the speech to be recognized and the encoding information of the recognition result of the historical speech, and the fused encoding information is input into the remaining network layers after the network layer that encodes the speech to be recognized in the encoder to continue encoding the fused encoding information, and the encoding information output by the last network layer of the encoder is used as the speech encoding information of the speech to be recognized. For example, the first to tenth network layers in the encoder encode the speech to be recognized, and the tenth network layer outputs the encoding information of the speech to be recognized. The tenth network layer is connected to the fusion module, which receives the encoding information of the speech to be recognized and the encoding information of the recognition results of the historical speech, and fuses them, and inputs the fused encoding information into the eleventh network layer. The eleventh network layer and all subsequent network layers in the encoder continue to encode the fused encoding information, and finally outputs the speech encoding information of the speech to be recognized.
[0071] Specifically, when only the recognized text in the historical speech recognition result is encoded at the word level, that is, the encoding information of the historical speech recognition result only includes the word level encoding of the recognized text, the word level encoding of the recognized text is merged with the encoding information of the speech to be recognized to obtain the speech encoding information of the speech to be recognized. Figure 2 As shown, the pre-trained language model PLM is used to perform word-level encoding processing on the recognition text s to obtain the word-level granularity code Es of the recognition text. The network layers Layer1 to Layer10 in the encoder are used to encode the speech to be recognized to obtain the encoding information Ev of the speech to be recognized, and the word-level granularity code Es of the recognition text and the encoding information Ev of the speech to be recognized are input into a fusion module (fusion module) set in the encoder. The fusion module fuses the word-level granularity code Es of the recognition text and the encoding information Ev of the speech to be recognized, and inputs the fused information into the network layer Layer11 in the encoder. The network layer Layer11 and all subsequent network layers in the encoder continue to encode the fused information output by the fusion module, and finally obtain and output the speech encoding information Ef of the speech to be recognized.
[0072] When only the recognized text in the recognition result of the historical speech is encoded at the phoneme level granularity, that is, the encoding information of the recognition result of the historical speech only includes the phoneme level granularity encoding of the recognized text, the phoneme level granularity encoding of the recognized text is fused with the encoding information of the speech to be recognized to obtain the speech encoding information of the speech to be recognized. In this embodiment, the fusion between the phoneme level granularity encoding of the recognized text and the encoding information of the speech to be recognized is shallower than the fusion network layer between the word level granularity encoding of the recognized text and the encoding information of the speech to be recognized, that is, the fusion between the word level granularity encoding of the recognized text and the encoding information of the speech to be recognized is at a deeper position of the encoder than the fusion between the phoneme level granularity encoding of the recognized text and the encoding information of the speech to be recognized. For example, if the word-level granularity coding of the recognized text and the coding information of the speech to be recognized output by the tenth network layer in the encoder are input into a fusion module set in the encoder for fusion, then the phoneme-level granularity coding of the recognized text needs to be fused with the coding information of the speech to be recognized output by the network layer before the tenth network layer in the encoder (for example, the sixth network layer), that is, the phoneme-level granularity coding of the recognized text and the coding information of the speech to be recognized output by the network layer before the tenth network layer in the encoder (for example, the sixth network layer) are input into the fusion module set in the encoder for fusion.
[0073] When the recognized text in the recognition result of the historical speech is encoded at the word-level granularity and the phoneme-level granularity, that is, the encoding information of the recognition result of the historical speech includes the word-level granularity encoding and the phoneme-level granularity encoding of the recognized text, the word-level granularity encoding and the phoneme-level granularity encoding of the recognized text are fused with the encoding information of the speech to be recognized to obtain the speech encoding information of the speech to be recognized. Specifically, since the network layer in which the encoding information of the speech to be recognized is integrated with the word-level granularity encoding in the encoder is deeper than the network layer in which the encoding information of the speech to be recognized is integrated with the phoneme-level granularity encoding in the encoder, this embodiment needs to first fuse the phoneme-level granularity encoding of the recognized text with the encoding information of the speech to be recognized, and then fuse the fused information with the word-level granularity encoding of the recognized text to finally obtain the speech encoding information of the speech to be recognized.
[0074] S103: Decode the speech coding information to obtain a recognition result of the speech to be recognized.
[0075] Through the above steps, the speech coding information of the speech to be recognized output by the encoder is decoded to obtain the recognition result of the speech to be recognized. Since the encoder integrates the coding information of the recognition result of the historical speech into the coding information of the speech to be recognized during the encoding process of the speech to be recognized, the speech coding information of the speech to be recognized contains the semantic information of the historical speech, which improves the accuracy of the speech coding information of the speech to be recognized. Then, the accuracy will also be improved in the process of decoding the speech coding information, thereby improving the accuracy of speech recognition.
[0076] In this embodiment, the speech coding information can be decoded by using a pre-trained speech recognition model (i.e., a decoder), and the speech coding information of the speech to be recognized is input into the speech recognition model, and the speech recognition model can decode the speech coding information, thereby recognizing the recognition text of the speech to be recognized as the recognition result of the speech to be recognized. For the training of the speech recognition model, the speech coding samples collected in advance and the speech text corresponding to the speech coding samples marked in advance can be used, and the speech coding samples can be input into the speech recognition model to predict the predicted text corresponding to the speech coding samples. With the goal of making the predicted text the same as the speech text, the model parameters of the speech recognition model are adjusted.
[0077] Furthermore, this embodiment combines the recognition results of historical voices to decode the voice coding information of the voice to be recognized, and obtains the recognition results of the voice to be recognized. In this way, the relevant information of the historical voices can be integrated in the encoding process of the voice to be recognized, and the relevant information of the historical voices can be combined in the decoding process, so that the above information can be combined in both encoding and decoding, that is, the encoding accuracy is improved in the encoding process, and the decoding accuracy is also improved in the decoding process, so that the accuracy of voice recognition can be higher.
[0078] From the above introduction, it can be seen that the speech recognition method proposed in the embodiment of the present application encodes the recognition result of the historical speech to obtain the encoding information of the recognition result of the historical speech, and encodes the speech to be recognized to obtain the encoding information of the speech to be recognized; fuses the encoding information of the recognition result of the historical speech with the encoding information of the speech to be recognized to obtain the speech encoding information of the speech to be recognized; and decodes the speech encoding information to obtain the recognition result of the speech to be recognized. By adopting the technical solution of the present application, the encoding information of the recognition result of the historical speech is fused with the encoding information of the speech to be recognized, so that in the process of encoding the speech to be recognized, the recognition result of the historical speech is combined, so that in the process of encoding the speech to be recognized, the above information can be combined, so as to improve the accuracy of the speech encoding information of the speech to be recognized, thereby improving the accuracy of speech recognition.
[0079] As an optional implementation, see Figure 3 As shown, in another embodiment of the present application, when the encoding information of the recognition result of the historical speech includes the word-level granularity encoding of the recognized text, the word-level granularity encoding is merged with the encoding information of the speech to be recognized to obtain the speech encoding information of the speech to be recognized, including:
[0080] S301, performing fusion coding processing on the first character granularity code and the coding information of the speech to be recognized to obtain a first fusion code of the speech to be recognized.
[0081] In this embodiment, the historical speech includes at least one speech segment. When the historical speech includes multiple speech segments, each speech segment has a sequence. The earlier the speech segment is ranked in the historical speech, the longer the time interval between it and the speech to be recognized and the weaker the correlation. The later the speech segment is ranked in the historical speech, the shorter the time interval between it and the speech to be recognized and the stronger the correlation. The weaker the correlation between the speech segment and the speech to be recognized, the earlier the coding information of the recognition text of the speech segment needs to be fused with the coding information of the speech to be recognized. The stronger the correlation between the speech segment and the speech to be recognized, the later the coding information of the recognition text of the speech segment needs to be fused with the coding information of the speech to be recognized. That is, the network layer for fusing the coding information of the recognition text of the speech segment with strong correlation and the coding information of the speech to be recognized is deeper than the network layer for fusing the coding information of the recognition text of the speech segment with weak correlation and the coding information of the speech to be recognized.
[0082] When the historical speech includes two speech segments, the recognition text of the historical speech includes a first recognition text corresponding to the first speech segment and a second recognition text corresponding to the second speech segment. The character-level granularity encoding processing of the recognition text of the historical speech includes character-level granularity encoding processing of the first recognition text and character-level granularity encoding processing of the second recognition text. Therefore, the character-level granularity encoding of the recognition text includes a first character-level granularity encoding corresponding to the first recognition text and a second character-level granularity encoding corresponding to the second recognition text. Moreover, the second speech segment is the speech after the first speech segment, so the second recognition text is also the text after the first recognition text. Therefore, the interval between the first speech segment and the speech to be recognized is longer and the correlation is weaker, so it is necessary to first perform a fusion encoding process on the first character granularity encoding corresponding to the first recognition text and the encoding information of the speech to be recognized to obtain the first fusion encoding of the speech to be recognized.
[0083] S302: Perform fusion coding processing on the second character granularity code and the first fusion code to obtain a second fusion code of the speech to be recognized.
[0084] The second speech segment is after the first speech segment, so the interval between the second speech segment and the speech to be recognized is shorter than the interval between the first speech segment and the speech to be recognized, that is, the correlation between the second speech segment and the speech to be recognized is stronger than the correlation between the first speech segment and the speech to be recognized. Therefore, after the first character granularity code corresponding to the first recognition text is fused with the coding information of the speech to be recognized, the second character granularity code and the first fusion code are fused and coded to obtain the second fusion code of the speech to be recognized. That is to say, the network layer for fusion coding the second character granularity code is deeper than the network layer for fusion coding the first character granularity code.
[0085] In addition, if the historical speech also includes a third speech segment after the second speech segment, then the third character granularity code corresponding to the third recognition text of the third speech segment needs to be fused with the second fusion code to obtain a third fusion code. Similarly, according to the above method, the corresponding fusion code can be determined when the historical speech also includes the fourth speech segment and other speech segments.
[0086] S303: Use the fusion code obtained by the last fusion coding process as speech coding information of the speech to be recognized.
[0087] Through the above steps, the fusion code obtained by the last fusion coding process is used as the voice coding information of the speech to be recognized. For example, if the historical speech includes only two speech segments, the second fusion code is used as the voice coding information of the speech to be recognized, if the historical speech includes three speech segments, the third fusion code is used as the voice coding information of the speech to be recognized, and so on.
[0088] See also Figure 4 As shown, in the case where the historical speech includes three speech segments, the first recognition text s1 corresponding to the first speech segment, the second recognition text s2 corresponding to the second speech segment, and the third recognition text s3 corresponding to the third speech segment are all input into the pre-trained language model PLM for character-level granularity encoding processing, and the first character-level granularity code Es1 corresponding to the first recognition text s1, the second character-level granularity code Es2 corresponding to the second recognition text s1, and the third character-level granularity code Es3 corresponding to the third recognition text s3 are obtained and output. The speech v to be recognized is input into the encoder, and the network layers Layer1 to Layer8 in the encoder encode the speech v to be recognized to obtain the encoding information Ev of the speech to be recognized. Among them, the network layers Layer1 to Layer8 in the encoder include all shallow network layers and at least one deep network layer. This embodiment does not limit the number of network layers used to encode the encoding information Ev of the speech to be recognized, as long as the encoding information output by the deep network layer is used as the encoding information Ev of the speech to be recognized.
[0089] Since the time interval between the first speech segment and the speech to be recognized is greater than the time interval between the second speech segment and the speech to be recognized, and greater than the time interval between the third speech segment and the speech to be recognized, the first word-level granularity code Es1 and the encoding information Ev of the speech to be recognized are first fused and encoded, then the second word-level granularity code Es2 is fused, and finally the third word-level granularity code Es3 is fused. That is, Figure 3 As shown, the first word-level granularity code Es1 and the coding information Ev of the speech to be recognized are both input into the first fusion module for fusion, and the fusion information output by the first fusion module is encoded through the network layer Layer9 to obtain the first fusion code E1; then, the second word-level granularity code Es2 and the first fusion code E1 are both input into the second fusion module for fusion, and the fusion information output by the second fusion module is encoded through the network layers Layer10~Layer11 to obtain the second fusion code E2 output by the network layer Layer11; finally, the third word-level granularity code Es3 and the second fusion code E2 are both input into the third fusion module for fusion, and the fusion information output by the third fusion module is encoded through the network layers Layer12, Layer13 and all subsequent network layers to obtain the third fusion code E3 output by the last network layer, and the third fusion code E3 is the fusion code obtained by the last fusion coding process, and the third fusion code E3 is used as the speech coding information Ef of the speech to be recognized.
[0090] By integrating and encoding each character-level granularity code with the coding information of the speech to be recognized in sequence according to the sequence of each speech segment in the above embodiment, the character-level granularity codes with weaker correlation can be integrated and encoded first, and the character granularity codes with stronger correlation can be integrated and encoded later, so that the semantic information of the speech segments with stronger correlation in the speech coding information of the speech to be recognized is more accurate, thereby ensuring the accuracy of the speech coding information of the speech to be recognized while reducing the amount of calculation and video memory occupancy.
[0091] As an optional implementation, see Figure 5 As shown, in another embodiment of the present application, when the encoding information of the recognition result of the historical speech includes the phoneme-level granularity encoding of the recognized text, the phoneme-level granularity encoding is merged with the encoding information of the speech to be recognized to obtain the speech encoding information of the speech to be recognized, including:
[0092] S501, performing a spatial alignment operation on the phoneme-level granularity code and the coding information of the speech to be recognized, to obtain aligned phoneme-level granularity code and the coding information of the speech to be recognized.
[0093] Since the phoneme sequence obtained after the recognition text of the historical speech is converted from word-level granularity to phoneme-level granularity belongs to a different modality from the speech to be recognized, the encoding information of the two has certain differences in spatial representation. Therefore, in order to improve the accuracy of the fusion between the phoneme-level granularity encoding and the encoding information of the speech to be recognized, this embodiment needs to align the phoneme-level granularity encoding corresponding to the recognition text of the historical speech with the encoding information of the speech to be recognized in terms of spatial representation to obtain the aligned phoneme-level granularity encoding and the encoding information of the speech to be recognized.
[0094] Specifically, this embodiment can calculate the distance between the phoneme-level granularity code and the coding information of the speech to be recognized, and perform an alignment operation on the phoneme-level granularity code and the coding information of the speech to be recognized by means of a distance loss constraint. For example, by performing an alignment operation on the phoneme-level granularity code and the coding information of the speech to be recognized, the distance between the phoneme-level granularity code and the coding information of the speech to be recognized is made smaller and smaller, until the distance between the phoneme-level granularity code and the coding information of the speech to be recognized reaches a preset distance loss threshold, and the phoneme-level granularity code and the coding information of the speech to be recognized after the alignment operation at this time are used as the final aligned phoneme-level granularity code and the coding information of the speech to be recognized. Among them, the distance calculation formula between the phoneme-level granularity code and the coding information of the speech to be recognized is as follows:
[0095]
[0096] Among them, x represents the phoneme-level granularity encoding, and y represents the encoding information of the speech to be recognized.
[0097] S502: Fusing the aligned phoneme-level granularity coding and the coding information of the speech to be recognized to obtain speech coding information of the speech to be recognized.
[0098] After the phoneme-level granularity coding and the coding information of the speech to be recognized are aligned in spatial representation through the above steps, the aligned phoneme-level granularity coding and the coding information of the speech to be recognized are fused to obtain the speech coding information of the speech to be recognized.
[0099] See also Figure 6As shown, the Word2Phone operation is performed on the recognition text s of the historical speech, that is, the recognition text s of the historical speech is converted from word-level granularity to phoneme-level granularity, and the phoneme sequence corresponding to the recognition text is obtained, and then the phoneme sequence is input into the embedding network layer Embedding for encoding processing to obtain the phoneme-level granularity encoding Ep of the recognition text of the historical speech. The speech v to be recognized is input into the encoder, and the network layers Layer1 to Layer6 in the encoder encode the speech v to be recognized to obtain the encoding information Ev of the speech to be recognized. Among them, the network layers Layer1 to Layer6 in the encoder include all shallow network layers and at least one deep network layer, and the network layer that outputs the encoding information of the speech to be recognized that is fused with the word-level granularity encoding is deeper than the network layer that outputs the encoding information of the speech to be recognized that is fused with the phoneme-level granularity encoding. This embodiment does not limit the number of network layers used to encode the encoding information Ev of the speech to be recognized, as long as the encoding information output by the deep network layer is used as the encoding information Ev of the speech to be recognized.
[0100] Then, the cosine distance CosineDistance is calculated for the phoneme-level granularity code Ep and the coding information Ev of the speech to be recognized, and the phoneme-level granularity code Ep and the coding information Ev of the speech to be recognized are aligned based on the calculated distance. The aligned phoneme-level granularity code Ep and the coding information Ev of the speech to be recognized are input into the fusion module for fusion. The fusion information output by the fusion module is encoded through network layer Layer7 and all subsequent network layers to obtain the final speech coding information Ef of the speech to be recognized.
[0101] As an optional implementation, see Figure 7 As shown, in another embodiment of the present application, it is disclosed that, when the encoding information of the recognition result of the historical speech includes the character-level granularity encoding and the phoneme-level granularity encoding of the recognized text, the character-level granularity encoding and the phoneme-level granularity encoding are merged with the encoding information of the speech to be recognized to obtain the speech encoding information of the speech to be recognized, including:
[0102] S701 , fusing the phoneme-level granularity code with the coding information of the speech to be recognized to obtain an intermediate fusion code of the speech to be recognized.
[0103] This embodiment fuses the phoneme-level granularity code with the coding information of the speech to be recognized to obtain the intermediate fusion code of the speech to be recognized. The specific fusion steps are the same as those in the above embodiment, that is, the phoneme-level granularity code and the coding information of the speech to be recognized are first aligned in spatial representation to obtain the aligned phoneme-level granularity code and the coding information of the speech to be recognized, and then the aligned phoneme-level granularity code and the coding information of the speech to be recognized are fused to obtain the intermediate fusion code of the speech to be recognized. The specific implementation method has been specifically described in the above embodiment and will not be repeated in this embodiment.
[0104] S702: Fuse the word-level granularity code with the intermediate fusion code to obtain speech coding information of the speech to be recognized.
[0105] After the phoneme-level granularity code is fused with the coding information of the speech to be recognized to obtain the intermediate fusion code, it is necessary to fuse the character-level granularity code with the intermediate fusion code, and then encode the fused information to finally obtain the speech coding information of the speech to be recognized. Among them, the fusion between the character-level granularity code and the intermediate fusion code can adopt the fusion coding method of the character-level granularity code and the coding information of the speech to be recognized described in step S102, directly fusing all the character-level granularity codes with the intermediate fusion code to obtain the speech coding information of the speech to be recognized; it can also adopt the fusion coding method of the character-level granularity code and the coding information of the speech to be recognized described in steps S301 to S303, first fusing the first character granularity code with the intermediate fusion code to obtain the first fusion code, then fusing the second character granularity code with the first fusion code to obtain the second fusion code, and finally using the fusion code obtained by the last fusion coding process as the speech coding information of the speech to be recognized.
[0106] See also Figure 8 As shown, a Word2Phone operation is performed on the recognition text s of the historical speech, that is, the recognition text s of the historical speech is converted from word-level granularity to phoneme-level granularity to obtain a phoneme sequence corresponding to the recognition text, and then the phoneme sequence is input into the embedding network layer Embedding for encoding processing to obtain the phoneme-level granularity encoding Ep of the recognition text of the historical speech. The speech v to be recognized is input into the encoder, and the network layers Layer1 to Layer6 in the encoder encode the speech v to be recognized to obtain the encoding information Ev of the speech to be recognized. Among them, the network layers Layer1 to Layer6 in the encoder include all shallow network layers and at least one deep network layer. This embodiment does not limit the number of network layers used to encode the encoding information Ev of the speech to be recognized, as long as the encoding information output by the deep network layer is used as the encoding information Ev of the speech to be recognized.
[0107] The cosine distance Cosine Distance is calculated for the phoneme-level granularity code Ep and the coding information Ev of the speech to be recognized, and the phoneme-level granularity code Ep and the coding information Ev of the speech to be recognized are aligned based on the calculated distance. The aligned phoneme-level granularity code Ep and the coding information Ev of the speech to be recognized are input into the first fusion module for fusion. The fusion information output by the first fusion module is encoded through the network layer Layer7 to obtain the intermediate fusion code Ec of the speech to be recognized.
[0108] When the historical speech includes three speech segments, the first recognized text s1 corresponding to the first speech segment, the second recognized text s2 corresponding to the second speech segment, and the third recognized text s3 corresponding to the third speech segment are all input into the pre-trained language model PLM for character-level granularity encoding processing, and the first character-level granularity code Es1 corresponding to the first recognized text s1, the second character-level granularity code Es2 corresponding to the second recognized text s1, and the third character-level granularity code Es3 corresponding to the third recognized text s3 are obtained and output.
[0109] Since the time interval between the first speech segment and the speech to be recognized is greater than the time interval between the second speech segment and the speech to be recognized, and the time interval between the third speech segment and the speech to be recognized, the first word-level granularity code Es1 and the intermediate fusion code Ec are first fused and encoded, and then the second word-level granularity code Es2 is fused, and finally the third word-level granularity code Es3 is fused. That is, the first word-level granularity code Es1 and the intermediate fusion code Ec are both input into the second fusion module for fusion, and the fusion information output by the second fusion module is encoded through the network layers Layer8~Layer9 to obtain the first fusion code Ec1; then, the second word-level granularity code Es2 and the first fusion code Ec1 output by the network layer Layer9 are both input into the third fusion module for fusion, and the fusion information output by the third fusion module is encoded through the network layers Layer10~Layer11 to obtain the second fusion code Ec2 output by the network layer Layer11; finally, the third word-level granularity code Es3 and the second fusion code Ec2 are both input into the fourth fusion module for fusion, and the fusion information output by the fourth fusion module is encoded through the network layers Layer12, Layer13 and all subsequent network layers to obtain the third fusion code Ec3 output by the last network layer, and the third fusion code Ec3 is the fusion code obtained by the last fusion coding process, and the third fusion code Ec3 is used as the speech coding information Ef of the speech to be recognized.
[0110] As an optional implementation, another embodiment of the present application discloses that based on the recognition result of the historical speech, the speech coding information is decoded to obtain the recognition result of the speech to be recognized, including:
[0111] The recognition results of the historical speech and the speech coding information are input into the pre-trained speech recognition model to obtain the recognition results of the speech to be recognized.
[0112] Specifically, the recognition result of the historical speech in this embodiment includes not only the recognition text of the historical speech, but also the voice code of the historical speech and the speaker of the historical speech. Among them, the recognition text of the historical speech, the voice code of the historical speech and the speaker of the historical speech can all be compressed with a fixed length, so as to reduce the memory usage, that is, the compression length is preset, and the recognition text of the historical speech, the voice code of the historical speech and the speaker of the historical speech are compressed according to the preset compression length. The speech coding information can also be compressed with a variable length. For example, the variable length compression ratio can be preset. If the ratio is one-half, 50 frames are compressed into 25 frames, and 100 frames are compressed into 50 frames, so that the compressed speech coding information can be obtained.
[0113] In this embodiment, the recognition result of the historical speech and the speech coding information are input into a pre-trained speech recognition model, and the speech recognition model is used for decoding processing to obtain the recognition result of the speech to be recognized. Among them, the speech recognition model preferably adopts a model obtained by performing speech recognition training on a pre-built large language model. Using a large language model for speech recognition can improve the decoding accuracy. For the training of the large language model, the pre-collected speech coding samples and the pre-annotated speech text corresponding to the speech coding samples and the recognition results of the historical speech corresponding to the speech coding samples can be used. The speech coding samples and the recognition results of the historical speech corresponding to the speech coding samples are input into the large language model, and the predicted text corresponding to the speech coding samples is predicted. With the goal of making the predicted text the same as the speech text, the model parameters of the large language model are adjusted.
[0114] Exemplary Devices
[0115] Accordingly, the present application also provides a speech recognition device, see Figure 6 As shown, the device comprises:
[0116] The encoding module 100 is used to encode the recognition result of the historical speech to obtain the encoding information of the recognition result of the historical speech, and to encode the speech to be recognized to obtain the encoding information of the speech to be recognized;
[0117] A fusion module 110 is used to fuse the coding information of the historical speech recognition result with the coding information of the speech to be recognized to obtain the speech coding information of the speech to be recognized;
[0118] The decoding module 120 is used to decode the speech coding information to obtain the recognition result of the speech to be recognized.
[0119] From the above introduction, it can be seen that the speech recognition device proposed in the embodiment of the present application integrates the coding information of the recognition results of the historical speech with the coding information of the speech to be recognized, so as to realize that in the process of encoding the speech to be recognized, the recognition results of the historical speech are combined, so that in the process of encoding the speech to be recognized, the above information can be combined, thereby improving the accuracy of the speech coding information of the speech to be recognized, and thus improving the accuracy of speech recognition.
[0120] As an optional implementation, another embodiment of the present application discloses that the decoding module 120 is specifically used for:
[0121] Based on the recognition results of the historical speech, the speech coding information is decoded to obtain the recognition result of the speech to be recognized.
[0122] As an optional implementation, in another embodiment of the present application, it is disclosed that the encoding module 100 includes: a character-level granularity encoding unit and / or a phoneme-level granularity encoding unit;
[0123] The phoneme granularity encoding unit is used to perform phoneme conversion on the recognized text in the recognition result of the historical speech to obtain a phoneme sequence corresponding to the recognized text, and perform phoneme granularity encoding processing on the phoneme sequence to obtain a phoneme-level granularity encoding of the recognized text;
[0124] and / or, a character-level granularity encoding unit, used to perform character-level granularity encoding processing on the recognized text in the recognition result of the historical speech to obtain the character-level granularity encoding of the recognized text;
[0125] The fusion module 110 is specifically used to fuse the word-level granularity coding and / or the phoneme-level granularity coding with the coding information of the speech to be recognized, so as to obtain the speech coding information of the speech to be recognized.
[0126] As an optional implementation, another embodiment of the present application discloses that, in the case where the encoding information of the recognition result of the historical speech includes the word-level granularity encoding of the recognized text, the recognized text includes: a first recognized text and a second recognized text; the word-level granularity encoding of the recognized text includes: a first word-level granularity encoding corresponding to the first recognized text and a second word-level granularity encoding corresponding to the second recognized text; wherein the second recognized text is the text after the first recognized text;
[0127] The fusion module 110 includes: a first fusion unit, a second fusion unit and a determination unit;
[0128] A first fusion unit is used to perform fusion coding processing on the first character granularity code and the coding information of the speech to be recognized to obtain a first fusion code of the speech to be recognized;
[0129] A second fusion unit is used to perform fusion coding processing on the second character granularity code and the first fusion code to obtain a second fusion code of the speech to be recognized;
[0130] The determining unit is used to use the fusion code obtained by the last fusion coding process as the speech coding information of the speech to be recognized.
[0131] As an optional implementation, another embodiment of the present application discloses that the fusion module 110 further includes: an alignment unit and a third fusion unit;
[0132] An alignment unit, used for performing a spatial alignment operation on the phoneme-level granularity code and the coding information of the speech to be recognized, so as to obtain the aligned phoneme-level granularity code and the coding information of the speech to be recognized;
[0133] The third fusion unit is used to fuse the aligned phoneme-level granularity coding and the coding information of the speech to be recognized to obtain the speech coding information of the speech to be recognized.
[0134] As an optional implementation manner, another embodiment of the present application discloses an alignment unit, which is specifically used for:
[0135] Based on the distance between the phoneme-level granularity coding and the coding information of the speech to be recognized, the phoneme-level granularity coding and the coding information of the speech to be recognized are aligned in spatial representation to obtain the aligned phoneme-level granularity coding and the coding information of the speech to be recognized.
[0136] As an optional implementation, another embodiment of the present application discloses that the fusion module 110 further includes: an intermediate fusion unit and a final fusion unit;
[0137] An intermediate fusion unit, used for fusing the phoneme-level granularity coding with the coding information of the speech to be recognized to obtain the intermediate fusion coding of the speech to be recognized;
[0138] The final fusion unit is used to fuse the word-level granularity coding with the intermediate fusion coding to obtain the speech coding information of the speech to be recognized.
[0139] As an optional implementation, another embodiment of the present application discloses that the decoding module 120 is specifically used for:
[0140] Inputting the recognition result and speech coding information of the historical speech into the pre-trained speech recognition model to obtain the recognition result of the speech to be recognized; the recognition result of the historical speech includes: the recognition text of the historical speech, the speech coding of the historical speech and the speaker of the historical speech;
[0141] The speech recognition model is obtained by training a pre-built large language model for speech recognition.
[0142] The speech recognition device provided in this embodiment belongs to the same application concept as the speech recognition method provided in the above embodiments of this application, can execute the speech recognition method provided in any of the above embodiments of this application, and has the corresponding functional modules and beneficial effects of executing the speech recognition method. For technical details not fully described in this embodiment, please refer to the specific processing content of the speech recognition method provided in the above embodiments of this application, which will not be repeated here.
[0143] Exemplary Electronic Devices
[0144] Another embodiment of the present application also provides an electronic device, see Figure 7 As shown, the device includes:
[0145] Memory 200 and processor 210;
[0146] The memory 200 is connected to the processor 210 and is used to store programs;
[0147] The processor 210 is used to implement the speech recognition method disclosed in any of the above embodiments by running the program stored in the memory 200.
[0148] Specifically, the electronic device may further include: a bus, a communication interface 220 , an input device 230 and an output device 240 .
[0149] The processor 210, the memory 200, the communication interface 220, the input device 230 and the output device 240 are connected to each other via a bus.
[0150] A bus may include a pathway that transfers information between components of a computer system.
[0151] The processor 210 may be a general-purpose processor, such as a general-purpose central processing unit (CPU), a microprocessor, etc., or an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the program of the scheme of the present invention. It may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0152] The processor 210 may include a main processor, and may also include a baseband chip, a modem, and the like.
[0153] The memory 200 stores a program for executing the technical solution of the present invention, and may also store an operating system and other key services. Specifically, the program may include a program code, and the program code includes a computer operation instruction. More specifically, the memory 200 may include a read-only memory (ROM), other types of static storage devices that can store static information and instructions, a random access memory (RAM), other types of dynamic storage devices that can store information and instructions, a disk storage, a flash, and the like.
[0154] The input device 230 may include a device for receiving data and information input by a user, such as a keyboard, a mouse, a camera, a scanner, a light pen, a voice input device, a touch screen, a pedometer, or a gravity sensor.
[0155] Output device 240 may include devices that allow information to be output to a user, such as a display screen, printer, speaker, etc.
[0156] The communication interface 220 may include any transceiver or the like to communicate with other devices or communication networks, such as Ethernet, Radio Access Network (RAN), Wireless Local Area Network (WLAN), etc.
[0157] The processor 210 executes the program stored in the memory 300 and calls other devices, which can be used to implement each step of any speech recognition method provided in the above embodiments of the present application.
[0158] Exemplary computer program products and storage media
[0159] In addition to the above-mentioned methods and devices, an embodiment of the present application may also be a computer program product, which includes computer program instructions, which, when executed by a processor, enable the processor to execute the steps of the speech recognition method according to various embodiments of the present application described in the above-mentioned "Exemplary Method" section of this specification.
[0160] The computer program product may be written in any combination of one or more programming languages to write program codes for performing the operations of the embodiments of the present application, including object-oriented programming languages, such as Java, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as an independent software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0161] In addition, an embodiment of the present application may also be a storage medium on which a computer program is stored, and the computer program is executed by a processor to execute the steps of the speech recognition method according to various embodiments of the present application described in the above "Exemplary Method" section of this specification.
[0162] For the aforementioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the order of the actions described, because according to the present application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0163] It should be noted that each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the embodiments can be referred to each other. For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0164] The steps in the methods of each embodiment of the present application can be adjusted in order, combined and deleted according to actual needs, and the technical features recorded in each embodiment can be replaced or combined.
[0165] The modules and sub-modules in the devices and terminals of the various embodiments of the present application can be combined, divided and deleted according to actual needs.
[0166] In the several embodiments provided in the present application, it should be understood that the disclosed terminals, devices and methods can be implemented in other ways. For example, the terminal embodiments described above are only schematic, for example, the division of modules or submodules is only a logical function division, and there may be other division methods in actual implementation, for example, multiple submodules or modules can be combined or integrated into another module, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules, which can be electrical, mechanical or other forms.
[0167] The modules or submodules described as separate components may or may not be physically separated, and the components of the modules or submodules may or may not be physical modules or submodules, that is, they may be located in one place, or they may be distributed on multiple network modules or submodules. Some or all of the modules or submodules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0168] In addition, each functional module or submodule in each embodiment of the present application may be integrated into one processing module, or each module or submodule may exist physically separately, or two or more modules or submodules may be integrated into one module. The above-mentioned integrated modules or submodules may be implemented in the form of hardware or in the form of software functional modules or submodules.
[0169] 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.
[0170] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly by hardware, software units executed by a processor, or a combination of the two. The software units 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.
[0171] 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", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0172] 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, characterized in that: include: Performing encoding processing on the recognition result of the historical speech to obtain encoding information of the recognition result of the historical speech, and performing encoding processing on the speech to be recognized to obtain encoding information of the speech to be recognized; Merging the encoding information of the recognition result of the historical speech with the encoding information of the speech to be recognized to obtain the speech encoding information of the speech to be recognized; The speech coding information is decoded to obtain a recognition result of the speech to be recognized.
2. The method according to claim 1, characterized in that The decoding process of the speech coding information to obtain the recognition result of the speech to be recognized includes: Based on the recognition result of the historical speech, the speech coding information is decoded to obtain the recognition result of the speech to be recognized.
3. The method according to claim 1 or 2, characterized in that: The recognition result of the historical speech is encoded to obtain the encoding information of the recognition result of the historical speech, including: Performing phoneme conversion on the recognized text in the recognition result of the historical speech to obtain a phoneme sequence corresponding to the recognized text, and performing phoneme granularity encoding processing on the phoneme sequence to obtain a phoneme-level granularity encoding of the recognized text; and / or, performing character-level granularity encoding processing on the recognized text in the recognition result of the historical speech to obtain the character-level granularity encoding of the recognized text; The coding information of the recognition result of the historical speech is merged with the coding information of the speech to be recognized to obtain the speech coding information of the speech to be recognized, including: The word-level granularity coding and / or the phoneme-level granularity coding are merged with the coding information of the speech to be recognized to obtain the speech coding information of the speech to be recognized.
4. The method according to claim 3, characterized in that In the case where the encoding information of the recognition result of the historical speech includes the word-level granularity encoding of the recognized text, the recognized text includes: a first recognized text and a second recognized text; the word-level granularity encoding of the recognized text includes: a first word-level granularity encoding corresponding to the first recognized text and a second word-level granularity encoding corresponding to the second recognized text; wherein the second recognized text is the text after the first recognized text; The word-level granularity coding is merged with the coding information of the speech to be recognized to obtain the speech coding information of the speech to be recognized, including: Performing fusion coding processing on the first character granularity code and the coding information of the speech to be recognized to obtain a first fusion code of the speech to be recognized; Performing fusion coding processing on the second character granularity code and the first fusion code to obtain a second fusion code of the speech to be recognized; The fused code obtained by the last fusion coding process is used as the speech coding information of the speech to be recognized.
5. The method according to claim 3, characterized in that: The phoneme-level granularity coding is integrated with the coding information of the speech to be recognized to obtain the speech coding information of the speech to be recognized, including: Performing a spatial alignment operation on the phoneme-level granularity code and the coding information of the speech to be recognized to obtain aligned phoneme-level granularity code and coding information of the speech to be recognized; The aligned phoneme-level granularity coding and the coding information of the speech to be recognized are fused to obtain the speech coding information of the speech to be recognized.
6. The method according to claim 5, characterized in that Performing a spatial alignment operation on the phoneme-level granularity code and the coding information of the speech to be recognized to obtain the aligned phoneme-level granularity code and the coding information of the speech to be recognized, including: Based on the distance between the phoneme-level granularity code and the coding information of the speech to be recognized, the phoneme-level granularity code and the coding information of the speech to be recognized are aligned in spatial representation to obtain aligned phoneme-level granularity code and coding information of the speech to be recognized.
7. The method according to claim 3, characterized in that The word-level granularity code and the phoneme-level granularity code are merged with the coding information of the speech to be recognized to obtain the speech coding information of the speech to be recognized, including: Fusion of the phoneme-level granularity code with the coding information of the speech to be recognized to obtain an intermediate fusion code of the speech to be recognized; The word-level granularity code is fused with the intermediate fusion code to obtain speech coding information of the speech to be recognized.
8. The method according to claim 2, characterized in that: Based on the recognition result of the historical speech, the speech coding information is decoded to obtain the recognition result of the speech to be recognized, including: Inputting the recognition result of the historical speech and the speech coding information into a pre-trained speech recognition model to obtain the recognition result of the speech to be recognized; the recognition result of the historical speech includes: the recognition text of the historical speech, the speech coding of the historical speech and the speaker of the historical speech; The speech recognition model is obtained by performing speech recognition training on a pre-built large language model.
9. A speech recognition device, characterized in that: include: The encoding module is used to encode the recognition result of the historical speech to obtain the encoding information of the recognition result of the historical speech, and to encode the speech to be recognized to obtain the encoding information of the speech to be recognized; A fusion module, used for fusing the coding information of the recognition result of the historical speech with the coding information of the speech to be recognized, so as to obtain the speech coding information of the speech to be recognized; The decoding module is used to decode the speech coding information to obtain the recognition result of the speech to be recognized.
10. An electronic device, characterized in that: include: Memory and processor; The memory is connected to the processor and is used to store programs; The processor is used to implement the speech recognition method according to any one of claims 1 to 8 by running the program in the memory.
11. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by the processor, the speech recognition method according to any one of claims 1 to 8 is implemented.
12. A computer program product, characterized in that The method comprises computer program instructions, which, when executed by a processor, enable the processor to implement the speech recognition method according to any one of claims 1 to 8.
Citation Information
Cited By
Speech processing method, speech dialogue method and system, and computer terminal
WO2026081647A1
