An off-line speech recognition matching device and method for limited sentence library

By combining neural networks and matching algorithms, the problem of recognition accuracy and computational efficiency under the influence of dialect or accent in offline speech recognition is solved, efficient speech recognition and matching under a limited sentence library is achieved, and computing time and redundancy are reduced. Suitable for diverse application scenarios.

CN113744722BActive Publication Date: 2024-08-23SHANGHAI SHENXIN TUOKE ROBOT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111066814.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-13
Publication Date
2024-08-23
Estimated Expiration
2041-09-13

AI Technical Summary

Technical Problem

In offline speech recognition scenarios, it is difficult for traditional technology to accurately identify speakers with dialects or accents, and the limited sentence library results in a limited number of instructions, resulting in long calculation times and technical redundancy.

Method used

Using a combination of neural network and matching algorithm, preprocessing, feature extraction, pinyin sequence recognition and difference calculation of speech signals are carried out through preprocessing, feature extraction, neural network recognition, instruction matching and language model modules to match the best Similar instruction pinyin sequences and use language models for text output when necessary.

Benefits of technology

It significantly reduces the calculation time and amount of calculations, improves the accuracy and efficiency of speech recognition, can accurately identify instructions when the speaker has an accent or makes a slip of the tongue, and handles non-instruction content to meet the needs of diverse application scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113744722B
    Figure CN113744722B
Patent Text Reader

Abstract

The invention discloses an off-line speech recognition matching device and method for a limited sentence library, and relates to the technical field of speech recognition. The device comprises: a preprocessing module, which performs a preprocessing operation on a speech signal; a feature extraction module, which is connected to the preprocessing module, performs feature extraction on the speech signal, and obtains features of the speech signal, including a spectrogram and MFCC features; a neural network module, which is connected to the feature extraction module, takes the spectrogram of the speech signal as an input of the neural network, and obtains a pinyin sequence contained in the speech signal; an instruction matching module, which is connected to the neural network module, calculates the difference between the pinyin sequence recognized by the neural network module and the pinyin sequence of each instruction in a pre-stored standard instruction set, and matches an instruction pinyin sequence with the smallest difference from the speech signal; if the difference is less than or equal to an instruction difference threshold, outputs an instruction text corresponding to the instruction pinyin sequence as a result text.
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 an off-line speech recognition matching device and method for a limited sentence library. Background Art

[0002] As one of the most basic ways of human interaction, voice can be converted into readable text information, which provides a feasible way for human-computer interaction. With the development of deep learning, neural network technology has been widely used in the field of speech recognition. Speech recognition has become an important way to identify and record instructions in many special application scenarios. However, in many specific occasions, the existing speech recognition technology still needs to be improved:

[0003] 1. In order to ensure data security, the speech recognition systems in many applications are not required to be connected to the Internet, while the recognition rate and computing speed of a large number of offline speech recognition systems are difficult to meet application requirements;

[0004] 2. Most of the staff in the application scenario have not received professional broadcasting training, and the voices in the work projects may have accents or words containing dialects. In this case, the traditional speech recognition technology cannot accurately recognize the dispatching commands word by word. In addition, everyone speaks in different dialects, making it difficult to obtain enough language samples for neural network training.

[0005] 3. Due to the particularity of the scenario, the number of instructions covered by voice recognition in the application scenario is limited, and the instruction set composed of all instructions is fixed. The general dictionary commonly used for voice recognition lacks some proprietary words and contains many words that will not appear in the instructions. In this case, homophones that do not belong to the instructions may appear in the text obtained by recognizing the voice. At the same time, the technical redundancy caused by redundant words will bring about problems such as extended processing time and slow processing speed.

[0006] In the invention patent with application number CN202011125376.7, the convolutional neural network and the recurrent neural network are effectively combined and connected to increase the overall learning efficiency and robustness of the network while ensuring the accuracy of speech recognition, thereby improving the performance of speech recognition. However, when the speaker has an accent or dialect, it is difficult to obtain a large number of training samples. The neural network model trained based on the standard Chinese data set will be affected by the accent and will have inaccurate recognition problems.

[0007] Therefore, technicians in this field are committed to developing an offline speech recognition matching device and method for a limited sentence library to solve the problem of recognition accuracy when the speaker has an accent in an offline speech recognition scenario under a limited sentence library. Summary of the invention

[0008] In view of the above-mentioned defects of the prior art, the technical problem to be solved by the present invention is how to obtain an ideal language recognition effect when facing offline speech with a dialect accent.

[0009] After neural networks were widely used, traditional speech recognition technology used neural networks to greatly improve the computing time and recognition accuracy of speech recognition. However, when faced with offline speech and the speaker has a dialect accent, the neural network cannot achieve an ideal recognition effect. In most application scenarios, the speaker has not received professional broadcasting training, and there may be situations where the speaker has an accent or uses dialect words during work. Therefore, traditional speech recognition technology cannot perform well when the speaker has a dialect accent or makes mistakes when offline. In addition, the traditional speech recognition method based only on the combination of acoustic models and language models has a lot of technical redundancy when the number of recognition instructions is limited, resulting in problems such as long computing time or large computing volume.

[0010] The technical solution provided by the embodiment of the present invention is to combine a neural network and a matching algorithm, and add a matching module to the back end of the neural network, which can better adapt to the offline speech recognition scenario under a limited sentence library when the speaker has an accent.

[0011] To achieve the above object, the present invention provides an off-line speech recognition matching device for a limited sentence library, comprising:

[0012] A preprocessing module, wherein the preprocessing module performs a preprocessing operation on the speech signal;

[0013] A feature extraction module, wherein the feature extraction module is connected to the preprocessing module, performs feature extraction on the speech signal to obtain features of the speech signal, including a spectrogram and MFCC features;

[0014] A neural network module, wherein the neural network module is connected to the feature extraction module, and uses the spectrogram of the speech signal as an input of the neural network to obtain a pinyin sequence contained in the speech signal;

[0015] An instruction matching module is connected to the neural network module, and performs difference calculation between the pinyin sequence recognized by the neural network module and the pinyin sequence of each instruction in the pre-stored standard instruction set, so as to match the instruction pinyin sequence with the smallest difference from the speech signal; if the difference is less than or equal to the instruction difference threshold, the instruction text corresponding to the instruction pinyin sequence is output as the result text.

[0016] Furthermore, it also includes:

[0017] A language model module, wherein the language model module is connected to the instruction matching module. In the instruction matching module, when the difference between the pinyin sequence and the pinyin sequences of each instruction in the pre-stored standard instruction set is greater than the instruction difference threshold, the pinyin sequence identified by the neural network module is input into the language model module, and the text content with the highest probability of appearing under the pinyin sequence is calculated by the language model and output as the result text.

[0018] Furthermore, in the preprocessing module, the preprocessing operation includes pre-emphasis, framing and windowing.

[0019] Furthermore, in the feature extraction module, a discrete Fourier transform is performed on the speech signal to convert the time domain signal of the speech into a superposition of multiple single signals, thereby converting the same signal from the time domain to the frequency domain to obtain the frequency domain features of the speech signal, and the spectrum information of each frame of speech is mapped to a grayscale representation, and each frame is spliced ​​together in chronological order to obtain the features of the speech signal, which include the spectrogram and the MFCC features.

[0020] The present invention also provides a method for offline speech recognition matching of a limited sentence library, the method comprising the following steps:

[0021] Step 1: Sampling and recording the speech signal;

[0022] Step 2: preprocessing and feature extraction of the speech signal to obtain features of the speech signal, including spectrogram and MFCC features;

[0023] Step 3: using the extracted features as input to the trained neural network model to perform calculation and recognition to obtain a pinyin sequence corresponding to the speech signal;

[0024] Step 4: Calculate the difference between the recognized Pinyin sequence and each instruction Pinyin sequence in the preset instruction Pinyin set through a dynamic time warping algorithm to obtain the instruction Pinyin sequence with the smallest difference from the Pinyin sequence and the minimum difference; if the minimum difference is less than a preset instruction difference threshold, the instruction text corresponding to the instruction Pinyin sequence pointed to by the minimum difference is output as the final result text of speech recognition and matching.

[0025] Furthermore, the method further comprises the following steps:

[0026] Step 5. If the minimum difference is greater than the preset instruction difference threshold, it is considered that the content in the speech signal is not an instruction in the standard instruction library, and the recognized pinyin sequence is sent to the language model to calculate the text content with the highest probability of appearing under the pinyin sequence, and the text content is used as the final result text output of the speech recognition and matching.

[0027] Furthermore, the step 1 comprises the following steps:

[0028] Step 1.1, use the program and microphone to record the speaker's voice;

[0029] Step 1.2, the sampling frequency of the recording is 16kHz, and the recording time is determined according to the length of the content spoken by the speaker;

[0030] Step 1.3, generating a file including the language signal and saving it as a wav format audio file;

[0031] The step 2 comprises the following steps:

[0032] Step 2.1, read the wav format audio file obtained in step 1.3;

[0033] Step 2.2, performing the preprocessing on the wav format audio file, including framing, windowing and discrete Fourier transform operations, to obtain the time domain and frequency domain characteristics of the speech signal;

[0034] Step 2.3: perform feature extraction on the speech signal, and extract the spectrogram and the MFCC features of the speech signal according to the input format of the neural network model.

[0035] Furthermore, the neural network model in step 3 includes multiple convolutional layers and pooling layers, and uses a CTC algorithm to correspond the input sequence and the output sequence.

[0036] Furthermore, step 4 includes the following steps:

[0037] Step 4.1, establishing an instruction matching module based on the dynamic time warping algorithm to calculate the difference between two sequences;

[0038] Step 4.2, using the pinyin sequence recognized by the neural network model as input to the instruction matching module;

[0039] Step 4.3, calculating the difference between the pinyin sequence and each instruction pinyin sequence in the preset instruction pinyin set, and obtaining the instruction pinyin sequence with the smallest difference from the pinyin sequence and the smallest difference;

[0040] Step 4.4: If the minimum difference is less than the preset instruction difference threshold, the instruction text corresponding to the instruction pinyin sequence pointed to by the minimum difference is output as the final result text of the speech recognition and matching.

[0041] Furthermore, the size of the instruction difference threshold is calibrated according to actual test conditions; in different application scenarios, the instruction difference threshold is different.

[0042] The present invention provides an off-line speech recognition matching device and method for a limited sentence library, which has at least the following technical effects:

[0043] 1. The technical solution proposed in the embodiment of the present invention first uses a neural network to recognize speech, and then uses a dynamic time warping algorithm to match the instruction pinyin sequence in the instruction library that is most similar to the recognized pinyin sequence, so as to obtain the corresponding text. When the instruction spoken by the speaker is a standard instruction in the instruction library, the calculation time and amount of calculation can be greatly reduced, and the traditional speech recognition method based only on the combination of acoustic model and language model is avoided. There is a lot of technical redundancy when the number of recognized instructions is limited, resulting in problems such as long calculation time or large amount of calculation;

[0044] 2. If the command spoken by the speaker is not a standard command in the command library, the subsequent language model part can also meet the non-command recognition requirements. By classifying the content spoken by the speaker according to whether it is in the command library and processing it separately, it can more efficiently meet the diverse requirements of application scenarios.

[0045] The concept, specific structure and technical effects of the present invention will be further described below in conjunction with the accompanying drawings to fully understand the purpose, characteristics and effects of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] Figure 1 It is a schematic diagram of a method flow chart of a preferred embodiment of the present invention;

[0047] Figure 2 yes Figure 1 The structure diagram of the speech recognition and pinyin sequence matching module of the illustrated embodiment. DETAILED DESCRIPTION

[0048] The following describes several preferred embodiments of the present invention with reference to the drawings in the specification, so that the technical content is clearer and easier to understand. The present invention can be embodied in many different forms of embodiments, and the protection scope of the present invention is not limited to the embodiments mentioned in the text.

[0049] After neural networks were widely used, traditional speech recognition technology used neural networks to greatly improve the computing time and recognition accuracy of speech recognition. However, when faced with offline speech and the speaker has a dialect accent, the neural network cannot achieve an ideal recognition effect. In most application scenarios, the speaker has not received professional broadcasting training, and there may be situations where the speaker has an accent or uses dialects during work. Therefore, traditional speech recognition technology cannot perform well when the speaker has a dialect accent or makes mistakes when offline. In addition, the traditional speech recognition method based only on the combination of acoustic models and language models has a lot of technical redundancy when the number of recognition instructions is limited, resulting in problems such as long computing time or large computing volume.

[0050] In view of the problems existing in the prior art, the embodiments of the present invention propose an offline speech recognition and matching device and method for a limited sentence library, which is used to recognize and match speech in offline scenarios where the speaker has an accent or the speech has speech errors. The technical solution recognizes the language signal after preprocessing it, calculates the difference between the obtained pinyin sequence and the pinyin sequence of the instructions in the pre-stored instruction set, and thus matches the correct instruction.

[0051] The technical solution proposed in the embodiment of the present invention combines speech recognition with pinyin sequence matching. First, after sampling and recording the speech signal, the speech is preprocessed to reduce the noise impact in the speech, improve the contrast between the target signal and the noise signal, and make the effective information more obvious; then, speech feature extraction is performed to obtain feature information in the speech signal, and then the feature information of the speech is recognized by a pre-trained neural network to obtain a preliminary recognition result, which is a pinyin sequence, and inaccurate recognition may occur due to problems such as accents or slips of the tongue; the pinyin sequence obtained by this recognition is matched with the pinyin sequence of the standard instruction in the pre-stored instruction set through a matching algorithm, so as to obtain the most similar (i.e., the smallest difference) instruction pinyin sequence, and obtain the corresponding instruction text according to the correspondence between the pinyin sequence and the text in the instruction library; if the difference between the speech and each instruction in the instruction set is higher than the pre-set instruction difference threshold, it is considered that the content described in the speech may not be an existing instruction in the instruction set, the original neural network output is saved, and the most likely text content is calculated through the language model.

[0052] The embodiment of the present invention proposes to first use a neural network to recognize speech and then use a dynamic time warping algorithm to match the instruction pinyin sequence in the instruction library that is most similar to the recognized pinyin sequence, thereby obtaining the corresponding text. When the instruction spoken by the speaker is a standard instruction in the instruction library, the calculation time and amount of calculation can be greatly reduced. If the instruction spoken by the speaker is not a standard instruction in the instruction library, the subsequent language model part can also meet the non-instruction recognition requirements. By classifying the content spoken by the speaker according to whether it is in the instruction library and processing it separately, the diversified requirements of application scenarios can be met more efficiently.

[0053] Specifically, the technical solution adopted in the embodiment of the present invention includes an offline speech recognition matching device and method for a limited sentence library, wherein a flow chart of a method for offline speech recognition of a limited sentence library is as follows: Figure 1 As shown, the discrete speech signal after the speech is sampled and recorded is saved as a waveform sound file, speech recognition and pinyin sequence matching are performed based on the waveform sound file, and the matched result text is output.

[0054] The present invention provides an off-line speech recognition matching device for a limited sentence library, such as Figure 2 As shown, including:

[0055] Preprocessing module, the preprocessing module performs preprocessing operations on the speech signal. In the preprocessing module, the preprocessing operations include pre-emphasis, framing and windowing, which eliminate the influence of aliasing, high-order harmonic distortion, high frequency and other factors on the quality of the speech signal caused by the human vocal organs themselves and the equipment for collecting speech signals, so as to ensure that the subsequent speech signal is more uniform and smooth as much as possible, and improve the quality of speech processing. The pre-emphasis link is used to strengthen the amplitude of the high-frequency part of the speech signal. In order to carry out the next step of analysis, the signal of a certain length is extracted from the speech signal by framing operation, which is regarded as a stable signal and analyzed. Each small segment of the signal obtained after framing is called a frame. When a frame of the speech signal is directly intercepted, the signals at both ends of each frame will suddenly change to 0, resulting in the speech having characteristics that do not exist in the original signal, which will interfere with subsequent processing. Therefore, the frame length of each frame is taken to be greater than the length of the target range, and the windowing operation is performed, that is, the range is filtered using a filter that continuously attenuates toward both ends, so as to avoid the signal from suddenly changing to 0.

[0056] Feature extraction module: The feature extraction module is connected to the preprocessing module to extract features of the speech signal and obtain the features of the speech signal, including spectrogram and MFCC features. The information of the speech signal in both the time domain and the frequency domain has analytical value. The speech is composed of the weighted sum of the harmonics of the basic frequency. The speech signal after passing through the preprocessing module is subjected to discrete Fourier transform to convert the time domain signal of the speech into the superposition of multiple single signals, thereby converting the same signal from the time domain to the frequency domain, obtaining the frequency domain features of the speech signal, and mapping the spectrum information of each frame of speech to a grayscale representation, and splicing each frame in chronological order to obtain the spectrogram and MFCC features of the speech. Among them, the spectrogram is a spectrum diagram that changes over time, which can intuitively show the static and dynamic information of the speech.

[0057] Neural network module, the neural network module is connected to the feature extraction module, and the spectrogram of the speech signal is used as the input of the neural network to obtain the pinyin sequence contained in the speech signal. The neural network module is an important link in recognizing speech as phonemes. A convolutional neural network consisting of multiple convolutional layers and pooling layers is established, and the network is trained using a standard Chinese data set. The speech features obtained after the feature extraction module are used as the input of the neural network to obtain the pinyin sequence contained in the speech signal. In the case where the speaker may have an accent or a slip of the tongue, the accuracy of the neural network's recognition of his or her speech will be reduced. The neural network may recognize incorrect pinyin due to the difference between the pronunciation of Mandarin with an accent and standard Mandarin.

[0058] The instruction matching module is connected to the neural network module. In order to correctly identify the instructions when the speaker has an accent or makes a slip of the tongue, the instruction matching module uses a dynamic time warping algorithm to calculate the difference between the pinyin sequence recognized by the neural network module and the pinyin sequence of each instruction in the pre-stored standard instruction set, and matches the instruction pinyin sequence with the smallest difference from the speaker's voice; if the difference is less than or equal to the pre-set instruction difference threshold, the instruction text corresponding to the instruction pinyin sequence is used as the final text output of speech recognition and matching; if the difference between the speaker's voice recognized by the neural network and all standard instructions is greater than the instruction difference threshold, the pinyin sequence recognized by the neural network is sent to the language model module for another processing, so as to achieve the purpose of classification processing for the two situations of whether the speech content is a stored instruction.

[0059] The language model module is connected to the instruction matching module. In the instruction matching module, when the difference between the pinyin sequence and the pinyin sequence of each instruction in the pre-stored standard instruction set is greater than the instruction difference threshold, the pinyin sequence recognized by the neural network module is input into the language model module, and the text content with the highest probability of appearing under the pinyin sequence is calculated by the language model, and output as the result text. The language model module exists to handle the situation where the command spoken by the speaker is not an instruction in the standard instruction set. A statistically based language model module is established to obtain the most likely voice text by calculating the probability of the context being connected in a sentence. By performing word frequency statistics on a large number of news reports, application scenarios and professional field texts, a word frequency statistics table of single-word words and two-word words is obtained. For a pinyin sequence, from the first pinyin to the last pinyin, for the nth pinyin, the probability of each character corresponding to the pinyin being associated with the first n-1 characters is calculated, and finally the sentence with the highest probability among all possible texts is selected as the final text output of speech recognition and matching.

[0060] The present invention also provides a method for offline speech recognition matching of a limited sentence library, which is as follows:

[0061] First, the speaker's voice is sampled and recorded, saved as a wav format audio file, and the audio file is preprocessed and feature extracted. The extracted voice features are used as the input of the neural network. The trained neural network calculates and recognizes according to the input voice features to obtain a pinyin sequence from the speaker's voice recognition. The instruction matching module based on the dynamic time warping algorithm calculates the difference between the recognized pinyin sequence obtained by the neural network recognition module and all the instruction pinyin sequences in the standard instruction library. If the minimum difference is less than the instruction difference threshold, the standard instruction corresponding to the instruction pinyin sequence pointed to by the minimum difference is used as the final text output of speech recognition and matching. If the minimum difference is greater than the instruction difference threshold, it is considered that the content spoken by the speaker is not included in the standard instruction library, and the text content with the highest probability of appearing under the pinyin sequence is calculated through the language model, and the text content is used as the final text output of speech recognition and matching.

[0062] The method specifically comprises the following steps:

[0063] Step 1: Sampling and recording the speech signal, specifically including the following steps:

[0064] Step 1.1, use the program and microphone to record the speaker's voice;

[0065] Step 1.2, the sampling frequency of the recording is 16kHz, and the recording time depends on the length of the content spoken by the speaker;

[0066] Step 1.3, generate a file including a language signal and save it as a wav format audio file;

[0067] Step 2: Preprocess and extract features of the speech signal to obtain the features of the speech signal, including spectrogram and MFCC features, which specifically includes the following steps:

[0068] Step 2.1, read the wav format audio file obtained in step 1.3;

[0069] Step 2.2, preprocessing the wav format audio file, including framing, windowing and discrete Fourier transform operations, to obtain the time domain and frequency domain characteristics of the speech signal;

[0070] Step 2.3: Extract features of the speech signal and extract the spectrogram and MFCC features of the speech signal according to the input format of the neural network model.

[0071] Step 3: Use the extracted features as the input of the trained neural network model to perform calculation and recognition to obtain the pinyin sequence corresponding to the speech signal.

[0072] Among them, an acoustic model of speech recognition (i.e., a neural network model) is built based on a neural network to recognize speech signals as pinyin sequences, and the network is trained using a standard Chinese speech data set, specifically including the following steps:

[0073] 1) Build a neural network, including multiple convolutional layers and pooling layers, and use the Connectionist Temporal Classification (CTC) algorithm to match the input sequence with the output sequence, so that the network output is the phonetic sequence of the speaker's speech;

[0074] 2) Using the speech features extracted in step 2 as input to the neural network model;

[0075] 3) Use the public Chinese standard speech dataset to train the neural network.

[0076] The construction of the instruction phonetic set includes collecting all possible instructions, making an instruction set, and extracting the phonemes corresponding to each word of each instruction in the instruction set to obtain the instruction phonetic set. The specific steps are as follows:

[0077] 1) Establish a pronunciation dictionary including common pronunciation and pronunciation of words in the fields involved in the application scenarios. The pronunciation dictionary consists of 1424 commonly used Chinese phonemes and multiple commonly used characters corresponding to each phoneme, including daily words and special words in the fields involved in the application scenarios;

[0078] 2) Collect all standard instructions that will be involved in the application scenario and create a text instruction set;

[0079] 3) For each instruction in the text instruction set, starting from the first word of the instruction, extract each word in the instruction in turn, search the pinyin corresponding to the changed word in the pronunciation dictionary, and record the pinyin, repeat this operation until the pinyin of the last word of the instruction is retrieved, and obtain the instruction pinyin sequence;

[0080] 4) Repeat the above 3) operation until the text-to-pinyin operation is performed on each instruction in the text instruction set to obtain the pinyin sequence of each instruction, and arrange each pinyin sequence according to the order of each instruction in the text instruction set to obtain the instruction pinyin set.

[0081] Step 4: Calculate the difference between the recognized Pinyin sequence and each instruction Pinyin sequence in the preset instruction Pinyin set through a dynamic time warping algorithm to obtain the instruction Pinyin sequence with the smallest difference from the Pinyin sequence and the minimum difference.

[0082] The specific steps include:

[0083] Step 4.1, establish an instruction matching module based on the dynamic time warping algorithm to calculate the difference between two sequences;

[0084] Step 4.2, using the pinyin sequence recognized by the neural network model as the input of the instruction matching module;

[0085] Step 4.3, calculating the difference between the pinyin sequence and each instruction pinyin sequence in the preset instruction pinyin set, and obtaining the instruction pinyin sequence with the smallest difference from the pinyin sequence and the smallest difference;

[0086] Step 4.4: If the minimum difference is less than or equal to the preset instruction difference threshold, the instruction text corresponding to the instruction pinyin sequence pointed to by the minimum difference is output as the final result text of speech recognition and matching.

[0087] If the minimum difference is greater than the instruction difference threshold, it means that the difference between the recognized pinyin sequence and all instruction pinyin sequences is greater than the instruction difference threshold. It is considered that the content in the speaker's speech is not an instruction in the standard instruction library. The recognized pinyin sequence obtained by the neural network is sent to the language model module for pinyin-to-text operation, which is step 5.

[0088] In step 5, the recognized pinyin sequence is sent to the language model to calculate the text content with the highest probability of appearing under the pinyin sequence, and the text content is used as the final result text output of speech recognition and matching.

[0089] Step 5 is to establish a language model based on statistics to realize the conversion of pinyin into text, which is used to convert the pinyin output by the neural network into text content when the difference between the output of the neural network and each standard instruction in the standard instruction set is higher than the instruction difference threshold, and specifically includes the following steps:

[0090] 1) Perform word frequency statistics on a large number of news reports and application scenario texts to obtain word frequency statistics tables for single-word and two-word words;

[0091] 2) In the pinyin sequence identified in the neural network model, for the nth pinyin, calculate the probability that each character corresponding to the pinyin is associated with the first n-1 characters;

[0092] 3) Obtain the sentence with the highest context probability among all possible texts;

[0093] 4) The text content is output as the final result text of speech recognition and matching.

[0094] The instruction difference threshold is calibrated according to actual test conditions; in different application scenarios, the instruction difference threshold is different.

[0095] The embodiment of the present invention proposes that after using a neural network as an acoustic model to recognize the pinyin sequence of the speaker's voice, the speech content is classified by using a difference calculation method, and the idea of ​​using a pinyin sequence matching method or a language model method to obtain the final output text content is selected according to whether the speech content belongs to a standard instruction set. This greatly improves the computational efficiency of speech recognition in offline application scenarios, where the speaker has a dialect accent or slips of the tongue, and the number of recognition instructions is limited.

[0096] The technical solution provided by the embodiment of the present invention solves the problem of low recognition rate and low efficiency of traditional neural network-based speech recognition in offline limited data sets with accents or slips of the tongue. The speaker's voice is classified and processed through the difference calculation link, and more possible instructions are efficiently calculated in a matching manner. At the same time, the language model is used to deal with possible special situations, thereby improving the computational efficiency of speech recognition in special application scenarios where the speaker is offline, has a dialect accent or slips of the tongue, and the number of recognized instructions is limited.

[0097] The preferred specific embodiments of the present invention are described in detail above. It should be understood that ordinary technicians in the field can make many modifications and changes based on the concept of the present invention without creative work. Therefore, all technical solutions that can be obtained by technicians in the technical field based on the concept of the present invention through logical analysis, reasoning or limited experiments on the basis of the prior art should be within the scope of protection determined by the claims.

Claims

1. An off-line speech recognition matching device for a limited sentence library, characterized in that: include: A preprocessing module, wherein the preprocessing module performs a preprocessing operation on the speech signal; A feature extraction module, wherein the feature extraction module is connected to the preprocessing module, performs feature extraction on the speech signal to obtain features of the speech signal, including a spectrogram and MFCC features; A neural network module, wherein the neural network module is connected to the feature extraction module, and uses the spectrogram of the speech signal as an input of the neural network to obtain a pinyin sequence contained in the speech signal; An instruction matching module, wherein the instruction matching module is connected to the neural network module, and the pinyin sequence identified by the neural network module and the pinyin sequence of each instruction in the pre-stored standard instruction set are used to calculate the difference through a dynamic time warping algorithm, and the instruction pinyin sequence with the smallest difference from the speech signal is matched; if the difference is less than or equal to the instruction difference threshold, the instruction text corresponding to the instruction pinyin sequence is output as the result text; Also includes: A language model module, the language model module is connected to the instruction matching module, in the instruction matching module, when the difference calculated between the pinyin sequence and the pinyin sequence of each instruction in the pre-stored standard instruction set is greater than the instruction difference threshold, the pinyin sequence recognized by the neural network module is input into the language model module, and the text content with the highest probability of appearing under the pinyin sequence is calculated by the language model, and is output as the result text; the language model is based on statistics, and obtains the most likely voice text by calculating the probability of connection between contexts in a sentence, including The method includes two steps: establishing a word frequency statistics table and calculating the probability; the word frequency statistics table is divided into single-word and two-word frequency statistics tables, which are obtained based on the word frequency statistics of single-word and two-word words in a large number of news reports and application scenario texts; for the nth pinyin in a pinyin sequence, the probability of each Chinese character corresponding to the pinyin in the pronunciation dictionary being associated with the first n-1 Chinese characters is calculated based on the word frequency statistics table, until n is the last pinyin in the sequence, then all possible text sequences corresponding to the pinyin sequence and the probability of each text sequence being a speech recognition text are obtained, and the text sequence with the largest probability is used as the output of the language model.

2. The off-line speech recognition matching device for a limited sentence library as claimed in claim 1, characterized in that: In the preprocessing module, the preprocessing operations include pre-emphasis, framing and windowing.

3. The off-line speech recognition matching device for a limited sentence library as claimed in claim 1, characterized in that: In the feature extraction module, the speech signal is subjected to a discrete Fourier transform, and the time domain signal of the speech is converted into a superposition of multiple single signals, thereby converting the same signal from the time domain to the frequency domain, obtaining the frequency domain features of the speech signal, and mapping the spectrum information of each frame of speech to a grayscale representation, and splicing each frame together in chronological order to obtain the features of the speech signal, which include the spectrogram and the MFCC features.

4. An offline speech recognition matching method for a limited sentence library, characterized in that: The method comprises the following steps: Step 1: Sampling and recording the speech signal; Step 2: preprocessing and feature extraction of the speech signal to obtain features of the speech signal, including spectrogram and MFCC features; Step 3: using the extracted features as input to the trained neural network model to perform calculation and recognition to obtain a pinyin sequence corresponding to the speech signal; Step 4: Calculate the difference between the recognized Pinyin sequence and each instruction Pinyin sequence in the preset instruction Pinyin set through a dynamic time warping algorithm to obtain the instruction Pinyin sequence with the smallest difference from the Pinyin sequence and the minimum difference; if the minimum difference is less than a preset instruction difference threshold, output the instruction text corresponding to the instruction Pinyin sequence pointed to by the minimum difference as the final result text of speech recognition and matching; Step 5: If the minimum difference is greater than the preset instruction difference threshold, it is considered that the content in the voice signal is not an instruction in the standard instruction library, and the identified pinyin sequence is sent to the language model to calculate the text content with the highest probability of appearing under the pinyin sequence; the language model is based on statistics, and the most likely voice text is obtained by calculating the probability of connection between the contexts in a sentence, including two steps of establishing a word frequency statistics table and calculating the probability; the word frequency statistics table is divided into single-word and two-word word frequency statistics table, which is obtained based on the word frequency statistics of single-word and two-word words in a large number of news reports and application scenario field texts; for the nth pinyin in a pinyin sequence, the probability of each Chinese character corresponding to the pinyin in the pronunciation dictionary being associated with the first n-1 Chinese characters is calculated based on the word frequency statistics table, until n is the last pinyin in the sequence, then all possible text sequences corresponding to the pinyin sequence and the probability of each text sequence being a speech recognition text are obtained, and the text sequence with the highest probability is used as the output of the language model.

5. The off-line speech recognition matching method for a limited sentence library as claimed in claim 4, characterized in that: The step 1 comprises the following steps: Step 1.1, use the program and microphone to record the speaker's voice; Step 1.2, the sampling frequency of the recording is 16kHz, and the recording time is determined according to the length of the content spoken by the speaker; Step 1.3, generating a file including the voice signal and saving it as a wav format audio file; The step 2 comprises the following steps: Step 2.1, read the wav format audio file obtained in step 1.3; Step 2.2, performing the preprocessing on the wav format audio file, including framing, windowing and discrete Fourier transform operations, to obtain the time domain and frequency domain characteristics of the speech signal; Step 2.3: perform feature extraction on the speech signal, and extract the spectrogram and the MFCC features of the speech signal according to the input format of the neural network model.

6. The off-line speech recognition matching method for a limited sentence library as claimed in claim 4, characterized in that: The neural network model in step 3 includes multiple convolutional layers and pooling layers, and uses the CTC algorithm to correspond the input sequence and the output sequence.

7. The off-line speech recognition matching method for a limited sentence library as claimed in claim 4, characterized in that: The step 4 comprises the following steps: Step 4.1, establishing an instruction matching module based on the dynamic time warping algorithm to calculate the difference between two sequences; Step 4.2, using the pinyin sequence recognized by the neural network model as input to the instruction matching module; Step 4.3, calculating the difference between the pinyin sequence and each instruction pinyin sequence in the preset instruction pinyin set, and obtaining the instruction pinyin sequence with the smallest difference from the pinyin sequence and the smallest difference; Step 4.4: If the minimum difference is less than the preset instruction difference threshold, the instruction text corresponding to the instruction pinyin sequence pointed to by the minimum difference is output as the final result text of the speech recognition and matching.

8. The off-line speech recognition matching method for a limited sentence library as claimed in claim 4, characterized in that: The size of the instruction difference threshold is calibrated according to actual test conditions; in different application scenarios, the instruction difference threshold is different.