Speech recognition method and related apparatus
By combining fully neural network-based and partially neural network-based speech recognition models, the adaptability of speech recognition technology in specific and general scenarios is solved, achieving efficient recognition in different scenarios.
Patent Information
- Application Number
- CN202111158900.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-30
- Publication Date
- 2026-02-06
- Estimated Expiration
- 2041-09-30
AI Technical Summary
Existing speech recognition technologies struggle to adapt to both specific and general recognition scenarios, resulting in poor recognition performance.
A first model based entirely on neural network principles and a second model not based entirely on neural network principles are used to obtain the text and score of the speech to be recognized, respectively, and the text with the highest score is selected as the recognition result.
It achieves good speech recognition results in both specific and general recognition scenarios, adapting to the needs of various recognition scenarios.
Smart Images

Figure CN113889097B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of speech recognition, in particular, to a speech recognition method and related device. BACKGROUND
[0002] With the development and commercial application of speech recognition technology, speech recognition technology is increasingly used in various scenarios, such as customer service, quality inspection, vehicle-mounted, mobile phone, sound box, home, etc.
[0003] However, the inventors have found that related speech recognition technology can only adapt to one of a specific recognition scenario and a general recognition scenario, and it is difficult to adapt to both recognition scenarios. SUMMARY
[0004] In order to overcome at least one of the deficiencies in the prior art, the present application provides a speech recognition method and related device, comprising:
[0005] In a first aspect, the present application provides a speech recognition method applied to a speech recognition device, wherein the speech recognition device is configured with a speech recognition model, the speech recognition model comprises a first model completely based on a neural network principle and a second model not completely based on a neural network principle, and the method comprises:
[0006] obtaining a to-be-recognized speech;
[0007] inputting the to-be-recognized speech into the first model to obtain a first text and a first score of the first text;
[0008] inputting the to-be-recognized speech into the second model to obtain a second text and a second score of the second text;
[0009] selecting a target text with the highest score from the first text and the second text according to the first score and the second score;
[0010] taking the target text as a speech recognition result of the to-be-recognized speech.
[0011] In a second aspect, the present application provides a speech recognition device applied to a speech recognition device, wherein the speech recognition device is configured with a speech recognition model, the speech recognition model comprises a first model completely based on a neural network principle and a second model not completely based on a neural network principle, and the speech recognition device comprises:
[0012] a speech module configured to obtain a to-be-recognized speech;
[0013] a score module configured to input the to-be-recognized speech into the first model to obtain a first text and a first score of the first text;
[0014] The scoring module is further configured to input the voice to be recognized into the second model to obtain a second text and a second score of the second text.
[0015] The text module is configured to select a target text with the highest score from the first text and the second text according to the first score and the second score.
[0016] The text module is further configured to take the target text as a voice recognition result of the voice to be recognized.
[0017] In a third aspect, the present application provides a voice recognition device, which comprises a processor and a memory, and the memory stores a computer program, and the computer program is executed by the processor to implement the voice recognition method.
[0018] In a fourth aspect, the present application provides a computer readable storage medium, which stores a computer program, and the computer program is executed by the processor to implement the voice recognition method.
[0019] In a fifth aspect, the present application provides a computer program product, which comprises computer programs / instructions, and the computer programs / instructions are executed by the processor to implement the voice recognition method.
[0020] Compared with the prior art, the present application has the following beneficial effects:
[0021] In the voice recognition method and related device provided by the present application, the voice recognition device is configured with a voice recognition model, and the voice recognition model comprises a first model completely based on a neural network principle and a second model not completely based on the neural network principle; then, the first text and the second text of the voice to be recognized and the scores of the two texts are obtained by the first model and the second model respectively, and finally, the text with the highest score is taken as the voice recognition result of the voice to be recognized. Since the first model can take good recognition effect in a general recognition scene, and the second model can take good recognition effect in a specific recognition scene, the purpose of simultaneously adapting to the two scenes can be achieved. BRIEF DESCRIPTION OF DRAWINGS
[0022] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments. It should be understood that the following drawings only show some embodiments of the present application, and therefore should not be regarded as a limitation on the scope, and for those skilled in the art, other related drawings can also be obtained without creative labor on the basis of these drawings.
[0023] Figure 1A structural schematic diagram of a voice recognition device provided by an embodiment of the present application;
[0024] Figure 2 A flowchart of a voice recognition method provided by an embodiment of the present application;
[0025] Figure 3 A flowchart of a voice recognition method provided by an embodiment of the present application;
[0026] Figure 4 A structural schematic diagram of a voice recognition model provided by an embodiment of the present application;
[0027] Figure 5 A training principle schematic diagram of a to-be-trained model provided by an embodiment of the present application;
[0028] Figure 6 A structural schematic diagram of a voice recognition device provided by an embodiment of the present application.
[0029] Icon: 120 - memory; 130 - processor; 140 - communication unit; 201 - voice module; 202 - score module; 203 - text module. DETAILED DESCRIPTION
[0030] In order to make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. The components of the embodiments of the present application described and shown in the drawings can be arranged and designed in various different configurations.
[0031] Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the claimed present application, but only represents selected embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without making creative efforts fall within the scope of protection of the present application.
[0032] It should be noted that: similar reference numbers and letters represent similar items in the following drawings, therefore, once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings.
[0033] In the description of the present application, it should be noted that the terms "first", "second", "third" and the like are merely used to distinguish descriptions, and cannot be understood as indicating or implying relative importance. In addition, the terms "include", "contain" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or equipment including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or equipment. Without more limitations, the element defined by the statement "includes a" does not exclude the presence of another identical element in the process, method, article or equipment including the element.
[0034] It should be understood that the operations of the flowchart can not be implemented in order, and the steps without logical context relationship can be reversed in order or implemented simultaneously. In addition, one or more other operations can be added to the flowchart or one or more operations can be removed from the flowchart under the guidance of the content of the present application.
[0035] Speech recognition technology can be used to convert the user's voice into text, so as to be more and more used in various scenes with the development and commercial application of speech recognition technology. The current speech recognition technology includes the following two technical ideas:
[0036] One is to use a first model completely based on the principle of neural network, for example, an end-to-end speech recognition model. And the other is to use a second model not completely based on the principle of neural network, for example, a traditional speech recognition model.
[0037] Among them, the traditional speech recognition model includes a feature extraction layer, an acoustic model layer, a language model layer and a decoding layer, and those skilled in the art can design the above-mentioned feature extraction layer, acoustic model layer, language model layer and decoding layer to adapt the traditional speech recognition model to various specific recognition scenes. For ease of understanding, the above-mentioned three sound processing links of each traditional speech recognition model are described below.
[0038] Feature extraction layer: Since direct recognition of the original waveform of the speech to be recognized cannot achieve good recognition effect, it is necessary to convert the time domain speech waveform signal into a frequency domain signal and then perform feature extraction. For example, the Mel Frequency Cepstrum Coefficient (MFCC) of the speech to be recognized.
[0039] Acoustic model layer: used to process the acoustic features obtained in the feature extraction stage to obtain the pronunciation unit of the speech to be recognized. Among them, the common acoustic model layer includes hidden Markov model, Gaussian mixture model, etc.
[0040] Language model layer: the language model layer is used to depict the way of human language expression habit, and focuses on describing the internal connection of words and words in the arrangement structure. Therefore, the language model can not only improve the decoding efficiency of the decoding layer, but also improve the speech recognition rate to a certain extent. For example, an N-Gram model can be used as a language model layer.
[0041] Decoding layer: since the pronunciation unit is relatively independent with respect to the entire speech to be recognized, and the same pronunciation unit also exists in the case of homophonic characters, it is necessary to use a language recognition model with a dictionary to decode the relatively isolated and dispersed pronunciation units to obtain the target text matched with the speech to be recognized. In addition, the language recognition model can be conveniently optimized using rich domain scene text corpus, thereby improving the speech recognition effect. In addition, under the traditional hybrid speech recognition framework, the hot word, word boundary, and language recognition model adaptation methods are relatively mature, and have been successfully commercialized.
[0042] Compared with the traditional speech recognition model, the end-to-end speech recognition model is trained based on a large number of speech-text paired samples. Therefore, the end-to-end speech recognition model is more suitable for general recognition scenarios, such as input method, customer service, etc. In general scenarios, the end-to-end speech recognition model has obvious advantages in speech recognition effect.
[0043] Therefore, the current end-to-end speech recognition model and the traditional speech recognition model can achieve good speech recognition effect in their respective good speech recognition scenarios, but it is difficult to adapt to both recognition scenarios.
[0044] In view of this, the embodiments of the present application provide a speech recognition method applied to a speech recognition device, which compares the recognition texts of the speech to be recognized by a first model completely based on a neural network principle and a second model not completely based on a neural network principle, selects the target text with the highest score as the speech recognition result of the speech to be recognized, so as to achieve the purpose of adapting to general recognition scenarios and specific recognition scenarios.
[0045] Optionally, in the implementation manner, the speech recognition device can be a server. The server can be a single server or a server group. The server group can be centralized or distributed (for example, the server can be a distributed system). When the speech recognition device is a server, the audio to be recognized can be obtained through an audio acquisition device in communication connection with the server.
[0046] In other optional embodiments, the voice recognition device can also be a user terminal. For example, a mobile terminal, a tablet computer, a laptop computer, or a built-in device in a motor vehicle, etc., or any combination thereof. In some embodiments, the mobile terminal can include a smart home device (e.g., a smart speaker), a wearable device, a smart mobile device, a virtual reality device, or an augmented reality device, etc., or any combination thereof. In some embodiments, the smart home device can include a smart lighting device, a control device of a smart electrical appliance, a smart monitoring device, a smart television, a smart camera, or an intercom, etc., or any combination thereof. In some embodiments, the wearable device can include a smart bracelet, a smart shoelace, smart glasses, a smart helmet, a smart watch, smart clothing, a smart backpack, a smart accessory, etc., or any combination thereof. In some embodiments, the smart mobile device can include a smart phone, a personal digital assistant (PDA), a game device, a navigation device, or a point of sale (POS) device, etc., or any combination thereof.
[0047] In optional embodiments, the operating system of the user terminal can be, but is not limited to, an Android system, an IOS (iPhone operating system) system, a Windows phone system, a Windows system, etc. Preferably, in the present embodiment, the operating system of the user terminal is an IOS system.
[0048] The structure of the voice recognition device is shown in Figure 1 The voice recognition device includes a memory 120, a processor 130, and a communication unit 140. The memory 120, the processor 130, and the communication unit 140 are directly or indirectly electrically connected to each other to realize the transmission or interaction of data. For example, the elements can be electrically connected to each other through one or more communication buses or signal lines.
[0049] The memory 120 can be, but is not limited to, a Random Access Memory (RAM), a Read Only Memory (ROM), a Programmable Read-Only memory (PROM), an Erasable Programmable Read-Only Memory (EPROM), an Electric Erasable Programmable Read-Only Memory (EEPROM), and the like. The memory 120 is configured to store a program. The processor 130 is configured to execute the program stored in the memory 120 upon receiving an execution instruction.
[0050] The communication unit 140 is configured to transceive data through a network. The network can include a wired network, a wireless network, a fiber network, a telecommunication network, an intranet, the Internet, a Local Area Network (LAN), a Wide Area Network (WAN), a Wireless Local Area Network (WLAN), a Metropolitan Area Network (MAN), a Wide Area Network (WAN), a Public Switched Telephone Network (PSTN), a Bluetooth network, a ZigBee network, or a Near Field Communication (NFC) network, or the like, or any combination thereof. In some embodiments, the network can include one or more network access points. For example, the network can include wired or wireless network access points, such as base stations and / or network switching nodes, through which one or more components of the service request processing system can connect to the network to exchange data and / or information.
[0051] The communication unit can include a radio frequency unit configured to receive and send radio wave signals (such as electromagnetic waves), to convert radio waves and electrical signals to each other, and to realize wireless communication between the user terminal and the network or other communication devices.
[0052] The processor 130 can be an integrated circuit chip with signal processing capability and can include one or more processing cores (e.g., a single-core processor or a multi-core processor). By way of example only, the processor can include a Central Processing Unit (CPU), an Application Specific Integrated Circuit (ASIC), an Application Specific Instruction-set Processor (ASIP), a Graphics Processing Unit (GPU), a Physics Processing Unit (PPU), a Digital Signal Processor (DSP), a Field Programmable Gate Array (FPGA), a Programmable Logic Device (PLD), a controller, a microcontroller unit, a Reduced Instruction Set Computing (RISC), or a microprocessor, or any combination thereof.
[0053] In optional embodiments, the voice recognition device further includes a peripheral interface, an input / output unit, an audio unit, and a display unit.
[0054] The peripheral interface is configured to couple various input / output devices (e.g., the input / output unit, the audio unit, and the display unit) to the processor 130 and the memory 120. In some embodiments, the peripheral interface and the processor 130 can be implemented in a single chip. In other embodiments, they can be implemented in separate chips.
[0055] The input / output unit is configured to provide input data for a user to interact with the user terminal. The input / output unit can be, but is not limited to, a mouse and a keyboard, etc.
[0056] The audio unit is configured to provide an audio interface for the user, which can include one or more microphones, one or more speakers, and an audio circuit. The voice recognition device can collect the audio to be recognized in the present embodiment through the audio unit.
[0057] The display unit is configured to provide an interactive interface (e.g., a user operation interface) between the user terminal and the user or to display image data. In the present embodiment, the display unit can be a liquid crystal display or a touch display. If the display unit is a touch display, it can be a capacitive touch screen or a resistive touch screen that supports single-point and multi-point touch operations. The support of single-point and multi-point touch operations means that the touch display can sense touch operations generated at one or more positions on the touch display and transmit the sensed touch operations to the processor for calculation and processing.
[0058] Based on the above description, the following embodiments will be described in detail. Figure 2 The specific embodiments of the method will be described in detail as follows. Figure 2 As shown in the method includes:
[0059] S101, obtaining a to-be-recognized speech.
[0060] S102, inputting the to-be-recognized speech into a first model to obtain a first text and a first score of the first text.
[0061] S103, inputting the to-be-recognized speech into a second model to obtain a second text and a second score of the second text.
[0062] S104, selecting a target text with the highest score from the first text and the second text according to the first score and the second score.
[0063] S105, taking the target text as a speech recognition result of the to-be-recognized speech.
[0064] For example, it is assumed that the first text output by the first model has a score of 8.0, and the second text output by the second model has a score of 7.5. Since the text score reflects the accuracy of the recognized text, and the score of the first text is higher than that of the second text, the speech recognition device takes the first text as the target text and the speech recognition result of the to-be-recognized speech.
[0065] Similarly, it is assumed that the first text output by the first model has a score of 6.0, and the second text output by the second model has a score of 7.5. Since the text score reflects the accuracy of the recognized text, and the score of the first text is lower than that of the second text, the speech recognition device takes the second text as the target text and the speech recognition result of the to-be-recognized speech.
[0066] Therefore, the speech recognition device is equipped with a speech recognition model, which includes a first model based entirely on neural network principles and a second model not entirely based on neural network principles. Then, the first and second models are used to obtain the first text, the second text, and scores for each text of the speech to be recognized. Finally, the text with the highest score is taken as the speech recognition result. Since the first model achieves good recognition results in general recognition scenarios, while the second model achieves good recognition results in specific recognition scenarios, it can adapt to both scenarios simultaneously.
[0067] Further research by the inventors revealed that, since the first model and the second model achieve excellent speech recognition results in their respective areas of expertise, the first model's speech recognition results are more reliable in general recognition scenarios; while in specific recognition scenarios, the second model's speech recognition results are more reliable. It should be noted that, for ease of description, the general recognition scenario will be referred to as the first scenario, and the specific recognition scenario as the second scenario in the following embodiments.
[0068] Therefore, this speech recognition device is configured with a first scene factor for general recognition scenarios, and a second scene factor for specific recognition scenarios. For example... Figure 3 As shown, based on the first scene factor and the second scene factor, the target text with the highest score is selected through the following implementation method:
[0069] S104-1, Obtain the target usage scenario of the speech recognition device.
[0070] S104-2, Determine the scenario type of the target usage scenario.
[0071] If the target use case is the first scenario, then execute steps S104-3 and S104-4:
[0072] S104-3, the first score is weighted by the first scene factor to obtain the first weighted score of the first text.
[0073] S104-4, Based on the first weighted score and the second score, select the target text with the highest score from the first text and the second text.
[0074] If the target use case is the second scenario, then execute steps S104-5 and S104-6:
[0075] S104-5, the second score is weighted by the second scene factor to obtain the second weighted score of the second text.
[0076] S104-6, selecting a target text with the highest score from the first text and the second text according to the first score and the second weighted score.
[0077] For example, continue with the first text of 8.0 points and the second text of 7.5 points. Assuming that the target scene is the second scene, and the scene factor of the second scene is 1.1, the first weighted score is 1.1*7.5=8.25; since the first weighted score is greater than the second score at this time, the voice recognition device takes the second text as the target text.
[0078] Assuming that the score of the first text is 8.5 points, it means that even after weighting the second score, it is still lower than the score of the first text, at this time, it means that the credibility of the first text is higher than that of the second text, therefore, the voice recognition device takes the first text as the target text.
[0079] In an optional embodiment, the values of the first scene factor and the second scene factor can be set artificially by the person skilled in the art according to his own experience, therefore, the values of the first scene factor and the second scene factor are not limited to the above examples, the person skilled in the art can adjust them as needed, and this embodiment is not limited.
[0080] In another optional embodiment, the voice recognition device can determine the first scene factor by the following way:
[0081] The voice recognition device counts the first recognition rate of the first model in the first scene and the second recognition rate of the second model in the first scene, and then takes the ratio between the first recognition rate and the second recognition rate as the first scene factor.
[0082] For example, assuming that the first recognition rate of the first model in the first scene is 95%, and the second recognition rate of the second model in the first scene is 70%, the ratio between the first recognition rate and the second recognition rate is 0.95 / 0.7≈1.35. Therefore, the value of the first scene factor is 1.35.
[0083] Similarly, the voice recognition device counts the third recognition rate of the first model in the second scene and the fourth recognition rate of the second model in the second scene, and then takes the ratio between the fourth recognition rate and the third recognition rate as the second scene factor.
[0084] For example, assuming that the third recognition rate of the first model in the second scene is 80%, and the fourth recognition rate of the second model in the second scene is 90%, the ratio between the fourth recognition rate and the third recognition rate is 0.9 / 0.8≈1.12. Therefore, the value of the second scene factor is 1.12.
[0085] Since the target use scenario will affect the final recognition result of the to-be-recognized speech, the embodiment provides multiple implementation manners for determining the use scenario of the speech device.
[0086] Optionally, in an implementation manner, the speech recognition device is configured with a first vocabulary corresponding to a first scenario and a second vocabulary corresponding to a second scenario.
[0087] Based on the two vocabularies, the speech recognition device acquires a first use frequency of the first vocabulary and a second use frequency of the second vocabulary; then, according to the first use frequency and the second use frequency, selects a target vocabulary meeting a preset condition from the first vocabulary and the second vocabulary; and finally, according to the target vocabulary, determines a target use scenario.
[0088] For example, the user can ask the smart speaker a question, the smart speaker converts the question of the user into text, then analyzes the text through a text analysis model (for example, an LSTM network), and finally generates an answer to the question according to the analysis result. Or, the user can control the smart speaker to play music, audio novels, and other devices through voice. In this example, when the user of the smart speaker is an adult, the use scenario of the smart speaker is regarded as a first scenario; and when the user of the smart speaker is a child, the use scenario of the smart speaker is regarded as a second scenario.
[0089] Considering that the words accumulated by children are mostly about fairy tales, animation, children's songs and the like, the words related to fairy tales, animation and children's songs are collected as a second vocabulary, and the words in a general scenario are collected as a first vocabulary. Then, the speech recognition device periodically counts the use frequencies of the first vocabulary and the second vocabulary, and then selects a vocabulary with the largest use frequency as a target vocabulary, and the scenario corresponding to the target vocabulary as a target use scenario.
[0090] In this example, the use frequency represents the number of times that the words in the historical speech are successfully matched with the first vocabulary and the second vocabulary in a statistical period. Assuming that the statistical period is one week, and the number of times that the first vocabulary is successfully matched is 10 times and the number of times that the second vocabulary is successfully matched is 35 times within the one week, it can be determined that the target vocabulary is the second vocabulary and the target use scenario is the second scenario.
[0091] Optionally, in other embodiments, the voice recognition device can also receive a scene configuration instruction input by a user; then, determine the target use scene according to the scene configuration instruction. Wherein, the user can issue the scene configuration instruction to the voice recognition device through voice input; and can also input the scene configuration instruction through the control provided by the voice recognition device. The control can be a button provided by the voice recognition device or a scene configuration control displayed in the human-computer interaction interface provided by the voice recognition device.
[0092] It should be noted that the same voice recognition device can have both the above two functions for determining the use scene of the voice recognition device. The user can select one of the embodiments for determining the target use scene through the configuration mode provided by the voice recognition device, or simultaneously start the above two embodiments for determining the use scene of the voice recognition device.
[0093] In this embodiment, the first score and the second score are obtained by scoring the first text and the second text according to the same scoring standard. The structure of the voice recognition model is as shown in Figure 4 , wherein the first model includes an acoustic recognition layer and a decoding layer, wherein the acoustic recognition layer includes an encoding layer and a connection time series classification layer, and the decoding layer provides the above scoring standard; the second model includes a language recognition layer with a dictionary.
[0094] Based on the above structure of the voice recognition model, optionally, in the embodiments, the voice recognition device can obtain the first text and the first score of the first text through the following embodiments:
[0095] The voice recognition device inputs the to-be-recognized voice into the acoustic recognition layer to obtain the acoustic encoding information of the to-be-recognized voice output by the encoding layer; then, inputs the acoustic encoding information into the decoding layer to obtain a plurality of first candidate texts and a plurality of scores of the plurality of first candidate texts respectively; and finally, obtains the first text and the first score of the first text according to the plurality of scores of the plurality of first candidate texts respectively.
[0096] Wherein, the voice recognition device can select the first candidate text with the highest score from the plurality of first candidate texts according to the plurality of scores of the plurality of first candidate texts respectively, as the first text.
[0097] It should be understood that, Figure 4 The encoding layer in is used for encoding the to-be-recognized voice to obtain the acoustic encoding information of the to-be-recognized voice.
[0098] The connection time series classification (CTC) layer is used for classifying the acoustic encoding information to obtain the acoustic recognition result of the to-be-recognized voice, i.e. the corresponding pronunciation unit of the to-be-recognized voice.
[0099] The decoding layer is used to decode the acoustic coding information output by the coding layer, obtain multiple first candidate texts of the speech to be recognized, and score each first candidate text.
[0100] Referring again to 4, in an optional implementation, the first model may further include an attention mechanism layer located between the decoding layer and the encoding layer to further improve the accuracy of speech recognition.
[0101] Based on the above structure of the speech recognition model, the second model can reuse the acoustic recognition layer and decoding layer of the first model, using the acoustic recognition layer as the feature extraction layer and acoustic model layer of the second model, and then obtain the second text and the first score of the second text through the following implementation method:
[0102] The speech recognition device first identifies the acoustic recognition results output by the temporal classification layer through a language recognition layer with a dictionary, and obtains multiple second candidate texts; then, it inputs the multiple second candidate texts into the decoding layer to obtain the scores of each of the multiple second candidate texts; finally, based on the scores of each of the multiple second candidate texts, it obtains the second text and the second score of the second text.
[0103] The speech recognition device can select the second candidate text with the highest score from multiple second candidate texts as the second text.
[0104] like Figure 5 As shown, in an optional embodiment, the speech recognition device acquires sample speech; inputs the sample speech into a configured training model for recognition; and finally, adjusts the model parameters of the speech recognition model to be trained based on the acoustic loss and text loss of the training model in recognizing the sample speech, so as to obtain the first model mentioned above.
[0105] The acoustic loss is calculated from the predicted pronunciation output by the connection-time classification layer, and the text loss is calculated from the predicted text output by the decoding layer. For example, the acoustic loss can be obtained based on the connection-time classification criterion, and the text loss can be obtained based on the cross-entropy criterion. Optionally, the speech recognition device can perform a weighted summation of these two training losses, and then adjust the model parameters of the speech recognition model to be trained based on the weighted summation result to obtain the first model described above.
[0106] Based on the same inventive concept as the speech recognition method, this embodiment also provides an apparatus related to the method, including:
[0107] The embodiment also provides a speech recognition device applied to a speech recognition apparatus; the speech recognition device comprises at least one function module stored in a memory in a software form, wherein the speech recognition apparatus is configured with a speech recognition model, the speech recognition model comprises a first model completely based on a neural network principle and a second model not completely based on the neural network principle. Figure 6 As shown in the figure, the speech recognition device can comprise, in terms of functions:
[0108] a speech module 201, configured to acquire a speech to be recognized.
[0109] In the embodiment, the speech module 201 can be used to implement step S101 in the method, and the detailed description of the speech module 201 can be referred to the detailed description of step S101. Figure 2
[0110] a score module 202, configured to input the speech to be recognized into the first model, to obtain a first text and a first score of the first text.
[0111] The score module 202 is further configured to input the speech to be recognized into the second model, to obtain a second text and a second score of the second text.
[0112] In the embodiment, the score module 202 can be used to implement steps S102 and S103 in the method, and the detailed description of the score module 202 can be referred to the detailed description of steps S102 and S103. Figure 2
[0113] a text module 203, configured to select a target text with the highest score from the first text and the second text according to the first score and the second score.
[0114] The text module 203 is further configured to take the target text as a speech recognition result of the speech to be recognized.
[0115] In the embodiment, the text module 203 can be used to implement steps S104 and S105 in the method, and the detailed description of the score module 202 can be referred to the detailed description of steps S104 and S105. Figure 2
[0116] Optionally, the manner in which the text module 203 acquires the target text comprises:
[0117] acquiring a target use scenario of the speech recognition apparatus;
[0118] if the target use scenario is a first scenario, performing weighted processing on the first score by using a first scenario factor to obtain a first weighted score of the first text;
[0119] According to the first weighted score and the second score, a target text with the highest score is selected from the first text and the second text;
[0120] If the target use scenario is the second scenario, the second score is weighted by a second scenario factor to obtain a second weighted score of the second text;
[0121] According to the first score and the second weighted score, a target text with the highest score is selected from the first text and the second text.
[0122] In an optional implementation, the speech recognition device is configured with a first vocabulary corresponding to the first scenario and a second vocabulary corresponding to the second scenario, and the text module 203 obtains the target use scenario in the following manner:
[0123] Obtain a first use frequency of the first vocabulary and a second use frequency of the second vocabulary;
[0124] According to the first use frequency and the second use frequency, a target vocabulary satisfying a preset condition is selected from the first vocabulary and the second vocabulary;
[0125] According to the target vocabulary, the target use scenario is determined.
[0126] In an optional implementation, the text module 203 obtains the target use scenario in the following manner:
[0127] Receive a scenario configuration instruction input by a user;
[0128] According to the scenario configuration instruction, the target use scenario is determined.
[0129] In an optional implementation, the first score and the second score are obtained by scoring the first text and the second text by the same scoring standard.
[0130] In an optional implementation, the first model includes an acoustic recognition layer and a decoding layer, wherein the acoustic recognition layer includes an encoding layer and a connection time sequence classification layer, and the decoding layer provides the scoring standard; and the second model includes a language recognition layer with a dictionary.
[0131] The score module 202 obtains the first score in the following manner:
[0132] Input the speech to be recognized into the acoustic recognition layer to obtain acoustic encoding information of the speech to be recognized output by the encoding layer;
[0133] Input the acoustic encoding information into the decoding layer to obtain a plurality of first candidate texts and a score of each of the plurality of first candidate texts;
[0134] According to the score of each of the plurality of first candidate texts, the first text and the first score of the first text are obtained.
[0135] The score module 202 obtains the second score in the following manner:
[0136] The acoustic recognition result output by the connection time sequence classification layer is recognized by a language recognition layer with a dictionary to obtain a plurality of second candidate texts;
[0137] The plurality of second candidate texts are input into a decoding layer to obtain a score of each of the plurality of second candidate texts;
[0138] The second text and the second score of the second text are obtained according to the score of each of the plurality of second candidate texts.
[0139] The embodiment further provides a speech recognition device, which comprises a processor and a memory, and the memory stores a computer program, and the computer program is executed by the processor to implement the speech recognition method.
[0140] The embodiment further provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the speech recognition method.
[0141] The embodiment further provides a computer program product, which comprises computer programs / instructions, and the computer programs / instructions are executed by a processor to implement the speech recognition method.
[0142] To sum up, in the speech recognition method and the related device provided by the embodiment of the application, the speech recognition device is configured with a speech recognition model, and the speech recognition model comprises a first model completely based on a neural network principle and a second model not completely based on the neural network principle; then, the first text and the second text of the speech to be recognized and the scores of the two texts are obtained by the first model and the second model respectively, and finally, the text with the highest score is taken as the speech recognition result of the speech to be recognized. Since the first model can take a good recognition effect in a general recognition scene, and the second model can take a good recognition effect in a specific recognition scene, the purpose of simultaneously adapting to the two scenes can be achieved.
[0143] In the embodiments of the present disclosure, it should be understood that the disclosed apparatus and method can also be implemented in other manners. The embodiments described above are merely exemplary. For example, the flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architectures, functions and operation of the apparatus, method and computer program product according to the embodiments of the present disclosure. In this regard, each block in the flowcharts and block diagrams can represent a module, a segment or a portion of code which comprises one or more executable instructions for implementing the specified logic function. It should also be noted that in some alternative implementations, the functions noted in the blocks can occur out of the order noted in the accompanying drawings. For example, two blocks noted in succession can in fact be executed substantially concurrently or in the reverse order, depending on the functionality involved. It should also be noted that each block in the block diagrams and / or flowcharts and combinations of blocks in the block diagrams and / or flowcharts can be implemented by dedicated hardware-based systems which perform the specified functions or actions, or can be implemented by a combination of dedicated hardware-based systems and computer instructions.
[0144] In addition, the various functional modules in the embodiments of the present disclosure can be integrated together to form a separate part, or each module can exist independently, or two or more modules can be integrated to form a separate part.
[0145] If the functions are implemented in the form of software function modules and sold or used as an independent product, they can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present disclosure essentially or partly, or a part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present disclosure. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk, and various other media which can store program codes.
[0146] The above describes only various embodiments of the present disclosure, but the protection scope of the present disclosure is not limited thereto. Any person skilled in the art can easily think of changes or replacements within the technical scope disclosed in the present disclosure, which should be covered within the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be subject to the protection scope of the claims.
Claims
1. A voice recognition method, characterized by, The application is applied to a speech recognition device configured with a speech recognition model, the speech recognition model comprising a first model completely based on a neural network principle and a second model not completely based on a neural network principle, the first model comprising an acoustic recognition layer and a decoding layer, wherein the decoding layer provides a scoring standard, the acoustic recognition layer comprising an encoding layer and a connection time sequence classification layer; the second model reuses the acoustic recognition layer and the decoding layer and further comprises a language recognition layer with a dictionary, the first model further comprising an attention mechanism layer between the decoding layer and the encoding layer, the method comprising: acquiring a speech to be recognized; inputting the speech to be recognized into the acoustic recognition layer to obtain acoustic encoding information of the speech to be recognized output by the encoding layer; inputting the acoustic encoding information into the decoding layer to obtain a plurality of first candidate texts and scores of the plurality of first candidate texts respectively; obtaining a first text and a first score of the first text according to the scores of the plurality of first candidate texts respectively; recognizing acoustic recognition results output by the connection time sequence classification layer through the language recognition layer with a dictionary to obtain a plurality of second candidate texts; inputting the plurality of second candidate texts into the decoding layer to obtain scores of the plurality of second candidate texts respectively; obtaining a second text and a second score of the second text according to the scores of the plurality of second candidate texts respectively; selecting a target text with the highest score from the first text and the second text according to the first score and the second score; taking the target text as a speech recognition result of the speech to be recognized.
2. The voice recognition method of claim 1, wherein, The method of selecting a target text with the highest score from the first text and the second text according to the first score and the second score comprises: acquiring a target use scenario of the speech recognition device; if the target use scenario is a first scenario, weighting the first score by a first scenario factor to obtain a first weighted score of the first text; selecting a target text with the highest score from the first text and the second text according to the first weighted score and the second score; if the target use scenario is a second scenario, weighting the second score by a second scenario factor to obtain a second weighted score of the second text; selecting a target text with the highest score from the first text and the second text according to the first score and the second weighted score.
3. The voice recognition method of claim 2, wherein, The speech recognition device is configured with a first word bank corresponding to the first scenario and a second word bank corresponding to the second scenario, and the method of acquiring a target use scenario of the speech recognition device comprises: acquiring a first use frequency of the first word bank and a second use frequency of the second word bank; selecting a target word bank satisfying a preset condition from the first word bank and the second word bank according to the first use frequency and the second use frequency; determining the target use scenario according to the target word bank.
4. The voice recognition method of claim 2, wherein, The method of acquiring a target use scenario of the speech recognition device comprises: receiving a scenario configuration instruction input by a user; According to the scene configuration instruction, the target use scene is determined.
5. A speech recognition apparatus characterized by comprising: The speech recognition device is configured with a speech recognition model, the speech recognition model comprising a first model based entirely on a neural network principle and a second model based on a non-neural network principle, the first model comprising an acoustic recognition layer and a decoding layer, wherein the decoding layer provides a scoring standard, the acoustic recognition layer comprising an encoding layer and a connection time sequence classification layer; the second model reuses the acoustic recognition layer and the decoding layer, and further comprises a language recognition layer with a dictionary, the first model further comprising an attention mechanism layer between the decoding layer and the encoding layer, the speech recognition device comprising: a speech module configured to acquire a speech to be recognized; a scoring module configured to input the speech to be recognized into the acoustic recognition layer to obtain acoustic encoding information of the speech to be recognized output by the encoding layer; input the acoustic encoding information into the decoding layer to obtain a plurality of first candidate texts and respective scores of the plurality of first candidate texts; obtain a first text and a first score of the first text according to the respective scores of the plurality of first candidate texts; recognize acoustic recognition results output by the connection time sequence classification layer through the language recognition layer with a dictionary to obtain a plurality of second candidate texts; input the plurality of second candidate texts into the decoding layer to obtain respective scores of the plurality of second candidate texts; obtain a second text and a second score of the second text according to the respective scores of the plurality of second candidate texts; a text module configured to select a target text with the highest score from the first text and the second text according to the first score and the second score; the text module is further configured to take the target text as a speech recognition result of the speech to be recognized.
6. A speech recognition device, characterized by The speech recognition device comprises a processor and a memory, the memory storing a computer program, the computer program being executed by the processor to implement the speech recognition method of any one of claims 1-4.
7. A computer readable storage medium characterized in that, The computer readable storage medium stores a computer program, the computer program being executed by the processor to implement the speech recognition method of any one of claims 1-4.
8. A computer program product, characterised in that, The computer program / instructions are executed by the processor to implement the speech recognition method of any one of claims 1-4.
Citation Information
Patent Citations
Natural speech recognition method, natural speech recognition device and natural speech recognition system based on local and cloud hybrid recognition
CN106328148A
Speech recognition method, device and equipment, and computer readable storage medium
CN110534095A
Speech recognition method and appratus
CN111292728A