A command word recognition method, device, equipment and medium
By using pre-trained acoustic models and Viterbi decoders in speech recognition technology, combined with improved edit distance and average cost value, to determine the command words in the speech segment, the low command word recognition rate and high false trigger rate in the existing technology are solved. problem, achieving higher recognition accuracy.
Patent Information
- Application Number
- CN202111636912.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-29
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2041-12-29
AI Technical Summary
In the prior art, when command word recognition is implemented only through the edit distance of the command word sequence, the recognition rate is relatively low, resulting in a high false trigger rate.
By inputting each speech frame in the received speech segment to be recognized into the pre-trained acoustic model, the cost value of each preset phoneme corresponding to the speech frame is obtained, and input into the Viterbi decoder. , determine the optimal command word phoneme sequence and all-pass phoneme sequence, calculate the improved edit distance (IPED), judge the command word confidence in the speech segment based on the average cost value, and determine the target command word.
The false trigger rate is reduced, the recognition rate of the command word recognition process is improved, and the accuracy of command word recognition is enhanced.
Smart Images

Figure CN114333777B
Abstract
Description
Technical Field
[0001] The present application relates to the field of speech recognition technology, and in particular to a command word recognition method, device, equipment and medium. Background Art
[0002] The problem of false triggering of command words is one of the main difficulties in the field of speech recognition technology. The so-called false triggering refers to the misrecognition of command words caused by TV noise or human voice that is not related to the command word. For example, a voice of the host on the TV triggers the "turn on" command of the voice air conditioner. The Viterbi decoder is an important part of the current command word speech recognition technology based on phoneme modeling. Improving the Viterbi decoder is one of the main development directions for improving speech recognition performance.
[0003] In the prior art, the false trigger rate of command word recognition is usually reduced by limiting the edit distance of the command word sequence. This is because different speech segments contain different phonemes, and the edit distances determined by two speech segments with completely different contents may be the same. Therefore, the credibility of solely relying on the edit distance to determine whether to trigger a command word is not high, and it will still result in a relatively low command word recognition rate.
[0004] Therefore, how to improve the recognition rate of command words becomes an urgent problem to be solved. Summary of the invention
[0005] The present application provides a command word recognition method, device, equipment and medium to solve the problem of low recognition rate when command word recognition is achieved only through the edit distance of command word sequences in the prior art.
[0006] In a first aspect, the present application provides a command word recognition method, the method comprising:
[0007] Input each speech frame in the received speech segment to be recognized into a pre-trained acoustic model, and obtain a cost value of each preset phoneme corresponding to each speech frame output by the acoustic model;
[0008] Inputting the cost value of each preset phoneme corresponding to each speech frame obtained and each preset phoneme into a Viterbi decoder, and obtaining the first target phoneme and target cost value corresponding to each output speech frame;
[0009] Determine the optimal command word phoneme sequence corresponding to the speech segment to be recognized and the target command word corresponding to the optimal command word phoneme sequence according to the first target phoneme and the target cost value corresponding to each speech frame; determine the second target phoneme corresponding to each speech frame; determine the optimal full-pass phoneme sequence corresponding to the speech segment to be recognized according to the second target phoneme corresponding to each speech frame;
[0010] Determine a target IPED of the optimal all-pass phoneme sequence and the optimal command word phoneme sequence according to each second target phoneme included in the optimal all-pass phoneme sequence and each first target phoneme included in the optimal command word phoneme sequence;
[0011] The confidence level corresponding to the speech segment to be recognized is determined based on the target IPED and the average cost value of the optimal command word phoneme sequence; and based on the confidence level, it is determined whether the target command word is a command word contained in the speech segment to be recognized.
[0012] In a second aspect, the present application further provides a command word recognition device, the device comprising:
[0013] An acquisition module is used to input each speech frame in the received speech segment to be recognized into a pre-trained acoustic model, and obtain a cost value of each preset phoneme corresponding to each speech frame output by the acoustic model; input the cost value of each preset phoneme corresponding to each speech frame obtained and each preset phoneme into a Viterbi decoder, and obtain a first target phoneme and a target cost value corresponding to each output speech frame;
[0014] A determination module is used to determine the optimal command word phoneme sequence corresponding to the speech segment to be recognized and the target command word corresponding to the optimal command word phoneme sequence according to the first target phoneme and the target cost value corresponding to each speech frame; determine the second target phoneme corresponding to each speech frame; determine the optimal all-pass phoneme sequence corresponding to the speech segment to be recognized according to the second target phoneme corresponding to each speech frame; determine the target IPED of the optimal all-pass phoneme sequence and the optimal command word phoneme sequence according to each second target phoneme included in the optimal all-pass phoneme sequence and each first target phoneme included in the optimal command word phoneme sequence;
[0015] The recognition module is used to determine the confidence corresponding to the speech segment to be recognized based on the target IPED and the average cost value of the optimal command word phoneme sequence; based on the confidence, determine whether the target command word is a command word contained in the speech segment to be recognized.
[0016] In a third aspect, the present application further provides an electronic device, which includes at least a processor and a memory, and the processor is used to implement the steps of any of the above-mentioned command word recognition methods when executing a computer program stored in the memory.
[0017] In a fourth aspect, the present application further provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of any of the above-mentioned command word recognition methods.
[0018] The embodiments of the present application provide a method, apparatus, device and medium for command word recognition, in which the optimal command word phoneme sequence, optimal all-pass phoneme sequence and target command word corresponding to the speech segment to be recognized are determined according to the cost value of each preset phoneme corresponding to each speech frame output by a pre-trained acoustic model, the target IPED is determined according to the optimal command word phoneme sequence and the optimal all-pass phoneme sequence, and the confidence corresponding to the speech to be recognized is determined according to the target IPED and the average cost value of the optimal command word phoneme sequence, and whether the target command word is a command word contained in the speech segment to be recognized is determined according to the confidence corresponding to the determined speech segment to be recognized, thereby reducing the false trigger rate and improving the recognition rate of the command word recognition process. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solution 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 paying any creative work.
[0020] Figure 1 A schematic diagram of the command word recognition process provided in an embodiment of the present application;
[0021] Figure 2 A schematic diagram of each speech frame in a speech segment to be recognized output by the acoustic model provided in an embodiment of the present application;
[0022] Figure 3 A schematic diagram of an optimal command word phoneme sequence output by a Viterbi decoder provided in an embodiment of the present application;
[0023] Figure 4 A schematic diagram of an optimal command word phoneme sequence corresponding to a speech segment to be recognized provided in an embodiment of the present application;
[0024] Figure 5 A schematic diagram of an optimal all-pass phoneme path corresponding to a speech segment to be recognized provided in an embodiment of the present application;
[0025] Figure 6 A schematic diagram corresponding to the optimal full-pass phoneme sequence corresponding to the speech segment to be recognized provided in an embodiment of the present application;
[0026] Figure 7 A schematic diagram of an IPED for determining an optimal all-pass phoneme sequence C and an optimal command word phoneme sequence T provided in an embodiment of the present application;
[0027] Figure 8 A schematic diagram of updating the target cost value of a speech frame provided in an embodiment of the present application;
[0028] Fig. 9 A flowchart of a command word recognition process provided by an embodiment of the present application;
[0029] Fig.10 A schematic diagram of the structure of a command word recognition device provided in an embodiment of the present application;
[0030] Fig.11 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0031] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the embodiment of the present application will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiment is only a part of the embodiment of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field belong to the scope of protection of this application.
[0032] The present application provides a method, apparatus, device and medium for command word recognition, wherein each speech frame in a received speech segment to be recognized is input into a pre-trained acoustic model, a cost value of each preset phoneme corresponding to each speech frame output by the acoustic model is obtained, the cost value of each preset phoneme corresponding to each speech frame obtained and each preset phoneme are input into a Viterbi decoder, a first target phoneme and a target cost value corresponding to each output speech frame are obtained, an optimal command word phoneme sequence corresponding to the speech segment to be recognized and a target command word corresponding to the optimal command word phoneme sequence are determined according to the first target phoneme and the target cost value corresponding to each speech frame; a second target phoneme corresponding to each speech frame is determined; an optimal full-pass phoneme sequence corresponding to the speech segment to be recognized is determined according to the second target phoneme corresponding to each speech frame, and a target improved edit distance (Improved Phones Edit Distance) between the optimal full-pass phoneme sequence and the optimal command word phoneme sequence is determined according to each second target phoneme contained in the optimal full-pass phoneme sequence and each first target phoneme contained in the optimal command word phoneme sequence. Distance, IPED), according to the target IPED and the average cost value of the optimal command word phoneme sequence, the confidence corresponding to the speech segment to be recognized is determined, and according to the confidence, whether the target command word is the command word contained in the speech segment to be recognized. Since the method determines the optimal command word phoneme sequence, the optimal all-pass phoneme sequence and the target command word corresponding to the speech segment to be recognized according to the cost value of each preset phoneme corresponding to each speech frame output by the pre-trained acoustic model, determines the target IPED according to the optimal command word phoneme sequence and the optimal all-pass phoneme sequence, and determines the confidence corresponding to the speech segment to be recognized according to the target IPED and the average cost value of the optimal command word phoneme sequence, and determines whether the target command word is the command word contained in the speech segment to be recognized according to the confidence corresponding to the determined speech segment to be recognized, the false trigger rate is reduced and the recognition rate of the command word recognition process is improved.
[0033] Embodiment 1:
[0034] Figure 1 The following is a schematic diagram of the command word recognition process provided in the embodiment of the present application. The process specifically includes the following steps:
[0035] S101: input each speech frame in the received speech segment to be recognized into a pre-trained acoustic model, and obtain a cost value of each preset phoneme corresponding to each speech frame output by the acoustic model.
[0036] The command word recognition method provided in the embodiment of the present application is applied to an electronic device, which may be a mobile terminal, a PC, or a smart home appliance that supports voice functions, such as an air conditioner, a television, and other devices.
[0037] When it is necessary to control an electronic device to execute a certain function through a command word, the user of the electronic device can issue a voice command to the electronic device. The voice command can be a short voice command such as "turn on", "set the temperature to 17 degrees", "sweep the wind upward", "turn off". The electronic device can receive the voice segment to be recognized input by the user through a microphone or other audio receiving hardware. Or it can also be that after another device receives the voice segment to be recognized, it sends the voice segment to be recognized to the electronic device.
[0038] After receiving the voice segment to be recognized, the electronic device can obtain each voice frame in the received voice segment to be recognized, and input each voice frame into the pre-trained acoustic model in chronological order. For each voice frame input, the pre-trained acoustic model outputs the cost value of each voice frame corresponding to each preset phoneme. Specifically, the pre-trained acoustic model can output each preset phoneme and output the cost value of each voice frame corresponding to each preset phoneme.
[0039] For example, during the training process, the number of preset phonemes is 200. Then, for each voice frame, the pre-trained acoustic model will output all 200 phonemes corresponding to the voice frame, and output the cost value of each voice frame corresponding to each of the 200 phonemes. A phoneme is the smallest unit of pronunciation defined by humans. For example, "buping" contains 5 phonemes, namely "b, u4, p, i2, ng".
[0040] S102: Input the cost value of each preset phoneme corresponding to each obtained voice frame and each preset phoneme into the Viterbi decoder, and obtain the first target phoneme and the target cost value corresponding to each voice frame output.
[0041] In order to determine the command words contained in the speech segment to be recognized, after obtaining the cost value of each preset phoneme and each preset phoneme corresponding to each speech frame output by the acoustic model, the cost value of each preset phoneme and each preset phoneme corresponding to each speech frame obtained can be input into the Viterbi decoder. The Viterbi decoder contains a Viterbi decoding graph, which is composed of the phonemes corresponding to each speech frame of multiple command words stored in advance and the cost value of the phoneme. After receiving each input speech frame, the Viterbi decoder can use the Viterbi decoding algorithm to determine the phonemes and cost values corresponding to each speech frame of the target command word that the speech segment to be recognized is most likely to correspond to, that is, output the first target phoneme and target cost value corresponding to each speech frame. For the convenience of description, the first target phoneme and target cost value corresponding to each speech frame output by the Viterbi decoder can be called the optimal command word phoneme path corresponding to the speech segment to be recognized. The above process of determining the optimal command word phoneme path using the Viterbi decoding algorithm belongs to the prior art and will not be repeated here.
[0042] S103: Determine the optimal command word phoneme sequence corresponding to the speech segment to be recognized and the target command word corresponding to the optimal command word phoneme sequence according to the first target phoneme and the target cost value corresponding to each speech frame; determine the second target phoneme corresponding to each speech frame; determine the optimal full-pass phoneme sequence corresponding to the speech segment to be recognized according to the second target phoneme corresponding to each speech frame.
[0043] The optimal command word phoneme sequence corresponding to the speech segment to be recognized can be determined based on the first target phoneme and target cost value corresponding to each speech frame determined by the Viterbi decoder, wherein each speech frame whose target cost value is greater than a preset threshold can be determined, and the optimal command word phoneme sequence can be determined based on the first target phoneme corresponding to each speech frame whose target cost value is greater than the preset threshold.
[0044] After the optimal command word phoneme sequence is determined, because the optimal command word phoneme sequence includes multiple phonemes, the word composed of the multiple phonemes is the target command word.
[0045] In order to ensure the accuracy of command word recognition, because the acoustic model outputs the size of the cost value of each preset phoneme corresponding to each speech frame, for each speech frame, the cost value of each preset phoneme corresponding to the speech frame is obtained, and according to the size of the cost value corresponding to each preset phoneme, for example, the phoneme with the largest cost value is determined as the second target phoneme corresponding to the speech frame, or the phoneme with the smallest cost value is determined as the second target phoneme corresponding to the speech frame.
[0046] After obtaining the second target phoneme corresponding to each speech frame, in order to determine the optimal all-pass phoneme sequence corresponding to the speech to be recognized, for the same second target phoneme, the speech frame with the largest or smallest cost value can be determined according to the size of the cost value corresponding to each speech frame corresponding to the second target phoneme, and the optimal all-pass phoneme sequence corresponding to the speech segment to be recognized can be determined according to the second target phoneme corresponding to each determined speech frame.
[0047] S104: Determine the target IPED of the optimal all-pass phoneme sequence and the optimal command word phoneme sequence according to each second target phoneme included in the optimal all-pass phoneme sequence and each first target phoneme included in the optimal command word phoneme sequence.
[0048] In order to reduce the false trigger rate of command word recognition, after obtaining the optimal all-pass phoneme sequence and the optimal command word phoneme sequence corresponding to the speech segment to be recognized, the edit distance corresponding to the two optimal phoneme sequences can be determined according to each second target phoneme contained in the optimal all-pass phoneme sequence and each first target phoneme contained in the optimal command word phoneme sequence, and the edit distance can be determined as the target IPED corresponding to the two optimal phoneme sequences. Of course, the sum or product of the edit distance and a preset value can also be determined as the target IPED corresponding to the two optimal phoneme sequences. In the process of determining the edit distance, the optimal all-pass phoneme sequence and the optimal command word phoneme sequence can be understood as two character strings, and the number of times the optimal all-pass phoneme sequence needs to be processed to become the optimal command word phoneme sequence is counted. The number of processing times is the edit distance between the optimal all-pass phoneme sequence and the optimal command word phoneme sequence, where the processing includes insertion, deletion and replacement.
[0049] S105: Determine the confidence level corresponding to the speech segment to be recognized based on the target IPED and the average cost value of the optimal command word phoneme sequence; and determine whether the target command word is a command word included in the speech segment to be recognized based on the confidence level.
[0050] After determining the target IPED of the optimal full-pass phoneme sequence and the optimal command word phoneme sequence, the command word recognition can be jointly constrained in combination with the target IPED and the average cost value of the optimal command word phoneme sequence, and the length of the speech segment to be recognized can be normalized to determine the confidence corresponding to the speech segment to be recognized. In the process of determining the confidence corresponding to the speech segment to be recognized, the cost value corresponding to each phoneme in the optimal command word phoneme sequence can be obtained, the average cost value of the optimal command word phoneme sequence can be calculated, and the confidence corresponding to the speech segment to be recognized can be determined according to the product of the target IPED and the average cost value.
[0051] After obtaining the confidence corresponding to the speech segment to be recognized, it can be determined whether the confidence corresponding to the speech segment to be recognized is less than a preset confidence threshold. If the confidence corresponding to the speech segment to be recognized is less than the preset confidence threshold, it is considered that the target command word corresponding to the optimal command word phoneme sequence is the command word contained in the speech segment to be recognized; if the confidence corresponding to the speech segment to be recognized is not less than the preset confidence threshold, it means that the target command word is not the command word contained in the speech segment to be recognized.
[0052] When a command word is recognized, the electronic device can control itself to perform a corresponding action, or control other devices to perform a corresponding action. The subsequent control process belongs to the existing technology and will not be repeated here.
[0053] In the embodiment of the present application, the optimal command word phoneme sequence, the optimal all-pass phoneme sequence and the target command word corresponding to the speech segment to be recognized are determined according to the cost value of each preset phoneme corresponding to each speech frame output by the pre-trained acoustic model, the target IPED is determined according to the optimal command word phoneme sequence and the optimal all-pass phoneme sequence, and the confidence corresponding to the speech to be recognized is determined according to the target IPED and the average cost value of the optimal command word phoneme sequence, and whether the target command word is the command word contained in the speech segment to be recognized is determined according to the determined confidence corresponding to the speech to be recognized, thereby reducing the false trigger rate and improving the recognition rate of the command word recognition process.
[0054] Embodiment 2:
[0055] In order to reduce the false trigger rate of command words, based on the above embodiment, in the embodiment of the present application, the optimal command word phoneme sequence corresponding to the speech segment to be recognized and the command word corresponding to the optimal command word phoneme sequence are determined according to the first target phoneme and the target cost value corresponding to each speech frame, including:
[0056] For the same first target phoneme, obtaining a minimum target cost value among target cost values of each speech frame of the first target phoneme, and obtaining a first target speech frame corresponding to the minimum target cost value;
[0057] According to the first target phonemes corresponding to each first target speech frame, the optimal command word phoneme sequence corresponding to the speech segment to be recognized is determined, and the word corresponding to the optimal command word phoneme sequence is determined as the target command word.
[0058] In an embodiment of the present application, the Viterbi decoder outputs the first target phoneme and target cost value corresponding to each speech frame, that is, outputs the optimal command word phoneme path corresponding to the speech segment to be recognized, wherein each speech frame corresponds to a first target phoneme, and the corresponding first target phonemes may be the same or different. In order to reduce the false trigger rate of the command word, for the same first target phoneme, the minimum target cost value among the target cost values of each speech frame of the first target phoneme can be obtained, and the first target speech frame corresponding to the minimum target cost value can be obtained. After obtaining the first target phoneme corresponding to each first target speech frame, the first target phoneme corresponding to each first target speech frame can be connected according to the sequence of each first target speech frame to obtain a sequence about the first target phoneme, and the obtained sequence is determined as the optimal command word phoneme sequence corresponding to the speech segment to be recognized. Because the Viterbi decoder outputs the optimal command word phoneme path saved in the Viterbi decoding graph, each command word path in the Viterbi decoding graph is set according to a pre-saved command word, and the optimal command word phoneme sequence is determined based on the optimal command word phoneme path, then the word corresponding to the optimal command word phoneme sequence is one of the pre-saved command words, and the command word corresponding to the optimal command word phoneme sequence can be determined as the target command word.
[0059] For example, the received speech segment to be recognized is "seventeen degrees", and the speech segment to be recognized contains a total of 10 speech frames. The pre-trained acoustic model contains 200 preset phonemes. Each speech frame in the received speech segment to be recognized is input into the pre-trained acoustic model. The pre-trained acoustic model will output the cost value of each speech frame in the 10 speech frames corresponding to the 200 preset phonemes, that is, the output of the acoustic model for each speech frame will include 200 preset phonemes and the cost value corresponding to each preset phoneme.
[0060] Figure 2 A schematic diagram of each speech frame in a speech segment to be recognized output by the acoustic model provided in an embodiment of the present application, Figure 2 There are 10 columns in total, each column can be understood as a speech frame, each speech frame corresponds to these 200 circles, each circle can be understood as a preset phoneme, and each preset phoneme corresponds to a cost value.
[0061] The cost value of each preset phoneme corresponding to each speech frame obtained and each preset phoneme are input into the Viterbi decoder. The Viterbi decoder will output the first target phoneme and the target cost value corresponding to each speech frame, that is, the optimal command word phoneme sequence corresponding to the speech segment to be recognized. For ease of understanding, the optimal command word phoneme sequence can be represented by an image.
[0062] Figure 3 A schematic diagram of an optimal command word phoneme sequence output by a Viterbi decoder provided in an embodiment of the present application, Figure 3 The 10 rectangular areas in the middle and lower parts (shown in the figure) represent the 10 speech frames of the speech segment to be recognized. The numbers in each rectangular area represent the numbers of the preset phonemes corresponding to the corresponding speech frames. Number 196 represents a phoneme, and number 157 represents another phoneme. Each rectangular area corresponds to a number, which represents the cost value of the phoneme corresponding to the rectangular area. For example, Figure 3 The first target phoneme corresponding to the first speech frame is 196, and the target cost value corresponding to this speech frame is 0.05. The first target phoneme corresponding to the second speech frame is 196, and the target cost value corresponding to this speech frame is 0.05. The first target phoneme corresponding to the third speech frame is 157, and the target cost value corresponding to this speech frame is 0.2.
[0063] After obtaining the first target phoneme and target cost value corresponding to each speech frame output by the Viterbi decoder, for the same first target phoneme, for example Figure 3 For the same first target phoneme 190 in , the target cost values of each speech frame corresponding to the first target phoneme 190 are 0.1, 0.1, and 0.2 respectively, then the minimum target cost value is 0.1, and the speech frame corresponding to the minimum target cost value is determined as the first target speech frame. It is worth noting that if the target cost values of the same first target phoneme are the same, any speech frame is taken as the first target speech frame.
[0064] Figure 4 A schematic diagram of the optimal command word phoneme sequence corresponding to the speech segment to be recognized provided in the embodiment of the present application, such as Figure 4 As shown, for the first target phoneme 196, the target cost values of the two speech frames corresponding to the first target phoneme 196 in the optimal command word phoneme path are both 0.05, so the minimum target cost value is 0.05; for the first target phoneme 157, the target cost value of one speech frame corresponding to the first target phoneme 157 in the optimal command word phoneme path is 0.2, so the minimum target cost value of the first target phoneme 157 is 0.2; for the first target phoneme 190, the target cost values of the three speech frames corresponding to the first target phoneme 190 in the optimal command word phoneme path are 0.1, 0.1, and 0.2 respectively, so the minimum target cost value of the first target phoneme 190 is 0.1.
[0065] In order to further reduce the false trigger rate of the command word, based on the above embodiments, in the embodiment of the present application, the second target phoneme corresponding to each speech frame is determined, including:
[0066] For each speech frame, a minimum cost value is obtained according to the cost value of each preset phoneme corresponding to the speech frame, and the phoneme corresponding to the minimum cost value is determined as the second target phoneme corresponding to the speech frame.
[0067] The false trigger rate is relatively high if command word recognition is performed only based on the optimal command word phoneme path output by the Viterbi decoder. In order to further reduce the false trigger rate of command words, after obtaining the cost value of each preset phoneme corresponding to each speech frame output by the acoustic model, a phoneme corresponding to each speech frame can be determined for each speech frame. This phoneme is the second target phoneme of the speech frame.
[0068] Because the smaller the cost value, the closer the corresponding phoneme is to the real phoneme corresponding to the speech frame, therefore, in the embodiment of the present application, when determining the second target phoneme corresponding to each speech frame, for each speech frame, the minimum cost value among the cost values of each preset phoneme corresponding to the speech frame is obtained, and the phoneme corresponding to the minimum cost value is determined as the second target phoneme corresponding to the speech frame. After obtaining the second target phoneme corresponding to each speech frame, the corresponding second target phonemes can be connected according to the sequence of the speech frames to obtain the optimal all-pass phoneme path, that is, the optimal all-pass phoneme sequence.
[0069] Figure 5 A schematic diagram of the optimal full-pass phoneme path corresponding to the speech segment to be recognized provided in the embodiment of the present application, such as Figure 5 As shown, in each preset phoneme corresponding to the first speech frame, the minimum cost value is 0.05, and the phoneme 196 corresponding to the minimum cost value 0.05 is the second target phoneme corresponding to the first speech frame; in each preset phoneme corresponding to the second speech frame, the minimum cost value is 0.05, and the phoneme 196 corresponding to the minimum cost value 0.05 is the second target phoneme corresponding to the second speech frame; in each preset phoneme corresponding to the third speech frame, the minimum cost value is 0.1, and the phoneme 196 corresponding to the minimum cost value 0.1 is the second target phoneme corresponding to the third speech frame. The method for determining the second target phonemes corresponding to other speech frames in the speech segment to be recognized is the same as the method for determining the second target phonemes corresponding to the first, second, and third speech frames mentioned above, which will not be repeated here.
[0070] After determining the second target phoneme corresponding to each speech frame of the speech segment to be recognized, in order to further reduce the false trigger rate of the command word, based on the above embodiments, in the embodiment of the present application, determining the optimal full-pass phoneme sequence corresponding to the speech segment to be recognized according to the second target phoneme corresponding to each speech frame includes:
[0071] For the same second target phoneme, obtaining a minimum target cost value among target cost values of each speech frame of the second target phoneme, and obtaining a second target speech frame corresponding to the minimum target cost value;
[0072] According to the second target phonemes corresponding to each of the second target speech frames, an optimal full-pass phoneme sequence corresponding to the speech segment to be recognized is determined.
[0073] The smaller the cost value in the same phoneme, the closer the phoneme is to the real phoneme corresponding to the speech frame. Therefore, in the embodiment of the present application, for the second target phoneme corresponding to each speech frame in the speech segment to be recognized, for the same second target phoneme, the minimum target cost value among the target cost values of each speech frame of the second target phoneme can be obtained, and the second target speech frame corresponding to the minimum target cost value can be obtained. After obtaining the second target speech frame corresponding to the minimum target cost value of each different second target phoneme, each corresponding second target phoneme can be sorted according to the order of each second target speech frame, and the sequence of the second target phonemes can be obtained, and the obtained sequence can be determined as the optimal full-pass phoneme sequence corresponding to the speech segment to be recognized.
[0074] Figure 6 A schematic diagram corresponding to the optimal full-pass phoneme sequence corresponding to the speech segment to be recognized provided in the embodiment of the present application, such as Figure 6 As shown, the target cost values of the three speech frames corresponding to the second target phoneme 196 are 0.05, 0.05, and 0.1, respectively, so the minimum target cost value corresponding to the second target phoneme 196 is 0.05; the target cost value of one speech frame corresponding to the second target phoneme 138 is 0.03, so the minimum target cost value corresponding to the second target phoneme 138 is 0.03; the target cost value of one speech frame corresponding to the second target phoneme 190 is 0.06, so the minimum target cost value corresponding to the second target phoneme 190 is 0.06. The method for determining the minimum target cost value corresponding to other second target phonemes in the speech segment to be recognized is the same as the method for determining the minimum target cost value of the second target phonemes 196, 138, and 190, and will not be repeated here.
[0075] Embodiment 3:
[0076] In order to further reduce the false trigger rate of command words, based on the above embodiments, in the embodiment of the present application, the target IPED of the optimal all-pass phoneme sequence and the optimal command word phoneme sequence is determined according to each second target phoneme included in the optimal all-pass phoneme sequence and each first target phoneme included in the optimal command word phoneme sequence, including:
[0077] Deleting the first target phoneme at a set position in the optimal command word phoneme sequence to obtain an optimal command word phoneme subsequence, and deleting the second target phoneme at a set position in the optimal all-pass phoneme sequence to obtain an optimal all-pass phoneme subsequence;
[0078] Determine a first IPED of the optimal command word phoneme subsequence and the optimal all-pass phoneme subsequence, and update the first IPED according to the first IPED and a preset first parameter;
[0079] Determine a second IPED of the optimal command word phoneme subsequence and the optimal all-pass phoneme sequence, and update the second IPED according to the second IPED and a preset second parameter;
[0080] Determine a third IPED of the optimal command word phoneme sequence and the optimal all-pass phoneme subsequence, and update the third IPED according to the third IPED and a preset third parameter;
[0081] The minimum value among the updated first IPED, second IPED and third IPED is determined as the target IPED.
[0082] After determining the optimal command word phoneme sequence and the optimal all-pass phoneme sequence corresponding to the speech segment to be recognized, the target IPED of the optimal command word phoneme sequence and the optimal all-pass phoneme sequence can be determined based on each first target phoneme contained in the optimal command word phoneme sequence and each second target phoneme contained in the optimal all-pass phoneme sequence.
[0083] After obtaining the optimal command word phoneme subsequence and the optimal all-pass phoneme subsequence, the first IPED of the optimal command word phoneme subsequence and the optimal all-pass phoneme subsequence can be determined, and the first IPED can be updated according to the first IPED and the preset first parameter. The second IPED of the optimal command word phoneme subsequence and the optimal all-pass phoneme sequence can also be determined, and the second IPED can be updated according to the second IPED and the preset second parameter, wherein the second parameter is a pre-stored fixed parameter. The third IPED of the optimal command word phoneme subsequence and the optimal all-pass phoneme sequence can also be determined, and the third IPED can be updated according to the third IPED and the preset third parameter, wherein the second parameter and the third parameter can be the same or different.
[0084] In the embodiment of the present application, the minimum value among the first IPED, the second IPED and the third IPED is determined as the target IPED of the optimal command word phoneme sequence and the optimal all-pass phoneme sequence.
[0085] The edit distance can determine the similarity between two phoneme sequences, that is, the number of times it takes to transform one phoneme sequence into another. The following operations can be used for transformation: insertion, replacement, and deletion.
[0086] For example, the optimal command word phoneme sequence T is: "abcde", and the optimal all-pass phoneme sequence A is: "xbcxx". In order to transform the optimal all-pass phoneme sequence A into the optimal command word phoneme sequence T, the following processing is required: replace the first English lowercase letter "x" in the optimal all-pass phoneme sequence A with a, replace the fourth English lowercase letter "x" with, and replace the fifth English lowercase letter "x" with e, so 3 operations are performed. Then the edit distance between the optimal command word phoneme sequence T and the optimal all-pass phoneme sequence A is 3.
[0087] Assume that the optimal command word phoneme sequence T is: "abcde", and the optimal all-pass phoneme sequence B is: "xxbcx". In order to transform the optimal all-pass phoneme sequence B into the optimal command word phoneme sequence T, the following processing is required: delete the first English lowercase letter "x" in the optimal all-pass phoneme sequence B, replace the second English lowercase letter "x" with a, replace the fifth English lowercase letter "x" with d, and insert e after the fifth English lowercase letter "x". Therefore, 4 operations are performed, and the edit distance between the optimal command word phoneme sequence T and the optimal all-pass phoneme sequence B is 4. If the edit distance determined by relative position is used to identify command words, the reliability is not high.
[0088] In order to eliminate the difference in edit distance caused by different relative positions, the prior art replaces the edit distance with the minimum "insert" and "delete" distance, that is, the "replacement" operation is not allowed, and the "replacement" operation is converted into two operations, "insert" and "delete". This is equivalent to including two operations corresponding to the "replacement" operation. Therefore, the weight value of each operation can be set in advance, which can also be called the cost value. The final edit distance is determined according to the number of times each operation is performed and the cost value corresponding to each operation. According to the above description, the cost value corresponding to the "replacement" operation is 2, and the cost value corresponding to the "insert" and "delete" operations is 1.
[0089] Using the above example to illustrate, the optimal all-through phoneme sequence B is converted into the optimal command word phoneme sequence T. Based on the minimum "insertion" and "deletion" distances, the following processing is required: delete the first lowercase English letter "x" in the optimal all-through phoneme sequence B, and the cost value corresponding to the deletion operation is 1; replace the second lowercase English letter "x" with a, that is, delete the second lowercase English letter "x" and then insert a at the original position of the second English letter "x". The cost value corresponding to the replacement operation is 2; replace the fifth lowercase English letter "x" with d, that is, delete the fifth lowercase English letter "x" and then insert d at the original position of the fifth English letter "x". The cost value corresponding to the replacement operation is 2; insert e after the fifth lowercase English letter "x". The cost value corresponding to the insertion operation is 1, so the editing distance between the optimal command word phoneme sequence T and the optimal all-through phoneme sequence B is 6.
[0090] In order to facilitate the calculation of the edit distance, the process of determining the edit distance by the minimum "insertion" and "deletion" distance can also be represented by the algorithm |A|+|B|-2LCS, where |A| is the length of the optimal command word phoneme sequence, |B| is the length of the optimal all-pass phoneme sequence, and LCS is the length of the longest common subsequence of the optimal command word phoneme sequence and the optimal all-pass phoneme sequence. Based on this algorithm, it can be determined that the edit distance between the optimal command word phoneme sequence T and the optimal all-pass phoneme sequence A is 6, and the edit distance between the optimal command word phoneme sequence T and the optimal all-pass phoneme sequence B is also 6. Obviously, if two different optimal all-pass phoneme sequences have the same edit distance, the credibility of command word recognition based on this edit distance is not high.
[0091] Therefore, in the embodiment of the present application, the "replacement" operation is smoothed on the basis of the edit distance, and the target IPED is determined by combining the optimal full-pass phoneme sequence and the optimal command word phoneme sequence to determine whether there are more and longer continuous common subsequences. Among them, the "replacement" operation is smoothed on the basis of the edit distance, and the "replacement" operation is penalized by a multiple of 1.5, that is, the cost value of the "replacement" operation is adjusted in combination with the above-mentioned edit distance and the minimum "insert" and "delete" distances. The cost value of the "insert" and "delete" operations is 1, and the cost value of the "replacement" operation is 1.5, wherein the cost value of the "replacement" operation can be adjusted according to the needs of command word recognition.
[0092] The IPED of the optimal all-pass phoneme sequence and the optimal command word phoneme sequence corresponding to two speech segments to be recognized that sound completely different may be equal. For example, the optimal command word phoneme sequence T is: "abcde" and the optimal all-pass phoneme sequence C is: "xxxbcdxx". Based on the method for determining IPED provided in the embodiment of the present application, the optimal all-pass phoneme sequence C is converted into the optimal command word phoneme sequence T. The following processing is required: delete the first English lowercase letter "x" in the optimal all-pass phoneme sequence C, delete the second English lowercase letter "x", replace the third English lowercase letter "x" with a, replace the seventh English lowercase letter "x" with e, and delete the eighth English lowercase letter "x". Then the IPED of the optimal command word phoneme sequence T and the optimal all-pass phoneme sequence C is 6.
[0093] For example, the optimal command word phoneme sequence T is: "abcde", and the optimal all-pass phoneme sequence D is: "xbxxcxdx". Based on the method for determining IPED provided in the embodiment of the present application, the optimal all-pass phoneme sequence D is converted into the optimal command word phoneme sequence T. The following processing is required: replace the first English lowercase letter "x" in the optimal all-pass phoneme sequence D with a, delete the third English lowercase letter "x", delete the fourth English lowercase letter "x", delete the sixth English lowercase letter "x", and replace the eighth English lowercase letter "x" with e. Then the IPED of the optimal command word phoneme sequence T and the optimal all-pass phoneme sequence D is 6.
[0094] The optimal all-pass phoneme sequence D looks like a completely different phoneme sequence from the optimal all-pass phoneme sequence T. The optimal all-pass phoneme sequence C contains the phonemes in the optimal command word phoneme sequence T and is closer to the optimal command word phoneme sequence, but the IPED corresponding to the optimal command word phoneme sequence is the same, which will cause false triggering of command word recognition, which is also the majority of cases that cause false triggering. The optimal all-pass phoneme sequence that is closer to the optimal command word phoneme sequence usually contains more such continuous common subsequences. If such more and longer continuous common subsequences can affect its sequence metric to a greater extent, it will effectively improve the recognition rate and reduce the false trigger rate.
[0095] Therefore, in the embodiment of the present application, the optimal all-pass phoneme sequence is rewarded with a multiple of -0.5 for having more and longer continuous common subsequences. The target IPED of the optimal all-pass phoneme sequence and the optimal command word phoneme sequence is determined by dynamic programming, and the calculation formula can be expressed by the following function:
[0096]
[0097] The time complexity is o(MN). In the above function expression, i represents the length of the optimal command word phoneme sequence, j represents the length of the optimal all-pass phoneme sequence, the length of the optimal command word phoneme sequence and the length of the optimal all-pass phoneme sequence may be the same or different, dp[i][j] represents the target IPED of the optimal command word phoneme sequence and the optimal all-pass phoneme sequence, dp[i-1][j-1] represents the first IPED, dp[i-1][j] represents the second IPED, dp[i][j-1] represents the third IPED, cost represents the cost, if the i-th phoneme of the optimal command word phoneme sequence is the same as the j-th phoneme of the optimal all-pass phoneme sequence, that is, the last phoneme of the optimal command word phoneme sequence is the same as the last phoneme of the optimal all-pass phoneme sequence, then cost is equal to 1.5; if the i-th phoneme of the optimal command word phoneme sequence is the same as the j-th phoneme of the optimal all-pass phoneme sequence, then cost is equal to 1.5; if the i-th phoneme of the optimal command word phoneme sequence is the same as the j-th phoneme of the optimal all-pass phoneme sequence, then cost is equal to 1.5. If the jth phoneme of the all-pass phoneme sequence is the same, and the i-1th phoneme of the optimal command word phoneme sequence is the same as the j-1th phoneme of the optimal all-pass phoneme sequence, and the i-2th phoneme of the optimal command word phoneme sequence is the same as the j-2th phoneme of the optimal all-pass phoneme sequence, then the cost is equal to -0.5, where the numerical value of the cost can also be adjusted. If the optimal all-pass phoneme sequence and the optimal command word phoneme sequence have more and longer continuous common subsequences, the smaller the cost value, for example, if the length of the common subsequence is 3, the cost can be equal to -0.5, and if the length of the common subsequence is 4, that is, the 4 consecutive phonemes of the optimal all-pass phoneme sequence and the 4 consecutive phonemes of the optimal command word phoneme sequence are the same, the cost can be equal to -2.0, and if the length of the common subsequence is 5, the cost can be equal to -5.0; otherwise, the cost is equal to 0.
[0098] Based on the above-mentioned method of determining the first IPED, the second IPED and the third IPED, it can be determined that the IPED of the optimal all-through phoneme sequence A and the optimal command word phoneme sequence T is 4.5, the IPED of the optimal all-through phoneme sequence B and the optimal command word phoneme sequence T is 5, the IPED of the optimal all-through phoneme sequence C and the optimal command word phoneme sequence T is 5.5, and the IPED of the optimal all-through phoneme sequence D and the optimal command word phoneme sequence T is 6.
[0099] For ease of understanding, the IPED for determining the optimal all-pass phoneme sequence C "xxxbcdxx" and the optimal command word phoneme sequence T "abcde" is now explained, where the phoneme sequence length of the optimal all-pass phoneme sequence C is 8, and the phoneme sequence length of the optimal command word phoneme sequence T is 5. Figure 7 A schematic diagram of an IPED for determining an optimal all-pass phoneme sequence C and an optimal command word phoneme sequence T provided in an embodiment of the present application, as shown in FIG. Figure 7As shown, 1.5 corresponding to the intersection of the first row and the first column represents the IPED corresponding to converting "x" into "a", 2.5 corresponding to the intersection of the first row and the second column represents the IPED corresponding to converting "x" into "ab", 3.5 corresponding to the intersection of the first row and the third column represents the IPED corresponding to converting "x" into "abc", 5.5 corresponding to the intersection of the eighth row and the fifth column represents the IPED corresponding to converting "xxxbcdxx" into "abcde", that is, the IPED of the optimal all-pass phoneme sequence C and the optimal command word phoneme sequence T is 5.5, and the IPEDs represented by other intersections are represented in the same way as the intersection of the first row and the first column, which will not be repeated here.
[0100] Embodiment 4:
[0101] In order to further reduce the false trigger rate of the command word, on the basis of the above embodiments, in the embodiment of the present application, the confidence corresponding to the speech segment to be recognized is determined according to the average cost value of the target IPED and the optimal command word phoneme sequence, including:
[0102] Determine an average cost value of the optimal command word phoneme sequence according to the cost value of each first target speech frame corresponding to the optimal command word phoneme sequence;
[0103] Determine a product value of the target IPED and the average cost value;
[0104] The confidence level corresponding to the speech segment to be recognized is determined according to the product value, the length of the optimal command word phoneme sequence and a preset length parameter.
[0105] After determining the target IPED of the optimal all-pass phoneme sequence and the optimal command word phoneme sequence, in order to further reduce the false trigger rate of the command word, the confidence of the optimal all-pass phoneme sequence can be determined based on the target IPED, the average cost of the optimal command word phoneme sequence, the length of the optimal command word phoneme sequence and the preset length parameter, that is, the length of the optimal command word phoneme sequence is normalized so that command word recognition is not affected by the length of the command word.
[0106] In the embodiment of the present application, the average cost value of the optimal command word phoneme sequence can be calculated, and the command word recognition is jointly constrained using the determined target IPED and the average cost value of the optimal command word phoneme sequence. Specifically, the average cost value of the optimal command word phoneme sequence is determined based on the cost value of each first target speech frame corresponding to the optimal command word phoneme sequence, and the product value of the target IPED and the average cost value is determined. After determining the average cost value and the product value, the confidence corresponding to the speech segment to be recognized can be determined in combination with the length of the optimal command word phoneme sequence and the preset length parameter.
[0107] Specifically, for the convenience of description, the confidence of the speech segment to be recognized can be expressed by the following function expression:
[0108]
[0109] In the above expression, th represents the confidence corresponding to the speech segment to be recognized, iped represents the target IPED of the optimal full-pass phoneme sequence and the optimal command word phoneme sequence, cost represents the average cost of the optimal command word phoneme sequence, N is the length of the optimal command word phoneme sequence, and 5 is the pre-saved length parameter.
[0110] Embodiment 5:
[0111] In order to reduce the influence of abnormal cost values on command word recognition, based on the above embodiments, in the embodiment of the present application, after obtaining the first target phoneme and target cost value corresponding to each speech frame output, the optimal command word phoneme sequence corresponding to the speech segment to be recognized and the command word corresponding to the optimal command word phoneme sequence are determined according to the first target phoneme and target cost value corresponding to each speech frame. The method includes:
[0112] For each speech frame, determine the target cost value corresponding to the speech frame and the average cost value of the target cost values corresponding to a set number of other speech frames adjacent to the speech frame, and update the average cost value to the target cost value of the speech frame.
[0113] After obtaining the first target phoneme and target cost value corresponding to each speech frame output by the Viterbi decoder, in order to further reduce the false trigger rate of the command word, the first target phoneme and target cost value corresponding to each speech frame output by the Viterbi decoder can be smoothed, that is, the optimal command word phoneme path can be smoothed to reduce the impact of abnormal values on command word recognition. The smoothing operation here refers to mean filtering with a smoothing window whose smoothing window size is equal to WIN_SIZE, wherein mean filtering can be understood as determining the target cost value corresponding to each speech frame of the optimal command word phoneme path corresponding to the speech segment to be recognized and the average cost value of the target cost corresponding to a set number of other speech frames adjacent to the speech frame, and updating the determined average cost value of each speech frame to the target cost value of the speech frame. The set number can be 3, 4, etc., and can be flexibly set according to needs.
[0114] Figure 8 A schematic diagram of updating the target cost value of a speech frame provided in an embodiment of the present application, Figure 8 The 10 numbers above (shown in the figure) represent the target cost value after each speech frame is updated. Figure 8The area consisting of the 10 rectangles in the lower middle section (the upper and lower sections shown in the figure) and the numbers in the upper row represents the first target phonemes and target cost values corresponding to the 10 speech frames output by the Viterbi decoder. Figure 8 The updated target cost value corresponding to the first speech frame is 0.05, and the updated target cost value is determined based on the target cost values corresponding to the first speech frame and the second speech frame adjacent to the first speech frame, that is, (0.05+0.05) / 2=0.05. The updated target cost value corresponding to the second speech frame is 0.1, and the updated target cost value is determined based on the target cost values corresponding to the second speech frame, the first speech frame adjacent to the second speech frame, and the third speech frame adjacent to the second speech frame, that is, (0.05+0.05+0.2) / 3=0.1. The method for determining the corresponding updated target cost values for other speech frames is the same as the method for determining the corresponding updated target cost values for the first and second speech frames, and will not be repeated here.
[0115] Embodiment 6:
[0116] The following is a detailed description of the command word recognition provided by the embodiment of the present application in conjunction with a specific embodiment. Fig. 9 The flowchart of the command word recognition process provided by the embodiment of the present application is as follows: Fig. 9 As shown, the process includes:
[0117] S901: receiving a speech segment to be recognized, inputting each speech frame of the speech segment to be recognized into a pre-trained acoustic model, and obtaining a cost value of each preset phoneme corresponding to each speech frame output by the acoustic model.
[0118] S902: Input the cost value of each preset phoneme corresponding to each acquired speech frame and each preset phoneme into the Viterbi decoder to obtain the optimal command word phoneme path corresponding to the speech segment to be recognized and the target command word corresponding to the optimal command word phoneme sequence.
[0119] S903: Determine the optimal all-pass phoneme path corresponding to the speech segment to be recognized according to the cost value of each preset phoneme corresponding to each speech frame obtained and each preset phoneme.
[0120] S904: Calculate the target IPED of the optimal command word phoneme path and the optimal all-pass phoneme path.
[0121] S905: Calculate the confidence level corresponding to the speech segment to be recognized according to the target IPED.
[0122] S906: Determine whether the confidence level corresponding to the speech segment to be recognized is less than a preset confidence threshold. If it is less than the preset confidence threshold, execute S907. If it is not less than the preset confidence threshold, the recognition of the speech segment to be recognized is terminated.
[0123] S907: Determine that the target command word is a command word included in the speech segment to be recognized.
[0124] Embodiment 7:
[0125] Fig.10 A schematic diagram of the structure of the command word recognition device provided in the embodiment of the present application is shown in FIG. Fig.10 As shown, the device comprises:
[0126] The acquisition module 1001 is used to input each speech frame in the received speech segment to be recognized into a pre-trained acoustic model, and obtain the cost value of each preset phoneme corresponding to each speech frame output by the acoustic model; input the cost value of each preset phoneme corresponding to each speech frame obtained and each preset phoneme into a Viterbi decoder, and obtain the first target phoneme and target cost value corresponding to each output speech frame;
[0127] The determination module 1002 is used to determine the optimal command word phoneme sequence corresponding to the speech segment to be recognized and the target command word corresponding to the optimal command word phoneme sequence according to the first target phoneme and the target cost value corresponding to each speech frame; determine the second target phoneme corresponding to each speech frame; determine the optimal full-pass phoneme sequence corresponding to the speech segment to be recognized according to the second target phoneme corresponding to each speech frame; determine the target IPED of the optimal full-pass phoneme sequence and the optimal command word phoneme sequence according to each second target phoneme included in the optimal full-pass phoneme sequence and each first target phoneme included in the optimal command word phoneme sequence;
[0128] The recognition module 1003 is used to determine the confidence level corresponding to the speech segment to be recognized based on the target IPED and the average cost value of the optimal command word phoneme sequence; and determine whether the target command word is a command word contained in the speech segment to be recognized based on the confidence level.
[0129] In a possible implementation, the determination module 1002 is specifically used to obtain, for the same first target phoneme, the minimum target cost value among the target cost values of each speech frame of the first target phoneme, and obtain the first target speech frame corresponding to the minimum target cost value; determine the optimal command word phoneme sequence corresponding to the speech segment to be recognized based on the first target phoneme corresponding to each first target speech frame, and determine the word corresponding to the optimal command word phoneme sequence as the target command word.
[0130] In a possible implementation, the recognition module 1003 is specifically used to determine the average cost value of the optimal command word phoneme sequence according to the cost value of each first target speech frame corresponding to the optimal command word phoneme sequence; determine the product value of the target IPED and the average cost value; and determine the confidence corresponding to the speech segment to be recognized according to the product value, the length of the optimal command word phoneme sequence and a preset length parameter.
[0131] In a possible implementation, the determination module 1002 is further specifically used to obtain a minimum cost value for each speech frame according to the cost value of each preset phoneme corresponding to the speech frame, and determine the phoneme corresponding to the minimum cost value as the second target phoneme corresponding to the speech frame.
[0132] In a possible implementation, the determination module 1002 is further specifically used to obtain, for the same second target phoneme, the minimum target cost value among the target cost values of each speech frame of the second target phoneme, and obtain the second target speech frame corresponding to the minimum target cost value; and determine the optimal full-pass phoneme sequence corresponding to the speech segment to be recognized based on the second target phoneme corresponding to each of the second target speech frames.
[0133] In a possible implementation, the determination module 1002 is further specifically used to delete the first target phoneme at a set position in the optimal command word phoneme sequence to obtain an optimal command word phoneme subsequence, and delete the second target phoneme at a set position in the optimal all-pass phoneme sequence to obtain an optimal all-pass phoneme subsequence; determine a first IPED between the optimal command word phoneme subsequence and the optimal all-pass phoneme subsequence, and update the first IPED according to the first IPED and a preset first parameter; determine a second IPED between the optimal command word phoneme subsequence and the optimal all-pass phoneme sequence, and update the second IPED according to the second IPED and a preset second parameter; determine a third IPED between the optimal command word phoneme sequence and the optimal all-pass phoneme subsequence, and update the third IPED according to the third IPED and a preset third parameter; and determine the minimum value among the updated first IPED, second IPED and third IPED as the target IPED.
[0134] In a possible implementation, the acquisition module 1001 is further specifically used to determine, for each speech frame, a target cost value corresponding to the speech frame and an average cost value of target cost values corresponding to a set number of other speech frames adjacent to the speech frame, and update the average cost value to the target cost value of the speech frame.
[0135] Embodiment 8:
[0136] Fig.11A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Based on the above embodiments, the present application further provides an electronic device, such as Fig.11 As shown, it includes: a processor 1101, a communication interface 1102, a memory 1103 and a communication bus 1104, wherein the processor 1101, the communication interface 1102, and the memory 1103 communicate with each other through the communication bus 1104;
[0137] The memory 1103 stores a computer program. When the program is executed by the processor 1101, the processor 1101 performs the following steps:
[0138] Input each speech frame in the received speech segment to be recognized into a pre-trained acoustic model, and obtain a cost value of each preset phoneme corresponding to each speech frame output by the acoustic model;
[0139] Inputting the cost value of each preset phoneme corresponding to each speech frame obtained and each preset phoneme into a Viterbi decoder, and obtaining the first target phoneme and target cost value corresponding to each output speech frame;
[0140] Determine the optimal command word phoneme sequence corresponding to the speech segment to be recognized and the target command word corresponding to the optimal command word phoneme sequence according to the first target phoneme and the target cost value corresponding to each speech frame; determine the second target phoneme corresponding to each speech frame; determine the optimal full-pass phoneme sequence corresponding to the speech segment to be recognized according to the second target phoneme corresponding to each speech frame;
[0141] Determine a target IPED of the optimal all-pass phoneme sequence and the optimal command word phoneme sequence according to each second target phoneme included in the optimal all-pass phoneme sequence and each first target phoneme included in the optimal command word phoneme sequence;
[0142] The confidence level corresponding to the speech segment to be recognized is determined based on the target IPED and the average cost value of the optimal command word phoneme sequence; and based on the confidence level, it is determined whether the target command word is a command word contained in the speech segment to be recognized.
[0143] In a possible implementation, determining the optimal command word phoneme sequence corresponding to the speech segment to be recognized and the command word corresponding to the optimal command word phoneme sequence according to the first target phoneme and the target cost value corresponding to each speech frame includes:
[0144] For the same first target phoneme, obtaining a minimum target cost value among target cost values of each speech frame of the first target phoneme, and obtaining a first target speech frame corresponding to the minimum target cost value;
[0145] According to the first target phonemes corresponding to each first target speech frame, the optimal command word phoneme sequence corresponding to the speech segment to be recognized is determined, and the word corresponding to the optimal command word phoneme sequence is determined as the target command word.
[0146] In a possible implementation, determining the confidence level corresponding to the speech segment to be recognized according to the target IPED and the average cost value of the optimal command word phoneme sequence includes:
[0147] Determine an average cost value of the optimal command word phoneme sequence according to the cost value of each first target speech frame corresponding to the optimal command word phoneme sequence;
[0148] Determine a product value of the target IPED and the average cost value;
[0149] The confidence level corresponding to the speech segment to be recognized is determined according to the product value, the length of the optimal command word phoneme sequence and a preset length parameter.
[0150] In a possible implementation, determining the second target phoneme corresponding to each speech frame includes:
[0151] For each speech frame, a minimum cost value is obtained according to the cost value of each preset phoneme corresponding to the speech frame, and the phoneme corresponding to the minimum cost value is determined as the second target phoneme corresponding to the speech frame.
[0152] In a possible implementation, determining the optimal full-pass phoneme sequence corresponding to the speech segment to be recognized according to the second target phoneme corresponding to each speech frame includes:
[0153] For the same second target phoneme, obtaining a minimum target cost value among target cost values of each speech frame of the second target phoneme, and obtaining a second target speech frame corresponding to the minimum target cost value;
[0154] According to the second target phonemes corresponding to each of the second target speech frames, an optimal full-pass phoneme sequence corresponding to the speech segment to be recognized is determined.
[0155] In a possible implementation, determining the target IPED of the optimal all-pass phoneme sequence and the optimal command word phoneme sequence according to each second target phoneme included in the optimal all-pass phoneme sequence and each first target phoneme included in the optimal command word phoneme sequence includes:
[0156] Deleting the first target phoneme at a set position in the optimal command word phoneme sequence to obtain an optimal command word phoneme subsequence, and deleting the second target phoneme at a set position in the optimal all-pass phoneme sequence to obtain an optimal all-pass phoneme subsequence;
[0157] Determine a first IPED of the optimal command word phoneme subsequence and the optimal all-pass phoneme subsequence, and update the first IPED according to the first IPED and a preset first parameter;
[0158] Determine a second IPED of the optimal command word phoneme subsequence and the optimal all-pass phoneme sequence, and update the second IPED according to the second IPED and a preset second parameter;
[0159] Determine a third IPED of the optimal command word phoneme sequence and the optimal all-pass phoneme subsequence, and update the third IPED according to the third IPED and a preset third parameter;
[0160] The minimum value among the updated first IPED, second IPED and third IPED is determined as the target IPED.
[0161] In a possible implementation, after obtaining the first target phoneme and the target cost value corresponding to each speech frame output, determining the optimal command word phoneme sequence corresponding to the speech segment to be recognized and the command word corresponding to the optimal command word phoneme sequence according to the first target phoneme and the target cost value corresponding to each speech frame, the method includes:
[0162] For each speech frame, determine the target cost value corresponding to the speech frame and the average cost value of the target cost values corresponding to a set number of other speech frames adjacent to the speech frame, and update the average cost value to the target cost value of the speech frame.
[0163] Since the principle of solving the problem by the above electronic device is similar to the command word recognition method, the implementation of the above electronic device can refer to the above embodiment, and the repeated parts will not be repeated.
[0164] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. The communication interface 1102 is used for communication between the above electronic device and other devices. The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor. The above processor may be a general-purpose processor, including a central processing unit, a network processor (NP), etc.; it may also be a digital signal processing processor (DSP), an application-specific integrated circuit, a field programmable gate array or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc.
[0165] Embodiment 9:
[0166] On the basis of the above embodiments, the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program executable by a processor, and when the program runs on the processor, the processor implements the following steps when executing:
[0167] Input each speech frame in the received speech segment to be recognized into a pre-trained acoustic model, and obtain a cost value of each preset phoneme corresponding to each speech frame output by the acoustic model;
[0168] Inputting the cost value of each preset phoneme corresponding to each speech frame obtained and each preset phoneme into a Viterbi decoder, and obtaining the first target phoneme and target cost value corresponding to each output speech frame;
[0169] Determine the optimal command word phoneme sequence corresponding to the speech segment to be recognized and the target command word corresponding to the optimal command word phoneme sequence according to the first target phoneme and the target cost value corresponding to each speech frame; determine the second target phoneme corresponding to each speech frame; determine the optimal full-pass phoneme sequence corresponding to the speech segment to be recognized according to the second target phoneme corresponding to each speech frame;
[0170] Determine a target IPED of the optimal all-pass phoneme sequence and the optimal command word phoneme sequence according to each second target phoneme included in the optimal all-pass phoneme sequence and each first target phoneme included in the optimal command word phoneme sequence;
[0171] The confidence level corresponding to the speech segment to be recognized is determined based on the target IPED and the average cost value of the optimal command word phoneme sequence; and based on the confidence level, it is determined whether the target command word is a command word contained in the speech segment to be recognized.
[0172] In a possible implementation, determining the optimal command word phoneme sequence corresponding to the speech segment to be recognized and the command word corresponding to the optimal command word phoneme sequence according to the first target phoneme and the target cost value corresponding to each speech frame includes:
[0173] For the same first target phoneme, obtaining a minimum target cost value among target cost values of each speech frame of the first target phoneme, and obtaining a first target speech frame corresponding to the minimum target cost value;
[0174] According to the first target phonemes corresponding to each first target speech frame, the optimal command word phoneme sequence corresponding to the speech segment to be recognized is determined, and the word corresponding to the optimal command word phoneme sequence is determined as the target command word.
[0175] In a possible implementation, determining the confidence level corresponding to the speech segment to be recognized according to the target IPED and the average cost value of the optimal command word phoneme sequence includes:
[0176] Determine an average cost value of the optimal command word phoneme sequence according to the cost value of each first target speech frame corresponding to the optimal command word phoneme sequence;
[0177] Determine a product value of the target IPED and the average cost value;
[0178] The confidence level corresponding to the speech segment to be recognized is determined according to the product value, the length of the optimal command word phoneme sequence and a preset length parameter.
[0179] In a possible implementation, determining the second target phoneme corresponding to each speech frame includes:
[0180] For each speech frame, a minimum cost value is obtained according to the cost value of each preset phoneme corresponding to the speech frame, and the phoneme corresponding to the minimum cost value is determined as the second target phoneme corresponding to the speech frame.
[0181] In a possible implementation, determining the optimal full-pass phoneme sequence corresponding to the speech segment to be recognized according to the second target phoneme corresponding to each speech frame includes:
[0182] For the same second target phoneme, obtaining a minimum target cost value among target cost values of each speech frame of the second target phoneme, and obtaining a second target speech frame corresponding to the minimum target cost value;
[0183] According to the second target phonemes corresponding to each of the second target speech frames, an optimal full-pass phoneme sequence corresponding to the speech segment to be recognized is determined.
[0184] In a possible implementation, determining the target IPED of the optimal all-pass phoneme sequence and the optimal command word phoneme sequence according to each second target phoneme included in the optimal all-pass phoneme sequence and each first target phoneme included in the optimal command word phoneme sequence includes:
[0185] Deleting the first target phoneme at a set position in the optimal command word phoneme sequence to obtain an optimal command word phoneme subsequence, and deleting the second target phoneme at a set position in the optimal all-pass phoneme sequence to obtain an optimal all-pass phoneme subsequence;
[0186] Determine a first IPED of the optimal command word phoneme subsequence and the optimal all-pass phoneme subsequence, and update the first IPED according to the first IPED and a preset first parameter;
[0187] Determine a second IPED of the optimal command word phoneme subsequence and the optimal all-pass phoneme sequence, and update the second IPED according to the second IPED and a preset second parameter;
[0188] Determine a third IPED of the optimal command word phoneme sequence and the optimal all-pass phoneme subsequence, and update the third IPED according to the third IPED and a preset third parameter;
[0189] The minimum value among the updated first IPED, second IPED and third IPED is determined as the target IPED.
[0190] In a possible implementation, after obtaining the first target phoneme and the target cost value corresponding to each speech frame output, determining the optimal command word phoneme sequence corresponding to the speech segment to be recognized and the command word corresponding to the optimal command word phoneme sequence according to the first target phoneme and the target cost value corresponding to each speech frame, the method includes:
[0191] For each speech frame, determine the target cost value corresponding to the speech frame and the average cost value of the target cost values corresponding to a set number of other speech frames adjacent to the speech frame, and update the average cost value to the target cost value of the speech frame.
[0192] Since the principle of solving the problem by the computer-readable medium provided above is similar to that of the command word recognition method, after the processor executes the computer program in the computer-readable medium above, the steps implemented can refer to the above embodiment, and the repeated parts will not be repeated.
[0193] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0194] As for the system / device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0195] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0196] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0197] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0198] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.
[0199] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A command word recognition method, characterized in that: The method comprises: Input each speech frame in the received speech segment to be recognized into a pre-trained acoustic model, and obtain a cost value of each preset phoneme corresponding to each speech frame output by the acoustic model; Inputting the cost value of each preset phoneme corresponding to each speech frame obtained and each preset phoneme into a Viterbi decoder, and obtaining the first target phoneme and target cost value corresponding to each output speech frame; Determine the optimal command word phoneme sequence corresponding to the speech segment to be recognized and the target command word corresponding to the optimal command word phoneme sequence according to the first target phoneme and the target cost value corresponding to each speech frame; determine the second target phoneme corresponding to each speech frame; determine the optimal full-pass phoneme sequence corresponding to the speech segment to be recognized according to the second target phoneme corresponding to each speech frame; Determine a target improved edit distance IPED between the optimal all-pass phoneme sequence and the optimal command word phoneme sequence according to each second target phoneme included in the optimal all-pass phoneme sequence and each first target phoneme included in the optimal command word phoneme sequence; The confidence level corresponding to the speech segment to be recognized is determined based on the target IPED and the average cost value of the optimal command word phoneme sequence; and based on the confidence level, it is determined whether the target command word is a command word contained in the speech segment to be recognized.
2. The method according to claim 1, characterized in that The step of determining the optimal command word phoneme sequence corresponding to the speech segment to be recognized and the command word corresponding to the optimal command word phoneme sequence according to the first target phoneme and the target cost value corresponding to each speech frame includes: For the same first target phoneme, obtaining a minimum target cost value among target cost values of each speech frame of the first target phoneme, and obtaining a first target speech frame corresponding to the minimum target cost value; According to the first target phonemes corresponding to each first target speech frame, the optimal command word phoneme sequence corresponding to the speech segment to be recognized is determined, and the word corresponding to the optimal command word phoneme sequence is determined as the target command word.
3. The method according to claim 2, characterized in that Determining the confidence level corresponding to the speech segment to be recognized according to the target IPED and the average cost value of the optimal command word phoneme sequence includes: Determine an average cost value of the optimal command word phoneme sequence according to the cost value of each first target speech frame corresponding to the optimal command word phoneme sequence; Determine a product value of the target IPED and the average cost value; The confidence level corresponding to the speech segment to be recognized is determined according to the product value, the length of the optimal command word phoneme sequence and a preset length parameter.
4. The method according to claim 1, characterized in that Determining the second target phoneme corresponding to each speech frame comprises: For each speech frame, a minimum cost value is obtained according to the cost value of each preset phoneme corresponding to the speech frame, and the phoneme corresponding to the minimum cost value is determined as the second target phoneme corresponding to the speech frame.
5. The method according to claim 1, characterized in that Determining the optimal full-pass phoneme sequence corresponding to the speech segment to be recognized according to the second target phoneme corresponding to each speech frame includes: For the same second target phoneme, obtaining a minimum target cost value among target cost values of each speech frame of the second target phoneme, and obtaining a second target speech frame corresponding to the minimum target cost value; According to the second target phonemes corresponding to each of the second target speech frames, an optimal full-pass phoneme sequence corresponding to the speech segment to be recognized is determined.
6. The method according to claim 1, characterized in that The step of determining the target IPED of the optimal all-pass phoneme sequence and the optimal command word phoneme sequence according to each second target phoneme included in the optimal all-pass phoneme sequence and each first target phoneme included in the optimal command word phoneme sequence comprises: Deleting the first target phoneme at a set position in the optimal command word phoneme sequence to obtain an optimal command word phoneme subsequence, and deleting the second target phoneme at a set position in the optimal all-pass phoneme sequence to obtain an optimal all-pass phoneme subsequence; Determine a first IPED of the optimal command word phoneme subsequence and the optimal all-pass phoneme subsequence, and update the first IPED according to the first IPED and a preset first parameter; Determine a second IPED of the optimal command word phoneme subsequence and the optimal all-pass phoneme sequence, and update the second IPED according to the second IPED and a preset second parameter; Determine a third IPED of the optimal command word phoneme sequence and the optimal all-pass phoneme subsequence, and update the third IPED according to the third IPED and a preset third parameter; The minimum value among the updated first IPED, second IPED and third IPED is determined as the target IPED.
7. The method according to claim 1, characterized in that After obtaining the first target phoneme and the target cost value corresponding to each speech frame output, determining the optimal command word phoneme sequence corresponding to the speech segment to be recognized and the command word corresponding to the optimal command word phoneme sequence according to the first target phoneme and the target cost value corresponding to each speech frame, the method includes: For each speech frame, determine the target cost value corresponding to the speech frame and the average cost value of the target cost values corresponding to a set number of other speech frames adjacent to the speech frame, and update the average cost value to the target cost value of the speech frame.
8. A command word recognition device, characterized in that: The device comprises: An acquisition module is used to input each speech frame in the received speech segment to be recognized into a pre-trained acoustic model, and obtain a cost value of each preset phoneme corresponding to each speech frame output by the acoustic model; input the cost value of each preset phoneme corresponding to each speech frame obtained and each preset phoneme into a Viterbi decoder, and obtain a first target phoneme and a target cost value corresponding to each output speech frame; A determination module is used to determine the optimal command word phoneme sequence corresponding to the speech segment to be recognized and the target command word corresponding to the optimal command word phoneme sequence according to the first target phoneme and the target cost value corresponding to each speech frame; determine the second target phoneme corresponding to each speech frame; determine the optimal all-pass phoneme sequence corresponding to the speech segment to be recognized according to the second target phoneme corresponding to each speech frame; determine the target IPED of the optimal all-pass phoneme sequence and the optimal command word phoneme sequence according to each second target phoneme included in the optimal all-pass phoneme sequence and each first target phoneme included in the optimal command word phoneme sequence; The recognition module is used to determine the confidence corresponding to the speech segment to be recognized based on the target IPED and the average cost value of the optimal command word phoneme sequence; based on the confidence, determine whether the target command word is a command word contained in the speech segment to be recognized.
9. An electronic device, characterized in that: The electronic device comprises at least a processor and a memory, and the processor is used to implement the steps of the command word recognition method described in any one of claims 1 to 7 when executing a computer program stored in the memory.
10. A computer-readable storage medium, characterized in that: It stores a computer program, which, when executed by a processor, implements the steps of the command word recognition method described in any one of claims 1-7.
Citation Information
Patent Citations
Voice command word recognition method and device, conference terminal and conference terminal system
CN111798846A
Voice recognition method and device and electronic equipment
CN111816165A
