Speech recognition method, device, storage medium and electronic device
By performing feature extraction and integral emission aggregation on the speech sequence, and processing speech frames in segments, the problem of long time-consuming and large calculations in expert model selection in the existing technology is solved, and the speed and accuracy of speech recognition are improved.
Patent Information
- Application Number
- CN202411081838.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-08
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2044-08-08
AI Technical Summary
In existing speech recognition technology, the expert model selection operation performed by the hybrid expert model on each speech frame is time-consuming and computationally intensive, resulting in reduced speech recognition speed and low accuracy.
By performing feature extraction on the target speech sequence and aggregating speech frames based on integral emission, the speech frames are processed in segments, and the same expert model is used to process continuous speech frames, thereby reducing the number and redundancy of expert model selection operations.
It improves the speed and accuracy of speech recognition, reduces the time-consuming and calculation amount of expert model selection, and achieves reasonable expert model allocation.
Smart Images

Figure CN118609548B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a speech recognition method, device, storage medium and electronic device. Background Art
[0002] In recent years, the ability of artificial intelligence models to perform various tasks has been improved to varying degrees. Taking speech recognition tasks as an example, speech recognition can be performed on speech sequences based on a hybrid expert model, which includes multiple expert models. During the speech recognition process of the hybrid expert model, an expert model selection operation needs to be performed for each speech frame in the speech sequence to select a suitable expert model. This process will result in a long time and large amount of calculation in the selection of expert models, thereby reducing the speed of speech recognition and increasing the performance consumption of speech recognition. Summary of the invention
[0003] The embodiments of the present application provide a speech recognition method, apparatus, storage medium and electronic device, which can determine the expert model adapted for each speech frame at one time by performing a single expert model selection operation, and continuous speech frames in the same speech segment can use the same expert model, so that the expert model allocation result is reasonable, the time and calculation amount of expert model selection are reduced, and not only the speech recognition speed is improved, but also the accuracy of speech recognition is improved.
[0004] According to one aspect of an embodiment of the present application, a speech recognition method is provided, the method comprising:
[0005] Acquire a target speech sequence formed by multiple speech frames;
[0006] Performing feature extraction on the target speech sequence to obtain a first feature;
[0007] Based on the first feature, the speech frames in the target speech sequence are aggregated to obtain a plurality of speech segments and an expert identifier corresponding to each of the speech segments, each of the speech segments includes a plurality of the speech frames, and the expert identifier is an identifier corresponding to an expert model that performs expert feature extraction;
[0008] For each of the speech segments, performing expert feature extraction on the first feature based on the expert model pointed to by the expert identifier corresponding to the speech segment, to obtain a target expert feature corresponding to the speech segment;
[0009] fusing the target expert features corresponding to the speech segments to obtain a second feature corresponding to the target speech sequence;
[0010] The second feature is decoded to obtain a speech recognition result.
[0011] According to one aspect of an embodiment of the present application, a speech recognition device is provided, the device comprising:
[0012] A speech acquisition module, used to acquire a target speech sequence formed by multiple speech frames;
[0013] The speech recognition module is used to perform the following operations:
[0014] Performing feature extraction on the target speech sequence to obtain a first feature;
[0015] Based on the first feature, the speech frames in the target speech sequence are aggregated to obtain a plurality of speech segments and an expert identifier corresponding to each of the speech segments, each of the speech segments includes a plurality of the speech frames, and the expert identifier is an identifier corresponding to an expert model that performs expert feature extraction;
[0016] For each of the speech segments, performing expert feature extraction on the first feature based on the expert model pointed to by the expert identifier corresponding to the speech segment, to obtain a target expert feature corresponding to the speech segment;
[0017] fusing the target expert features corresponding to the speech segments to obtain a second feature corresponding to the target speech sequence;
[0018] The second feature is decoded to obtain a speech recognition result.
[0019] According to one aspect of an embodiment of the present application, a computer device is provided, comprising a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the above-mentioned speech recognition method.
[0020] According to one aspect of an embodiment of the present application, a computer-readable storage medium is provided, in which at least one instruction, at least one program, a code set or an instruction set is stored, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by a processor to implement the above-mentioned speech recognition method.
[0021] According to one aspect of the embodiments of the present application, a computer program product is provided, the computer program product comprising computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes to implement the above-mentioned speech recognition method.
[0022] The technical solution provided in the embodiments of the present application can bring the following beneficial effects:
[0023] The embodiment of the present application proposes a speech recognition method, device, storage medium and electronic device. The speech recognition method obtains a first feature by extracting features from a target speech sequence. The first feature is aggregated based on integral emission of speech frames, and the target speech sequence can be divided into multiple speech segments. Each speech segment includes a number of continuous speech frames, which correspond to the same expert identifier and can be processed using the same expert model. Different speech segments can be processed using different expert models, thereby achieving a reasonable allocation of expert models and improving the quality of speech recognition. Moreover, a number of continuous speech frames in the target speech sequence have similar contexts and often have similar semantics. Therefore, the use of the same expert model for each speech frame in the same speech segment is conducive to the aggregation of continuous semantics and context information, thereby improving the quality of speech recognition.
[0024] The embodiment of the present application obtains an expert model adapted for each speech frame at one time, and there is no need to perform an expert model selection operation for each speech frame, thereby reducing the number of expert model selection operations, improving the expert model selection speed, reducing the expert model selection consumption, and improving the speech recognition speed. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0026] Figure 1 is a schematic diagram of an application program operating environment provided by an embodiment of the present application;
[0027] Figure 2 is a flow chart of a speech recognition method provided by an embodiment of the present application;
[0028] Figure 3 is a flow chart of a method for speech frame aggregation based on integral transmission provided by an embodiment of the present application;
[0029] Figure 4 It is a flowchart of the reasoning process provided by an embodiment of the present application;
[0030] Figure 5 is a schematic diagram of a speech recognition model provided by an embodiment of the present application;
[0031] Figure 6 This is a schematic diagram of a speech recognition model training process provided by an embodiment of the present application;
[0032] Figure 7 It is a schematic diagram of a second loss calculation method provided by an embodiment of the present application;
[0033] Figure 8 This is a schematic diagram of a third loss calculation method provided by an embodiment of the present application;
[0034] Fig. 9 is a block diagram of a speech recognition device provided by an embodiment of the present application;
[0035] Fig.10 It is a structural block diagram of a computer device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0036] Before introducing the method embodiments provided in the present application, a brief introduction is first given to the relevant terms or nouns that may be involved in the method embodiments of the present application to facilitate understanding by technicians in the field of the present application.
[0037] Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that machines have the functions of perception, reasoning and decision-making.
[0038] Artificial intelligence technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level and software-level technologies. Basic artificial intelligence technologies generally include sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, large-scale fine-tuning training technology, operation / interaction systems, mechatronics, and other technologies. Artificial intelligence software technologies mainly include computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0039] Cloud technology refers to a hosting technology that unifies hardware, software, network and other resources within a wide area network or local area network to achieve data computing, storage, processing and sharing. Cloud technology is a general term for network technology, information technology, integration technology, management platform technology, application technology, etc. based on the cloud computing business model. It can form a resource pool and be used on demand, which is flexible and convenient. Cloud computing technology will become an important support. The background services of technical network systems require a large amount of computing and storage resources, such as video websites, image websites and more portal websites. With the high development and application of the Internet industry, in the future, each item may have its own identification mark, and all need to be transmitted to the background system for logical processing. Data of different levels will be processed separately. All kinds of industry data require strong system backing support, which can only be achieved through cloud computing.
[0040] Before describing the embodiments of the present application in detail, the relevant technical background related to the embodiments of the present application is introduced to facilitate understanding by those skilled in the art in the field of the present application.
[0041] Speech recognition refers to the process of converting a continuous speech stream into corresponding text. In the process of using a speech recognition model for speech recognition, the speech recognition model can recognize speech units such as phonemes, syllables, characters, and phrases, thereby completing the complete speech recognition process.
[0042] In recent years, mixed expert models have been widely used in the field of deep learning. A typical mixed expert model has an MOE structure. The MOE (Mixture of Experts) structure is a deep learning model architecture that includes multiple expert models (Experts) and is suitable for processing complex pattern recognition tasks. The MOE structure can effectively improve the modeling ability, enhance the model's cross-domain reasoning ability, and enhance the model's robustness. As a typical pattern recognition task, speech recognition tasks often face cross-language and cross-domain modeling requirements during the modeling process. Therefore, the MOE structure has been widely used in speech recognition models.
[0043] However, when the MOE structure performs expert model selection, the following problems will occur: the range of each speech frame is extremely small, only about 10 to 40 milliseconds. In such a small range, each speech frame does not contain complete speech information. Therefore, if the expert model selection operation is performed on each speech frame, the expert model selection operation will become difficult and the selection effect will be poor in the first few layers of the speech recognition model due to the low quality of the extracted features. However, for the latter layers, the probability of continuous speech frames being selected to use the same expert model will increase due to the full integration of context information. In short, although the expert model selection operation is performed on each speech frame, the expert model selection operations of adjacent speech frames are actually likely to have the same result, which leads to a high degree of selection duplication and selection process redundancy in so many expert model selection operations. Moreover, frequent expert model selection operations will reduce the recognition speed of the speech recognition model.
[0044] In view of this, an embodiment of the present application provides a speech recognition method, which can perform feature extraction on a target speech frame sequence formed by multiple speech frames to obtain a first feature, and then perform speech frame aggregation based on integral emission on the first feature. This process essentially segments the target speech frame sequence, and each speech segment obtained includes several continuous speech frames. These speech frames are processed using the same expert model, so there is no need to perform an expert model selection operation for each speech frame. An expert model adapted for each speech frame is obtained through a one-time expert model selection operation, which reduces the computational complexity and redundancy of the expert model selection operation, and also reduces the reasoning difficulty of each expert model, making the allocation of expert models more reasonable, thereby improving the accuracy and speed of speech recognition.
[0045] To make the purpose, technical solution and advantages of this application clearer, the following will further describe the implementation of this application in detail with reference to the accompanying drawings. It should be noted that the various data used in the embodiments of this application have been fully authorized by the relevant entities before use.
[0046] Please refer to Figure 1 , which shows a schematic diagram of an application program running environment provided by an embodiment of the present application. The application program running environment may include: a terminal 10 and a server 20.
[0047] The terminal 10 includes, but is not limited to, electronic devices such as mobile phones, computers, intelligent voice interaction devices, smart home appliances, vehicle-mounted terminals, game consoles, e-book readers, multimedia playback devices, wearable devices, etc. The terminal 10 may be installed with a client of an application program.
[0048] In an embodiment of the present application, the above-mentioned application can be any application that relies on voice recognition or provides voice recognition services, and is implemented based on the voice recognition method mentioned in the embodiment of the present application. Typically, the application is a question-and-answer application. Of course, in addition to question-and-answer applications, other types of applications can also provide services based on voice recognition. For example, news applications, social applications, interactive entertainment applications, browser applications, shopping applications, content sharing applications, virtual reality (VR) applications, augmented reality (AR) applications, etc., which are not limited in the embodiment of the present application. Optionally, a client of the above-mentioned application is running in the terminal 10.
[0049] The server 20 is used to provide background services for the client of the application in the terminal 10. For example, the server 20 can be the background server of the above application. The server 20 can be an independent physical server, or a server cluster or distributed system composed 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 communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. Optionally, the server 20 provides background services for applications in multiple terminals 10 at the same time.
[0050] Optionally, the terminal 10 and the server 20 may communicate with each other via a network 30. The terminal 10 and the server 20 may be directly or indirectly connected via wired or wireless communication, which is not limited in the present application.
[0051] Please refer to Figure 2 , which shows a flow chart of a speech recognition method provided by an embodiment of the present application. The method can be applied to a computer device, which refers to an electronic device with data calculation and processing capabilities. For example, the execution subject of each step can be Figure 1 The method may include the following steps:
[0052] Step S201: Acquire a target speech sequence formed by multiple speech frames.
[0053] The target speech sequence refers to the speech sequence that needs to be speech recognized. The present application does not limit the number and source of the target speech sequence, which can come from the Internet or from user input.
[0054] Step S202: extract features from the target speech sequence to obtain a first feature.
[0055] The embodiments of the present application do not limit the feature extraction method, and relevant feature extraction networks can be used. In an exemplary embodiment, the first feature can be obtained by using an initial feature extraction network with feature extraction capabilities in a speech recognition model. The speech recognition model may include multiple Conformer layers, and the first several layers of Conformer layers can be used as the initial feature extraction network. The Conformer layer is a neural network structure used in speech recognition and other sequence modeling tasks, which combines the local perception ability of convolutional neural networks with the long-term dependency capture ability of recurrent neural networks. The Conformer layer uses the local feature extraction ability of convolutional neural networks to capture local time-frequency features through convolution operations. The recurrent neural network is used in combination with the convolutional neural network to capture long-distance dependencies. In addition, the Conformer layer can also include a multi-head self-attention mechanism to simultaneously focus on multiple positions in the sequence when processing information on the sequence morphology. The Conformer layer generates a more comprehensive representation, such as the first feature, by fusing features from the convolutional neural network and the recurrent neural network, thereby ensuring the quality of the first feature.
[0056] Step S203. Based on the above-mentioned first feature, the speech frames in the above-mentioned target speech sequence are aggregated to obtain multiple speech segments and expert identifiers corresponding to each of the above-mentioned speech segments, each of the above-mentioned speech segments includes multiple of the above-mentioned speech frames, and the above-mentioned expert identifiers are identifiers corresponding to the expert model that performs expert feature extraction.
[0057] The embodiment of the present application can perform speech frame aggregation based on integral emission on the speech frames of the target speech sequence through the above-mentioned first feature to obtain multiple speech segments and expert identifiers corresponding to each of the above-mentioned speech segments. The speech frame aggregation based on integral emission can be implemented through a continuous integration emission network. The continuous integration emission network, namely CIF (Continuous Integrate-and-Fire), is a computational model of a biological nervous system used to simulate the discharge behavior of biological neurons. This model is inspired by the working mechanism of biological neurons and can integrate continuous input signals and trigger the "firing" or discharge of neurons when accumulated to a certain extent. The continuous integration emission network receives continuous input signals in the integration stage, integrates the signal, and is triggered to generate a preset action when the integral value reaches a threshold, that is, generates emission. Therefore, the continuous integration emission network has two characteristics of integration and emission. The embodiment of the present application uses these two characteristics to realize speech frame aggregation based on integral emission.
[0058] By utilizing speech frame aggregation based on integral emission, several consecutive speech frames can be aggregated into a speech segment, thereby dividing the target speech sequence into multiple speech segments. Each speech segment corresponds to an expert identifier, that is, each speech frame of the speech segment uses the expert model corresponding to the expert identifier. In this way, the selection of expert models for all speech frames is achieved at one time. Using the same expert model for adjacent speech frames is conducive to fully aggregating similar contextual information and maintaining semantic continuity. Therefore, the selection of such expert models is more reasonable, and at the same time improves the efficiency, speed and quality of expert model selection.
[0059] Step S204: For each of the above speech segments, expert features are extracted from the above first feature based on the expert model pointed to by the expert identifier corresponding to the above speech segment, so as to obtain the target expert features corresponding to the above speech segment.
[0060] The speech recognition model may include several reasoning units, each of which may include at least one MOE structure, and the MOE structure may include multiple expert models. The MOE structure may also be constructed using a Confomer layer, and the MOE structure may perform expert feature extraction operations through expert models to improve the accuracy of speech recognition. The related technology requires that the following operations be performed for each reasoning unit: when the reasoning unit performs reasoning, a suitable expert model is selected for each speech frame. Then, if there are multiple reasoning units, each MOE structure needs to screen out an expert model that is adapted to each speech frame, which requires a large number of expert model selection operations. In the embodiment of the present application, multiple speech segments are obtained at one time, and all speech frames in each speech segment use the same expert identifier. Regardless of how many reasoning units there are in the speech recognition model and how many MOE structures there are, the expert model corresponding to the same expert identifier is used to output the corresponding expert feature extraction results, so all expert model selections are completed at one time. In the embodiment of the present application, only one expert model selection operation is required when performing speech recognition, which significantly reduces the number of executions of the expert model selection operation and greatly reduces the redundancy of expert model selection.
[0061] After at least one expert feature extraction operation, the final target expert feature of each speech frame can be obtained.
[0062] Step S205: Fusing the target expert features corresponding to the above speech segments to obtain the second feature corresponding to the above target speech sequence.
[0063] In an exemplary implementation, the target expert features corresponding to the above-mentioned speech segments may be sequentially concatenated to obtain the second feature corresponding to the above-mentioned target speech sequence.
[0064] Step S206: Decode the second feature to obtain a speech recognition result.
[0065] The process from acquiring the target speech sequence to obtaining the second feature can be understood as a feature encoding process. By decoding the second feature, the speech recognition result can be output, and the speech recognition result can be presented in the form of text.
[0066] The speech recognition method of the embodiment of the present application obtains the first feature by extracting the features of the target speech sequence. The first feature is aggregated based on the speech frame of the integral emission, and the target speech sequence can be divided into a plurality of speech segments. Each speech segment includes a plurality of continuous speech frames, which correspond to the same expert identification and can be processed using the same expert model. Different speech segments can be processed using different expert models, thereby achieving the reasonable allocation of expert models and improving the quality of speech recognition. Moreover, a plurality of continuous speech frames in the target speech sequence have similar contexts and often have similar semantics. Therefore, the use of the same expert model by each speech frame in the same speech segment is conducive to the aggregation of semantics and context information with continuity, thereby improving the quality of speech recognition. The embodiment of the present application obtains the expert model adapted to each speech frame at one time, and there is no need to perform an expert model selection operation for each speech frame, thereby reducing the number of implementation times of the expert model selection operation, improving the selection speed of the expert model, reducing the selection consumption of the expert model, and improving the speech recognition speed.
[0067] Please refer to Figure 3 , which shows a flow chart of a method for speech frame aggregation based on integral emission. Based on the first feature, the speech frames in the target speech sequence are aggregated to obtain multiple speech segments and expert identifiers corresponding to each of the speech segments, including:
[0068] Step S301: extract information from the first feature to obtain a third feature.
[0069] The continuous integration emission network can first extract information from the first feature to obtain the third feature.
[0070] Step S302: predicting the integral unit value corresponding to each of the speech frames based on the third feature.
[0071] The continuous integration transmission network can directly fit the confidence corresponding to each of the above-mentioned speech frames based on the third feature. The confidence is a decimal between 0 and 1, which serves as the integration unit value corresponding to the speech frame.
[0072] Step S303: Determine at least one transmitted speech frame by integrating the values of the above-mentioned integral units, where the above-mentioned transmitted speech frame is a speech frame whose corresponding integral value meets the preset requirement.
[0073] The integration process of the continuous integrated transmission network is to integrate the values of each integration unit in sequence, and each time the preset requirements are met, the corresponding voice frame is used as the transmission voice frame. The embodiment of the present application does not limit the preset requirements. For example, if the integration value reaches or exceeds the preset value, such as 1, after the integration operation is performed on the first 4 voice frames of the target voice sequence, the 4th voice frame is the transmission voice frame, and the first 4 voice frames form the first voice segment. Re-integration starts from the 5th voice frame. If the integration value of the 10th voice frame reaches or exceeds the preset value again, such as 1, the 10th voice frame is also a transmission voice frame, and the 5th voice frame to the 10th voice frame form the second voice segment. Integration and transmission are capabilities that the continuous integrated transmission network itself possesses. That is to say, the continuous integrated transmission network can determine a number of transmission voice frames based on the principle of integral transmission, thereby determining a number of voice segments.
[0074] Step S304: Obtain the above-mentioned multiple voice segments according to each of the above-mentioned transmitted voice frames.
[0075] According to the foregoing, each speech segment may include at most one transmitted speech frame, and in some cases, the last speech segment may not include a transmitted speech frame. For example, for a target speech sequence including 13 speech frames, if the 4th speech frame and the 10th speech frame are both transmitted speech frames, on the basis of obtaining the aforementioned two speech segments, the 11th speech frame to the 13th speech frame will also form a speech segment, which is the last speech segment without transmitting a speech frame, and a total of 3 speech segments are obtained. The speech segment can also be obtained synchronously to obtain the time period corresponding to each speech segment, that is, to determine which time period corresponds to the speech segment when the target speech sequence is played, which is also information that cannot be obtained in the relevant technology. Taking the foregoing as an example, the first speech segment is the first speech frame to the fourth speech frame, and the playback time of each speech frame is known information, so the playback time period corresponding to the first speech segment can be determined. Each speech segment segmented by the embodiment of the present application can be identified as a corresponding speech unit, and the speech unit is a phoneme, a syllable, a word or a phrase.
[0076] In some embodiments, based on the first feature, the speech frames in the target speech sequence are aggregated to obtain multiple speech segments and expert identifiers corresponding to each of the speech segments, and also includes: for each of the speech segments, determining the corresponding speech segment feature in the third feature; determining a target expert screening distribution based on the speech segment feature, the target expert screening distribution indicates the probability of each expert model being selected; based on the target expert screening distribution, determining the expert identifier corresponding to the speech segment.
[0077] Specifically, the third feature is a feature that describes the entire target speech sequence, from which the speech segment features corresponding to each speech segment are separated. , specific , is the first feature output by the initial feature extraction network, is the mapping from the first feature to the speech segment. The target expert screening distribution can be predicted, and the target expert screening distribution includes a probability value corresponding to each expert identifier, and the expert identifier with the largest probability value can be used as the expert identifier corresponding to the speech segment.
[0078] In the embodiment of the present application, at least one inference unit can be used to extract the first feature, each of which includes a MOE structure, and the MOE structure includes several expert models for expert feature extraction. Figure 4 The flowchart of the reasoning process of a single reasoning unit is shown. For each of the above-mentioned speech segments, the expert feature extraction is performed on the above-mentioned first feature based on the expert model pointed to by the expert identifier corresponding to the above-mentioned speech segment to obtain the target expert feature corresponding to the above-mentioned speech segment, including:
[0079] Step S401. Perform non-expert feature extraction on the first feature to obtain a fourth feature;
[0080] Reasoning units can include non-expert models and expert models. Figure 5 , which shows an exemplary schematic diagram of a speech recognition model. The speech recognition model includes a total of M reasoning units, each of which includes a non-expert model (Non-expert Layer) and multiple expert models E1, E2, E3..., and the Non-expert Layer can also be constructed based on the Conform layer. Taking the first reasoning unit as an example, after obtaining the first feature from the initial feature extraction network composed of K Conformer layers, the first feature is input into the corresponding Non-expert Layer for non-expert feature extraction to obtain the fourth feature, and M is a positive integer greater than 1.
[0081] Step S402. For each of the above-mentioned speech segments, the above-mentioned fourth feature is input into the expert model pointed to by the expert identifier corresponding to the above-mentioned speech segment to obtain the corresponding first expert feature, and the above-mentioned first expert feature is the above-mentioned target expert feature, or the above-mentioned first expert feature is the basic feature used to obtain the above-mentioned target expert feature.
[0082] The fourth feature output by the non-expert layer of the first reasoning unit is the common input of all expert models of the first reasoning unit, thereby obtaining the output of each expert model. For each speech segment, the data output by the expert model pointed to by the corresponding expert identifier can be used as the corresponding first expert feature.
[0083] Please refer to Figure 5 , which includes multiple reasoning units, and the reasoning process of subsequent reasoning units is the same as that of the first reasoning unit. In the embodiment of the present application, each reasoning unit participates in forming an expert feature extraction network, because each reasoning unit includes multiple expert models. In the case where the above-mentioned first expert feature is a basic feature for obtaining the above-mentioned target expert feature, the above-mentioned first feature is subjected to expert feature extraction based on the expert model pointed to by the expert identifier corresponding to the above-mentioned speech segment for each of the above-mentioned speech segments to obtain the target expert feature corresponding to the above-mentioned speech segment, and also includes: non-expert feature extraction is performed on the above-mentioned first expert feature corresponding to each of the above-mentioned speech segments to obtain the fifth feature; for each of the above-mentioned speech segments, the above-mentioned fifth feature is input into the expert model pointed to by the expert identifier corresponding to the above-mentioned speech segment to obtain the corresponding second expert feature, and the above-mentioned second expert feature is the above-mentioned target expert feature, or the above-mentioned second expert feature is the basic feature for obtaining the above-mentioned target expert feature. Specifically, the above-mentioned first expert features corresponding to each of the above-mentioned speech segments can be spliced according to the order of the speech segments, and the splicing results can be subjected to non-expert feature extraction to obtain the fifth feature.
[0084] Please refer to Figure 5 , the expert features corresponding to each speech segment output by the last inference unit are the target expert features corresponding to each speech segment. The target expert features are concatenated according to the order of the speech segments to obtain the second features, which are then input into the decoding network to finally obtain the speech recognition result.
[0085] by Figure 5 Taking the speech recognition model shown as an example, it includes an expert selection network, an initial feature extraction network, an expert feature extraction network and a decoding network. The expert feature extraction network includes multiple expert models. These networks have been described above and will not be described here. The above-mentioned feature extraction of the target speech sequence to obtain the first feature includes: inputting the target speech sequence into the initial feature extraction network to obtain the first feature; the above-mentioned aggregation of speech frames in the target speech sequence based on the first feature to obtain multiple speech segments and expert identifiers corresponding to each of the speech segments includes: inputting the first feature into the expert selection network to obtain the multiple speech segments and the expert identifiers corresponding to each of the speech segments; the above-mentioned expert model pointed to by the expert identifier corresponding to the speech segment extracts the expert feature of the first feature to obtain the target expert feature corresponding to the speech segment, including: extracting the expert feature of the first feature based on the expert model corresponding to the corresponding expert identifier in the expert feature extraction network to obtain the target expert feature corresponding to the speech segment; the above-mentioned decoding of the second feature to obtain the speech recognition result includes: inputting the second feature into the decoding network to obtain the speech recognition result.
[0086] Please refer to Figure 6 , which shows a schematic diagram of the speech recognition model training process of an embodiment of the present application. The training process includes:
[0087] Step S601. Obtain a sample speech sequence formed by a plurality of sample speech frames; input the sample speech sequence into the initial feature extraction network to obtain a sample first feature.
[0088] Input the sample speech sequence Figure 5 The initial feature extraction network in can output the first feature of the sample after K layers of Conformer layers, where K is an integer greater than 1.
[0089] Step S602: Input the first feature of the sample into the expert selection network to obtain a plurality of sample speech segments and an expert identifier corresponding to each of the sample speech segments.
[0090] Please refer to Figure 5 , the expert selection network includes a continuous integrated emission network (CIF Predictor) and a gate network (MoE Gate), and the above-mentioned first feature of the sample is input into the above-mentioned expert selection network to obtain multiple sample speech segments and expert identifiers corresponding to each of the above-mentioned sample speech segments, including: inputting the above-mentioned first feature of the sample into the above-mentioned continuous integrated emission network to obtain the sample third feature and the integral unit value corresponding to each of the above-mentioned sample speech frames determined based on the above-mentioned third feature of the sample; based on the integral unit value corresponding to each of the above-mentioned sample speech frames, determining the above-mentioned multiple sample speech segments; for each of the above-mentioned sample speech segments, determining the corresponding sample speech segment feature in the above-mentioned third feature of the sample; inputting the above-mentioned sample speech segment feature into the above-mentioned gate network to obtain the sample expert screening distribution; based on the above-mentioned sample expert screening distribution, determining the expert identifier corresponding to the above-mentioned sample speech segment. This process is based on the same inventive concept as the above-mentioned integration and emission process, and will not be repeated here.
[0091] Specifically, the gating network can use the following formula calculate , is a vector in which each position includes the probability value corresponding to the expert identification at the corresponding position. and are the parameters of the gating network. This has been mentioned in the previous article, so I won’t repeat it here.
[0092] Step S603: For each of the sample speech segments, expert feature extraction is performed on the sample first feature based on the expert model corresponding to the corresponding expert identifier in the expert feature extraction network to obtain the sample expert feature corresponding to the sample speech segment.
[0093] The expert feature extraction network includes multiple reasoning units, each of which uses the expert model corresponding to the corresponding expert identifier to output the features corresponding to the corresponding sample speech segment, until the last reasoning unit uses the expert model corresponding to the corresponding expert identifier to output the sample expert features corresponding to the corresponding sample speech segment.
[0094] Step S604: Fuse the sample expert features corresponding to the sample speech segments to obtain the sample second features; input the sample second features into the decoding network to obtain the sample speech recognition results.
[0095] The sample expert features output by the last inference unit are concatenated to obtain the sample second feature, and the sample second feature is input into the decoding network (CTC Decoder) to obtain the sample speech recognition result.
[0096] Step S605: Determine a model loss, wherein the model loss includes a first loss for indicating a difference between the sample speech recognition result and the annotation, wherein the annotation indicates the speech content of the sample speech sequence.
[0097] The first loss is a basic loss used in speech recognition model training. It is used to quantify the difference between speech recognition results and actual speech content. Needless to say,
[0098] Furthermore, the above-mentioned model loss in the embodiment of the present application may also include a second loss, which quantifies the loss caused by segmenting the sample speech segment. Figure 7 , which shows a schematic flow chart of a second loss calculation method according to an embodiment of the present application, including:
[0099] Step S701: Obtain a target number, where the target number indicates a reference number of sample speech segments.
[0100] The number of speech units in the sample speech sequence is a known quantity, so the sample speech segments that can be divided are also a known quantity, which is the target quantity.
[0101] Step S702: Integrate the integration unit value corresponding to each of the sample speech frames to obtain an integration result; and determine the second loss based on the difference between the integration result and the target number.
[0102] The embodiments of the present application do not limit the quantification method and do not constitute an implementation obstacle. In one embodiment, the formula Calculate the second loss, is the target number, is the total number of sample speech frames in the sample speech sequence, The integral unit value corresponding to each sample speech frame.
[0103] Furthermore, the model loss in the embodiment of the present application may also include a third loss, which quantifies the rationality of the selection of the expert model to guide the load balancing of each expert model in the speech recognition model. The sample expert screening distribution includes the screening probability corresponding to the expert identification corresponding to the sample speech segment, which is the screening probability corresponding to each sample speech segment. The maximum value of the number of positions corresponding to each expert identification in , based on the screening probability, the third loss can be calculated. Please refer to Figure 8 , which shows a schematic flow chart of a third loss calculation method according to an embodiment of the present application, including:
[0104] Step S801. For each expert identification, corresponding proportion information is determined, where the proportion information indicates the proportion of the total number of sample speech frames corresponding to the expert identification to the total number of all sample speech frames in the sample speech sequence.
[0105] For example, the sample speech sequence includes 400 sample speech frames, and a certain expert identifier only corresponds to the first sample speech segment. The first sample speech segment includes 4 sample speech frames. Then the proportion information corresponding to the expert identifier is 4 / 400, that is, 0.01.
[0106] Step S802. Determine the load information corresponding to the expert identifier based on the product of the proportion information and the screening probability corresponding to the expert identifier; determine the third loss based on the load information corresponding to each of the expert identifiers.
[0107] The embodiment of the present application does not limit the quantification method of the third loss and does not constitute an implementation obstacle. In one embodiment, it can be based on the formula Calculate the third loss, is the total number of expert identifiers, which ranges from 1 to n, and there are n expert identifiers in total. is the proportion information corresponding to expert identification i, is the screening probability corresponding to expert identification i, and The product of is the load information corresponding to the expert identification i.
[0108] In an exemplary implementation, the first loss, the second loss, and the third loss may be weightedly summed to obtain the model loss, and the embodiment of the present application does not limit the weights.
[0109] Step S606. Based on the model loss, adjust the parameters of the expert selection network, the initial feature extraction network, the expert feature extraction network and the decoding network.
[0110] The embodiments of the present application do not limit the parameter adjustment method, for example, the gradient descent method can be used. The present application also does not limit the conditions for stopping the parameter adjustment. For example, when the model loss is less than the preset loss threshold or the number of parameter adjustments is more than the preset number of times, the parameter adjustment can be stopped, and the speech recognition model can enter the application stage. The preset loss threshold and the preset number of times can be set according to the actual situation, which will not be elaborated here.
[0111] The speech recognition model trained by the embodiment of the present application has a high overall performance and can play a better role in multilingual, dialect and cross-domain speech recognition tasks. Please refer to the table below, which shows the comparison of the speech recognition effect of the speech recognition model of the embodiment of the present application and the speech recognition model in the related art. The test results of the tests conducted under multiple test set conditions all show that the speech recognition word error rate of the speech recognition model of the embodiment of the present application has been significantly improved, and it has the significant advantages of high robustness and high recognition accuracy.
[0112]
[0113] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.
[0114] Please refer to Fig. 9 , which shows a block diagram of a speech recognition device provided by an embodiment of the present application. The device has the function of implementing the above-mentioned speech recognition method, and the above-mentioned function can be implemented by hardware, or by hardware executing corresponding software. The device can be a computer device, or can be set in a computer device. The device may include:
[0115] A speech acquisition module 901 is used to acquire a target speech sequence formed by multiple speech frames;
[0116] The speech recognition module 902 is used to perform the following operations:
[0117] Performing feature extraction on the target speech sequence to obtain a first feature;
[0118] Based on the first feature, the speech frames in the target speech sequence are aggregated to obtain a plurality of speech segments and an expert identifier corresponding to each of the speech segments, each of the speech segments includes a plurality of the speech frames, and the expert identifier is an identifier corresponding to an expert model that performs expert feature extraction;
[0119] For each of the above-mentioned speech segments, expert feature extraction is performed on the above-mentioned first feature based on the expert model pointed to by the expert identifier corresponding to the above-mentioned speech segment, so as to obtain the target expert feature corresponding to the above-mentioned speech segment;
[0120] The target expert features corresponding to the above speech segments are integrated to obtain a second feature corresponding to the above target speech sequence;
[0121] The second feature is decoded to obtain a speech recognition result.
[0122] In one implementation, the speech recognition module 902 is configured to perform the following operations:
[0123] Extract information from the first feature to obtain a third feature;
[0124] Predicting the integral unit value corresponding to each of the speech frames based on the third feature;
[0125] Determine at least one transmitted voice frame by integrating each of the above-mentioned integral unit values, wherein the above-mentioned transmitted voice frame is a voice frame whose corresponding integral value meets a preset requirement;
[0126] The above-mentioned multiple speech segments are obtained according to each of the above-mentioned transmitted speech frames.
[0127] In one implementation, the speech recognition module 902 is configured to perform the following operations:
[0128] For each of the above speech segments, determining a corresponding speech segment feature in the above third feature;
[0129] Determining a target expert screening distribution based on the speech segment features, wherein the target expert screening distribution indicates a probability of each expert model being selected;
[0130] Based on the target expert screening distribution, an expert identifier corresponding to the speech segment is determined.
[0131] In one implementation, the speech recognition module 902 is configured to perform the following operations:
[0132] Perform non-expert feature extraction on the first feature to obtain a fourth feature;
[0133] For each of the above-mentioned speech segments, the above-mentioned fourth feature is input into the expert model pointed to by the expert identifier corresponding to the above-mentioned speech segment to obtain the corresponding first expert feature, and the above-mentioned first expert feature is the above-mentioned target expert feature, or the above-mentioned first expert feature is the basic feature used to obtain the above-mentioned target expert feature.
[0134] In one implementation, the speech recognition module 902 is configured to perform the following operations:
[0135] Performing non-expert feature extraction on the first expert features corresponding to each of the speech segments to obtain a fifth feature;
[0136] For each of the above-mentioned speech segments, the above-mentioned fifth feature is input into the expert model pointed to by the expert identifier corresponding to the above-mentioned speech segment to obtain the corresponding second expert feature, and the above-mentioned second expert feature is the above-mentioned target expert feature, or the above-mentioned second expert feature is the basic feature used to obtain the above-mentioned target expert feature.
[0137] In one embodiment, the speech recognition module 902 is implemented based on a speech recognition model, wherein the speech recognition model includes an expert selection network, an initial feature extraction network, an expert feature extraction network, and a decoding network, wherein the expert feature extraction network includes a plurality of the expert models.
[0138] The step of extracting features from the target speech sequence to obtain the first feature comprises: inputting the target speech sequence into the initial feature extraction network to obtain the first feature;
[0139] The method of aggregating speech frames in the target speech sequence based on the first feature to obtain a plurality of speech segments and an expert identifier corresponding to each of the speech segments comprises: inputting the first feature into the expert selection network to obtain the plurality of speech segments and an expert identifier corresponding to each of the speech segments;
[0140] The expert model pointed to by the expert identifier corresponding to the speech segment performs expert feature extraction on the first feature to obtain the target expert feature corresponding to the speech segment, including: performing expert feature extraction on the first feature based on the expert model corresponding to the corresponding expert identifier in the expert feature extraction network to obtain the target expert feature corresponding to the speech segment;
[0141] The decoding of the second feature to obtain a speech recognition result includes: inputting the second feature into the decoding network to obtain the speech recognition result.
[0142] In one implementation, the speech recognition module 902 is configured to perform the following operations:
[0143] Acquire a sample speech sequence formed by a plurality of sample speech frames;
[0144] Input the sample speech sequence into the initial feature extraction network to obtain the first feature of the sample;
[0145] Inputting the first feature of the sample into the expert selection network to obtain a plurality of sample speech segments and an expert identifier corresponding to each of the sample speech segments;
[0146] For each of the sample speech segments, performing expert feature extraction on the sample first feature based on the expert model corresponding to the corresponding expert identifier in the expert feature extraction network to obtain a sample expert feature corresponding to the sample speech segment;
[0147] The sample expert features corresponding to the above sample speech segments are integrated to obtain the sample second feature;
[0148] Input the second feature of the sample into the decoding network to obtain a sample speech recognition result;
[0149] Determining a model loss, the model loss comprising a first loss for indicating a difference between the sample speech recognition result and the annotation, the annotation indicating the speech content of the sample speech sequence;
[0150] Based on the model loss, the parameters of the expert selection network, the initial feature extraction network, the expert feature extraction network and the decoding network are adjusted.
[0151] In one embodiment, the expert selection network includes a continuous integrated emission network and a gating network, and the speech recognition module 902 is used to perform the following operations:
[0152] Inputting the sample first feature into the continuous integration transmission network to obtain a sample third feature and an integral unit value corresponding to each of the sample speech frames determined based on the sample third feature;
[0153] Determining the plurality of sample speech segments based on the integral unit value corresponding to each of the sample speech frames;
[0154] For each of the sample speech segments, determining a corresponding sample speech segment feature in the sample third feature;
[0155] Input the sample speech segment features into the gating network to obtain sample expert screening distribution;
[0156] Based on the sample expert screening distribution, an expert identifier corresponding to the sample speech segment is determined.
[0157] In one implementation, the model loss further includes a second loss, and the speech recognition module 902 is configured to perform the following operations:
[0158] obtaining a target number, wherein the target number indicates a reference number of sample speech segments;
[0159] Integrate the integral unit value corresponding to each of the sample speech frames to obtain an integral result;
[0160] Based on the difference between the above integration result and the above target number, the above second loss is determined.
[0161] In one implementation, the model loss further includes a third loss, and the speech recognition module 902 is configured to perform the following operations:
[0162] For each expert identification, determining corresponding proportion information, the proportion information indicating the proportion of the total number of sample speech frames corresponding to the expert identification to the total number of all sample speech frames in the sample speech sequence;
[0163] Determine the load information corresponding to the expert identifier based on the product of the proportion information and the screening probability corresponding to the expert identifier;
[0164] The third loss is determined based on the load information corresponding to each of the expert identifications.
[0165] It should be noted that the device provided in the above embodiment, when implementing its functions, is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.
[0166] Please refer to Fig.10 , which shows a structural block diagram of a computer device provided by an embodiment of the present application, for executing the above-mentioned speech recognition method. Specifically:
[0167] The computer device 1000 includes a central processing unit (CPU) 1001, a system memory 1004 including a random access memory (RAM) 1002 and a read only memory (ROM) 1003, and a system bus 1005 connecting the system memory 1004 and the central processing unit 1001. The computer device 1000 also includes a basic input / output system (I / O (Input / Output) system) 1006 for facilitating information transmission between various components in the computer, and a large-capacity storage device 1007 for storing an operating system 1013, application programs 1014, and other program modules 1015.
[0168] The basic input / output system 1006 includes a display 1008 for displaying information and an input device 1009 such as a mouse and a keyboard for user inputting information. The display 1008 and the input device 1009 are connected to the central processing unit 1001 through an input / output controller 1010 connected to the system bus 1005. The basic input / output system 1006 may also include an input / output controller 1010 for receiving and processing inputs from a plurality of other devices such as a keyboard, a mouse, or an electronic stylus. Similarly, the input / output controller 1010 also provides output to a display screen, a printer, or other types of output devices.
[0169] The mass storage device 1007 is connected to the central processing unit 1001 through a mass storage controller (not shown) connected to the system bus 1005. The mass storage device 1007 and its associated computer readable medium provide non-volatile storage for the computer device 1000. That is, the mass storage device 1007 may include a computer readable medium (not shown) such as a hard disk or a CD-ROM (Compact Disc Read-Only Memory) drive.
[0170] Without loss of generality, computer-readable media may include computer storage media and communication media. Computer storage media include volatile and non-volatile, removable and non-removable media implemented by any method or technology for storing information such as computer-readable instructions, data structures, program modules or other data. Computer storage media include RAM, ROM, EPROM (Erasable Programmable Read Only Memory), EEPROM (Electrically Erasable Programmable Read Only Memory), flash memory or other solid-state storage technologies, CD-ROM, DVD (Digital Video Disc) or other optical storage, cassettes, tapes, disk storage or other magnetic storage devices. Of course, those skilled in the art will know that computer storage media are not limited to the above. The above-mentioned system memory 1004 and mass storage device 1007 can be collectively referred to as memory.
[0171] According to various embodiments of the present application, the computer device 1000 can also be connected to a remote computer on the network through a network such as the Internet. That is, the computer device 1000 can be connected to the network 1012 through the network interface unit 1011 connected to the system bus 1005, or the network interface unit 1011 can be used to connect to other types of networks or remote computer systems (not shown).
[0172] The memory also includes a computer program, which is stored in the memory and configured to be executed by one or more processors to implement the speech recognition method.
[0173] In an exemplary embodiment, a computer-readable storage medium is also provided, in which at least one instruction, at least one program, a code set or an instruction set is stored. When the at least one instruction, the at least one program, the code set or the instruction set is executed by a processor, the speech recognition method is implemented.
[0174] Specifically, the speech recognition method includes:
[0175] Acquire a target speech sequence formed by multiple speech frames;
[0176] Performing feature extraction on the target speech sequence to obtain a first feature;
[0177] By performing speech frame aggregation based on integral emission on the first feature, a plurality of speech segments and an expert identifier corresponding to each of the speech segments are obtained, each of the speech segments includes a plurality of the speech frames, and the expert identifier is an identifier corresponding to an expert model for performing expert feature extraction;
[0178] For each of the speech segments, performing expert feature extraction on the first feature based on the expert model pointed to by the expert identifier corresponding to the speech segment, to obtain a target expert feature corresponding to the speech segment;
[0179] fusing the target expert features corresponding to the speech segments to obtain a second feature corresponding to the target speech sequence;
[0180] The second feature is decoded to obtain a speech recognition result.
[0181] In an exemplary embodiment, based on the first feature, the speech frames in the target speech sequence are aggregated to obtain a plurality of speech segments and an expert identifier corresponding to each of the speech segments, including:
[0182] Extract information from the first feature to obtain a third feature;
[0183] Predicting the integral unit value corresponding to each of the speech frames based on the third feature;
[0184] Determine at least one transmitted voice frame by integrating each of the above-mentioned integral unit values, wherein the above-mentioned transmitted voice frame is a voice frame whose corresponding integral value meets a preset requirement;
[0185] The above-mentioned multiple speech segments are obtained according to each of the above-mentioned transmitted speech frames.
[0186] In an exemplary embodiment, based on the first feature, the speech frames in the target speech sequence are aggregated to obtain a plurality of speech segments and an expert identifier corresponding to each of the speech segments, and further includes:
[0187] For each of the above speech segments, determining a corresponding speech segment feature in the above third feature;
[0188] Determining a target expert screening distribution based on the speech segment features, wherein the target expert screening distribution indicates a probability of each expert model being selected;
[0189] Based on the target expert screening distribution, an expert identifier corresponding to the speech segment is determined.
[0190] In an exemplary embodiment, for each of the above-mentioned speech segments, expert feature extraction is performed on the above-mentioned first feature based on the expert model pointed to by the expert identifier corresponding to the above-mentioned speech segment to obtain the target expert feature corresponding to the above-mentioned speech segment, including:
[0191] Perform non-expert feature extraction on the first feature to obtain a fourth feature;
[0192] For each of the above-mentioned speech segments, the above-mentioned fourth feature is input into the expert model pointed to by the expert identifier corresponding to the above-mentioned speech segment to obtain the corresponding first expert feature, and the above-mentioned first expert feature is the above-mentioned target expert feature, or the above-mentioned first expert feature is the basic feature used to obtain the above-mentioned target expert feature.
[0193] In an exemplary embodiment, when the first expert feature is a basic feature for obtaining the target expert feature, for each of the speech segments, the expert feature of the first feature is extracted based on the expert model pointed to by the expert identifier corresponding to the speech segment to obtain the target expert feature corresponding to the speech segment, and further includes:
[0194] Performing non-expert feature extraction on the first expert features corresponding to each of the speech segments to obtain a fifth feature;
[0195] For each of the above-mentioned speech segments, the above-mentioned fifth feature is input into the expert model pointed to by the expert identifier corresponding to the above-mentioned speech segment to obtain the corresponding second expert feature, and the above-mentioned second expert feature is the above-mentioned target expert feature, or the above-mentioned second expert feature is the basic feature used to obtain the above-mentioned target expert feature.
[0196] In an exemplary embodiment, the method is implemented based on a speech recognition model, the speech recognition model includes an expert selection network, an initial feature extraction network, an expert feature extraction network and a decoding network, the expert feature extraction network includes a plurality of the expert models,
[0197] The step of extracting features from the target speech sequence to obtain the first feature comprises: inputting the target speech sequence into the initial feature extraction network to obtain the first feature;
[0198] The method of aggregating speech frames in the target speech sequence based on the first feature to obtain a plurality of speech segments and an expert identifier corresponding to each of the speech segments comprises: inputting the first feature into the expert selection network to obtain the plurality of speech segments and an expert identifier corresponding to each of the speech segments;
[0199] The expert model pointed to by the expert identifier corresponding to the speech segment performs expert feature extraction on the first feature to obtain the target expert feature corresponding to the speech segment, including: performing expert feature extraction on the first feature based on the expert model corresponding to the corresponding expert identifier in the expert feature extraction network to obtain the target expert feature corresponding to the speech segment;
[0200] The decoding of the second feature to obtain a speech recognition result includes: inputting the second feature into the decoding network to obtain the speech recognition result.
[0201] In an exemplary embodiment, the speech recognition model is trained by the following method:
[0202] Acquire a sample speech sequence formed by a plurality of sample speech frames;
[0203] Input the sample speech sequence into the initial feature extraction network to obtain the first feature of the sample;
[0204] Inputting the first feature of the sample into the expert selection network to obtain a plurality of sample speech segments and an expert identifier corresponding to each of the sample speech segments;
[0205] For each of the sample speech segments, performing expert feature extraction on the sample first feature based on the expert model corresponding to the corresponding expert identifier in the expert feature extraction network to obtain a sample expert feature corresponding to the sample speech segment;
[0206] The sample expert features corresponding to the above sample speech segments are integrated to obtain the sample second feature;
[0207] Input the second feature of the sample into the decoding network to obtain a sample speech recognition result;
[0208] Determining a model loss, the model loss comprising a first loss for indicating a difference between the sample speech recognition result and the annotation, the annotation indicating the speech content of the sample speech sequence;
[0209] Based on the model loss, the parameters of the expert selection network, the initial feature extraction network, the expert feature extraction network and the decoding network are adjusted.
[0210] In an exemplary embodiment, the expert selection network includes a continuous integrated emission network and a gating network, and the first feature of the sample is input into the expert selection network to obtain a plurality of sample speech segments and an expert identifier corresponding to each of the sample speech segments, including:
[0211] Inputting the sample first feature into the continuous integration transmission network to obtain a sample third feature and an integral unit value corresponding to each of the sample speech frames determined based on the sample third feature;
[0212] Determining the plurality of sample speech segments based on the integral unit value corresponding to each of the sample speech frames;
[0213] For each of the sample speech segments, determining a corresponding sample speech segment feature in the sample third feature;
[0214] Input the sample speech segment features into the gating network to obtain sample expert screening distribution;
[0215] Based on the sample expert screening distribution, an expert identifier corresponding to the sample speech segment is determined.
[0216] In an exemplary embodiment, the model loss further includes a second loss, and the method further includes:
[0217] obtaining a target number, wherein the target number indicates a reference number of sample speech segments;
[0218] Integrate the integral unit value corresponding to each of the sample speech frames to obtain an integral result;
[0219] Based on the difference between the above integration result and the above target number, the above second loss is determined.
[0220] In an exemplary embodiment, the model loss further includes a third loss, the sample expert screening distribution includes a screening probability corresponding to the expert identification corresponding to the sample speech segment, and the method further includes:
[0221] For each expert identification, determining corresponding proportion information, the proportion information indicating the proportion of the total number of sample speech frames corresponding to the expert identification to the total number of all sample speech frames in the sample speech sequence;
[0222] Determine the load information corresponding to the expert identifier based on the product of the proportion information and the screening probability corresponding to the expert identifier;
[0223] The third loss is determined based on the load information corresponding to each of the expert identifications.
[0224] Optionally, the computer-readable storage medium may include: ROM (Read Only Memory), RAM (Random Access Memory), SSD (Solid State Drives) or an optical disk, etc. Among them, the random access memory may include ReRAM (Resistance Random Access Memory) and DRAM (Dynamic Random Access Memory).
[0225] In an exemplary embodiment, a computer program product or a computer program is also provided, the computer program product or the computer program comprising computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the above-mentioned speech recognition method.
[0226] It should be understood that the "multiple" mentioned in this article refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. In addition, the step numbers described in this article only illustrate a possible execution sequence between the steps. In some other embodiments, the above steps may not be executed in the order of the numbers, such as two steps with different numbers are executed at the same time, or two steps with different numbers are executed in the opposite order to the diagram. The embodiments of the present application are not limited to this.
[0227] In addition, in the specific implementation of this application, related data such as user information is involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
[0228] The above are merely exemplary embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A speech recognition method, characterized in that: The method comprises: Acquire a target speech sequence formed by multiple speech frames; Performing feature extraction on the target speech sequence to obtain a first feature; Extracting information from the first feature to obtain a third feature; predicting an integral unit value corresponding to each of the speech frames based on the third feature; Determine at least one transmitted speech frame by integrating each of the integral unit values, wherein the transmitted speech frame is a speech frame whose corresponding integral value meets a preset requirement; According to each of the transmitted speech frames, a plurality of speech segments are obtained, each of the speech segments comprising a plurality of the speech frames; For each of the speech segments, determine the corresponding speech segment features in the third features; determine the probability of each expert model being selected based on the speech segment features; and use the expert identifier of the expert model with the highest probability as the expert identifier corresponding to the speech segment; For each of the speech segments, performing expert feature extraction on the first feature based on the expert model pointed to by the expert identifier corresponding to the speech segment, to obtain a target expert feature corresponding to the speech segment; fusing the target expert features corresponding to the speech segments to obtain a second feature corresponding to the target speech sequence; The second feature is decoded to obtain a speech recognition result.
2. The method according to claim 1, characterized in that For each of the speech segments, performing expert feature extraction on the first feature based on the expert model pointed to by the expert identifier corresponding to the speech segment to obtain the target expert feature corresponding to the speech segment includes: Performing non-expert feature extraction on the first feature to obtain a fourth feature; For each of the speech segments, the fourth feature is input into the expert model pointed to by the expert identifier corresponding to the speech segment to obtain the corresponding first expert feature, where the first expert feature is the target expert feature, or the first expert feature is the basic feature used to obtain the target expert feature.
3. The method according to claim 2, characterized in that In a case where the first expert feature is a basic feature for obtaining the target expert feature, for each of the speech segments, performing expert feature extraction on the first feature based on an expert model pointed to by an expert identifier corresponding to the speech segment to obtain the target expert feature corresponding to the speech segment, further comprising: Performing non-expert feature extraction on the first expert features corresponding to each of the speech segments to obtain a fifth feature; For each of the speech segments, the fifth feature is input into the expert model pointed to by the expert identifier corresponding to the speech segment to obtain the corresponding second expert feature, where the second expert feature is the target expert feature, or the second expert feature is the basic feature used to obtain the target expert feature.
4. The method according to claim 1, characterized in that: The method is implemented based on a speech recognition model, the speech recognition model includes an expert selection network, an initial feature extraction network, an expert feature extraction network and a decoding network, the expert feature extraction network includes a plurality of the expert models, and the speech recognition model is trained by the following method: Acquire a sample speech sequence formed by a plurality of sample speech frames; Inputting the sample speech sequence into the initial feature extraction network to obtain the first feature of the sample; Inputting the sample first feature into the expert selection network to obtain a plurality of sample speech segments and an expert identifier corresponding to each of the sample speech segments; For each of the sample speech segments, performing expert feature extraction on the sample first feature based on the expert model corresponding to the corresponding expert identifier in the expert feature extraction network to obtain a sample expert feature corresponding to the sample speech segment; Fusion of sample expert features corresponding to each of the sample speech segments to obtain a second sample feature; Inputting the second feature of the sample into the decoding network to obtain a sample speech recognition result; determining a model loss, the model loss comprising a first loss for indicating a difference between the sample speech recognition result and an annotation, the annotation indicating speech content of the sample speech sequence; Based on the model loss, parameters of the expert selection network, the initial feature extraction network, the expert feature extraction network, and the decoding network are adjusted.
5. The method according to claim 4, characterized in that The expert selection network includes a continuous integrated emission network and a gating network. The first feature of the sample is input into the expert selection network to obtain a plurality of sample speech segments and an expert identifier corresponding to each of the sample speech segments, including: Inputting the sample first feature into the continuous integration transmission network to obtain a sample third feature and an integral unit value corresponding to each sample speech frame determined based on the sample third feature; Determining the plurality of sample speech segments based on the integral unit value corresponding to each of the sample speech frames; For each of the sample speech segments, determining a corresponding sample speech segment feature in the sample third feature; Inputting the sample speech segment features into the gating network to obtain a sample expert screening distribution; Based on the sample expert screening distribution, an expert identifier corresponding to the sample speech segment is determined.
6. The method according to claim 5, characterized in that The model loss also includes a second loss, and the method further includes: obtaining a target number, wherein the target number indicates a reference number of sample speech segments; Integrating the integral unit value corresponding to each of the sample speech frames to obtain an integral result; The second loss is determined based on a difference between the integration result and the target amount.
7. The method according to claim 6, characterized in that The model loss also includes a third loss, the sample expert screening distribution includes a screening probability corresponding to the expert identification corresponding to the sample speech segment, and the method also includes: For each expert identification, determining corresponding proportion information, the proportion information indicating the proportion of the total number of sample speech frames corresponding to the expert identification to the total number of all sample speech frames in the sample speech sequence; Determine the load information corresponding to the expert identifier based on the product of the proportion information and the screening probability corresponding to the expert identifier; The third loss is determined based on the load information corresponding to each of the expert identifications.
8. A speech recognition device, characterized in that: The device comprises: A speech acquisition module, used to acquire a target speech sequence formed by multiple speech frames; The speech recognition module is used to perform the following operations: Performing feature extraction on the target speech sequence to obtain a first feature; Extracting information from the first feature to obtain a third feature; predicting an integral unit value corresponding to each of the speech frames based on the third feature; Determine at least one transmitted speech frame by integrating each of the integral unit values, wherein the transmitted speech frame is a speech frame whose corresponding integral value meets a preset requirement; According to each of the transmitted speech frames, a plurality of speech segments are obtained, each of the speech segments comprising a plurality of the speech frames; For each of the speech segments, determine the corresponding speech segment features in the third features; determine the probability of each expert model being selected based on the speech segment features; and use the expert identifier of the expert model with the highest probability as the expert identifier corresponding to the speech segment; For each of the speech segments, performing expert feature extraction on the first feature based on the expert model pointed to by the expert identifier corresponding to the speech segment, to obtain a target expert feature corresponding to the speech segment; fusing the target expert features corresponding to the speech segments to obtain a second feature corresponding to the target speech sequence; The second feature is decoded to obtain a speech recognition result.
9. A computer device, characterized in that: The computer device includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the speech recognition method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The storage medium stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the speech recognition method as described in any one of claims 1 to 7.
11. A computer program product, characterized in that The computer program product includes computer instructions. The processor of a computer device reads the computer instructions, and the processor of the computer device executes the computer instructions to implement the speech recognition method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Speech recognition method and device, speech recognition model training method and device, medium and equipment
CN116013257A
Voiceprint recognition method based on phoneme information and electronic equipment
CN116403587A
