A speech recognition method and apparatus

By processing multiple input speech messages in parallel on a graphics processor and using a heuristic method to determine the end of the speech, the slow response speed of existing speech recognition systems is solved, achieving fast and accurate speech recognition.

CN115188382BActive Publication Date: 2026-02-17KE COM (BEIJING) TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210540451.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-17
Publication Date
2026-02-17
Estimated Expiration
2042-05-17

AI Technical Summary

Technical Problem

Existing speech recognition systems are slow to respond when processing large amounts of input speech, resulting in system lag and failing to meet users' needs for rapid response.

Method used

By leveraging the parallel computing capabilities of graphics processing units (GPUs), multiple input speech samples are processed in parallel, and the parallel recognition model simultaneously outputs text recognition results. Heuristic methods are used to determine the end of speech recognition, reducing the impact of path truncation and improving accuracy.

Benefits of technology

It significantly improves the processing speed of the speech recognition system, reduces processing time, and enhances the system's real-time performance and accuracy, reducing processing time by more than 30% compared to existing technologies.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115188382B_ABST
    Figure CN115188382B_ABST
Patent Text Reader

Abstract

The application provides a speech recognition method and device, comprising: obtaining a plurality of input speech to be recognized; inputting each input speech into a speech recognition model running on a graphic processor at the same time to obtain text recognition results corresponding to each input speech output by the speech recognition model at the same time; wherein the speech recognition model is used to encode the input speech into a feature representation, and based on the feature representation and a recognition result of a previous moment of the input speech, recognize a current moment of the input speech to obtain a current moment recognition result until the recognition is completed to obtain a text recognition result of the input speech. The application utilizes the parallel computing capability of the graphic processor, and through the speech recognition model running on the graphic processor, simultaneously and in parallel processes a plurality of input input speech and simultaneously outputs a recognition result, thereby realizing a process of quickly performing speech recognition on a large amount of input speech.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of speech recognition, in particular to a speech recognition method and device. BACKGROUND

[0002] Automatic Speech Recognition (ASR) technology is a technology to solve how to make better communication between human and machine. With the continuous expansion of the application range of speech recognition technology, the user's requirement for the response speed of the speech recognition system is getting higher and higher, so as to better meet the needs of user interaction, which poses a great challenge to the speech recognition system. The speech recognition system applied in the prior art has certain hysteresis in system response speed due to the consideration of global input speech information, thereby the speech recognition system has problems such as slow processing speed when facing a large amount of input speech. SUMMARY

[0003] The present application provides a speech recognition method and device to solve the defect of slow response speed of the speech recognition system in the prior art, and realizes fast response recognition of a large amount of input speech.

[0004] The present application provides a speech recognition method, comprising:

[0005] obtaining a plurality of input speech to be recognized;

[0006] inputting each of the input speech into a speech recognition model running on a graphics processor at the same time to obtain text recognition results corresponding to each of the input speech output by the speech recognition model at the same time;

[0007] wherein the speech recognition model is trained based on a sample speech and a text corresponding to the sample speech;

[0008] the speech recognition model is used to encode the input speech into a feature representation, and according to the feature representation and the recognition result of the previous moment of the input speech, to recognize the current moment of the input speech to obtain the current moment recognition result, until the recognition is completed, to obtain the text recognition result of the input speech.

[0009] According to the speech recognition method provided by the present application, the plurality of input speech to be recognized is obtained, and then further comprising:

[0010] caching the length of each of the input speech to be recognized;

[0011] determining the position of the end symbol of each of the input speech according to the length of the cached input speech.

[0012] The voice recognition method provided by the application comprises the following steps: determining the position of the end symbol of each input voice according to the length of each input voice in the cache; processing each input voice to be recognized into a voice with consistent length, so that each input voice forms an input matrix.

[0013] The voice recognition method provided by the application comprises the following steps: determining the position of the end symbol of each input voice according to the length of each input voice in the cache; processing each input voice to be recognized into a voice with consistent length, so that each input voice forms an input matrix.

[0014] In each input voice, the longest voice is taken as a reference, and other input voices are processed into voices with consistent length with the reference voice by means of supplementing placeholders, so that input voices with the same length form an input matrix.

[0015] The voice recognition method provided by the application comprises the following steps: determining the position of the end symbol of each input voice according to the length of each input voice in the cache; processing each input voice to be recognized into a voice with consistent length, so that each input voice forms an input matrix.

[0016] The voice recognition method provided by the application comprises the following steps: determining the position of the end symbol of each input voice according to the length of each input voice in the cache; processing each input voice to be recognized into a voice with consistent length, so that each input voice forms an input matrix.

[0017] The voice recognition method provided by the application comprises the following steps: determining the position of the end symbol of each input voice according to the length of each input voice in the cache; processing each input voice to be recognized into a voice with consistent length, so that each input voice forms an input matrix.

[0018] The voice recognition method provided by the application comprises the following steps: determining the position of the end symbol of each input voice according to the length of each input voice in the cache; processing each input voice to be recognized into a voice with consistent length, so that each input voice forms an input matrix.

[0019] The voice recognition method provided by the application comprises the following steps: determining the position of the end symbol of each input voice according to the length of each input voice in the cache; processing each input voice to be recognized into a voice with consistent length, so that each input voice forms an input matrix.

[0020] The voice recognition method provided by the application comprises the following steps: determining the position of the end symbol of each input voice according to the length of each input voice in the cache; processing each input voice to be recognized into a voice with consistent length, so that each input voice forms an input matrix.

[0021] The voice recognition method provided by the application comprises the following steps: determining the position of the end symbol of each input voice according to the length of each input voice in the cache; processing each input voice to be recognized into a voice with consistent length, so that each input voice forms an input matrix.

[0022] The voice recognition method provided by the application comprises the following steps: determining the position of the end symbol of each input voice according to the length of each input voice in the cache; processing each input voice to be recognized into a voice with consistent length, so that each input voice forms an input matrix.

[0023] The voice recognition method provided by the application comprises the following steps: determining the position of the end symbol of each input voice according to the length of each input voice in the cache; processing each input voice to be recognized into a voice with consistent length, so that each input voice forms an input matrix.

[0024] According to the speech recognition method provided by the application, the end of recognition is identified in response to the end symbol of the input speech, and a text recognition result of the input speech is obtained, and the method specifically comprises the following steps:

[0025] According to the recognition result generated at each time in the input speech decoding, a plurality of candidate paths of the input speech are generated, wherein one of the candidate paths represents a text recognition result.

[0026] According to the end symbol of the input speech, a candidate result of each candidate path is obtained.

[0027] According to each candidate result, a corresponding candidate path length is determined.

[0028] According to the path length of each candidate path, a total path length is determined.

[0029] The average value of each candidate path is obtained by taking the total path length as the denominator and the candidate path length as the numerator.

[0030] The candidate result of the candidate path with the maximum average value is taken as the text recognition result of the input speech.

[0031] The application further provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the speech recognition method according to any one of the above.

[0032] The application further provides a computer program product, comprising computer programs / instructions, which, when executed by a processor, implement the steps of the speech recognition method according to any one of the above.

[0033] The application further provides a non-transitory computer-readable storage medium, which stores a computer program, and the computer program, when executed by a processor, implements the steps of the speech recognition method according to any one of the above.

[0034] The speech recognition method and device provided by the application utilize the parallel computing capability of a graphics processor, simultaneously and parallelly process a plurality of input speeches by running a speech recognition model on the graphics processor, and simultaneously output recognition results, thereby realizing fast simultaneous recognition processing of a plurality of input speeches. BRIEF DESCRIPTION OF DRAWINGS

[0035] In order to more clearly illustrate the technical solutions of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings described below are some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained from these drawings without creative labor.

[0036] Figure 1 is the flow chart of the speech recognition method provided by the present application;

[0037] Figure 2 is the specific method flow chart corresponding to step 120 in Figure 1

[0038] Figure 3 is the specific method flow chart corresponding to step 230 in Figure 2

[0039] Figure 4 is the specific method flow chart corresponding to step 310 in Figure 3

[0040] Figure 5 is the schematic diagram of the process principle of the speech recognition in the prior art;

[0041] Figure 6 is the schematic diagram of the process principle of the speech recognition provided by the present application;

[0042] Figure 7 is the structural schematic diagram of the speech recognition device provided by the present application;

[0043] Figure 8 is the structural schematic diagram of the electronic device provided by the present application. DETAILED DESCRIPTION

[0044] In order to make the purpose, technical solutions and advantages of the present application more clear, the technical solutions in the present application will be described clearly and completely in the following by combining the drawings in the present application. Obviously, the described embodiments are some embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all the other embodiments obtained by those skilled in the art without creative labor are within the protection scope of the present application.

[0045] ​​​The speech recognition method provided by the embodiment of the present application mainly aims at decoding acceleration of the current mainstream end-to-end speech recognition system. The model with better speech recognition effect at present is the speech recognition system based on attention mechanism, which comprehensively determines the output result by comprehensively considering the information of the entire input sentence. The disadvantage brought by this is that the system has large hysteresis, that is, it cannot quickly meet the response needs of the user. In addition, due to the long processing time of speech, much time is consumed to process a large amount of input speech, and the real-time performance of the system is poor.

[0046] As shown in Figure 1 The embodiment of the present application provides a speech recognition method, comprising:

[0047] Step 110: acquiring a plurality of input speeches to be recognized;

[0048] In the embodiment of the present application, each input speech to be recognized includes a plurality of speech segments at different time points. For example, each time point has a length of 5 milliseconds, 10 milliseconds, 15 milliseconds, 20 milliseconds, etc., and the embodiment of the present application does not limit this.

[0049] In the embodiment of the present application, the plurality of input speeches to be recognized are simultaneously input into the speech recognition model running on the graphics processor in step 120.

[0050] In the embodiment of the present application, corresponding to step 110, the acquisition of the plurality of input speeches to be recognized further comprises:

[0051] The length of each input speech to be recognized is cached.

[0052] The position of the end symbol of each input speech is determined according to the length of each input speech cached.

[0053] Specifically, since a plurality of input speeches are processed at the same time, and the length of each input speech may be different, the length of each input speech needs to be cached in order to distinguish the end of each input speech in subsequent model recognition.

[0054] In the embodiment of the present application, after determining the position of the end symbol of each input speech according to the length of each input speech in the cache, the method further comprises: processing each input speech to be recognized into a speech with consistent length, so that each input speech forms an input matrix. In the embodiment of the present application, the applied graphics processing unit (GPU) is a microprocessor specially used for image and graphics related operations. The GPU plays a large role in parallel computing and model training. The embodiment of the present application utilizes the parallel computing capability of the GPU to accelerate the speech recognition system. However, due to the limitation of the logical processing capability of the GPU application, the data input into the GPU requires the same dimension and consistent length. Therefore, each input speech is processed into a speech with consistent length, so that each input speech forms an input matrix and is input into the speech recognition model.

[0055] Specifically, the processing of each input speech to be recognized into a speech with consistent length, so that each input speech forms an input matrix, specifically comprises:

[0056] In each input speech, the longest speech is taken as a reference, and other input speeches are processed into speeches with consistent length with the reference speech by means of supplementing placeholders, so that each input speech with the same length forms an input matrix. In the embodiment of the present application, each input speech is processed into a speech with consistent length by means of supplementing placeholders, that is, other input speech sentences are supplemented to be as long as the longest sentence. In this way, it is ensured that the lengths of multiple input speeches in a batch are consistent, forming an input matrix. In combination with the aforementioned caching of the real length of each input speech to be recognized, instead of the length of the speech after supplementing placeholders, so that the speech recognition model does not calculate redundant placeholders when operating, the real time at which each speech should be recognized is determined.

[0057] Step 120: inputting each input speech into a speech recognition model running on a graphics processing unit at the same time to obtain text recognition results corresponding to each input speech output by the speech recognition model at the same time;

[0058] The speech recognition model is trained based on a sample speech and a text corresponding to the sample speech.

[0059] The speech recognition model is used for encoding an input speech into a high-dimensional feature representation, recognizing a current time of the input speech based on the high-dimensional feature representation and a recognition result of a previous time of the input speech to obtain a current time recognition result, until the recognition is completed, and obtaining a text recognition result of the input speech.

[0060] The speech recognition model comprises an encoder (Endocer) and a decoder (Decoder), and the speech recognition model is an attention mechanism (Attention) based speech recognition model, and belongs to an end-to-end system (End2End).

[0061] In the embodiment of the application, corresponding to step 120, the input speech is input into the speech recognition model running on the graphic processor at the same time, and text recognition results corresponding to the input speech are obtained by the speech recognition model at the same time, as shown in Figure 2 The step 210 comprises the following steps:

[0062] The step 210 comprises the following steps:

[0063] The step 220 comprises the following steps:

[0064] In the embodiment of the application, the intermediate state vector of each input speech is cached by the step 220, that is, the high-dimensional output of the encoder in the step 210, so that the data cached by the step 220 can be directly applied when the corresponding decoder in the step 230 predicts the input speech, and the output of the encoder in the step 210 does not need to be calculated repeatedly, so that the purpose of acceleration is achieved.

[0065] The step 230 comprises the following steps:

[0066] In the embodiment of the application, the input speech comprises speech features; corresponding to the step 230, the step 310 comprises the following steps: Figure 3 The step 310 comprises the following steps:

[0067] The step 310 comprises the following steps:

[0068] Specifically, when the decoder recognizes that the speech feature of the current time of the input speech is a start symbol of the speech, the recognition result of the corresponding previous time in the step 310 is empty.

[0069] The step 320 comprises the following steps:

[0070] Specifically, the output result of the speech feature of the current time of the input speech is cached by step 320 as the input of the decoder to predict the speech feature of the next time of the input speech, so as to accelerate the purpose.

[0071] Step 330: The decoder continues to identify the speech features of each time after the current time of the input speech in sequence, and the identification is ended in response to the recognition of the end symbol of the input speech, and the text recognition result of the input speech is obtained. In the embodiment of the application, the decoder outputs the recognition result (predicted word) of the current time according to the output of the encoder and the recognition result (predicted word) of the previous time, and outputs one predicted word at each time until the end symbol is recognized.

[0072] In the embodiment of the application, in response to the recognition of the end symbol of the input speech, the identification is ended, and the text recognition result of the input speech is obtained, as shown in Figure 4 , specifically comprising:

[0073] Step 410: According to the recognition result generated in the input speech decoding of each time, a plurality of candidate paths of the input speech are generated, wherein one of the candidate paths represents a text recognition result;

[0074] Specifically, during the decoding process of the decoder, a plurality of possible candidate paths of an input speech are generated, and each candidate path represents a possible recognition result of the input speech.

[0075] Step 420: According to the end symbol of the input speech, the candidate results of each candidate path are obtained;

[0076] Specifically, when all the candidate paths predict the end symbol, that is, there is no surviving candidate path, the entire decoding process of the input speech is ended, and the information of all the candidate paths at this time is retained.

[0077] Step 430: The length of each candidate path is determined according to the corresponding candidate result;

[0078] Step 440: The total path length is determined according to the path length of each candidate path;

[0079] Step 450: The average value of each candidate path is obtained by taking the total path length as the denominator and the candidate path length as the numerator;

[0080] Step 460: The candidate result of the candidate path with the largest average value is taken as the text recognition result of the input speech.

[0081] Specifically, the recognition result on the candidate path with the highest average value is returned as the final output text recognition result of the input speech.

[0082] In the embodiment of the present application, since the end symbol recognized by the decoder is predicted, there is a certain uncertainty, and the prediction position of the end symbol recognized by the decoder can be wrong, so that the decoding process ends too early, which greatly affects the accuracy of speech recognition. Therefore, the embodiment of the present application uses the heuristic method as described in steps 410-460 to determine when the decoding ends, and through the heuristic method, the influence of the early ending of the decoding on the accuracy of speech recognition is eliminated. Through the heuristic method, the problem of path truncation can be effectively reduced, and the accuracy of speech recognition can be effectively improved.

[0083] As Figure 5 shown is a working principle schematic diagram of a prior art speech recognition system based on an attention mechanism, the speech recognition system runs on a CPU system, input sentences are sent into the speech recognition system one by one, the speech recognition system processes the input speech one by one, and outputs the recognition result one by one, and the whole recognition process is performed in series.

[0084] As Figure 6 shown is a working principle schematic diagram of a speech recognition method provided by the embodiment of the present application, Figure 5 the method in the embodiment of the present application can send multiple sentences at a time and process them in parallel, and then generate multiple recognition results at a time, which greatly improves the processing capacity of the system.

[0085] The speech recognition method provided by the embodiment of the present application simultaneously processes multiple input speeches in parallel by using the parallel computing capability of the GPU, and records the intermediate state of each speech, so as to be directly applied by the decoder in the subsequent speech recognition model, thereby improving the decoding efficiency; the shorter input speech is filled in a manner, to meet the requirement of the input data for the GPU calculation, and the real length of each input speech is recorded, so as to return the recognition result of the real input speech; through the heuristic method, the judgment of the end of the speech recognition process is performed, thereby effectively reducing the problem of path truncation, and effectively improving the accuracy of speech recognition.

[0086] In the embodiment of the present application, before a plurality of input speech to be recognized is input to a speech recognition model running on a GPU for processing, the length of each input speech is first padded to meet the requirements for processing each input speech on the GPU, so that the parallel computing capability of the GPU can be fully utilized in the speech recognition model processing process to improve the processing speed. During the processing of the speech recognition model, on the one hand, the encoder encodes each input speech to obtain a high-dimensional feature representation as an intermediate state vector of each input speech, so that the decoder directly uses the cached high-dimensional feature representation as one input of the decoder when decoding each input speech, and the other input of the decoder is the output result of the decoder for the previous input speech, thereby achieving the purpose of speeding up the processing of the current (target) input speech, and realizing the fast response recognition of a large number of input speeches. Through simulation experiments, it is verified that the speech processing method provided by the embodiment of the present application reduces the speech recognition processing time by more than 30% compared with the prior art method. The speech recognition task that takes 24 hours to complete by the prior art method can be completed in about 16 hours by applying the method provided by the embodiment of the present application.

[0087] The speech recognition device provided by the embodiment of the present application is described below. The speech recognition device described below can be referred to in correspondence with the speech recognition method described above, as shown in the following description. Figure 7 The speech recognition device provided by the embodiment of the present application comprises:

[0088] The input speech to be recognized acquisition unit 710 is configured to acquire a plurality of input speeches to be recognized.

[0089] The speech recognition unit 720 is configured to simultaneously input each input speech to a speech recognition model running on a graphics processing unit to obtain text recognition results corresponding to each input speech simultaneously output by the speech recognition model.

[0090] The speech recognition model is trained based on a sample speech and a text corresponding to the sample speech.

[0091] The speech recognition model is configured to recognize the current time of the input speech based on the encoding of the input speech into a high-dimensional feature representation, and the recognition result of the previous time of the input speech, to obtain the current time recognition result, until the recognition is completed, to obtain the text recognition result of the input speech.

[0092] In the embodiment of the present application, the speech recognition device further comprises an input speech length buffering unit for buffering the lengths of each piece of input speech to be recognized; and an end symbol determination unit for determining the positions of the end symbols of each piece of input speech according to the buffered lengths of each piece of input speech. Specifically, since multiple pieces of input speech are processed at the same time, and the lengths of each piece of input speech can be different, the lengths of each piece of input speech need to be buffered so as to distinguish the end of each piece of input speech in subsequent model recognition.

[0093] In the embodiment of the present application, the speech recognition device further comprises an input speech length padding unit for processing each piece of input speech to be recognized into speech with consistent length, so that each piece of input speech forms an input matrix. In the embodiment of the present application, since the application of GPU is limited by logical processing capacity, the data input to the GPU requires the same dimension and consistent length, so that each piece of input speech is processed into speech with consistent length by the input speech length padding unit, and then input to the speech recognition model after forming an input matrix.

[0094] In the processing process of the input speech length padding unit, the longest speech is taken as a reference in each piece of input speech, and other input speech is processed into speech with consistent length with the reference speech by means of supplementing placeholders. Specifically, each piece of input speech is processed into speech with consistent length by means of supplementing placeholders. In combination with the input speech length buffering unit, the real length of each piece of input speech to be recognized is buffered instead of the length of speech after supplementing placeholders, so that the speech recognition model does not calculate redundant placeholders when operating, and determines the real time when each piece of speech should be recognized to end. The input speech length padding unit meets the data processing requirements of the GPU, and the input speech length buffering unit makes the speech recognition model recognize to end at the end time point of the real speech length, thereby improving the system processing speed and avoiding waste of computing resources.

[0095] In the embodiment of the present application, the speech recognition model comprises an encoder (Endocer) and a decoder (Decoder), and the speech recognition model is an attention mechanism (Attention) based speech recognition model, which belongs to an end-to-end system (End2End).

[0096] In the embodiment of the present application, the speech recognition unit 720 comprises:

[0097] The high-dimensional feature representation set acquisition subunit is configured to encode each piece of input speech into a high-dimensional feature representation set by means of the encoder;

[0098] The high-dimensional feature representation set buffering subunit is configured to buffer the high-dimensional feature representation set;

[0099] The decoding output subunit is configured to simultaneously decode each input speech by using the cached high-dimensional feature representation set and the decoder to obtain and simultaneously output a text recognition result corresponding to each input speech.

[0100] In the embodiment of the present application, the high-dimensional feature representation set caching subunit caches the intermediate state vector of each input speech, so that the decoding output subunit can directly use the data cached by the high-dimensional feature representation set caching subunit when predicting the input speech, without re-computing the output of the encoder, thereby achieving the purpose of acceleration.

[0101] In the embodiment of the present application, the input speech includes speech features, and the decoding output subunit includes:

[0102] The unit decoding subunit is configured to simultaneously input the cached high-dimensional feature representation set and the recognition result of the speech features of the previous time of the input speech output by the decoder into the decoder to obtain the recognition result of the speech features of the current time of the input speech output by the decoder;

[0103] The unit recognition result caching subunit is configured to cache the recognition result of the speech features of the current time of the input speech as an input for the decoder to recognize the speech features of the next time of the input speech.

[0104] The decoding end subunit is configured to continue to recognize the speech features of each time after the current time of the input speech by using the decoder, and in response to recognizing an end symbol of the input speech, the recognition ends to obtain a text recognition result of the input speech.

[0105] The decoding end subunit includes:

[0106] The candidate path generating subunit is configured to generate multiple candidate paths from the recognition result generated at each time in the input speech decoding, wherein one of the candidate paths represents a text recognition result.

[0107] The candidate result determining subunit is configured to obtain a candidate result of each candidate path according to the end symbol of the input speech.

[0108] The candidate path length determining subunit is configured to determine the length of each candidate path according to each candidate result.

[0109] The path total length determining subunit is configured to determine a path total length according to the lengths of the candidate paths.

[0110] The candidate path average value determining subunit is configured to obtain an average value of each candidate path by taking the path total length as the denominator and the length of the candidate path as the numerator.

[0111] ​The text recognition result determination subunit is used to take the candidate result of the candidate path with the largest average value as the text recognition result of the input speech.

[0112] In this embodiment of the invention, since the end symbol recognized by the decoder is predicted, there is a certain degree of uncertainty. The predicted position of the end symbol may be incorrect, leading to premature termination of the decoding process and significantly impacting the accuracy of speech recognition. Therefore, this embodiment employs the aforementioned heuristic method to determine when decoding ends. This heuristic method eliminates the impact of premature decoding termination on speech recognition accuracy. This heuristic method effectively reduces the problem of path truncation and significantly improves the accuracy of speech recognition.

[0113] The speech recognition device provided in this invention utilizes the parallel computing power of a GPU to process multiple input speech messages simultaneously and records the intermediate states of each message message so that the decoder can directly apply them in subsequent speech recognition models, thereby improving decoding efficiency. By padding shorter input speech messages, the device meets the GPU's computational requirements for input data and records the true length of each input speech message to return the true recognition result. Furthermore, by employing a heuristic method to determine the end of the speech recognition process, the device effectively reduces path truncation issues and significantly improves the accuracy of speech recognition.

[0114] The following is combined Figure 8 A schematic diagram illustrating the physical structure of an electronic device provided in an embodiment of the present invention is shown below. Figure 8 As shown, the electronic device may include a processor 810, a communications interface 820, a memory 830, and a communication bus 840, wherein the processor 810, the communications interface 820, and the memory 830 communicate with each other via the communication bus 840. The processor 810 can call logical instructions in the memory 830 to execute a speech recognition method. This method includes: acquiring multiple input speech samples to be recognized; simultaneously inputting each of the input speech samples into a speech recognition model running on a graphics processing unit, and obtaining text recognition results corresponding to each of the input speech samples simultaneously output by the speech recognition model; wherein the speech recognition model is trained based on sample speech samples and the corresponding text; the speech recognition model is used to recognize the input speech at the current moment based on a high-dimensional feature representation encoded into the input speech, and based on the high-dimensional feature representation and the recognition result of the input speech at the previous moment, to obtain the recognition result at the current moment, until the recognition ends, and obtain the text recognition result of the input speech.

[0115] Further, the logic instructions in the memory 830 described above can be implemented in the form of software functional units and sold or used as independent products, and can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application essentially or partly or parts 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 application. 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 media that can store program codes.

[0116] In another aspect, the embodiments of the present application also provide a computer program product, which comprises a computer program stored on a non-transitory computer readable storage medium, and the computer program comprises program instructions, and when the program instructions are executed by a computer, the computer can execute the speech recognition method provided by the above-mentioned methods. The method comprises: obtaining a plurality of input speech to be recognized; inputting each of the input speech into a speech recognition model running on a graphics processor at the same time to obtain text recognition results corresponding to each of the input speech output by the speech recognition model at the same time; wherein the speech recognition model is trained based on sample speech and text corresponding to the sample speech; and the speech recognition model is used to encode input speech into high-dimensional feature representation, and to recognize the current time of the input speech based on the high-dimensional feature representation and the recognition result of the previous time of the input speech to obtain the recognition result of the current time, until the recognition is completed, and the text recognition result of the input speech is obtained.

[0117] In another aspect, the embodiments of the present application also provide a non-transitory computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the speech recognition method provided by the above-mentioned methods: obtaining a plurality of input speech to be recognized; inputting each of the input speech into a speech recognition model running on a graphics processor at the same time to obtain text recognition results corresponding to each of the input speech output by the speech recognition model at the same time; wherein the speech recognition model is trained based on sample speech and text corresponding to the sample speech; and the speech recognition model is used to encode input speech into high-dimensional feature representation, and to recognize the current time of the input speech based on the high-dimensional feature representation and the recognition result of the previous time of the input speech to obtain the recognition result of the current time, until the recognition is completed, and the text recognition result of the input speech is obtained.

[0118] The device embodiments described above are merely illustrative, wherein the units described as separate components can or can not be physically separate, and the components displayed as units can or can not be physical units, i.e., can be located in one place, or can be distributed to multiple network units. Part or all of the modules can be selected to achieve the purposes of the embodiments according to actual needs. Those skilled in the art can understand and implement without creative labor.

[0119] Through the description of the above embodiments, those skilled in the art can clearly understand that the embodiments can be realized by means of software and the necessary general hardware platform, and of course can also be realized by hardware. Based on such understanding, the above technical solutions can be embodied in the form of a software product, which can be stored in a computer readable storage medium, such as a ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute the methods described in each embodiment or some parts of the embodiments.

[0120] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement to part of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A voice recognition method, characterized by, The method comprises: obtaining a plurality of input speeches to be recognized; inputting each of the input speeches into a speech recognition model running on a graphics processor at the same time to obtain text recognition results corresponding to each of the input speeches output by the speech recognition model at the same time; wherein the speech recognition model is trained based on sample speeches and texts corresponding to the sample speeches; the speech recognition model is used to encode input speeches into feature representations, and based on the feature representations and the recognition result of the previous moment of the input speeches, recognize the current moment of the input speeches to obtain the recognition result of the current moment, until the recognition is completed, to obtain the text recognition result of the input speeches; the speech recognition model comprises an encoder and a decoder; the inputting each of the input speeches into the speech recognition model running on the graphics processor at the same time to obtain the text recognition results corresponding to each of the input speeches output by the speech recognition model at the same time comprises: encoding each of the input speeches into a feature representation set through the encoder; caching the feature representation set; decoding each of the input speeches at the same time through the decoder based on the cached feature representation set to obtain and output the text recognition results of each of the input speeches at the same time; the input speeches comprise speech features; the decoding each of the input speeches through the decoder based on the cached feature representation set to obtain the text recognition results of each of the input speeches comprises: inputting the cached feature representation set and the recognition result of the speech features of the previous moment of the input speeches output by the decoder into the decoder at the same time to obtain the recognition result of the speech features of the current moment of the input speeches output by the decoder; caching the recognition result of the speech features of the current moment of the input speeches as an input for the decoder to recognize the speech features of the next moment of the input speeches; continuing to recognize the speech features of each of the moments after the current moment of the input speeches through the decoder in turn, and obtaining the text recognition result of the input speeches in response to recognizing an end symbol of the input speeches; the obtaining the text recognition result of the input speeches in response to recognizing the end symbol of the input speeches comprises: generating a plurality of candidate paths of the input speeches according to the recognition results generated at each moment in the input speech decoding, wherein one of the candidate paths represents a text recognition result; obtaining candidate results of each of the candidate paths according to the end symbol of the input speeches; determining the lengths of the corresponding candidate paths according to each of the candidate results; determining a total path length according to the path lengths of each of the candidate paths; obtaining the average value of each of the candidate paths by taking the total path length as the denominator and the candidate path length as the numerator; taking the candidate result of the candidate path with the largest average value as the text recognition result of the input speeches.

2. The voice recognition method of claim 1, wherein, The method further comprises: caching the lengths of each of the input speeches to be recognized; determining the positions of the end symbols of each of the input speeches according to the cached lengths of each of the input speeches.

3. The voice recognition method of claim 2, wherein, The method further comprises: processing each of the input speeches to be recognized into a speech with a same length, so that each of the input speeches forms an input matrix.

4. The voice recognition method of claim 3, wherein, The method further comprises: In each of the input speeches, a longest speech is taken as a reference, and other input speeches are processed into speeches with the same length as the reference speech by means of a placeholder, so that each of the input speeches with the same length forms an input matrix.

5. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor implements the steps of the speech recognition method according to any one of claims 1 to 4 when executing the program.

6. A computer program product comprising computer programs / instructions, characterized in that, The computer program / instruction implements the steps of the speech recognition method according to any one of claims 1 to 4 when executed by the processor.

7. A non-transitory computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program / instruction implements the steps of the speech recognition method according to any one of claims 1 to 4 when executed by the processor.

Citation Information

Patent Citations

  • Speech recognition method and device and electronic equipment

    CN112185352A

  • Transformer-based speech recognition decoding acceleration method

    CN113035178A