Training method for command word recognition model, command word recognition method and device
By updating model parameters through decoding paths and objective functions, the problem of traditional command word recognition models being unable to distinguish different preset command words is solved, achieving higher recognition accuracy and lower false recognition rate, which is suitable for device voice wake-up and control.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-11
- Publication Date
- 2026-04-03
AI Technical Summary
Traditional command word recognition models struggle to effectively distinguish between different preset command words, resulting in a high false recognition rate that could potentially damage devices or systems.
By acquiring and decoding the audio of the voice command words, the optimal and suboptimal decoding paths are obtained. The corresponding objective function is then called to update the parameters of the command word recognition model in order to distinguish different preset command words.
It reduces the misrecognition rate of command words, improves the recognition rate, enhances the user experience, and is suitable for device voice wake-up and control scenarios.
Smart Images

Figure CN116778914B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of command word recognition technology, and more specifically, it provides a training method for a command word recognition model, a command word recognition method, and an apparatus. Background Technology
[0002] Command word recognition is an important subfield of speech recognition. Evaluation metrics for command word recognition include recognition rate and false recognition rate. The recognition rate can be understood as the ratio of the number of correctly recognized command words to the total number of command words to be recognized, while the false recognition rate can be understood as the ratio of the number of incorrectly recognized command words to the total number of correctly recognized command words. For command word recognition models, misidentifying a pre-defined command word as another pre-defined command word can cause significant damage to subsequent devices or systems, even more so than the impact of not recognizing it at all. Therefore, reducing the possibility of misidentifying a correct pre-defined command word is crucial for command word recognition models. Thus, overcoming the problem of command word recognition models' inability to effectively distinguish between different pre-defined command words has become a pressing technical problem that needs to be solved by those skilled in the art. Summary of the Invention
[0003] To address the problem that traditional command word recognition models struggle to effectively distinguish between different preset command words, this invention provides a training method, a command word recognition method, and an apparatus for a command word recognition model, aiming to achieve the technical objective that a trained command word recognition model can effectively recognize different preset command words.
[0004] To achieve the above-mentioned technical objectives, the present invention provides a training method for a command word recognition model, which may include, but is not limited to, at least one of the following steps.
[0005] Get the audio of the first voice command word.
[0006] The audio of the first voice command word is decoded to obtain a first optimal decoding path and at least one second optimal decoding path.
[0007] Based on whether the first optimal decoding path contains a first voice command word and whether the at least one second optimal decoding path contains a second voice command word, the corresponding objective function is invoked to update the parameters in the command word recognition model based on the objective function; wherein, the second voice command word is different from the first voice command word.
[0008] To achieve the above-mentioned technical objectives, the present invention can also provide a command word recognition method, which includes, but is not limited to, at least one of the following steps.
[0009] Receive audio of the command word to be recognized.
[0010] The audio of the command word to be identified is parsed to obtain the feature sequence to be identified.
[0011] The feature sequence to be identified is input into the command word recognition model, and the recognition result of the audio of the command word to be identified is determined according to the output of the command word recognition model; the command word recognition model can be trained by the training method of the command word recognition model according to any embodiment of the present invention.
[0012] To achieve the above-mentioned technical objectives, the present invention can also provide a training device for a command word recognition model, which may include, but is not limited to, a command word acquisition module, a command word decoding module, and a target function call module.
[0013] The command word acquisition module is used to acquire the audio of the first voice command word.
[0014] The command word decoding module is used to decode the audio of the first voice command word to obtain a first optimal decoding path and at least one second optimal decoding path.
[0015] The objective function calling module is used to call the corresponding objective function based on whether the first optimal decoding path contains a first speech command word and whether the at least one second optimal decoding path contains a second speech command word, so as to update the parameters in the command word recognition model based on the objective function.
[0016] The second voice command word is different from the first voice command word.
[0017] To achieve the above-mentioned technical objectives, the present invention can also provide a command word recognition device, which may include, but is not limited to, a command word receiving module, a command word parsing module, and a recognition result determination module.
[0018] The command word receiving module is used to receive audio of the command word to be recognized.
[0019] The command word parsing module is used to parse the audio of the command word to be identified in order to obtain the feature sequence to be identified.
[0020] The recognition result determination module is used to input the feature sequence to be recognized into the command word recognition model, and determine the recognition result of the audio of the command word to be recognized based on the output of the command word recognition model; the command word recognition model is trained by the training method of the command word recognition model according to any embodiment of the present invention.
[0021] To achieve the above-mentioned technical objectives, the present invention may also provide an electronic device, which includes a memory and a processor. The memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the processor causes the processor to perform the steps of the training method of the command word recognition model in any embodiment of the present invention or the steps of the command word recognition method in any embodiment of the present invention.
[0022] To achieve the above-mentioned technical objectives, the present invention may also provide a storage medium storing computer-readable instructions, which, when executed by one or more processors, cause the one or more processors to perform the steps of the training method of the command word recognition model in any embodiment of the present invention or the steps of the command word recognition method in any embodiment of the present invention.
[0023] The beneficial effects of this invention are as follows: The training method for the command word recognition model provided by this invention includes a first step of acquiring and decoding audio of a voice command word. Based on a first optimal decoding path and at least one second optimal decoding path obtained from the decoding, the corresponding target function is called, and the called target function is used as the basis for updating the parameters in the command word recognition model to achieve the training of the command word recognition model. The data processed in each step of this method revolves around the voice command word, demonstrating that the training method of this invention is closely related to the voice command word processing process. The problem to be solved is how to overcome the problem that the command word recognition model cannot effectively distinguish different preset command words. The method adopts the means of calling the corresponding target function based on the voice command word results contained in the decoding path and training it. This achieves the technical effect that the trained command word recognition model can effectively identify and distinguish different preset command words. It can be seen that this invention can greatly reduce the command word misrecognition rate, that is, minimize the possibility of misjudging the correct command word as other command words. This invention can be widely applied to scenarios such as device voice wake-up and voice control, with a better user experience and high user satisfaction. Attached Figure Description
[0024] Figure 1 A flowchart illustrating the training method of the command word recognition model in one or more embodiments of the present invention is shown.
[0025] Figure 2 The diagram illustrates a process for training a command word recognition model based on a pre-trained command word recognition baseline model, according to one or more embodiments of the present invention.
[0026] Figure 3 A schematic diagram illustrating possible decoding paths listed in one or more embodiments of the present invention is shown.
[0027] Figure 4 The diagram illustrates a flowchart of a command word recognition method based on a command word recognition model in one or more embodiments of the present invention.
[0028] Figure 5 A schematic diagram of the training apparatus for a command word recognition model in one or more embodiments of the present invention is shown.
[0029] Figure 6 A schematic diagram of a command word recognition device based on a command word recognition model in one or more embodiments of the present invention is shown.
[0030] Figure 7 A schematic diagram of the internal structure of an electronic device according to one or more embodiments of the present invention is shown. Detailed Implementation
[0031] The following description, in conjunction with the accompanying drawings, provides a detailed explanation and illustration of the training method, command word recognition method, and apparatus for a command word recognition model provided by this invention.
[0032] While traditional command word recognition models can effectively distinguish between command words and non-command words, they lack effective methods for differentiating different command words, making it difficult to differentiate between different preset command words. Therefore, this invention provides a training method for a command word recognition model, a command word recognition method, and an apparatus.
[0033] like Figure 1 As shown, and can be combined Figure 2 One or more embodiments of the present invention can provide a training method for a command word recognition model. This training method includes, but is not limited to, one or more of the following steps, as detailed below.
[0034] Step 101: Obtain the audio of the first voice command word. During the training of the command word recognition model, the audio of the first voice command word required for model training is acquired or read. In one or more embodiments of the present invention, the audio of the first voice command word contains information about the training voice feature sequence.
[0035] Step 102: Decode the audio of the first voice command word to obtain a first optimal decoding path and at least one second optimal decoding path. In this embodiment of the invention, a command word recognition basic model is used to decode the audio of the first voice command word.
[0036] like Figure 2As shown, the training method of the command word recognition model in one or more embodiments of the present invention may further include: training a basic command word recognition model using training speech feature sequences and known label sequences to obtain a trained basic command word recognition model, which can be used to decode the audio of the first speech command word. The basic command word recognition model in this embodiment of the present invention may be a recurrent neural network transducer (RNN-T) model. Specifically, the recurrent neural network transducer model may include, but is not limited to, an encoder network, a prediction network, a joint network, and a decoding softmax (normalized exponential function) layer. The encoder network and the prediction network are connected to the joint network, and the joint network is connected to the decoding softmax layer. The encoder network is used to learn acoustic information, the prediction network is used to learn contextual information, the joint network is used to combine the acoustic information and the contextual information, and the decoding softmax layer is used to output the posterior probability. When training the command word recognition base model, the training speech feature sequence is input into the encoding network, and the known label sequence is input into the text prediction network. After passing through the RNN-T model, the objective function is calculated using a forward and backward algorithm. The objective function is denoted as L. RNN-T Based on general speech recognition data (i.e., training speech features and label sequences) and command word data (i.e. command word training speech features and command word label sequences), this embodiment trains an RNN-T-based command word recognition model by minimizing the following objective function, which serves as the basic model for command word recognition.
[0037]
[0038] Among them, L RNN-T Let α(t,u) represent the objective function, where t represents the time step, u represents the label step, T represents the feature sequence length, U represents the label sequence length, and n represents the sum of the time step and the label step, where for any n, 1 ≤ n ≤ U + T. α(t,u) represents the forward variable, defined as the probability that the RNN-T model outputs 1 to u labels when the encoding network outputs frames 1 to t. β(t,u) represents the backward variable, defined as the probability that the RNN-T model outputs u+1 to U labels when the encoding network outputs frames t to T.
[0039] Based on the existing command word recognition model, this embodiment of the invention can decode the first speech command word audio through the decoding network (i.e., the decoding softmax layer) in the command word recognition model, and obtain a first optimal decoding path and at least one second optimal decoding path, including but not limited to the following process: parsing the first speech command word audio to obtain a training speech feature sequence; inputting the training speech feature sequence into the command word recognition model to output a posterior probability sequence; and performing a beam search on the posterior probability sequence in the decoding network of the full label space (the full label space represents all possible output modeling units). The present invention uses a beam search algorithm to search for the optimal n paths, denoted as n-best paths. Each n-best path can include the first optimal decoding path and at least one second optimal decoding path. When n = 1, it is denoted as 1-best path, representing the first optimal path, i.e., the first optimal decoding path involved in this embodiment. When n > 1, it can represent the first n optimal paths excluding the first optimal path, i.e., the optimal paths other than the first optimal decoding path, i.e., the second optimal decoding paths involved in this embodiment. The modeling units involved in the embodiments of the present invention may include, but are not limited to, characters, words, syllables, or phonemes.
[0040] like Figure 3 As shown, taking the symbol k∈{E,B,C,φ} in the first voice command word as an example, at time step t=1, the start symbol is input. <bos>Output possible symbols The probabilities of B, E, and C, for example, their probabilities are respectively Take the path with the n largest path probabilities. When n=2, the path is... [ <bos>[,B], if the current path ends with a non- Then, under the current time step (t=1), continue to output the symbol. The probabilities of E, B, and C, for example, their probabilities are respectively Take the path with the n largest path probabilities. When n=2, the path is... If the ending is Then jump to the next time step (t=2). At time step t=2, for example, the output probabilities are respectively Again, select the path with the highest probability among the top n paths. When n=2, for example, the path is... After all time steps T, the predicted sequence corresponding to the n-most probabilities is finally obtained, denoted as the n-best path. In this embodiment of the invention, the probability of the first optimal decoding path is greater than or equal to the probability of the second optimal decoding path.
[0041] Step 103: Based on whether the first optimal decoding path contains the first speech command word and whether at least one second optimal decoding path contains the second speech command word, the corresponding objective function is called to update the parameters in the command word recognition model based on the objective function; wherein, the second speech command word is different from the first speech command word. It can be seen that the present invention achieves model training through parameter updating. Specifically, the command word recognition model involved in the embodiments of the present invention can be a recurrent neural network transducer (RNN-T) model.
[0042] The updating of parameters in the command word recognition model based on the objective function in this embodiment of the invention may further include: updating the parameters in the basic command word recognition model based on the objective function, wherein the basic command word recognition model is the command word recognition model to be trained, and training the basic command word recognition model using the model training method provided by this invention to obtain the command word recognition model. In specific implementation, before calling the corresponding objective function, this method may further include a process of determining average accuracy information and a process of determining average dissimilarity distance information.
[0043] The embodiments of the present invention can determine the average accuracy information between the model prediction results corresponding to the first optimal decoding path and the second optimal decoding path and the reference label sequence, specifically determining the average accuracy between the output prediction sequence (i.e. the model prediction result) and the reference label sequence on the 1-best path and the n-best path.
[0044]
[0045] in, This represents the average accuracy between the model's predictions and the reference label sequence, where n represents the number of n-best paths. N represents the number of modeling unit replacement errors and deletion errors. r This indicates the number of correctly labeled sequence modeling units. (This is from an embodiment of the invention.) The Levenshtein edit distance is calculated as follows: The output predicted sequence is aligned with the reference label sequence and compared. Using dynamic programming algorithms, the correct, replaced, and deleted positions on each reference label sequence are determined one by one. Each replacement or deletion position is recorded as one unit of edit distance. This yields the number of replacement and deletion errors in the modeling units, and the number N of modeling units with correct label sequences. r The modeling unit can be a character, word, syllable, or phoneme.
[0046] This invention can determine the first path score of a first optimal decoding path and the second path score of a second optimal decoding path, and determine the average dissimilarity distance information between the first and second speech command words based on the first and second path scores. In a specific implementation, if the 1-best path (first optimal decoding path) of the first optimal path contains the first speech command word, and the n-best path (second optimal decoding path) other than the 1-best path contains the second speech command word, the path score of the first speech command word (labeled command word) in the 1-best path and the path score of the second speech command word (non-labeled command word) in the n-best path other than the 1-best path are taken. That is, the first path score of the first optimal decoding path and the second path score of the second optimal decoding path are determined, and the average dissimilarity distance between the first and second speech command words is determined accordingly. In other words, the average dissimilarity distance information between the first and second speech command words is determined based on the first and second path scores.
[0047]
[0048] in, This represents the average dissimilarity distance between the first and second speech command words. Indicates the score of the first path. N represents the second path score. r This indicates the number of modeling units for the first speech command word (labeled command word) in the 1-best path. This represents the output probability of the modeling unit for the first speech command word (labeled command word) in the 1-best path, and n represents the number of paths in the n-best path that contain the second speech command word (non-labeled command word). This represents the number of second speech command word modeling units in the n-best path that contains the second speech command word (non-labeled command word). This represents the output probability of the second speech command word modeling unit in the path where the n-best path contains the unlabeled second speech command word. The modeling unit can be a character, word, syllable, or phoneme.
[0049] like Figure 2 As shown, embodiments of the present invention can update the model using different objective functions based on whether the second optimal decoding path contains a second speech command word (non-labeled command word). Specifically, the present invention calls the corresponding objective function based on whether the first optimal decoding path contains the first speech command word and whether at least one second optimal decoding path contains the second speech command word. This process may include, but is not limited to, the following: if the first optimal decoding path contains the first speech command word and at least one second optimal decoding path contains the second speech command word, a first loss function is called as the objective function; otherwise, a second loss function is called as the objective function. The first loss function contains the average dissimilarity distance information between the first and second speech command words. The present invention calls the second loss function as the objective function only if both the first and second optimal decoding paths contain the first and second speech command words. The second loss function contains the average accuracy information between the model prediction result and the reference label sequence. It can be seen that the present invention updates the model parameters through two functions (the first loss function and the second loss function) according to different decoding results.
[0050] When the 1-best path contains the first speech command word (labeled command word), and the n-best path other than the 1-best path also contains the second speech command word (unlabeled command word), the first loss function is used to update the model parameters in order to maximize the dissimilarity distance between the first speech command word (labeled command word) and the second speech command word (unlabeled command word). The first loss function is expressed as follows.
[0051]
[0052] Where L1 represents the first loss function, L RNN-T This represents the objective function of the command word recognition base model. This represents the average dissimilarity distance between the first and second speech command words.
[0053] Otherwise, in this embodiment of the invention, a second loss function is used to update the model parameters, thereby maximizing the accuracy of the decoding result. The second loss function is expressed as follows.
[0054]
[0055] Where L2 represents the second loss function, L RNN-T This represents the objective function of the command word recognition base model. This represents the average accuracy between the model's prediction results and the reference label sequence.
[0056] In summary, the objective function Loss used to update model parameters in this embodiment of the invention can be expressed as follows.
[0057]
[0058] in," "" indicates the case where the 1-best path contains a labeled command word and the n-best path also contains a non-labeled command word (other keyword), in which case the objective function Loss is the first loss function L1; "other" indicates other cases besides the 1-best path containing a labeled command word and the n-best path containing a non-labeled command word, in which case the objective function Loss is the second loss function L2.
[0059] This invention updates the parameters of the RNN-T command word recognition model using the objective function Loss obtained above, specifically updating the basic parameters of the RNN-T command word recognition model to obtain a fine-tuned RNN-T command word recognition model.
[0060] When the 1-best path contains a labeled command word and the n-best path contains a non-labeled command word, the objective function is determined by maximizing the dissimilarity distance between the labeled and non-labeled command word paths. This further distinguishes the feature space representations of labeled and non-labeled command words, i.e., distinguishes the feature space representations of the first and second speech command words, thereby reducing the false recognition rate of the command word recognition model. In other cases, the objective function is determined by maximizing the accuracy, further distinguishing the feature space representations of labeled and non-labeled command words, identifying the correct command word, and thus improving the recognition rate of the command word recognition model.
[0061] The command word recognition model training method provided by this invention can be used in scenarios such as voice wake-up and command control of embedded devices, such as wake-up and control of furniture devices, to improve the anti-false triggering ability and recognition ability of the command word recognition model. Taking a smart speaker device as an example, the command word library of a command word recognition system that has integrated a command word recognition model contains preset command words such as "previous track", "next track", and "mute". When the training label command word is "previous track", if the 1-best path contains "previous track" and the n-best path (excluding the 1-best path) contains "next track", then the objective function is to maximize the difference in path scores between the two paths, so that the probability of "next track" appearing in the n-best path is reduced; otherwise, the objective function is to maximize the accuracy, so that the probability of the label command word "previous track" appearing is increased. Thus, this invention achieves the technical objective of having both a low false recognition rate and a high recognition rate in the command word recognition model.
[0062] like Figure 4 As shown, the training method of the command word recognition model is based on the same inventive concept, and one or more embodiments of the present invention can also provide a command word recognition method based on the command word recognition model of the present invention.
[0063] The command word recognition method provided in this embodiment of the invention includes, but is not limited to, at least one of the following steps, which are described in detail below.
[0064] Step 201: Receive the audio of the command word to be identified. The audio of the command word to be identified contains acoustic features. There can be multiple audio of the command word to be identified, and the command word recognition model can specifically be RNN-T. Therefore, this invention can provide a multi-command word recognition method based on RNN-T, and can effectively distinguish different command words.
[0065] Step 202: Parse the audio of the command word to be recognized to obtain the feature sequence to be recognized. The feature sequence to be recognized is an acoustic feature sequence, and the input is used to train the command word recognition model trained using the technical solution of this invention.
[0066] Step 203: Input the feature sequence to be identified into the command word recognition model, and determine the recognition result of the audio of the command word to be identified based on the output of the command word recognition model; the command word recognition model is trained according to the training method of the command word recognition model in any embodiment of the present invention. Specifically, the feature sequence to be identified is input into the encoding network of the trained RNN-T command word recognition basic model, and the probability sequence is output by decoding the softmax layer to obtain the corresponding command word recognition result. By inputting acoustic features into the trained command word recognition model for command word recognition, a recognition result with a lower false recognition rate and a higher recognition rate is obtained.
[0067] like Figure 5 As shown, the training method for the command word recognition model provided by this invention is based on the same inventive concept. One or more embodiments of this invention can also provide a training device for the command word recognition model.
[0068] The training device for the command word recognition model may include, but is not limited to, a command word acquisition module, a command word decoding module, and a target function call module, as detailed below.
[0069] The command word acquisition module is used to acquire the audio of the first voice command word.
[0070] The command word decoding module is used to decode the audio of the first voice command word to obtain a first optimal decoding path and at least one second optimal decoding path.
[0071] Optionally, the command word decoding module can be used to parse the audio of the first speech command word to obtain a training speech feature sequence; the command word decoding module can be used to input the training speech feature sequence into the command word recognition basic model to output a posterior probability sequence; the command word decoding module can be used to perform beam search processing on the posterior probability sequence in the decoding network of the full label space to determine a first optimal decoding path and at least one second optimal decoding path for the training speech feature sequence.
[0072] The objective function calling module is used to call the corresponding objective function based on whether the first optimal decoding path contains the first speech command word and whether at least one second optimal decoding path contains the second speech command word, so as to update the parameters in the command word recognition model based on the objective function. The second speech command word is different from the first speech command word.
[0073] Specifically, the objective function calling module is used to call a first loss function as the objective function based on the fact that a first optimal decoding path contains a first speech command word and at least one second optimal decoding path contains a second speech command word; the first loss function contains the average dissimilarity distance information between the first speech command word and the second speech command word.
[0074] Specifically, the objective function calling module is used to call the second loss function as the objective function, except when the first optimal decoding path contains the first speech command word and the second optimal decoding path contains the second speech command word; the second loss function contains the average accuracy information between the model prediction result and the reference label sequence.
[0075] Optionally, the objective function call module can be used to determine the average accuracy information between the model prediction results corresponding to the first optimal decoding path and the second optimal decoding path and the reference label sequence; the objective function call module is used to determine the first path score of the first optimal decoding path and the second path score of the second optimal decoding path, and to determine the average dissimilarity distance information between the first speech command word and the second speech command word based on the first path score and the second path score.
[0076] Optionally, the training device for the command word recognition model in one or more embodiments of the present invention further includes a pre-training module, which is used to train the basic command word recognition model using training speech feature sequences and known label sequences.
[0077] Optionally, the objective function call module is used to update the parameters in the command word recognition base model based on the objective function, where the command word recognition base model is the command word recognition model to be trained.
[0078] like Figure 6 As shown, based on the same inventive concept as the command word recognition method, one or more embodiments of the present invention can also provide a command word recognition device. This recognition device includes, but is not limited to, a command word receiving module, a command word parsing module, and a recognition result determination module, as detailed below.
[0079] The command word receiving module is used to receive audio of the command word to be recognized.
[0080] The command word parsing module is used to parse the audio of the command word to be recognized in order to obtain the feature sequence to be recognized.
[0081] The recognition result determination module is used to input the feature sequence to be recognized into the command word recognition model and determine the recognition result of the audio of the command word to be recognized based on the output of the command word recognition model; wherein, the command word recognition model is trained by the training method of the command word recognition model according to any embodiment of the present invention.
[0082] like Figure 7 As shown, based on the same inventive concept as the training method for the command word recognition model, this invention can also provide an electronic device. The electronic device includes a memory and a processor. The memory stores computer-readable instructions. When the computer-readable instructions are executed by the processor, the processor performs the steps of the training method for the command word recognition model or the steps of the command word recognition method in any embodiment of this invention. The detailed processes of the training method for the command word recognition model and the command word recognition method have been described in detail in this specification and will not be repeated here.
[0083] like Figure 7 As shown, based on the same inventive concept as the training method for the command word recognition model, this invention can also provide a storage medium storing computer-readable instructions. When executed by one or more processors, the computer-readable instructions cause the one or more processors to perform the steps of the training method for the command word recognition model or the steps of the command word recognition method in any embodiment of this invention. The detailed processes of the training method for the command word recognition model and the command word recognition method have been described in detail in this specification and will not be repeated here.
[0084] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable storage medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable storage medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable storage media include: electrical connections (electronic devices) having one or more wires, portable computer disks (magnetic devices), random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM, or flash memory), fiber optic devices, and compact disc read-only memory (CDROM). Furthermore, computer-readable storage media can even be paper or other suitable media on which the program can be printed, since the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in computer memory.
[0085] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0086] In the description of this specification, the terms "this embodiment," "an embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0087] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this invention, "a plurality of" means at least two, such as two, three, etc., unless otherwise explicitly specified.
[0088] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and simple improvements made on the substantive content of the present invention should be included within the protection scope of the present invention.< / bos> < / bos>
Claims
1. A training method for a command word recognition model, characterized in that, include: Obtain the audio of the first voice command word; The audio of the first voice command word is decoded to obtain a first optimal decoding path and at least one second optimal decoding path; Based on whether the first optimal decoding path contains a first voice command word and whether the at least one second optimal decoding path contains a second voice command word, the corresponding objective function is invoked to update the parameters in the command word recognition model based on the objective function; wherein, the second voice command word is different from the first voice command word; The step of calling the corresponding objective function based on whether the first optimal decoding path contains a first speech command word and whether the at least one second optimal decoding path contains a second speech command word includes: Based on the first optimal decoding path containing the first speech command word and the at least one second optimal decoding path containing the second speech command word, a first loss function is called as the objective function; otherwise, a second loss function is called as the objective function. The first loss function contains the average dissimilarity distance information between the first speech command word and the second speech command word, and the second loss function contains the average accuracy information between the model prediction result and the reference label sequence. The first loss function is expressed as follows: ; The second loss function is expressed as follows: ; in, L 1 represents the first loss function. L 2 represents the second loss function. This represents the objective function of the command word recognition base model. This represents the average dissimilarity distance between the first and second speech command words. This represents the average accuracy between the model's prediction results and the reference label sequence.
2. The training method for the command word recognition model according to claim 1, characterized in that, Before calling the corresponding target function, the following is also included: Determine the average accuracy information between the model prediction results corresponding to the first and second optimal decoding paths and the reference label sequence; Determine the first path score of the first optimal decoding path and the second path score of the second optimal decoding path, and determine the average dissimilarity distance information between the first speech command word and the second speech command word based on the first path score and the second path score.
3. The training method for the command word recognition model according to claim 1, characterized in that, The step of decoding the audio of the first voice command word to obtain a first optimal decoding path and at least one second optimal decoding path includes: The audio of the first voice command word is parsed to obtain the training voice feature sequence; The trained speech feature sequence is input into the command word recognition basic model to output a posterior probability sequence; In a full-label space decoding network, a beam search is performed on the posterior probability sequence to determine a first optimal decoding path and at least one second optimal decoding path for the training speech feature sequence.
4. The training method for the command word recognition model according to claim 3, characterized in that, It also includes: training a basic model for command word recognition using the trained speech feature sequence and the known label sequence; The step of updating the parameters in the command word recognition model based on the objective function includes: updating the parameters in the basic command word recognition model based on the objective function, wherein the basic command word recognition model is the command word recognition model to be trained.
5. A command word recognition method, characterized in that, include: Receive audio of the command word to be recognized; The audio of the command word to be identified is parsed to obtain the feature sequence to be identified; The feature sequence to be identified is input into the command word recognition model, and the recognition result of the audio of the command word to be identified is determined according to the output of the command word recognition model; the command word recognition model is trained according to the training method of the command word recognition model according to any one of claims 1-4.
6. A training device for a command word recognition model, characterized in that, include: The command word acquisition module is used to acquire the audio of the first voice command word; The command word decoding module is used to decode the audio of the first voice command word to obtain a first optimal decoding path and at least one second optimal decoding path; The objective function calling module is used to call the corresponding objective function based on whether the first optimal decoding path contains a first speech command word and whether the at least one second optimal decoding path contains a second speech command word, so as to update the parameters in the command word recognition model based on the objective function; Wherein, the second voice command word is different from the first voice command word; The objective function calling module is specifically used to call a first loss function as the objective function based on the first optimal decoding path containing a first speech command word and the at least one second optimal decoding path containing a second speech command word; otherwise, it calls a second loss function as the objective function. The first loss function contains the average dissimilarity distance information between the first speech command word and the second speech command word, and the second loss function contains the average accuracy information between the model prediction result and the reference label sequence. The first loss function is expressed as follows: ; The second loss function is expressed as follows: ; in, L 1 represents the first loss function. L 2 represents the second loss function. This represents the objective function of the command word recognition base model. This represents the average dissimilarity distance between the first and second speech command words. This represents the average accuracy between the model's prediction results and the reference label sequence.
7. A command word recognition device, characterized in that, include: The command word receiving module is used to receive the audio of the command word to be recognized. The command word parsing module is used to parse the audio of the command word to be identified in order to obtain the feature sequence to be identified; The recognition result determination module is used to input the feature sequence to be recognized into the command word recognition model, and determine the recognition result of the audio of the command word to be recognized based on the output of the command word recognition model; the command word recognition model is trained according to the training method of the command word recognition model according to any one of claims 1 to 4.
8. An electronic device, characterized in that, The system includes a memory and a processor, wherein the memory stores computer-readable instructions that, when executed by the processor, cause the processor to perform the steps of the training method for the command word recognition model as claimed in any one of claims 1 to 4 or the steps of the command word recognition method as claimed in claim 5.
9. A storage medium storing computer-readable instructions, characterized in that, When the computer-readable instructions are executed by one or more processors, the one or more processors perform the steps of the training method for the command word recognition model as claimed in any one of claims 1 to 4 or the steps of the command word recognition method as claimed in claim 5.
Citation Information
Patent Citations
Training method and device for word embedding model
CN109308353A
Wake-up model training method, wake-up method and electronic equipment
CN113782012A