Voice keyword detection method, device, electronic device and readable storage medium

By calculating the correlation matrix and matching probability between syllables and speech segments, it solves the problems of large amount of calculation and poor interference resistance in the existing technology, and achieves efficient and accurate speech keyword detection, which is suitable for any keyword and can be used under noise interference. accurate identification.

CN114927128BInactive Publication Date: 2024-08-27TSINGHUA UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210424846.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-21
Publication Date
2024-08-27
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing speech keyword detection methods have problems such as large amount of calculation, the need for repeated training to recognize target keywords, and poor resistance to interference in speech clips.

Method used

By extracting the phonetic features and basic phonetic patterns of each syllable, calculate the correlation matrix between the syllable and the speech fragment, search for the best matching path, and calculate the matching probability between the target keyword and the speech fragment. If the matching probability is greater than or equal to the preset The threshold value determines that the target keyword is included.

Benefits of technology

It achieves efficient and accurate speech keyword detection, and can accurately capture target keywords despite noise interference and pronunciation aliasing, without the need to retrain the model to adapt to different keywords.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114927128B
    Figure CN114927128B
Patent Text Reader

Abstract

The present invention provides a method, device, electronic device and readable storage medium for detecting speech keywords. The method comprises: obtaining a speech segment to be detected and a target keyword, wherein the speech segment is a sequence including multiple frames of speech vectors, and the target keyword is a sequence including multiple syllables; based on each of the syllables and the speech segment, extracting the speech feature of each of the syllables, calculating the correlation between each of the syllables and the speech segment according to the speech feature of each of the syllables and the basic speech pattern of each of the syllables, and obtaining a correlation matrix between the target keyword and the speech segment; searching for the best matching path between the target keyword and the speech segment based on the correlation matrix, thereby calculating the matching probability between the target keyword and the speech segment; if the matching probability is greater than or equal to a preset threshold, determining that the speech segment contains the target keyword.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of speech recognition technology, and in particular to a method, device, electronic device and readable storage medium for detecting speech keywords. Background Art

[0002] Detecting specific key words or phrases from speech has a wide range of application scenarios. For example, in the field of smart home appliances, keyword detection is used for device voice wake-up and voice commands; in online live broadcast inspection, keyword detection is used for pornographic, violent, and insulting language warnings; in multimedia data archiving, keyword detection is used for audio and video search.

[0003] The existing keyword detection methods are generally divided into the following categories:

[0004] First: Large-scale continuous speech recognition. The most direct approach is to use large-scale continuous speech recognition technology to convert audio into text, and then detect keywords based on the text content. This method has two drawbacks: (1) Large-scale continuous speech recognition consumes too much computing resources, is not suitable for large-scale online detection, and cannot be run on devices with low computing power; (2) It is difficult to detect words that have not been seen in the vocabulary.

[0005] Second: Partial decoding method. Keyword detection is achieved by designing a small decoding graph that contains keywords and filler components. Because the decoding graph is designed based on the target keyword and is small in size, the computational complexity is low and it can be run on embedded devices. At the same time, the design and generation of the decoding graph are convenient, so it can support the detection of any keyword. The problem with this method is that the path weights for different keywords need to be readjusted, and it has low resistance to noise and mixed sounds.

[0006] Third: End-to-end model method. The basic scheme of the end-to-end model method is that, given a voice clip, the neural network directly determines whether the voice clip contains a specified keyword. If it does, it outputs 1, and if it does not, it outputs 0. The biggest drawback of this method is that the network is keyword-specific, and it needs to be retrained when a keyword is changed. In addition, training the network for each keyword requires preparing a large number of voice clips of the target keyword, which consumes too much resources. Summary of the invention

[0007] The present invention provides a method, device, electronic device and readable storage medium for detecting speech keywords, so as to solve the defects of the prior art, such as large amount of calculation, need for repeated training to identify target keywords and poor resistance to interference in speech segments, and realize efficient and accurate detection of target keywords.

[0008] The present invention provides a method for detecting a speech keyword, comprising:

[0009] Acquire a speech segment to be detected and a target keyword, wherein the speech segment is a sequence including multiple frames of speech vectors, and the target keyword is a sequence including multiple syllables;

[0010] Based on each of the syllables and the speech segment, extracting the speech feature of each of the syllables, calculating the correlation between each of the syllables and the speech segment according to the speech feature of each of the syllables and the basic speech pattern of each of the syllables, and obtaining a correlation matrix between the target keyword and the speech segment;

[0011] Searching for the best matching path between the target keyword and the voice segment based on the relevance matrix, thereby calculating the matching probability between the target keyword and the voice segment;

[0012] If the matching probability is greater than or equal to a preset threshold, it is determined that the target keyword is contained in the voice segment.

[0013] According to a method for detecting a speech keyword provided by the present invention, the speech feature of each syllable is extracted based on each syllable and the speech segment, specifically comprising:

[0014] obtaining a masking pattern for each of the syllables;

[0015] Based on the masking mode of each syllable, masking the speech vector of each frame in the speech segment;

[0016] The speech feature corresponding to each of the syllables is extracted.

[0017] According to a method for detecting a speech keyword provided by the present invention, the correlation between each syllable and the speech segment is calculated according to the speech feature of each syllable and the basic speech pattern of each syllable to obtain a correlation matrix between the target keyword and the speech segment, specifically comprising:

[0018] Obtaining a basic speech pattern for each of the syllables;

[0019] Performing a dot product operation between a basic speech pattern of a single syllable and speech features of the single syllable and the speech segment to obtain a correlation between the single syllable and the speech segment;

[0020] The correlation between each of the syllables and the speech segment is calculated to obtain a correlation matrix between the target keyword and the speech segment.

[0021] According to a method for detecting a speech keyword provided by the present invention, the calculation of the matching probability between the target keyword and the speech segment is specifically as follows:

[0022] Calculate the average matching score of the best matching path according to the best matching path;

[0023] According to the average matching score, the matching probability between the target keyword and the voice segment is obtained.

[0024] According to a method for detecting a speech keyword provided by the present invention, the calculating the average matching score of the best matching path according to the best matching path specifically includes:

[0025] Obtaining the number of frames corresponding to the best matching path;

[0026] Calculating the cumulative value of the correlation between each syllable and each frame of speech vector in the best matching path;

[0027] The accumulated value is divided by the number of frames to obtain an average matching score of the best matching path.

[0028] A method for detecting a speech keyword provided by the present invention further includes:

[0029] If the matching probability is less than the preset threshold, it is determined that the target keyword is not included in the voice segment.

[0030] The present invention also provides a device for detecting a speech keyword, comprising:

[0031] An acquisition module, used to acquire a speech segment to be detected and a target keyword, wherein the speech segment is a sequence including multiple frames of speech vectors, and the target keyword is a sequence including multiple syllables;

[0032] A first calculation module is used to extract the speech feature of each syllable based on each syllable and the speech segment, calculate the correlation between each syllable and the speech segment according to the speech feature of each syllable and the basic speech pattern of each syllable, and obtain the correlation matrix between the target keyword and the speech segment;

[0033] A second calculation module, used for searching the best matching path between the target keyword and the voice segment based on the correlation matrix, so as to calculate the matching probability between the target keyword and the voice segment;

[0034] The result determination module determines that the target keyword is included in the voice segment if the matching probability is greater than or equal to a preset threshold.

[0035] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, a method for detecting a voice keyword as described above is implemented.

[0036] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the method for detecting a voice keyword as described in any one of the above is implemented.

[0037] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the method for detecting a voice keyword as described above is implemented.

[0038] The present invention provides a method, device, electronic device and readable storage medium for detecting speech keywords. The detection method comprises the following steps: obtaining a speech segment to be detected and a target keyword, wherein the speech segment is a sequence including multiple frames of speech vectors, and the target keyword is a sequence including multiple syllables;

[0039] Based on each syllable and speech segment, the speech feature of each syllable is extracted, and the correlation between each syllable and the speech segment is calculated according to the speech feature of each syllable and the basic speech pattern of each syllable, so as to obtain the correlation matrix between the target keyword and the speech segment;

[0040] Searching for the best matching path between the target keyword and the voice segment based on the correlation matrix, thereby calculating the matching probability between the target keyword and the voice segment;

[0041] If the matching probability is greater than or equal to the preset threshold, it is determined that the target keyword is included in the speech segment. According to the above steps, it is determined that the speech segment to be detected includes the target keyword. The scheme proposed by the present invention learns the mask of each syllable and "captures" the corresponding spectral component from the speech segment through the mask. Therefore, even if there is noise interference or even pronunciation aliasing, the target keyword can still be captured from it, and the anti-interference ability is strong. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0043] Figure 1 This is one of the flow charts of the method for detecting speech keywords provided by the present invention;

[0044] Figure 2 This is the second flow chart of the method for detecting speech keywords provided by the present invention;

[0045] Figure 3 This is a third flow chart of the method for detecting speech keywords provided by the present invention;

[0046] Figure 4 This is a fourth flow chart of the method for detecting speech keywords provided by the present invention;

[0047] Figure 5 It is a structural schematic diagram of a device for detecting speech keywords provided by the present invention;

[0048] Figure 6 is a schematic diagram of the structure of an electronic device provided by the present invention;

[0049] Figure 7 A schematic diagram of masking a speech segment provided by the present invention. DETAILED DESCRIPTION

[0050] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0051] Combine the following Figure 1-Figure 4 The present invention describes the method for detecting speech keywords.

[0052] Figure 1 This is one of the flow charts of the method for detecting voice keywords provided by an embodiment of the present invention.

[0053] Compared with the defects in the prior art, the technical solution of the present invention does not limit specific keywords, and can accurately capture target keywords in the face of noise interference and pronunciation aliasing in voice clips.

[0054] like Figure 1 As shown, an embodiment of the present invention provides a method for detecting a voice keyword, comprising the following steps:

[0055] 101. Obtain a speech segment X to be detected and a target keyword Q. The speech segment X is a sequence of t-frame speech vectors x, that is, X = [x1, x2…, x t ], the target keyword Q is a sequence of n syllables q, that is, Q = [q1, q2..., q n ], where t and n are both positive integers.

[0056] First, a fixed-length speech segment X containing t-frame speech vectors x is given, and the fixed-length speech segment X = [x1, x2…, x t ], which may be extracted from voice clips to be used for voice wake-up and voice commands in the field of smart home appliances, voice clips in live video, or voice clips in multimedia data archives. In the present invention, the logarithmic power spectrum (LPS) of each frame is used as the voice vector x of the frame.

[0057] Given a target keyword Q, any target keyword Q can be decomposed into a sequence containing syllables q, that is, Q = [q1, q2..., q n ] A syllable is the unit that constitutes a speech sequence and is also the most natural unit of speech structure.

[0058] The purpose of the present invention is to detect whether a speech segment X includes a target keyword Q.

[0059] 102. Based on each syllable q and speech fragment X, the speech features of each syllable q are extracted, and the correlation between each syllable q and the speech fragment X is calculated according to the speech features of each syllable q and the basic speech pattern b(q) of each syllable q, so as to obtain the correlation matrix between the target keyword Q and the speech fragment X.

[0060] 103. Based on the correlation matrix R, the best matching path p between the target keyword Q and the speech segment X is searched, thereby calculating the matching probability between the target keyword Q and the speech segment X. That is, the correlation between the frame speech vector x and the syllable q is obtained by comparing the basic speech patterns b(q) based on v and q. Finally, the temporal relationship between x and q is considered, and the optimal matching path is solved by using a dynamic programming algorithm.

[0061] 104. If the matching probability is greater than or equal to a preset threshold, it is determined that the target keyword Q is included in the voice segment X. Meanwhile, if the matching probability is less than the preset threshold, it is determined that the target keyword Q is not included in the voice segment X.

[0062] Specifically, Figure 2 As shown, the process of extracting the speech features of each syllable q in the target keyword in step 102 includes the following steps:

[0063] 201. Obtain the masking pattern m(q) of each syllable q.

[0064] 202. Mask each frame of speech vector x in the speech segment X based on the masking pattern m(q) of each syllable q.

[0065] 203. Extract the speech features corresponding to each syllable q.

[0066] Among them, the speech feature v=m(q)⊙X of each syllable q, that is, the mask pattern of each syllable q is multiplied with each frame of speech vector, and ⊙ represents the Hadamard product.

[0067] Further, such as Figure 7 As shown, in the present invention, for a syllable q in a speech segment X, the position of syllable q in the speech segment is obtained by alignment, and a mask is added to the speech segment outside this position, that is, the speech segment is masked. For example, for syllable A in the figure below, all positions outside A are added as masks.

[0068] Specifically, for the original signal x[APPLE]; x mask = x ·

[01000] where 1 is located at the position of syllable P; by dot multiplication, x mask =[0P000].

[0069] The above description is at the signal level, and the actual mask operation is at the feature level, such as extracting the mfcc / fbank features of signal x and then performing the mask.

[0070] Specifically, the present invention proposes a keyword processing method called "phonetic carving", the core idea of ​​which is to learn the pronunciation characteristics of each syllable q (or phoneme) in a specific context, and formalize this pronunciation feature into a mask pattern m(q).

[0071] Speech carving defines a mask m(q) for each syllable q (or context-related syllable). This mask m(q) is learned through, but not limited to, a neural network. m(q) is the carving knife in the speech carving mentioned above. It carves the syllable q of interest from the confused audio, focusing only on the characteristics of syllable q, while the characteristics of other syllables are masked. The mask m(q) is used to extract the speech features related to each syllable q from each frame of speech vector x in the original speech segment X.

[0072] Based on m(q), the input speech segment X is masked and the speech feature v corresponding to q is extracted. Specifically, m(q) is a one-dimensional vector with the same length as x, and each element is between 0 and 1. The speech feature extraction process is as follows (this speech feature is the feature obtained by syllable q on speech segment X):

[0073] v q =m(q)⊙X (1)

[0074] Where ⊙ represents element-wise multiplication. The formula specifically expresses that the speech feature of a single syllable q is the product of the mask m(q) of the syllable q and the speech vector x of each frame in the speech segment X.

[0075] Further, such as Figure 3 As shown, in step 102, the correlation between each syllable q and the speech segment X is calculated according to the speech features of each syllable q and the basic speech pattern b(q) of each syllable q, and the correlation matrix between the target keyword Q and the speech segment X is obtained, which specifically includes the following steps:

[0076] 301. Obtain a basic speech model b(q) for each syllable q. Specifically, define a basic speech model b(q) for each syllable q (this basic speech model can be understood as a word vector of the syllable q).

[0077] In the present invention, the correlation between the speech segment X and each syllable q is defined as the speech feature v of the syllable q The correlation r between the syllable and the basic speech pattern b(q) of the syllable. This correlation r can be calculated by a simple dot product or a more complex neural network. In step 302, the dot product measurement is used as an example.

[0078] 302. Perform a dot product operation between the basic speech pattern b(q) of the single syllable q and the speech feature v of the single syllable q and the speech segment X to obtain a correlation r between the single syllable q and the speech segment X.

[0079] The formula is as follows:

[0080] r=b(q)v q (2)

[0081] 303. Calculate the correlation between each syllable q and the speech segment X to obtain a correlation matrix R between the target keyword Q and the speech segment X. Specifically, considering that there are n syllables in Q, a speech segment X-keyword Q correlation matrix R can be calculated for XQ:

[0082] R=b(Q)v(Q) (3)

[0083] Among them, b(Q) represents the basic speech pattern of each syllable in the target keyword Q, and v(Q) represents the speech features of each syllable in the target keyword Q and each frame of the speech vector x in the speech segment X.

[0084] The following table gives an example of the correlation matrix R of a speech segment X-keyword Q, where there are 4 frames of speech in the speech segment X, and there are 3 syllables A, B, and C in the corresponding keyword Q. The value in each element of the table represents the corresponding correlation r.

[0085] Table 1: Example of a phonetic-syllable correlation matrix

[0086]

[0087] In step 103, the optimal path p is first defined to satisfy the following constraints: (1) p must start from q1 and end from q n Completed; (2) The speech frame number (1, 2…t) corresponding to each step of p must increase, and the phoneme number (1, 2…n) cannot decrease. |p| is the length of path p. Note that because Q may be contained in a sub-segment of X, p may not enter from the first speech frame, nor may it be completed from the tth speech frame. Therefore, n≤|p|≤t.

[0088] In order to determine p, a sequential search algorithm is used. First, the path expansion on the syllable is started only when the correlation r reaches a certain level continuously, to ensure that the speech corresponding to the best matching path p does start with q1; second, the Viterbi algorithm is used in the search to ensure the search efficiency; third, at the end of the search, all the syllables starting with q1 must be searched. n Select from the ending paths to obtain the optimal match p and its corresponding optimal average path matching value s.

[0089] Further, such as Figure 4 As shown, the average matching score s of the best matching path is calculated according to the best matching path p, which specifically includes the following steps:

[0090] 401. Obtain the number of frames |p| corresponding to the best matching path p;

[0091] 402. Calculate the cumulative value R of the correlation r corresponding to each syllable q in the best matching path p and each frame speech vector x p ;

[0092] 403. Accumulated value R p Divide by the number of frames |p| to get the average matching score s of the best matching path p.

[0093] Given a speech-syllable correlation matrix R, we can search for a best matching path p in it and calculate the average matching score s=R of the best matching path. p / |p|.

[0094] For example, the gray cell in Table 1 is the best path p in the correlation matrix. The number of frames corresponding to the best matching path p is |p|=4. The cumulative value of the correlation r corresponding to each syllable q and each frame speech vector x is R. p =0.8+0.7+0.8+0.7=3, average matching score s=R p / |p|=0.75.

[0095] Further, the matching probability between the target keyword Q and the voice segment X is calculated, specifically: the average matching score of the best matching path is calculated according to the best matching path;

[0096] According to the average matching score s, the matching probability between the target keyword Q and the voice segment X is obtained.

[0097] Based on the score s, we can make a decision on the existence of keyword Q. When training, we use end-to-end training. The model outputs s, which is normalized by the Sigmoid function to obtain the matching probability of X and Q p(1|X,R)=sigmoid(s). The goal of training is to make p(1|X,R) close to 1 for positive samples and close to 0 for negative samples, so we use the cross entropy criterion for training.

[0098] In actual training, a large number of positive and negative samples need to be produced. These samples can be randomly generated based on any speech recognition database: if you choose a text corresponding to a speech segment, you get a positive example, and if you choose a random text, you get a negative example. Therefore, the model can be trained based on an existing speech database without having to collect additional data for specific keywords.

[0099] The present invention is based on a neural network model. The neural network is used to extract speech features from X, calculate the mask m(q) and the basic pattern b(q) of the syllable q, and calculate a more complex correlation r. The present invention does not limit the structure of the neural network, and a fully connected neural network or a convolutional neural network can be applied.

[0100] The technical solution of the present invention has the following advantages:

[0101] First: Freely replace keywords. The solution proposed by the present invention is independent of specific keywords. The model learns the pronunciation characteristics of each syllable, and any keyword can be disassembled into a syllable sequence. Therefore, the solution can be quickly applied to any keyword without retraining.

[0102] Second: Strong anti-interference ability. The solution proposed by the present invention learns the mask of each syllable and "grabs" the corresponding spectral components from the speech through the mask. Therefore, even if there is noise interference or even pronunciation aliasing, the target keyword can still be captured.

[0103] A voice keyword detection device provided by the present invention is described below. The voice keyword detection device described below and the voice keyword detection method described above can refer to each other.

[0104] Figure 5 It is a structural schematic diagram of a voice keyword detection device provided by an embodiment of the present invention.

[0105] like Figure 5 As shown, the embodiment of the present invention provides a device for detecting a speech keyword, comprising the following modules: an acquisition module 51 , a first calculation module 52 , a second calculation module 53 and a result determination module 54 .

[0106] Specifically, the acquisition module 51 is used to acquire the speech segment X to be detected and the target keyword Q, where the speech segment X is a sequence of t-frame speech vectors x, that is, X = [x1, x2…, x t ], the target keyword Q is a sequence of n syllables q, that is, Q = [q1, q2..., q n ], where t and n are both positive integers.

[0107] The first calculation module 52 is used to extract the speech features of each syllable q based on each syllable q and the speech segment X, calculate the correlation between each syllable q and the speech segment X according to the speech features of each syllable q and the basic speech pattern b(q) of each syllable q, and obtain the correlation matrix between the target keyword Q and the speech segment X.

[0108] The second calculation module 53 is used to search for the best matching path between the target keyword Q and the speech segment X based on the correlation matrix, so as to calculate the matching probability between the target keyword Q and the speech segment X.

[0109] If the matching probability is greater than or equal to the preset threshold, the result determination module 54 determines that the speech segment X includes the target keyword Q.

[0110] Figure 6 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 6 As shown, the electronic device may include: a processor 610, a communication interface 620, a memory 630 and a communication bus 640, wherein the processor 610, the communication interface 620 and the memory 630 communicate with each other through the communication bus 640. The processor 610 may call the logic instructions in the memory 630 to execute a method for detecting a voice keyword, the method comprising the following steps:

[0111] Get the speech segment X to be detected and the target keyword Q, where the speech segment X is a sequence of t-frame speech vectors x, that is, X = [x1, x2…, x t ], the target keyword Q is a sequence of n syllables q, that is, Q = [q1, q2..., q n ], where t and n are both positive integers;

[0112] Based on each syllable q and speech segment X, the speech features of each syllable q are extracted, and the correlation between each syllable q and the speech segment X is calculated according to the speech features of each syllable q and the basic speech pattern b(q) of each syllable q, so as to obtain the correlation matrix between the target keyword Q and the speech segment X;

[0113] Searching for the best matching path between the target keyword Q and the voice segment X based on the correlation matrix, thereby calculating the matching probability between the target keyword Q and the voice segment X;

[0114] If the matching probability is greater than or equal to the preset threshold, it is determined that the target keyword Q is included in the speech segment X.

[0115] In addition, the logic instructions in the above-mentioned memory 630 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0116] On the other hand, the present invention further provides a computer program product, the computer program product includes a computer program, the computer program can be stored in a non-transitory computer-readable storage medium, when the computer program is executed by a processor, the computer can perform a method for detecting a voice keyword provided by the above methods, the method comprising the following steps:

[0117] Get the speech segment X to be detected and the target keyword Q, where the speech segment X is a sequence of t-frame speech vectors x, that is, X = [x1, x2…, x t ], the target keyword Q is a sequence of n syllables q, that is, Q = [q1, q2..., q n ], where t and n are both positive integers;

[0118] Based on each syllable q and speech segment X, the speech features of each syllable q are extracted, and the correlation between each syllable q and the speech segment X is calculated according to the speech features of each syllable q and the basic speech pattern b(q) of each syllable q, so as to obtain the correlation matrix between the target keyword Q and the speech segment X;

[0119] Searching for the best matching path between the target keyword Q and the voice segment X based on the correlation matrix, thereby calculating the matching probability between the target keyword Q and the voice segment X;

[0120] If the matching probability is greater than or equal to the preset threshold, it is determined that the target keyword Q is included in the speech segment X.

[0121] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the computer program is executed by a processor to perform a method for detecting a speech keyword provided by the above methods, the method comprising the following steps:

[0122] Get the speech segment X to be detected and the target keyword Q, where the speech segment X is a sequence of t-frame speech vectors x, that is, X = [x1, x2…, x t ], the target keyword Q is a sequence of n syllables q, that is, Q = [q1, q2..., q n ], where t and n are both positive integers;

[0123] Based on each syllable q and speech segment X, the speech features of each syllable q are extracted, and the correlation between each syllable q and the speech segment X is calculated according to the speech features of each syllable q and the basic speech pattern b(q) of each syllable q, so as to obtain the correlation matrix between the target keyword Q and the speech segment X;

[0124] Searching for the best matching path between the target keyword Q and the voice segment X based on the correlation matrix, thereby calculating the matching probability between the target keyword Q and the voice segment X;

[0125] If the matching probability is greater than or equal to the preset threshold, it is determined that the target keyword Q is included in the speech segment X.

[0126] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0127] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0128] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for detecting speech keywords, characterized in that: include: Acquire a speech segment to be detected and a target keyword, wherein the speech segment is a sequence including multiple frames of speech vectors, and the target keyword is a sequence including multiple syllables; Based on each of the syllables and the speech segment, extracting the speech feature of each of the syllables, calculating the correlation between each of the syllables and the speech segment according to the speech feature of each of the syllables and the basic speech pattern of each of the syllables, and obtaining a correlation matrix between the target keyword and the speech segment; Searching for the best matching path between the target keyword and the voice segment based on the relevance matrix, thereby calculating the matching probability between the target keyword and the voice segment; If the matching probability is greater than or equal to a preset threshold, it is determined that the target keyword is contained in the voice segment; Among them, a basic speech pattern is defined for each syllable, and the basic speech pattern is a word vector of this syllable.

2. The method for detecting speech keywords according to claim 1, characterized in that: The extracting the speech feature of each syllable based on each syllable and the speech segment specifically includes: obtaining a masking pattern for each of the syllables; Based on the masking mode of each syllable, masking the speech vector of each frame in the speech segment; The speech feature corresponding to each of the syllables is extracted.

3. The method for detecting speech keywords according to claim 2, characterized in that: The step of calculating the correlation between each syllable and the speech segment according to the speech feature of each syllable and the basic speech pattern of each syllable to obtain a correlation matrix between the target keyword and the speech segment specifically includes: Obtaining a basic speech pattern for each of the syllables; Performing a dot product operation between a basic speech pattern of a single syllable and speech features of the single syllable and the speech segment to obtain a correlation between the single syllable and the speech segment; The correlation between each of the syllables and the speech segment is calculated to obtain a correlation matrix between the target keyword and the speech segment.

4. The method for detecting speech keywords according to claim 1, characterized in that: The calculating of the matching probability between the target keyword and the voice segment is specifically as follows: Calculate the average matching score of the best matching path according to the best matching path; According to the average matching score, the matching probability between the target keyword and the voice segment is obtained.

5. The method for detecting speech keywords according to claim 4, characterized in that: Calculating the average matching score of the best matching path according to the best matching path specifically includes: Obtaining the number of frames corresponding to the best matching path; Calculating the cumulative value of the correlation between each syllable and each frame of speech vector in the best matching path; The accumulated value is divided by the number of frames to obtain an average matching score of the best matching path.

6. The method for detecting speech keywords according to claim 1, characterized in that: Also includes: If the matching probability is less than the preset threshold, it is determined that the target keyword is not included in the voice segment.

7. A device for detecting speech keywords, characterized in that: include: An acquisition module, used to acquire a speech segment to be detected and a target keyword, wherein the speech segment is a sequence including multiple frames of speech vectors, and the target keyword is a sequence including multiple syllables; A first calculation module is used to extract the speech feature of each syllable based on each syllable and the speech segment, calculate the correlation between each syllable and the speech segment according to the speech feature of each syllable and the basic speech pattern of each syllable, and obtain the correlation matrix between the target keyword and the speech segment; A second calculation module, used for searching the best matching path between the target keyword and the voice segment based on the correlation matrix, so as to calculate the matching probability between the target keyword and the voice segment; A result determination module, if the matching probability is greater than or equal to a preset threshold, determines that the target keyword is included in the voice segment; Among them, a basic speech pattern is defined for each syllable, and the basic speech pattern is a word vector of this syllable.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the method for detecting voice keywords according to any one of claims 1 to 6 is implemented.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for detecting a speech keyword as claimed in any one of claims 1 to 6 is implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method for detecting a speech keyword as claimed in any one of claims 1 to 6 is implemented.