Keyword detection method and apparatus, and storage medium and electronic device

Through the acoustic model, the speech frames are identified and decoded maps are constructed, and the efficiency and flexibility of keyword detection are achieved, solving the problems of low efficiency and large resource utilization in the prior art.

WO2025043987A1PCT designated stage expired Publication Date: 2025-03-06CHINA TELECOM CORP LTD
View PDF 10 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2023/140708
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-08-31
Filing Date
2023-12-21
Publication Date
2025-03-06

AI Technical Summary

Technical Problem

The existing keyword detection methods are low-efficiency, cannot change keywords in time, and have large resources, and output redundant information.

Method used

By obtaining the voice to be detected, using the acoustic model to identify multiple voice frames, a candidate decoded map is constructed, and the voice to be detected is detected based on the keyword decoded map to determine whether there are preset keywords.

Benefits of technology

Improves the efficiency and flexibility of keyword detection, reduces resource usage, can quickly respond to business needs, and update keywords without retraining the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023140708_06032025_PF_FP_ABST
    Figure CN2023140708_06032025_PF_FP_ABST
Patent Text Reader

Abstract

A keyword detection method and apparatus, and a storage medium and an electronic device. The method comprises: acquiring speech on which detection is to be performed, wherein said speech comprises a plurality of speech frames (S102); using an acoustic model to recognize the plurality of speech frames, so as to obtain speech recognition results of different speech frames (S104), wherein the speech recognition results are configured to represent the probability of recognizing at least one syllable corresponding to the different speech frames; constructing a candidate decoding graph on the basis of the speech recognition results and the plurality of speech frames (S106), wherein the candidate decoding graph includes a plurality of nodes, and edges connected between the plurality of nodes; and performing detection on said speech on the basis of a keyword decoding graph and the candidate decoding graph, so as to obtain a detection result (S108), wherein the keyword decoding graph is constructed on the basis of at least one preset keyword, and the detection result is configured to indicate whether there is a preset keyword in said speech. The technical problem in the related art of the efficiency of detecting keywords being relatively low is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Keyword detection method, device, storage medium and electronic device

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] The present disclosure is based on and claims priority to an application with CN application number 202311121475.1 and filing date August 31, 2023. The disclosure content of the CN application is hereby incorporated into the present disclosure as a whole. Technical Field

[0003] The present disclosure relates to the field of keyword detection, and in particular to a keyword detection method, device, storage medium, and electronic device. Background Art

[0004] Currently, most keyword detection methods in the industry can only detect a fixed number of keywords. When encountering task adjustments, keywords cannot be replaced in time, and the model can only be retrained and debugged, which will result in a lot of time and energy being spent on matching business needs. Another way is to learn from the speech recognition system, which can output the transcribed content of all audio and then extract the corresponding keywords from all the transcribed content. However, this method has obvious disadvantages. First, it requires more resource instances and memory to ensure the operation of the entire system. Second, due to the low frequency of keywords, outputting all transcribed content is very redundant for keyword detection. In summary, the current method has low efficiency for keyword detection.

[0005] To address the above-mentioned problems, no effective solutions have been proposed so far.

[0006] Summary of the Invention

[0007] According to one aspect of an embodiment of the present disclosure, a keyword detection method is provided, comprising: obtaining a speech to be detected, wherein the speech to be detected includes a plurality of speech frames; recognizing the plurality of speech frames using an acoustic model to obtain speech recognition results of different speech frames, wherein the speech recognition results are used to characterize the recognition probability of at least one syllable corresponding to different speech frames; constructing a candidate decoding graph based on the speech recognition results and the plurality of speech frames, wherein the candidate decoding graph comprises a plurality of nodes and edges connecting the plurality of nodes, the plurality of nodes correspond one-to-one to the plurality of speech frames, and the edges are used to represent the speech recognition results; detecting the speech to be detected based on the keyword decoding graph and the candidate decoding graph to obtain a detection result, wherein the keyword decoding graph is constructed based on at least one preset keyword, and the detection result is used to indicate whether the speech to be detected contains the preset keyword.

[0008] In some embodiments, the speech to be detected is detected based on the keyword decoding graph and the candidate decoding graph to obtain a detection result, including: merging the keyword decoding graph and the candidate decoding graph to obtain a merged decoding graph; traversing the merged decoding graph to obtain a traversal result, wherein the traversal result is used to indicate whether the edge between any two nodes in the merged decoding graph contains a speech recognition result; in response to the edge between any two nodes in the merged decoding graph containing a speech recognition result, determining that the detection result is that a preset keyword exists in multiple speech frames; in response to the edges between all nodes in the merged decoding graph not containing a speech recognition result, determining that the detection result is that the preset keyword does not exist in multiple speech frames.

[0009] In some embodiments, a candidate decoding graph is constructed based on speech recognition results and multiple speech frames, including: obtaining extraction times of multiple speech frames; constructing a candidate decoding graph based on speech recognition results, extraction times and multiple speech frames, wherein edges are used to represent speech recognition results and extraction times.

[0010] In some embodiments, the method further includes: in response to the detection result indicating that the to-be-detected speech contains preset keywords, extracting the preset keywords from the combined decoding graph based on the speech recognition result.

[0011] In some embodiments, when there are multiple preset keywords, the method also includes: obtaining the weight value corresponding to the preset keyword in the merged decoding graph, wherein the weight value is used to characterize the recognition probability of the syllable corresponding to the preset keyword; determining the preset keyword corresponding to the target weight value from multiple preset keywords based on multiple weight values, wherein the target weight value is the largest weight value among the multiple weight values.

[0012] In some embodiments, the method further includes: determining a starting speech frame and an ending speech frame of the preset keyword from the plurality of speech frames based on the extraction time.

[0013] In some embodiments, the acoustic model is trained based on sample speech and sample syllables.

[0014] According to another aspect of an embodiment of the present disclosure, a keyword detection device is also provided, including: an acquisition module for acquiring a speech to be detected, wherein the speech to be detected includes multiple speech frames; a recognition module for using an acoustic model to recognize the multiple speech frames to obtain speech recognition results of different speech frames, wherein the speech recognition result includes at least one syllable and the probability of outputting at least one syllable; a construction module for constructing a candidate decoding graph based on the speech recognition result and the multiple speech frames, wherein the candidate decoding graph includes multiple nodes and edges connecting the multiple nodes, the multiple nodes correspond one-to-one to the multiple speech frames, and the output of the edges is used to represent the speech recognition result; a detection module for detecting the speech to be detected based on the keyword decoding graph and the candidate decoding graph to obtain a detection result, wherein the keyword decoding graph is constructed based on at least one preset keyword, and the detection result is used to indicate whether the preset keyword exists in the speech to be detected.

[0015] According to another aspect of the embodiments of the present disclosure, a computer-readable storage medium is further provided. The computer-readable storage medium includes a stored program, wherein when the program is run, the processor of the device where the program is located is controlled to execute the keyword detection method of any one of the above embodiments.

[0016] According to another aspect of the embodiments of the present disclosure, an electronic device is also provided, including: one or more processors; a storage device for storing one or more programs; when the one or more programs are executed by one or more processors, the one or more processors execute the keyword detection method of any one of the above embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The drawings described herein are used to provide a further understanding of the present disclosure and constitute a part of the present disclosure. The exemplary embodiments of the present disclosure and their descriptions are used to explain the present disclosure and do not constitute an improper limitation of the present disclosure. In the drawings:

[0018] FIG1 is a flow chart of a keyword detection method according to an embodiment of the present disclosure;

[0019] FIG2 is a structural diagram of an acoustic model according to an embodiment of the present disclosure;

[0020] FIG3 is a schematic diagram of a candidate decoding graph according to an embodiment of the present disclosure;

[0021] FIG4 is a schematic diagram of a keyword decoding diagram according to an embodiment of the present disclosure;

[0022] FIG5 is a schematic diagram of a merged decoding diagram according to an embodiment of the present disclosure;

[0023] FIG6 is a schematic diagram of a keyword detection device according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0024] In order to enable those skilled in the art to better understand the solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the embodiments described are only part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments of the present disclosure, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present disclosure.

[0025] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0026] The embodiments of the present disclosure provide a keyword detection method, apparatus, storage medium, and electronic device to at least solve the technical problem of low efficiency in keyword detection in related technologies.

[0027] In an embodiment of the present disclosure, a speech to be detected is first obtained, wherein the speech to be detected includes multiple speech frames, and the multiple speech frames are recognized using an acoustic model to obtain speech recognition results of different speech frames, wherein the speech recognition results are used to characterize the recognition probability of at least one syllable corresponding to different speech frames; a candidate decoding graph is constructed based on the speech recognition results and the multiple speech frames, wherein the candidate decoding graph includes multiple nodes and edges connecting the multiple nodes, the multiple nodes correspond one-to-one to the multiple speech frames, and the edges are used to represent the speech recognition results; the speech to be detected is detected based on the keyword decoding graph and the candidate decoding graph to obtain a detection result, wherein the keyword decoding graph is constructed based on at least one preset keyword, and the detection result is used to indicate whether the speech to be detected contains the preset keyword, thereby improving the detection efficiency of the keyword; it is easy to notice that the keyword decoding graph and the candidate decoding graph constructed based on at least one preset keyword can be used to determine whether the candidate decoding graph contains the preset keyword. Since the keyword decoding graph can be adjusted by the user according to the task requirements, Therefore, after the keyword is updated, the new keyword decoding graph and candidate decoding graph can be used to determine whether there is a preset keyword in the candidate decoding graph. By constructing a keyword decoding graph, the flexibility of keyword detection for the detected speech can be greatly improved. The keyword replacement can be completed simply by replacing the keyword decoding graph, and the resource usage is small, thereby improving the efficiency of keyword detection, and thus solving the technical problem of low efficiency of keyword detection in related technologies.

[0028] Example 1

[0029] According to an embodiment of the present disclosure, an embodiment of a keyword detection method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0030] FIG1 is a flow chart of a keyword detection method according to an embodiment of the present disclosure. As shown in FIG1 , the method includes the following steps:

[0031] Step S102: Acquire the speech to be detected, where the speech to be detected includes a plurality of speech frames.

[0032] The aforementioned speech to be detected may be a speech to be detected for whether a keyword is present.

[0033] The above-mentioned speech to be detected may include a plurality of speech frames that are continuous in time.

[0034] In some embodiments, after the speech to be detected is acquired, multiple speech frames in the speech to be detected may be preprocessed, thereby improving the availability of the multiple speech frames.

[0035] In other embodiments, the voice information of the target object can be monitored in real time. When the target object is detected to output voice, the current voice of the target object can be obtained and preprocessed based on the current voice to obtain the voice to be detected.

[0036] Step S104: using the acoustic model to recognize multiple speech frames to obtain speech recognition results of different speech frames.

[0037] The speech recognition result is used to represent the recognition probability of at least one syllable corresponding to different speech frames.

[0038] The above-mentioned acoustic models can be used to process feature extraction and modeling of sound signals. Among them, acoustic models can include Gaussian mixture models, hidden Markov models, deep neural networks, and convolutional neural networks.

[0039] In some embodiments, an acoustic model can be used to extract features of the speech to be detected to obtain acoustic features corresponding to multiple speech frames, where the acoustic features can be spectral features (fbank) of the speech signal, but are not limited thereto and can be other types of acoustic features.

[0040] The above-mentioned speech recognition result can be used to represent the recognition probability of at least one syllable obtained by recognizing different speech frames, wherein the recognition probability of at least one syllable is used to represent the probability of the speech frame containing the syllable.

[0041] In some embodiments, a deep neural network can be used to recognize multiple speech frames to obtain recognition results of different speech frames. The model can adopt an end-to-end modeling method when modeling, thereby eliminating the traditional speech recognition alignment step, and the speech recognition effect is higher. In the present disclosure, the modeling unit in the original acoustic model can be changed from word-based modeling to syllable-based modeling, which can reduce the number of model outputs, which is beneficial to reducing the size of the generated decoding graph in subsequent steps, thereby improving the recall rate of keywords.

[0042] Figure 2 is a diagram of an acoustic model structure according to an embodiment of the present disclosure. As shown in Figure 2, multiple input speech frames can be subjected to spectrum enhancement (Spec Aug), convolution subsampling (Convolution Subsampling), linear processing (Linear), random dropout (Dropout), and speech feature extraction modules (Conformer Blocks). The speech feature extraction module can include a feed forward module (Feed Forward Module), a multi-head self attention module (Multi-Head Self Attention Module), a convolution module (Convolution Module), and a layer normalization module (Layer Norm).

[0043] Among them, spectrum enhancement is a data enhancement technology used for speech recognition tasks. It increases the diversity of training data by randomly transforming the speech spectrum. The specific processing principles include time and frequency masking and spectrum warping. Convolution downsampling is a basic module in the acoustic model, mainly used to extract local features of the speech signal. This module uses convolution operations to process input features and reduces the dimension of the features through downsampling operations. The linear layer is a basic module in the acoustic model and is mainly used for linear transformation. This module usually contains a weight matrix and a bias vector, which can map the input features to a new feature space. Random dropout is a commonly used regularization technique used to reduce overfitting in acoustic models. During the training process, this module randomly sets the output of some neurons to zero to reduce the dependency between neurons and increase the robustness of the model. The speech feature extraction module is a basic module in the acoustic model. It is a module that combines a convolutional neural network (CNN) and a self-attention mechanism. It is mainly used to extract the global features of speech signals and perform feature conversion and dimensionality reduction through operations such as position encoding and multi-layer perceptron.

[0044] The feedforward module in the speech feature extraction module is used to perform nonlinear transformation on the input speech signal; the multi-head self-attention module is used to capture the global dependencies of the input speech signal; the convolution module is used to extract the local features of the input speech signal; and the layer normalization module is used to normalize the input to solve the problems of gradient disappearance and gradient explosion in neural network training.

[0045] In the above embodiments of the present disclosure, the acoustic model is trained based on sample speech and sample syllables.

[0046] In some embodiments, training can be performed using sample speech and sample syllables so that the acoustic model can reduce the number of outputs, which is beneficial for reducing the size of the generated decoding graph.

[0047] Step S106: construct a candidate decoding graph based on the speech recognition result and multiple speech frames.

[0048] The candidate decoding graph includes: multiple nodes and edges connecting the multiple nodes, the multiple nodes correspond one-to-one to the multiple speech frames, and the edges are used to represent the speech recognition results.

[0049] The above-mentioned multiple nodes are connected according to the time sequence of multiple voice frames.

[0050] There may be one or more edges between any two of the above nodes. If there is one edge, it means that only the speech recognition result of one syllable is output. If there are multiple edges, it means that the speech recognition results of multiple syllables are output.

[0051] In some embodiments, the speech recognition results may be used as edges and the speech frames may be used as nodes to construct a candidate decoding graph, so that the recognition status of multiple speech frames in the speech to be detected can be viewed through the candidate decoding graph.

[0052] Step S108: Detect the speech to be detected based on the keyword decoding graph and the candidate decoding graph to obtain a detection result.

[0053] The keyword decoding graph is constructed based on at least one preset keyword, and the detection result is used to indicate whether the voice to be detected contains the preset keyword.

[0054] The above-mentioned preset keywords can be pre-set keywords that need to be detected, wherein the preset keywords can be illegal words, sensitive words, and words of focus. The preset keywords here can be set according to user needs, and there is no limitation on the preset keywords here.

[0055] In some embodiments, the intersection between the keyword decoding graph and the candidate decoding graph can be obtained to determine whether there is a preset keyword in the speech to be detected. If the keyword decoding graph and the candidate decoding graph contain the same words, it means that there is a preset keyword in the speech to be detected; if the keyword decoding graph and the candidate decoding graph do not contain the same words, it means that there is no preset keyword in the speech to be detected.

[0056] In other embodiments, if the preset keywords need to be updated, a keyword decoding graph can be constructed based on the updated preset keywords, so that the keyword decoding graph and the candidate decoding graph can be used to detect whether the updated preset keywords are present in the speech to be detected. In this way, the keywords can be updated flexibly and quickly, thereby improving the efficiency of keyword detection.

[0057] Through the above steps, firstly, the speech to be detected is obtained, wherein the speech to be detected includes multiple speech frames, and the multiple speech frames are recognized by using an acoustic model to obtain speech recognition results of different speech frames, wherein the speech recognition results are used to characterize the recognition probability of at least one syllable corresponding to different speech frames; a candidate decoding graph is constructed based on the speech recognition results and multiple speech frames, wherein the candidate decoding graph includes multiple nodes and edges connecting the multiple nodes, the multiple nodes correspond one-to-one to the multiple speech frames, and the edges are used to represent the speech recognition results; the speech to be detected is detected based on the keyword decoding graph and the candidate decoding graph to obtain a detection result, wherein the keyword decoding graph is constructed based on at least one preset keyword, and the detection result is used to indicate whether the speech to be detected has the preset keyword, thereby realizing Improve the efficiency of keyword detection; it is easy to notice that the keyword decoding graph and the candidate decoding graph constructed according to at least one preset keyword can be used to determine whether the preset keyword exists in the candidate decoding graph. Since the keyword decoding graph can be adjusted by the user according to the task requirements, after the keyword is updated, the new keyword decoding graph and the candidate decoding graph can be used to determine whether the preset keyword exists in the candidate decoding graph. By constructing the keyword decoding graph, the flexibility of keyword detection for the speech to be detected can be greatly improved. The replacement of keywords can be completed only by replacing the keyword decoding graph, and the resource usage is small, thereby improving the efficiency of keyword detection, and thus solving the technical problem of low efficiency of keyword detection in related technologies.

[0058] In the above-mentioned embodiment of the present disclosure, the speech to be detected is detected based on the keyword decoding graph and the candidate decoding graph to obtain a detection result, including: merging the keyword decoding graph and the candidate decoding graph to obtain a merged decoding graph; traversing the merged decoding graph to obtain a traversal result, wherein the traversal result is used to indicate whether the edge between any two nodes in the merged decoding graph contains a speech recognition result; in response to the edge between any two nodes in the merged decoding graph containing a speech recognition result, determining that the detection result is that a preset keyword exists in multiple speech frames; in response to the edges between all nodes in the merged decoding graph not containing a speech recognition result, determining that the detection result is that the preset keyword does not exist in multiple speech frames.

[0059] The above merging uses the finite state transcriber merging operation (WFST Compose), where WFST Compose is used to merge two decoding graphs into a new decoding graph.

[0060] In some embodiments, WFST Compose may be performed on the keyword decoding graph and the candidate decoding graph to obtain a merged decoding graph. Here, the above merging may be understood as intersecting the keyword decoding graph and the candidate decoding graph.

[0061] In other embodiments, the merged decoding graph may be traversed to obtain traversal results. Based on the traversal results, it can be determined whether a path consisting of edges containing speech recognition results exists. If such a path exists, it indicates that the preset keyword exists in multiple speech frames. If such a path does not exist, it indicates that the preset keyword does not exist in multiple speech frames. It should be noted that if multiple paths exist, the preset keyword can be determined based on the path corresponding to the edge with the highest syllable recognition probability in the speech recognition results.

[0062] Figure 3 is a schematic diagram of a candidate decoding graph according to an embodiment of the present disclosure. As shown in Figure 3, In represents the input of multiple speech frames, and Out represents the output of the recognition results of multiple speech frames. Nodes 2, 3, 4, 5, 6, 7, and 8 can correspond to a speech frame respectively, wherein the edge between node 2 and node 3 can be used to represent the probabilities corresponding to different syllables in the speech recognition results. For example, Jia / 0.87,3 is used to represent that the probability of the syllable being Jia is 0.87, and the probability of Jia is the largest. Then, the syllable Jia can be retained. The speech recognition results of other frames are similar and will not be elaborated here. Combining the speech recognition results of multiple speech frames, it can be seen that the speech recognition results in the speech to be detected include "Add me as a friend".

[0063] FIG4 is a schematic diagram of a keyword decoding diagram according to an embodiment of the present disclosure. As shown in FIG4 , the preset keyword may be “Add me as a friend” and the syllable corresponding to the preset keyword may be “jia_wo_hao_you”. It should be noted that in the keyword decoding diagram, in order to prevent false detection, a syllable may be added between two nodes. <blank>Node, if the preset keyword contained in the candidate decoding graph exists <blank>Nodes can be filtered out through the keyword decoding graph to avoid missing keyword detection.

[0064] Figure 5 is a schematic diagram of a merged decoding graph according to an embodiment of the present disclosure. As shown in Figure 5, by merging the keyword decoding graph and the candidate decoding graph, the intersection between the keyword decoding graph and the candidate decoding graph can be determined. Based on the intersection, it can be determined that the preset keyword contained in the speech to be detected is "jia_wo_hao_you".

[0065] In the above embodiments of the present disclosure, a candidate decoding graph is constructed based on speech recognition results and multiple speech frames, including: obtaining extraction times of multiple speech frames; and constructing a candidate decoding graph based on the speech recognition results, extraction times, and multiple speech frames, wherein edges are used to represent speech recognition results and extraction times.

[0066] In some embodiments, the above-mentioned extraction time can be the time for extracting multiple speech frames from the speech to be detected. Generally, multiple speech frames in the speech to be detected are arranged based on time sequence. Therefore, the extraction time of multiple speech frames can also be used to represent the output time sequence of multiple speech frames.

[0067] In other embodiments, when constructing a candidate decoding graph, the connection order of nodes corresponding to multiple speech frames can be determined based on the extraction time, the speech recognition results can be represented by edges, and the nodes corresponding to multiple speech frames can be connected according to the extraction time.

[0068] In the above embodiment of the present disclosure, the method further includes: in response to the detection result indicating that the to-be-detected speech contains preset keywords, extracting the preset keywords from the combined decoding graph based on the speech recognition result.

[0069] In some embodiments, if the detection result shows that there are preset keywords in the voice to be detected, the preset keywords in the merged decoding graph can be extracted based on the voice recognition result. In some embodiments, the preset keywords can be extracted based on the connection paths between nodes in the merged decoding graph.

[0070] In the above embodiment of the present disclosure, when there are multiple preset keywords, the method also includes: obtaining the weight value corresponding to the preset keyword in the merged decoding diagram, wherein the weight value is used to characterize the recognition probability of the syllable corresponding to the preset keyword; and determining the preset keyword corresponding to the target weight value from multiple preset keywords based on multiple weight values, wherein the target weight value is the largest weight value among the multiple weight values.

[0071] In some embodiments, the weight values ​​corresponding to the preset keywords in the merged decoding graph can be obtained, and the preset keyword with the largest weight value can be determined from multiple preset keywords and extracted. As shown in Figure 5, if there are multiple paths to the preset keyword, the path with the largest weight value needs to be determined as the final preset keyword.

[0072] In the above embodiment of the present disclosure, the method further includes: determining a starting speech frame and an ending speech frame of the preset keyword from the plurality of speech frames based on the extraction time.

[0073] The above-mentioned starting speech frame is used to represent the speech frame output first among multiple speech frames, and the above-mentioned ending speech frame can be used to represent the speech frame output last.

[0074] The above extraction time can be represented by time frame information.

[0075] As shown in Figure 3, the edge between two nodes in the candidate decoding graph represents the syllable with the highest probability output by the acoustic model, with the weight being the corresponding probability of the syllable and its time frame. Taking the edge between states 3 and 4 as an example, wo represents the retained syllable wo, 0.70 represents the probability of wo output by the acoustic model is 0.70, and 4 represents the fourth frame. This is then merged with the keyword vocabulary decoding graph in Figure 4 to produce the merged decoding graph in Figure 5. Merging here can be understood as intersecting the two decoding graphs. Finally, traversing the merged decoding graph yields the path with the highest probability. This path, located on the edge between states 4 and 6, contains the output jia_wo_hao_you, representing the final keyword detection result, "Add me as a friend." Because this disclosure incorporates time frame information into the edges of the candidate decoding graph, the number of time frames can be output alongside the keyword result. In the example above, when "Add me as a friend" is output, the time frames 2_3_4_5_6_7_8 are also output, indicating that the keyword starts with speech frame 2 and ends with speech frame 8.

[0076] The keyword detection method provided by the present invention can improve detection efficiency and occupy less resources. In addition, there is no need to retrain the acoustic model. The keyword to be detected can be replaced by simply replacing the keyword decoding diagram to quickly respond to business needs.

[0077] The present invention can quickly update the keywords to be detected without retraining the model, and can also output the start and end time of the keywords at the same time when outputting the keywords. In order to demonstrate the effect achieved by the present invention, the following tests were conducted:

[0078] First, a test set is constructed. The test set can select 19 words with high frequency from the online data of the telephone scene, with about 150 audios for each word, totaling 2.2 hours. In addition, about 40 hours of audio without any keywords are selected as negative samples. The keywords are as follows: balance, recharge, number, package, broadband, staff, owner, set-top box, traffic, phone number, business hall, operator, phone fee, router. Through the keyword detection method disclosed in this invention, the recall rate achieved is 90.3% and the accuracy is 89.6%. The acoustic model in this invention has a model parameter amount reduced by about 70% compared to the speech recognition model, so it occupies less computing power resources.

[0079] Example 2

[0080] According to another aspect of the embodiments of the present disclosure, a keyword detection device is also provided. The device can execute the keyword detection method of the above embodiment. The specific implementation method and preferred application scenario are the same as those of the above embodiment and will not be repeated here.

[0081] FIG6 is a schematic diagram of a keyword detection device according to an embodiment of the present disclosure. As shown in FIG6 , the device includes: an acquisition module 602 , a recognition module 604 , a construction module 606 , and a detection module 608 .

[0082] Among them, the acquisition module is used to obtain the speech to be detected, wherein the speech to be detected includes multiple speech frames; the recognition module is used to use the acoustic model to recognize the multiple speech frames to obtain speech recognition results of different speech frames, wherein the speech recognition result includes at least one syllable and the probability of outputting at least one syllable; the construction module is used to construct a candidate decoding graph based on the speech recognition result and multiple speech frames, wherein the candidate decoding graph includes multiple nodes and edges connecting the multiple nodes, the multiple nodes correspond one-to-one to the multiple speech frames, and the output of the edges is used to represent the speech recognition result; the detection module is used to detect the speech to be detected based on the keyword decoding graph and the candidate decoding graph to obtain a detection result, wherein the keyword decoding graph is constructed based on at least one preset keyword, and the detection result is used to indicate whether the preset keyword exists in the speech to be detected.

[0083] In some embodiments, the detection module is also used to merge the keyword decoding graph and the candidate decoding graph to obtain a merged decoding graph, traverse the merged decoding graph to obtain a traversal result, wherein the traversal result is used to indicate whether the edge between any two nodes in the merged decoding graph contains a speech recognition result. In response to the edge between any two nodes in the merged decoding graph containing a speech recognition result, it is determined that the detection result is that there are preset keywords in multiple speech frames. In response to the edges between all nodes in the merged decoding graph not containing a speech recognition result, it is determined that the detection result is that there are no preset keywords in multiple speech frames.

[0084] In some embodiments, the construction module is further used to obtain the extraction time of multiple speech frames, and construct a candidate decoding graph based on the speech recognition result, the extraction time and multiple speech frames, wherein the edge is used to represent the speech recognition result and the extraction time.

[0085] In some embodiments, the apparatus further comprises: an extraction module.

[0086] The extraction module is configured to extract the preset keywords from the combined decoding graph based on the speech recognition result in response to a detection result indicating that the speech to be detected contains preset keywords.

[0087] In some embodiments, the apparatus further includes: a determination module.

[0088] Among them, the acquisition module is also used to obtain the weight value corresponding to the preset keyword in the merged decoding diagram, wherein the weight value is used to represent the recognition probability of the syllable corresponding to the preset keyword; the determination module is used to determine the preset keyword corresponding to the target weight value from multiple preset keywords based on multiple weight values, wherein the target weight value is the largest weight value among the multiple weight values.

[0089] In some embodiments, the determination module is further configured to determine a starting speech frame and an ending speech frame of the preset keyword from the plurality of speech frames based on the extraction time.

[0090] In some embodiments, the acoustic model is trained based on sample speech and sample syllables.

[0091] Example 3

[0092] According to another aspect of the embodiments of the present disclosure, a computer-readable storage medium is further provided. The computer-readable storage medium includes a stored program, wherein when the program is executed, a processor of a device is controlled to execute the keyword detection method of the above embodiment.

[0093] Example 4

[0094] According to another aspect of an embodiment of the present disclosure, an electronic device is also provided, including: one or more processors; a storage device for storing one or more programs; when the one or more programs are executed by one or more processors, the one or more processors execute the keyword detection method of the above embodiment.

[0095] The serial numbers of the above-mentioned embodiments of the present disclosure are for description only and do not represent the advantages or disadvantages of the embodiments.

[0096] In the above embodiments of the present disclosure, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0097] In the several embodiments provided in the present disclosure, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only exemplary. For example, the division of the units can be a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0098] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0099] In addition, the functional units in the various embodiments of the present disclosure may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0100] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or all or 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 enabling 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: various media that can store program codes, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.

[0101] The above is only a preferred embodiment of the present disclosure. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present disclosure. These improvements and modifications should also be regarded as within the scope of protection of the present disclosure.< / blank> < / blank>

Claims

1. A keyword detection method, comprising: Acquire a speech to be detected, wherein the speech to be detected includes a plurality of speech frames; Recognize the multiple speech frames using an acoustic model to obtain speech recognition results of different speech frames, wherein the speech recognition results are used to characterize the recognition probability of at least one syllable corresponding to the different speech frames; Constructing a candidate decoding graph based on the speech recognition result and the multiple speech frames, wherein the candidate decoding graph comprises: multiple nodes and edges connecting the multiple nodes, the multiple nodes correspond to the multiple speech frames one by one, and the edges are used to represent the speech recognition result; The speech to be detected is detected based on the keyword decoding graph and the candidate decoding graph to obtain a detection result, wherein the keyword decoding graph is constructed based on at least one preset keyword, and the detection result is used to indicate whether the preset keyword exists in the speech to be detected.

2. The keyword detection method according to claim 1, detecting the to-be-detected speech based on the keyword decoding graph and the candidate decoding graph to obtain a detection result, comprising: Merging the keyword decoding graph and the candidate decoding graph to obtain a merged decoding graph; Traversing the merged decoding graph to obtain a traversal result, wherein the traversal result is used to indicate whether an edge between any two nodes in the merged decoding graph contains the speech recognition result; In response to an edge between any two nodes in the merged decoding graph containing the speech recognition result, determining that the detection result is that the preset keyword exists in the plurality of speech frames; In response to the edges between all nodes in the combined decoding graph not including the speech recognition result, it is determined that the detection result is that the preset keyword does not exist in the multiple speech frames.

3. The keyword detection method according to any one of claims 1 to 2, constructing a candidate decoding graph based on the speech recognition result and the multiple speech frames, comprising: Obtaining extraction time of the multiple speech frames; The candidate decoding graph is constructed based on the speech recognition result, the extraction time and the multiple speech frames, wherein the edge is used to represent the speech recognition result and the extraction time.

4. The keyword detection method according to claim 2, further comprising: In response to the detection result indicating that the preset keyword exists in the to-be-detected speech, the preset keyword in the combined decoding graph is extracted based on the speech recognition result.

5. The keyword detection method according to claim 4, when the preset keyword includes multiple keywords, the method further comprises: Obtaining a weight value corresponding to the preset keyword in the combined decoding graph, wherein the weight value is used to represent the recognition probability of the syllable corresponding to the preset keyword; The preset keyword corresponding to the target weight value is determined from the plurality of preset keywords based on the plurality of weight values, wherein the target weight value is the largest weight value among the plurality of weight values.

6. The keyword detection method according to claim 3, further comprising: A start speech frame and an end speech frame of the preset keyword are determined from the multiple speech frames based on the extraction time.

7. According to the keyword detection method according to any one of claims 1 to 6, the acoustic model is trained based on sample speech and sample syllables.

8. The keyword detection method according to claim 1, detecting the to-be-detected speech based on the keyword decoding graph and the candidate decoding graph to obtain a detection result, comprising: By obtaining the intersection between the keyword decoding graph and the candidate decoding graph, it is determined whether there is a preset keyword in the speech to be detected. If the keyword decoding graph and the candidate decoding graph contain the same words, it means that there is a preset keyword in the speech to be detected; if the keyword decoding graph and the candidate decoding graph do not contain the same words, it means that there is no preset keyword in the speech to be detected.

9. A keyword detection device, comprising: An acquisition module, used for acquiring a speech to be detected, wherein the speech to be detected includes a plurality of speech frames; A recognition module, used to recognize the multiple speech frames using an acoustic model to obtain speech recognition results of different speech frames, wherein the speech recognition results are used to characterize the recognition probability of at least one syllable corresponding to the different speech frames; A construction module, configured to construct a candidate decoding graph based on the speech recognition result and the plurality of speech frames, wherein the candidate decoding graph comprises a plurality of nodes and edges connecting the plurality of nodes, the plurality of nodes correspond one-to-one to the plurality of speech frames, and outputs of the edges are used to represent the speech recognition result; A detection module is used to detect the speech to be detected based on a keyword decoding graph and the candidate decoding graph to obtain a detection result, wherein the keyword decoding graph is constructed based on at least one preset keyword, and the detection result is used to indicate whether the speech to be detected contains the preset keyword.

10. A computer-readable storage medium, the computer-readable storage medium comprising a stored program, wherein: When the program is running, the method for detecting keywords according to any one of claims 1 to 8 is executed in a processor of the device where the program is located.

11. An electronic device, comprising: one or more processors; A storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors execute the keyword detection method described in any one of claims 1 to 8.

12. A computer program comprising: An instruction, when executed by a processor, causes the processor to perform a keyword detection method according to any one of claims 1-8.

Citation Information

Patent Citations

  • Method and system for monitoring rule-violating advertisements in broadcasting and TV programs

    CN103914530A

  • Keyword detection method and system, mobile terminal and storage medium

    CN111429912A

  • Voice keyword recognition method and device, computer equipment and storage medium

    CN112259101A

  • Speech recognition method and device, server and computer readable storage medium

    CN112802476A

  • Voice keyword recognition method and device

    CN116524912A