Speech recognition method and apparatus, electronic device, and storage medium
By generating task sets and dividing them into multiple task batches for parallel execution, the problems of memory access bottlenecks and redundant calculations in automatic speech recognition are solved, thereby improving computational and inference efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- WANGYIYOUDAO INFORMATION TECH BEIJING CO LTD
- Filing Date
- 2022-11-15
- Publication Date
- 2026-07-21
AI Technical Summary
Existing automatic speech recognition technologies suffer from memory access bottlenecks and redundant computations, resulting in low inference efficiency.
By generating task sets and dividing them into multiple task batches based on preset mapping relationships, each batch is executed in parallel to improve computational efficiency and reduce memory access bottlenecks.
It improves the computational and inference efficiency of speech recognition, reduces memory access bottlenecks, and increases the throughput of the decoder.
Smart Images

Figure CN116052684B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of computer science and technology, and more specifically, the embodiments of the present invention relate to a speech recognition method and apparatus, electronic device and storage medium. Background Technology
[0002] This section is intended to provide background or context for embodiments of the invention as set forth in the claims. The description herein is not an admission that it is prior art simply because it is included in this section.
[0003] Automatic speech recognition (ASR) is a technology that converts human speech into text. Its goal is to enable computers to "dictate" continuous speech spoken by different people, achieving a conversion from "sound" to "text." Automatic speech recognition is also known as speech recognition or computer speech recognition.
[0004] In related technologies, during the inference computation of ASR, a rescore mechanism is used to re-score multiple output results obtained from the search, and the result with the highest score is selected as the final speech recognition result. However, the process of rescorening multiple streaming segments suffers from high memory access bottlenecks and a lot of redundant computation, thereby reducing the efficiency of inference. Summary of the Invention
[0005] Therefore, there is a great need for an improved speech recognition method and related products to reduce memory access bottlenecks and improve computational efficiency, thereby improving inference efficiency.
[0006] In this context, embodiments of the present invention are intended to provide a speech recognition method and apparatus, an electronic device, and a storage medium.
[0007] In a first aspect of the present invention, a speech recognition method is provided, applied in an automatic speech recognition model, comprising: Generate a first task set based on at least two speech data points from the speech dataset to be identified; Based on a preset mapping relationship, the first task set is divided into at least one first task batch; wherein the mapping relationship represents the relationship between the feature information of each task batch in the at least one task batch and the corresponding execution time. Each task in each of the first task batches is executed in parallel to obtain the target speech recognition result corresponding to each speech data.
[0008] In one embodiment of the present invention, dividing the first task set into at least one first task batch based on a preset mapping relationship includes: sorting each task in the first task set to obtain a second task set; for the Mth task in the second task set, obtaining the first batch information of the Mth task based on the first batch information of the previous M-1 tasks and the mapping relationship; and obtaining each first task batch based on each first batch information. Thus, by obtaining the batch information of the Mth task through the mapping relationship and the batch information of the previous M-1 tasks, the accuracy of the task batch information can be improved, thereby increasing computational efficiency and, consequently, inference efficiency.
[0009] In another embodiment of the present invention, obtaining the first batch information of the Mth task based on the first batch information of the first M-1 tasks and the mapping relationship includes: generating at least one second batch of information based on the first batch information of the first M-1 tasks and the Mth task; obtaining a first execution time corresponding to each second batch of information based on the mapping relationship; and obtaining the first batch information of the Mth task based on each first execution time. Thus, obtaining the batch information of the Mth task through the execution time of each second batch of information can improve the accuracy of the task's batch information, thereby improving computational efficiency and, consequently, inference efficiency.
[0010] In another embodiment of the present invention, generating at least one second batch of information based on the first batch information of the first M-1 tasks and the Mth task includes: using the Mth task as one second batch of information; and for the Kth task among the first M-1 tasks, combining the Kth task to the Mth task based on the first batch information of the first K-1 tasks to form one second batch of information. Thus, using the Mth task as one batch of information, and using the Mth task and the first K tasks as separate batches of information, can improve the comprehensiveness and accuracy of the batch information, thereby improving the accuracy of the task batch information.
[0011] In another embodiment of the present invention, the feature information includes the number of tasks and the size information of the target task; obtaining the first execution time corresponding to each second batch of information based on the mapping relationship includes: for each second batch of information, determining the target task from at least one task in the second batch of information, and determining a second execution time from the mapping relationship that matches both the size information of the target task and the number of tasks included in the second batch of information, and using the second execution time as the first execution time. Thus, obtaining the first execution time through the mapping table can improve the accuracy of the execution time, thereby improving the accuracy of the batch information of the tasks.
[0012] In another embodiment of the present invention, obtaining the first batch information of the Mth task based on each of the first execution times includes: determining a target execution time based on each of the first execution times; and using the second batch information corresponding to the target execution time as the first batch information of the Mth task. Thus, by using the batch information corresponding to the target execution time as the batch information of the Mth task, the accuracy of the task's batch information can be improved, thereby improving computational efficiency and, consequently, inference efficiency.
[0013] In another embodiment of the present invention, the method further includes: determining at least one second task batch; for each second task batch, determining a third execution time corresponding to the second task batch, and saving the correspondence between the third execution time corresponding to the second task batch and the feature information of the second task batch into the mapping relationship. Thus, generating the mapping relationship based on information from multiple second task batches can improve the accuracy of the mapping relationship, thereby improving the accuracy of the first task batch.
[0014] In another embodiment of the present invention, determining the third execution time corresponding to the second task batch includes: obtaining at least one fourth execution time corresponding to a third task batch; for each third task batch, obtaining a fifth execution time corresponding to the fourth task batch, and determining a sixth execution time for the second task batch based on the fifth execution time corresponding to the fourth task batch and the fourth execution time corresponding to the third task batch, wherein the fourth task batch includes the second task batch and the third task batch; and determining the third execution time corresponding to the second task batch based on each sixth execution time. Thus, obtaining the execution time of the second task batch based on the execution time of the third task batch and the execution time of the fourth task batch can improve the accuracy of the task batch execution time, thereby improving the accuracy of the mapping relationship and ultimately enhancing the accuracy of the first task batch.
[0015] In another embodiment of the present invention, determining at least one second task batch includes: determining three-dimensional feature points corresponding to each of the at least one fifth task batch; determining at least one sampling point from each of the three-dimensional feature points based on a preset sampling rule; and treating each sampling point as a second task batch. Thus, by determining the second task batch based on the length of the task batch to be tested and the preset sampling rule, the time required to acquire the second task batch is shortened while also improving the accuracy of the second task batch, thereby improving the accuracy and generation efficiency of the mapping relationship, and consequently enhancing the accuracy of the first task batch.
[0016] In another embodiment of the present invention, the sampling rule includes at least one of the following: downsampling, GPU, correlation between the duration information of the task batch and the length information of the task batch. Thus, by determining the second task batch through different sampling rules, the sampling time is reduced while improving the accuracy and completeness of the second task batch, thereby improving the accuracy of the mapping relationship and consequently enhancing the accuracy of the first task batch.
[0017] In another embodiment of the present invention, the method further includes: determining at least one sixth task batch from each of the fifth task batches; for each sixth task batch, determining a seventh execution time corresponding to the sixth task batch, and saving the correspondence between the seventh execution time corresponding to the sixth task batch and the feature information of the sixth task batch into the mapping relationship. Thus, generating the mapping relationship based on the information of the sixth task batches reduces testing time while improving the accuracy and completeness of the mapping relationship, thereby improving the accuracy of the first task batch.
[0018] In another embodiment of the present invention, determining the seventh execution time corresponding to the sixth task batch includes: querying the mapping relationship based on the number of tasks included in the sixth task batch to obtain a query result; if the query result indicates that there is a task batch in the mapping relationship with the same number of tasks as the sixth task batch, determining a first target task batch from the mapping relationship, and using the execution time corresponding to the first target task batch as the seventh execution time corresponding to the sixth task batch; if the query result indicates that there is no task batch in the mapping relationship with the same number of tasks as the sixth task batch, determining a second target task batch and a third target task batch from the mapping relationship, and using a preset interpolation algorithm, obtaining the seventh execution time corresponding to the sixth task batch based on the execution time corresponding to the second target task batch and the execution time corresponding to the third target task batch. Thus, obtaining the execution time of the sixth task batch through different methods can improve the accuracy of the execution time, thereby improving the accuracy of the sixth batch of tasks, and further improving the accuracy and completeness of the mapping relationship.
[0019] In a second aspect of the present invention, a speech recognition device is provided, applied in an automatic speech recognition model, the device comprising: The generation module is used to generate a first task set based on at least two speech data points in the speech dataset to be recognized; A partitioning module is used to partition the first task set into at least one first task batch based on a preset mapping relationship; wherein the mapping relationship represents the relationship between the feature information of each task batch in the at least one task batch and the corresponding execution time, and each first task batch includes at least one task. The execution module is used to execute each task in each of the first task batches in a parallel manner to obtain the target speech recognition result corresponding to each of the speech data.
[0020] In a third aspect of the present invention, an electronic device is provided, including a processor and a memory, the memory storing a computer program executable on the processor, characterized in that the processor executes the computer program to implement the method described in any of the preceding claims.
[0021] In a fourth aspect of the present invention, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the method described in any of the preceding claims.
[0022] According to the speech recognition method, apparatus, electronic device, and storage medium of the present invention, on the one hand, multiple tasks are divided into multiple batches through a preset mapping relationship, which not only improves the accuracy of the batches but also reduces the memory access bottleneck and improves the computational efficiency, thereby improving the inference efficiency and thus improving the throughput of the decoder; on the other hand, executing multiple tasks in parallel can further improve the computational efficiency, thereby further improving the inference efficiency. Attached Figure Description
[0023] The above and other objects, features, and advantages of exemplary embodiments of the present invention will become readily apparent from the following detailed description taken in conjunction with the accompanying drawings. Several embodiments of the invention are illustrated in the drawings by way of example and not limitation, wherein: Figure 1A The diagram illustrates an application scenario of speech recognition provided by an embodiment of the present invention. Figure 1B A flowchart illustrating the implementation of a speech recognition method according to an embodiment of the present invention is shown schematically. Figure 2 A flowchart illustrating the implementation of a speech recognition method according to an embodiment of the present invention is shown schematically. Figure 3 A flowchart illustrating the implementation of a speech recognition method according to an embodiment of the present invention is shown schematically. Figure 4A A schematic diagram of a first task batch provided in the prior art is shown; Figure 4B A schematic diagram illustrating a process for establishing a mapping relationship according to an embodiment of the present invention is shown. Figure 4C A schematic flowchart of a speech recognition method according to an embodiment of the present invention is shown. Figure 4D A schematic diagram illustrating a first task batch provided by an embodiment of the present invention is shown. Figure 5 A schematic block diagram illustrating the composition of a speech recognition device according to an embodiment of the present invention is shown. Figure 6 A schematic diagram of the hardware entity of an electronic device according to an embodiment of the present invention is shown. In the accompanying drawings, the same or corresponding reference numerals indicate the same or corresponding parts. Detailed Implementation
[0024] The principles and spirit of the invention will now be described with reference to several exemplary embodiments. It should be understood that these embodiments are given merely to enable those skilled in the art to better understand and implement the invention, and are not intended to limit the scope of the invention in any way. Rather, these embodiments are provided to make this disclosure more thorough and complete, and to fully convey the scope of this disclosure to those skilled in the art. Invention Overview The inventors have discovered that the Transformer's Decoder is commonly used for ASR (Automatic Speech Rescore) rescores. To achieve high-performance inference, it's necessary to leverage data locality to reduce memory access bottlenecks. This requires grouping multiple streaming segments into a batch, utilizing the GPU to compute this batch, and returning the corresponding results. Due to the computational characteristics of the Decoder, the lengths of the input speech from different users vary. Therefore, multiple speech segments cannot be directly batched; they need to be extended to their maximum length. This increases redundant computation, severely impacting inference performance. While parallel computation via a multi-stream mechanism, placing each batch on a separate stream on the GPU, improves computational efficiency to some extent, it still presents a significant memory access bottleneck.
[0026] In view of this, embodiments of the present invention provide at least one speech recognition method and apparatus, electronic device, and storage medium. According to an embodiment of the present invention, in the process of speech recognition, firstly, a first task set is generated based on at least two speech data points in a speech dataset to be recognized; secondly, based on a preset mapping relationship, the first task set is divided into at least one first task batch; wherein, the mapping relationship characterizes the relationship between the feature information of each task batch in the at least one task batch and the corresponding execution time; finally, each task in each first task batch is executed in parallel to obtain the target speech recognition result corresponding to each speech data point. Thus, on the one hand, dividing multiple tasks into multiple batches through a preset mapping relationship not only improves the accuracy of the batches but also reduces memory access bottlenecks and improves computational efficiency, thereby improving inference efficiency and consequently increasing the decoder's throughput; on the other hand, executing multiple tasks simultaneously in parallel further improves computational efficiency, thereby further improving inference efficiency.
[0027] After introducing the basic principles of the present invention, various non-limiting embodiments of the present invention will be described in detail below.
[0028] Overview of speech recognition application scenarios First refer to Figure 1A , Figure 1A The diagram illustrates an application scenario of speech recognition provided by an embodiment of the present invention. For example... Figure 1A As shown, the display page 100 includes at least a voice input section 101 and a display section 102. The voice input section 101 is used to input the voice to be recognized or the voice dataset to be recognized, and the display section 102 is used to display the corresponding target voice recognition result.
[0029] In the process of speech recognition, firstly, a first task set is generated based on at least two speech data in the speech dataset to be recognized; secondly, based on a preset mapping relationship, the first task set is divided into at least one first task batch; wherein, the mapping relationship represents the relationship between the feature information of each task batch in the at least one task batch and the corresponding execution time; finally, each task in each first task batch is executed in parallel to obtain the target speech recognition result corresponding to each speech data.
[0030] It should be noted that the display page can be displayed on any suitable electronic device with a user interface. In implementation, the electronic device displaying the page and the device executing the speech recognition method can be the same or different; this is not limited. For example, the electronic device executing the speech recognition method can be a laptop computer, and the electronic device displaying the page can also be the laptop computer. The display page can be an interactive interface of a client running on the laptop computer, or a webpage displayed in a browser running on the laptop computer. Alternatively, the electronic device executing the speech recognition method can be a server, and the electronic device displaying the page can be a laptop computer. The display page can be an interactive interface of a client running on the laptop computer, or a webpage displayed in a browser running on the laptop computer. The laptop computer can access the server through the client or browser. The electronic device can be a laptop computer, tablet computer, desktop computer, set-top box, mobile device (e.g., mobile phone, portable music player, personal digital assistant, dedicated messaging device, portable gaming device), or any other type of terminal, and can also be implemented as a server. A server can be a standalone physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.
[0031] Exemplary speech recognition method The following is combined with Figure 1A Application scenarios, refer to Figure 1B This description outlines a method for speech recognition according to exemplary embodiments of the present invention. It should be noted that the above application scenarios are shown only to facilitate understanding of the spirit and principles of the invention, and the embodiments of the invention are not limited in any way. Rather, the embodiments of the invention can be applied to any applicable scenario.
[0032] This invention provides a speech recognition method that can be executed by an electronic device, which includes an automatic speech recognition model. Figure 1B A flowchart illustrating the implementation of a speech recognition method according to an embodiment of the present invention is shown schematically. Figure 1B As shown, the method includes the following steps S11 to S13, wherein: Step S11: Generate a first task set based on at least two speech data points in the speech dataset to be recognized.
[0033] Here, the speech dataset to be recognized can be any suitable speech dataset. At least two speech data points can be from the same user or from different users. For example, the speech dataset includes three speech data points input by user A and four speech data points input by user B. In practice, the duration of each speech data point can be the same, different, or partially the same.
[0034] In some implementations, the speech dataset to be recognized can be selected by a user through a gesture or operation inputted by the user on a display page using an input component of an electronic device. The input component may include, but is not limited to, a keyboard, mouse, touchscreen, touchpad, audio input device, etc. For example, if a user inputs a preset gesture on the display page, the speech dataset corresponding to that gesture is used as the speech dataset to be recognized. Another example is that a user selects multiple speech data points in the speech input section 101 on the display page using a mouse, and these multiple speech data points are used as the speech dataset to be recognized. Yet another example is that a user can record at least one speech data point using a microphone, and this at least one speech data point is used as the speech dataset to be recognized.
[0035] In some implementations, the speech dataset to be identified can be determined from the speech information uttered by the user. For example, if the user utters "speech dataset X", then "speech dataset X" is used as the speech dataset to be identified.
[0036] In some implementations, the speech dataset to be recognized can be remotely selected by the user. For example, the user selects a speech dataset in the interface of another electronic device and sends the speech dataset to the electronic device via Bluetooth or a wireless network, and the electronic device uses the speech dataset as the speech dataset to be recognized.
[0037] In implementation, those skilled in the art can independently determine the method of the speech dataset to be recognized according to actual needs, and the embodiments of the present invention are not limited thereto.
[0038] The first task set includes at least one task. Each task represents scoring at least one speech recognition result for the corresponding speech data. During automatic speech recognition, a pre-defined database is searched based on each speech data to obtain at least one optimal speech recognition result for each speech data. In practice, for multiple speech recognition results of a single speech data, the lengths of these results are generally consistent. For example, for speech data A, after searching the database, three optimal speech recognition results are obtained: speech recognition result A1, speech recognition result A2, and speech recognition result A3. Then, speech recognition results A1, A2, and A3 can be re-scored and used as the task corresponding to that speech data.
[0039] Step S12: Based on a preset mapping relationship, the first task set is divided into at least one first task batch; wherein the mapping relationship represents the relationship between the feature information of each task batch in the at least one task batch and the corresponding execution time.
[0040] Here, each first task batch includes at least one task. In some implementations, each first task batch represents that at least one task in the corresponding first task batch can be grouped into a batch. For example, if the first task set includes tasks 1 to 10, the first task set is divided into three first task batches through this mapping relationship: the first first task batch includes tasks 1 to 5, the second first task batch includes tasks 6 to 8, and the third first task batch includes tasks 9 to 10.
[0041] In some implementations, a mapping relationship between feature information and execution time can be pre-established and stored in an electronic device or other electronic device. When the mapping relationship is stored in an electronic device, the electronic device determines the execution time matching the feature information within the mapping relationship. When the mapping relationship is stored in other electronic devices, the electronic device sends the feature information to those other electronic devices, enabling them to determine the execution time matching the feature information within the mapping relationship and return the execution time to the original electronic device. In practice, those skilled in the art can determine the mapping relationship between feature information and execution time according to actual needs; this embodiment of the invention does not impose limitations.
[0042] The characteristic information of a task batch may include, but is not limited to, the size information of the target task, the number of tasks, etc.
[0043] The task count indicates the number of tasks contained in the current task batch. For example, if the current task batch contains 10 tasks, then the task count is 10.
[0044] The size information of the target task may include, but is not limited to, row information and column information. In some implementations, the row information of the target task is positively correlated with the duration of the speech, and the column information of the target task is positively correlated with the number of words corresponding to the speech. In practice, different durations may correspond to the same or different row information. Different numbers of words may correspond to the same or different column information. In some implementations, within a preset deviation range, different durations may correspond to the same row information, and different numbers of words may correspond to the same column information.
[0045] In some implementations, the target task can be at least one task selected from at least one task in the current task batch according to preset rules. These preset rules may include, but are not limited to, the default configuration of the electronic device, user-defined rules, user preferences, and usage frequency. For example, the target task may be the task with the largest size; that is, the size information of the target task can be the maximum value of the row information and the maximum value of the column information among all tasks in the current task batch. Another example is that the first task may be selected as the target task. In implementation, those skilled in the art can independently set preset rules according to actual needs, and this embodiment of the invention does not impose limitations.
[0046] For example, if the current task batch includes Task 1, Task 2 and Task 3, where the size information of Task 1 is 1 row and 6 columns, the size information of Task 2 is 4 rows and 6 columns, and the size information of Task 3 is 2 rows and 6 columns, then the task with the largest size can be taken as the target task, that is: take Task 2 as the target task, and the size information of the target task will be 4 rows and 6 columns.
[0047] For example, if the current task batch includes Task 1, Task 2 and Task 3, where the size information of Task 1 is 1 row and 6 columns, the size information of Task 2 is 4 rows and 6 columns, and the size information of Task 3 is 6 rows and 4 columns, then at least one task with the largest size can be used as the target task, that is: Task 2 and Task 3 are used as the target task, and the size information of the target task is 6 rows and 6 columns.
[0048] Execution time represents the time consumed in calculating the current task batch. Methods for determining execution time may include, but are not limited to, a single measurement time, a weighted average of a single measurement time, the mean / variance / mean squared error of multiple measurement times, or the mean / variance / mean squared error after weighting multiple test times. In implementation, those skilled in the art can choose the method for determining execution time according to actual needs; this embodiment of the invention does not impose any limitations. Measurement time can be the time consumed by the current task batch obtained through any suitable measurement method, such as the overflow method. In implementation, those skilled in the art can determine the measurement method according to actual needs; this embodiment of the invention does not impose any limitations.
[0049] For example, first measure the baseline execution time of at least one baseline task batch; for each baseline task, in a multi-stream manner, calculate the current task batch and the baseline task batch in parallel to obtain the total execution time, and use the difference between the total execution time and the baseline execution time as the measurement time of the current task batch; and use the average of each measurement time as the execution time of the current task batch.
[0050] Step S13: Execute each task in each of the first task batches in a parallel manner to obtain the target speech recognition result corresponding to each speech data.
[0051] Here, parallelism can include, but is not limited to, parallelism within batches and parallelism between batches. In implementation, by executing each task in each first task batch, the execution result of each task can be obtained, and each execution result represents the score result of the corresponding task. For example, the first task batch includes tasks 1 to 3, where task 1 is to score the 5 speech recognition results corresponding to speech data 1, task 2 is to score the 4 speech recognition results corresponding to speech data 2, and task 3 is to score the 5 speech recognition results corresponding to speech data 3. Then, the score results include the scores for the 5 speech recognition results corresponding to speech data 1, the scores for the 4 speech recognition results corresponding to speech data 2, and the scores for the 5 speech recognition results corresponding to speech data 3.
[0052] The target speech recognition result can be one of multiple speech recognition results corresponding to the speech data. In some embodiments, a preset rule is used to select one speech recognition result from multiple speech recognition results as the target speech recognition result. The preset rule may include, but is not limited to, the default configuration of the electronic device, user-defined criteria, user preferences, usage frequency, etc. For example, the speech recognition result with the highest score may be selected as the target speech recognition result. Another example is the speech recognition result with a score closest to a preset value. In implementation, those skilled in the art can independently set the preset rule according to actual needs; this embodiment of the invention does not impose limitations.
[0053] In the embodiments of the present invention described above, a first task set is generated based on at least two speech data points from a speech dataset to be recognized; the first task set is divided into at least one first task batch based on a preset mapping relationship; wherein the mapping relationship characterizes the relationship between the feature information of each task batch in the at least one task batch and the corresponding execution time, and each first task batch includes at least one task; each task in each first task batch is executed in parallel to obtain the target speech recognition result corresponding to each speech data point. Thus, on the one hand, dividing multiple tasks into multiple batches through the preset mapping relationship not only improves the batch accuracy but also reduces memory access bottlenecks and improves computational efficiency, thereby improving inference efficiency and consequently increasing the decoder's throughput; on the other hand, executing multiple tasks simultaneously in parallel further improves computational efficiency, thereby further improving inference efficiency.
[0054] Figure 2The diagram schematically illustrates an implementation flowchart of a speech recognition method according to an embodiment of the present invention. This method can be executed by an electronic device, which includes an automatic speech recognition model, such as... Figure 2 As shown, the method includes the following steps S21 to S25, wherein: Step S21: Generate a first task set based on at least two speech data points in the speech dataset to be recognized.
[0055] Here, step S21 corresponds to step S11 mentioned above. In implementation, the specific implementation method of step S11 mentioned above can be referred to.
[0056] Step S22: Sort each task in the first task set to obtain the second task set.
[0057] Here, the sorting method can include, but is not limited to, size, generation time, etc. For example, to sort by size from smallest to largest, in implementation, it can be first sorted by row information from smallest to largest, and if the number of rows is the same, then sorted by column information from smallest to largest; or, it can be first sorted by column information from smallest to largest, and if the number of columns is the same, then sorted by row information from smallest to largest. As another example, to sort by size from largest to smallest, in implementation, it can be first sorted by row information from largest to smallest, and if the number of rows is the same, then sorted by column information from largest to smallest; or, it can be first sorted by column information from largest to smallest, and if the number of columns is the same, then sorted by row information from largest to smallest. In implementation, those skilled in the art can choose the sorting method according to actual needs, and this embodiment of the invention does not impose limitations.
[0058] For example, the first task set includes tasks 1 to 5, where task 1 has a size of 3 rows and 4 columns, task 2 has a size of 6 rows and 3 columns, task 3 has a size of 1 row and 3 columns, task 4 has a size of 1 row and 4 columns, and task 5 has a size of 6 rows and 4 columns. Then, in order of increasing size (i.e., row information from smallest to largest, and if the number of rows is the same, column information from smallest to largest), the second task set is: task 3, task 4, task 1, task 2, and task 5.
[0059] Step S23: For the Mth task in the second task set, based on the first batch information of the first M-1 tasks and the preset mapping relationship, obtain the first batch information of the Mth task; wherein, the mapping relationship represents the relationship between the feature information of each task batch in at least one task batch and the corresponding execution time.
[0060] Here, M is a positive integer. The first batch of information represents the optimal batch information for the corresponding task, which can be the task with the minimum execution time in that optimal batch.
[0061] In some implementations, for the first task in the second task set, its first batch information is itself. For each other task in the second task set, the first batch information of each task can be obtained based on the first batch information of each preceding task and this mapping relationship.
[0062] For example, for the second task A[2] in the second task set, A[2] can be considered as a batch information, and A[2] and A[1] can be considered as a batch information. Based on this mapping relationship, the execution time corresponding to these two batch information can be obtained. Based on these two execution times, the first batch information of A[2] can be determined. For example, the batch information corresponding to the smallest total execution time can be used as the first batch information of A[2]. The total execution time includes the first total execution time and the second total execution time. The first total execution time is the sum of the execution time C[1] corresponding to A[1] as a first batch information and the execution time corresponding to A[2] as a first batch information. The second total execution time is the execution time corresponding to A[1] and A[2] as a first batch information.
[0063] Step S24: Based on each of the first batch information, obtain each of the first task batches.
[0064] Here, each first task batch includes at least one task. During implementation, each first task batch is obtained based on the batch information corresponding to each task. For example, the second task set includes tasks 1 to 5, namely: A[1] to A[5], and the first batch information corresponding to A[1] to A[5] are A[1], A[2] to A[4], and A[5], respectively. Then the second task set can be divided into three first task batches, namely: the first first task batch is A[1], the second first task batch is A[2] to A[4], and the third first task batch is A[5].
[0065] Step S25: Execute each task in each of the first task batches in a parallel manner to obtain the target speech recognition result corresponding to each speech data.
[0066] Here, step S25 corresponds to step S13 mentioned above. In implementation, the specific implementation method of step S13 mentioned above can be referred to.
[0067] In the embodiments of the present invention described above, a first task set is generated based on at least two speech data points from the speech dataset to be recognized; each task in the first task set is sorted to obtain a second task set; for the Mth task in the second task set, the first batch information of the Mth task is obtained based on the first batch information of the first M-1 tasks and a preset mapping relationship; wherein, the mapping relationship represents the relationship between the feature information of each task batch in at least one task batch and the corresponding execution time; each first batch information is used as a first task batch; each task in each first task batch is executed in parallel to obtain the target speech recognition result corresponding to each speech data point. Thus, by obtaining the batch information of the Mth task through the mapping relationship and the batch information of the first M-1 tasks, the accuracy of the task batch information can be improved, thereby increasing computational efficiency and, consequently, inference efficiency.
[0068] In some embodiments, step S23, "obtaining the first batch information of the Mth task based on the first batch information of the first M-1 tasks and the mapping relationship," includes steps S231 to S233, wherein: Step S231: Based on the first batch information of the first M-1 tasks and the Mth task, generate at least one second batch of information.
[0069] Here, for the Mth task, there are a total of M second batches of information. Among them, the M second batches of information are: the Mth task as one second batch of information, and the M-1 second batches of information obtained by combining the Mth task with the previous M-1 tasks respectively. For example, for the 2nd task, there are 2 second batches of information, namely: A[2] as one second batch of information, and A[1] and A[2] as one second batch of information. For another example, for the 3rd task, there are 3 second batches of information, namely: A[3] as one second batch of information, A[2] and A[3] as one second batch of information, and A[1] to A[3] as one second batch of information.
[0070] In some embodiments, step S231 includes steps S2311 to S2312, wherein: Step S2311: Treat the Mth task as a second batch of information.
[0071] Here, M is a positive integer. For example, if M is 6, then the 6th task A[6] can be used as a second batch of information.
[0072] Step S2312: For the Kth task in the first M-1 tasks, based on the first batch information of the first K-1 tasks, combine the Kth task to the Mth task as a second batch of information.
[0073] Here, K is a positive integer not greater than M-1. For example, assuming M is 6, K can be 1 to 5. Then, for the 6th task, there are 5 additional second batches of information, namely: combining A[1] to A[6] as a second batch, combining A[2] to A[6] as a second batch, combining A[3] to A[6] as a second batch, combining A[4] to A[6] as a second batch, and combining A[5] to A[6] as a second batch. In this way, by taking the Mth task as a batch and taking the Mth task and the first K tasks as separate batches, the comprehensiveness and accuracy of the batch information can be improved, thereby improving the accuracy of the task batch information.
[0074] Step S232: Based on the mapping relationship, obtain the first execution time corresponding to each second batch of information.
[0075] Here, the first execution time corresponding to each second batch of information can be obtained through the mapping relationship T(batch, size). Here, batch represents the number of tasks in the second batch of information, size represents the size information of the target task in the second batch of information, and T represents the execution time corresponding to the second batch of information. For example, assuming that the size information of the first task A[1] is 1 row and 1 column, the size information of the second task A[2] is 3 rows and 3 columns, and the size information of the third task A[3] is 6 rows and 6 columns, then for A[3], there are a total of 3 second batches of information, namely: A[3], A[2]+A[3], A[1]+A[2]+A[3]. Through this mapping relationship, the execution time of the first second batch of information is T[1,6], the execution time of the second second batch of information is T[2,6], and the execution time of the third second batch of information is T[3,6].
[0076] In some embodiments, the feature information includes the number of tasks and the size information of the target task; step S232 includes step S2321, wherein: Step S2321: For each second batch of information, determine the target task from at least one task in the second batch of information, and determine a second execution time from the mapping relationship that matches both the size information of the target task and the number of tasks included in the second batch of information, and use the second execution time as the first execution time.
[0077] Here, the target task can be at least one task selected from at least one task in the current task batch according to preset rules. The preset rules may include, but are not limited to, the default configuration of the electronic device, user-defined rules, user preferences, usage frequency, etc. For example, the target task can be the task with the largest size, that is, the size information of the target task can be the maximum value of the row information and the maximum value of the column information of all tasks in the current task batch. Another example is to take the first task as the target task. In implementation, those skilled in the art can set preset rules according to actual needs, and the embodiments of the present invention do not limit this. For example, assuming that the size information of the first task A[1] is 1 row and 1 column, the size information of the second task A[2] is 3 rows and 3 columns, and the size information of the third task A[3] is 4 rows and 4 columns, then for A[3], there are a total of 3 second batch information, namely: A[3], A[2]+A[3], A[1]+A[2]+A[3], and the target task corresponding to these 3 second batch information is A[3]. In this way, obtaining the first execution time through the mapping table can improve the accuracy of the execution time, thereby improving the accuracy of the task batch information.
[0078] Step S233: Based on each of the first execution times, obtain the first batch information of the Mth task.
[0079] Here, based on each first execution time, the target execution time is obtained, and the batch information corresponding to the target execution time is used as the first batch information of the Mth task.
[0080] In some embodiments, step S233 includes steps S2331 to S2332, wherein: Step S2331: Determine the target execution time based on each of the first execution times.
[0081] Here, the methods for determining the target execution time may include, but are not limited to, a single total execution time, the mean / variance / mean squared error of multiple total execution times, a weighted average of a single total execution time, or the mean / variance / mean squared error obtained by weighting the mean / variance / mean squared error of multiple total execution times. In implementation, those skilled in the art can choose the method for determining the target execution time according to actual needs; this embodiment of the invention does not impose any limitations. The total execution time represents the execution time of the first M tasks.
[0082] For example, the smallest total execution time among multiple total execution times is taken as the target execution time. For example, suppose the size information of the first task A[1] is 1 row and 1 column, the size information of the second task A[2] is 3 rows and 3 columns, the size information of the third task A[3] is 6 rows and 6 columns, and the size information of the fourth task is 8 rows and 8 columns. For the fourth task A[4], there are a total of 4 total execution times, namely: T(4,8), C[1]+T(3,8), C[2]+T(2,8) and C[3]+T(1,8). The smallest of the 4 total execution times is taken as the target execution time C[4], where T(4,8) means that A[1]~ A[4] represents the execution time corresponding to a batch, T(3,8) represents the execution time corresponding to a batch of A[2]~A[4], T(2,8) represents the execution time corresponding to a batch of A[3]~A[4], T(1,8) represents the execution time corresponding to a batch of A[4], C[1] represents the execution time corresponding to S[1], C[2] represents the sum of the execution times corresponding to S[2], C[3] represents the sum of the execution times corresponding to S[3], S[1] represents the task batch corresponding to A[1], S[2] represents the task batch corresponding to A[1]~A[2], and S[3] represents the task batch corresponding to A[1]~A[3].
[0083] Step S2332: Use the second batch information corresponding to the target execution time as the first batch information of the Mth task.
[0084] Here, the second batch information corresponding to the target execution time is used as the first batch information of the Mth task. For example, assuming the size information of the first task A[1] is 1 row and 1 column, the size information of the second task A[2] is 3 rows and 3 columns, and the size information of the third task A[3] is 6 rows and 6 columns, for A[3], there are a total of 3 execution times, namely: T(3,6), C[1]+T(2,6), C[2]+T(1,6). If the target execution time C[3] is the second total execution time, then the second batch information corresponding to the second total execution time is used as the first batch information of A[3], that is: A[2]+A[3] is used as the first batch information of A[3]. In this way, by using the batch information corresponding to the target execution time as the batch information of the Mth task, the accuracy of the batch information of the task can be improved, thereby improving the computational efficiency and inference efficiency.
[0085] In the embodiments of the present invention described above, at least one second batch of information is generated based on the first batch information of the first M-1 tasks and the Mth task; a first execution time corresponding to each second batch of information is obtained based on the mapping relationship; and the first batch information of the Mth task is obtained based on each first execution time. In this way, by obtaining the batch information of the Mth task through the execution time of each second batch of information, the accuracy of the task's batch information can be improved, thereby increasing computational efficiency and, consequently, inference efficiency.
[0086] Figure 3 The diagram schematically illustrates an implementation flowchart of a speech recognition method according to an embodiment of the present invention. This method can be executed by an electronic device, which includes an automatic speech recognition model, such as... Figure 3 As shown, the method includes the following steps S31 to S35, wherein: Step S31: Determine at least one second task batch.
[0087] Here, each second task batch includes at least one task. In implementation, this second task batch can be a batch of tasks to be tested.
[0088] In some implementations, a three-dimensional coordinate system comprising at least one task batch can be pre-established. The three dimensions of this coordinate system represent the number of tasks contained in each task batch, the duration of each task batch, and the length of each task batch, respectively. A subset of three-dimensional feature points in this coordinate system are then used as a second task batch. In practice, the duration of a task batch is positively correlated with the speech duration, and the length of a task batch is positively correlated with the number of words corresponding to the speech data. In some implementations, different speech durations can correspond to the same or different duration information. Different word counts can correspond to the same or different length information. In some implementations, within a preset deviation range, different speech durations can correspond to the same duration information, and different word counts can correspond to the same length information.
[0089] In some embodiments, step S31 includes steps S311 to S313, wherein: Step S311: Determine the three-dimensional feature points corresponding to each of the fifth task batches in at least one fifth task batch.
[0090] Here, the fifth task batch can be any three-dimensional feature point in the three-dimensional coordinate system. The first dimension of each three-dimensional feature point represents the number of tasks contained in the corresponding fifth task batch, the second dimension represents the duration of the corresponding fifth task batch, and the third dimension represents the length of the corresponding fifth task batch.
[0091] Step S312: Based on the preset sampling rules, determine at least one sampling point from each of the three-dimensional feature points.
[0092] Here, the sampling rules can include, but are not limited to, at least one of the following: downsampling, GPU, and the correlation between the duration and length information of the task batch. Downsampling represents taking a subset of sampling points in each dimension. GPU represents the GPU's sensitivity to data; for example, the GPU is more sensitive to multiples of 64, so measurements can be sampled twice at multiples of 64, such as 128 and 129, 192 and 193, etc. Correlation represents the positive correlation between the speech duration and the number of words corresponding to the task batch. For example, assuming 5 seconds (S) of speech data corresponds to 20 words, more sampling points can be taken around these 20 words, such as sampling points corresponding to words 15-25, while fewer sampling points are taken for other less likely words, such as sampling points corresponding to 60, 80, and 100 words out of a total of 60-100 words.
[0093] In some implementations, downsampling can be used to sample the number of tasks in a task batch, while GPU and correlation methods can be used to sample the duration and length of the task batch. By determining the second task batch using different sampling rules, the sampling time is reduced while improving the accuracy and completeness of the second task batch, thereby improving the accuracy of the mapping relationship and ultimately enhancing the accuracy of the first task batch.
[0094] Step S313: Each of the sampling points is treated as a second task batch.
[0095] Here, each sampling point is treated as a batch of tasks to be tested. Based on the length of the batch of tasks to be tested and the preset sampling rules, a second batch of tasks is determined. This shortens the time required to acquire the second batch of tasks and also improves its accuracy, thereby increasing the accuracy and efficiency of the mapping relationship, and ultimately improving the accuracy of the first batch of tasks.
[0096] Step S32: For each second task batch, determine the third execution time corresponding to the second task batch, and save the correspondence between the third execution time corresponding to the second task batch and the feature information of the second task batch into the mapping relationship.
[0097] Here, the third execution time represents the time consumed in calculating the second task batch. The methods for determining the third execution time may include, but are not limited to, a single measurement time, a weighted average of a single measurement time, the mean / variance / mean square deviation of multiple measurement times, or the mean / variance / mean square deviation after weighting multiple test times. In implementation, those skilled in the art can choose the method for determining the third execution time according to actual needs; this embodiment of the invention does not impose any limitations. The measurement time can be the time consumed by the second task batch obtained through any suitable measurement method, such as the overflow method. In implementation, those skilled in the art can determine the measurement method according to actual needs; this embodiment of the invention does not impose any limitations.
[0098] The characteristic information of the second task batch may include, but is not limited to, the size information of the target task, the number of tasks, etc.
[0099] In some embodiments, "determining the third execution time corresponding to the second task batch" in step S32 includes steps S321 to S323, wherein: Step S321: Obtain the fourth execution time corresponding to at least one third task batch.
[0100] Here, each third task batch corresponds to a different baseline batch, and each third task batch includes at least one task, which can be the same or different tasks. In implementation, the size of this baseline batch is relatively large, and it can essentially fill the GPU resources. In some implementations, different baseline batches can correspond to the same or different size information, and different baseline batches can contain the same or different numbers of tasks. For example, the first baseline batch includes 3 tasks, and the second baseline batch includes 4 tasks.
[0101] In some implementations, the fourth execution time corresponding to the baseline batch can be measured using any suitable measurement method. The methods for determining the fourth execution time may include, but are not limited to, a single fourth execution time, a weighted average of a single fourth execution time, the mean / variance / mean squared error of multiple fourth execution times, or the mean / variance / mean squared error after weighting multiple fourth execution times. In implementation, those skilled in the art can choose the method for determining the fourth execution time according to actual needs; this embodiment of the invention does not impose any limitations.
[0102] Step S322: For each third task batch, obtain the fifth execution time corresponding to the fourth task batch, and determine the sixth execution time of the second task batch based on the fifth execution time corresponding to the fourth task batch and the fourth execution time corresponding to the third task batch.
[0103] Here, the fourth task batch includes the second and third task batches. In implementation, the fourth task batch can be obtained in a multi-stream format or as a batch. In some embodiments, the fifth execution time corresponding to the fourth task batch can be measured using any suitable measurement method. Methods for determining the fifth execution time may include, but are not limited to, a single fifth execution time, a weighted average of a single fifth execution time, the mean / variance / mean squared error of multiple fifth execution times, or the mean / variance / mean squared error after weighting multiple fifth execution times. In implementation, those skilled in the art can choose the method for determining the fifth execution time according to actual needs; this embodiment of the invention does not impose limitations.
[0104] The methods for determining the sixth execution time may include, but are not limited to, the difference / variance / mean square error between the fifth and fourth execution times, weighted average of the difference / variance / mean square error between the fifth and fourth execution times, and the difference / variance / mean square error after weighting the fifth and fourth execution times separately. In implementation, those skilled in the art can choose the method for determining the sixth execution time according to actual needs, and this embodiment of the invention does not limit this. For example, the difference between the fifth and fourth execution times can be used as the sixth execution time.
[0105] Step S323: Based on each of the sixth execution times, determine the third execution time corresponding to the second task batch.
[0106] Here, the methods for determining the third execution time may include, but are not limited to, a specific sixth execution time, a weighted average of a specific sixth execution time, the mean / variance / mean squared error of each sixth execution time, or the mean / variance / mean squared error after weighting each sixth execution time. In implementation, those skilled in the art can choose the method for determining the third execution time according to actual needs; this embodiment of the invention does not impose limitations. For example, the mean of each sixth execution time can be used as the third execution time. Thus, based on the execution time of the third task batch and the execution time of the fourth task batch, the execution time of the second task batch can be obtained, which can improve the accuracy of the task batch execution time, thereby improving the accuracy of the mapping relationship and ultimately enhancing the accuracy of the first task batch.
[0107] Step S33: Generate a first task set based on at least two speech data points in the speech dataset to be recognized.
[0108] Step S34: Based on the mapping relationship, divide the first task set into at least one first task batch.
[0109] Step S35: Execute each task in each of the first task batches in a parallel manner to obtain the target speech recognition result corresponding to each speech data.
[0110] Here, steps S33 to S35 correspond to steps S11 to S13, respectively. In implementation, the specific implementation methods of steps S11 to S13 can be referred to.
[0111] In the embodiments of the present invention described above, at least one second task batch is determined; for each second task batch, a third execution time corresponding to the second task batch is determined, and the correspondence between the third execution time corresponding to the second task batch and the feature information of the second task batch is saved in a mapping relationship; a first task set is generated based on at least two speech data in the speech dataset to be recognized; based on the mapping relationship, the first task set is divided into at least one first task batch; each task in each first task batch is executed in parallel to obtain the target speech recognition result corresponding to each speech data. Thus, generating a mapping relationship based on information from multiple second task batches can improve the accuracy of the mapping relationship, thereby improving the accuracy of the first task batch.
[0112] In some embodiments, the method further includes steps S36 to S37, wherein: Step S36: Determine at least one sixth task batch from each of the fifth task batches.
[0113] Here, each sixth task batch is different from each second task batch. In implementation, each sixth task batch corresponds to a non-sampling point, that is, each sixth task batch is used as a completion point. For example, for sampling points (12,5,5) and (12,8,8), the completion points can include at least (12,6,6) and (12,7,7).
[0114] Step S37: For each sixth task batch, determine the seventh execution time corresponding to the sixth task batch, and save the correspondence between the seventh execution time corresponding to the sixth task batch and the feature information of the sixth task batch into the mapping relationship.
[0115] Here, the methods for determining the seventh execution time may include, but are not limited to, the execution time of the target task batch, weighting the execution time of the target task batch, the mean / variance / mean squared error of multiple target execution times, or the mean / variance / mean squared error after weighting each target execution time, etc. The target task batch is the task batch that matches the sixth task batch in the mapping relationship. In implementation, those skilled in the art can choose the method for determining the seventh execution time according to actual needs; this embodiment of the invention does not impose limitations.
[0116] In some implementations, fill points can be determined first for the quantity of the same task, and then fill points can be determined for the quantity of different tasks.
[0117] During implementation, for each padding point containing the same task, a task batch matching the sixth task batch is found using a preset selection method, and the execution time of that matching task batch is used as the execution time of the sixth task batch. The preset selection method can include, but is not limited to, preset value, proportional, rounding, and GPU. Preset value can be an increment based on a set value. During implementation, if the duration and length of the sixth task batch are the same, the preset value can be used. Proportional can be a proportional relationship between the duration and length of the sixth task batch; if they are different, proportional increments can be used. Rounding can be rounding the duration and / or length information. GPU refers to the fact that GPUs are sensitive to multiples of 64; points exceeding multiples of 64 are ignored.
[0118] For example, if the mapping relationship includes the task batches corresponding to sampling points (11, 32, 32), (11, 33, 33), and (11, 37, 37), then the completion points can include, but are not limited to, (11, 34, 34), (11, 35, 35), and (11, 36, 36). The execution time corresponding to sampling point (11, 33, 33) can be used as the execution time of completion point (11, 34, 34), and the execution time corresponding to sampling point (11, 37, 37) can be used as the execution time of completion points (11, 35, 35) and (11, 36, 36), respectively.
[0119] For example, if the mapping relationship includes task batches corresponding to sampling points (1, 60, 64), (1, 63, 65), and (1, 61, 60), then for the completion point (1, 63, 64), since sampling point (1, 63, 65) exceeds a multiple of 64, this sampling point (1, 63, 65) is first excluded, and the sampling point with the smaller sum of the difference ratios is taken as the target sampling point, that is: The execution time corresponding to the target sampling point will be used as the execution time of the sixth task batch.
[0120] For each fill point containing a different number of tasks, the execution time of the sixth task batch can be determined based on the execution time of at least one task batch with the same size information.
[0121] For example, suppose the three-dimensional feature point corresponding to the sixth task batch is (13, 35, 35). If the mapping relationship includes three-dimensional feature points (11, 35, 35) and (17, 35, 35), then the task batch corresponding to the three-dimensional feature point (11, 35, 35) and the task batch corresponding to the three-dimensional feature point (17, 35, 35) can be taken as target task batches respectively, and the target execution time can be obtained based on the execution time of these two target task batches.
[0122] The characteristic information of the sixth task batch may include, but is not limited to, the size information of the target task, the number of tasks, etc.
[0123] In the embodiments of the present invention described above, at least one sixth task batch is determined from each of the fifth task batches; for each sixth task batch, a seventh execution time corresponding to the sixth task batch is determined, and the correspondence between the seventh execution time corresponding to the sixth task batch and the feature information of the sixth task batch is saved in the mapping relationship. In this way, generating the mapping relationship based on the information of the sixth task batch reduces testing time while improving the accuracy and completeness of the mapping relationship, thereby improving the accuracy of the first task batch.
[0124] In some embodiments, the step S37 of "determining the seventh execution time corresponding to the sixth task batch" includes steps S371 to S373, wherein: Step S371: Based on the number of tasks included in the sixth task batch, query the mapping relationship to obtain the query result.
[0125] Here, the query result indicates whether there exists a task batch in the mapping relationship with the same number of tasks as the sixth task batch.
[0126] Step S372: If the query result indicates that there is a task batch in the mapping relationship with the same number of tasks as the sixth task batch, determine the first target task batch from the mapping relationship, and take the execution time corresponding to the first target task batch as the seventh execution time corresponding to the sixth task batch.
[0127] Here, the number of tasks in the first target task batch is the same as the number of tasks in the sixth task batch. The methods for determining the first target task batch can include, but are not limited to, preset values, proportional scaling, rounding, and GPU selection. For example, if the duration and length information of the sixth task batch are consistent, they can be increased according to a preset value to obtain the target first task batch. For instance, if the mapping relationship includes task batches corresponding to sampling points (11, 32, 32) and (11, 35, 35), then for the padding point (11, 34, 34), the task batch corresponding to sampling point (11, 35, 35) can be used as the first target task batch. As another example, if the duration and length information of the sixth task batch are inconsistent, they can be selected according to a preset ratio, rounding, or GPU selection to obtain the target first task batch. For example, if the mapping relationship includes task batches corresponding to sampling points (1, 60, 64), (1, 63, 65), and (1, 61, 60), then for the fill point (1, 63, 64), since the sampling point (1, 63, 65) is more than a multiple of 64, the sampling point (1, 63, 65) is first excluded, and the task batch corresponding to the sampling point (1, 60, 64) with the smaller sum of the difference ratios is taken as the first target task batch.
[0128] Step S373: If the query result indicates that there is no task batch with the same number of tasks as the sixth task batch in the mapping relationship, determine the second target task batch and the third target task batch from the mapping relationship, and use a preset interpolation algorithm to obtain the seventh execution time corresponding to the sixth task batch based on the execution time corresponding to the second target task batch and the execution time corresponding to the third target task batch.
[0129] Here, the number of tasks in the second target task batch and the number of tasks in the third target task batch are different from the number of tasks in the sixth task batch. The duration information of the second target task batch, the duration information of the third target task batch and the duration information of the sixth task batch are the same. The length information of the second target task batch, the length information of the third target task batch and the length information of the sixth task batch are also the same.
[0130] The interpolation algorithm can be any suitable interpolation algorithm, such as linear interpolation. In implementation, those skilled in the art can choose a suitable interpolation algorithm based on actual needs; this embodiment of the invention does not impose any limitations.
[0131] The methods for determining the seventh execution time may include, but are not limited to, the product / mean / variance / mean squared error between the execution times corresponding to the second and third target task batches, or the product / mean / variance / mean squared error after weighting the execution times corresponding to the second and third target task batches respectively. In implementation, those skilled in the art can choose the method for determining the seventh execution time according to actual needs; this embodiment of the invention does not impose limitations.
[0132] In some implementations, the seventh execution time can be determined using the following formula (1-1), wherein: (1-1); in, This indicates the number of tasks included in the sixth objective task batch. The number of tasks included in the second objective task batch. This indicates the number of tasks included in the third objective task batch. for and The difference between them for and The difference between them for and The difference between them.
[0133] For example, if the mapping relationship includes task batches corresponding to sampling points (11, 32, 32), (11, 33, 33), (11, 39, 39), (17, 32, 32), (17, 33, 33), and (17, 39, 39), then for the padding point (13, 39, 39), a linear interpolation algorithm can be used to obtain the execution time corresponding to this padding point (13, 39, 39), i.e.: ; In the embodiments of the present invention described above, the mapping relationship is queried based on the number of tasks included in the sixth task batch to obtain a query result. If the query result indicates that there exists a task batch in the mapping relationship with the same number of tasks as the sixth task batch, a first target task batch is determined from the mapping relationship, and the execution time corresponding to the first target task batch is used as the seventh execution time corresponding to the sixth task batch. If the query result indicates that there is no task batch in the mapping relationship with the same number of tasks as the sixth task batch, a second target task batch and a third target task batch are determined from the mapping relationship, and a preset interpolation algorithm is used to obtain the seventh execution time corresponding to the sixth task batch based on the execution time corresponding to the second target task batch and the execution time corresponding to the third target task batch. Thus, by obtaining the execution time of the sixth task batch in different ways, the accuracy of the execution time can be improved, thereby improving the accuracy of the sixth batch of tasks, and further improving the accuracy and completeness of the mapping relationship.
[0134] Exemplary application scenarios The following explanation uses the Decoder as an example of Rescore. In ASR (Automatic Rescore) processing, to achieve high-performance inference, it's necessary to leverage data locality to reduce memory access bottlenecks. This requires grouping multiple streaming segments into a batch, utilizing the GPU to compute this batch, and returning the corresponding results. Alternatively, a multi-stream mechanism can be used for parallel computation, placing each batch separately on a dedicated stream of the GPU for computation.
[0135] The inventors analyzed the speech recognition solutions provided in related technologies and found that directly expanding multiple speech data into the maximum length batch increases redundant computation, which seriously affects inference performance. Figure 4A A schematic diagram of a first task batch provided in the prior art is shown, such as... Figure 4A As shown, the task set includes tasks 1 through 4. Task 1 has a size of 1 row and 1 column, task 2 has a size of 2 rows and 2 columns, task 3 has a size of 6 rows and 6 columns, and task 4 has a size of 8 rows and 8 columns. Dividing the task set into a first task batch requires expanding the sizes of tasks 1, 2, and 3 to match the size of task 4, which increases redundant computation. While placing each batch on a separate stream on the GPU improves computational efficiency to some extent, it also presents a significant memory access bottleneck.
[0136] To address the problems existing in the speech recognition solutions provided in the aforementioned related technologies, the inventors divided their work into two parts: establishing a mapping relationship between the feature information and execution time of each task batch, and dividing the task set based on the mapping relationship.
[0137] Figure 4B The diagram illustrates a process for establishing a mapping relationship according to an embodiment of the present invention, such as... Figure 4B As shown, the method includes steps S411 to S417, wherein: Step S411: Construct a three-dimensional coordinate system; Here, the first dimension in the three-dimensional coordinate system represents the number of tasks in the corresponding task batch, the second dimension represents the duration of the corresponding task batch, and the third dimension represents the length of the corresponding task batch.
[0138] Step S412: Based on the preset sampling rules, determine at least one sampling point from at least one three-dimensional feature point in the three-dimensional coordinate system; Here, the sampling rules can include, but are not limited to, at least one of the following: downsampling, GPU performance, and the correlation between the duration information and length information of the task batch. In implementation, the sampling density in the first dimension can be adjusted based on downsampling; based on the GPU's sensitivity to multiples of 64, sampling can be performed twice in the second or third dimension when the value is a multiple of 64; the sampling density can be adjusted based on correlation. For example, assuming 5 seconds corresponds to 20 characters, more sampling points can be taken around the 20 characters (e.g., 18, 19, 21, 22), while fewer sampling points (50, 80, 100, etc.) can be taken around other less likely characters.
[0139] Step S413: Treat each sampling point as a batch to be tested (corresponding to the second task batch mentioned above). Step S414: Determine the execution time of each batch to be tested (corresponding to the aforementioned third execution time) using the overflow method. Here, the total execution time of the test batch and multiple benchmark batches during parallel computation is obtained in a multi-stream manner (corresponding to the fifth execution time mentioned above). The difference between the total execution time and the execution time of the benchmark batch (corresponding to the fourth execution time mentioned above) is taken as the execution time of the test batch this time (corresponding to the sixth execution time mentioned above), and the average of the multiple execution times is taken as the execution time of the test batch.
[0140] Step S415: For each batch to be tested, save the execution time and feature information of the batch to be tested into the mapping relationship; Step S416: Treat the non-sampling points as a completion batch (corresponding to the sixth task batch mentioned above), and determine the execution time of each completion batch through a preset completion method; Here, the imputation method can be to first imput the number of non-sampling points containing the same number of tasks, and then imput the number of non-sampling points containing different numbers of tasks. In implementation, first imput the non-sampling points with the same first dimension. If the second and third dimensions are the same (e.g., in the Self-Attention structure in the Decoder), increase the values in the second and third dimensions simultaneously by a preset value until the nearest sampling point is found. During the search, sampling points exceeding a multiple of 64 are ignored. If the second and third dimensions are different (e.g., in the Source-Attention structure in the Decoder), increase the second and third dimensions proportionally, ensuring that both the increased second and third dimensions are positive, until the nearest point is found. During the search, sampling points exceeding a multiple of 64 are ignored. Then, imput the non-sampling points with different first dimensions, which can be done using linear interpolation. For example, using linear interpolation, the execution time of the imputation batch can be obtained using the above formula (1-1).
[0141] Step S417: For each completed batch, save the execution time and feature information of the completed batch to the mapping relationship.
[0142] In this way, a mapping relationship is generated based on the information of multiple batches to be tested and the supplementary batches. This improves the accuracy and completeness of the mapping relationship while shortening the establishment time, thereby improving the accuracy of subsequent task batch division.
[0143] Figure 4C The schematic diagram illustrates a flow chart of a speech recognition method according to an embodiment of the present invention, such as... Figure 4C As shown, the method includes steps S421 to S425, wherein: Step S421: Generate a first task set based on at least two speech data points in the speech dataset to be recognized; Step S422: Sort each task according to its size information to obtain the second task set; Here, each task is sorted in ascending order. The second set of tasks after sorting can be an increasing array A that allows repetition, where A[i] represents the i-th task and i is a positive integer.
[0144] Step S423: For the Mth task in the second task set, obtain the grouping information of the Mth task based on the grouping information of the previous M - 1 tasks (corresponding to the first batch of information) and the mapping relationship. Here, the M tasks are divided into multiple groups, that is, a set of numbers B[k] is found, and the array A is divided into several groups. Each B[k] is the maximum value among all A[i] in its group. For the Mth task, there are M grouping schemes, where M is a positive integer. In implementation, first, use the mapping relationship to determine the execution time when the Mth task is taken as a single group; second, use the mapping relationship to determine the execution time when the Mth task is combined with each of the previous M - 1 tasks respectively; third, determine the total execution time among these M groupings; finally, select the grouping information corresponding to the minimum execution time (corresponding to the aforementioned target execution time) as the grouping information of the Mth task.
[0145] For example, first define an array C[i] and a set of schemes S[i]. Here, the meaning of S[i] is the optimal grouping scheme of A[1] - A[i], and the meaning of C[i] is the minimum evaluation value sum generated by the optimal scheme of S[i].
[0146] Then, C[i] and S[i] can be calculated sequentially starting from C[ (n is the total number of tasks), and the minimum time consumption is C[n]. In implementation, the S[i] scheme needs to select one from i schemes, that is: Based on the grouping scheme of S[j] (0 < j < i), then take A[j + 1] - A[i] as a grouping scheme. As j takes values from 1 to (i - 1), i - 1 grouping schemes are generated; Take A[1] - A[i] as a grouping scheme, generating the ith grouping scheme; Therefore, S[i] is to select the grouping scheme with the minimum evaluation value sum from these i grouping schemes.
[0147] Step S424: Based on the grouping information of each task, obtain at least one task batch (corresponding to the aforementioned first task batch); Step S425: In a parallel manner, execute each task in each task batch to obtain the target speech recognition result corresponding to each speech data.
[0148] Here, each task in each task batch is executed simultaneously through intra-group alignment padding and inter-group multi-streaming to obtain the execution result of each task. Each execution result represents the score result of the corresponding task. The score result of each task includes the score of each speech recognition result corresponding to each task. The speech recognition result with the highest score is taken as the target speech recognition result corresponding to the speech data.
[0149] Figure 4D The diagram illustrates a first task batch according to an embodiment of the present invention, such as... Figure 4D As shown, the second task set includes tasks 1 to 4. Task 1 has a size of 1 row and 1 column, Task 2 has a size of 2 rows and 2 columns, Task 3 has a size of 6 rows and 6 columns, and Task 4 has a size of 8 rows and 8 columns. Through this mapping relationship, the second task set is divided into two first task batches: the first first task batch consists of Task 1 and Task 2, and the second first task batch consists of Task 3 and Task 4. At this point, the size of Task 1 can be increased to the size of Task 2, and the size of Task 3 can be increased to the size of Task 4. In implementation, Tasks 1 to 4 are executed simultaneously using intra-group padding and inter-group multi-stream parallel computing.
[0150] In this way, on the one hand, by dividing multiple tasks into multiple batches through a pre-defined mapping relationship, not only is the accuracy of the batches improved, but the memory access bottleneck is also reduced, and the computational efficiency is also improved, thereby improving the inference efficiency and thus the throughput of the Decoder. On the other hand, executing multiple tasks in parallel can further improve the computational efficiency, thereby further improving the inference efficiency.
[0151] Exemplary voice recognition device After introducing the method of exemplary embodiments of the present invention, the following references are made. Figure 5 A chessboard display device according to an exemplary embodiment of the present invention will be described.
[0152] Figure 5 This schematically illustrates a structural block diagram of a speech recognition device according to an embodiment of the present invention, applied in an automatic speech recognition model, such as... Figure 5 As shown, the speech recognition device 500 includes: a generation module 510, a segmentation module 520, and an execution module 530. Wherein: The generation module 510 is used to generate a first task set based on at least two speech data in the speech dataset to be recognized; wherein each task in the first task set represents scoring at least one speech recognition result of the corresponding speech data. The partitioning module 520 is used to partition the first task set into at least one first task batch based on a preset mapping relationship; wherein the mapping relationship represents the relationship between the feature information of each task batch in the at least one task batch and the corresponding execution time, and each first task batch includes at least one task. The execution module 530 is used to execute each task in each of the first task batches in a parallel manner to obtain the target speech recognition result corresponding to each speech data.
[0153] In some embodiments, the partitioning module 520 is further configured to: sort each task in the first task set to obtain a second task set; for the Mth task in the second task set, obtain the first batch information of the Mth task based on the first batch information of the first M-1 tasks and the mapping relationship; and obtain each first task batch based on each first batch information.
[0154] In some embodiments, the partitioning module 520 is further configured to: generate at least one second batch of information based on the first batch information of the first M-1 tasks and the Mth task; obtain a first execution time corresponding to each second batch of information based on the mapping relationship; and obtain the first batch of information of the Mth task based on each first execution time.
[0155] In some embodiments, the segmentation module 520 is further configured to: treat the Mth task as a second batch of information; and, for the Kth task among the first M-1 tasks, combine the Kth task to the Mth task based on the first batch of information of the first K-1 tasks to form a second batch of information.
[0156] In some embodiments, the feature information includes the number of tasks and the size information of the target task; the segmentation module 520 is further configured to: for each second batch of information, determine the target task from at least one task in the second batch of information, and determine a second execution time from the mapping relationship that matches both the size information of the target task and the number of tasks included in the second batch of information, and use the second execution time as the first execution time.
[0157] In some embodiments, the partitioning module 520 is further configured to: determine a target execution time based on each of the first execution times; and use the second batch information corresponding to the target execution time as the first batch information of the Mth task.
[0158] In some embodiments, the apparatus further includes a first storage module, the first storage module being configured to: determine at least one second task batch; for each second task batch, determine a third execution time corresponding to the second task batch, and save the correspondence between the third execution time corresponding to the second task batch and the feature information of the second task batch into the mapping relationship.
[0159] In some embodiments, the first storage module is further configured to: obtain a fourth execution time corresponding to at least one third task batch; for each third task batch, obtain a fifth execution time corresponding to the fourth task batch, and determine a sixth execution time of the second task batch based on the fifth execution time corresponding to the fourth task batch and the fourth execution time corresponding to the third task batch, wherein the fourth task batch includes the second task batch and the third task batch; and determine the third execution time corresponding to the second task batch based on each sixth execution time.
[0160] In some embodiments, the first storage module is further configured to: determine three-dimensional feature points corresponding to each of the five task batches in at least one fifth task batch; determine at least one sampling point from each of the three-dimensional feature points based on a preset sampling rule; and assign each sampling point as a second task batch.
[0161] In some embodiments, the sampling rules include at least one of the following: downsampling, GPU, correlation between task batch duration information and task batch length information.
[0162] In some embodiments, the apparatus further includes a second storage module, the second storage module being configured to: determine at least one sixth task batch from each of the fifth task batches; for each sixth task batch, determine the seventh execution time corresponding to the sixth task batch, and save the correspondence between the seventh execution time corresponding to the sixth task batch and the feature information of the sixth task batch to the mapping relationship.
[0163] In some embodiments, the second storage module is further configured to: query the mapping relationship based on the number of tasks included in the sixth task batch to obtain a query result; if the query result indicates that there exists a task batch in the mapping relationship with the same number of tasks as the sixth task batch, determine a first target task batch from the mapping relationship, and use the execution time corresponding to the first target task batch as the seventh execution time corresponding to the sixth task batch, wherein the number of tasks included in the first target task batch is the same as the number of tasks included in the sixth task batch; if the query result indicates that there is no task batch in the mapping relationship with the same number of tasks as the sixth task batch. The second and third target task batches are determined from the mapping relationship. Using a preset interpolation algorithm, the seventh execution time corresponding to the sixth task batch is obtained based on the execution time corresponding to the second and third target task batches. The number of tasks in the second and third target task batches are different from the number of tasks in the sixth task batch. The duration information of the second and third target task batches is the same as that of the sixth task batch. The length information of the second and third target task batches is the same as that of the sixth task batch.
[0164] The descriptions of the apparatus embodiments above are similar to those of the method embodiments above, and have similar beneficial effects. In some embodiments, the functions or modules included in the apparatus provided by the present invention can be used to perform some or all of the steps in the method described in the above method embodiments. For technical details not disclosed in the apparatus embodiments of the present invention, please refer to the descriptions of the method embodiments of the present invention for understanding.
[0165] Exemplary electronic devices After introducing the method of exemplary embodiments of the present invention, the following references are made. Figure 6 An electronic device according to an exemplary embodiment of the present invention will be described.
[0166] Figure 6 The diagram illustrates, schematically, a hardware entity diagram of an electronic device according to an embodiment of the present invention, such as... Figure 6 As shown, the hardware entity of the electronic device 600 includes: a processor 601, a communication interface 602, and a memory 603, wherein: The processor 601 typically controls the overall operation of the electronic device 600.
[0167] Communication interface 602 enables electronic devices to communicate with other terminals or servers via a network.
[0168] The memory 603 is configured to store instructions and applications executable by the processor 601, and can also cache data to be processed or already processed (e.g., image data, audio data, voice communication data, and video communication data) in the processor 601 and various modules in the electronic device 600. It can be implemented using flash memory or random access memory (RAM). Data transfer between the processor 601, the communication interface 602, and the memory 603 can be performed via bus 604.
[0169] This invention provides an electronic device, including a memory and a processor. The memory stores a computer program that can run on the processor, and the processor executes the computer program to implement any of the methods described above.
[0170] This invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements any of the methods described above. The computer-readable storage medium can be transient or non-transient.
[0171] This invention provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program. When the computer program is read and executed by a computer, it implements some or all of the steps in the above-described method. This computer program product can be implemented specifically through hardware, software, or a combination thereof. In one optional embodiment, the computer program product is specifically embodied as a computer storage medium; in another optional embodiment, the computer program product is specifically embodied as a software product, such as a software development kit (SDK), etc.
[0172] It should be noted that although several devices or sub-devices of the electronic device and chessboard display device have been mentioned in the detailed description above, this division is not mandatory. In fact, according to embodiments of the present invention, the features and functions of two or more devices described above can be embodied in one device. Conversely, the features and functions of one device described above can be further divided and embodied by multiple devices.
[0173] Furthermore, although the operations of the method of the present invention are described in a specific order in the accompanying drawings, this does not require or imply that these operations must be performed in that specific order, or that all of the operations shown must be performed to achieve the desired result. Rather, the steps depicted in the flowchart may be performed in a different order. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.
[0174] It should be understood that each block of a flowchart and / or block diagram, as well as combinations of blocks in a flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device to produce a machine that, when executed by a computer or other programmable data processing device, creates means for implementing the functions / operations specified in the blocks of the flowchart and / or block diagram.
[0175] These computer program instructions may also be stored in a computer-readable medium that enables a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable medium produce a product comprising an instruction apparatus that implements the functions / operations specified in the boxes of a flowchart and / or block diagram.
[0176] Computer program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, such that the instructions that execute on the computer or other programmable apparatus can provide a process for implementing the functions / operations specified in the boxes of a flowchart and / or block diagram.
[0177] The use of the verbs "including" and "contains" and their inflections in the application documents does not preclude the existence of elements or steps other than those described in the application documents. The article "a" or "one" preceding an element does not preclude the existence of multiple such elements.
[0178] While the spirit and principles of the invention have been described with reference to several specific embodiments, it should be understood that the invention is not limited to the disclosed specific embodiments, and the division of aspects does not imply that features in these aspects cannot be combined for benefit; such division is merely for ease of description. The invention is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims. The scope of the appended claims is to be interpreted in the broadest sense, thereby encompassing all such modifications and equivalent structures and functions.
Claims
1. A speech recognition method, characterized in that, The method, applied in an automatic speech recognition model, includes: A first task set is generated based on at least two speech data points in the speech dataset to be recognized; wherein each task in the first task set represents scoring at least one speech recognition result of the corresponding speech data. Based on a preset mapping relationship, the first task set is divided into at least one first task batch; wherein the mapping relationship represents the relationship between the feature information of each task batch in the at least one task batch and the corresponding execution time, and each first task batch includes at least one task. Each task in each of the first task batches is executed in parallel to obtain the target speech recognition result corresponding to each speech data.
2. The method according to claim 1, characterized in that, The process of dividing the first task set into at least one first task batch based on a preset mapping relationship includes: Sort each task in the first task set to obtain the second task set; For the Mth task in the second task set, the first batch information of the Mth task is obtained based on the first batch information of the first M-1 tasks and the mapping relationship, where M is a positive integer; Each first task batch is obtained based on each of the first batch information.
3. The method according to claim 2, characterized in that, The process of obtaining the first batch information of the Mth task based on the first batch information of the first M-1 tasks and the mapping relationship includes: Based on the first batch information of the first M-1 tasks and the Mth task, at least one second batch of information is generated; Based on the mapping relationship, the first execution time corresponding to each second batch of information is obtained; Based on each of the first execution times, the first batch information of the Mth task is obtained.
4. The method according to claim 3, characterized in that, The feature information includes the number of tasks and the size information of the target task; The step of generating at least one second batch of information based on the first batch information of the first M-1 tasks and the Mth task includes: taking the Mth task as a second batch of information; and for the Kth task among the first M-1 tasks, combining the Kth task to the Mth task based on the first batch information of the first K-1 tasks to form a second batch of information; wherein, K is a positive integer not greater than M-1. The step of obtaining the first execution time corresponding to each second batch of information based on the mapping relationship includes: for each second batch of information, determining the target task from at least one task in the second batch of information, and determining a second execution time that matches the size information of the target task and the number of tasks included in the second batch of information from the mapping relationship, and using the second execution time as the first execution time; The step of obtaining the first batch information of the Mth task based on each first execution time includes: determining the target execution time based on each first execution time; and using the second batch information corresponding to the target execution time as the first batch information of the Mth task.
5. The method according to any one of claims 1 to 4, characterized in that, The method further includes: Identify at least one second task batch; wherein each second task batch includes at least one task; For each second task batch, determine the third execution time corresponding to the second task batch, and save the correspondence between the third execution time corresponding to the second task batch and the feature information of the second task batch into the mapping relationship; The step of determining the third execution time corresponding to the second task batch includes: Obtain the fourth execution time corresponding to at least one third task batch; wherein each third task batch includes at least one task; For each third task batch, the fifth execution time corresponding to the fourth task batch is obtained, and based on the fifth execution time corresponding to the fourth task batch and the fourth execution time corresponding to the third task batch, the sixth execution time of the second task batch is determined, wherein the fourth task batch includes the second task batch and the third task batch; Based on each of the sixth execution times, the third execution time corresponding to the second task batch is determined.
6. The method according to claim 5, characterized in that, The determination of at least one second task batch includes: A three-dimensional feature point is determined for each of the five task batches in at least one fifth task batch; wherein, the first dimension of each three-dimensional feature point represents the number of tasks contained in the corresponding fifth task batch, the second dimension of each three-dimensional feature point represents the duration information of the corresponding fifth task batch, and the third dimension of each three-dimensional feature point represents the length information of the corresponding fifth task batch. Based on preset sampling rules, at least one sampling point is determined from each of the three-dimensional feature points; wherein, the sampling rules include at least one of the following: downsampling, GPU, correlation between the duration information of the task batch and the length information of the task batch; Each of the sampling points is treated as a second task batch.
7. The method according to claim 6, characterized in that, The method further includes: At least one sixth task batch is determined from each of the fifth task batches, and each of the sixth task batches is different from each of the second task batches; For each sixth task batch, determine the seventh execution time corresponding to the sixth task batch, and save the correspondence between the seventh execution time corresponding to the sixth task batch and the feature information of the sixth task batch into the mapping relationship; The determination of the seventh execution time corresponding to the sixth task batch includes: Based on the number of tasks contained in the sixth task batch, the mapping relationship is queried to obtain the query results; If the query result indicates that there exists a task batch in the mapping relationship with the same number of tasks as the sixth task batch, a first target task batch is determined from the mapping relationship, and the execution time corresponding to the first target task batch is used as the seventh execution time corresponding to the sixth task batch; wherein, the number of tasks in the first target task batch is the same as the number of tasks in the sixth task batch. If the query result indicates that there is no task batch with the same number of tasks as the sixth task batch in the mapping relationship, a second target task batch and a third target task batch are determined from the mapping relationship. Then, using a preset interpolation algorithm, a seventh execution time corresponding to the sixth task batch is obtained based on the execution time corresponding to the second target task batch and the execution time corresponding to the third target task batch. Specifically, the number of tasks in the second target task batch and the number of tasks in the third target task batch are different from the number of tasks in the sixth task batch. The duration information of the second target task batch, the duration information of the third target task batch, and the duration information of the sixth task batch are all the same. The length information of the second target task batch, the length information of the third target task batch, and the length information of the sixth task batch are all the same.
8. A voice recognition device, characterized in that, The device, used in automatic speech recognition models, includes: The generation module is used to generate a first task set based on at least two speech data in the speech dataset to be recognized; wherein each task in the first task set represents scoring at least one speech recognition result of the corresponding speech data. A partitioning module is used to partition the first task set into at least one first task batch based on a preset mapping relationship; wherein the mapping relationship represents the relationship between the feature information of each task batch in the at least one task batch and the corresponding execution time, and each first task batch includes at least one task. The execution module is used to execute each task in each of the first task batches in a parallel manner to obtain the target speech recognition result corresponding to each of the speech data.
9. An electronic device comprising a processor and a memory, the memory storing a computer program executable on the processor, characterized in that, When the processor executes the computer program, it implements the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, It stores a computer program that, when executed by a processor, implements the method described in any one of claims 1 to 7.