Speech recognition method and device, equipment and storage medium
By extracting keywords from the context information of the speech to be recognized and building a dynamic vocabulary list, the problem of difficulty in identifying special vocabulary in the prior art is solved, and the accuracy and efficiency of speech recognition are improved.
Patent Information
- Application Number
- CN202311348539.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-17
- Publication Date
- 2025-04-18
AI Technical Summary
Existing speech recognition technologies are difficult to accurately recognize when dealing with special vocabulary, infrequently used words or homonyms in specific fields, and fixed word lists lead to the need to introduce a large number of words, affecting the performance of speech recognition models.
By extracting keywords from the context information of the speech to be recognized, finding conjunctional words in the preset vocabulary, and building a dynamic target vocabulary list, it is used to identify using a speech recognition model that supports word enhancement.
It improves the accuracy and efficiency of speech recognition, avoids the negative impact of too many words on the performance of speech recognition model, and enhances the effect of word enhancement.
Smart Images

Figure CN119851657A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present disclosure relate to the field of computer technology, and in particular to speech recognition methods, devices, equipment, and storage media. Background Art
[0002] Automatic Speech Recognition (ASR) is a technology that transcribes speech into corresponding text. However, it is difficult to accurately recognize some special words (such as new words, uncommon words in a specific field, or homophones in a specific scenario).
[0003] The use of a speech recognition model that supports word enhancement can solve the above problems to a certain extent. However, the current word list used for word enhancement is a pre-set fixed word list. If the accuracy is to be guaranteed, a large number of words need to be introduced, which has a significant impact on the performance of the speech recognition model. Summary of the invention
[0004] The embodiments of the present disclosure provide a speech recognition method, apparatus, device, and storage medium, which can optimize existing speech recognition solutions.
[0005] In a first aspect, an embodiment of the present disclosure provides a speech recognition method, comprising:
[0006] Extracting a first keyword from context information of the speech to be recognized;
[0007] Searching for a second keyword associated with the first keyword in a first preset word library;
[0008] constructing a target vocabulary according to the first keyword and the second keyword;
[0009] Using a preset speech recognition model that supports word enhancement, based on the target vocabulary and the speech to be recognized, determine the text corresponding to the speech to be recognized.
[0010] In a second aspect, the present disclosure also provides a speech recognition device, including:
[0011] A keyword extraction module, used to extract a first keyword from context information of the speech to be recognized;
[0012] A keyword search module, used to search a first preset word library for a second keyword associated with the first keyword;
[0013] A vocabulary building module, used to build a target vocabulary according to the first keyword and the second keyword;
[0014] The speech recognition module is used to determine the text corresponding to the speech to be recognized based on the target vocabulary and the speech to be recognized by using a preset speech recognition model that supports word enhancement.
[0015] In a third aspect, an embodiment of the present disclosure further provides an electronic device, the electronic device comprising:
[0016] one or more processors;
[0017] a storage device for storing one or more programs,
[0018] When the one or more programs are executed by the one or more processors, the one or more processors implement the speech recognition method provided by the embodiment of the present disclosure.
[0019] In a fourth aspect, an embodiment of the present disclosure further provides a storage medium containing computer executable instructions, which, when executed by a computer processor, are used to execute the speech recognition method provided by an embodiment of the present disclosure.
[0020] The speech recognition solution provided by the embodiment of the present disclosure extracts a first keyword from the context information of the speech to be recognized, searches for a second keyword associated with the first keyword in a first preset word library, and constructs a target word list based on the first keyword and the second keyword, and uses a preset speech recognition model that supports word enhancement to determine the text corresponding to the speech to be recognized based on the target word list and the speech to be recognized. By adopting the above technical solution, a target word list is jointly constructed based on the first keyword extracted from the conversation context of the speech to be recognized and the second keyword associated with the first keyword found in the preset word library, which can more flexibly and accurately determine the word list for word enhancement related to the context information, improve the word enhancement effect, and avoid the negative impact of too many words used for word enhancement on the performance of the speech recognition model, thereby ensuring the accuracy and recognition efficiency of speech recognition. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.
[0022] Figure 1 A flowchart of a speech recognition method provided by an embodiment of the present disclosure;
[0023] Figure 2 A flowchart of another speech recognition method provided by an embodiment of the present disclosure;
[0024] Figure 3A schematic diagram of a speech recognition process provided by an embodiment of the present disclosure;
[0025] Figure 4 A schematic diagram of a vocabulary building process provided by an embodiment of the present disclosure;
[0026] Figure 5 A flowchart of another speech recognition method provided by an embodiment of the present disclosure;
[0027] Figure 6 A schematic diagram of the structure of a speech recognition device provided by an embodiment of the present disclosure;
[0028] Figure 7 A schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0029] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0030] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0031] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0032] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0033] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0034] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0035] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0036] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.
[0037] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0038] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet the relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0039] It is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.
[0040] Figure 1 A flow chart of a speech recognition method provided in an embodiment of the present disclosure is provided. The embodiment of the present disclosure is applicable to speech recognition scenarios, and specifically to scenarios such as human-computer dialogue or intelligent recording of conferences. The method can be executed by a speech recognition device, which can be implemented in the form of software and / or hardware. Optionally, it can be implemented by an electronic device, which can be a mobile terminal such as a mobile phone, a smart watch, a tablet computer, and a personal digital assistant, or a device such as a personal computer (PC) or a server.
[0041] like Figure 1 As shown, the method includes:
[0042] Step 101: extract a first keyword from context information of the speech to be recognized.
[0043] Exemplarily, the speech to be recognized may include the speech that currently needs to be recognized, which may be a speech signal, such as a speech signal of a sentence. The context information of the speech to be recognized may be the speech that appeared before the speech to be recognized. Taking the human-computer dialogue scenario as an example, the context information may be obtained from the historical dialogue before the current dialogue (which may be one or more dialogues, and the specific number of dialogues is not limited. It should be noted that the acquisition and use of the historical dialogue have been fully authorized by the user to whom the dialogue belongs). Specifically, effective dialogue information may be screened from the historical dialogue to obtain the context information. Optionally, the content of the historical dialogue may be analyzed to determine the topic switching point, and the context information may be obtained from the historical dialogue corresponding to the latest topic. If the topic switching point is not detected, the context information may be obtained from the acquired historical dialogue.
[0044] Exemplarily, after obtaining the context information, a preset extraction method may be used to extract keywords from the context information, which are recorded as first keywords. The specific number of first keywords is not limited. The preset extraction method may include, for example, a rule extraction method or a semantic extraction method, and one or more extraction methods may be selected according to actual needs. When performing the extraction, the extraction may be performed in an orderly manner according to the order of the context, such as the order of the conversation.
[0045] Step 102: Search a first preset word library for a second keyword associated with the first keyword.
[0046] Exemplarily, the first preset word library may be a preset word library, which may be set manually or automatically according to actual needs. Optionally, the first preset word library may be a hot word library, which contains pre-set hot words. The first preset word library may be a dynamically updated word library, and the update method may include manual update or automatic update.
[0047] For example, the relevance between each word in the first preset word library and the first keyword can be determined, and the words with a relevance higher than a preset relevance threshold are determined as the searched keywords and recorded as the second keywords. The specific number of the second keywords is not limited.
[0048] Step 103: construct a target vocabulary according to the first keyword and the second keyword.
[0049] Exemplarily, after obtaining the second keyword, the first keyword and the second keyword may be merged to obtain a target vocabulary, for example, the union of the first keyword and the second keyword is used as the target vocabulary.
[0050] Step 104: using a preset speech recognition model that supports word enhancement, based on the target vocabulary and the speech to be recognized, determine the text corresponding to the speech to be recognized.
[0051] Word enhancement (Context Biasing or Contextual Biasing) can add some prior knowledge (such as a vocabulary) to the speech recognition model, so that some uncommon words can be accurately recognized, thereby improving the accuracy of speech recognition.
[0052] In the prior art, the preset speech recognition models that support word enhancement all use pre-set fixed word lists, which are limited to special scenarios. If the words do not match the scenarios, misrecognition will occur. If the accuracy is to be guaranteed and multiple fields need to be covered, a large number of words must be introduced, which will have a significant impact on the performance of the speech recognition model, such as affecting the decoding search efficiency and the recognition accuracy of words outside the word list.
[0053] In the disclosed embodiment, a target vocabulary is dynamically constructed based on the context information of the speech to be recognized and a preset vocabulary, which can take into account both the accuracy of speech recognition based on word enhancement and the performance of the speech recognition model.
[0054] The speech recognition method of the disclosed embodiment extracts a first keyword from the context information of the speech to be recognized, searches for a second keyword associated with the first keyword in a first preset word library, and constructs a target word list based on the first keyword and the second keyword, and uses a preset speech recognition model that supports word enhancement to determine the text corresponding to the speech to be recognized based on the target word list and the speech to be recognized. By adopting the above technical solution, a target word list is jointly constructed based on the first keyword extracted from the conversation context of the speech to be recognized and the second keyword associated with the first keyword found in the preset word library, which can more flexibly and accurately determine the word list for word enhancement related to the context information, improve the word enhancement effect, and avoid the negative impact of too many words used for word enhancement on the performance of the speech recognition model, thereby ensuring the accuracy and recognition efficiency of speech recognition.
[0055] In some embodiments, the first preset word library includes a word relationship graph of multiple topics, and the word relationship graph includes multiple words and the association relationship between the multiple words; wherein, searching the first keyword associated with the second keyword in the first preset word library includes: searching the target topic to which the first keyword belongs in the first preset word library; and searching the second keyword associated with the first keyword based on the association relationship in the target word relationship graph corresponding to the target topic. Thus, the words in the preset word library are stored in the form of a relationship graph, and the association relationship between different words is pre-set, which can effectively improve the search efficiency and search accuracy of the second keyword.
[0056] For example, the specific division method of the topic is not limited. For example, it can be divided according to vertical fields, such as science and technology, literature, poetry, idioms, music, film and television, and games, etc. The relationship diagram between topics and words can be a one-to-one relationship. For a certain topic, the association relationship between words can be set according to actual needs. Taking idioms as an example, the association relationship can include synonym relationships, antonym relationships, and idiom chain relationships.
[0057] Exemplarily, the target theme is one of the multiple themes. Assuming that the first keyword is the name of a singer, it can be determined that the target theme is music, and the word relationship graph corresponding to music is determined as the target word relationship graph. The words in the target word relationship graph that are associated with the singer's name may include the singer's latest album name or the latest song name, etc., so that the latest album name or the latest song name can be determined as the second keyword.
[0058] Figure 2 This is a flow chart of another speech recognition method provided by an embodiment of the present disclosure. The embodiment of the present disclosure is optimized based on each optional solution in the above embodiment. Figure 3 A schematic diagram of a speech recognition process provided by an embodiment of the present disclosure, Figure 4 A schematic diagram of a vocabulary building process provided by an embodiment of the present disclosure can be combined with Figures 2 to 4 Specifically, the method includes the following steps:
[0059] Step 201: extract a first keyword from context information of the speech to be recognized.
[0060] Optionally, the first preset vocabulary may include preset scene vocabulary corresponding to multiple dialogue scenes. When the context information of the speech to be recognized cannot be obtained, such as at the beginning of the dialogue, there is no historical dialogue or the number of historical dialogues is very small, the current target dialogue scene can be determined, and the third keyword can be obtained from the preset scene vocabulary corresponding to the target dialogue scene, and the target vocabulary can be constructed based on the third keyword.
[0061] like Figure 3 As shown, for situations such as the initial stage of a conversation, even if the context is insufficient, the third keyword can be obtained from the preset scene vocabulary corresponding to the current target conversation scene by pre-selection, a target word list is constructed according to the third keyword, the target word list and the speech to be recognized (such as the audio shown in the figure) are input into a preset speech recognition model (ASR) that supports word enhancement, and the text (Text) as the recognition result is output. As the conversation continues, if there is valid context in multiple rounds of conversation, the context information can be obtained, and the first keyword is obtained after context analysis and extraction.
[0062] Step 202: Search the first preset word library for a second keyword associated with the first keyword.
[0063] like Figure 3 As shown, the first keyword extracted from the context information is used to extract the second keyword from the preset vocabulary through association.
[0064] Step 203: construct a target vocabulary according to the first keyword and the second keyword.
[0065] like Figure 3 As shown, the first keyword and the second keyword are collected, merged, screened, and weighted (weight adjusted) to obtain a target vocabulary, which is input into the ASR together with the current audio to be recognized.
[0066] Exemplarily, the union of the first keyword and the second keyword is used as the initial vocabulary, and each keyword in the initial vocabulary is recorded as an initial word.
[0067] Step 204: Using the correlation between the second preset vocabulary and the initial words in the initial vocabulary, adjust the weight values of the tokens in the initial words to obtain a target vocabulary.
[0068] The output of speech recognition is text, which is represented by a series of tokens. For example, the smallest unit of written text can be used as a token. Taking Chinese as an example, each character in a word can be used as a token. Based on word-enhanced speech recognition, when a token of a word in the vocabulary is matched during the decoding search process, a corresponding score reward can be obtained. The score reward can be understood as a weight value. In the prior art, the weight values of each token of a word in the vocabulary are all pre-set weight values and are equal. In the embodiment of the present disclosure, the weight value is recorded as the original weight value. For different speech recognition models, the original weight value may be different, for example, it may be 1 or other values. Optionally, the original weight values of each initial word in the initial vocabulary are equal, for example, they are all 1.
[0069] In the disclosed embodiment, before starting the decoding search, the weight value of each initial word in the initial word list is dynamically adjusted by using the correlation between the second preset word library and the initial words in the initial word list to obtain a target word list for participating in the decoding search. Compared with the existing fixed and equal weight value setting scheme, the impact of the speech recognition model on the recognition ability of words outside the word list can be reduced, that is, the negative impact of the introduction of words on the speech recognition model can be reduced. Among them, the second preset word library can be understood as a pre-set word library containing multiple preset words, the preset words can be commonly used words, and commonly used words can be understood as words that the speech recognition model can accurately recognize without the need for word enhancement.
[0070] Optionally, the method of adjusting the weight values of the tokens in the initial words by using the correlation between the second preset word library and the initial words in the initial word library includes: for each initial word in the initial word library, if there is a prefix token in the current initial word that matches a preset word in the second preset word library, then reducing the weight value of at least one token in the current initial word, wherein the prefix token does not include the last token in the current initial word. In this way, the weights of the tokens in the initial words can be adjusted more accurately.
[0071] Exemplarily, each initial word in the initial word list can become the current initial word. Starting from the first token of the current initial word, tokens are matched with the preset words in the second preset word library one by one until there is no token matching the preset word, and one or more tokens that have been matched currently are recorded as prefix tokens, and the weight value of at least one token in the current initial word is reduced (that is, the adjusted weight value is less than the original weight value). If there is no prefix token matching the preset word, the original weight value of each token is maintained.
[0072] Optionally, if the current initial word exists in the second preset vocabulary, that is, the current initial word is a preset word in the second preset vocabulary, the current initial word can be deleted from the initial vocabulary to achieve screening or filtering based on the second preset vocabulary, thereby further reducing the negative impact of word enhancement on the ability of the speech recognition model to recognize preset words such as common words.
[0073] Optionally, reducing the weight value of at least one token in the current initial word may include: reducing the original weight value of the prefix token in the current initial word to a first value. The first value may be a first preset value, such as 0, or a value dynamically set according to the original weight value, such as the product of a first coefficient and the original weight value, and the first coefficient may be, for example, 0.1.
[0074] Optionally, on the basis of reducing the weight value of the prefix token, the weight value of the token after the prefix token can be further reduced. Exemplarily, the reducing the weight value of at least one token in the current initial word may include: reducing the original weight value of the prefix token in the current initial word to a first value, and reducing the original weight value of the token other than the prefix token in the current initial word to a second value, wherein the first value is lower than the second value. The second value may be a second preset value, such as 0.5, or a value dynamically set according to the original weight value, such as the product of a second coefficient and the original weight value, and the second coefficient is greater than the first coefficient, for example, it may be 0.5.
[0075] like Figure 4As shown, context information (Context) is input, and the first keyword is extracted through rule extraction and semantic extraction, such as natural language processing (NLP) extraction, etc., and the second keyword is extracted from the dynamically updated specific vocabulary (preset vocabulary) according to the first keyword. The first keyword and the second keyword are processed by preset word filtering and word weight adjustment to obtain a weighted vocabulary, that is, the target vocabulary. Among them, the first preset vocabulary can include a part that is automatically updated by a scheduled task; it can also include a part that is manually updated by a scheduled task, such as an idiom vocabulary, etc.; it can also include a part that can be manually increased or decreased at any time, such as a resident word, etc.
[0076] Step 205: using a preset speech recognition model that supports word enhancement, based on the target vocabulary and the speech to be recognized, determine the text corresponding to the speech to be recognized.
[0077] The speech recognition method provided in the embodiment of the present invention dynamically constructs a target vocabulary based on the context information of the speech to be recognized and the first preset vocabulary library, and can more flexibly and accurately determine the vocabulary used for word enhancement, improve the word enhancement effect, and avoid the negative impact of too many words on the performance of the speech recognition model. By utilizing the correlation between the second preset vocabulary library and the initial words in the initial vocabulary library, the weight value of the initial words is dynamically adjusted, which can further reduce the negative impact of word enhancement on the performance of the speech recognition model and further ensure the accuracy and recognition efficiency of speech recognition.
[0078] Figure 5 The flowchart of another speech recognition method provided by the embodiment of the present disclosure is as follows. The embodiment of the present disclosure is optimized based on the various optional solutions in the above embodiments. Specifically, the method includes the following steps:
[0079] Step 501: extract a first keyword from context information of the speech to be recognized.
[0080] Step 502: Search the first preset word library for the target topic to which the first keyword belongs, and search the target word relationship graph corresponding to the target topic for the second keyword associated with the first keyword based on the association relationship.
[0081] Step 503, traverse each initial word in the initial vocabulary. If the current initial word contains a prefix token that matches a preset word in the second preset vocabulary, reduce the original weight value of the prefix token in the current initial word to a first value, and reduce the original weight values of the tokens in the current initial word except the prefix token to a second value. If the current initial word exists in the second preset vocabulary, delete the current initial word from the initial vocabulary. After the traversal is completed, the target vocabulary is obtained.
[0082] Step 504: using a preset speech recognition model that supports word enhancement, a decoding search is performed based on a target word list and the speech to be recognized, wherein, during the decoding search process, if all tokens in the current target word match the speech to be recognized, and there is a prefix token in the current target word that matches a preset word in a second preset word library, a target weight value is added to the current target word, and the target weight value is used to improve the ranking score of the current target word during the decoding search process.
[0083] Among them, the target weight value can be a third preset value, and can also be dynamically set according to actual conditions. Among them, the ranking score can be understood as a score used to participate in the search ranking. For the current target word that partially matches the preset words in the second preset vocabulary, if it completely matches the speech to be recognized, it means that the current target word is likely to be included in the recognition result. Due to the previous weight adjustment processing, the weight value of some or all tokens is reduced. In order to ensure that the current target word can be accurately recognized, the weight can be additionally increased so that the current target word can be ranked more prominently than other candidate words.
[0084] Optionally, the target weight value is the difference between the first sum value and the second sum value, wherein the first sum value is the sum of the original weight values of the tokens in the current target word, and the second sum value is the sum of the current weight values of the tokens in the current target word. In this way, the target weight value can be set more flexibly and reasonably.
[0085] For example, the current target word is a 4-character word, there are 4 tokens, the original weight values are all 1, assuming that the first 3 tokens are prefix tokens that match the preset word, after the weight value adjustment, the weight value is adjusted to 0, the weight value of the 4th token is adjusted to 0.5, and the 4 tokens are all matched with the speech to be recognized, then the target weight value = sum (original weight) - sum (new weight) = 4-0.5 = 3.5. After the additional target weight value is increased, the current target word can get a higher ranking score in the decoding search process, and the hit probability is improved.
[0086] Step 505: Determine the text corresponding to the speech to be recognized based on the decoding search results.
[0087] The speech recognition method provided by the embodiment of the present disclosure dynamically constructs a target vocabulary based on the context information of the speech to be recognized and a preset vocabulary, and can more flexibly and accurately determine the vocabulary used for word enhancement, improve the effect of word enhancement, and avoid the negative impact of too many words on the performance of the speech recognition model. The weight value of the initial word is dynamically adjusted by utilizing the correlation between the second preset vocabulary and the initial words in the initial vocabulary, which can further reduce the negative impact of word enhancement on the performance of the speech recognition model. When the target word completely matches the speech to be recognized, an additional weight is added to the target word to ensure that the current target word can be ranked more prominently than other candidate words, thereby ensuring that word enhancement has good positive benefits and further ensuring the accuracy of speech recognition.
[0088] Figure 6 A schematic diagram of the structure of a speech recognition device provided by an embodiment of the present disclosure is shown in FIG. Figure 6 As shown, the device comprises:
[0089] A keyword extraction module 601 is used to extract a first keyword from context information of the speech to be recognized;
[0090] A keyword search module 602, configured to search a first preset word library for a second keyword associated with the first keyword;
[0091] A vocabulary building module 603, configured to build a target vocabulary according to the first keyword and the second keyword;
[0092] The speech recognition module 604 is used to determine the text corresponding to the speech to be recognized based on the target vocabulary and the speech to be recognized by using a preset speech recognition model that supports word enhancement.
[0093] The speech recognition device provided by the embodiment of the present disclosure extracts a first keyword from the context information of the speech to be recognized, searches for a second keyword associated with the first keyword in a first preset word library, and constructs a target word list based on the first keyword and the second keyword, and uses a preset speech recognition model that supports word enhancement to determine the text corresponding to the speech to be recognized based on the target word list and the speech to be recognized. By adopting the above technical solution, a target word list is jointly constructed based on the first keyword extracted from the conversation context of the speech to be recognized and the second keyword associated with the first keyword found in the preset word library, which can more flexibly and accurately determine the word list for word enhancement related to the context information, improve the word enhancement effect, and avoid the negative impact of too many words used for word enhancement on the performance of the speech recognition model, thereby ensuring the accuracy and recognition efficiency of speech recognition.
[0094] Optionally, the first preset word library includes a word relationship diagram of multiple topics, and the word relationship diagram includes multiple words and association relationships between the multiple words;
[0095] Wherein, the keyword search module includes:
[0096] A subject search unit, configured to search a first preset word library for a target subject to which the first keyword belongs;
[0097] A keyword search unit is used to search for a second keyword associated with the first keyword based on the association relationship in the target word relationship graph corresponding to the target topic.
[0098] Optional, vocabulary building modules, including:
[0099] an initial vocabulary building unit, configured to build an initial vocabulary according to the first keyword and the second keyword;
[0100] The weight adjustment unit is used to adjust the weight values of the tokens in the initial words by using the correlation between the second preset vocabulary and the initial words in the initial vocabulary to obtain the target vocabulary.
[0101] Optionally, the weight adjustment unit is specifically used to: for each initial word in the initial vocabulary, if there is a prefix token in the current initial word that matches a preset word in the second preset vocabulary, then reduce the weight value of at least one token in the current initial word, wherein the prefix token does not include the last token in the current initial word.
[0102] Optionally, reducing the weight value of at least one token in the current initial word includes:
[0103] reducing the original weight value of the prefix token in the current initial word to a first value; or,
[0104] The original weight value of the prefix token in the current initial word is reduced to a first value, and the original weight value of the token other than the prefix token in the current initial word is reduced to a second value, wherein the first value is lower than the second value.
[0105] Optionally, the speech recognition module includes:
[0106] A decoding search unit, used for performing a decoding search based on the target word list and the speech to be recognized by using a preset speech recognition model that supports word enhancement, wherein during the decoding search process, if each token in the current target word matches the speech to be recognized, and there is a prefix token in the current target word that matches a preset word in the second preset word library, then a target weight value is added to the current target word, and the target weight value is used to improve the ranking score of the current target word during the decoding search process;
[0107] The text determination unit is used to determine the text corresponding to the speech to be recognized based on the decoding search result.
[0108] Optionally, the target weight value is the difference between a first sum value and a second sum value, wherein the first sum value is the sum of the original weight values of the tokens in the current target word, and the second sum value is the sum of the current weight values of the tokens in the current target word.
[0109] The speech recognition device provided in the embodiments of the present disclosure can execute the speech recognition method provided in any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
[0110] It is worth noting that the various units and modules included in the above-mentioned device are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the embodiments of the present disclosure.
[0111] Figure 7 This is a schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure. Figure 7 , which shows an electronic device (eg, Figure 7 The terminal device in the embodiment of the present disclosure may include but is not limited to mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 7 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0112] like Figure 7As shown, the electronic device 700 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage device 708 into a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the electronic device 700 are also stored. The processing device 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An edit / output (I / O) interface 705 is also connected to the bus 704.
[0113] Typically, the following devices may be connected to the I / O interface 705: an input device 706 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 707 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 708 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 709. The communication device 709 may allow the electronic device 700 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 7 The electronic device 700 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0114] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 709, or installed from a storage device 708, or installed from a ROM 702. When the computer program is executed by the processing device 701, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0115] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0116] The electronic device provided by the embodiment of the present disclosure and the speech recognition method provided by the above embodiment belong to the same inventive concept. The technical details not fully described in this embodiment can be referred to the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.
[0117] The embodiments of the present disclosure provide a computer storage medium on which a computer program is stored. When the program is executed by a processor, the speech recognition method provided by the above embodiments is implemented.
[0118] The embodiments of the present disclosure provide a computer program product, including a computer program, which implements the speech recognition method provided in the above embodiments when executed by a processor.
[0119] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer 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. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0120] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0121] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0122] The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by the electronic device, the electronic device: extracts a first keyword from the context information of the speech to be recognized; searches for a second keyword associated with the first keyword in a first preset vocabulary; constructs a target vocabulary based on the first keyword and the second keyword; and uses a preset speech recognition model that supports word enhancement to determine the text corresponding to the speech to be recognized based on the target vocabulary and the speech to be recognized.
[0123] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0124] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0125] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware. The name of a module does not limit the module itself in some cases. For example, a keyword extraction module may also be described as a "module for extracting a first keyword from context information of a speech to be recognized."
[0126] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0127] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer 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 foregoing.
[0128] According to one or more embodiments of the present disclosure, a speech recognition method is provided, comprising:
[0129] Extracting a first keyword from context information of the speech to be recognized;
[0130] Searching for a second keyword associated with the first keyword in a first preset word library;
[0131] constructing a target vocabulary according to the first keyword and the second keyword;
[0132] Using a preset speech recognition model that supports word enhancement, based on the target vocabulary and the speech to be recognized, determine the text corresponding to the speech to be recognized.
[0133] According to one or more embodiments of the present disclosure, the first preset word library includes a word relationship graph of multiple topics, and the word relationship graph includes multiple words and association relationships between the multiple words;
[0134] The step of searching the first preset word library for the second keyword associated with the first keyword includes:
[0135] Searching for a target topic to which the first keyword belongs in a first preset word library;
[0136] In the target word relationship graph corresponding to the target topic, a second keyword associated with the first keyword is searched based on the association relationship.
[0137] According to one or more embodiments of the present disclosure, the step of constructing a target vocabulary according to the first keyword and the second keyword includes:
[0138] constructing an initial vocabulary according to the first keyword and the second keyword;
[0139] The weight values of the tokens in the initial words are adjusted by using the correlation between the second preset word library and the initial words in the initial word list to obtain the target word list.
[0140] According to one or more embodiments of the present disclosure, adjusting the weight values of tokens in the initial words by using the correlation between the second preset vocabulary and the initial words in the initial vocabulary includes:
[0141] For each initial word in the initial vocabulary, if there is a prefix token in the current initial word that matches a preset word in the second preset vocabulary, the weight value of at least one token in the current initial word is reduced, wherein the prefix token does not include the last token in the current initial word.
[0142] According to one or more embodiments of the present disclosure, reducing the weight value of at least one token in the current initial word includes:
[0143] reducing the original weight value of the prefix token in the current initial word to a first value; or,
[0144] The original weight value of the prefix token in the current initial word is reduced to a first value, and the original weight value of the token other than the prefix token in the current initial word is reduced to a second value, wherein the first value is lower than the second value.
[0145] According to one or more embodiments of the present disclosure, the preset speech recognition model enhanced by supporting words, based on the target vocabulary and the speech to be recognized, determines the text corresponding to the speech to be recognized, including:
[0146] Using a preset speech recognition model that supports word enhancement, a decoding search is performed based on the target word list and the speech to be recognized, wherein, during the decoding search process, if all tokens in the current target word match the speech to be recognized, and there is a prefix token in the current target word that matches a preset word in the second preset word library, a target weight value is added to the current target word, and the target weight value is used to improve the ranking score of the current target word in the decoding search process;
[0147] The text corresponding to the speech to be recognized is determined based on the decoding search result.
[0148] According to one or more embodiments of the present disclosure, the target weight value is the difference between a first sum value and a second sum value, wherein the first sum value is the sum of original weight values of each token in the current target word, and the second sum value is the sum of current weight values of each token in the current target word.
[0149] According to one or more embodiments of the present disclosure, there is provided a speech recognition device, comprising:
[0150] A keyword extraction module, used to extract a first keyword from context information of the speech to be recognized;
[0151] A keyword search module, used to search a first preset word library for a second keyword associated with the first keyword;
[0152] A vocabulary building module, used to build a target vocabulary according to the first keyword and the second keyword;
[0153] The speech recognition module is used to determine the text corresponding to the speech to be recognized based on the target vocabulary and the speech to be recognized by using a preset speech recognition model that supports word enhancement.
[0154] According to one or more embodiments of the present disclosure, an electronic device is provided, the electronic device comprising:
[0155] one or more processors;
[0156] a storage device for storing one or more programs,
[0157] When the one or more programs are executed by the one or more processors, the one or more processors implement the speech recognition method provided by the embodiment of the present disclosure.
[0158] According to one or more embodiments of the present disclosure, a storage medium containing computer executable instructions is provided. When the computer executable instructions are executed by a computer processor, they are used to perform the speech recognition method provided by the embodiments of the present disclosure.
[0159] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.
[0160] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0161] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.
Claims
1. A speech recognition method, characterized in that: include: Extracting a first keyword from context information of the speech to be recognized; Searching for a second keyword associated with the first keyword in a first preset word library; constructing a target vocabulary according to the first keyword and the second keyword; Using a preset speech recognition model that supports word enhancement, based on the target vocabulary and the speech to be recognized, determine the text corresponding to the speech to be recognized.
2. The method according to claim 1, characterized in that The first preset word library includes a word relationship diagram of multiple topics, and the word relationship diagram includes multiple words and the association relationship between the multiple words; The step of searching the first preset word library for the second keyword associated with the first keyword includes: Searching for a target topic to which the first keyword belongs in a first preset word library; In the target word relationship graph corresponding to the target topic, a second keyword associated with the first keyword is searched based on the association relationship.
3. The method according to claim 1, characterized in that The step of constructing a target vocabulary according to the first keyword and the second keyword includes: constructing an initial vocabulary according to the first keyword and the second keyword; The weight values of the tokens in the initial words are adjusted by using the correlation between the second preset word library and the initial words in the initial word list to obtain the target word list.
4. The method according to claim 3, characterized in that The step of adjusting the weight values of the tokens in the initial words by using the correlation between the second preset word library and the initial words in the initial word list comprises: For each initial word in the initial vocabulary, if there is a prefix token in the current initial word that matches a preset word in the second preset vocabulary, the weight value of at least one token in the current initial word is reduced, wherein the prefix token does not include the last token in the current initial word.
5. The method according to claim 4, characterized in that The step of reducing the weight value of at least one token in the current initial word comprises: reducing the original weight value of the prefix token in the current initial word to a first value; or, The original weight value of the prefix token in the current initial word is reduced to a first value, and the original weight value of the token other than the prefix token in the current initial word is reduced to a second value, wherein the first value is lower than the second value.
6. The method according to claim 3, characterized in that The method of using the preset speech recognition model that supports word enhancement to determine the text corresponding to the speech to be recognized based on the target word list and the speech to be recognized includes: Using a preset speech recognition model that supports word enhancement, a decoding search is performed based on the target word list and the speech to be recognized, wherein, during the decoding search process, if all tokens in the current target word match the speech to be recognized, and there is a prefix token in the current target word that matches a preset word in the second preset word library, a target weight value is added to the current target word, and the target weight value is used to improve the ranking score of the current target word in the decoding search process; The text corresponding to the speech to be recognized is determined based on the decoding search result.
7. The method according to claim 6, characterized in that The target weight value is the difference between a first sum value and a second sum value, wherein the first sum value is the sum of original weight values of each token in the current target word, and the second sum value is the sum of current weight values of each token in the current target word.
8. A speech recognition device, characterized in that: include: A keyword extraction module, used to extract a first keyword from context information of the speech to be recognized; A keyword search module, used to search a first preset word library for a second keyword associated with the first keyword; A vocabulary building module, used to build a target vocabulary according to the first keyword and the second keyword; The speech recognition module is used to determine the text corresponding to the speech to be recognized based on the target vocabulary and the speech to be recognized by using a preset speech recognition model that supports word enhancement.
9. An electronic device, characterized in that: The electronic device comprises: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the speech recognition method as described in any one of claims 1-7.
10. A storage medium containing computer executable instructions, characterized in that: The computer executable instructions are used to perform the speech recognition method as described in any one of claims 1 to 7 when executed by a computer processor.