Voice signal based instruction triggering method, device and equipment and storage medium
By dividing the speech signal into short segments and classifying them to generate instruction sequences, and then combining these sequences with activation conditions to trigger target instructions, the problem of low accuracy in traditional speech signal recognition is solved, achieving more efficient and accurate instruction triggering.
Patent Information
- Application Number
- CN202211180123.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-27
- Publication Date
- 2025-12-09
- Estimated Expiration
- 2042-09-27
AI Technical Summary
Traditional voice signal recognition methods have low accuracy, leading to electronic devices triggering control commands erroneously.
The target speech signal is divided into multiple shorter speech segments, processed by a classification and recognition model to generate a sequence of instructions, and the target instructions are triggered based on activation conditions.
It improves the efficiency and accuracy of voice signal processing, reduces the probability of false triggering of commands, and ensures the accuracy of command execution.
Smart Images

Figure CN115620703B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer, in particular to a command triggering method and device based on voice signal, computer equipment, storage medium and computer program product. BACKGROUND
[0002] With the development of artificial intelligence technology, electronic devices are often controlled through voice signals, so that the electronic devices trigger corresponding instructions according to the voice signals. In the traditional technology, the phoneme sequence corresponding to the voice signal is recognized through an acoustic model, and then it is judged whether the voice signal contains a specific vocabulary according to the phoneme sequence, so as to trigger the corresponding instruction when the voice signal contains the specific vocabulary. However, the accuracy of recognizing the voice signal through the acoustic model is low, which easily leads to the false triggering of the control instruction by the electronic device. SUMMARY
[0003] Therefore, it is necessary to provide a command triggering method and device based on voice signal, computer equipment, computer readable storage medium and computer program product, which can improve the accuracy of triggering control instruction.
[0004] In a first aspect, the present application provides a command triggering method based on voice signal. The method comprises:
[0005] obtaining a plurality of voice segments in a target voice signal;
[0006] respectively classifying and identifying a plurality of voice segments to obtain an identification result set;
[0007] generating an instruction sequence corresponding to each candidate instruction according to the identification result set;
[0008] selecting a target instruction from the candidate instructions based on each instruction sequence;
[0009] if the target instruction meets an activation condition, triggering the target instruction.
[0010] In a second aspect, the present application also provides a command triggering device based on voice signal. The device comprises:
[0011] an acquisition module configured to obtain a plurality of voice segments in a target voice signal;
[0012] an identification module configured to respectively classify and identify a plurality of voice segments to obtain an identification result set;
[0013] a generation module configured to generate an instruction sequence corresponding to each candidate instruction according to the identification result set;
[0014] A selection module is used to select a target instruction from the candidate instructions based on each instruction sequence;
[0015] The triggering module is used to trigger the target instruction if the target instruction meets the activation conditions.
[0016] In one embodiment, the identification module is further configured to:
[0017] The multiple speech segments are classified and identified by a classification and recognition model to obtain recognition vectors corresponding to the multiple speech segments;
[0018] The matching probabilities between the multiple recognition vectors are calculated to obtain the matching probabilities between the multiple speech segments and each candidate instruction.
[0019] The recognition result corresponding to each speech segment is determined based on the matching probability, and the recognition results corresponding to each speech segment are combined into a recognition result set.
[0020] In one embodiment, the generation module is further configured to:
[0021] Obtain the candidate instruction identifier and probability threshold corresponding to each candidate instruction;
[0022] Based on the candidate instruction identifier and the probability threshold, determine the element value corresponding to each recognition result in the recognition result set;
[0023] The element values corresponding to each of the recognition results form the instruction sequence corresponding to the candidate instruction.
[0024] In one embodiment, the identification result set includes an identification instruction identifier and a matching probability; the instruction corresponding to the identification instruction identifier belongs to the candidate instruction; the generation module is further configured to:
[0025] If the identification instruction identifier corresponding to the identification result is consistent with the candidate instruction identifier, and the matching probability corresponding to the identification result is greater than the probability threshold, the element value corresponding to the identification result is determined to be the first element value;
[0026] If the identification instruction identifier corresponding to the identification result is inconsistent with the candidate instruction identifier, and / or the matching probability corresponding to the identification result is less than or equal to the probability threshold, the element value corresponding to the identification result is determined to be the second element value.
[0027] In one embodiment, the selection module is further configured to:
[0028] Determine the number of target elements contained in each of the instruction sequences;
[0029] Select a target instruction sequence from the instruction sequence according to the stated quantity;
[0030] In the candidate instructions, a candidate instruction corresponding to the target instruction sequence is determined as a target instruction.
[0031] In an embodiment, the triggering module is further configured to:
[0032] obtain an activation sequence corresponding to the target instruction;
[0033] calculate an activation value of an instruction sequence corresponding to the target instruction based on the activation sequence;
[0034] when the activation value is greater than a preset activation threshold, determine that the target instruction satisfies an activation condition, and trigger the target instruction.
[0035] In an embodiment, the obtaining module is further configured to:
[0036] obtain a preset signal length and an interception time interval for segmenting and intercepting a target voice signal to be recognized;
[0037] intercept voice segments from the voice signal to be recognized in sequence according to the preset signal length and the interception time interval.
[0038] In a third aspect, the present application further provides a computer device. The computer device comprises a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
[0039] obtain a plurality of voice segments in a target voice signal;
[0040] perform classified recognition on the plurality of voice segments respectively to obtain a recognition result set;
[0041] generate an instruction sequence corresponding to each candidate instruction according to the recognition result set;
[0042] select a target instruction from the candidate instructions based on the instruction sequences;
[0043] if the target instruction satisfies an activation condition, trigger the target instruction.
[0044] In a fourth aspect, the present application further provides a computer readable storage medium. The computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the following steps:
[0045] obtain a plurality of voice segments in a target voice signal;
[0046] perform classified recognition on the plurality of voice segments respectively to obtain a recognition result set;
[0047] generating an instruction sequence corresponding to each candidate instruction according to the recognition result set;
[0048] selecting a target instruction from the candidate instructions based on the instruction sequences;
[0049] if the target instruction meets an activation condition, triggering the target instruction.
[0050] In a fifth aspect, the present application provides a computer program product. The computer program product comprises a computer program which, when executed by a processor, implements the following steps:
[0051] obtaining a plurality of speech segments in a target speech signal;
[0052] performing classification recognition on the plurality of speech segments respectively to obtain a recognition result set;
[0053] generating an instruction sequence corresponding to each candidate instruction according to the recognition result set;
[0054] selecting a target instruction from the candidate instructions based on the instruction sequences;
[0055] if the target instruction meets an activation condition, triggering the target instruction.
[0056] The above-mentioned instruction triggering method and device based on a speech signal, computer device, storage medium and computer program product can obtain a plurality of speech segments in a target speech signal, so that the speech signal can be divided into shorter speech segments, and the speech segments can be processed in a pipeline manner, thereby reducing the delay of processing the speech signal and improving the processing efficiency of the speech signal. Then, classification recognition is performed on the plurality of speech segments respectively to obtain a recognition result set, and an instruction sequence corresponding to each candidate instruction is generated according to the recognition result set. A target instruction is selected from the candidate instructions based on the instruction sequences, and if the target instruction meets an activation condition, the target instruction is triggered. Since the target instruction is selected according to the recognition result set, the accuracy of recognizing the speech signal is improved, and the target instruction is triggered only when the activation condition is met, thereby further reducing the probability of false triggering of the instruction and ensuring the accuracy of execution of the instruction. BRIEF DESCRIPTION OF DRAWINGS
[0057] Figure 1 An application environment diagram of the instruction triggering method based on a speech signal in one embodiment;
[0058] Figure 2 A flowchart of the instruction triggering method based on a speech signal in one embodiment;
[0059] Figure 3 A diagram of a target speech signal and a speech segment in one embodiment;
[0060] Figure 4 a schematic diagram of instruction sequences corresponding to each candidate instruction in an embodiment;
[0061] Figure 5 a schematic diagram of a method for obtaining a recognition result set in an embodiment;
[0062] Figure 6 a schematic diagram of a method for determining an instruction sequence in an embodiment;
[0063] Figure 7 a schematic diagram of a method for triggering an instruction based on a voice signal in another embodiment;
[0064] Figure 8 a structural block diagram of an apparatus for triggering an instruction based on a voice signal in an embodiment;
[0065] Figure 9 an internal structural diagram of a computer device in an embodiment. DETAILED DESCRIPTION
[0066] In order to make the purposes, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and should not be used to limit the present application.
[0067] The method for triggering an instruction based on a voice signal provided by the embodiments of the present application can be applied in an application environment as shown in Figure 1 . A terminal 102 obtains a plurality of voice segments in a target voice signal; respectively classifies and identifies the plurality of voice segments to obtain a recognition result set; generates an instruction sequence corresponding to each candidate instruction according to the recognition result set; selects a target instruction from the candidate instructions based on the instruction sequences; and triggers the target instruction if the target instruction satisfies an activation condition. The terminal 102 can be, but is not limited to, various smart phones, tablet computers, Internet of Things devices and portable wearable devices. The Internet of Things device can be an image acquisition device, a smart speaker, a smart television, a smart air conditioner, a smart vehicle device, etc. The image acquisition device can be a general camera, a motion camera, a panoramic camera or a video camera, etc. The portable wearable device can be a smart watch, a smart bracelet, a head-mounted device, etc.
[0068] In an embodiment, as shown in Figure 2 , a method for triggering an instruction based on a voice signal is provided. Taking the terminal in Figure 1 as an example, the method includes the following steps:
[0069] S202, obtaining a plurality of voice segments in a target voice signal.
[0070] The target voice signal is a signal in which the sound intensity changes over time. The target voice signal can include a control instruction issued by a user to the intelligent device. For example, the target voice signal can include a "turn on the aperture" control instruction issued by the user, to instruct the camera to turn on the aperture. For another example, the target voice signal can include a "turn off the air conditioner" control instruction issued by the user, to instruct the air conditioner to turn off. The terminal determines whether the target voice signal includes a control instruction by detecting whether the target voice signal includes a specific keyword. For example, when it is detected that the target voice signal includes the keyword "turn on", it is determined that the target voice signal is a voice signal in which the user instructs to turn on. The voice segment is a segment in the target voice signal. For example, the target voice signal is a voice signal with a length greater than 10 seconds, and the voice segment is a segment with a length of 1 second cut from the target voice signal.
[0071] In one embodiment, S202 specifically includes: the terminal receives the target voice signal, and if the target voice signal is an analog signal, first converts the target voice signal into a digital signal, and then extracts the voice segment from the target voice signal.
[0072] In one embodiment, S202 specifically includes: obtaining a preset signal length for segmenting and cutting the target voice signal to be recognized, and a cutting time interval; and cutting the voice segment from the voice signal to be recognized in turn according to the preset signal length and the cutting time interval.
[0073] The preset signal length is the length of the voice segment, which can be any length value less than the target voice signal. For example, the preset signal length is 1 second, 2 seconds, or 1.5 seconds, etc. The cutting time interval is the time interval for cutting two adjacent voice segments. For example, the cutting time interval is 100 milliseconds, and the terminal cuts a voice segment from the target voice signal every 100 milliseconds. For example, as shown in FIG. 1, the voice segment is a segment with a length of 1 second in the target voice signal. When the terminal receives the target voice signal with a length of 1 second, it cuts the 1-second voice signal to obtain a voice segment, then continues to cut the target voice signal with an interval of 100 milliseconds, and so on, to obtain multiple voice segments. Figure 3
[0074] The terminal cuts the voice segment from the voice signal to be recognized in turn according to the preset signal length and the cutting time interval. Thus, the longer target voice signal can be divided into multiple shorter voice segments, and the cut voice segments can be processed in a pipeline manner, reducing the delay of processing the voice signal and improving the efficiency of controlling the intelligent device according to the voice signal.
[0075] S204, respectively classifying and recognizing the multiple voice segments to obtain a recognition result set.
[0076] The terminal respectively classifies and identifies each voice segment, obtains a corresponding recognition result for each voice segment, and the recognition results corresponding to the voice segments form a recognition result set. The recognition result is used to indicate a control instruction corresponding to the voice segment. For example, assuming that there are N control instructions, the instruction identifiers of the N control instructions are Y1, Y2, …, YN respectively, the recognition result corresponding to voice segment 1 is (Yt, Pt), where 1≤t≤N, Yt represents an instruction identifier, Pt represents a probability that the control instruction corresponding to voice segment 1 is Yt, and (Yt, Pt) represents that the recognition result corresponding to voice segment 1 is that the probability that Yt is Y1, Y2, …, YN is Pt.
[0077] In one embodiment, the terminal respectively classifies and identifies each voice segment, and obtains a recognition result set {Y1, P1; Y2, P2; Y3, P3; …; Yn, Pn}, where n is a positive integer greater than 1, (Yn, Pn) is a recognition result corresponding to the nth voice segment.
[0078] In one embodiment, S204 specifically includes that the terminal respectively classifies and identifies each voice segment, obtains a probability that the voice segment is each control instruction, and then determines a recognition result corresponding to the voice segment according to the probability that the voice segment is each control instruction. For example, the terminal selects a control instruction with the maximum probability, and takes the control instruction with the maximum probability and the corresponding probability as the recognition result of the voice segment. Finally, the recognition result set is formed by the recognition results corresponding to the voice segments.
[0079] In one embodiment, S204 specifically includes that the terminal respectively classifies and identifies each voice segment, obtains a probability that the voice segment is each control instruction, and then determines a recognition result corresponding to the voice segment according to the probability that the voice segment is each control instruction. For example, the terminal selects a control instruction with the maximum probability, and takes the control instruction with the maximum probability and the corresponding probability as the recognition result of the voice segment. Finally, the recognition result set is formed by the recognition results corresponding to the voice segments.
[0080] S206, according to the recognition result set, generates an instruction sequence corresponding to each candidate instruction.
[0081] The candidate instruction is an instruction for controlling the smart device. For example, the candidate instruction is a power-on instruction for instructing the smart device to power on. For another example, the candidate instruction is a temperature adjustment instruction for instructing the air conditioner to adjust the temperature. For another example, the candidate instruction is a photograph instruction for instructing the camera to take a photograph. For another example, the candidate instruction is a video recording instruction for instructing the video camera to record a video. The instruction sequence is a character sequence composed of specific characters, and the characters constituting the instruction sequence can be numbers, letters, special symbols, and the like. For example, the instruction sequence is a character sequence composed of 0 and 1. For example, the instruction sequence is 011010. The candidate instruction is a speech instruction composed of phonemes, and the candidate instruction contains phonemes of a specific keyword. For example, when the candidate instruction is a power-on instruction, the candidate instruction contains the phoneme “kaiji” of the keyword “power on”. The character “1” in the instruction sequence can be used to indicate that the phoneme of the keyword appears at the position of “1”, and the character “0” in the instruction sequence can be used to indicate that the phoneme of the keyword does not appear at the position of “0”. For example, the temperature adjustment instruction can be “increase the temperature”, and the instruction sequence can be “001111(wendu)0011(gao)”.
[0082] In one embodiment, the recognition result set further includes instructions other than the candidate instructions.
[0083] In one embodiment, S206 specifically includes: starting from the first candidate instruction, the terminal determines, for each candidate instruction, an instruction sequence corresponding to the candidate instruction. Specifically, as shown in Figure 4 For example, for the candidate instruction 1, the terminal determines the element values according to the recognition results 1-6 as 0, 1, 1, 0, 0, and 1, respectively, to obtain the instruction sequence 011001; for the candidate instruction 2, the terminal determines the element values according to the recognition results 1-6 as 0, 0, 0, 0, 1, and 0, respectively, to obtain the instruction sequence 000010, and so on until the last candidate instruction. Assuming that there are N candidate instructions Y1, Y2, …YN, M speech segments t1, t2, …tm, and the recognition result set is {Y t1 , P t1 ; Y t2 , P t2 ; … Y tm , P tm}, where Y t1 to Y tmY1, Y2, …YN are candidate instructions in Y1, Y2, …YN. For candidate instruction Y1, an element value is determined according to each recognition result (Yt, Pt, t1<=t<=tm) in the recognition result set respectively, and the element values corresponding to all the recognition results form an instruction sequence corresponding to Y1; for candidate instruction Y2, an element value is determined according to each recognition result in the recognition result set respectively, and the element values corresponding to all the recognition results form an instruction sequence corresponding to Y2, and the like is sequentially repeated until candidate instruction YN.
[0084] S208, selecting a target instruction from the candidate instructions based on the instruction sequences.
[0085] The terminal selects a target instruction from all the candidate instructions based on the instruction sequences. Specifically, the terminal can select a candidate instruction corresponding to an instruction sequence satisfying a selection condition as the target instruction. The selection condition may, for example, be that the instruction sequence contains a specific character, or the selection condition may, for example, be that the number of specific characters contained in the instruction sequence reaches a preset value, or the selection condition may, for example, be that the number of specific characters contained in the instruction sequence is the largest. When multiple instruction sequences all satisfy the selection condition, the terminal determines a control instruction corresponding to the target voice signal as an instruction other than the candidate instructions, so as to avoid triggering the control instruction by mistake.
[0086] S210, if the target instruction satisfies an activation condition, triggering the target instruction.
[0087] The activation condition is a condition for judging whether the target instruction is activated. For example, the activation condition is that the activation value corresponding to the target instruction is greater than a preset activation threshold. For example, the activation condition is that the activation value corresponding to the target instruction is greater than the average of the activation values corresponding to all the candidate instructions. For example, the activation condition is that the ranking of the activation value corresponding to the target instruction in all the activations is before a preset ranking.
[0088] In one embodiment, S210 specifically includes: obtaining an activation sequence corresponding to the target instruction; performing convolution calculation on the instruction sequence corresponding to the target instruction based on the activation sequence to obtain an activation value; when the activation value is greater than a preset activation threshold, determining that the target instruction satisfies the activation condition, and triggering the target instruction.
[0089] The activation sequence is a character sequence set in advance and is used to judge whether the target instruction satisfies the activation condition. The activation sequence may, for example, be composed of digits, such as binary, decimal or octal digits. For example, the activation sequence is “01001”.
[0090] In one embodiment, the terminal obtains activation sequences corresponding to each control command through extensive learning and training. Specifically, the characters used to form the activation sequence are permuted and combined to obtain multiple candidate activation sequences. Then, a test set is used to test each candidate activation sequence. For example, assuming the activation sequence is a four-bit binary sequence composed of "0" and "1", the candidate activation sequences obtained by permuting and combining "0" and "1" are 0001, 0010, 0100, 1000, 0011, 0110, 1100... The test set is used to test each candidate activation sequence. If it is assumed that selecting "1100" as the activation sequence results in the highest accuracy for identifying the target command triggered by the user, then "1100" is selected as the activation sequence corresponding to the target command. The length of the activation sequence can be less than the length of the command sequence. The terminal performs convolution calculation on the command sequence using the activation sequence to obtain the activation value. Specifically, the terminal performs convolution calculation on the command sequence using the activation sequence with a preset stride to obtain a convolution sequence. Then, the values of each element in the convolution sequence are summed to obtain the activation value. For example, suppose the instruction sequence M = {X1, X2, ... X} m}, of length m, activation sequence Z = {Z1, Z2, ... Z} n}, with a length of n (n < m), the terminal can calculate the convolution sequence Y = {Y1, Y2, ... Y} according to formula (1). m-n Then, the activation value s is calculated according to formula (2).
[0091] Y1 = X1 × Z1 + X2 × Z2 + ... + X n ×Z n
[0092] Y2=X2×Z1+X3×Z2+...+X n+1 ×Z n ...
[0093] Y m-n =X m-n ×Z1+X m-n+1 ×Z2+...+X m ×Z n (1)
[0094]
[0095] The terminal performs convolution calculation on the instruction sequence corresponding to the target instruction based on the activation sequence, and triggers the target instruction when the activation value obtained from the convolution calculation is greater than the preset activation threshold. In this way, the difference between the instruction sequence that appears during false detection and the instruction sequence corresponding to the real control instruction can be used to determine whether to activate the target instruction by the activation value, thereby reducing the probability of falsely triggering control instructions.
[0096] In the above embodiment, each speech segment in the target speech signal is sequentially acquired, so that the speech signal can be divided into shorter speech segments, and the speech segments can be processed in a pipeline manner, thereby reducing the delay of processing the speech signal and improving the processing efficiency of the speech signal. Then, each speech segment is classified and recognized respectively to obtain a recognition result set, and an instruction sequence corresponding to each candidate instruction is generated according to the recognition result set. Based on each instruction sequence, a target instruction is selected from the candidate instructions, and if the target instruction satisfies an activation condition, the target instruction is triggered. Since the target instruction is selected according to the recognition result set, the accuracy of recognizing the speech signal is improved, the probability of false triggering of the instruction is reduced, and the accuracy of instruction execution is ensured.
[0097] In one embodiment, as shown in FIG. 2, Figure 5 S204 specifically includes the following steps:
[0098] S502, classifying and recognizing each speech segment by a classification recognition model to obtain an identification vector corresponding to each speech segment.
[0099] The classification recognition model is a deep learning model for classifying and recognizing speech segments. For example, the classification recognition model can be a logistic regression model, a decision tree model, a support vector machine model, or a naive Bayes model. The identification vector is a vector output by the classification recognition model after processing the speech segment. When there are N candidate instructions, the identification vector can be an N+1-dimensional vector. The terminal inputs the speech segment into the classification recognition model to obtain the identification vector output by the classification recognition model.
[0100] S504, calculating the identification vector to obtain a matching probability between the speech segment and each candidate instruction.
[0101] The terminal calculates the identification vector to obtain a matching probability between the speech segment and each candidate instruction. For example, the terminal can perform a SoftMax (normalization) operation on the identification vector to obtain the matching probability between the speech segment and each candidate instruction. For example, the matching probabilities between speech segment 1 and candidate instruction 1 to candidate instruction 5 are P1, P2, P3, P4, and P5, respectively.
[0102] S506, determining the recognition result corresponding to the speech segment based on the matching probability, and grouping the recognition results corresponding to each speech segment into a recognition result set.
[0103] The terminal determines the recognition result corresponding to the speech segment based on the matching probability. For example, the terminal can select a target matching probability with the maximum value from the matching probability, and then the target matching probability and the candidate instruction identification corresponding to the target matching probability form the recognition result corresponding to the speech segment. For example, the terminal can select a target matching probability greater than a preset value from the matching probability, and then the target matching probability and the candidate instruction identification corresponding to the target matching probability form the recognition result corresponding to the speech segment. For example, the matching probability between the speech segment 1 and each candidate instruction is as follows: candidate instruction A: 0.3; candidate instruction B: 0.5; candidate instruction C: 0.35; candidate instruction D: 0.68; and candidate instruction E: 0.44. Since the matching probability (0.68) corresponding to the candidate instruction D is the maximum, the terminal can form the recognition result corresponding to the speech segment 1 by the matching probability 0.68 and the instruction identification of the candidate instruction D. The terminal forms the recognition result set by the recognition results corresponding to all speech segments when obtaining the recognition result corresponding to each speech segment.
[0104] In the above embodiment, the classification and recognition model is used to classify and recognize each speech segment, and then the recognition vector obtained by the classification and recognition is calculated to obtain the matching probability between the speech segment and each candidate instruction. The recognition result corresponding to the speech segment is determined based on the matching probability, and the recognition results corresponding to the speech segments are combined to form the recognition result set. Thus, whether the key word for triggering the target instruction is included in the speech signal can be determined by clustering the recognition results in the recognition result set, and the accuracy of triggering the target instruction is improved.
[0105] In one embodiment, as shown in FIG. 6, S602 specifically includes the following steps: Figure 6
[0106] S602, obtaining the candidate instruction identification corresponding to each candidate instruction and the probability threshold.
[0107] The candidate instruction identification is an identification used to mark each candidate instruction, which can be composed of numbers, letters, characters, or special symbols, etc. The probability threshold can be any decimal, integer, fraction, or percentage, etc. For example, the probability threshold can be 0.5, 2 / 3, or 70%, etc. For example, the candidate instruction identification corresponding to the candidate instruction A is “A”, and the probability threshold is 0.6.
[0108] S604, determining the element value corresponding to each recognition result according to the candidate instruction identification and the probability threshold.
[0109] The element value is a value of an element in the instruction sequence, which can be a binary, octal or decimal value. For example, the instruction sequence is a binary sequence, and the element value can be a value of 0 or 1; for another example, the instruction sequence is a decimal sequence, and the element value can be a value of 0-9. The terminal can set the same probability threshold for each candidate instruction, or can set different probability thresholds for each candidate instruction. For example, the terminal sets the probability threshold to be 0.5 for each candidate instruction; for another example, the terminal sets the probability threshold to be 0.5 for candidate instructions A-C, and sets the probability threshold to be 0.6 for candidate instructions D-F.
[0110] In one embodiment, the identification result in the identification result set includes an identification instruction and a matching probability; S604 specifically includes: if the identification instruction identification corresponding to the identification result is consistent with the candidate instruction identification, and the matching probability corresponding to the identification result is greater than the probability threshold, determining that the element value corresponding to the identification result is the first element value; if the identification instruction identification corresponding to the identification result is inconsistent with the candidate instruction identification, and / or the matching probability corresponding to the identification result is less than or equal to the probability threshold, determining that the element value corresponding to the identification result is the second element value.
[0111] The first element value and the second element value can be set to any value, for example, the first element value is 1 and the second element value is 0. For another example, the first element value is a two-bit binary character 10, and the second element value is a two-bit binary character 00.
[0112] Specifically, as shown in Table 1, the terminal sets the first element value to be 1, the second element value to be 0, and the probability threshold to be 0.5. For candidate instruction A, the identification results (A, 0.7) and (A, 0.65) are consistent with the identification instruction identification of candidate instruction A, and the corresponding matching probability is greater than the probability threshold 0.5, so for candidate instruction A, the element values corresponding to the identification results (A, 0.7) and (A, 0.65) are the first element value 1; the identification result (A, 0.3) is consistent with the identification instruction identification of candidate instruction A, but the corresponding matching probability is less than the probability threshold, so the element value corresponding to (A, 0.3) is the second element value 0; the identification results (B, 0.52), (C, 0.73), (B, 0.65), (D, 0.84) and (D, 0.3) are inconsistent with the identification instruction identification of candidate instruction A, so the corresponding element values are the second element value 0. For candidate instruction B, the identification results (B, 0.52) and (B, 0.65) are consistent with the identification instruction identification of candidate instruction B, and the corresponding matching probability is greater than the probability threshold 0.5. Therefore, for candidate instruction B, the element values corresponding to the identification results (B, 0.52) and (B, 0.65) are the first element value 1, and the element values corresponding to the remaining identification results are 0. By analogy, for candidate instruction C and candidate instruction D, the element values corresponding to each identification result can also be obtained.
[0113] Table 1
[0114]
[0115] When the terminal identifies that the identification instruction identifier corresponding to the identification result is consistent with the candidate instruction identifier, and the matching probability corresponding to the identification result is greater than the probability threshold, the terminal determines that the element value corresponding to the identification result is the first element value. Thus, the first element value can be used to mark the voice segment that matches a certain candidate instruction with a matching probability greater than the probability threshold, that is, the matching probability between the voice segment corresponding to the first element value and the specific candidate instruction is greater than the probability threshold, and the voice segment contains the keyword in the specific candidate instruction with a higher possibility.
[0116] S606, the terminal assembles the element values corresponding to the identification results to obtain the instruction sequence corresponding to the candidate instruction.
[0117] The terminal assembles the element values corresponding to the identification results to obtain the instruction sequence corresponding to the candidate instruction. For example, as shown in Table 1, the instruction sequence corresponding to the candidate instruction A is “00000011”, the instruction sequence corresponding to the candidate instruction B is “01010000”, the instruction sequence corresponding to the candidate instruction C is “00100000”, and the instruction sequence corresponding to the candidate instruction D is “00001000”.
[0118] In the above embodiment, the candidate instruction identifier corresponding to each candidate instruction and the probability threshold are obtained, the element value corresponding to each identification result is determined according to the candidate instruction identifier and the probability threshold, and the instruction sequence corresponding to the candidate instruction is assembled from the element values corresponding to the identification results. Thus, the identification result can be converted into an instruction sequence, and the target instruction is selected from the candidate instruction according to the instruction sequence. The difference between the instruction sequence and the instruction sequence corresponding to the real control instruction is utilized, and the instruction sequence with a large difference from the instruction sequence of the real control instruction is excluded, so that the selected target instruction is more accurate, and the accuracy of controlling the intelligent device through the voice signal is improved.
[0119] In one embodiment, S208 specifically includes: determining the number of target elements in each instruction sequence; selecting a target instruction sequence in the instruction sequence according to the number; and determining the candidate instruction corresponding to the target instruction sequence as the target instruction in the candidate instruction.
[0120] The target element can be an element with a target value. For example, when the instruction sequence is a binary sequence, the target element can be 1, or the target element can also be 0, etc. The terminal queries the target element in each instruction sequence, and then counts the number of target elements to obtain the number of target elements in the instruction sequence. For example, for the instruction sequence “0110100”, the number of target elements “1” in the instruction sequence is 3.
[0121] The terminal selects a target instruction sequence from the instruction sequences according to the number of target elements contained in the instruction sequence. For example, the terminal can select an instruction sequence containing the largest number of target elements as the target instruction sequence. For another example, the terminal can select an instruction sequence containing a number of target elements greater than an average number as the target instruction sequence. For another example, the terminal can select an instruction sequence containing a number of target elements greater than a preset value as the target instruction sequence. For example, the terminal can select an instruction sequence containing the largest number of target elements "1" as the target instruction sequence.
[0122] In an embodiment, if the number of target elements contained in the plurality of instruction sequences is the same, it indicates that the probability of the target voice signal corresponding to the plurality of candidate instructions is the same. In order to avoid triggering the control instruction by mistake, other instructions except the candidate instructions are determined as the target instructions to avoid triggering the control instruction by mistake, and the other instructions are non-candidate instructions.
[0123] In the above embodiment, the more the number of target elements contained in the instruction sequence, the greater the possibility that the target voice signal contains the keyword in the candidate instruction corresponding to the instruction sequence. The terminal determines the number of target elements contained in each instruction sequence, and selects a target instruction sequence from the instruction sequences according to the number. Thus, the candidate instruction corresponding to the selected target instruction sequence can have the greatest possibility of being the control instruction actually corresponding to the target voice signal, avoiding triggering the control instruction by mistake, and improving the accuracy of controlling the intelligent device through the voice signal.
[0124] In an embodiment, as shown in FIG. 8, the instruction triggering method based on the voice signal includes the following steps: Figure 7
[0125] S702, obtaining a preset signal length and a time interval for segmenting and intercepting the target voice signal to be recognized.
[0126] S704, according to the preset signal length and the time interval, sequentially intercepting voice segments from the voice signal to be recognized.
[0127] S706, classifying and recognizing each voice segment through a classification recognition model to obtain a recognition vector corresponding to each voice segment.
[0128] S708, calculating the recognition vector to obtain a matching probability between the voice segment and each candidate instruction.
[0129] S710, determining a recognition result corresponding to the voice segment based on the matching probability, and grouping the recognition results corresponding to each voice segment into a recognition result set.
[0130] S712, obtain the candidate instruction identifier corresponding to each candidate instruction and the probability threshold value, and determine the element value corresponding to each recognition result according to the candidate instruction identifier and the probability threshold value.
[0131] S714, compose the instruction sequence corresponding to each candidate instruction by the element value corresponding to each recognition result, determine the number of target elements contained in each instruction sequence, and select the target instruction sequence in the instruction sequence according to the number.
[0132] S716, determine the candidate instruction corresponding to the target instruction sequence as the target instruction in the candidate instruction.
[0133] S718, obtain the activation sequence corresponding to the target instruction, perform convolution calculation on the instruction sequence corresponding to the target instruction based on the activation sequence, and obtain the activation value.
[0134] S720, trigger the target instruction when the activation value is greater than the preset activation threshold value.
[0135] The specific content of S702 to S720 can refer to the specific implementation process described above.
[0136] It should be understood that, although each step in the flowchart involved in the above embodiments is displayed in sequence according to the arrow, these steps are not necessarily executed in sequence according to the arrow. Unless otherwise stated herein, the execution of these steps has no strict sequence limitation, and these steps can be executed in other orders. Moreover, at least part of the steps in the flowchart involved in the above embodiments can include multiple steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution sequence of these steps or stages is not necessarily sequential, but can be executed in rotation or alternation with at least part of other steps or steps or stages in other steps.
[0137] Based on the same inventive concept, the embodiments of the present application also provide a voice signal based instruction triggering device for implementing the above voice signal based instruction triggering method. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme described in the above method, so the specific limitations in one or more voice signal based instruction triggering device embodiments provided below can refer to the limitations of the voice signal based instruction triggering method in the above text, which will not be repeated here.
[0138] In one embodiment, as shown in Figure 8 a voice signal based instruction triggering device is provided, which includes an acquisition module 802, a recognition module 804, a generation module 806, a selection module 808 and a triggering module 810, wherein:
[0139] The acquisition module 802 is configured to acquire a plurality of speech segments in the target speech signal.
[0140] The identification module 804 is configured to perform classified identification on the plurality of speech segments respectively to obtain a set of identification results.
[0141] The generation module 806 is configured to generate an instruction sequence corresponding to each candidate instruction according to the set of identification results.
[0142] The selection module 808 is configured to select a target instruction from the candidate instructions based on the instruction sequences.
[0143] The triggering module 810 is configured to trigger the target instruction if the target instruction meets an activation condition.
[0144] In the above embodiments, each speech segment in the target speech signal is acquired in sequence, so that a shorter speech segment can be selected from the speech signal, and the speech segments can be processed in a pipeline manner, thereby reducing the delay of processing the speech signal. Then, the classified identification is performed on each speech segment respectively to obtain a set of identification results, and an instruction sequence corresponding to each candidate instruction is generated according to the set of identification results. The target instruction is selected from the candidate instructions based on the instruction sequences, and the target instruction is triggered if the target instruction meets an activation condition. Since the target instruction is selected according to the set of identification results, the accuracy of identifying the speech signal is improved, the probability of false triggering of the instruction is reduced, and the accuracy of instruction execution is ensured.
[0145] In one embodiment, the identification module 804 is further configured to:
[0146] The classified identification model is used to perform classified identification on the plurality of speech segments to obtain an identification vector corresponding to each speech segment.
[0147] The identification vector is calculated to obtain a matching probability between the speech segment and each candidate instruction.
[0148] The identification result corresponding to the speech segment is determined based on the matching probability, and the identification result corresponding to each speech segment is combined to form the set of identification results.
[0149] In one embodiment, the generation module 806 is further configured to:
[0150] The candidate instruction identifier corresponding to each candidate instruction and the probability threshold are acquired.
[0151] The element value corresponding to each identification result is determined according to the candidate instruction identifier and the probability threshold.
[0152] The instruction sequence corresponding to the candidate instruction is composed of the element value corresponding to each identification result.
[0153] In an embodiment, the recognition result in the recognition result set comprises a recognition instruction identifier and a matching probability; the recognition instruction identifier corresponds to a candidate instruction; the generation module 806 is further configured to:
[0154] If the recognition instruction identifier corresponding to the recognition result is consistent with the candidate instruction identifier, and the matching probability corresponding to the recognition result is greater than the probability threshold, the element value corresponding to the recognition result is determined as the first element value;
[0155] If the recognition instruction identifier corresponding to the recognition result is inconsistent with the candidate instruction identifier, and / or the matching probability corresponding to the recognition result is less than or equal to the probability threshold, the element value corresponding to the recognition result is determined as the second element value.
[0156] In an embodiment, the selection module 808 is further configured to:
[0157] Determine the number of target elements contained in each instruction sequence;
[0158] Select a target instruction sequence in the instruction sequence according to the number;
[0159] Determine the candidate instruction corresponding to the target instruction sequence as the target instruction.
[0160] In an embodiment, the triggering module 810 is further configured to:
[0161] Obtain an activation sequence corresponding to the target instruction;
[0162] Perform convolution calculation on the instruction sequence corresponding to the target instruction based on the activation sequence to obtain an activation value;
[0163] When the activation value is greater than a preset activation threshold, it is determined that the target instruction satisfies an activation condition, and the target instruction is triggered.
[0164] In an embodiment, the acquisition module 802 is further configured to:
[0165] Obtain a preset signal length and an interception time interval for segmenting and intercepting the target voice signal to be recognized;
[0166] According to the preset signal length and the interception time interval, sequentially intercept voice segments from the voice signal to be recognized.
[0167] The above various modules in the instruction triggering device based on the voice signal can be realized by software, hardware, and combinations thereof, in whole or in part. The above various modules can be embedded in or independent of the processor in the computer device in hardware form, or can be stored in the memory in the computer device in software form, so as to be called and executed by the processor to perform the operations corresponding to the above various modules.
[0168] In one embodiment, a computer device is provided, which can be a terminal, and an internal structure diagram thereof can be as shown in FIG. 1. Figure 9 The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operating system and the computer program in the non-volatile storage medium to run. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals in a wired or wireless manner. The wireless manner can be achieved through WIFI, mobile cellular network, NFC (near field communication) or other technologies. The computer program is executed by the processor to implement a voice signal-based instruction triggering method. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer overlaid on the display screen, or a key, trackball or touchpad arranged on the shell of the computer device, or an external keyboard, touchpad or mouse, etc.
[0169] Those skilled in the art can understand that Figure 9 The structure shown in the above embodiment is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0170] In one embodiment, a computer device is provided, which includes a memory and a processor, and the memory stores a computer program. The processor executes the computer program to implement the steps in the above method embodiments.
[0171] In one embodiment, a computer readable storage medium is provided, which stores a computer program. The computer program is executed by a processor to implement the steps in the above method embodiments.
[0172] In one embodiment, a computer program product is provided, which includes a computer program. The computer program is executed by a processor to implement the steps in the above method embodiments.
[0173] It should be noted that the user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties, and the collection, use and processing of related data need to comply with relevant laws, regulations and standards of the country and region.
[0174] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing related hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium. When the computer program is executed, it can include the processes of the above-mentioned embodiments of each method. Any reference to a memory, database or other medium used in the embodiments provided by the present application can include at least one of a non-volatile and volatile memory. The non-volatile memory can include a read-only memory (ROM), a magnetic tape, a floppy disk, a flash memory, an optical storage, a high-density embedded non-volatile memory, a resistive memory (ReRAM), a magnetoresistive random access memory (MRAM), a ferroelectric memory (FRAM), a phase change memory (PCM), a graphene memory, etc. The volatile memory can include a random access memory (RAM) or an external cache memory, etc. As an illustration but not limitation, the RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The database involved in the embodiments provided by the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., without being limited thereto. The processor involved in the embodiments provided by the present application can be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., without being limited thereto.
[0175] The technical features of the above embodiments can be combined in any way. To make the description concise, not all possible combinations of the technical features in the above embodiments are described, but as long as the combination of the technical features does not exist contradictory, it should be considered as the scope of the present disclosure.
[0176] The above embodiments only express several implementation ways of the present application, and the description is specific and detailed, but it should not be understood as a limitation to the patent scope of the present application. It should be pointed out that for ordinary skilled in the art, without departing from the concept of the present application, several modifications and improvements can be made, which all belong to the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.
Claims
1. A command triggering method based on voice signals, characterized in that, The method includes: To acquire multiple speech segments from a target speech signal; The multiple speech segments are classified and identified respectively to obtain a set of recognition results; Generate an instruction sequence corresponding to each candidate instruction based on the recognition result set; Among the candidate instructions, the candidate instruction corresponding to the target instruction sequence that meets the selection criteria is selected as the target instruction; the selection criteria are that the target instruction sequence contains a specific character, or the number of specific characters in the target instruction sequence reaches a preset value, or the number of specific characters in the target instruction sequence is the largest. If the target instruction meets the activation condition, the target instruction is triggered; the activation condition is that the activation value corresponding to the target instruction is greater than a preset activation threshold, or the activation value corresponding to the target instruction is greater than the average of the activation values corresponding to each candidate instruction, or the activation value corresponding to the target instruction ranks higher than a preset rank among all activation values.
2. The method according to claim 1, characterized in that, The step of classifying and recognizing each of the aforementioned speech segments to obtain a recognition result set includes: Multiple speech segments are classified and identified using a classification and recognition model to obtain multiple recognition vectors corresponding to the multiple speech segments; The matching probabilities between the multiple recognition vectors are calculated to obtain the matching probabilities between the multiple speech segments and each candidate instruction. The recognition result corresponding to each speech segment is determined based on the matching probability, and the recognition results corresponding to each speech segment are combined into a recognition result set.
3. The method according to claim 1, characterized in that, The step of generating the instruction sequence corresponding to each candidate instruction based on the recognition result set includes: Obtain the candidate instruction identifier and probability threshold corresponding to each candidate instruction; Based on the candidate instruction identifier and the probability threshold, determine the element value corresponding to each recognition result in the recognition result set; The element values corresponding to each of the recognition results form the instruction sequence corresponding to the candidate instruction.
4. The method according to claim 3, characterized in that, Each recognition result in the recognition result set includes a recognition instruction identifier and a matching probability; the instruction corresponding to the recognition instruction identifier belongs to the candidate instruction; determining the element value corresponding to each recognition result based on the candidate instruction identifier and the probability threshold includes: If the identification instruction identifier corresponding to the identification result is consistent with the candidate instruction identifier, and the matching probability corresponding to the identification result is greater than the probability threshold, the element value corresponding to the identification result is determined to be the first element value; If the identification instruction identifier corresponding to the identification result is inconsistent with the candidate instruction identifier, and / or the matching probability corresponding to the identification result is less than or equal to the probability threshold, the element value corresponding to the identification result is determined to be the second element value.
5. The method according to claim 1, characterized in that, The step of selecting the candidate instruction corresponding to the target instruction sequence that meets the selection criteria from among the candidate instructions includes: Determine the number of target elements contained in each of the instruction sequences; Select a target instruction sequence from the instruction sequence according to the stated quantity; The candidate instructions corresponding to the target instruction sequence are determined as the target instructions.
6. The method according to claim 1, characterized in that, If the target instruction meets the activation condition, triggering the target instruction includes: Obtain the activation sequence corresponding to the target instruction; Based on the activation sequence, the instruction sequence corresponding to the target instruction is calculated to obtain the activation value; When the activation value is greater than the preset activation threshold, the target instruction is determined to meet the activation condition and the target instruction is triggered.
7. The method according to claim 1, characterized in that, The acquisition of multiple speech segments from the target speech signal includes: Obtain the preset signal length and segmentation time interval for segmenting the target speech signal to be recognized; According to the preset signal length and the extraction time interval, speech segments are extracted sequentially from the target speech signal.
8. A command triggering device based on voice signals, characterized in that, The device includes: The acquisition module is used to acquire multiple speech segments from the target speech signal; The recognition module is used to classify and recognize multiple speech segments respectively to obtain a recognition result set; The generation module is used to generate the instruction sequence corresponding to each candidate instruction based on the recognition result set; The selection module is used to select, from among the candidate instructions, the candidate instruction corresponding to the target instruction sequence that meets the selection criteria as the target instruction; the selection criteria are that the target instruction sequence contains a specific character, or the number of specific characters contained in the target instruction sequence reaches a preset value, or the number of specific characters contained in the target instruction sequence is the largest. The triggering module is used to trigger the target instruction if the target instruction meets the activation conditions; the activation conditions are that the activation value corresponding to the target instruction is greater than a preset activation threshold, or the activation value corresponding to the target instruction is greater than the average of the activation values corresponding to each candidate instruction, or the ranking of the activation value corresponding to the target instruction among all activation values is higher than a preset ranking.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.
11. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Method and device for controlling cursor movement through voice
CN110007826A
Voice endpoint detection method and device, storage medium and electronic equipment
CN112420079A