A speech recognition method, apparatus, computer device, and storage medium
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-16
- Publication Date
- 2026-08-14
AI Technical Summary
[0005]本发明实施例提供一种语音识别方法、装置、计算机设备及存储介质,以解决由于训练样本质量较差而导致语音识别模型的识别效果大大降低的问题
[0043]综上,本发明公开了一种语音识别方法、装置、计算机设备及存储介质,通过将待筛选语音数据分为第一语音数据和第二语音数据,进而从第一语音数据中筛选出第一置信度样本和第二置信度样本,从第二语音数据中筛选出第一相似度样本和第二相似度样本,然后,根据筛选的第一置信度样本、第二置信度样本,第一相似度样本和第二相似度样本训练得到用于对目标语音进行语音识别的目标语音识别模型。可见,本实施例中通过两种筛选方法,对待筛选语音数据中的第一语音数据和第二语音数据进行筛选,以得到,第一置信度样本、第二置信度样本,第一相似度样本和第二相似度样本对目标语音识别模型进行训练,相较于现有的随机选取训练样本的方法,可以较好的保证训练样本的质量,可以达到提高数字医疗领域中医疗引导系统的识别效果的目的。
Smart Images

Figure CN116543767B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of artificial intelligence technology and digital medical technology, and in particular to a speech recognition method, device, computer equipment and storage medium. Background Technology
[0002] With the continuous development of science and technology, speech recognition technology has been widely used in fields such as digital healthcare. For example, in many hospitals, medical guidance robots or systems are used to solve problems such as hospital consultations, registration, and asking for directions.
[0003] The speech recognition performance of the speech recognition model used in medical guidance robots or medical guidance systems is closely related to the quality of the training samples used during model training. High-quality training samples can greatly improve the recognition accuracy of the entire speech recognition model.
[0004] However, the current method for obtaining training samples mainly involves randomly selecting a portion of the speech data from a massive amount of speech data as training samples for training the speech recognition model. This makes it impossible to guarantee the quality of the training samples, which in turn leads to a significant reduction in the recognition performance of the trained speech recognition model. Summary of the Invention
[0005] This invention provides a speech recognition method, apparatus, computer device, and storage medium to address the problem that the recognition performance of speech recognition models is greatly reduced due to poor training sample quality.
[0006] A speech recognition method, the method comprising:
[0007] The voice data to be filtered is obtained, which includes first voice data and second voice data;
[0008] A first confidence sample and a second confidence sample are selected from the first voice data; the confidence level of the first confidence sample is higher than that of the second confidence sample.
[0009] A first similarity sample and a second similarity sample are selected from the second speech data; the similarity of the first similarity sample is higher than that of the second similarity sample.
[0010] Based on the first confidence sample, the second confidence sample, the first similarity sample, and the second similarity sample, a target speech recognition model is trained, which is used to perform speech recognition on the target speech.
[0011] Optionally, in the above method, the step of filtering the first confidence sample and the second confidence sample from the first speech data includes:
[0012] The training samples in the first speech data are input into the first speech recognition model to obtain the confidence level of each training sample.
[0013] Determine whether the confidence level of the training sample is greater than the first confidence threshold;
[0014] If the confidence level of the training sample is greater than the first confidence threshold, the training sample is determined to be the first confidence level sample;
[0015] Determine whether the confidence level of the training sample is greater than the second confidence threshold and less than the first confidence threshold;
[0016] If the confidence level of the training sample is greater than the second confidence threshold and less than the first confidence threshold, then the training sample is determined to be a sample with the second confidence level.
[0017] Optionally, in the above method, the step of inputting the training samples from the first speech data into the first speech recognition model to obtain the confidence score of each training sample includes:
[0018] The training samples in the first speech data are respectively input into the first speech recognition model to obtain several speech recognition results for each training sample and a score corresponding to each speech recognition result.
[0019] The confidence level of the training sample is calculated by selecting the scores corresponding to the two highest-scoring speech recognition results.
[0020] Optionally, in the above method, the step of selecting a first similarity sample and a second similarity sample from the second speech data, wherein the similarity of the first similarity sample is higher than the similarity of the second similarity sample, includes:
[0021] The training samples in the second speech data are input into the second speech recognition model to obtain the first recognized text of each training sample;
[0022] The training samples in the second speech data are input into the third speech recognition model to obtain the second recognized text for each training sample; therefore, the second speech recognition model and the third speech recognition model are trained through sample features of different dimensions.
[0023] Based on the first recognized text and the second recognized text, the first similarity sample and the second similarity sample are selected from the second speech data.
[0024] Optionally, in the above method, the step of filtering the first similarity sample and the second similarity sample from the second speech data based on the first recognized text and the second recognized text includes:
[0025] Determine whether the text content of the first identified text and the text content of the second identified text in the training sample are the same;
[0026] If the text content of the first identified text in the training sample is the same as the text content of the second identified text, the training sample is determined to be the first similarity sample.
[0027] If the text content of the first recognized text and the text content of the second recognized text in the training sample are different, obtain the word error rate of the text content of the first recognized text and the text content of the second recognized text.
[0028] Determine whether the word error rate of the text content of the first recognition sample and the text content of the second recognition sample is lower than a preset word error rate threshold;
[0029] If the word error rate of the text content of the first recognition sample and the text content of the second recognition sample is lower than a preset word error rate threshold, the training sample is determined to be the second similarity sample.
[0030] Optionally, in the above method, training the target speech recognition model based on the first confidence sample, the second confidence sample, the first similarity sample, and the second similarity sample includes:
[0031] The first confidence sample and the first similarity sample are input into the target speech recognition model for the first stage of training.
[0032] The second confidence sample and the second similarity sample are input into the target speech recognition model for the second stage of training to obtain the trained target speech recognition model.
[0033] Optionally, the first stage of training and the second stage of training can be distinguished in the following ways:
[0034] When the target speech recognition model is trained for the first time, it is determined that the target speech recognition model is in the first stage of training;
[0035] When the number of training iterations of the target speech recognition model reaches the preset number of iterations, the target speech recognition model is determined to be in the second stage of training.
[0036] A voice recognition device, comprising:
[0037] A voice data acquisition unit is used to acquire voice data to be filtered, wherein the voice data to be filtered includes first voice data and second voice data;
[0038] The first sample filtering unit is used to filter out a first confidence sample and a second confidence sample from the first speech data; the confidence level of the first confidence sample is higher than the confidence level of the second confidence sample.
[0039] The second sample filtering unit is used to filter out a first similarity sample and a second similarity sample from the second speech data; the similarity of the first similarity sample is higher than the similarity of the second similarity sample.
[0040] The model training unit is used to train a target speech recognition model based on the first confidence sample, the second confidence sample, the first similarity sample, and the second similarity sample. The target speech recognition model is used to perform speech recognition on the target speech.
[0041] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements a speech recognition method, for example.
[0042] A computer-readable storage medium storing a computer program that, when executed by a processor, implements a speech recognition method.
[0043] In summary, this invention discloses a speech recognition method, apparatus, computer device, and storage medium. It divides the speech data to be screened into first speech data and second speech data, then selects first confidence samples and second confidence samples from the first speech data, and selects first similarity samples and second similarity samples from the second speech data. Finally, it trains a target speech recognition model for recognizing the target speech based on the selected first confidence samples, second confidence samples, first similarity samples, and second similarity samples. Therefore, this embodiment uses two screening methods to screen the first and second speech data to obtain first confidence samples, second confidence samples, first similarity samples, and second similarity samples for training the target speech recognition model. Compared to existing methods that randomly select training samples, this method can better ensure the quality of the training samples and improve the recognition effect of medical guidance systems in the digital healthcare field. Attached Figure Description
[0044] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0045] Figure 1 This is a flowchart illustrating a speech recognition method disclosed in Embodiment 1 of the present invention;
[0046] Figure 2 This is a partial flowchart of a speech recognition method disclosed in Embodiment 1 of the present invention;
[0047] Figure 3 This is a partial flowchart of a speech recognition method disclosed in Embodiment 1 of the present invention;
[0048] Figure 4 This is a partial flowchart of a speech recognition method disclosed in Embodiment 1 of the present invention;
[0049] Figure 5 This is a partial flowchart of a speech recognition method disclosed in Embodiment 1 of the present invention;
[0050] Figure 6 This is a partial flowchart of a speech recognition method disclosed in Embodiment 1 of the present invention;
[0051] Figure 7 This is a schematic diagram of the structure of a voice recognition device disclosed in Embodiment 2 of the present invention;
[0052] Figure 8 This is a schematic diagram of the structure of a computer device disclosed in Embodiment 3 of the present invention. Detailed Implementation
[0053] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0054] This invention discloses a speech recognition method, apparatus, computer device, and storage medium. The method involves dividing the speech data to be screened into first speech data and second speech data. First confidence samples and second confidence samples are then selected from the first speech data, and first similarity samples and second similarity samples are selected from the second speech data. A target speech recognition model for recognizing the target speech is then trained based on the selected first confidence samples, second confidence samples, first similarity samples, and second similarity samples. As can be seen, this embodiment uses two screening schemes to screen the first and second speech data to be screened, using the obtained first confidence samples, second confidence samples, first similarity samples, and second similarity samples to train the target speech recognition model. Compared to existing methods that randomly select training samples, this method can better ensure the quality of the training samples and improve the recognition performance of the speech recognition model. Specific embodiments are described below.
[0055] It should be noted that the models involved in this embodiment, such as the first speech recognition model, the second speech recognition model, the third speech recognition model, or the target speech recognition model, include but are not limited to the traditional HMM-DNN hybrid model, the CTC-based end-to-end model, the joint-CTC-attention model, or the RNN-T model, etc. This embodiment does not make specific limitations on the first speech recognition model, the second speech recognition model, the third speech recognition model, or the target speech recognition model.
[0056] Example 1
[0057] like Figure 1 The diagram shown is a flowchart of a speech recognition method disclosed in Embodiment 1 of the present invention. This method is applicable to medical guidance systems in the field of digital healthcare, such as medical guidance robots equipped with this system. These robots can collect the speech signals of patients or their families, perform speech signal recognition, and then provide guidance services such as consultation, registration, and directions to patients or their families. Specifically, it can be shown below:
[0058] S101: Obtain the voice data to be filtered, which includes the first voice data and the second voice data.
[0059] In this specific implementation, the speech data to be screened in this embodiment is a pre-collected training sample. The speech data to be screened is divided into first speech data and second speech data. The number of training samples in the first speech data and the second speech data can be the same or different. That is to say, the first speech data and the second speech data together constitute the speech data to be screened. Accordingly, the subsequent steps of the speech recognition method are performed based on the first speech data and the second speech data.
[0060] For example, half of the training samples are randomly selected from the speech data to be screened as the first speech data, and the remaining unselected training samples are used as the second speech data. Or, two-thirds of the training samples are selected from the data to be screened as the first speech data, and the remaining one-third of the training samples are used as the second speech data.
[0061] It should be noted that in this embodiment, the number of training samples in the first speech data and the number of training samples in the second speech data are not limited. In this embodiment, the proportion of the number of training samples in the first speech data to the speech data to be screened and the proportion of the number of training samples in the second speech data to the speech data to be screened are not limited.
[0062] S102: Select the first confidence sample and the second confidence sample from the first speech data.
[0063] The confidence level of the first confidence level sample is higher than that of the second confidence level sample.
[0064] Obtain the confidence score of each training sample in the first speech data. Based on the confidence scores of the training samples, select the required first confidence score samples and second confidence score samples. Perform subsequent speech recognition steps based on the selected first confidence score data and second confidence score data.
[0065] S103: Select the first similarity sample and the second similarity sample from the second speech data.
[0066] Among them, the similarity of the first similarity sample is higher than that of the second similarity sample.
[0067] At least two speech recognition models are used to perform speech recognition on the training samples in the second speech data to obtain two sets of recognition texts corresponding to each training sample. Then, based on the similarity of the contents of these two recognition texts, a first similarity sample and a second similarity sample are selected from the second speech data. The subsequent steps of speech recognition are then performed based on the selected first similarity sample and second similarity sample.
[0068] S104: The target speech recognition model is trained based on the first confidence sample, the second confidence sample, the first similarity sample, and the second similarity sample.
[0069] Among them, the target speech recognition model is used to perform speech recognition on the target speech.
[0070] The first confidence sample, second confidence sample, first similarity sample, and second similarity sample are manually labeled. For example, the actual speech text of these training samples is used as the text label for that training sample. The manually labeled first confidence sample, second confidence sample, first similarity sample, and second similarity sample are then input into the target speech recognition model for training, resulting in a trained target speech recognition model. This model is then used to recognize target speech.
[0071] In summary, this invention discloses a speech recognition method. It divides the speech data to be screened into first speech data and second speech data. Then, it selects first confidence samples and second confidence samples from the first speech data, and first similarity samples and second similarity samples from the second speech data. Finally, it trains a target speech recognition model for recognizing the target speech based on the selected first confidence samples, second confidence samples, first similarity samples, and second similarity samples. As can be seen, this embodiment uses two screening schemes to screen the first and second speech data to be screened, using the obtained first confidence samples, second confidence samples, first similarity samples, and second similarity samples to train the target speech recognition model. Compared to existing methods that randomly select training samples, this method can better ensure the quality of the training samples and improve the recognition performance of the speech recognition model. Applying the trained target speech recognition model to a medical guidance system in the digital healthcare field can effectively improve the speech recognition accuracy of the medical guidance system or medical guidance robots equipped with such systems.
[0072] based on Figure 1 In its specific implementation, step S102 can be achieved through the following steps, such as... Figure 2 As shown:
[0073] S201: Input the training samples from the first speech data into the first speech recognition model to obtain the confidence level of each training sample.
[0074] The training samples are input into the first speech recognition model to obtain several speech candidate results. Each speech candidate result corresponds to a candidate score. The two speech candidate results with the highest scores are selected from these speech candidate results, and the confidence of the training samples is calculated based on the candidate scores corresponding to these two speech candidate results.
[0075] S202: Determine whether the confidence level of the training sample is greater than the first confidence threshold.
[0076] If the confidence level of the training sample is greater than the first confidence threshold, proceed to step S203, that is, determine the training sample as the first confidence sample. If the confidence level of the training sample is less than the first confidence threshold, proceed to step S204, that is, determine whether the confidence level of the training sample is greater than the second confidence threshold and less than the first confidence threshold.
[0077] In a specific implementation, this embodiment can preset a first confidence threshold, and compare the confidence of each training sample with the first confidence threshold. If the confidence of the training sample is greater than the first confidence threshold, step S203 and subsequent steps are executed. If the confidence of the training sample is less than the first confidence threshold, step S204 and subsequent steps are executed.
[0078] S203: Determine the training sample as the first confidence sample.
[0079] In other words, the confidence level of the first confidence level sample is the training sample whose confidence level is greater than the first confidence threshold.
[0080] S204: Determine whether the confidence level of the training sample is greater than the second confidence threshold and less than the first confidence threshold.
[0081] If the confidence level of a training sample is greater than the second confidence threshold and less than the first confidence threshold, step S205 is executed, that is, the training sample is determined to be a second confidence sample. If the confidence level of a training sample is less than the second confidence threshold, the training sample is discarded. In other words, training samples with a confidence level less than the second confidence threshold will not participate in the subsequent steps of the speech recognition method.
[0082] In this specific implementation, a second confidence threshold can be preset. Training samples with confidence levels lower than the first confidence threshold are subjected to secondary screening to obtain training samples with confidence levels higher than the second confidence threshold and lower than the first confidence threshold, which are then used as second confidence samples. If the confidence level of a training sample is higher than the second confidence threshold and lower than the first confidence threshold, step S205 and subsequent steps are executed. If the confidence level of a training sample is lower than the second confidence threshold, the training sample is discarded. Training samples with confidence levels lower than the second confidence threshold will not participate in subsequent steps of the speech recognition method. Based on this, the second confidence samples can be obtained.
[0083] S205: Determine the training sample as the second confidence level sample.
[0084] It should be understood that the confidence level of a second confidence level sample is the training sample whose confidence level is greater than the second confidence level threshold and less than the first confidence level threshold.
[0085] In summary, this embodiment obtains the confidence level of each training sample in the first speech data, and then filters out the first confidence sample and the second confidence sample from the first speech data according to the preset first confidence threshold and the second confidence threshold, so as to complete the filtering of the first speech data and achieve the purpose of removing the training samples with low quality in the first speech data.
[0086] based on Figure 2 In its specific implementation, step S201 can be achieved through the following steps, such as... Figure 3 As shown:
[0087] S301: Input each training sample in the first speech data into the first speech recognition model to obtain several speech recognition results for each training sample and the score corresponding to each speech recognition result.
[0088] In a specific implementation, the training samples in the first speech data can be input into the first speech recognition model, and then speech recognition can be performed on each training sample to obtain several speech recognition results for each training sample. Each speech recognition result corresponds to a score, and the subsequent steps of the speech recognition method are executed according to the score corresponding to the obtained speech recognition result.
[0089] S302: Select the scores corresponding to the two highest-scoring speech recognition results and calculate the confidence level of the training samples.
[0090] For each training sample, select the two highest-scoring speech recognition results and calculate the confidence level of the training sample based on the scores of these two speech recognition results.
[0091] In this specific implementation, for each training sample's speech recognition results, the two highest scores are selected, and the difference between these two scores is calculated. This difference is then normalized, and the resulting value in the 0-1 range represents the confidence level of the training sample. Based on this, the confidence level corresponding to each training sample is calculated, and subsequent steps of the speech recognition method are executed according to the calculated confidence level for each training sample.
[0092] In summary, this embodiment normalizes the difference between the scores of the two highest-scoring speech recognition results to obtain a value in the 0-1 range, and uses this value to represent the confidence level of the training sample. This makes the confidence level data easier to process in subsequent steps of the speech recognition method.
[0093] based on Figure 1 In its specific implementation, step S103 can be achieved through the following steps, such as... Figure 4 As shown:
[0094] S401: Input the training samples from the second speech data into the second speech recognition model to obtain the first recognized text of each training sample;
[0095] In this specific implementation, the second speech recognition model includes, but is not limited to, the traditional HMM-DNN hybrid model, the CTC-based end-to-end model, the joint-CTC-attention model, or the RNN-T model. Each training sample in the second speech data is input into the second speech recognition model to obtain the first recognized text corresponding to each training sample. Subsequent steps of the speech recognition method are then executed based on the obtained first recognized text.
[0096] S402: Input the training samples from the second speech data into the third speech recognition model to obtain the second recognition text for each training sample.
[0097] The second and third speech recognition models are trained using sample features from different dimensions. In other words, the sample features input to the second and third speech recognition models during training differ. By extracting features from different dimensions of the training samples, the second and third speech recognition models are trained separately. For example, 80-dimensional frequency domain (fbank) features are extracted from the training samples to train the second speech recognition model, and 40-dimensional fbank features are extracted to train the third speech recognition model.
[0098] In addition, it should be noted that the difference between the second speech recognition model and the third speech recognition model can be reflected not only in the feature dimension of the sample features, but also in the high and low frequency cutoff frequencies, the pre-emphasis coefficients, whether to add first-order and second-order differences, whether to introduce pitch features, whether to retain DC components, whether to introduce random jitter, etc. In this embodiment, no specific limitation is made on which aspect the difference between training the second speech recognition model and the third speech recognition model is reflected.
[0099] In this specific implementation, the second speech recognition model includes, but is not limited to, the traditional HMM-DNN hybrid model, the CTC-based end-to-end model, the joint-CTC-attention model, or the RNN-T model. Each training sample in the second speech data is input into the third speech recognition model to obtain the second recognized text corresponding to each training sample. The subsequent steps of the speech recognition method are then executed based on the obtained second recognized text.
[0100] S403: Based on the first and second recognized texts, select the first similarity sample and the second similarity sample from the second speech data.
[0101] In a specific implementation, this embodiment can obtain the similarity between the text content of the first recognized text and the text content of the second recognized text by comparing the text content of the first recognized text and the text content of the second recognized text. Then, based on the similarity between the first recognized sample and the second recognized sample, the first similarity sample and the second similarity sample are selected from the second speech data. The subsequent steps of speech recognition are performed based on the obtained first similarity sample and the second similarity sample.
[0102] In summary, by using two models to identify the training samples, if the identification results of the two models are the same or basically the same, the current training sample can be determined to be a high-quality sample. Based on this, high-quality sample data can be selected from the second speech book.
[0103] based on Figure 4 In its specific implementation, step S403 can be achieved through the following steps, such as... Figure 5 As shown:
[0104] S501: Determine whether the text content of the first recognized text and the text content of the second recognized text in the training sample are the same.
[0105] If the text content of the first recognized text and the text content of the second recognized text of the training sample are the same, proceed to step S502, that is, determine the training sample as the first similarity sample. If the text content of the first recognized text and the text content of the second recognized text of the training sample are different, proceed to step S503, that is, obtain the word error rate of the text content of the first recognized sample and the text content of the second recognized sample.
[0106] In a specific implementation, this embodiment can determine whether the text content of the first identified text and the text content of the second identified text of the training sample are the same by comparing the text content of the first identified text and the text content of the second identified text. If the text content of the first identified text and the text content of the second identified text of the training sample are the same, step S502 and subsequent steps are executed. If the text content of the first identified text and the text content of the second identified text of the training sample are different, step S503 and subsequent steps are executed.
[0107] S502: Determine the training sample as the first similarity sample.
[0108] In other words, the first similarity sample is a sample whose text content of the first identified text of the training sample is exactly the same as the text content of the second identified text.
[0109] S503: Obtain the word error rate of the text content of the first recognition sample and the text content of the second recognition sample.
[0110] In a specific implementation, in this embodiment, the text content of the first recognition text can be used as the reference text, the text content of the second recognition text can be used as the recognition text, and then the recognition text is compared with the reference text character by character. Then, the number of incorrect characters, missing characters, and added characters in the recognition text compared to the reference text are divided by the total number of characters in the reference text to obtain the word error rate of the text content of the first recognition sample and the text content of the second recognition sample, that is, the word error rate of the training sample. Accordingly, the word error rate of the text content of the first recognition sample and the text content of the second recognition sample can be obtained.
[0111] For example, taking the reference text as "Have you eaten?" and the recognition text "Have you eaten?" as an example. Among them, the recognition text is missing the character "们" compared to the reference text, and the characters "么" in the recognition text and "吗" in the reference text are different. Therefore, the word error rate of the recognition text compared to the reference text is 2 / 6 = 33.3%. Accordingly, the word error rate of the recognition text compared to the reference text can be obtained.
[0112] S504: Determine whether the word error rate of the text content of the first recognition sample and the text content of the second recognition sample is lower than a preset word error rate threshold.
[0113] If the word error rate of the text content of the first recognition sample and the text content of the second recognition sample is lower than the preset word error rate threshold, execute step S505, that is, determine the training sample as the second similarity sample. If the word error rate of the text content of the first recognition sample and the text content of the second recognition sample is higher than the preset word error rate threshold, discard the training sample. That is, the training sample with the word error rate of the text content of the first recognition sample and the text content of the second recognition sample higher than the preset word error rate threshold will no longer participate in the subsequent steps of the speech recognition method.
[0114] S505: Determine the training sample as the second similarity sample.
[0115] That is to say, the second similarity sample is the training sample whose word error rate of the text content of the first recognition sample and the text content of the second recognition sample is lower than the preset word error rate threshold, and the text content of the first recognition sample and the text content of the second recognition sample are not completely the same.
[0116] In summary, this embodiment divides the training samples in the second speech data into first similarity samples and second similarity samples by comparing the text content of the first recognized text and the text content of the second recognized text, and by calculating the word error rate of the first recognized text. It can be seen that by comprehensively selecting the first similarity samples and second similarity samples through the speech recognition results of two speech recognition models, the quality of the training samples can be effectively guaranteed compared with the training samples selected by a single model.
[0117] based on Figure 1 In its specific implementation, step S104 can be achieved through the following steps, such as... Figure 6 As shown:
[0118] S601: Input the first confidence sample and the first similarity sample into the target speech recognition model to perform the first stage of training.
[0119] In specific implementation, the target speech recognition model in this embodiment includes, but is not limited to, the traditional hmm-dnn hybrid model, the end-to-end model based on CTC, the joint-ctc-attention model, or the RNN-T model. This embodiment does not impose specific limitations on the target speech recognition model.
[0120] S602: Input the second confidence sample and the second similarity sample into the target speech recognition model to perform the second stage of training and obtain the trained target speech recognition model.
[0121] In this specific implementation, the first confidence sample and the first similarity sample, which are of higher quality, are input into the target speech recognition model for the first stage of training. After the model achieves a good training effect, the second confidence sample and the second similarity sample, which are of lower quality than the first confidence sample and the first similarity sample, are input into the target speech recognition model for the second stage of training, so as to further improve the training effect of the target speech recognition model. Based on this, a well-trained target speech recognition model can be obtained.
[0122] In summary, the target speech recognition model in this embodiment is first trained using the highest quality first confidence samples and first similarity samples, enabling it to quickly achieve good training results. After the target speech recognition model is sufficiently trained, inputting the lower quality second confidence samples and second similarity samples further improves its training performance. Therefore, a target speech recognition model with better training results can be obtained. Applying the trained target speech recognition model to a medical guidance system in the digital healthcare field can effectively improve the speech recognition accuracy of the system or medical guidance robots equipped with such systems.
[0123] In one implementation, the first phase of training and the second phase of training are distinguished in the following way:
[0124] When the target speech recognition model is trained for the first time, it is determined that the target speech recognition model is in the first stage of training; when the number of training iterations of the target speech recognition model reaches the preset number of iterations, it is determined that the target speech recognition model is in the second stage of training.
[0125] In other words, in this embodiment, whether the target speech recognition model enters the first stage of training and whether it enters the second stage of training can be determined based on the number of training iterations. The preset number of iterations can be set according to the type of the target speech recognition model. For example, taking a preset number of iterations of 20, after inputting the first confidence sample and the first similarity sample into the target speech recognition model for 20 iterations of training, the second confidence sample and the second similarity sample are input into the target speech recognition model for the second stage of training. Based on this, a trained target speech recognition model can be obtained.
[0126] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0127] Example 2
[0128] like Figure 7 As shown in the diagram, this invention discloses a structural schematic of a voice recognition device. This device is applicable to medical guidance systems in the field of digital healthcare, such as medical guidance robots equipped with this system. The robot can collect voice signals from patients or their families, perform voice recognition, and then provide services such as consultation, registration, and directions to patients or their families. Details are shown below:
[0129] In a specific implementation, the speech recognition device in this embodiment may include the following units:
[0130] The voice data acquisition unit 701 is used to acquire voice data to be filtered, which includes first voice data and second voice data.
[0131] The first sample filtering unit 702 is used to filter out a first confidence sample and a second confidence sample from the first speech data; the confidence of the first confidence sample is higher than the confidence of the second confidence sample.
[0132] The second sample filtering unit 703 is used to filter out a first similarity sample and a second similarity sample from the second speech data; the similarity of the first similarity sample is higher than the similarity of the second similarity sample.
[0133] The model training unit 704 is used to train a target speech recognition model based on the first confidence sample, the second confidence sample, the first similarity sample and the second similarity sample. The target speech recognition model is used to perform speech recognition on the target speech.
[0134] In one implementation, the first sample screening unit 702 can specifically be used for:
[0135] The training samples from the first speech data are input into the first speech recognition model to obtain the confidence score of each training sample.
[0136] Determine whether the confidence level of the training sample is greater than the first confidence threshold;
[0137] If the confidence level of a training sample is greater than the first confidence threshold, the training sample is determined to be a first confidence sample.
[0138] Determine whether the confidence level of the training sample is greater than the second confidence threshold and less than the first confidence threshold;
[0139] If the confidence level of a training sample is greater than the second confidence threshold but less than the first confidence threshold, the training sample is determined to be a second confidence sample.
[0140] In one implementation, the first sample screening unit 702 can also be used for:
[0141] The training samples in the first speech data are input into the first speech recognition model to obtain several speech recognition results for each training sample and the score corresponding to each speech recognition result.
[0142] The confidence level of the training samples is calculated by selecting the scores corresponding to the two highest-scoring speech recognition results.
[0143] In one implementation, the second sample screening unit 703 can specifically be used for:
[0144] The training samples in the second speech data are input into the second speech recognition model to obtain the first recognized text of each training sample.
[0145] The training samples from the second speech data are input into the third speech recognition model to obtain the second recognized text for each training sample; therefore, the second and third speech recognition models are trained using sample features of different dimensions.
[0146] Based on the first and second recognized texts, first similarity samples and second similarity samples are selected from the second speech data.
[0147] In one implementation, the second sample screening unit 703 can also be used for:
[0148] Determine whether the text content of the first identified text and the text content of the second identified text in the training sample are the same;
[0149] If the text content of the first identified text and the text content of the second identified text in the training sample are the same, the training sample is determined to be the first similarity sample.
[0150] If the text content of the first recognized text and the text content of the second recognized text in the training samples are different, obtain the word error rate of the text content of the first recognized text and the text content of the second recognized text.
[0151] Determine whether the word error rate of the text content of the first recognition sample and the text content of the second recognition sample is lower than the preset word error rate threshold;
[0152] If the word error rate of the text content of the first recognition sample and the text content of the second recognition sample is lower than the preset word error rate threshold, the training sample is determined as the second similarity sample.
[0153] In one implementation, the model training unit 704 can be specifically the same as:
[0154] The first confidence sample and the first similarity sample are input into the target speech recognition model for the first stage of training;
[0155] The second confidence sample and the second similarity sample are input into the target speech recognition model for the second stage of training, resulting in a trained target speech recognition model.
[0156] In one implementation, the first phase of training and the second phase of training are distinguished in the following way:
[0157] When the target speech recognition model is trained for the first time, it is determined that the target speech recognition model is in the first stage of training;
[0158] When the number of training iterations of the target speech recognition model reaches the preset number of iterations, the target speech recognition model is determined to be in the second stage of training.
[0159] For specific limitations regarding the speech recognition device, please refer to the limitations on the speech recognition method mentioned above, which will not be repeated here. Each module in the aforementioned speech recognition device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in the computer device in hardware form, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0160] Example 3
[0161] Embodiment 3 of this application discloses a computer device, which can be a server, and its internal structure diagram can be as follows: Figure 8 As shown, the computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it implements a speech recognition method.
[0162] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to perform the following steps:
[0163] The voice data to be filtered is obtained, which includes the first voice data and the second voice data.
[0164] A first confidence sample and a second confidence sample are selected from the first voice data; the confidence level of the first confidence sample is higher than that of the second confidence sample.
[0165] First similarity samples and second similarity samples are selected from the second speech data; the similarity of the first similarity samples is higher than that of the second similarity samples.
[0166] Based on the first confidence sample, the second confidence sample, the first similarity sample, and the second similarity sample, a target speech recognition model is trained, which is used to perform speech recognition on the target speech.
[0167] Example 4
[0168] Embodiment 4 of this application discloses a computer-readable storage medium that, when executed by a processor in a computer device, enables the computer device to perform the steps of any embodiment of the speech recognition method disclosed in this invention. The computer-readable storage medium may be non-volatile or volatile.
[0169] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:
[0170] The voice data to be filtered is obtained, which includes the first voice data and the second voice data.
[0171] A first confidence sample and a second confidence sample are selected from the first voice data; the confidence level of the first confidence sample is higher than that of the second confidence sample.
[0172] First similarity samples and second similarity samples are selected from the second speech data; the similarity of the first similarity samples is higher than that of the second similarity samples.
[0173] Based on the first confidence sample, the second confidence sample, the first similarity sample, and the second similarity sample, a target speech recognition model is trained, which is used to perform speech recognition on the target speech.
[0174] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0175] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0176] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.
Claims
1. A speech recognition method, characterized in that, The method includes: The voice data to be filtered is obtained, which includes first voice data and second voice data; A first confidence sample and a second confidence sample are selected from the first speech data; the confidence of the first confidence sample is higher than the confidence of the second confidence sample; wherein, the confidence calculation process includes: for each training sample corresponding to several speech recognition results, selecting the scores corresponding to the two speech recognition results with the highest scores, calculating the difference between the two scores, and normalizing the difference to obtain a value in the range of 0-1 as the confidence of the training sample; A first similarity sample and a second similarity sample are selected from the second speech data; the similarity of the first similarity sample is higher than that of the second similarity sample. Based on the first confidence sample, the second confidence sample, the first similarity sample, and the second similarity sample, a target speech recognition model is trained, which is used to perform speech recognition on the target speech. The step of training a target speech recognition model based on the first confidence sample, the second confidence sample, the first similarity sample, and the second similarity sample includes: inputting the first confidence sample and the first similarity sample into the target speech recognition model for a first-stage training; and inputting the second confidence sample and the second similarity sample into the target speech recognition model for a second-stage training to obtain the trained target speech recognition model. The step of selecting a first similarity sample and a second similarity sample from the second speech data, wherein the similarity of the first similarity sample is higher than that of the second similarity sample, includes: inputting training samples from the second speech data into a second speech recognition model to obtain a first recognition text for each training sample; inputting training samples from the second speech data into a third speech recognition model to obtain a second recognition text for each training sample; therefore, the second speech recognition model and the third speech recognition model are trained using sample features of different dimensions; extracting 80-dimensional frequency domain features from the training samples to train the second speech recognition model, and extracting 40-dimensional frequency domain features from the training samples to train the third speech recognition model; and selecting the first similarity sample and the second similarity sample from the second speech data based on the first recognition text and the second recognition text.
2. The method as described in claim 1, characterized in that, The step of filtering the first confidence sample and the second confidence sample from the first speech data includes: The training samples in the first speech data are input into the first speech recognition model to obtain the confidence level of each training sample. Determine whether the confidence level of the training sample is greater than the first confidence threshold; If the confidence level of the training sample is greater than the first confidence threshold, the training sample is determined to be the first confidence level sample; Determine whether the confidence level of the training sample is greater than the second confidence threshold and less than the first confidence threshold; If the confidence level of the training sample is greater than the second confidence threshold and less than the first confidence threshold, then the training sample is determined to be a sample with the second confidence level.
3. The method as described in claim 2, characterized in that, The step of inputting training samples from the first speech data into the first speech recognition model to obtain the confidence score of each training sample includes: The training samples in the first speech data are respectively input into the first speech recognition model to obtain several speech recognition results for each training sample and a score corresponding to each speech recognition result. The confidence level of the training sample is calculated by selecting the scores corresponding to the two highest-scoring speech recognition results.
4. The method as described in claim 1, characterized in that, The step of filtering the first similarity sample and the second similarity sample from the second speech data based on the first recognized text and the second recognized text includes: Determine whether the text content of the first identified text and the text content of the second identified text in the training sample are the same; If the text content of the first identified text in the training sample is the same as the text content of the second identified text, the training sample is determined to be the first similarity sample. If the text content of the first recognized text and the text content of the second recognized text in the training sample are different, obtain the word error rate of the text content of the first recognized text and the text content of the second recognized text. Determine whether the word error rate of the text content of the first recognition sample and the text content of the second recognition sample is lower than a preset word error rate threshold; If the word error rate of the text content of the first recognition sample and the text content of the second recognition sample is lower than a preset word error rate threshold, the training sample is determined to be the second similarity sample.
5. The method as described in claim 1, characterized in that, The first phase of training and the second phase of training are distinguished in the following ways: When the target speech recognition model is trained for the first time, it is determined that the target speech recognition model is in the first stage of training; When the number of training iterations of the target speech recognition model reaches the preset number of iterations, the target speech recognition model is determined to be in the second stage of training.
6. A voice recognition device, characterized in that, include: A voice data acquisition unit is used to acquire voice data to be filtered, wherein the voice data to be filtered includes first voice data and second voice data; The first sample filtering unit is used to filter out a first confidence sample and a second confidence sample from the first voice data; The confidence level of the first confidence sample is higher than that of the second confidence sample; The second sample filtering unit is used to filter out the first similarity sample and the second similarity sample from the second speech data; The similarity of the first similarity sample is higher than that of the second similarity sample; The model training unit is used to train a target speech recognition model based on the first confidence sample, the second confidence sample, the first similarity sample, and the second similarity sample. The target speech recognition model is used to perform speech recognition on the target speech. The step of training a target speech recognition model based on the first confidence sample, the second confidence sample, the first similarity sample, and the second similarity sample includes: inputting the first confidence sample and the first similarity sample into the target speech recognition model for a first-stage training; and inputting the second confidence sample and the second similarity sample into the target speech recognition model for a second-stage training to obtain the trained target speech recognition model. The step of selecting a first similarity sample and a second similarity sample from the second speech data, wherein the similarity of the first similarity sample is higher than that of the second similarity sample, includes: inputting training samples from the second speech data into a second speech recognition model to obtain a first recognition text for each training sample; inputting training samples from the second speech data into a third speech recognition model to obtain a second recognition text for each training sample; therefore, the second speech recognition model and the third speech recognition model are trained using sample features of different dimensions; and selecting the first similarity sample and the second similarity sample from the second speech data based on the first recognition text and the second recognition text.
7. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the speech recognition method as described in any one of claims 1 to 5.
8. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the speech recognition method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Speech recognition model training method and speech recognition method and device
CN110827805A
Voice recognition acoustic model training method, system and device and medium
CN111883110A
Speech recognition model training method and device, electronic equipment and storage medium
CN115035890A