Speech recognition method and apparatus, storage medium, and electronic device
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-23
- Publication Date
- 2026-08-11
AI Technical Summary
其中,人工维护受人工主观判断会影响语音识别的准确度
[0009]本申请实施例提供的技术方案,通过根据热词库中的热词及其权重,对需要进行语音识别的待识别语音数据进行语音识别处理,得到语音识别结果,其中,语音识别结果能够指示热词及其权重与待识别语音数据之间的关联关系。之后,基于该语音识别结果指示的关联关系确定待调整热词及其权重调节系数,并基于权重调节系数更新对应待调整热词的权重,加强了待调整热词的权重与语音识别结果之间的关联,且通过语音识别结果自动更新待调整热词的权重,提高了通过热词库对待识别语音数据进行语音识别的准确度。
Smart Images

Figure CN115565526B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of natural language processing technology, specifically to a speech recognition method, device, storage medium, and electronic device. Background Technology
[0002] In speech recognition services, the recognition effect is good for common words, but the recognition accuracy may be low for certain unique words or proper nouns in a certain field.
[0003] Typically, proper nouns or unique nouns can be added to a hot word database for use in speech recognition services. However, the hot words in the database rely on manual maintenance. This manual maintenance, influenced by subjective human judgment, can affect the accuracy of speech recognition. Summary of the Invention
[0004] This application provides a speech recognition method, apparatus, storage medium, and electronic device that can improve the accuracy of speech recognition.
[0005] In a first aspect, embodiments of this application provide a speech recognition method, including: Acquire the speech data to be recognized for speech recognition; Based on the hot words and their weights in the hot word library, speech recognition processing is performed on the speech data to be recognized to obtain the speech recognition result. The hot words to be adjusted and their weight adjustment coefficients are determined based on the speech recognition results. The weights of the corresponding hot words to be adjusted are updated based on the weight adjustment coefficient.
[0006] Secondly, embodiments of this application also provide a voice recognition device, including: The data acquisition module is used to acquire the speech data to be recognized for speech recognition. The speech recognition module is used to perform speech recognition processing on the speech data to be recognized based on the hot words in the hot word library and their weights, and obtain the speech recognition result. The weight acquisition module is used to determine the hot words to be adjusted and their weight adjustment coefficients based on the speech recognition results. The hot word library update module is used to update the weight of the corresponding hot words to be adjusted according to the weight adjustment coefficient.
[0007] Thirdly, embodiments of this application also provide a computer-readable storage medium having a computer program stored thereon, which, when run on a computer, causes the computer to execute the speech recognition method provided in any embodiment of this application.
[0008] Fourthly, embodiments of this application also provide an electronic device, including a processor and a memory, the memory having a computer program, and the processor executing the speech recognition method as provided in any embodiment of this application by calling the computer program.
[0009] The technical solution provided in this application performs speech recognition processing on the speech data to be recognized based on hot words and their weights in a hot word library, obtaining a speech recognition result. The speech recognition result indicates the correlation between the hot words, their weights, and the speech data to be recognized. Then, based on the correlation indicated by the speech recognition result, the hot words to be adjusted and their weight adjustment coefficients are determined, and the weights of the corresponding hot words to be adjusted are updated based on the weight adjustment coefficients. This strengthens the correlation between the weights of the hot words to be adjusted and the speech recognition result, and automatically updates the weights of the hot words to be adjusted through the speech recognition result, improving the accuracy of speech recognition of the speech data to be recognized using the hot word library. Attached Figure Description
[0010] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0011] Figure 1 This is a schematic diagram illustrating an application scenario of the speech recognition method provided in the embodiments of this application.
[0012] Figure 2 This is a flowchart illustrating the speech recognition method provided in an embodiment of this application.
[0013] Figure 3 This is a schematic diagram illustrating the updating of the weights of hot words to be adjusted in the hot word library in the speech recognition method provided in the embodiments of this application.
[0014] Figure 4 This is a schematic diagram illustrating the updating of hot words in the hot word library in the speech recognition method provided in the embodiments of this application.
[0015] Figure 5 This is a schematic diagram illustrating the determination of the target sub-hot word library in the speech recognition method provided in the embodiments of this application.
[0016] Figure 6 This is a schematic diagram of the structure of the speech recognition device provided in the embodiments of this application.
[0017] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0018] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the protection scope of this application.
[0019] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0020] For ease of understanding, the terms used in the embodiments of this application will be explained below.
[0021] Hot words: proper nouns or unique nouns in certain fields.
[0022] Automatic Speech Recognition (ASR) is a technology that converts human speech into text.
[0023] Please see Figure 1 , Figure 1 This diagram illustrates an application scenario of the speech recognition method provided in this application. The electronic device is a mobile phone. Speech data is collected via the phone's microphone, and speech recognition processing is performed on the speech data based on a hot word database to obtain a speech recognition result. The text corresponding to the speech data can then be determined based on the speech recognition result. The electronic device then displays the text.
[0024] Understandably, the accuracy of speech data recognition is affected by the hot words and their weights in the hot word database. Therefore, this application provides a speech recognition method to improve the accuracy of speech recognition based on a hot word database. The execution entity of the speech recognition method provided in this application can be the speech recognition device provided in this application, or an electronic device integrating the speech recognition device, wherein the speech recognition device can be implemented in hardware or software. The electronic device can be a smartphone, tablet, laptop, desktop computer, smart wearable device, etc. The smart wearable device includes, but is not limited to, smartwatches, smart headphones, smart bracelets, smart glasses, etc.
[0025] Please see Figure 2 , Figure 2This is a flowchart illustrating the speech recognition method provided in an embodiment of this application. The specific flow of the speech recognition method provided in this embodiment of the application can be as follows: 101. Obtain the speech data to be recognized that needs to be recognized.
[0026] For example, electronic devices can acquire the voice data to be recognized from various sources. For instance, they can use stored voice data as the voice data to be recognized. Another example is using voice data received from an external device. Yet another example is using an external microphone built into the electronic device to collect external sound and using that external sound as the voice data to be recognized. Still another example is using an audio acquisition device connected to the electronic device to collect external sound and using that external sound as the voice data to be recognized. Whether or not voice data is used as the voice data to be recognized depends on the voice recognition requirements of the electronic device.
[0027] The speech data to be recognized can be streaming or non-streaming; no limitation is made here.
[0028] 102. Based on the hot words and their weights in the hot word library, perform speech recognition processing on the speech data to be recognized to obtain the speech recognition result.
[0029] For example, the hot words in the hot word database can be hot words obtained from web pages, hot words searched by users, or hot words manually entered by users. The hot word database can be stored locally or in the cloud, without limitation.
[0030] The hot term database includes professional terms, which are specialized terms used in a particular professional field. For example, in chemistry, professional terms might include crystals, reducing agents, oxidizing agents, and chemical bonds. In film and television, professional terms might include montage, transitions, and establishing shots. In the medical field, professional terms might include hyperthyroidism, nodules, and lesions. Understandably, there are many professional fields, and each field can have its own set of professional terms, which will not be listed here.
[0031] The hot word database also includes proper nouns, such as personal names, place names, and company names. For example, film and television proper nouns might include Hengdian World Studios, director names, actor names, and film and media company names. Medical proper nouns might include doctor names, nurse names, hospital names, and hospital addresses.
[0032] Of course, the hot word database can also include popular internet slang. Popular internet slang includes terms such as metaverse, involution, and respect.
[0033] The number and types of hot words in the hot word library are not limited here. A default number or a default number range can be set for the hot word library, and the number can be set according to actual needs.
[0034] The hot word library contains at least one hot word, and each hot word has a weight. After the speech data to be recognized is processed by speech recognition, the speech recognition result can indicate multiple candidate hot words and their corresponding recognition probability values.
[0035] 103. Determine the hot words to be adjusted and their weight adjustment coefficients based on the speech recognition results.
[0036] For example, a correspondence between speech recognition results and weight adjustment coefficients can be pre-set. Upon receiving the speech recognition results, the hot words to be adjusted and their weight adjustment coefficients can be determined based on this correspondence.
[0037] In this embodiment of the application, the recognition probability value of candidate hot words can be used as the basis for weight adjustment. Specifically, the hot words to be adjusted and their weight adjustment coefficients can be determined by the recognition probability value.
[0038] The hot words to be adjusted can be all the hot words in the hot word library or only a portion of them; this is not limited here. It should be noted that any method capable of automatically updating the weight of any hot word in the hot word library falls within the scope of protection claimed in this application.
[0039] 104. Update the weight of the corresponding hot words to be adjusted according to the weight adjustment coefficient.
[0040] Once the hot keywords to be adjusted and their weight adjustment coefficients are determined, the weights of the corresponding hot keywords to be adjusted can be updated based on the weight adjustment coefficients. The methods for updating the weights include adjusting the weights of the corresponding hot keywords based on the weight adjustment coefficients.
[0041] For example, for each hot word to be adjusted, the weight of the hot word to be adjusted can be added to or subtracted from the corresponding weight adjustment coefficient, and the result of the addition or subtraction can be used as the new weight of the hot word to be adjusted, thereby updating the weight of the hot word to be adjusted. Alternatively, the weight of the hot word to be adjusted can be multiplied or divided by the corresponding weight adjustment coefficient, and the result of the multiplication or division can be used as the new weight of the hot word to be adjusted, thereby updating the weight of the hot word to be adjusted.
[0042] To better explain the solutions provided in the embodiments of this application, a schematic diagram is provided here for illustration. Please refer to [link / reference]. Figure 3 , Figure 3This diagram illustrates the process of updating the weights of hot words to be adjusted in a hot word library using the speech recognition method provided in this application. The electronic device acquires speech data to be recognized and performs speech recognition processing on the speech data based on the hot words and their weights in the hot word library to obtain a speech recognition result. Then, based on the speech recognition result, it determines the hot words to be adjusted in the hot word library and their weight adjustment parameters. Finally, based on the weight adjustment parameters, it updates the weights of the corresponding hot words to be adjusted, obtaining new weights for the hot words to be adjusted, thus updating the weights of the hot words to be adjusted in the hot word library.
[0043] In practice, this application is not limited by the execution order of the described steps. Without causing conflicts, some steps may be performed in other orders or simultaneously.
[0044] As can be seen from the above, the speech recognition method provided in this application performs speech recognition processing on the speech data to be recognized based on the hot words and their weights in the hot word library to obtain the speech recognition result, and then updates the weights of the hot words in the hot word library based on the speech recognition result, thereby realizing the automatic updating of the weights of the hot words in the hot word library so that it can meet the real-time speech recognition requirements, thereby improving the accuracy of speech recognition.
[0045] In some embodiments, determining the hot words to be adjusted and their weight adjustment coefficients based on speech recognition results includes: Identify multiple candidate hot words indicated by the speech recognition results and their recognition probability values; If there are candidate hot words with a recognition probability value greater than the preset threshold, then the hot words to be adjusted and their weight adjustment coefficients are determined based on the recognition probability values of the candidate hot words. The recognition probability value and the weight adjustment coefficient are positively correlated.
[0046] In this embodiment, only the weights of hot words with high recognition probability values are adjusted, while the weights of hot words with low recognition probability values are not adjusted.
[0047] Specifically, the positive correlation between the recognition probability value and the weight adjustment coefficient can be linear or non-linear. For example, if the recognition probability value is 85, the corresponding weight adjustment coefficient is 1.2; if the recognition probability value is 90, the corresponding weight adjustment coefficient is 1.4; and if the recognition probability value is 99, the corresponding weight adjustment coefficient is 1.9. When updating the weight of the corresponding hot word to be adjusted based on the weight adjustment coefficient, one implementation method is to multiply the weight adjustment coefficient by the weight, and then use the product as the new weight of the corresponding hot word to be adjusted. For example, if the weight of a hot word to be adjusted is 50 and its weight adjustment coefficient is 1.4, then the new weight of the hot word to be adjusted is 50 * 1.4 = 70. Another implementation method is to add the weight adjustment coefficient to the weight, and then use the sum as the new weight of the corresponding hot word to be adjusted. For example, if the weight of a hot word to be adjusted is 66 and its weight adjustment coefficient is 1.9, then the new weight of the hot word to be adjusted is 67.9.
[0048] In some embodiments, hot words with recognition probability values not greater than a preset threshold can also be considered as hot words to be adjusted, and their corresponding weight adjustment coefficients can be obtained. These weight adjustment coefficients are either less than or equal to 1, or greater than 0 and less than or equal to 1. When updating the weights of hot words with recognition probability values not greater than the preset threshold based on the weight adjustment coefficients, the weights of the corresponding hot words to be adjusted can be updated either by multiplying the weight adjustment coefficients and the weights, or by updating the weights of the corresponding hot words to be adjusted based on the difference between the weight adjustment coefficients and the weights. It is understood that the updated weights are less than the original weights, thereby reducing the weights of hot words with low recognition probability values.
[0049] Furthermore, the weight of the hot keyword to be adjusted can be updated using a unified weight adjustment coefficient. For example, the unified weight adjustment coefficient can be set to 1, or it can be set to a value less than 1, such as 0.8, 0.9, or 0.95. It should be noted that the updated weight will either be the same as or less than the original weight.
[0050] In some embodiments, if there is no recognition probability value greater than a preset threshold, then a second speech recognition process is performed on the speech data to be recognized based on the hot words in the hot word library and their weights to obtain a speech recognition result; it is determined whether there are any predicted probability values greater than a preset threshold among the candidate hot words indicated by the speech recognition result; until a preset number of times is reached, if there is still no recognition probability value greater than the preset threshold, then speech recognition processing is performed on the speech data to be recognized based on a conventional corpus to obtain a speech recognition result.
[0051] The preset number of times can be positive integers such as 2, 3, 4, etc., depending on the actual needs.
[0052] In this embodiment, the decision to use a hot word library is based on the speech recognition results, which avoids recognition errors in the speech data to be recognized and helps to improve the accuracy of speech recognition.
[0053] In some embodiments, determining the hot words to be adjusted and their weight adjustment coefficients based on speech recognition results includes: Identify multiple candidate hot words indicated by the speech recognition results and their recognition probability values; The candidate hot words with the highest identification probability values are selected as the hot words to be adjusted, and the weight adjustment parameters of the hot words to be adjusted are determined.
[0054] In this embodiment, only the weight of the hot word with the highest recognition probability value is updated, and the update method is as mentioned above. It can be understood that the weight of the hot word to be adjusted after the update is greater than the weight of the hot word to be adjusted before the update. The weights of other hot words remain unchanged.
[0055] In some embodiments, after updating the weights of the hot words to be adjusted, the method further includes: The frequency of each hot word within a preset period is statistically analyzed, and the hot words to be adjusted and their weight adjustment coefficients are determined based on the word frequency. The weights of the corresponding hot words to be adjusted are updated based on the weight adjustment coefficient.
[0056] In this study, word frequency is positively correlated with the weight adjustment coefficient; the higher the word frequency, the greater the weight of the adjusted hot word after the update. Alternatively, a preset threshold can be set to identify hot words with frequencies higher than this threshold as hot words to be adjusted. The weight adjustment coefficient for these hot words can then be determined based on their word frequency, and the weight of the hot words can be updated according to this coefficient, ensuring that the updated weight is greater than the original weight. Since there are multiple implementation methods, they will not be listed here.
[0057] For example, the frequency of each hot word can be counted by acquiring speech recognition records. Each time an electronic device performs speech recognition processing on a piece of speech data to be recognized, a speech recognition record is formed. By counting the frequency of each hot word in multiple records and adjusting the weight of the hot words based on the frequency, the adjusted weights can be adapted to user habits, achieving personalized customization for the user and providing targeted speech recognition services.
[0058] Understandably, the basis for updating the weight of hot words is not limited to word frequency. The weight can also be adjusted based on the hot word's popularity or its decay rate. The methods for adjusting the weight are as mentioned in the above embodiments and will not be repeated here. It should be noted that when the word frequency of a hot word is higher, the updated weight of that hot word is greater than the original weight, and the increase in weight is positively correlated with the word frequency. When the decay rate of a hot word is higher, the updated weight of that hot word is less than the original weight, and the decrease in weight is positively correlated with the decay rate.
[0059] In some embodiments, after updating the weight of the corresponding hot word to be adjusted according to the weight adjustment coefficient, the method further includes: Get the list of hot word replacements; Update the hot words in the hot word library based on the hot word replacement list and the hot words and their weights in the hot word library.
[0060] The hot word replacement list is obtained by crawling and analyzing web data. The analysis of the web data is based on factors including, but not limited to, popularity scores, word frequencies, and duration of popularity. Specifically, the top-ranking hot words based on popularity scores, word frequencies, or popularity are added to the hot word replacement list.
[0061] Please see Figure 4 , Figure 4 This diagram illustrates the updating of hot words in the hot word library in the speech recognition method provided in this application embodiment. When updating the hot words in the hot word library, the weight of each hot word in the library can be analyzed to determine the hot words that need to be removed, and then the hot words in the library can be removed. Alternatively, the weight of each hot word in the library can be analyzed, the hot word library can be compared with a hot word replacement list, and based on the comparison results, hot words that need to be added can be determined from the hot word replacement list, and non-duplicate hot words can be added to the hot word library. This achieves the updating of hot words in the hot word library.
[0062] For example, a removal condition can be set, meaning that if a hot word with a weight that meets the removal condition exists, then that hot word is removed from the hot word database. The removal condition includes, but is not limited to: a weight less than a first preset threshold, a weight that has not been updated within a preset period, or a minimum weight. For instance, hot words with weights less than the first preset threshold are removed from the hot word database, hot words whose weights have not been updated within the preset period are removed, and hot words with the minimum weight are removed.
[0063] For example, an addition condition can be set. When a hot word with a weight that meets the addition condition exists, multiple candidate hot words are selected from the hot word replacement list based on that hot word. The hot words among these candidate hot words that do not overlap with those in the hot word library are then added to the hot word library. The addition condition includes, but is not limited to: the maximum weight in the hot word library being less than a second preset threshold, and the weights of more than a preset number of hot words in the hot word library not being updated within a preset period. For instance, if the maximum weight in the hot word library is less than the second preset threshold, multiple hot words with weights not less than the preset threshold are selected from the hot word replacement list as candidate hot words to filter out duplicates before being added to the hot word library. As another example, if the number of hot words in the hot word library whose weights have not been updated within a preset period is greater than a preset number, multiple hot words are selected from the hot word replacement list in order of arrangement as candidate hot words to filter out duplicates before being added to the hot word library.
[0064] Furthermore, each time a hot word is removed from the hot word database, a hot word is selected from the hot word replacement list and added back to the database. This achieves a dynamic balance in the number of hot words in the database.
[0065] Understandably, this embodiment does not limit the number of hot words removed from the hot word library, nor the number of hot words selected from the hot word replacement list to be added to the hot word library; the number can be determined according to actual needs.
[0066] In some embodiments, the hot words in the hot word library can also be updated based on popularity values. Updating the hot words in the hot word library according to the hot word replacement list and the hot words and their weights includes: Update the hot words in the hot word library based on the hot word replacement list and the hot words in the hot word library, as well as their weights and popularity values.
[0067] In this embodiment, the popularity value of each hot word is first determined, and then the position of the maximum popularity value in the hot word replacement table is checked. If the maximum popularity value in the hot word library is not the maximum popularity value in the hot word replacement table, then it is determined that hot words in the hot word replacement table with a higher maximum popularity value than the maximum popularity value in the hot word library need to be added to the hot word library. If there are hot words in the hot word library with popularity values lower than the popularity threshold, then it is determined whether the weight of the hot word is less than the preset weight. If yes, then the hot word is removed from the hot word library; otherwise, the hot word is not removed.
[0068] This embodiment combines popularity value and weight to determine the update method of the hot word library, so that the popularity value of hot words in the hot word library can be maintained at a certain high level. This allows the hot words in the speech data to be recognized to be identified more accurately and converted into text when the speech data to be recognized is processed using the hot word library.
[0069] In some embodiments, the hot words in the hot word library can also be updated based on word frequency. Updating the hot words in the hot word library according to the hot word replacement list and the hot words and their weights includes: Update the hot words in the hot word library based on the hot word replacement list, the hot words in the hot word library, their weights, and their frequencies.
[0070] In this embodiment, when updating the hot words in the hot word library by combining word frequency, the word frequency can be obtained from the Internet or obtained by statistically analyzing the historical records on the electronic device.
[0071] First, it can be determined whether the highest frequency word in the hot word library is the same as the highest frequency word in the hot word replacement table. If not, hot words with a frequency greater than the highest frequency word in the hot word library are added to the hot word library. If the frequency of a hot word in the hot word library is less than a preset frequency, it can be determined whether its weight is less than a preset weight. If so, the hot word is removed from the hot word library; otherwise, it is not removed.
[0072] This embodiment determines the update method for the hot word database by combining word frequency and weight. If word frequency obtained from the internet is used, the updated hot word database can be used by most users and is easy to promote. If word frequency is calculated from historical records, personalized updates to the hot word database can be achieved, flexibly changing the hot words in the hot word database used by electronic devices, which conforms to user habits.
[0073] In some embodiments, speech recognition processing is performed on the speech data to be recognized based on hot words in a hot word library and their weights to obtain speech recognition results, including: The speech data to be recognized is processed for scene recognition to obtain the scene recognition result; Based on the hot words and their weights in the target sub-hot word library of the corresponding scene recognition results, speech recognition processing is performed on the speech data to be recognized to obtain the speech recognition results.
[0074] In this embodiment, the hot word library includes multiple domain sub-hot word libraries. Before performing speech recognition, a target sub-hot word library is selected from the multiple domain sub-hot word libraries. Then, based on the hot words and their weights in the target sub-hot word library, speech recognition processing is performed on the speech data to be recognized to obtain the speech recognition result.
[0075] The sub-keyword libraries are divided by domain, such as healthcare, film and television, sports, driving, banking, and tourism. The specific domain used can be selected based on actual needs.
[0076] For example, a pre-trained scene recognition model can be used to identify the usage scenario of the speech data to be recognized, thereby obtaining the scene recognition result. The scene recognition model can be an expert scoring and rating model, an event-driven model, etc. The pre-trained scene recognition model can predict multiple candidate usage scenarios and their probability values relative to the speech data to be recognized, and then select the candidate usage scenario with the highest probability value as the target usage scenario.
[0077] This system pre-sets a correspondence between usage scenarios and domains. Once the target usage scenario indicated by the voice data to be recognized is determined, the corresponding domain can be identified based on this correspondence. Then, the corresponding target sub-domain is searched from the hot word library based on the domain. Usage scenarios could be, for example, driving scenarios, medical scenarios, or audio-visual scenarios. The correspondence between usage scenarios and domains is illustrated here; for instance, a driving scenario can be associated with the driving domain.
[0078] In this embodiment, by setting up multiple domain sub-hot word libraries and by identifying the usage scenario of the speech data to be recognized, a sub-hot word library of a specific domain can be obtained as the target sub-hot word library, thereby reducing the amount of computation and improving the efficiency of speech recognition. At the same time, based on the accurately selected target sub-hot word library, it is also beneficial to improve the accuracy of speech recognition.
[0079] In some embodiments, before obtaining the speech recognition result, speech recognition processing is performed on the speech data to be recognized based on the hot words and their weights in the target sub-hot word library of the corresponding scene recognition result, and the process further includes: Based on web crawling, hot words from multiple fields are crawled, and sub-hot word libraries for multiple fields are created respectively. Based on the hot words and their weights in the target sub-hot word library of the corresponding scene recognition results, speech recognition processing is performed on the speech data to be recognized to obtain the speech recognition results, including: Obtain multiple candidate use scenarios and their probability values as indicated by the scene recognition results; When there is a candidate use scenario with a probability value greater than a preset probability threshold among multiple candidate use scenarios, the candidate use scenario with the highest probability value among multiple candidate use scenarios is determined as the target use scenario; A target sub-hot word library matching the target usage scenario is determined from sub-hot word libraries in multiple fields; Based on the hot words and their weights in the target sub-hot word library, speech recognition processing is performed on the speech data to be recognized to obtain the speech recognition result.
[0080] In this embodiment, data is first crawled from the web to obtain a hot word library, and then the hot words in the hot word library are divided according to the domain to form multiple sub-hot word libraries for different domains.
[0081] The crawling network can be a web crawler network. When crawling data, it can crawl data from the entire network or all fields to analyze hot words from the crawled data. When creating sub-hot word libraries for multiple fields, multiple sub-hot word libraries can be divided according to the fields to which the crawled hot words belong, or multiple fields can be set in advance to assign matching hot words to the corresponding sub-hot word libraries.
[0082] For example, when determining the target sub-hot word library based on the scene recognition results, the multiple candidate usage scenarios indicated by the scene recognition results and their scene probability values are first analyzed. The candidate usage scenarios are a subset of usage scenarios recalled from multiple preset usage scenarios based on a pre-trained scene recognition model. Each candidate usage scenario is labeled with a scene probability value, which is the predicted probability value that the speech data to be recognized belongs to that usage scenario, as predicted by the scene recognition model. After obtaining the scene prediction probability value for each candidate usage scenario, it is determined whether there are any candidate usage scenarios among the multiple candidate usage scenarios whose scene prediction probability value is greater than a preset probability threshold. If so, it indicates that there are candidate usage scenarios with high scene prediction probability values among the multiple candidate usage scenarios. Then, the candidate usage scenario with the highest preset scene probability value is selected as the target usage scenario.
[0083] Once the target usage scenario is determined, a target sub-keyword library that matches the target usage scenario can be selected from multiple domain sub-keyword libraries.
[0084] In this embodiment, by analyzing the scene probability value of each candidate use scenario indicated by the scene recognition result, only when there are one or more candidate use scenarios with a higher scene probability value among multiple candidate use scenarios, is one selected from multiple domain sub-hot word libraries as the target sub-hot word library. This improves the accuracy of selecting the target sub-hot word library and indirectly improves the recognition accuracy of the speech data to be recognized.
[0085] In some embodiments, after obtaining multiple candidate use scenarios indicated by the scene recognition results and their scene probability values, the method further includes: When there are no candidate use scenarios with a probability value greater than a preset probability threshold among multiple candidate use scenarios, the general sub-hot word library is determined as the target sub-hot word library. Based on the hot words and their weights in the target sub-hot word library, speech recognition processing is performed on the speech data to be recognized to obtain the speech recognition result.
[0086] In this embodiment, the hot word library also includes a general sub-hot word library, which is not domain-specific and can be applied to various domains, or other domains besides those specific domains. The general sub-hot word library can also be obtained by crawling network data as described above.
[0087] When none of the candidate usage scenarios have a probability value greater than a preset probability threshold, it indicates that the probability values of all candidate usage scenarios are low. In this case, selecting a general sub-hot word library as the target sub-hot word library avoids the impact of domain division on the speech recognition effect of the speech data to be recognized, thus improving the accuracy of speech recognition. Understandably, when the candidate hot words and their recognition probability values in the general sub-hot word library are also low, speech recognition processing can also be performed on the speech data to be recognized based on a general corpus.
[0088] As above, please refer to Figure 5 , Figure 5 This diagram illustrates the determination of a target sub-hot word library in the speech recognition method provided in this application. The hot word library includes sub-hot word libraries from multiple domains and a general sub-hot word library. In this diagram, the sub-hot word libraries from multiple domains are represented by sub-hot word libraries from the medical field, the film and television field, and the driving field, respectively (but are not limited to the diagram and may include sub-hot word libraries from more fields). First, scene recognition processing is performed on the speech data to be recognized to obtain scene recognition processing results. Then, based on the multiple candidate usage scenarios and their probability values indicated by the scene recognition processing results, it is determined whether there are candidate usage scenarios with a probability value greater than a preset probability threshold. If so, the candidate usage scenario with the highest probability value among the multiple candidate usage scenarios is determined as the target usage scenario, and the target sub-hot word library is determined from the sub-hot word libraries from multiple domains based on the target usage scenario. If not, the general sub-hot word library is determined as the target sub-hot word library.
[0089] In some embodiments, speech recognition processing is performed on the speech data to be recognized based on hot words in a hot word library and their weights to obtain speech recognition results, including: Obtain a pre-trained first language model; Based on the first language model and the hot words and their weights in the hot word library, speech recognition processing is performed on the speech data to be recognized to obtain the speech recognition result.
[0090] In this embodiment, a pre-trained first language model can be used to perform speech recognition processing on the speech data to be recognized. This speech recognition method is also called end-to-end speech recognition. The first language model is an end-to-end language model, such as the Conformer model, the CTC model (Connectionist temporal classification), the Transducer model (an autoregressive model), the Attention model (an attention model), etc.
[0091] When performing speech recognition processing on the speech data to be recognized using a first language model and a hot word library, the predicted probability value of each hot word in the hot word library is predicted in the speech data to be recognized. Then, some candidate hot words are recalled from the hot word library, and each candidate hot word is labeled with a predicted probability value. Finally, the candidate hot word with the highest predicted probability value is taken as the speech recognition result.
[0092] The weight of each hot word represents its importance and is positively correlated with its prediction probability; the higher the weight, the higher the prediction probability. Therefore, by automatically updating the weight of each hot word and using the new weight in the model prediction, the prediction results are made more accurate.
[0093] In some embodiments, speech recognition processing is performed on the speech data to be recognized based on hot words in a hot word library and their weights to obtain speech recognition results, including: A pre-trained acoustic model is obtained, and the speech data to be recognized is input into the acoustic model for decoding to obtain acoustic feature parameters; A pre-trained second language model is obtained, and based on the second language model and the hot words and their weights in the hot word library, the acoustic feature parameters are processed for speech recognition to obtain the speech recognition result.
[0094] In this embodiment, speech recognition processing can be performed on the speech data to be recognized in a non-end-to-end manner. First, an acoustic model is used to process the speech data to obtain acoustic feature parameters. The acoustic model decomposes the speech data into a set of phonemes, and the acoustic feature parameters may include the phoneme set. Alternatively, the acoustic model can also decompose the speech data into a set of words. Then, a second language model and a hot word library are used to perform speech recognition processing on the acoustic feature parameters. The second language model can match the hot words to be adjusted corresponding to each acoustic feature parameter from the hot word library, and then generate the text corresponding to the speech data to be recognized based on the matched hot words.
[0095] Among them, acoustic models include gmm-hmm models (Gaussian mixture-hidden Markov models) and DNN models (deep neural network models). Second language models include LSTM models (long short-term memory networks) and chain models (a type of sequence discrimination training model).
[0096] As mentioned above, for the first language model or the second language model, the hot word library used can be the target sub-hot word library mentioned in the above embodiments, and the hot words and their weights in the target sub-hot word library can be the latest hot words and their weights.
[0097] After performing speech recognition processing on the speech data to be recognized using the first language model and the second language model, the hot words or their weights in the target sub-hot word library can be updated based on the speech recognition results. Furthermore, the hot word replacement list can be crawled at a preset period to update the hot words or their weights in any sub-hot word library. For specific implementation methods, please refer to the content mentioned above, which will not be repeated here.
[0098] As can be seen from the above, the speech recognition method proposed in this embodiment of the invention automatically updates the hot words or their weights in the hot word library based on the recognition results of the speech data to be recognized. This ensures that the hot words and their weights in any sub-hot word library included in the hot word library can adapt to the current speech recognition requirements, thereby accurately utilizing the hot words and their weights in the sub-hot word libraries to perform speech recognition processing on the speech data to be recognized, greatly improving the accuracy of speech recognition. Furthermore, under the premise of identifying the usage scenario of the speech data to be recognized, a corresponding target sub-hot word library is matched for it, thereby improving the efficiency of speech recognition.
[0099] In one embodiment, a voice recognition device is also provided. See also... Figure 6 , Figure 6 This is a schematic diagram of the structure of a voice recognition device 200 provided in an embodiment of this application. The voice recognition device 200 is applied to an electronic device and includes: Data acquisition module 201 is used to acquire speech data to be recognized for speech recognition. The speech recognition module 202 is used to perform speech recognition processing on the speech data to be recognized based on the hot words in the hot word library and their weights, and obtain the speech recognition result. The weight adjustment coefficient acquisition module 203 is used to determine the hot words to be adjusted and their weight adjustment coefficients based on the speech recognition results. The hot word library update module 204 is used to update the weight of the corresponding hot words to be adjusted according to the weight adjustment coefficient.
[0100] In some embodiments, the speech recognition module 202 is further configured to: The speech data to be recognized is processed for scene recognition to obtain the scene recognition result; Based on the hot words and their weights in the target sub-hot word library of the corresponding scene recognition results, speech recognition processing is performed on the speech data to be recognized to obtain the speech recognition results.
[0101] In some embodiments, the hot word library includes sub-hot word libraries for multiple domains; based on the hot words and their weights in the target sub-hot word library of the corresponding scene recognition result, speech recognition processing is performed on the speech data to be recognized. Before obtaining the speech recognition result, the hot word library update module 204 is further configured to: Based on web crawling, hot words from multiple fields are crawled, and sub-hot word libraries for multiple fields are created respectively. The speech recognition module 202 is also used for: Obtain multiple candidate use scenarios and their probability values as indicated by the scene recognition results; When there is a candidate use scenario with a probability value greater than a preset probability threshold among multiple candidate use scenarios, the candidate use scenario with the highest probability value among multiple candidate use scenarios is determined as the target use scenario; A target sub-hot word library matching the target usage scenario is determined from sub-hot word libraries in multiple fields; Based on the hot words and their weights in the target sub-hot word library, speech recognition processing is performed on the speech data to be recognized to obtain the speech recognition result.
[0102] In some embodiments, the hot word library further includes a general sub-hot word library; the speech recognition module 202 is also used for: When there are no candidate use scenarios with a probability value greater than a preset probability threshold among multiple candidate use scenarios, the general sub-hot word library is determined as the target sub-hot word library. Based on the hot words and their weights in the target sub-hot word library, speech recognition processing is performed on the speech data to be recognized to obtain the speech recognition result.
[0103] In some embodiments, the speech recognition module 202 is further configured to: Obtain a pre-trained first language model; Based on the first language model and the hot words and their weights in the hot word library, speech recognition processing is performed on the speech data to be recognized to obtain the speech recognition result.
[0104] In some embodiments, the speech recognition module 202 is further configured to: A pre-trained acoustic model is obtained, and the speech data to be recognized is input into the acoustic model for decoding to obtain acoustic feature parameters; A pre-trained second language model is obtained, and based on the second language model and the hot words and their weights in the hot word library, the acoustic feature parameters are processed for speech recognition to obtain the speech recognition result.
[0105] In some embodiments, after updating the weights of the corresponding hot words to be adjusted according to the weight adjustment coefficients, the hot word library update module 204 is further configured to: Get the list of hot word replacements; Update the hot words in the hot word library based on the hot word replacement list and the hot words and their weights in the hot word library.
[0106] It should be noted that the speech recognition device 200 provided in this application embodiment belongs to the same concept as the speech recognition method in the above embodiment. The speech recognition device 200 can implement any of the methods provided in the speech recognition method embodiment. For details of its implementation process, please refer to the speech recognition method embodiment, which will not be repeated here.
[0107] As can be seen from the above, the speech recognition device 200 proposed in this application automatically updates the hot words or their weights in the hot word library based on the recognition result of the speech data to be recognized. This ensures that the hot words and their weights in any sub-hot word library included in the hot word library can adapt to the current speech recognition requirements, thereby accurately utilizing the hot words and their weights in the sub-hot word library to perform speech recognition processing on the speech data to be recognized, greatly improving the accuracy of speech recognition. Furthermore, under the premise of recognizing the usage scenario of the speech data to be recognized, it matches a corresponding target sub-hot word library for it, thereby improving the efficiency of speech recognition.
[0108] This application also provides an electronic device, which can be a smartphone, tablet, laptop, desktop computer, smart wearable device, etc. The smart wearable device includes, but is not limited to, smartwatches, smart earphones, smart bracelets, smart glasses, etc. Figure 7 As shown, Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. The electronic device 300 includes a processor 301 with one or more processing cores, a memory 302 with one or more computer-readable storage media, and a computer program stored in the memory 302 and executable on the processor. The processor 301 and the memory 302 are electrically connected. Those skilled in the art will understand that the electronic device structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0109] The processor 301 is the control center of the electronic device 300. It connects various parts of the electronic device 300 through various interfaces and lines. By running or loading software programs and / or modules stored in the memory 302, and calling data stored in the memory 302, it performs various functions of the electronic device 300 and processes data, thereby monitoring the electronic device 300 as a whole.
[0110] In this embodiment, the processor 301 in the electronic device 300 loads the instructions corresponding to the processes of one or more applications into the memory 302 according to the following steps, and the processor 301 runs the applications stored in the memory 302 to realize various functions: Acquire the speech data to be recognized for speech recognition; Based on the hot words and their weights in the hot word library, speech recognition processing is performed on the speech data to be recognized to obtain the speech recognition result. The hot words to be adjusted and their weight adjustment coefficients are determined based on the speech recognition results. The weights of the corresponding hot words to be adjusted are updated based on the weight adjustment coefficient.
[0111] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.
[0112] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0113] As can be seen from the above, the electronic device provided in this embodiment automatically updates the hot words or their weights in the hot word library based on the recognition results of the speech data to be recognized. This ensures that the hot words and their weights in any sub-hot word library included in the hot word library can adapt to the current speech recognition requirements, thereby accurately utilizing the hot words and their weights in the sub-hot word libraries to perform speech recognition processing on the speech data to be recognized, greatly improving the accuracy of speech recognition. Furthermore, under the premise of recognizing the usage scenario of the speech data to be recognized, it matches a corresponding target sub-hot word library, thereby improving the efficiency of speech recognition.
[0114] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0115] Therefore, embodiments of this application provide a computer-readable storage medium storing a plurality of computer programs that can be loaded by a processor to execute the steps of any of the speech recognition methods provided in embodiments of this application. For example, the computer program can execute the following steps: Acquire the speech data to be recognized for speech recognition; Based on the hot words and their weights in the hot word library, speech recognition processing is performed on the speech data to be recognized to obtain the speech recognition result. The hot words to be adjusted and their weight adjustment coefficients are determined based on the speech recognition results. The weights of the corresponding hot words to be adjusted are updated based on the weight adjustment coefficient.
[0116] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.
[0117] The storage medium may include: read-only memory (ROM), random access memory (RAM), disk, or optical disk, etc. Since the computer program stored in the storage medium can execute the steps of any of the speech recognition methods provided in the embodiments of this application, it can achieve the beneficial effects that any of the speech recognition methods provided in the embodiments of this application can achieve, as detailed in the preceding embodiments, and will not be repeated here.
[0118] The above provides a detailed description of a speech recognition method, apparatus, medium, and electronic device provided in the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A speech recognition method, characterized in that, include: Acquire the speech data to be recognized for speech recognition; Based on the hot words and their weights in the hot word library, the speech data to be recognized is processed for speech recognition to obtain the speech recognition result; Based on the speech recognition results, determine the hot words to be adjusted and their weight adjustment coefficients; Update the weights of the corresponding hot words to be adjusted according to the weight adjustment coefficients; Get the list of hot word replacements; Update the hot words in the hot word library based on the hot word replacement list and the hot words and their weights in the hot word library; A removal condition is preset. When there is a hot word whose weight meets the removal condition, the corresponding hot word is removed from the hot word library. The removal condition includes the hot word's weight being less than a first preset threshold, the hot word's weight being updated 0 times within a preset period, or the hot word's weight being the minimum. Pre-set addition conditions: When there are hot words with weights that meet the addition conditions, select multiple candidate hot words from the hot word replacement list according to the hot words, so as to add the hot words that do not overlap with the hot words in the hot word library to the hot word library. The addition conditions include: the maximum weight of the hot words in the hot word library is less than a second preset threshold or the weight of more than a preset number of hot words in the hot word library has not been updated within a preset period. When a hot word is removed from the hot word library, a hot word is selected from the hot word replacement list and added to the hot word library.
2. The method according to claim 1, characterized in that, The step of performing speech recognition processing on the speech data to be recognized based on hot words and their weights in the hot word library to obtain speech recognition results includes: The speech data to be recognized is subjected to scene recognition processing to obtain scene recognition results; Based on the hot words and their weights in the target sub-hot word library corresponding to the scene recognition result, the speech data to be recognized is processed for speech recognition to obtain the speech recognition result.
3. The method according to claim 2, characterized in that, The hot word library includes sub-hot word libraries for multiple fields; before performing speech recognition processing on the speech data to be recognized based on the hot words and their weights in the target sub-hot word library corresponding to the scene recognition result, and obtaining the speech recognition result, the process further includes: Based on web crawling, hot words from multiple fields are crawled, and sub-hot word libraries for each field are created. The step of performing speech recognition processing on the speech data to be recognized based on the hot words and their weights in the target sub-hot word library corresponding to the scene recognition result, to obtain the speech recognition result, includes: Obtain multiple candidate usage scenarios and their probability values as indicated by the scene recognition results; When there are candidate use scenarios with a scenario probability value greater than a preset probability threshold, the candidate use scenario with the highest scenario probability value is determined as the target use scenario; The target sub-hot word library that matches the target usage scenario is determined from the sub-hot word libraries in multiple fields; Based on the hot words and their weights in the target sub-hot word library, the speech data to be identified is processed for speech recognition to obtain the speech recognition result.
4. The method according to claim 3, characterized in that, The hot word library also includes a general sub-hot word library; After obtaining the multiple candidate usage scenarios indicated by the scene recognition result and their scene probability values, the method further includes: When there are no candidate usage scenarios with a scenario probability value greater than the preset probability threshold, the general sub-hot word library is determined as the target sub-hot word library; Based on the hot words and their weights in the target sub-hot word library, the speech data to be identified is processed for speech recognition to obtain the speech recognition result.
5. The method according to claim 1, characterized in that, The step of performing speech recognition processing on the speech data to be recognized based on hot words and their weights in the hot word library to obtain speech recognition results includes: Obtain a pre-trained first language model; Based on the first language model and the hot words and their weights in the hot word library, the speech data to be recognized is processed for speech recognition to obtain the speech recognition result.
6. The method according to claim 1, characterized in that, The step of performing speech recognition processing on the speech data to be recognized based on hot words and their weights in the hot word library to obtain speech recognition results includes: A pre-trained acoustic model is obtained, and the speech data to be recognized is input into the acoustic model for decoding processing to obtain acoustic feature parameters; A pre-trained second language model is obtained, and based on the second language model and the hot words and their weights in the hot word library, the acoustic feature parameters are processed for speech recognition to obtain the speech recognition result.
7. A voice recognition device, characterized in that, include: The data acquisition module is used to acquire the speech data to be recognized for speech recognition. The speech recognition module is used to perform speech recognition processing on the speech data to be recognized based on the hot words in the hot word library and their weights, so as to obtain the speech recognition result; The weight adjustment coefficient acquisition module is used to determine the hot words to be adjusted and their weight adjustment coefficients based on the speech recognition results. The hot word library update module is used to update the weight of the corresponding hot word to be adjusted according to the weight adjustment coefficient; Get the list of hot word replacements; Update the hot words in the hot word library based on the hot word replacement list and the hot words and their weights in the hot word library; A removal condition is preset. When there is a hot word whose weight meets the removal condition, the corresponding hot word is removed from the hot word library. The removal condition includes the hot word's weight being less than a first preset threshold, the hot word's weight being updated 0 times within a preset period, or the hot word's weight being the minimum. Pre-set addition conditions: When there are hot words with weights that meet the addition conditions, select multiple candidate hot words from the hot word replacement list according to the hot words, so as to add the hot words that do not overlap with the hot words in the hot word library to the hot word library. The addition conditions include: the maximum weight of the hot words in the hot word library is less than a second preset threshold or the weight of more than a preset number of hot words in the hot word library has not been updated within a preset period. When a hot word is removed from the hot word library, a hot word is selected from the hot word replacement list and added to the hot word library.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is run on a computer, it causes the computer to perform the speech recognition method as described in any one of claims 1 to 6.
9. An electronic device comprising a processor and a memory, the memory storing a computer program, characterized in that, The processor executes the speech recognition method as described in any one of claims 1 to 6 by invoking the computer program.
Citation Information
Patent Citations
Voice recognition method, device, equipment, system and storage medium
CN113436614A
Automatic voice recording method for online customized updating of hot words in telephone scene
CN114283796A
Speech recognition method and device, equipment and storage medium
CN114360499A