Speech recognition method and device, equipment, storage medium and program product
By correcting entity keywords in the text collection to be corrected in real-time in long speech recognition, the large language model is used to improve the recognition accuracy and consistency of entity keywords, solving the problem of low entity recognition accuracy in the existing technology. .
Patent Information
- Application Number
- CN202410507743.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-25
- Publication Date
- 2024-08-23
AI Technical Summary
In long speech recognition scenarios, maintaining the accuracy and consistency of entity recognition is a challenge. Existing technologies cannot effectively solve the problem of low recognition accuracy of entity keywords by increasing the amount of model training or hot word decoding incentives.
By collecting low-confidence entity keywords in real time during the long speech recognition process, a text set to be corrected is formed, and a large language model is used to correct the errors until the confidence of the error correction result reaches the threshold, and the historical recognition results are updated to Improve the recognition accuracy and consistency of entity keywords.
Significantly improves the recognition accuracy of entity keywords in long speech recognition, maintains the consistency of recognition results, and improves user experience.
Smart Images

Figure CN118538221A
Abstract
Description
Technical Field
[0001] The present application relates to the field of speech recognition technology, and in particular to a speech recognition method, apparatus, device, storage medium and program product. Background Art
[0002] In the long speech recognition scenario, maintaining the correct and consistent recognition of entities such as names and place names in the context of the long speech is the key to improving the user experience. For example, for the same name entity, in the context recognition process of the long speech, the recognition of the name entity should be correct and consistent. Even if the recognition result is different from the real name, the recognition result of the context should be consistent. If a person's name appears in a variety of different recognition results in the recognition result of the long speech context, it will greatly affect the user experience. However, simply increasing the amount of model training has limited effect on improving the recognition effect of entity keywords, resulting in low accuracy of entity recognition in long speech recognition results. Summary of the invention
[0003] In order to solve the above problems, the present application proposes a speech recognition method, apparatus, device, storage medium and program product, which can significantly improve the accuracy of entity recognition in long speech recognition results.
[0004] According to a first aspect of an embodiment of the present application, there is provided a speech recognition method, comprising:
[0005] In the recognition result of the i-th speech segment, entity keywords whose confidence is less than the confidence threshold are marked to obtain a first text to be corrected corresponding to the recognition result of the i-th speech segment, and the first text to be corrected is added to the set of texts to be corrected;
[0006] Inputting the speech code of the i+kth speech segment and the set of texts to be corrected into the large language model, so that the large language model decodes the speech code of the i+kth speech segment and corrects the annotated entity keywords of the texts to be corrected in the set of texts to be corrected; wherein i and k are positive integers;
[0007] When the confidences of the entity keywords in the correction results corresponding to the first text to be corrected are not less than the confidence threshold, the correction results corresponding to the first text to be corrected are determined as the updated recognition results of the i-th speech segment, and the first text to be corrected is removed from the set of texts to be corrected.
[0008] According to a second aspect of an embodiment of the present application, there is provided a speech recognition device, including:
[0009] A marking module is used to mark entity keywords whose confidence is less than a confidence threshold in the recognition result of the i-th speech segment, obtain a first text to be corrected corresponding to the recognition result of the i-th speech segment, and add the first text to be corrected to the set of texts to be corrected;
[0010] A processing module, used for inputting the speech code of the i+kth speech segment and the set of texts to be corrected into a large language model, so that the large language model decodes the speech code of the i+kth speech segment, and corrects the annotated entity keywords of the texts to be corrected in the set of texts to be corrected; wherein i and k are positive integers;
[0011] An identification module is used to determine the correction result corresponding to the first text to be corrected as the updated recognition result of the i-th speech segment and move the first text to be corrected out of the set of texts to be corrected when the confidence levels of the entity keywords in the correction results corresponding to the first text to be corrected are not less than the confidence threshold.
[0012] A third aspect of the present application provides an electronic device, including:
[0013] Memory and processor;
[0014] The memory is connected to the processor and is used to store programs;
[0015] The processor implements the above-mentioned speech recognition method by running the program in the memory.
[0016] A fourth aspect of the present application provides a storage medium, on which a computer program is stored. When the computer program is executed by a processor, the above-mentioned speech recognition method is implemented.
[0017] A fifth aspect of the present application provides a computer program product, including a computer program, which implements the above-mentioned speech recognition method when executed by a processor.
[0018] One embodiment of the above application has the following advantages or beneficial effects:
[0019] In the recognition result of the i-th speech segment, entity keywords whose confidence is less than the confidence threshold are marked to obtain the first text to be corrected corresponding to the recognition result of the i-th speech segment, and the first text to be corrected is added to the set of texts to be corrected; the speech code of the i+k-th speech segment and the set of texts to be corrected are input into the large language model, so that the large language model decodes the speech code of the i+k-th speech segment, and corrects the marked entity keywords of the text to be corrected in the set of texts to be corrected; when the confidences of the entity keywords in the correction result corresponding to the first text to be corrected are not less than the confidence threshold, the correction result corresponding to the first text to be corrected is determined as the updated recognition result of the i-th speech segment, and the first text to be corrected is removed from the set of texts to be corrected. It can be seen that in the long speech recognition process, the speech segment recognition texts with low recognition confidence of entity keywords are collected in real time to form a text set to be corrected, and in the subsequent recognition process of the long speech, the entity keywords in each text to be corrected in the text set to be corrected are corrected until the confidence of the entity keywords in the correction results corresponding to the text to be corrected is not less than the confidence threshold, and the correction results are used to update the recognition results of the historical speech segments, thereby improving the accuracy of entity keyword recognition, and the above process can maintain the consistency of entity keyword recognition in long speech recognition. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] 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.
[0021] Figure 1 A flowchart of a speech recognition method provided in an embodiment of the present application;
[0022] Figure 2 A schematic diagram of a specific process of confidence determination in a speech recognition method provided in an embodiment of the present application;
[0023] Figure 3 A schematic diagram of a specific process of text error correction and speech recognition in a speech recognition method provided in an embodiment of the present application;
[0024] Figure 4 A schematic diagram of the structure of a speech recognition device provided in an embodiment of the present application;
[0025] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0026] The technical solution of the embodiment of the present application is applicable to various speech recognition scenarios, especially long speech recognition scenarios, etc. The technical solution of the embodiment of the present application can improve the accuracy of speech recognition results, especially the recognition accuracy of entity keywords in long speech recognition.
[0027] At present, the field of long speech recognition mainly adopts the encoder-decoder based speech recognition scheme. This scheme first encodes the current speech segment to be recognized by the encoder encoder to obtain the encoding result of the speech segment, and then uses the decoder decoder to decode the encoding result to obtain the recognized text.
[0028] In order to correctly identify entity keywords such as names of people and places, it is usually achieved by strengthening the recognition of the encoder-decoder model, that is, collecting more training samples containing entity keywords such as names of people and places to train the model, so that the model can recognize more names of people and places. Or the keyword incentive method is adopted, that is, the keyword is stimulated during the decoding process, so that the model is more likely to appear in this type of keyword.
[0029] However, simply increasing the amount of model training has limited effect on improving the recognition effect of entity keywords, and collecting a large number of entity samples to train the model is inefficient. The conventional hot word decoding incentive method cannot take advantage of the knowledge coverage of the large model, which results in low accuracy of entity recognition in long speech recognition results.
[0030] In response to the above technical problems, the present application proposes a new speech recognition solution, which collects speech segment recognition texts with low recognition confidence of entity keywords in real time during the long speech recognition process to form a text set to be corrected, and corrects the entity keywords in each text to be corrected in the text set to be corrected in the subsequent recognition process of the long speech, until the confidence of the entity keywords in the correction results corresponding to the text to be corrected is not less than the confidence threshold, and uses the correction results to update the recognition results of the historical speech segments, thereby improving the accuracy of entity keyword recognition, and the above process can maintain the consistency of entity keyword recognition in long speech recognition.
[0031] The technical solution of the embodiment of the present application can be exemplarily applied to hardware devices such as processors, electronic devices, servers (including cloud servers), or packaged into software programs to be run. When the hardware device executes the processing of the technical solution of the embodiment of the present application, or the above-mentioned software program is run, the purpose of improving the accuracy of long speech recognition can be achieved. The embodiment of the present application only exemplarily introduces the specific processing of the technical solution of the present application, and does not limit the specific implementation form of the technical solution of the present application. Any technical implementation form that can execute the processing of the technical solution of the present application can be adopted by the embodiment of the present application.
[0032] 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.
[0033] Exemplary Methods
[0034] Figure 1 is a flow chart of a speech recognition method according to an embodiment of the present application. In an exemplary embodiment, a speech recognition method is provided, comprising:
[0035] S110, marking entity keywords whose confidence is less than a confidence threshold in the recognition result of the i-th speech segment, obtaining a first text to be corrected corresponding to the recognition result of the i-th speech segment, and adding the first text to be corrected to the set of texts to be corrected;
[0036] S120, inputting the speech code of the i+kth speech segment and the set of texts to be corrected into a large language model, so that the large language model decodes the speech code of the i+kth speech segment, and corrects the annotated entity keywords of the texts to be corrected in the set of texts to be corrected; wherein i and k are positive integers;
[0037] S130. When the confidences of the entity keywords in the correction results corresponding to the first text to be corrected are not less than the confidence threshold, the correction results corresponding to the first text to be corrected are determined as the updated recognition results of the i-th speech segment, and the first text to be corrected is removed from the set of texts to be corrected.
[0038] It should be noted that Large Language Models (LLMs) are deep learning models trained based on massive text data. Large language models have three important capabilities: contextual learning, instruction following, and chain of thought reasoning. Contextual learning: LLMs can understand and utilize contextual information by learning a large amount of text data. This means that the model can interpret the following content based on the previous content, so as to better understand and generate coherent language. Instruction following: LLMs can follow instructions provided by humans to perform specific tasks or generate specific types of output. By providing clear instructions as prompts to the model, it can generate results that are consistent with the instructions. Prompts drive large language models to express text descriptions. Prompts can be a phrase, a sentence, a paragraph, or even a complete question. It is usually created by staff to clarify and convey specific intentions or task requirements. The purpose of prompts is to guide large language models to perform specific operations or generate specific types of output. This can include answering questions, completing tasks, writing articles, generating code, etc. Prompts need to clearly guide the expected behavior of large language models to ensure that the generated results meet expectations. Prompts can contain contextual information so that the model understands and generates content related to it. The context can be previous conversation history, background knowledge, or domain-specific constraints. By providing relevant context, Prompt helps the model better understand the input and generate output.
[0039] In step S110, exemplarily, a speech segment represents a speech signal that lasts for a certain length of time. Specifically, a speech segment can be a speech sentence consisting of one sentence, or a longer speech segment consisting of several sentences, or a shorter speech segment consisting of a word or a character. The length of the processed speech segment is not limited in the embodiment of the present application. When the technical solution of the embodiment of the present application is actually implemented, the length of the above-mentioned speech segment can be any multiple of the minimum token of speech recognition, so that the technical solution of the embodiment of the present application can realize the processing of speech segments of any length.
[0040] The recognition result of the i-th speech segment can be obtained by performing speech recognition on the i-th speech segment through the large language model. For example, the encoding features of the i-th speech segment are input into the large language model, and the large language model is decoded to obtain the recognition result of the i-th speech segment. The large language model can directly use its own capabilities to perform speech recognition, or it can use a long speech sample to fine-tune the large language model and perform speech recognition based on the fine-tuned large language model.
[0041] The recognition result of the i-th speech segment can also be obtained by using a preset speech recognition model to perform speech recognition on the i-th speech segment, wherein the specific training process of the preset speech recognition model is as follows: a large number of speech segments can be obtained as training samples. Professionals use the speech recognition samples corresponding to the training samples as training labels. The training samples are input into the speech recognition model to obtain the speech recognition results output by the speech recognition model, and the loss value of the speech recognition model is determined by comparing the speech recognition results and the training labels. The parameters of the speech recognition model are adjusted with the goal of reducing the loss value of the speech recognition model. Then repeat the above training process until the loss value of the speech recognition model is less than the set value, wherein the set value can be set according to the actual situation, and this embodiment does not limit it. The above speech recognition model can be obtained by training based on any neural network model, or it can be obtained by training based on a pre-trained model.
[0042] Exemplarily, entity keywords represent keywords or phrases that have a specific meaning or refer to a specific entity in the recognition result of a speech segment. For example, names of people, places, names of organizations, etc. Confidence score is usually used to measure the degree of certainty or accuracy of the model in identifying entity keywords. In the entity keyword detection task, confidence can represent the trust of the model in the recognized entity keywords. Generally, confidence is a value between 0 and 1, indicating the degree of certainty of the model for the recognition result. A higher confidence means that the model is more confident that the entity keywords it recognizes are correct, while a lower confidence means that the model has a certain degree of uncertainty about the accuracy of the recognition result. The set of texts to be corrected includes multiple texts to be corrected. The text to be corrected is a text in which there are entity keywords with a confidence less than a confidence threshold in the recognition result of a speech segment. Specifically, as the recognition process of long speech adds texts to the set of texts to be corrected, these texts to be corrected need to be corrected in the subsequent speech recognition process until the correction is completed and removed from the set of texts to be corrected.
[0043] Specifically, a pre-trained model (such as BERT, RoBERTa, etc.) is used to perform named entity recognition (NER) on the recognition result of the i-th speech segment, and then the entity keyword is determined based on the label and confidence output by the model. After determining the entity keyword, the confidence of each entity keyword is compared with the confidence threshold. The confidence threshold is set according to the actual situation and is not limited here. If the entity keyword confidence is less than the confidence threshold, it means that the entity keyword is recognized incorrectly. Therefore, the entity keyword is marked in the recognition result of the i-th speech segment (for example, the entity keyword is marked with a special marking symbol, such as <keyword>), obtain the corresponding first text to be corrected, and add it to the set of texts to be corrected.
[0044] In step S120, exemplarily, when the speech recognition task is performed on the speech segment after the i-th speech segment, the text correction task is added, that is, the large language model performs the speech recognition task and the text correction task together. Specifically, the speech of the i+k-th speech segment is encoded by the encoder to obtain the speech code of the i+k-th speech segment, and the text set to be corrected and the speech code of the i+k-th speech segment are input into the large language model. The large language model may first perform the decoding of the speech code to obtain the recognition result of the i+k-th speech segment, and then perform the correction of the annotated entity keywords of the text to be corrected to obtain the correction result. It may also be that the correction of the annotated entity keywords of the text to be corrected is first performed to obtain the correction result, and then the decoding of the speech code is performed to obtain the recognition result of the i+k-th speech segment, which is not limited here.
[0045] It should be noted that when correcting the text to be corrected in the correction text set during the recognition of the i+kth speech segment, it is not limited to correcting the text to be corrected in the correction text set using only the recognition result of the i+kth speech segment. In other words, it is not limited to correcting the previous speech recognition result only through the subsequent speech information.
[0046] Taking the correction of the above-mentioned first text to be corrected as an example, in the correction process, the relevant information (recognition results, etc.) of the speech segment after the i-th speech segment can be used to correct the above-mentioned first text to be corrected, such as using the information of the i+k-th speech segment to correct the above-mentioned first text to be corrected; the relevant information (recognition results, etc.) of the speech segment before the i-th speech segment can also be used to correct the above-mentioned first text to be corrected, such as using the information of the ik-th speech segment to correct the above-mentioned first text to be corrected; the high-confidence recognition result in the i-th speech segment can also be used to correct the above-mentioned first text to be corrected; or the relevant information of the speech segment before the i-th speech segment, the high-confidence recognition result of the i-th speech segment, and the relevant information of the speech segment after the i-th speech segment can be used together to correct the above-mentioned first text to be corrected.
[0047] Those skilled in the art should understand that the above step S102 is intended to be reflected in the long speech recognition process, and the previous speech recognition result is corrected in the process of recognizing the subsequent speech, and it is not limited to correcting the previous speech recognition result only with the help of the relevant information of the subsequent speech. In the error correction process, any information obtained at any stage in the long speech recognition process can be used to correct the text to be corrected.
[0048] It can be understood that the recognition result of the i+kth speech segment can be the output of the large language model, that is, to realize the speech recognition of the speech segment, it is necessary to continue to judge the confidence of the entity keywords in the recognition result of the i+kth speech segment. If the recognition result of the i+kth speech segment contains entity keywords with a confidence less than the confidence threshold, it is also necessary to add the text to be corrected corresponding to the recognition result of the i+kth speech segment to the set of texts to be corrected, that is, the correction task will continue to accumulate with the recognition of the speech segment. As long as there are entity keywords with a confidence less than the confidence threshold in the recognition result of the speech segment, it will be carried out in the subsequent speech segment recognition. The recognition result of the i+kth speech segment can also be just an intermediate quantity of the large language model, that is, it is only used as reference information for the text correction task. The recognition result of the i+kth speech segment can also be both the output of the large language model and the intermediate quantity of the large language model.
[0049] Optionally, the large language model decodes the speech encoding of the i+kth speech segment according to its own capabilities to obtain the recognition result of the i+kth speech segment. Since the i+kth speech segment is the speech after the i-th speech segment, according to the contextual relationship between the speech segments, the large language model can perform text correction on the text to be corrected according to the speech encoding of the i+kth speech segment to obtain the correction result.
[0050] Preferably, step S120 includes: S1210, inputting the speech code of the i+kth speech segment and the set of texts to be corrected into the large language model, so that the large language model decodes the speech code of the i+kth speech segment to obtain the recognition result of the i+kth speech segment; S1220, the large language model corrects the annotated entity keywords of the text to be corrected in the set of texts to be corrected based on the i+kth speech segment and its recognition result to obtain a correction result.
[0051] Exemplarily, the large language model first performs the speech recognition task of the i+kth speech segment, and then performs the text correction task of the text set to be corrected. In this way, when the large language model performs the text correction task of the text set to be corrected, it can use the recognition result of the i+kth speech segment to correct each text to be corrected in the text set to be corrected. It has more reference information when correcting, which is more conducive to completing text correction.
[0052] In this embodiment, in the scenario of long speech, when the i+kth speech segment is subjected to speech recognition, the speech of the i+kth speech segment is encoded according to the encoder to obtain the speech encoding of the i+kth speech segment. The speech encoding of the i+kth speech segment and the set of texts to be corrected are input into the large language model, and the large language model can first decode the speech encoding of the i+kth speech segment according to its own capabilities to obtain the recognition result of the i+kth speech segment; then, the large language model performs text correction on the annotated entity keywords in each text to be corrected according to the speech encoding of the i+kth speech segment and the recognition result of the i+kth speech segment to obtain the correction results corresponding to each text to be corrected.
[0053] In step S130, illustratively, each time a new speech segment is recognized and a text to be corrected in the text set to be corrected is corrected, the confidence of the entity keywords in each correction result is determined once. If the confidence of each entity keyword in any correction result is not less than the confidence threshold, the text to be corrected corresponding to the correction result is removed from the correction text set and no longer participates in subsequent corrections. At the same time, the recognition result of the speech segment corresponding to the text to be corrected is updated to the correction result. If there are still entity keywords with a confidence less than the confidence threshold in the correction result, the text to be corrected is still retained in the text set to be corrected, waiting for the next correction.
[0054] Furthermore, when the number of corrections of a text to be corrected in the set of texts to be corrected reaches a threshold number of times, if the correction still cannot be successfully made, the text to be corrected will also be removed from the set of texts to be corrected. The number of corrections refers to the number of times the input large language model is corrected. The number of times threshold is set based on actual experience and is not limited here. For example, if there are still entity keywords with a confidence level less than the confidence threshold in the correction result, the text to be corrected will still be retained in the set of texts to be corrected. At this time, the number of corrections of the text to be corrected will be increased by one. If the updated number of corrections still does not reach the number threshold, wait for the next correction.
[0055] In the technical solution of the present application, entity keywords whose confidence is less than a confidence threshold are marked in the recognition result of the i-th speech segment, and a first text to be corrected corresponding to the recognition result of the i-th speech segment is obtained, and the first text to be corrected is added to a set of texts to be corrected; the speech code of the i+k-th speech segment and the set of texts to be corrected are input into a large language model, so that the large language model decodes the speech code of the i+k-th speech segment, and corrects the marked entity keywords of the text to be corrected in the set of texts to be corrected; when the confidences of the entity keywords in the correction result corresponding to the first text to be corrected are not less than the confidence threshold, the correction result corresponding to the first text to be corrected is determined as the updated recognition result of the i-th speech segment, and the first text to be corrected is removed from the set of texts to be corrected. It can be seen that in the long speech recognition process, the speech segment recognition texts with low recognition confidence of entity keywords are collected in real time to form a text set to be corrected, and in the subsequent recognition process of the long speech, the entity keywords in each text to be corrected in the text set to be corrected are corrected until the confidence of the entity keywords in the correction results corresponding to the text to be corrected is not less than the confidence threshold, and the correction results are used to update the recognition results of the historical speech segments, thereby improving the accuracy of entity keyword recognition, and the above process can maintain the consistency of entity keyword recognition in long speech recognition.
[0056] In one implementation, when the confidence of the entity keyword in the recognition result of the i-th speech segment is not less than the confidence threshold, the entity keyword with the confidence not less than the confidence threshold is added to the auxiliary information set.
[0057] Exemplarily, the auxiliary information set is used to assist the large language model in entity keyword recognition. The auxiliary information set includes multiple entity keywords, which can be common words in the field corresponding to the pre-acquired speech segment, or entity keywords whose confidence is not less than the confidence threshold each time a new speech segment is recognized. Specifically, the confidence of each entity keyword in the recognition result of the i-th speech segment is compared with the confidence threshold. If the confidence of the entity keyword is not less than the confidence threshold, it means that the entity keyword is accurately recognized, and it is added to the auxiliary information set to assist in the recognition of subsequent speech segments.
[0058] Preferably, the step of inputting the speech code of the i+kth speech segment and the set of texts to be corrected into a large language model so that the large language model decodes the speech code of the i+kth speech segment, and performs entity keyword correction on the texts to be corrected in the set of texts to be corrected, comprises:
[0059] The auxiliary information set, the speech coding of the i+kth speech segment and the set of texts to be corrected are input into a large language model, so that the large language model decodes the speech coding of the i+kth speech segment based on the auxiliary information set, and performs entity keyword correction on the texts to be corrected in the set of texts to be corrected.
[0060] Exemplarily, after obtaining the auxiliary information set, the auxiliary information set, the speech encoding of the i+kth speech segment and the to-be-corrected text set may be directly input into the large language model without processing the auxiliary information.
[0061] Alternatively, each entity keyword in the auxiliary information set is first encoded according to the encoder, and then each entity keyword encoding in the auxiliary information set, the speech encoding of the i+kth speech segment and the text set to be corrected are input into the large language model. In this way, when the number of words in the auxiliary information set is large, its data size can be reduced, thereby reducing the computational complexity of the large language model.
[0062] Specifically, Figure 2 As shown, in the scenario of long speech, speech recognition is performed on the speech encoding of the ith speech segment according to the large language model to obtain the recognition result of the ith speech segment. When the confidence of the entity keywords in the recognition result of the ith speech segment is not less than the confidence threshold, the entity keywords with confidence not less than the confidence threshold are added to the auxiliary information set. In the recognition result of the ith speech segment, the entity keywords with confidence less than the confidence threshold are marked to obtain the first text to be corrected corresponding to the recognition result of the ith speech segment, and the first text to be corrected is added to the text set to be corrected.
[0063] like Figure 3 As shown, in the case of performing speech recognition on the i+kth speech segment, the speech of the i+kth speech segment is encoded according to the encoder to obtain the speech encoding of the i+kth speech segment. The auxiliary information set, the speech encoding of the i+kth speech segment and the text set to be corrected are input into the large language model, and the large language model can use the auxiliary information set as a prompt to more accurately decode the speech encoding of the i+kth speech segment. Since the i+kth speech segment is the speech after the i-th speech segment, according to the contextual relationship between the speech segments, the large language model can perform text correction on the text to be corrected according to the speech encoding of the i+kth speech segment to obtain the correction result. In this way, the accuracy of long speech recognition can be prompted by the auxiliary information set.
[0064] After the auxiliary information set, the speech code of the i+kth speech segment and the set of texts to be corrected are input into the large language model, the large language model can first use the auxiliary information set as a prompt, decode the speech code of the i+kth speech segment according to each entity keyword in the auxiliary information set, and obtain the recognition result of the i+kth speech segment. Then, the large language model performs text correction on the annotated entity keywords in each text to be corrected according to the speech code of the i+kth speech segment and the recognition result of the i+kth speech segment, and obtains the correction results corresponding to each text to be corrected.
[0065] Furthermore, if the recognition result of the i+kth speech segment is the output of the large language model, the confidence of the entity keywords in the recognition result of the i+kth speech segment is further judged, and the entity keywords with a confidence not less than the confidence threshold are added to the auxiliary information set. If there are entity keywords with a confidence less than the confidence threshold in the recognition result, the recognition result of the i+kth speech segment is added to the text set to be corrected, waiting for the large language model to perform text correction.
[0066] In one embodiment, the method further comprises:
[0067] Determining, from the correction results corresponding to the first text to be corrected, the correction keywords corresponding to the annotated entity keywords in the first text to be corrected;
[0068] When the confidence of the error correction keyword is not less than the confidence threshold, the error correction keyword is added to the auxiliary information set.
[0069] Specifically, in the scenario of long speech, when performing speech recognition on the i+kth speech segment, the speech of the i+kth speech segment is encoded according to the encoder to obtain the speech encoding of the i+kth speech segment. The auxiliary information set, the speech encoding of the i+kth speech segment and the text set to be corrected are input into the large language model. The large language model can use the auxiliary information set as a prompt and decode the speech encoding of the i+kth speech segment according to each entity keyword in the auxiliary information set, so that the recognition result of the large language model is more accurate. The large language model performs text correction on the first text to be corrected according to the speech encoding of the i+kth speech segment to obtain a correction result. Since the first text to be corrected is marked with entity keywords, only the correction keywords corresponding to the entity keywords in the correction results can be extracted, and the confidence of the correction keywords can be judged to determine whether the correction is successful. The correction keywords that are successfully corrected (the confidence of the correction keywords is not less than the confidence threshold) are added to the auxiliary information set to enrich the auxiliary information, thereby improving the accuracy of the large language model in long speech recognition.
[0070] In one implementation, the auxiliary information set, the speech encoding of the i+kth speech segment, and the to-be-corrected text set are input into a large language model, so that the large language model decodes the speech encoding of the i+kth speech segment based on the auxiliary information set, and performs entity keyword correction on the to-be-corrected text in the to-be-corrected text set, including:
[0071] Generate a task prompt instruction including the auxiliary information set, the speech code of the i+kth speech segment, the set of texts to be corrected, a description text of the first task, and a description text of the second task; wherein the first task is used to decode the speech code of the i+kth speech segment based on the auxiliary information set, and the second task is used to perform entity keyword correction on the texts to be corrected in the set of texts to be corrected based on the auxiliary information set;
[0072] The task prompt instruction is input into the large language model so that the large language model performs the first task and the second task.
[0073] Exemplarily, the first task represents a speech recognition task, and the second task represents a text error correction task. The task prompt instruction is used to prompt the task to be performed by the large language model. Furthermore, when generating the task prompt instruction, each entity keyword in the auxiliary information set can be directly used, and each entity keyword in the auxiliary information set can be encoded first, and the task prompt instruction is generated using the encoding of each auxiliary information.
[0074] Specifically, the i+kth speech segment is first encoded according to the encoder to obtain the speech encoding of the i+kth speech segment. Then the description text of the first task and the description text of the second task are determined. For example, the description text of the first task can be based on the auxiliary information set to decode the speech encoding of the i+kth speech segment, and the description text of the second task can be based on the auxiliary information set to correct the entity keywords marked in the text to be corrected in the text set to be corrected. Then the auxiliary information set, the speech encoding of the i+kth speech segment, the text set to be corrected, the description text of the first task and the description text of the second task are spliced to generate a task prompt instruction. Then the generated task prompt instruction is input into the large language model, and the large language model can first decode the speech encoding of the i+kth speech segment according to each entity keyword in the auxiliary information set to obtain the recognition result of the i+kth speech segment. Then, the large language model performs text correction on the marked entity keywords in each text to be corrected according to the speech encoding of the i+kth speech segment and the recognition result of the i+kth speech segment, and obtains the correction result corresponding to each text to be corrected. Thus, the speech recognition task and text error correction task are completed through task prompt instructions.
[0075] In one implementation, the auxiliary information set and the speech code of the i+kth speech segment are input into a large language model, so that the large language model decodes the speech code of the i+kth speech segment based on the auxiliary information set, including:
[0076] Encoding entity keywords in the auxiliary information set to obtain keyword codes;
[0077] The keyword code and the speech code of the i+kth speech segment are input into the large language model, so that the large language model can fuse the entity keyword code with the speech code of the i+kth speech segment during the decoding process, and decode the fused code to obtain the recognition result of the i+kth speech segment.
[0078] Exemplarily, the entity keyword and the i+kth speech segment in the auxiliary information set are respectively encoded by an encoder to obtain the keyword code and the speech code of the i+kth speech segment. The keyword code and the speech code of the i+kth speech segment are input into the large language model, and the hidden layer representation corresponding to the speech code of the i+kth speech segment is fused with the keyword code in the large language model, and the fused code is decoded to obtain the recognition result of the i+kth speech segment.
[0079] Specifically, the middle layer of the large language model implements a cross-attention mechanism to allow the hidden layer representation of the middle layer of the large language model to interact with the keyword representation. For example, when adding a keyword classification task to the large language model, the keyword encoding obtained by the hidden layer performing the task is fused to the representation of the i+kth speech segment obtained by the hidden layer performing the i+kth speech segment recognition task, and then the fused encoding is decoded to obtain the recognition result of the i+1th speech segment.
[0080] In one implementation, inputting the task prompt instruction into the large language model so that the large language model performs the first task includes:
[0081] The task prompt instruction is input into the large language model so that the large language model determines the auxiliary information related to the i+kth speech segment from the auxiliary information set based on the pronunciation similarity and / or topic relevance between the entity keywords in the auxiliary information set and the i+kth speech segment, and decodes the speech encoding of the i+kth speech segment based on the relevant auxiliary information.
[0082] Exemplarily, the auxiliary information related to the i+kth speech segment may be an entity keyword whose pronunciation similarity with the i+kth speech segment in the auxiliary information set is higher than a preset similarity threshold; it may also be an entity keyword whose subject relevance with the i+kth speech segment in the auxiliary information set is higher than a preset relevance threshold; it may also be an entity keyword whose subject relevance with the i+kth speech segment in the auxiliary information set is higher than a preset relevance threshold and whose pronunciation similarity is higher than a preset similarity threshold. The preset relevance threshold and the preset similarity threshold are set according to actual conditions and are not limited here. The subject relevance is generally judged by the field, for example, the speech segment and the entity keyword belong to the same medical field, etc.
[0083] Optionally, the description text of the first task may be set to be based on the pronunciation similarity and / or topic relevance between the entity keywords in the auxiliary information set and the i+kth speech segment, the auxiliary information related to the i+kth speech segment is determined from the auxiliary information set, and the speech encoding of the i+kth speech segment is decoded based on the relevant auxiliary information. Since the task prompt instruction includes the description text of the first task, the large language model can judge the pronunciation similarity and / or topic relevance of the entity keywords in the auxiliary information set according to the task prompt instruction to determine the auxiliary information related to the i+kth speech segment, thereby completing the decoding of the speech encoding of the i+kth speech segment.
[0084] Furthermore, it is impossible to accurately determine the pronunciation similarity and / or topic relevance between the speech coding and the entity keywords in the auxiliary information set by relying solely on the capabilities of the large language model itself.
[0085] Therefore, pronunciation similarity recognition tasks and topic relevance recognition tasks are added to the large language model in advance, so that the large language model can filter out entity keywords that are similar in pronunciation and / or related in topic to the current speech segment from the auxiliary information set through pronunciation similarity and topic relevance, as auxiliary information related to the current speech segment, and then perform speech recognition on the current speech segment based on the auxiliary information related to the current speech segment.
[0086] For the pronunciation similarity recognition task, the specific training implementation process is as follows: obtain a large number of speech segment samples, randomly extract entity keyword samples, and if the entity keyword sample is similar to each speech segment sample in pronunciation, the label is 1, if the pronunciation is not similar, the label is 0. Randomly extract entity keywords and speech segment samples to let the large language model perform the pronunciation similarity recognition task, determine the loss of the large language model through the pronunciation similarity recognition results and labels, and optimize the large language model based on the loss so that the large language model can accurately recognize entity keywords that are similar to the pronunciation of the speech segment.
[0087] For the topic relevance recognition task, the specific training implementation process is as follows: obtain a large number of speech segment samples, randomly extract entity keyword samples, and if the entity keyword sample is related to the topic of each speech segment sample, the label is 1, if the topic is not related, the label is 0. Randomly extract entity keywords and speech segment samples to let the large language model perform the topic relevance recognition task, determine the loss of the large language model through the recognition results and labels of the topic relevance, and optimize the large language model based on the loss so that the large language model can accurately identify entity keywords related to the speech sample topic.
[0088] In this embodiment, when the confidence of the entity keyword in the recognition result of the i-th speech segment is not less than the confidence threshold, the entity keyword with a confidence not less than the confidence threshold is added to the auxiliary information set. The auxiliary information set, the speech code of the i+k-th speech segment, the text set to be corrected, the description text of the first task, and the description text of the second task are spliced to generate a task prompt instruction. The task prompt instruction is input into the large language model, and the large language model determines the entity keyword whose topic relevance to the i+k-th speech segment is higher than the preset relevance threshold and the pronunciation similarity is higher than the preset similarity threshold in the auxiliary information set as the relevant auxiliary information. The speech code of the i+k-th speech segment is decoded according to the relevant auxiliary information to obtain the recognition result of the i+k-th speech segment. It is ensured that the auxiliary information set contains all entity keywords related to the current speech segment, and irrelevant historical auxiliary information is avoided from being applied to the recognition of subsequent speech, so as to improve the accuracy of long speech recognition. Then, the large language model performs text correction on the annotated entity keywords in each text to be corrected based on the speech coding of the i+kth speech segment and the recognition result of the i+kth speech segment, and obtains the correction results corresponding to each text to be corrected. Thus, the speech recognition task and the text correction task are completed through the task prompt instructions.
[0089] In one embodiment, it is characterized in that before the auxiliary information set, the speech encoding of the i+kth speech segment and the set of texts to be corrected are input into the large language model, the method further comprises:
[0090] Determining the correlation between the entity keyword in the auxiliary information set and the speech encoding of the i+kth speech segment;
[0091] Based on the correlation between the entity keywords in the auxiliary information set and the speech coding of the i+kth speech segment, the entity keywords whose correlation with the speech coding of the i+kth speech segment is less than a set correlation threshold are removed from the auxiliary information set.
[0092] Exemplarily, the correlation between the entity keyword and the speech encoding of the i+kth speech segment can be determined by comparing the semantic or grammatical similarity between the two texts, and the correlation can be specifically calculated using cosine similarity, word embedding model, etc. The setting of the correlation threshold is set according to the actual situation and is not limited here.
[0093] Specifically, when the confidence of the entity keyword in the recognition result of the i-th speech segment is not less than the confidence threshold, the entity keyword with a confidence not less than the confidence threshold is added to the auxiliary information set, and the entity keyword in the auxiliary information set is encoded by an encoder to obtain a keyword code; wherein the keyword code can be at the phone level, character level or word level. The i+k-th speech segment is encoded by the encoder to obtain the speech code of the i+k-th speech segment. The correlation between the keyword code and the speech code of the i+k-th speech segment is calculated, and the entity keywords with a correlation less than the set correlation threshold are removed from the auxiliary information set. The auxiliary information set after the removal process is used as the prompt of the large language model to ensure that the auxiliary information set contains entity keywords related to the current speech segment, and to avoid applying irrelevant historical auxiliary information to the recognition of subsequent speech, so as to improve the accuracy of long speech recognition.
[0094] Exemplary Devices
[0095] Accordingly, Figure 4 1 is a schematic diagram of a speech recognition device according to an embodiment of the present application. In an exemplary embodiment, a speech recognition device is provided, comprising:
[0096] The marking module 410 is used to mark entity keywords whose confidence is less than a confidence threshold in the recognition result of the i-th speech segment, obtain a first text to be corrected corresponding to the recognition result of the i-th speech segment, and add the first text to be corrected to the set of texts to be corrected;
[0097] The processing module 420 is used to input the speech code of the i+kth speech segment and the set of texts to be corrected into the large language model, so that the large language model decodes the speech code of the i+kth speech segment and corrects the annotated entity keywords of the texts to be corrected in the set of texts to be corrected; wherein i and k are positive integers;
[0098] The identification module 430 is used to determine the correction result corresponding to the first text to be corrected as the updated recognition result of the i-th speech segment, and to move the first text to be corrected out of the set of texts to be corrected, when the confidence levels of the entity keywords in the correction results corresponding to the first text to be corrected are not less than the confidence threshold.
[0099] In one embodiment, when the confidence of the entity keyword in the recognition result of the i-th speech segment is not less than the confidence threshold, the entity keyword with the confidence not less than the confidence threshold is added to the auxiliary information set;
[0100] The processing module 420 includes:
[0101] The first execution module is used to input the auxiliary information set, the speech coding of the i+kth speech segment and the text set to be corrected into a large language model, so that the large language model decodes the speech coding of the i+kth speech segment based on the auxiliary information set, and performs entity keyword correction on the text to be corrected in the text set to be corrected.
[0102] In one embodiment, the device further comprises:
[0103] A detection module, configured to determine, from the correction results corresponding to the first text to be corrected, the correction keywords corresponding to the annotated entity keywords in the first text to be corrected;
[0104] The first response module is used to add the error correction keyword to the auxiliary information set when the confidence of the error correction keyword is not less than the confidence threshold.
[0105] In one implementation, the processing module 420 further includes:
[0106] A second execution module is used to input the speech code of the i+kth speech segment and the set of texts to be corrected into a large language model, so that the large language model decodes the speech code of the i+kth speech segment to obtain a recognition result of the i+kth speech segment;
[0107] The third execution module is used for the large language model to correct the annotated entity keywords of the text to be corrected in the text to be corrected set according to the i+kth speech segment and its recognition result to obtain a correction result.
[0108] In one implementation, the first execution module is further configured to:
[0109] Generate a task prompt instruction including the auxiliary information set, the speech code of the i+kth speech segment, the set of texts to be corrected, a description text of the first task, and a description text of the second task; wherein the first task is used to decode the speech code of the i+kth speech segment based on the auxiliary information set, and the second task is used to perform entity keyword correction on the texts to be corrected in the set of texts to be corrected based on the auxiliary information set;
[0110] The task prompt instruction is input into the large language model so that the large language model performs the first task and the second task.
[0111] In one implementation, the first execution module is further configured to:
[0112] Encoding entity keywords in the auxiliary information set to obtain keyword codes;
[0113] The keyword code and the speech code of the i+kth speech segment are input into the large language model, so that the large language model can fuse the entity keyword code with the speech code of the i+kth speech segment during the decoding process, and decode the fused code to obtain the recognition result of the i+kth speech segment.
[0114] In one implementation, inputting the task prompt instruction into the large language model so that the large language model performs the first task includes:
[0115] The task prompt instruction is input into the large language model so that the large language model determines the auxiliary information related to the i+kth speech segment from the auxiliary information set based on the pronunciation similarity and / or topic relevance between the entity keywords in the auxiliary information set and the i+kth speech segment, and decodes the speech encoding of the i+kth speech segment based on the relevant auxiliary information.
[0116] In one embodiment, before the first execution module, the device further includes:
[0117] A relevance determination module, used to determine the relevance between the entity keyword in the auxiliary information set and the speech code of the i+kth speech segment;
[0118] A screening module is used to remove entity keywords whose correlation with the speech coding of the i+kth speech segment is less than a set correlation threshold from the auxiliary information set based on the correlation between the entity keywords in the auxiliary information set and the speech coding of the i+kth speech segment.
[0119] 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.
[0120] The functions implemented by the above-mentioned labeling module 410, processing module 420, and identification module 430 may be implemented by the same or different processors, respectively, and the embodiments of the present application are not limited thereto.
[0121] It should be understood that the modules in the above devices can be implemented in the form of a processor calling software. For example, the device includes a processor, the processor is connected to a memory, and instructions are stored in the memory. The processor calls the instructions stored in the memory to implement any of the above methods or realize the functions of each unit of the device, wherein the processor can be a general-purpose processor, such as a CPU or a microprocessor, etc., and the memory can be a memory in the device or a memory outside the device. Alternatively, the unit in the device can be implemented in the form of a hardware circuit, and the functions of some or all units can be realized by designing the hardware circuit. The hardware circuit can be understood as one or more processors; for example, in one implementation, the hardware circuit is an ASIC, and the functions of some or all of the above units are realized by designing the logical relationship of the components in the circuit; for another example, in another implementation, the hardware circuit can be implemented by PLD, taking FPGA as an example, which can include a large number of logic gate circuits, and the connection relationship between the logic gate circuits is configured by a configuration file, so as to realize the functions of some or all of the above units. All units of the above devices can be implemented in the form of a processor calling software, or in the form of a hardware circuit, or in part by a processor calling software, and the remaining part is implemented in the form of a hardware circuit.
[0122] In an embodiment of the present application, a processor is a circuit with the ability to process signals. In one implementation, the processor may be a circuit with the ability to read and run instructions, such as a CPU, a microprocessor, a GPU, or a DSP; in another implementation, the processor may implement certain functions through the logical relationship of a hardware circuit, and the logical relationship of the hardware circuit is fixed or reconfigurable, such as a hardware circuit implemented by an ASIC or PLD, such as an FPGA. In a reconfigurable hardware circuit, the process of the processor loading a configuration document to implement the hardware circuit configuration can be understood as the process of the processor loading instructions to implement the functions of some or all of the above units. In addition, it can also be a hardware circuit designed for artificial intelligence, which can be understood as an ASIC, such as an NPU, TPU, DPU, etc.
[0123] It can be seen that each unit in the above device can be one or more processors (or processing circuits) configured to implement the above method, such as: CPU, GPU, NPU, TPU, DPU, microprocessor, DSP, ASIC, FPGA, or a combination of at least two of these processor forms.
[0124] In addition, all or part of the units in the above device can be integrated together, or can be implemented independently. In one implementation, these units are integrated together and implemented in the form of a SOC. The SOC may include at least one processor for implementing any of the above methods or implementing the functions of each unit of the device. The type of the at least one processor may be different, for example, including a CPU and an FPGA, a CPU and an artificial intelligence processor, a CPU and a GPU, etc.
[0125] Exemplary Electronic Devices
[0126] Another embodiment of the present application also provides an electronic device, see Figure 5 As shown, the device includes:
[0127] Memory 500 and processor 510;
[0128] The memory 500 is connected to the processor 510 and is used to store programs;
[0129] The processor 510 is used to implement the speech recognition method disclosed in any of the above embodiments by running the program stored in the memory 500.
[0130] Specifically, the electronic device may further include: a bus, a communication interface 520 , an input device 530 and an output device 540 .
[0131] The processor 510, the memory 500, the communication interface 520, the input device 530 and the output device 540 are connected to each other via a bus.
[0132] A bus may include a pathway that transfers information between components of a computer system.
[0133] The processor 510 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.
[0134] The processor 510 may include a main processor, and may also include a baseband chip, a modem, and the like.
[0135] The memory 500 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 500 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.
[0136] The input device 530 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.
[0137] Output device 540 may include devices that allow information to be output to a user, such as a display screen, printer, speaker, etc.
[0138] The communication interface 520 may include any transceiver-like device to communicate with other devices or communication networks, such as Ethernet, radio access network (RAN), wireless local area network (WLAN), etc. The processor 510 executes the program stored in the memory 500 and calls other devices, which can be used to implement the various steps of any speech recognition method provided in the above embodiments of the present application.
[0139] Exemplary computer program products and storage media
[0140] In addition to the above methods and devices, the embodiments of the present application may also be a computer program product, which includes computer program instructions. When the computer program instructions are executed by a processor, the processor executes each step of the speech recognition method provided in the above embodiments.
[0141] 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 also 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 a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0142] In addition, the embodiments of the present application may also be a computer-readable storage medium on which computer program instructions are stored. When the computer program instructions are executed by a processor, the processor executes each step of the speech recognition method provided in the above embodiments.
[0143] The computer readable storage medium may adopt any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may include, for example, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0144] Specifically, the specific working contents of each part of the above-mentioned electronic device, computer program product and storage medium, as well as the specific processing contents when the computer program product or the computer program on the above-mentioned storage medium is executed by the processor, can all be found in the contents of the various embodiments of the above-mentioned speech recognition method, and will not be repeated here.
[0145] 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 for the present application.
[0146] 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.
[0147] 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.
[0148] The modules and sub-modules in the devices and terminals in the various embodiments of the present application can be combined, divided and deleted according to actual needs.
[0149] 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, such as 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.
[0150] 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.
[0151] 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.
[0152] 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.
[0153] 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.
[0154] 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 "comprises", "includes" 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, an element defined by the sentence "comprises a..." does not exclude the presence of other identical elements in the process, method, article or device including the element.
[0155] 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.< / keyword>
Claims
1. A speech recognition method, characterized in that: include: In the recognition result of the i-th speech segment, entity keywords whose confidence is less than the confidence threshold are marked to obtain a first text to be corrected corresponding to the recognition result of the i-th speech segment, and the first text to be corrected is added to the set of texts to be corrected; Inputting the speech code of the i+kth speech segment and the set of texts to be corrected into the large language model, so that the large language model decodes the speech code of the i+kth speech segment and corrects the annotated entity keywords of the texts to be corrected in the set of texts to be corrected; wherein i and k are positive integers; When the confidences of the entity keywords in the correction results corresponding to the first text to be corrected are not less than the confidence threshold, the correction results corresponding to the first text to be corrected are determined as the updated recognition results of the i-th speech segment, and the first text to be corrected is removed from the set of texts to be corrected.
2. The method according to claim 1, characterized in that When the confidence of the entity keyword in the recognition result of the i-th speech segment is not less than the confidence threshold, adding the entity keyword with the confidence not less than the confidence threshold to the auxiliary information set; The step of inputting the speech code of the i+kth speech segment and the set of texts to be corrected into a large language model so that the large language model decodes the speech code of the i+kth speech segment, and correcting the texts to be corrected in the set of texts to be corrected by entity keywords comprises: The auxiliary information set, the speech encoding of the i+kth speech segment and the set of texts to be corrected are input into the large language model, so that the large language model decodes the speech encoding of the i+kth speech segment based on the auxiliary information set, and performs entity keyword correction on the texts to be corrected in the set of texts to be corrected.
3. The method according to claim 2, characterized in that The method further comprises: Determining, from the correction results corresponding to the first text to be corrected, the correction keywords corresponding to the annotated entity keywords in the first text to be corrected; When the confidence of the error correction keyword is not less than the confidence threshold, the error correction keyword is added to the auxiliary information set.
4. The method according to claim 1, characterized in that: The step of inputting the speech code of the i+kth speech segment and the set of texts to be corrected into a large language model so that the large language model decodes the speech code of the i+kth speech segment, and corrects the annotated entity keywords of the texts to be corrected in the set of texts to be corrected, comprises: Inputting the speech code of the i+kth speech segment and the set of texts to be corrected into the large language model, so that the large language model decodes the speech code of the i+kth speech segment to obtain a recognition result of the i+kth speech segment; The large language model corrects the annotated entity keywords of the text to be corrected in the text to be corrected set according to the i+kth speech segment and its recognition result to obtain a correction result.
5. The method according to claim 2, characterized in that: Inputting the auxiliary information set, the speech code of the i+kth speech segment and the to-be-corrected text set into the large language model, so that the large language model decodes the speech code of the i+kth speech segment based on the auxiliary information set, and performs entity keyword correction on the to-be-corrected text in the to-be-corrected text set, including: Generate a task prompt instruction including the auxiliary information set, the speech code of the i+kth speech segment, the set of texts to be corrected, a description text of a first task, and a description text of a second task; wherein the first task is used to decode the speech code of the i+kth speech segment based on the auxiliary information set, and the second task is used to perform entity keyword correction on the texts to be corrected in the set of texts to be corrected based on the auxiliary information set; The task prompt instruction is input into the large language model so that the large language model performs the first task and the second task.
6. The method according to claim 2, characterized in that The step of inputting the auxiliary information set and the speech code of the i+kth speech segment into the large language model so that the large language model decodes the speech code of the i+kth speech segment based on the auxiliary information set comprises: Encoding entity keywords in the auxiliary information set to obtain keyword codes; The keyword code and the speech code of the i+kth speech segment are input into the large language model, so that the large language model fuses the entity keyword code with the speech code of the i+kth speech segment during the decoding process, and decodes the fused code to obtain the recognition result of the i+kth speech segment.
7. The method according to claim 5, characterized in that Inputting the task prompt instruction into the large language model so that the large language model performs the first task includes: The task prompt instruction is input into the large language model so that the large language model determines the auxiliary information related to the i+kth speech segment from the auxiliary information set based on the pronunciation similarity and / or topic relevance between the entity keywords in the auxiliary information set and the i+kth speech segment, and decodes the speech encoding of the i+kth speech segment based on the relevant auxiliary information.
8. The method according to claim 2, characterized in that: Before inputting the auxiliary information set, the speech code of the i+kth speech segment and the to-be-corrected text set into the large language model, the method further includes: Determining the correlation between the entity keyword in the auxiliary information set and the speech encoding of the i+kth speech segment; Based on the correlation between the entity keywords in the auxiliary information set and the speech coding of the i+kth speech segment, the entity keywords whose correlation with the speech coding of the i+kth speech segment is less than a set correlation threshold are removed from the auxiliary information set.
9. A speech recognition device, characterized in that: include: A marking module is used to mark entity keywords whose confidence is less than a confidence threshold in the recognition result of the i-th speech segment, obtain a first text to be corrected corresponding to the recognition result of the i-th speech segment, and add the first text to be corrected to the set of texts to be corrected; A processing module, used for inputting the speech code of the i+kth speech segment and the set of texts to be corrected into a large language model, so that the large language model decodes the speech code of the i+kth speech segment, and corrects the annotated entity keywords of the texts to be corrected in the set of texts to be corrected; wherein i and k are positive integers; An identification module is used to determine the correction result corresponding to the first text to be corrected as the updated recognition result of the i-th speech segment and move the first text to be corrected out of the set of texts to be corrected when the confidence levels of the entity keywords in the correction results corresponding to the first text to be corrected are not less than the confidence threshold.
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 implements 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, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the speech recognition method according to any one of claims 1 to 8.
Citation Information
Cited By
Language recognition system, method and equipment combined with large language model error correction and medium
CN121306104A
