Training method and device for voice line recognition model, voice line recognition method and device
By clustering and labeling speech samples, the problem of insufficient annotation data in voice recognition is solved, and efficient training and strong generalization effects of the voice recognition model are achieved.
Patent Information
- Application Number
- CN202111591448.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-23
- Publication Date
- 2024-10-25
- Estimated Expiration
- 2041-12-23
AI Technical Summary
In the field of intelligent speech and voiceprint recognition technology, how to generate massive annotation data has become a difficulty that restricts the performance of the algorithm. Especially in voice recognition, it is necessary to determine the voice type of speech but lacks sufficient annotation data.
By clustering multiple speech samples and using the characteristics that the speech corresponding to the same speech output object label should belong to a type of voice line, the speech samples carrying the speech output object label were subjected to unsupervised clustering and a small number of annotations. Successfully Label conversion is realized, the same voice is regarded as the same person, and the supervised learning voice recognition algorithm is trained according to the training method of voiceprint recognition.
Without the need for a large amount of manual annotation of voice types, a large amount of supervised voice recognition data is obtained, and the trained voice recognition model has strong generalization.
Smart Images

Figure CN114299964B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of intelligent voice technology, and in particular to a method and device for training a voice line recognition model, and a method and device for voice line recognition. Background Art
[0002] With the development of artificial intelligence technology, machine learning and deep learning methods have been widely used in various fields. In the field of intelligent voice, the technology of distinguishing and identifying different people through human voice signals is called voiceprint recognition. The mainstream technology is supervised algorithm, including Gaussian mixture model (such as GMM-UBM, Gaussian Mixture Model-Universal Background Model), factor analysis (such as I-vector) and deep learning algorithm (such as X-Vector). Extended applications include distinguishing gender, age, etc. through human voice, and gradually extending to distinguishing voice types, such as loli voice, girl voice, and royal sister voice. Voice recognition does not need to distinguish whether it belongs to a certain person like traditional voiceprint recognition, but only needs to judge whether it belongs to a certain type of voice. As an extended application of voiceprint recognition, how to generate massive labeled data has become a difficulty that restricts the performance of the algorithm. Summary of the invention
[0003] The present disclosure provides a method and device for training a sound line recognition model, and a method and device for sound line recognition, so as to at least solve the problem of how to generate massive labeled data in the related art, and may not solve any of the above problems.
[0004] According to a first aspect of the present disclosure, a training method for a voice line recognition model is provided, comprising: obtaining a plurality of speech samples, each of the speech samples carrying a speech output object label; performing clustering processing on the plurality of speech samples to obtain a plurality of speech sample sets; wherein speech samples carrying the same speech output object label are classified into the same speech sample set; extracting a preset number of sampled speech samples from each of the speech sample sets to obtain first voice line type labels for the preset number of sampled speech samples; obtaining a second voice line type label corresponding to the corresponding speech sample set according to a target first voice line type label that meets a preset condition among the preset number of first voice line type labels; training a preset machine learning module according to the speech samples in each of the speech sample sets and the corresponding second voice line type labels to obtain a voice line recognition model.
[0005] Optionally, clustering the multiple voice samples to obtain multiple voice sample sets includes: cutting each of the voice samples to obtain multiple voice sample segments; extracting embedded features of the multiple voice sample segments corresponding to each of the voice samples, and calculating the average value of the extracted multiple embedded features as the embedded features of the corresponding voice samples; clustering the embedded features of the multiple voice samples to obtain the multiple voice sample sets.
[0006] Optionally, clustering the embedded features of the multiple speech samples to obtain the multiple speech sample sets includes: dividing the embedded features of the multiple speech samples into multiple clusters based on a preset clustering algorithm; in response to determining that more than a first proportion of the embedded features corresponding to the same speech output object label belong to the same cluster, all the speech samples carrying the corresponding speech output object label are classified into a speech sample set corresponding to the same cluster to obtain the multiple speech sample sets; or in response to determining that more than a first proportion of the embedded features corresponding to the same speech output object label belong to the same cluster, the speech samples corresponding to the embedded features exceeding the first proportion are classified into a speech sample set corresponding to the same cluster to obtain the multiple speech sample sets.
[0007] Optionally, clustering the multiple speech samples to obtain multiple speech sample sets includes: dividing the speech samples into multiple groups; clustering each group of speech samples separately to obtain multiple speech sample sets corresponding to each group; and merging the speech sample sets that have common speech output object labels between different groups to obtain the multiple speech sample sets.
[0008] Optionally, obtaining the second voice line type label corresponding to the corresponding speech sample set based on the target first voice line type label that meets the preset conditions among the preset number of first voice line type labels includes: traversing each of the speech sample sets, and in response to determining that there is a target first voice line type label among the preset number of first voice line type labels of the current speech sample set, and the proportion of the target first voice line type label exceeds a second proportion, using the target first voice line type label as the second voice line type label corresponding to the current speech sample set.
[0009] Optionally, before training the preset machine learning module according to the speech samples in each of the speech sample sets and the corresponding second voice line type labels to obtain the voice line recognition model, the training method further includes: in response to determining that there are speech samples without the second voice line type label, adjusting the parameters of the clustering processing, and re-clustering the speech samples without the second voice line type label.
[0010] Optionally, in response to determining that there are speech samples without the second voice line type label, adjusting the parameters of clustering processing, and re-clustering the speech samples without the second voice line type label, includes: in response to determining that the speech samples of at least one speech sample set do not have the second voice line type label, adjusting the parameters of clustering processing to increase the number of clusters based on the initial number of clusters, and re-clustering the speech samples of the at least one speech sample set until each speech sample of the speech sample set has the second voice line type label.
[0011] Optionally, after the clustering processing, among the speech samples carrying the same speech output object label, the proportion of speech samples included in the same speech sample set exceeds a set proportion or is zero, and the remaining speech samples are not included in any of the speech sample sets, wherein in response to determining that there are speech samples without the second voice line type label, adjusting the parameters of the clustering processing, and re-clustering the speech samples without the second voice line type label, also includes: in response to determining that there are speech samples that are not included in any of the speech sample sets, adjusting the parameters of the clustering processing to reduce the initial number of clusters, and re-clustering the speech samples that are not included in any of the speech sample sets.
[0012] Optionally, in response to determining that there are speech samples without the second voice line type label, adjusting the parameters of clustering processing, and re-clustering the speech samples without the second voice line type label, also includes: in response to determining that the number of reductions in the initial number of clusters has reached a set number of times, and there are still speech samples that are not included in any of the speech sample sets, judging whether the number of speech samples with the second voice line type label has reached a target number, if so, stopping adjusting the parameters of clustering processing, if not, adjusting the conditions for obtaining the multiple speech sample sets and / or the conditions for obtaining the second voice line type label, and clearing the recorded number of reductions in the initial number of clusters to zero, and continuing to adjust the parameters of clustering processing.
[0013] Optionally, the method of training a preset machine learning module according to the speech samples in each of the speech sample sets and the corresponding second voice line type labels to obtain a voice line recognition model includes: extracting acoustic features of each of the speech samples; inputting the acoustic features into the preset machine learning module to obtain the corresponding predicted voice line type of the speech sample; determining the value of the loss function of the preset machine learning module according to the predicted voice line type and the second voice line type label of the same speech sample; and adjusting the parameters of the preset machine learning module according to the value of the loss function to obtain the voice line recognition model.
[0014] According to a second aspect of the present disclosure, a voice line recognition method is provided, comprising: obtaining a speech to be recognized; extracting acoustic features of the speech to be recognized; inputting the acoustic features into a voice line recognition model to obtain an estimated voice line type of the speech to be recognized, wherein the voice line recognition model is trained using the above-mentioned training method.
[0015] According to a third aspect of the present disclosure, a training device for a voice line recognition model is provided, comprising: an acquisition unit, configured to execute acquisition of multiple voice samples, each of which carries a voice output object label; a clustering unit, configured to perform clustering processing on the multiple voice samples to obtain multiple voice sample sets; wherein the voice samples carrying the same voice output object label are classified into the same voice sample set; a labeling unit, configured to execute extraction of a preset number of sampled voice samples from each of the voice sample sets to obtain first voice line type labels of the preset number of sampled voice samples; a determination unit, configured to execute, according to the target first voice line type labels that meet the preset conditions in the preset number of first voice line type labels, to obtain a second voice line type label corresponding to the corresponding voice sample set; a training unit, configured to execute training of a preset machine learning module according to the voice samples in each of the voice sample sets and the corresponding second voice line type labels to obtain a voice line recognition model.
[0016] Optionally, the clustering unit includes: a cutting unit, configured to perform cutting processing on each of the speech samples to obtain multiple speech sample segments; a preparation unit, configured to extract embedded features of the multiple speech sample segments corresponding to each of the speech samples, and calculate the average value of the extracted multiple embedded features as the embedded features of the corresponding speech sample; and a processing unit, configured to perform clustering processing on the embedded features of the multiple speech samples to obtain the multiple speech sample sets.
[0017] Optionally, the processing unit includes: a clustering subunit, configured to execute division of the embedded features of the multiple speech samples into multiple clusters based on a preset clustering algorithm; a classification subunit, configured to execute, in response to determining that more than a first proportion of the embedded features corresponding to the same speech output object label belong to the same cluster, classify all the speech samples carrying the corresponding speech output object label into a speech sample set corresponding to the same cluster to obtain the multiple speech sample sets, or configured to execute, in response to determining that more than a first proportion of the embedded features corresponding to the same speech output object label belong to the same cluster, classify the speech samples corresponding to the embedded features exceeding the first proportion into a speech sample set corresponding to the same cluster to obtain the multiple speech sample sets.
[0018] Optionally, the clustering unit includes: a grouping unit, configured to perform grouping of the multiple voice samples into multiple groups; a grouping processing unit, configured to perform clustering processing on each group of the voice samples separately to obtain multiple voice sample sets corresponding to each group; and a merging unit, configured to perform merging processing on the voice sample sets that have common voice output object labels between different groups to obtain the multiple voice sample sets.
[0019] Optionally, the determination unit is further configured to: traverse each of the speech sample sets, and in response to determining that there is a target first voice line type label among the preset number of first voice line type labels in the current voice sample set, and satisfying that the proportion of the target first voice line type label exceeds a second proportion, use the target first voice line type label as the second voice line type label corresponding to the current speech sample set.
[0020] Optionally, the training device also includes: a parameter adjustment unit, configured to adjust the parameters of clustering processing in response to determining that there are speech samples without the second voice line type label, and call the clustering unit to re-cluster the speech samples without the second voice line type label.
[0021] Optionally, the parameter adjustment unit is also configured to adjust the parameters of clustering processing in response to determining that the speech samples of at least one speech sample set do not have the second voice line type label, so as to increase the number of clusters based on the initial number of clusters, and call the clustering unit to re-cluster the speech samples of the at least one speech sample set until each speech sample of the speech sample set has the second voice line type label.
[0022] Optionally, after the clustering processing, among the speech samples carrying the same speech output object label, the proportion of speech samples belonging to the same speech sample set exceeds a set ratio or is zero, and the remaining speech samples are not included in any of the speech sample sets. The parameter adjustment unit is also configured to execute, in response to determining that there are speech samples that are not included in any of the speech sample sets, adjust the parameters of the clustering processing to reduce the initial number of clusters, and call the clustering unit to re-cluster the speech samples that are not included in any speech sample set.
[0023] Optionally, the parameter adjustment unit is also configured to execute, in response to determining that the number of reductions in the initial number of clusters has reached a set number and there are still voice samples that are not included in any of the voice sample sets, whether the number of voice samples with the second voice line type label has reached a target number, and if so, stop adjusting the parameters of the clustering processing; if not, adjust the conditions for obtaining the multiple voice sample sets and / or the conditions for obtaining the second voice line type label, and clear the recorded number of reductions in the initial number of clusters to zero, and continue to adjust the parameters of the clustering processing.
[0024] Optionally, the training unit includes: an extraction unit configured to extract the acoustic features of each of the speech samples; a prediction unit configured to input the acoustic features into the preset machine learning module to obtain the predicted voice type of the corresponding speech sample; a calculation unit configured to determine the value of the loss function of the preset machine learning module based on the predicted voice type and the second voice type label of the same speech sample; and an adjustment unit configured to adjust the parameters of the preset machine learning module according to the value of the loss function to obtain the voice recognition model.
[0025] According to a fourth aspect of the present disclosure, a voice line recognition device is provided, comprising: an acquisition unit, configured to execute acquisition of a speech to be recognized; an extraction unit, configured to execute extraction of acoustic features of the speech to be recognized; and a recognition unit, configured to execute input of the acoustic features into a voice line recognition model to obtain an estimated voice line type of the speech to be recognized, wherein the voice line recognition model is trained using the above-mentioned training method.
[0026] According to a fifth aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and at least one memory storing computer executable instructions, wherein the computer executable instructions, when executed by the at least one processor, prompt the at least one processor to execute a training method for a sound line recognition model or a sound line recognition method according to the present disclosure.
[0027] According to a sixth aspect of the present disclosure, a computer-readable storage medium is provided. When instructions in the computer-readable storage medium are executed by at least one processor, the at least one processor is prompted to execute the training method of the sound line recognition model or the sound line recognition method according to the present disclosure.
[0028] According to a seventh aspect of the present disclosure, a computer program product is provided, comprising computer instructions, which, when executed by at least one processor, implement the training method of the sound line recognition model or the sound line recognition method according to the present disclosure.
[0029] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects:
[0030] According to the training method and device of the voice recognition model and the voice recognition method and device of the embodiments of the present disclosure, the voice corresponding to the same voice output object label should belong to the same type of voice, and the voiceprint recognition data carrying the voice output object label is clustered and annotated in an unsupervised manner. A large amount of supervised data for voice recognition can be obtained without the need for a large amount of manual annotation of voice types, and label conversion is successfully achieved. Then, the same voice is regarded as the same person, and the voice recognition algorithm of supervised learning is trained according to the training method of voiceprint recognition. The voice recognition model trained in this way has strong generalization because it can learn a large amount of data.
[0031] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.
[0033] Figure 1 is a flowchart illustrating a training method of a sound ray recognition model according to an exemplary embodiment of the present disclosure.
[0034] Figure 2 Detailed description is a flowchart illustrating a method for training a sound ray recognition model according to an exemplary embodiment of the present disclosure.
[0035] Figure 3 is a flowchart illustrating a sound ray recognition method according to an exemplary embodiment of the present disclosure.
[0036] Figure 4 is a block diagram illustrating a training apparatus of a sound ray recognition model according to an exemplary embodiment of the present disclosure.
[0037] Figure 5is a block diagram illustrating a sound ray recognition apparatus according to an exemplary embodiment of the present disclosure.
[0038] Figure 6 is a block diagram of an electronic device according to an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION
[0039] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.
[0040] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The implementation methods described in the following examples do not represent all implementation methods consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the attached claims.
[0041] It should be noted that the phrase "at least one of the items" in the present disclosure includes three types of parallel situations: "any one of the items", "a combination of any number of the items", and "all of the items". For example, "including at least one of A and B" includes the following three parallel situations: (1) including A; (2) including B; (3) including A and B. Another example is "executing at least one of step 1 and step 2" which means the following three parallel situations: (1) executing step 1; (2) executing step 2; (3) executing step 1 and step 2.
[0042] With the development of artificial intelligence technology, machine learning and deep learning methods have been widely used in various fields. In the field of intelligent voice, the technology of distinguishing and identifying different people through human voice signals is called voiceprint recognition. The mainstream technology is supervised algorithms, including Gaussian mixture models (such as GMM-UBM), factor analysis (such as I-vector) and deep learning algorithms (such as X-Vector). Extended applications include distinguishing gender, age, etc. through human voice, which also requires labeled data to train the model, and then use embedding feature scoring or direct classification to obtain the final result.
[0043] As short videos, live broadcasts and other applications occupy a lot of Internet users' time, users have also formed preferences for different voices of anchors, including lolita voices, girl voices, mature sister voices, aunt voices, shota voices, young voices, uncle voices, and old voices. How to identify the voice characteristics of speech has become a technology that can provide services for many applications such as recommendations and advertising. Voice recognition does not need to distinguish whether it belongs to a certain person like traditional voiceprint recognition, but only needs to judge whether it belongs to a certain type of voice. As an extended application of voiceprint recognition, how to generate massive amounts of labeled data has become a difficulty that restricts the performance of the algorithm.
[0044] The present disclosure aims to propose a solution combining unsupervised classification and supervised voiceprint recognition algorithms. By taking advantage of the fact that the voice of the same speaker should belong to the same type of voice, the voiceprint recognition data of different speakers are clustered and annotated in an unsupervised manner. A large amount of supervised data for voice recognition can be obtained without the need for a large amount of manual annotation of voice types, and label conversion is successfully achieved. Then, the same voice is regarded as the same person, and the voice recognition algorithm of supervised learning is trained according to the training method of voiceprint recognition. The voice recognition model trained in this way has strong generalization because it can learn a large amount of data.
[0045] Next, we will refer to Figures 1 to 6 A training method and a training device for a vocal ray recognition model and a vocal ray recognition method and a vocal ray recognition device according to exemplary embodiments of the present disclosure are described in detail.
[0046] Figure 1 is a flowchart illustrating a training method of a sound ray recognition model according to an exemplary embodiment of the present disclosure. Figure 2 is a flowchart showing a method for training a sound line recognition model according to an exemplary embodiment of the present disclosure. It should be understood that the method for training a sound line recognition model according to an exemplary embodiment of the present disclosure can be implemented in a terminal device such as a smart phone, a tablet computer, a personal computer (PC), or can also be implemented in a device such as a server.
[0047] Reference Figure 1 In step 101, a plurality of speech samples are obtained, each of which carries a speech output object label. Voiceprint recognition algorithm is a relatively mature technology, so it is easy to obtain a large number of speech samples carrying speech output object labels (i.e. Figure 2 The main purpose of the exemplary embodiment of the present disclosure is to obtain the voice line type labels of these voice samples as training samples for the voice line recognition model. For example, by obtaining 200 voice samples from each of 6,000 speakers, 1.2 million voice samples with voice output object labels (corresponding to the speakers) can be obtained.
[0048] In step 102, a plurality of speech samples are clustered to obtain a plurality of speech sample sets. Among them, speech samples carrying the same speech output object label are classified into the same speech sample set. According to the training method of the voice line recognition model of the exemplary embodiment of the present disclosure, the speech samples carrying the speech output object label are clustered unsupervisedly by utilizing the characteristic that the speech corresponding to the same speech output object label should belong to a type of voice line, and then all or most of the speech samples corresponding to one speech output object label or multiple voice line-similar speech output object labels can be classified into one speech sample set, so as to provide a unified confirmation of the voice line type for each speech sample set in the subsequent steps, which helps to significantly reduce the workload of manual labeling.
[0049] Optionally, the speech samples can be clustered using the embedded features of the speech samples. At this time, step 102 specifically includes: cutting each speech sample to obtain multiple speech sample segments; extracting the embedded features of multiple speech sample segments corresponding to each speech sample, and calculating the average value of the extracted multiple embedded features as the embedded features of the corresponding speech sample; clustering the embedded features of multiple speech samples to obtain multiple speech sample sets. Speech recognition usually uses acoustic features extracted from speech (such as spectral features fbank, mfcc, etc.), but if the acoustic features are directly used for clustering, it is often difficult to solve the problems of noise and channels, while the embedded features can learn the individual information of the speech output object in the speech sample, and there is no problem of noise and channel. By extracting the embedded features of the speech samples for clustering, the clustering of speech samples can be achieved more reliably. Specifically, when extracting the embedded features of the speech samples, the speech samples are first cut into multiple segments, which can be cut into multiple segments of a set duration (such as 300ms), and these speech sample segments correspond to the speech output object labels before cutting. Then, the embedded features are extracted for each segment (the forward calculation of the existing voiceprint recognition model can be used to extract the embedded features), and the embedded features also correspond to the voice output object labels. Finally, the average of the embedded features of these segments is taken as the embedded features of the entire voice sample. The segmented averaging method can better characterize the individual information of the voice output object in a voice sample, and at the same time can reduce the subsequent data processing amount and improve the calculation efficiency.
[0050] Furthermore, after the embedding features of the speech samples are obtained, the embedding features of the multiple speech samples are clustered to obtain the steps of multiple speech sample sets, specifically including: based on a preset clustering algorithm (the preset clustering algorithm is not limited here, and spectral clustering, hierarchical clustering, etc. can be used), the embedding features of the multiple speech samples are divided into multiple clusters, and the calculation results of the clustering algorithm can be obtained. In view of the fact that after the clustering algorithm is directly applied for calculation, the speech samples carrying the same speech output object label are often scattered into different clusters, and rarely all enter the same cluster. This is the reality that each sentence output by the same speech output object may be different. According to the exemplary embodiment of the present disclosure, the speech carrying the same speech output object label should belong to the same type of voice line. Therefore, it is necessary to properly process the results of the clustering algorithm to achieve the classification of the speech samples.
[0051] In some embodiments, the clustering process further includes: in response to determining that more than a first proportion of the embedded features corresponding to the same speech output object label belong to the same cluster, all speech samples carrying the corresponding speech output object label are classified into a speech sample set corresponding to the same cluster, and multiple speech sample sets are obtained. In these embodiments, it is considered that the speech carrying the same speech output object label belongs to a class of sound lines. By configuring a first proportion (for example, 90%), the first proportion can be used as a judgment standard to determine whether the speech samples carrying the same speech output object label are mainly concentrated in one cluster. If so, it is considered that the result of the clustering algorithm is available for the speech samples carrying the speech output object label, and the speech samples dispersed in other clusters can be regarded as errors. All speech samples carrying the speech output object label are classified into the speech sample set corresponding to this concentrated cluster to obtain the result of the entire clustering process. If not, it is considered that the result of the clustering algorithm is not available for the speech samples carrying the speech output object label, and the speech samples carrying the speech output object label are not classified into any speech sample set.
[0052] In other embodiments, the clustering process further includes: in response to determining that among the embedded features corresponding to the same speech output object label, more than a first proportion of the embedded features belong to the same cluster, the speech samples corresponding to the embedded features exceeding the first proportion are classified into a speech sample set corresponding to the same cluster, and multiple speech sample sets are obtained. In these embodiments, it is considered that the speech carrying the same speech output object label is likely to belong to a type of voice line, but exceptions are allowed. By still configuring a first proportion (for example, 90%), it is also possible to use the first proportion to determine whether the speech samples carrying the same speech output object label are mainly concentrated in one cluster, and then determine whether the result of the clustering algorithm is available. However, the difference from the previous embodiment is that for the speech samples carrying the same speech output object label, at this time, only the part of the speech samples concentrated in one cluster are classified into the speech sample set corresponding to the concentrated cluster, and whether the remaining speech samples belong to the same voice line type is not judged, and they are not classified into any speech sample set, that is, this part of the data is abandoned, which also helps to simplify the scheme.
[0053] In other words, clustering processing includes two operations: applying a clustering algorithm and processing the results of the clustering algorithm. It is understandable that, since there may be one or more speech sample embedding features corresponding to speech output object labels in a cluster, a speech sample set obtained may contain speech samples corresponding to one or more speech output object labels. Specifically, there are a large number of speech samples. For the execution order of speech sample classification, the distribution of speech sample embedding features corresponding to each speech output object label in different clusters can be calculated one by one, or each cluster can be discussed one by one to see which speech output object labels are involved in the current cluster, and then the distribution of speech sample embedding features corresponding to these speech output object labels in different clusters can be calculated. These are all implementation methods of the present disclosure, and the present disclosure does not limit this.
[0054] Optionally, considering the huge number of speech samples (e.g., the aforementioned 1.2 million), step 102 may specifically include: dividing multiple speech samples into multiple groups; performing clustering processing on each group of speech samples to obtain multiple speech sample sets corresponding to each group; merging speech sample sets with common speech output object labels between different groups to obtain multiple speech sample sets. By dividing all acquired speech samples into multiple groups, batch clustering can be achieved, thereby reducing the amount of calculation for a single clustering and reducing the performance requirements for hardware. In addition, speech samples carrying the same speech output object label may be divided into different clustering batches. By merging speech sample sets with the same speech output object label between different groups, the number of speech sample sets can be reduced, the degree of data concentration can be improved, and the number of manual annotations in the subsequent step 103 can be reduced. It can be understood that for each group of speech samples, the aforementioned embodiment can be specifically adopted to cluster the speech samples using the embedded features of the speech samples. At this time, the embedded features of the speech samples may be extracted first and then the embedded features may be grouped, or the speech samples may be grouped first and then the embedded features may be extracted. These are both implementations of the present disclosure and the present disclosure does not impose any limitation thereto.
[0055] In general, refer to Figure 2 As an example, step 102 can be specifically performed as follows: first, the embedded features of each speech sample are extracted, and then the embedded features are divided into N groups. Taking the nth group as an example, n_1, n_2, n_3, ... classes are clustered based on the preset clustering algorithm. In the nth group, taking the data with speech output object label A as an example, if the data carrying the speech output object label A is clustered into a class n_i in excess of the first ratio, the speech sample carrying the speech output object label A is marked as the n_i class, otherwise the speech sample carrying the speech output object label A is not marked in the result of this clustering. After batch clustering is completed, since the data corresponding to a speech output object label may be divided into different clustering batches and have different labels, these speech sample sets with the same speech output object label are merged. For example, n1_2 containing data corresponding to speech output object labels A and B and n2_1 containing data corresponding to speech output object labels A and C are merged into one category, recorded as category C_1, which contains data corresponding to speech output object labels A, B, and C. A total of M categories C_1, C_2, ..., C_M are merged to obtain M speech sample sets.
[0056] Combined with reference Figure 1 and Figure 2In step 103, a preset number of sampled speech samples are extracted from each speech sample set to obtain the first voice line type labels of the preset number of sampled speech samples. This step only randomly extracts a preset number of data from each speech sample set determined in step 102 for manual labeling (i.e., the first voice line type label is obtained by manual labeling), without manually labeling each speech sample, and can effectively use the results of clustering processing to reduce the amount of manual labeling. For example, if speech samples of M speech sample sets are obtained through step 102, and the preset number is X, then M*X speech samples can be extracted to label the voice line type.
[0057] In step 104, a second voice line type label corresponding to the corresponding speech sample set is obtained according to a target first voice line type label that meets a preset condition among a preset number of first voice line type labels. For the speech samples of each speech sample set, the voice line types of the speech samples of the entire speech sample set can be obtained by reasonably expanding the first voice line type label obtained by manual annotation in the entire speech sample set, and then the second voice line type label is assigned to the speech samples of the entire speech sample set, which can be used as training data for the voice line recognition model.
[0058] Optionally, refer to Figure 2 , step 104 specifically includes: traversing each speech sample set, in response to determining that there is a target first voice line type label in the preset number of first voice line type labels in the current speech sample set, the proportion of the target first voice line type label exceeds a second proportion (for example, Figure 2 90% as shown), the target first voice line type label is used as the second voice line type label corresponding to the current voice sample set. By configuring a second ratio, the second ratio can be used as a judgment standard to determine whether the preset number of voice samples extracted from the current voice sample set basically belong to the same voice line type. If so, it is extended to the entire current voice sample set, and it is considered that the voice line types of all voice samples contained in the voice sample set belong to this voice line type, which can not only obtain the second voice line type labels of a large number of voice samples, but also ensure the accuracy of the label. If not, it is also extended to the entire current voice sample set, and it is considered that all voice samples contained in the voice sample set do not belong to the same voice line type, and no second voice line type label is assigned. For example, if among the X voice samples randomly selected from the C_m class, the first voice line type label of most voice samples is "Lolita sound", and the proportion of "Lolita sound" in the X voice samples exceeds the second ratio, all voice samples of the C_m class are marked as "Lolita sound", that is, "Lolita sound" is assigned as the second voice line type label, and the same applies to other voice lines. It can be understood that speech samples in different speech sample sets may be assigned the same second voice line type label.
[0059] Optionally, after processing in step 102, there may be some speech samples corresponding to the speech output object labels that are not included in any speech sample set, and naturally will not have the second voice line type label. After step 104, there may also be some speech samples in the speech sample set that are not assigned the second voice line type label. When it is determined that there are speech samples without the second voice line type label, the parameters of the clustering process can be adjusted, and the process returns to step 102 to re-cluster these speech samples without the second voice line type label, that is, repeating steps 102, 103 and 104.
[0060] Optionally, refer to Figure 2 , adjusting the parameters of clustering processing to re-perform clustering processing, specifically including: in response to determining that the speech samples of at least one speech sample set do not have the second voice line type label, adjusting the parameters of clustering processing to increase the number of clusters based on the initial number of clusters, and re-clustering the speech samples of the at least one speech sample set until the speech samples of each speech sample set have the second voice line type label. That is, after step 104, if there is a speech sample of at least one speech sample set that is not assigned the second voice line type label, the possible reason for analysis is that when performing clustering processing in step 102, speech samples of a certain voice line type are classified into one speech sample set with speech samples of other different voice line types. By increasing the number of clusters and re-performing clustering processing, the number of speech samples in a single speech sample set can be reduced, and the possibility of speech samples of different voice line types being classified into the same speech sample set can be reduced, so that the speech samples of as many speech sample sets as possible can determine their second voice line type labels in step 104. For ease of description and understanding, the multiple cycles in which steps 102 to 104 are repeatedly executed until the speech samples of each speech sample set are assigned the second voice line type label are regarded as a whole, which is called a large cycle. The initial number of clusters is the number of clusters when clustering is performed for the first time in this large cycle. In a large cycle, the number of clusters can be gradually increased as the number of cycles increases, or it can be increased first and then decreased, as long as it is guaranteed to be greater than the initial number of clusters. This disclosure does not limit this. It can be understood that Figure 2 The illustrated embodiment only shows the situation where a speech sample is not assigned the second voice line type label after step 104, and is not a limitation of the present disclosure.
[0061] In a large cycle, each time step 102 is executed, some speech samples that are not included in any speech sample set may appear. Specifically, in combination with the description of the embodiment in the previous text, it can be seen that each time step 102 is executed, after clustering processing, for speech samples carrying the same speech output object label, either the proportion of speech samples included in the same speech sample set exceeds the set ratio, and the remaining speech samples are not included in any speech sample set, or all speech samples are not included in any speech sample set, so each time it may appear that the speech samples carrying the same speech output object label are not concentrated in the same cluster. There may be two reasons for this situation: one is that the difference between the speech samples carrying the same speech output object label is caused by the channel or noise, and the representation of the embedded features fails to completely eliminate this part of the difference; the other is that the number of clusters is too large, and the speech samples carrying the same speech output object label are mistakenly separated by the clustering algorithm. Both problems can be solved by reducing the number of clusters and clustering these speech samples again. However, this is inconsistent with the aforementioned solution of increasing the number of clusters. Based on this, optionally, the clustering processing parameters are adjusted to re-perform the clustering processing, which specifically also includes: in response to determining that there are voice samples that are not included in any voice sample set, the parameters of the clustering processing are adjusted to reduce the initial number of clusters, and the voice samples that are not included in any voice sample set are re-clustered. In other words, the adjustment scheme for reducing the number of clusters is only for the initial number of clusters of a large cycle. In a large cycle, the number of clusters can be increased based on the initial number of clusters; after completing a large cycle, the initial number of clusters of this large cycle can be reduced and used as the initial number of clusters of the next large cycle, thereby resolving the contradiction of parameter adjustment.
[0062] In addition, after the processing of step 102, there is a high probability that there will always be speech samples that are not included in any speech sample set. If the large loop is performed all the time, it will cause a large computing load. In this regard, optionally, the parameters of the clustering process are adjusted to re-perform the clustering process, which specifically includes: in response to determining that the number of reductions in the initial number of clusters reaches a set number of times (that is, the number of large loops reaches the set number of times plus 1, and the set number of times can be configured as needed during the execution of the method), and there are still speech samples that are not included in any speech sample set, it is determined whether the number of speech samples with the second sound line type label reaches the target number. If so, stop adjusting the parameters of the clustering process. If not, adjust the conditions for obtaining multiple speech sample sets and / or the conditions for obtaining the second sound line type label, and clear the number of reductions in the recorded initial number of clusters to zero, and continue to adjust the parameters of the clustering process. By setting the set number of times, it is possible to avoid the infinite large loop caused by the presence of speech samples that are not included in any speech sample set. When the number of reductions in the number of initial clusters (i.e., the number of large cycles minus 1) reaches the set number, it can be first determined whether the number of speech samples currently assigned the second voice line type label (i.e., the voice line type has been determined) meets the training needs of the model. For example, it can be required that the number of speech samples of each voice line type reaches 50,000. If it is sufficient to meet the training needs, the loop can be stopped and the amount of calculation can be reasonably controlled. If it is still insufficient to meet the training needs, at least one of the conditions for obtaining a plurality of voice sample sets in step 102 and the conditions for determining the second voice line type label in step 104 can be appropriately relaxed to increase the number of speech samples required for training. Specifically, the first ratio in step 102 can be reduced, and the second ratio in step 104 can also be reduced. The specific reduction can be determined according to the actual calculation situation. Further, after relaxing the conditions, the number of reductions in the number of initial clusters recorded previously can be cleared, and the large cycle can be continued. At this time, in order to control the amount of calculation, the set number can also be appropriately reduced, that is, the number of large cycles can be reduced after relaxing the conditions. Of course, the set number can also be not reduced, and the present disclosure does not limit this.
[0063] In step 105, a preset machine learning module is trained according to the speech samples in each speech sample set and the corresponding second voice line type labels to obtain a voice line recognition model. A large number of speech samples with the second voice line type labels are used as training samples to train a voice line recognition model with strong generalization.
[0064] Optionally, step 105 specifically includes: extracting the acoustic features of each speech sample (such as the aforementioned spectral features mfcc); inputting the acoustic features into a preset machine learning module to obtain the predicted voice line type of the corresponding speech sample; determining the value of the loss function of the preset machine learning module according to the predicted voice line type and the second voice line type label of the same speech sample; adjusting the parameters of the preset machine learning module according to the value of the loss function to obtain a voice line recognition model. Like the voiceprint recognition model, the voice line recognition model also recognizes the individual information of the voice output object in the speech, so the voiceprint recognition model can be referred to and the acoustic features of the speech can be used as input data. Based on this, the voice line recognition model can be a modification of the number of classification nodes in the last layer of the original voiceprint recognition model to the number of voice line types that the voice line recognition model is expected to recognize, and the voice line recognition model to be trained can be obtained by only slightly adjusting the parameters of the existing voiceprint recognition model, so that an effective voice line recognition model can be obtained more conveniently.
[0065] Figure 3 is a flow chart showing a sound line recognition method according to an exemplary embodiment of the present disclosure. It should be understood that the sound line recognition method according to the exemplary embodiment of the present disclosure can be implemented in a terminal device (i.e., a client) such as a smart phone, a tablet computer, a personal computer (PC), or in a device (i.e., a server) such as a server.
[0066] Reference Figure 3 , in step 301, the voice to be recognized is obtained. That is, the voice of the voice type to be recognized is obtained. It can be understood that when the voice recognition method according to the exemplary embodiment of the present disclosure is implemented in the client, a microphone or other sound pickup device can be configured for the client to directly record and obtain the voice to be recognized, or the voice to be recognized recorded by an external sound pickup device can be obtained, and the voice to be recognized received via the network can also be obtained. When the voice recognition method according to the exemplary embodiment of the present disclosure is implemented in the server, the voice to be recognized uploaded by the client can be received.
[0067] Step 302: extracting acoustic features of the speech to be recognized. This step is the same as the forward calculation of the existing voiceprint recognition model, and will not be repeated here.
[0068] Step 303, input the acoustic features into the voice line recognition model to obtain the estimated voice line type of the speech to be recognized. The voice line recognition model is trained using the above-mentioned training method. The trained voice line recognition model can receive the input acoustic features, and then output the recognized voice line type to complete the voice line recognition. Since the voice line recognition model used is obtained by applying the above-mentioned training method, it has all the beneficial effects of the training method, which will not be repeated here. Specifically, after the acoustic features are input into the voice line recognition model, the estimated voice line type can be obtained with its probability (that is, the maximum probability voice line type is obtained). If the probability exceeds the confidence threshold, the estimated voice line type is output as a confidence result as the estimated voice line type of the speech to be recognized.
[0069] Figure 4 is a block diagram showing a training device for a sound line recognition model according to an exemplary embodiment of the present disclosure. It should be understood that the training device for a sound line recognition model according to an exemplary embodiment of the present disclosure can be implemented in a terminal device such as a smart phone, a tablet computer, a personal computer (PC) in the form of software, hardware, or a combination of software and hardware, and can also be implemented in a device such as a server.
[0070] Reference Figure 4 The training device 400 for the sound ray recognition model includes an acquisition unit 401 , a clustering unit 402 , a labeling unit 403 , a determination unit 404 , and a training unit 405 .
[0071] The acquisition unit 401 can acquire multiple voice samples, each of which carries a voice output object label. Voiceprint recognition algorithm is a relatively mature technology, so it is easy to acquire a large number of voice samples carrying voice output object labels (i.e. Figure 2 The main purpose of the exemplary embodiment of the present disclosure is to obtain the voice line type labels of these voice samples as training samples of the voice line recognition model.
[0072] The clustering unit 402 can perform clustering processing on multiple speech samples to obtain multiple speech sample sets. Among them, speech samples carrying the same speech output object label are classified into the same speech sample set. According to the training device 400 of the voice line recognition model of the exemplary embodiment of the present disclosure, the speech samples of the speech output object label are clustered unsupervisedly using the characteristic that the speech corresponding to the same speech output object label should belong to a type of voice line, and then all or most of the speech samples corresponding to one speech output object label or multiple voice line-similar speech output object labels can be classified into one speech sample set, so as to provide a unified confirmation of the voice line type of each speech sample set in the subsequent steps, which helps to greatly reduce the workload of manual labeling.
[0073] Optionally, the speech samples can be clustered using the embedded features of the speech samples. At this time, the clustering unit 402 may specifically include a cutting unit, a preparation unit, and a processing unit. The cutting unit may perform a cutting process on each speech sample to obtain a plurality of speech sample segments; the preparation unit may extract the embedded features of the plurality of speech sample segments corresponding to each speech sample, and calculate the average value of the extracted plurality of embedded features as the embedded features of the corresponding speech sample; the processing unit may perform a clustering process on the embedded features of the plurality of speech samples to obtain a plurality of speech sample sets. Speech recognition usually uses acoustic features extracted from speech, but if acoustic features are used directly for clustering, it is often difficult to solve the problems of noise and channels, while the embedded features can learn the individual information of the speech output object in the speech sample, and there is no problem of noise and channels. By extracting the embedded features of the speech samples for clustering, the clustering of the speech samples can be realized more reliably. Specifically, when extracting the embedded features of the speech samples, the speech samples are first cut into a plurality of segments, which can be cut into a plurality of segments of a set duration, and these speech sample segments correspond to the speech output object labels before cutting. Then, the embedded features are extracted for each segment (the forward calculation of the existing voiceprint recognition model can be used to extract the embedded features), and the embedded features also correspond to the voice output object labels. Finally, the average of the embedded features of these segments is taken as the embedded features of the entire voice sample. The segmented averaging method can better characterize the individual information of the voice output object in a voice sample, and at the same time can reduce the subsequent data processing amount and improve the calculation efficiency.
[0074] Further, the processing unit includes a clustering subunit and a classification subunit. After obtaining the embedded features of the speech sample, the clustering subunit can divide the embedded features of multiple speech samples into multiple clusters based on a preset clustering algorithm (the preset clustering algorithm is not limited here, and spectral clustering, hierarchical clustering, etc. can be used), and the calculation result of the clustering algorithm can be obtained. In view of the fact that after directly applying the clustering algorithm for calculation, speech samples carrying the same speech output object label tend to be scattered into different clusters, and rarely all enter the same cluster. This is a reality that each sentence output by the same speech output object may be different. According to the exemplary embodiment of the present disclosure, the speech carrying the same speech output object label should belong to the same type of voice line. Therefore, it is necessary to properly process the results of the clustering algorithm to achieve the classification of the speech sample.
[0075] To achieve the processing of clustering results, in some embodiments, the classification subunit may respond to the determination that among the embedded features corresponding to the same speech output object label, more than a first ratio of embedded features belong to the same cluster, and classify all speech samples carrying the corresponding speech output object label into a speech sample set corresponding to the same cluster, thereby obtaining multiple speech sample sets. In these embodiments, it is considered that the speech carrying the same speech output object label belongs to a class of sound lines. By configuring a first ratio, the first ratio can be used as a judgment criterion to determine whether the speech samples carrying the same speech output object label are mainly concentrated in one cluster. If so, it is considered that the result of the clustering algorithm is available for the speech samples carrying the speech output object label, and the speech samples dispersed in other clusters can be regarded as errors. All speech samples carrying the speech output object label are classified into the speech sample set corresponding to this concentrated cluster, and the result of the entire clustering processing is obtained. If not, it is considered that the result of the clustering algorithm is not available for the speech samples carrying the speech output object label, and the speech samples carrying the speech output object label are not classified into any speech sample set.
[0076] In other embodiments, the classification subunit may respond to the determination that among the embedded features corresponding to the same speech output object label, more than a first proportion of the embedded features belong to the same cluster, and classify the speech samples corresponding to the embedded features exceeding the first proportion into a speech sample set corresponding to the same cluster, thereby obtaining multiple speech sample sets. In these embodiments, it is considered that the speech carrying the same speech output object label is likely to belong to a type of voice line, but exceptions are allowed. By still configuring a first proportion, it is also possible to use the first proportion to determine whether the speech samples carrying the same speech output object label are mainly concentrated in one cluster, and then determine whether the result of the clustering algorithm is available. However, the difference from the previous embodiment is that for the speech samples carrying the same speech output object label, at this time, only the part of the speech samples concentrated in one cluster is classified into the speech sample set corresponding to this concentrated cluster, and whether the remaining speech samples belong to the same voice line type is not judged, and they are not classified into any speech sample set, that is, this part of the data is abandoned, which also helps to simplify the scheme.
[0077] In other words, clustering processing includes two operations: applying a clustering algorithm and processing the results of the clustering algorithm. It is understandable that, since there may be one or more speech sample embedding features corresponding to speech output object labels in a cluster, a speech sample set obtained may contain speech samples corresponding to one or more speech output object labels. Specifically, there are a large number of speech samples. For the execution order of speech sample classification, the distribution of speech sample embedding features corresponding to each speech output object label in different clusters can be calculated one by one, or each cluster can be discussed one by one to see which speech output object labels are involved in the current cluster, and then the distribution of speech sample embedding features corresponding to these speech output object labels in different clusters can be calculated. These are all implementation methods of the present disclosure, and the present disclosure does not limit this.
[0078] Optionally, considering the huge magnitude of the speech samples, the clustering unit 402 may specifically include a grouping unit, a group processing unit and a merging unit. The grouping unit may divide a plurality of speech samples into a plurality of groups; the group processing unit may perform clustering processing on each group of speech samples respectively to obtain a plurality of speech sample sets corresponding to each group; the merging unit may merge speech sample sets having a common speech output object label between different groups to obtain a plurality of speech sample sets. By dividing all acquired speech samples into a plurality of groups, batch clustering may be achieved, thereby reducing the amount of calculation for a single clustering and reducing the performance requirements for the hardware. In addition, speech samples carrying the same speech output object label may be divided into different clustering batches. By merging speech sample sets having the same speech output object label between different groups together, the number of speech sample sets may be reduced, the degree of data concentration may be improved, and the number of manual annotations of the subsequent annotation unit 403 may be reduced. It is understandable that for each group of speech samples, the aforementioned embodiment may be specifically adopted to perform clustering processing on the speech samples using the embedded features of the speech samples. At this time, the embedded features of the speech samples may be extracted first and then the embedded features may be grouped, or the speech samples may be grouped first and then the embedded features may be extracted. These are both implementations of the present disclosure and the present disclosure does not impose any limitation thereto.
[0079] In general, as an example, for the clustering unit 402, the cutting unit and the preparation unit can first extract the embedded features of each speech sample, and then the grouping unit can divide these embedded features into N groups. The processing unit specifically includes a grouping processing unit and a merging unit. The grouping processing unit includes a clustering subunit and a classification subunit. Taking the nth group as an example, the clustering subunit clusters n_1, n_2, n_3...classes based on a preset clustering algorithm. In the nth group, taking the data of the speech output object label A as an example, if the classification subunit determines that the data carrying the speech output object label A is clustered into a class n_i in excess of a first proportion, the speech sample carrying the speech output object label A is marked as the n_i class, otherwise the speech sample carrying the speech output object label A is not marked in the result of this clustering. After the grouping processing unit completes the batch clustering, since the data of a speech output object label may be divided into different clustering batches and have different labels, the merging unit is responsible for merging these speech sample sets with the same speech output object label. For example, n1_2 containing data corresponding to speech output object labels A and B and n2_1 containing data corresponding to speech output object labels A and C are merged into one category, recorded as category C_1, which contains data corresponding to speech output object labels A, B, and C. A total of M categories C_1, C_2, ..., C_M are merged to obtain M speech sample sets.
[0080] The labeling unit 403 can extract a preset number of sampled speech samples from each speech sample set to obtain the first voice line type labels of the preset number of sampled speech samples. The labeling unit 403 only randomly extracts a preset number of data from each speech sample set determined by the clustering unit 402 for manual labeling (i.e., the first voice line type label is obtained by manual labeling), without manually labeling each speech sample, and can effectively use the results of clustering processing to reduce the amount of manual labeling.
[0081] The determination unit 404 may obtain a second voice line type label corresponding to the corresponding speech sample set according to a target first voice line type label that meets a preset condition among a preset number of first voice line type labels. For the speech samples of each speech sample set, the voice line types of the speech samples of the entire speech sample set can be obtained by reasonably expanding the first voice line type label obtained by manual annotation in the entire speech sample set, and then the second voice line type label is assigned to the speech samples of the entire speech sample set, which can be used as training data for the voice line recognition model.
[0082] Optionally, the determination unit 404 may specifically traverse each speech sample set, and in response to determining that there is a target first voice line type label in the preset number of first voice line type labels of the current speech sample set, and the proportion of the target first voice line type label exceeds the second proportion, the target first voice line type label is used as the second voice line type label corresponding to the current speech sample set. By configuring a second proportion, the second proportion can be used as a judgment standard to determine whether the preset number of speech samples randomly selected from the current speech sample set basically belong to the same voice line type. If so, it is extended to the entire current speech sample set, and it is considered that the voice line types of all the voice output object labels contained in the speech sample set belong to this voice line type, which can not only obtain the second voice line type labels of a large number of speech samples, but also ensure the accuracy of the label. If not, it is also extended to the entire current speech sample set, and it is considered that all the voice output object labels contained in the speech sample set do not belong to the same voice line type, and no second voice line type label is assigned. It can be understood that speech samples of different speech sample sets may be assigned the same second voice line type label.
[0083] Optionally, in view of the fact that after being processed by the clustering unit 402, there may be several speech samples corresponding to the speech output object labels that are not included in any speech sample set, and naturally will not have the second voice line type label. After being processed by the determination unit 404, there may also be several speech samples in the speech sample set that are not assigned the second voice line type label. According to the exemplary embodiment of the present disclosure, the training device 400 of the voice line recognition model may also include a parameter adjustment unit (not shown in the figure). When it is determined that there are speech samples without the second voice line type label, the parameter adjustment unit may adjust the parameters of the clustering process, and the clustering unit 402 re-clustering these speech samples without the second voice line type label, and the labeling unit 403 and the determination unit 404 also repeat the action accordingly.
[0084] Optionally, the parameter adjustment unit may be specifically executed as follows: in response to determining that the speech samples of at least one speech sample set do not have the second voice line type label, adjusting the parameters of the clustering process to increase the number of clusters based on the initial number of clusters, and calling the clustering unit 402 to re-cluster the speech samples of the at least one speech sample set until the speech samples of each speech sample set have the second voice line type label. That is, after being processed by the determination unit 404, if there is at least one speech sample set whose speech samples are not assigned the second voice line type label, the possible reason for the analysis is that when the clustering unit 402 performs the clustering process, the speech samples of a certain voice line type and other speech samples of different voice line types are classified into one speech sample set. By increasing the number of clusters and re-performing the clustering process, the number of speech samples in a single speech sample set can be reduced, and the possibility of speech samples of different voice line types being classified into the same speech sample set can be reduced, so that the speech samples of as many speech sample sets as possible can be determined by the determination unit 404 for their second voice line type labels. For ease of description and understanding, the multiple cycles of repeatedly running the clustering unit 402, the labeling unit 403, and the determination unit 404 until the speech samples of each speech sample set are assigned the second voice line type label are regarded as a whole, which is called a large cycle, and the initial number of clusters is the number of clusters when the clustering process is performed for the first time in this large cycle. In a large cycle, the number of clusters can be gradually increased as the number of cycles increases, or it can be increased first and then decreased, as long as it is guaranteed to be greater than the initial number of clusters, and the present disclosure does not limit this.
[0085] In a large cycle, each time the clustering unit 402 is run, some speech samples that are not included in any speech sample set may appear. Specifically, in combination with the description of the embodiment in the foregoing text, it can be seen that each time the clustering unit 402 is run, after clustering processing, for speech samples carrying the same speech output object label, either the proportion of speech samples included in the same speech sample set exceeds the set ratio, and the remaining speech samples are not included in any speech sample set, or all speech samples are not included in any speech sample set, so each time it may appear that the speech samples carrying the same speech output object label are not concentrated in the same cluster. There may be two reasons for this situation: one is that the difference between the speech samples carrying the same speech output object label is caused by the channel or noise, and the representation of the embedded features fails to completely eliminate this part of the difference; the other is that the number of clusters is too large, and the speech samples carrying the same speech output object label are mistakenly separated by the clustering algorithm. Both problems can be solved by reducing the number of clusters and clustering these speech samples again. However, this is inconsistent with the aforementioned solution of increasing the number of clusters. Based on this, optionally, the parameter adjustment unit can also be specifically executed as follows: in response to determining that there are voice samples that are not classified into any voice sample set, the parameters of the clustering process are adjusted to reduce the initial number of clusters, and the voice samples that are not classified into any voice sample set are re-clustered. In other words, the adjustment scheme for reducing the number of clusters is only for the initial number of clusters of a large cycle. In a large cycle, the number of clusters can be increased based on the initial number of clusters; after completing a large cycle, the initial number of clusters of this large cycle can be reduced and used as the initial number of clusters of the next large cycle, thereby resolving the contradiction in parameter adjustment.
[0086] In addition, after being processed by the clustering unit 402, there is a high probability that there will always be voice samples that are not included in any voice sample set. If the large loop is performed all the time, it will cause a large computing load. In this regard, optionally, the parameter adjustment unit can also be specifically executed as follows: in response to determining that the number of reductions in the initial number of clusters reaches a set number of times (that is, the number of large loops reaches the set number of times plus 1, and the set number of times can be configured as needed during the execution of the method), and there are still voice samples that are not included in any voice sample set, it is determined whether the number of voice samples with the second voice line type label reaches the target number. If so, stop adjusting the parameters of the clustering processing. If not, adjust the conditions for obtaining multiple voice sample sets and / or the conditions for obtaining the second voice line type label, and clear the number of reductions in the recorded initial number of clusters to zero, and continue to adjust the parameters of the clustering processing. By setting the set number of times, it is possible to avoid the infinite large loop caused by the presence of voice samples that are not included in any voice sample set. When the number of reductions in the number of initial clusters (i.e., the number of large cycles minus 1) reaches the set number, it can be first determined whether the number of speech samples currently assigned the second voice line type label (i.e., the voice line type has been determined) meets the training needs of the model, for example, it can be required that the number of speech samples of each voice line type reaches 50,000. If it is sufficient to meet the training needs, the loop can be stopped to reasonably control the amount of calculation. If it is still insufficient to meet the training needs, at least one of the conditions for the clustering unit 402 to obtain a plurality of voice sample sets and the conditions for the determination unit 404 to obtain the second voice line type label can be appropriately relaxed to increase the number of speech samples required for training. Specifically, the first ratio used when the clustering unit 402 is running can be reduced, and the second ratio used when the determination unit 404 is running can also be reduced. The specific reduction can be determined according to the actual calculation situation. Further, after relaxing the conditions, the number of reductions in the number of initial clusters recorded previously can be cleared, and the large cycle can be continued. At this time, in order to control the amount of calculation, the set number can also be appropriately reduced, that is, the number of large cycles can be reduced after relaxing the conditions. Of course, the set number can also be not reduced, and the present disclosure does not limit this.
[0087] The training unit 405 can train a preset machine learning module according to the speech samples in each speech sample set and the corresponding second voice line type label to obtain a voice line recognition model. A large number of speech samples with the second voice line type label obtained are used as training samples to train a voice line recognition model with strong generalization.
[0088] Optionally, the training unit 405 may specifically include an extraction unit, a prediction unit, a calculation unit, and an adjustment unit. The extraction unit may extract the acoustic features of each speech sample; the prediction unit may input the acoustic features into a preset machine learning module to obtain the predicted voice line type of the corresponding speech sample; the calculation unit may determine the value of the loss function of the preset machine learning module according to the predicted voice line type and the second voice line type label of the same speech sample; the adjustment unit may adjust the parameters of the preset machine learning module according to the value of the loss function to obtain a voice line recognition model. Like the voiceprint recognition model, the voice line recognition model is also the recognition of the individual information of the voice output object in the speech, so the voiceprint recognition model can be referred to and the acoustic features of the speech can be used as input data. Based on this, the voice line recognition model can be the last layer classification node number of the original voiceprint recognition model modified to the number of voice line types expected to be recognized by the voice line recognition model, and the voice line recognition model to be trained can be obtained by only slightly adjusting the parameters of the existing voiceprint recognition model, so that an effective voice line recognition model can be obtained more conveniently.
[0089] Figure 5 is a block diagram showing a sound line recognition device according to an exemplary embodiment of the present disclosure. It should be understood that the sound line recognition device according to the exemplary embodiment of the present disclosure can be implemented in a terminal device (i.e., a client) such as a smart phone, a tablet computer, a personal computer (PC) in the form of software, hardware, or a combination of software and hardware, and can also be trained in a device such as a server (i.e., a server).
[0090] Reference Figure 5 The sound ray recognition device 500 includes an acquisition unit 501, an extraction unit 502, and a recognition unit 503.
[0091] The acquisition unit 501 can acquire the speech to be recognized. That is, the speech whose voice type needs to be recognized is acquired. It can be understood that, when the voice recognition device 500 according to the exemplary embodiment of the present disclosure is implemented in the client, a microphone or other sound pickup device can be configured for the client to directly record and obtain the speech to be recognized. The acquisition unit 501 can also acquire the speech to be recognized recorded by the external sound pickup device, and can also acquire the speech to be recognized received via the network. When the voice recognition device 500 according to the exemplary embodiment of the present disclosure is implemented in the server, the acquisition unit 501 can receive the speech to be recognized uploaded by the client.
[0092] The extraction unit 502 can extract the acoustic features of the speech to be recognized. The calculation of the extraction unit 502 is the same as the forward calculation of the existing voiceprint recognition model, and will not be repeated here.
[0093] The recognition unit 503 can input the acoustic features into the voice line recognition model to obtain the estimated voice line type of the speech to be recognized. Among them, the voice line recognition model is trained using the above-mentioned training method. The trained voice line recognition model can receive the input acoustic features, and then output the recognized voice line type to complete the voice line recognition. Since the voice line recognition model used is obtained by applying the above-mentioned training method, it has all the beneficial effects of the training method, which will not be repeated here. Specifically, after the recognition unit 503 inputs the acoustic features into the voice line recognition model, the estimated voice line type can be obtained with its probability (that is, the maximum probability voice line type is obtained). If the probability exceeds the confidence threshold, the estimated voice line type is output as a confidence result as the estimated voice line type of the speech to be recognized.
[0094] Figure 6 is a block diagram of an electronic device according to an exemplary embodiment of the present disclosure.
[0095] Reference Figure 6 The electronic device 600 includes at least one memory 601 and at least one processor 602, wherein the at least one memory 601 stores a set of computer executable instructions. When the set of computer executable instructions is executed by the at least one processor 602, a training method for a sound line recognition model or a sound line recognition method according to an exemplary embodiment of the present disclosure is executed.
[0096] As an example, the electronic device 600 may be a PC, a tablet device, a personal digital assistant, a smart phone, or other device capable of executing the above instruction set. Here, the electronic device 600 is not necessarily a single electronic device, but may also be any device or circuit capable of executing the above instruction (or instruction set) individually or in combination. The electronic device 600 may also be part of an integrated control system or system manager, or may be configured as a portable electronic device interconnected with a local or remote (e.g., via wireless transmission) interface.
[0097] In the electronic device 600, the processor 602 may include a central processing unit (CPU), a graphics processing unit (GPU), a programmable logic device, a dedicated processor system, a microcontroller or a microprocessor. As an example and not limitation, the processor may also include an analog processor, a digital processor, a microprocessor, a multi-core processor, a processor array, a network processor, etc.
[0098] The processor 602 may execute instructions or codes stored in the memory 601, which may also store data. Instructions and data may also be sent and received over a network via a network interface device, which may employ any known transmission protocol.
[0099] The memory 601 may be integrated with the processor 602, for example, by placing RAM or flash memory within an integrated circuit microprocessor or the like. In addition, the memory 601 may include a separate device, such as an external disk drive, a storage array, or any other storage device that can be used by a database system. The memory 601 and the processor 602 may be operatively coupled, or may communicate with each other, such as through an I / O port, a network connection, etc., so that the processor 602 can read files stored in the memory.
[0100] In addition, the electronic device 600 may further include a video display (such as a liquid crystal display) and a user interaction interface (such as a keyboard, a mouse, a touch input device, etc.) All components of the electronic device 600 may be connected to each other via a bus and / or a network.
[0101] According to an exemplary embodiment of the present disclosure, a computer-readable storage medium may also be provided. When the instructions in the computer-readable storage medium are executed by at least one processor, the at least one processor is prompted to execute the training method of the sound line recognition model or the sound line recognition method according to the exemplary embodiment of the present disclosure. Examples of computer-readable storage media here include: read-only memory (ROM), random access programmable read-only memory (PROM), electrically erasable programmable read-only memory (EEPROM), random access memory (RAM), dynamic random access memory (DRAM), static random access memory (SRAM), flash memory, non-volatile memory, CD-ROM, CD-R, CD+R, CD-RW, CD+RW, DVD-ROM, DVD-R, DVD+R, DVD-RW, DVD+RW, DVD-RAM, BD-ROM, BD-R, BD-R LTH, BD-RE, Blu-ray or optical disk storage, hard disk drive (HDD), solid state drive (SSD), card storage (such as, multimedia card, secure digital (SD) card or extreme digital (XD) card), magnetic tape, floppy disk, magneto-optical data storage device, optical data storage device, hard disk, solid state disk and any other device, any other device is configured to store computer programs and any associated data, data files and data structures in a non-transitory manner and provide the computer programs and any associated data, data files and data structures to a processor or computer so that the processor or computer can execute the computer program. The computer program in the above-mentioned computer-readable storage medium can be run in an environment deployed in a computer device such as a client, a host, an agent device, a server, etc. In addition, in one example, the computer program and any associated data, data files and data structures are distributed on a networked computer system, so that the computer program and any associated data, data files and data structures are stored, accessed and executed in a distributed manner by one or more processors or computers.
[0102] According to an exemplary embodiment of the present disclosure, a computer program product may also be provided, the computer program product comprising computer instructions, which, when executed by at least one processor, prompt the at least one processor to execute the training method of the sound line recognition model or the sound line recognition method according to the exemplary embodiment of the present disclosure.
[0103] According to the training method and device of the voice recognition model and the voice recognition method and device of the exemplary embodiment of the present disclosure, the voice corresponding to the same voice output object label should belong to the same type of voice, and the voiceprint recognition data carrying the voice output object label is clustered and annotated in an unsupervised manner. A large amount of supervised data for voice recognition can be obtained without the need for a large amount of manual annotation of voice types, and label conversion is successfully achieved. Then, the same type of voice is regarded as the same person, and the voice recognition algorithm of supervised learning is trained according to the training method of voiceprint recognition. The voice recognition model trained in this way has strong generalization because it can learn a large amount of data.
[0104] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0105] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A method for training a sound line recognition model, characterized in that: include: Acquire multiple speech samples, each of which carries a speech output object label; Clustering the plurality of speech samples to obtain a plurality of speech sample sets; wherein speech samples carrying the same speech output object label are classified into the same speech sample set; Extracting a preset number of sampled speech samples from each of the speech sample sets, and respectively obtaining first voice line type labels of the preset number of sampled speech samples corresponding to each of the speech sample sets; Obtaining a second voice line type label corresponding to the speech sample set according to a target first voice line type label that meets a preset condition among the preset number of first voice line type labels; A preset machine learning module is trained according to the speech samples in each of the speech sample sets and the corresponding second voice line type labels to obtain a voice line recognition model, The step of obtaining the second voice line type label corresponding to the speech sample set according to the target first voice line type label that meets the preset condition among the preset number of first voice line type labels includes: Each of the speech sample sets is traversed, and in response to determining that a target first voice line type label exists in the preset number of first voice line type labels of the current speech sample set, and the proportion of the target first voice line type label exceeds a second proportion, the target first voice line type label is used as the second voice line type label corresponding to the current speech sample set.
2. The training method according to claim 1, characterized in that: The clustering process is performed on the plurality of speech samples to obtain a plurality of speech sample sets, including: Performing segmentation processing on each of the voice samples to obtain a plurality of voice sample segments; Extracting embedding features of the plurality of speech sample segments corresponding to each of the speech samples, and calculating an average value of the extracted plurality of embedding features as the embedding feature of the corresponding speech sample; Clustering is performed on the embedded features of the multiple speech samples to obtain the multiple speech sample sets.
3. The training method according to claim 2, characterized in that: The clustering process is performed on the embedded features of the plurality of speech samples to obtain the plurality of speech sample sets, including: Dividing the embedded features of the plurality of speech samples into a plurality of clusters based on a preset clustering algorithm; In response to determining that more than a first proportion of the embedded features corresponding to the same speech output object label belong to the same cluster, all the speech samples carrying the corresponding speech output object label are classified into a speech sample set corresponding to the same cluster to obtain the multiple speech sample sets, or In response to determining that more than a first proportion of the embedded features corresponding to the same speech output object label belong to the same cluster, the speech samples corresponding to the embedded features exceeding the first proportion are classified into one speech sample set to obtain the multiple speech sample sets.
4. The training method according to claim 1, characterized in that: The clustering process is performed on the plurality of speech samples to obtain a plurality of speech sample sets, including: dividing the speech samples into a plurality of groups; Performing clustering processing on each group of the speech samples respectively to obtain a plurality of speech sample sets corresponding to each group; The speech sample sets having a common speech output object label between different groups are merged to obtain the multiple speech sample sets.
5. The training method according to any one of claims 1 to 4, characterized in that: Before training the preset machine learning module according to the speech samples in each of the speech sample sets and the corresponding second voice line type labels to obtain the voice line recognition model, the training method further includes: In response to determining that there are speech samples without the second voice ray type label, the parameters of the clustering process are adjusted, and the clustering process is re-performed on the speech samples without the second voice ray type label.
6. The training method according to claim 5, characterized in that: In response to determining that there is a speech sample without the second sound line type label, adjusting the parameters of clustering processing and re-clustering the speech sample without the second sound line type label includes: In response to determining that the speech samples of at least one speech sample set do not have the second voice line type label, the parameters of the clustering processing are adjusted to increase the number of clusters based on the initial number of clusters, and the speech samples of the at least one speech sample set are re-clustered until each speech sample of the speech sample set has the second voice line type label.
7. The training method according to claim 6, characterized in that: After the clustering process, among the speech samples carrying the same speech output object label, the proportion of speech samples classified into the same speech sample set exceeds a set ratio or is zero, and the remaining speech samples are not classified into any speech sample set, wherein in response to determining that there are speech samples without the second voice line type label, adjusting the parameters of the clustering process, and re-clustering the speech samples without the second voice line type label, further comprising: In response to determining that there are speech samples that are not included in any of the speech sample sets, adjusting the parameters of the clustering process to reduce the number of the initial clusters, and re-clustering the speech samples that are not included in any of the speech sample sets.
8. The training method according to claim 7, characterized in that: In response to determining that there is a speech sample without the second sound line type label, adjusting the parameters of the clustering process and re-clustering the speech sample without the second sound line type label, further includes: In response to determining that the number of reductions in the initial number of clusters has reached a set number of times and there are still speech samples that are not included in any of the speech sample sets, it is determined whether the number of speech samples with the second voice line type label has reached a target number. If so, the adjustment of the parameters of the clustering processing is stopped; if not, the conditions for obtaining the multiple speech sample sets and / or the conditions for obtaining the second voice line type label are adjusted, and the recorded number of reductions in the initial number of clusters is cleared to zero, and the parameters of the clustering processing are continued to be adjusted.
9. The training method according to any one of claims 1 to 4, characterized in that: The step of training a preset machine learning module according to the speech samples in each of the speech sample sets and the corresponding second voice line type labels to obtain a voice line recognition model includes: Extracting acoustic features of each of the speech samples; Inputting the acoustic features into the preset machine learning module to obtain the predicted voice line type of the corresponding speech sample; Determining a value of a loss function of the preset machine learning module according to the predicted voice line type and the second voice line type label of the same speech sample; The parameters of the preset machine learning module are adjusted according to the value of the loss function to obtain the sound ray recognition model.
10. A method for recognizing a sound line, characterized in that: include: Get the speech to be recognized; Extracting acoustic features of the speech to be recognized; Input the acoustic features into a voice line recognition model to obtain an estimated voice line type of the speech to be recognized, The sound line recognition model is trained using the training method described in any one of claims 1 to 9.
11. A training device for a sound line recognition model, characterized in that: include: An acquisition unit is configured to acquire a plurality of speech samples, each of which carries a speech output object label; A clustering unit is configured to perform clustering processing on the plurality of speech samples to obtain a plurality of speech sample sets; wherein speech samples carrying the same speech output object label are classified into the same speech sample set; a labeling unit configured to extract a preset number of sampled speech samples from each of the speech sample sets, and respectively obtain first voice line type labels of the preset number of sampled speech samples corresponding to each of the speech sample sets; A determination unit is configured to execute, according to a target first voice line type label that meets a preset condition among the preset number of first voice line type labels, to obtain a second voice line type label corresponding to the corresponding speech sample set; A training unit is configured to execute training of a preset machine learning module according to the speech samples in each of the speech sample sets and the corresponding second voice line type labels to obtain a voice line recognition model, Wherein, the determining unit is further configured to: Each of the speech sample sets is traversed, and in response to determining that a target first voice line type label exists in the preset number of first voice line type labels of the current speech sample set, and the proportion of the target first voice line type label exceeds a second proportion, the target first voice line type label is used as the second voice line type label corresponding to the current speech sample set.
12. The training device according to claim 11, characterized in that The clustering unit comprises: A segmentation unit, configured to perform segmentation processing on each of the voice samples to obtain a plurality of voice sample segments; A preparation unit is configured to extract embedding features of the plurality of speech sample segments corresponding to each of the speech samples, and calculate an average value of the extracted plurality of embedding features as the embedding feature of the corresponding speech sample; The processing unit is configured to perform clustering processing on the embedded features of the multiple voice samples to obtain the multiple voice sample sets.
13. The training device according to claim 12, characterized in that The processing unit comprises: A clustering subunit, configured to execute the division of the embedded features of the plurality of speech samples into a plurality of clusters based on a preset clustering algorithm; The classification subunit is configured to execute, in response to determining that more than a first proportion of the embedded features corresponding to the same speech output object label belong to the same cluster, classify all the speech samples carrying the corresponding speech output object label into a speech sample set corresponding to the same cluster to obtain the multiple speech sample sets, or is configured to execute, in response to determining that more than a first proportion of the embedded features corresponding to the same speech output object label belong to the same cluster, classify the speech samples corresponding to the embedded features exceeding the first proportion into a speech sample set corresponding to the same cluster to obtain the multiple speech sample sets.
14. The training device according to claim 11, characterized in that The clustering unit comprises: A grouping unit, configured to perform grouping of the plurality of speech samples into a plurality of groups; A grouping processing unit is configured to perform clustering processing on each group of the voice samples to obtain a plurality of voice sample sets corresponding to each group; The merging unit is configured to perform merging processing on the speech sample sets having a common speech output object label between different groups to obtain the multiple speech sample sets.
15. A training device according to any one of claims 11 to 14, characterised in that The training device also includes: The parameter adjustment unit is configured to adjust the parameters of the clustering process in response to determining that there is a speech sample without the second voice line type label, and call the clustering unit to re-cluster the speech sample without the second voice line type label.
16. The training device according to claim 15, characterized in that The parameter adjustment unit is also configured to execute, in response to determining that the speech samples of at least one speech sample set do not have the second voice line type label, adjusting the parameters of the clustering processing to increase the number of clusters based on the initial number of clusters, and calling the clustering unit to re-cluster the speech samples of the at least one speech sample set until each speech sample of the speech sample set has the second voice line type label.
17. The training device according to claim 16, characterized in that After the clustering processing, among the speech samples carrying the same speech output object label, the proportion of speech samples classified into the same speech sample set exceeds the set ratio or is zero, and the remaining speech samples are not classified into any of the speech sample sets. The parameter adjustment unit is also configured to execute, in response to determining that there are speech samples that are not classified into any of the speech sample sets, adjust the parameters of the clustering processing to reduce the initial number of clusters, and call the clustering unit to re-cluster the speech samples that are not classified into any speech sample set.
18. The training device according to claim 17, characterized in that The parameter adjustment unit is also configured to execute, in response to determining that the number of reductions in the initial number of clusters has reached a set number of times and there are still voice samples that are not included in any of the voice sample sets, whether the number of voice samples with the second voice line type label has reached a target number, and if so, stop adjusting the parameters of the clustering processing; if not, adjust the conditions for obtaining the multiple voice sample sets and / or the conditions for obtaining the second voice line type label, and clear the recorded number of reductions in the initial number of clusters to zero, and continue to adjust the parameters of the clustering processing.
19. A training device according to any one of claims 11 to 14, characterised in that The training unit comprises: An extraction unit, configured to extract acoustic features of each of the speech samples; A prediction unit, configured to input the acoustic feature into the preset machine learning module to obtain a predicted voice line type of the corresponding speech sample; a computing unit configured to determine a value of a loss function of the preset machine learning module according to the predicted voice line type and the second voice line type label of the same voice sample; An adjustment unit is configured to adjust the parameters of the preset machine learning module according to the value of the loss function to obtain the sound ray recognition model.
20. A sound line recognition device, characterized in that: include: An acquisition unit is configured to acquire the speech to be recognized; An extraction unit, configured to extract acoustic features of the speech to be recognized; A recognition unit is configured to input the acoustic feature into a voice line recognition model to obtain an estimated voice line type of the speech to be recognized, The sound line recognition model is trained using the training method described in any one of claims 1 to 9.
21. An electronic device, characterized in that: include: at least one processor; at least one memory storing computer executable instructions, When the computer executable instructions are executed by the at least one processor, the at least one processor is prompted to execute the training method of the sound line recognition model according to any one of claims 1 to 9 or the sound line recognition method according to claim 10.
22. A computer-readable storage medium, characterized in that: When the instructions in the computer-readable storage medium are executed by at least one processor, the at least one processor is prompted to execute the training method for a sound line recognition model according to any one of claims 1 to 9 or the sound line recognition method according to claim 10.
23. A computer program product comprising computer instructions, characterized in that When the computer instructions are executed by at least one processor, the training method for a sound line recognition model according to any one of claims 1 to 9 or the sound line recognition method according to claim 10 is implemented.
