Speech synthesis model training method, speech synthesis method and device

By integrating the duration prediction module in the speech synthesis model and performing iterative updates, the problem of duration error accumulation in the speech synthesis model is solved, the performance and accuracy of speech synthesis are improved, and a more natural and efficient speech synthesis effect is achieved.

CN113823260BActive Publication Date: 2024-10-29IFLYTEK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111221947.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-20
Publication Date
2024-10-29
Estimated Expiration
2041-10-20

AI Technical Summary

Technical Problem

The performance and accuracy of existing speech synthesis models are not high in practical applications, especially because the duration prediction model has the problem of accumulation of duration errors during the training process, resulting in unsatisfactory speech synthesis effects.

Method used

By integrating the duration prediction module in the initial synthesis model, the gap between the sample text and the synthesized speech is used for iterative updates to avoid the accumulation of duration errors and improve the accuracy of duration prediction, thus improving the performance and accuracy of the speech synthesis model.

Benefits of technology

It effectively avoids the accumulation of errors during training of the duration prediction model, improves the performance and accuracy of the speech synthesis model in practical applications, and ensures the naturalness and efficiency of speech synthesis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113823260B_ABST
    Figure CN113823260B_ABST
Patent Text Reader

Abstract

The present invention provides a speech synthesis model training method, a speech synthesis method and a device, wherein the method comprises: determining an initial synthesis model, the initial synthesis model comprising a duration prediction module, the duration prediction module being used to predict the duration of each phoneme in a text in a synthesized speech; determining the synthesized speech of a sample text based on the initial synthesis model, iteratively updating the parameters of the duration prediction module based on the gap between the sample speech of the sample text and the synthesized speech, and obtaining a trained speech synthesis model. The method and device provided by the present invention can predict the duration of each phoneme in a sample text in a synthesized speech through the duration prediction module in the initial synthesis model, thereby avoiding the problem of cumulative duration error and improving the performance and accuracy of the speech synthesis model in practical applications.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a speech synthesis model training method, a speech synthesis method and a device. Background Art

[0002] Text to Speech (TTS) is a technology that converts text into speech. Existing speech synthesis methods based on deep learning are mainly divided into two categories: autoregressive speech synthesis methods and non-autoregressive speech synthesis methods.

[0003] Among them, the autoregressive speech synthesis method has the problem of mismatch between training and generation, and the generation efficiency and accuracy are both low. Although the non-autoregressive speech synthesis method solves the problems existing in the autoregressive speech synthesis method, the non-autoregressive speech synthesis method introduces a duration model. During the training of the duration model, there is an error between the predicted duration and the actual duration, and there is a problem of accumulated duration errors, which limits the performance and accuracy of the trained speech synthesis model in practical applications. Summary of the invention

[0004] The present invention provides a speech synthesis model training method, a speech synthesis method and a device, which are used to solve the defects of the speech synthesis model in the prior art in that the performance and accuracy are low in practical applications.

[0005] The present invention provides a method for training a speech synthesis model, comprising:

[0006] Determine an initial synthesis model, wherein the initial synthesis model includes a duration prediction module, wherein the duration prediction module is used to predict the duration of each phoneme in the text in the synthesized speech;

[0007] Based on the initial synthesis model, the synthesized speech of the sample text is determined, and based on the gap between the sample speech of the sample text and the synthesized speech, the parameters of the duration prediction module are iteratively updated to obtain a trained speech synthesis model.

[0008] According to a speech synthesis model training method provided by the present invention, the method of determining the synthesized speech of the sample text based on the initial synthesis model includes:

[0009] Based on the encoding module in the initial synthesis model, the sample text is encoded with linguistic features to obtain the features of each phoneme in the phoneme sequence of the sample text;

[0010] Based on the duration prediction module and the characteristics of each phoneme, predict the duration of each phoneme in the synthesized speech to obtain the predicted duration of each phoneme;

[0011] Based on the upsampling module in the initial synthesis model, upsampling the features of each phoneme to obtain upsampled features of each phoneme, wherein the length of the upsampled features is determined based on the predicted duration;

[0012] Based on the decoding module in the initial synthesis model, the upsampled features of each phoneme are acoustically decoded to obtain the synthesized speech.

[0013] According to a speech synthesis model training method provided by the present invention, the upsampling module in the initial synthesis model upsamples the features of each phoneme to obtain the upsampled features of each phoneme, including:

[0014] Based on the upsampling module in the initial synthesis model and the weight of any phoneme at each moment in the corresponding prediction duration, upsampling the feature of any phoneme to obtain the upsampled feature of any phoneme;

[0015] The weight of any phoneme at each moment in the corresponding predicted duration is determined based on the distribution of any phoneme in the corresponding predicted duration.

[0016] According to a speech synthesis model training method provided by the present invention, the distribution of any phoneme in the corresponding predicted duration is determined based on the following steps:

[0017] Determining the distribution center position of any phoneme based on the predicted duration of any phoneme and the label durations of each phoneme before any phoneme in the phoneme sequence;

[0018] The distribution of any phoneme is determined based on the predicted duration of any phoneme, the distribution center position of any phoneme, and the distribution discrete parameter of any phoneme.

[0019] According to a speech synthesis model training method provided by the present invention, the distribution discrete parameter is determined based on the characteristics and predicted duration of any phoneme.

[0020] According to a speech synthesis model training method provided by the present invention, the weight of any phoneme at each moment in the corresponding prediction duration is determined based on the following steps:

[0021] Determine, based on the distribution of any phoneme in the corresponding predicted duration, a distribution value of any phoneme at any moment in the corresponding predicted duration;

[0022] The weight of any moment is determined based on the distribution value at any moment and the sum of the distribution values ​​of any phoneme at each moment in the corresponding prediction duration.

[0023] The present invention also provides a speech synthesis model training device, comprising: a determination module, used to determine an initial synthesis model, the initial synthesis model includes a duration prediction module, the duration prediction module is used to predict the duration of each phoneme in the text in the synthesized speech;

[0024] The training module is used to determine the synthesized speech of the sample text based on the initial synthesis model, and iteratively update the parameters of the duration prediction module based on the gap between the sample speech of the sample text and the synthesized speech to obtain a trained speech synthesis model.

[0025] The present invention also provides a speech synthesis method, comprising:

[0026] Determine the text to be synthesized;

[0027] The synthesized speech of the text is determined based on a speech synthesis model, wherein the speech synthesis model is trained based on the training method of the speech synthesis model as described in any one of the above items.

[0028] The present invention also provides a speech synthesis device, comprising:

[0029] A determination module, used for determining the text to be synthesized;

[0030] A synthesis module is used to determine the synthesized speech of the text based on a speech synthesis model, wherein the speech synthesis model is trained based on the training method of the speech synthesis model as described in any of the above items.

[0031] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the training method of any speech synthesis model as described above or the steps of any speech synthesis method as described above are implemented.

[0032] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the above-described speech synthesis model training methods or the steps of any of the above-described speech synthesis methods.

[0033] The present invention also provides a computer program product, comprising a computer program, which, when executed by a processor, implements the steps of any of the training methods for speech synthesis models described above or the steps of any of the speech synthesis methods described above.

[0034] The speech synthesis model training method, speech synthesis method and device provided by the present invention use the duration prediction module in the initial synthesis model to predict the duration of each phoneme in the predicted text in the synthesized speech, and iteratively update the parameters of the duration prediction module according to the gap between the sample speech of the sample text and the synthesized speech output by the initial synthesis model, thereby avoiding the accumulation of duration errors during the training of the duration prediction model and improving the performance and accuracy of the speech synthesis model in practical applications. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0036] Figure 1 This is one of the flow charts of a speech synthesis model training method provided by the present invention;

[0037] Figure 2 It is a flow chart of a method for determining a synthetic speech of a sample text provided by the present invention;

[0038] Figure 3 It is a flow chart of a method for determining the distribution of any phoneme in a corresponding predicted duration provided by the present invention;

[0039] Figure 4 It is a flow chart of a method for determining the weight of any phoneme at each moment in the corresponding prediction duration provided by the present invention;

[0040] Figure 5 The present invention provides a second method for training a speech synthesis model;

[0041] Figure 6 It is a framework diagram of a training method for a speech synthesis model provided by the present invention;

[0042] Figure 7 It is a flow chart of the speech synthesis method provided by the present invention;

[0043] Figure 8 It is a structural schematic diagram of a training device for a speech synthesis model provided by the present invention;

[0044] Fig. 9 It is a structural schematic diagram of the speech synthesis device provided by the present invention;

[0045] Fig.10 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

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

[0047] Existing deep learning-based speech synthesis methods mainly include autoregressive speech synthesis methods and non-autoregressive speech synthesis methods.

[0048] The existing autoregressive speech synthesis model has the problem of mismatch between training and generation, and the existing non-autoregressive speech synthesis model uses a duration prediction model to predict the duration of the sample text. There will be an error between the predicted duration and the actual duration. This error will gradually accumulate with continuous training, resulting in subsequent training not being optimized in the optimal direction due to the accumulation of duration errors, which in turn leads to reduced training performance and accuracy.

[0049] Therefore, how to improve the performance and accuracy of speech synthesis models in practical applications is an urgent problem to be solved in this field.

[0050] Figure 1 This is one of the flow charts of a speech synthesis model training method provided by the present invention. Figure 1 As shown, a speech synthesis model training method provided by an embodiment of the present invention includes:

[0051] Step 110, determining an initial synthesis model, the initial synthesis model including a duration prediction module, the duration prediction module being used to predict the duration of each phoneme in the text in the synthesized speech;

[0052] Step 120, based on the initial synthesis model, determine the synthesized speech of the sample text, and iteratively update the parameters of the duration prediction module based on the gap between the sample speech and the synthesized speech of the sample text to obtain a trained speech synthesis model.

[0053] Typically, in the process of applying a speech synthesis model for speech synthesis, the speech synthesis model can linguistically encode the phoneme sequence of the sample text, and apply a speech duration prediction model to predict the duration of each phoneme in the synthesized speech based on the features of each phoneme obtained by linguistic encoding. Subsequently, the speech synthesis model can decode the features of each phoneme to obtain the acoustic features of each phoneme at the corresponding predicted duration, and speech synthesis is now completed.

[0054] Considering that the speech duration prediction model, whether it is a sub-model of the speech synthesis model or a model independent of the speech synthesis model, needs to use the pre-annotated duration as a label to perform supervised training on the speech duration prediction model, but due to the poor reliability of the manually annotated duration itself, the speech duration prediction model cannot be reliably guided under the supervised training with the annotated duration as a label, resulting in the accumulation of duration errors between the duration predicted by the speech duration prediction model and the actual duration. Therefore, the embodiment of the present invention no longer uses the manually annotated duration as a sample label when training the speech duration prediction model, but integrates the duration prediction module in the initial synthesis model, and promotes the parameter update iteration of the duration prediction module inside the initial synthesis model by training the initial synthesis model.

[0055] Specifically, first, an initial synthesis model including a duration prediction module can be determined, and the initial synthesis model can be trained based on the sample text collected in advance and the sample speech corresponding to the sample text, so as to implement the update iteration of the modules included in the initial synthesis model, especially the duration prediction module, and then obtain the trained speech synthesis model. Here, when the initial synthesis model is trained, the sample text can be input into the initial synthesis model to obtain the synthesized speech of the sample text output by the initial synthesis model, and then on this basis, by analyzing the gap between the synthesized speech of the sample text and the sample speech of the sample text, the parameters of the duration prediction module are iteratively updated until the initial synthesis model training is completed to obtain the speech synthesis model.

[0056] During the above training process, the duration prediction module, as a module in the initial synthesis model, participates in speech synthesis based on sample text. The predicted duration output by the duration prediction module will also directly affect the size of the gap between the synthesized speech output by the initial synthesis model and the sample speech as a label. Therefore, the gap between the synthesized speech and the sample speech can also guide the duration prediction module in the initial synthesis model to update and iterate in the direction of predicting a duration close to the actual duration of each phoneme in the sample speech. In this process, there is no need to refer to the manually annotated duration, which avoids the introduction of unreliable labels during the training of the duration prediction module, which helps to improve the effect of the duration prediction module training, thereby ensuring the reliability of the trained speech synthesis model.

[0057] The speech synthesis model training method provided by the present invention predicts the duration of each phoneme in the synthesized speech in the prediction text by using the duration prediction module in the initial synthesis model, and iteratively updates the parameters of the duration prediction module according to the gap between the sample speech of the sample text and the synthesized speech output by the initial synthesis model, thereby avoiding the accumulation of duration errors during the training of the duration prediction model and improving the performance and accuracy of the speech synthesis model in practical applications.

[0058] Based on the above embodiments, Figure 2 FIG. 1 is a flow chart of a method for synthesizing speech of a sample text provided by the present invention. Figure 2 As shown, in step 120, based on the initial synthesis model, the synthesized speech of the sample text is determined, including:

[0059] Step 210, based on the encoding module in the initial synthesis model, linguistic feature encoding is performed on the sample text to obtain the feature of each phoneme in the phoneme sequence of the sample text;

[0060] Specifically, a phoneme is the smallest unit of speech divided according to the natural properties of speech. It is analyzed based on the pronunciation action in a syllable, and one action constitutes a phoneme. In the embodiment of the present invention, a phoneme sequence refers to a sequence composed of phonemes extracted in sequence from a sample text, specifically obtained by performing phoneme segmentation on the sample text and position encoding on the segmented phonemes. The order of phonemes in the phoneme sequence is obtained according to the order of characters in the sample text.

[0061] The encoding module in the initial synthesis model is used to encode each phoneme in the phoneme sequence to extract the linguistic features of each phoneme. It should be noted that the input to the encoding module can be a sample text, and the encoding module performs phoneme segmentation on the sample text to obtain a phoneme sequence and performs linguistic encoding. The input to the encoding module can also be a phoneme sequence of the sample text, and the encoding module directly performs linguistic encoding on the phoneme sequence. The embodiment of the present invention does not specifically limit this.

[0062] Step 220, based on the duration prediction module and the characteristics of each phoneme, predict the duration of each phoneme in the synthesized speech to obtain the predicted duration of each phoneme;

[0063] Specifically, the duration prediction module in the initial synthesis model can predict the duration of a single phoneme based on the characteristics of the phoneme, and can also predict the duration of the phoneme based on the characteristics of a single phoneme and multiple adjacent phonemes. When predicting the duration, the characteristics of each phoneme obtained in step 210 can be re-encoded so that the characteristics of each phoneme contain more duration information, and then the duration of each phoneme is predicted based on the characteristics of each phoneme containing the duration information to obtain the predicted duration of each phoneme.

[0064] Step 230, based on the upsampling module in the initial synthesis model, upsample the features of each phoneme to obtain upsampled features of each phoneme, and the length of the upsampled features is determined based on the predicted duration;

[0065] Specifically, in the initial synthesis model, the upsampling module upsamples the features of each phoneme according to the predicted duration of each phoneme obtained in step 220 to obtain the upsampled features of each phoneme. It should be noted that the upsampling here can be hard upsampling or flexible upsampling. Among them, hard upsampling is to copy the phoneme feature to the predicted duration according to the predicted duration of the phoneme to obtain the upsampled features of the phoneme. For example, if the phoneme feature is [d] and the predicted duration of the phoneme is 3, then the upsampled features of the phoneme are [d, d, d]; flexible upsampling is to upsample the phoneme feature according to the weight of the predicted duration of each phoneme at each moment. For example, if the phoneme feature is [d] and the predicted duration of the phoneme is 3, the weight of the phoneme in its predicted duration is 0.3 at the first moment, 0.8 at the second moment, and 0.4 at the third moment, then the upsampled features of the phoneme are [0.3×d, 0.8×d, 0.4×d]. Among them, the weight of the predicted duration of each phoneme at each moment can be determined by the predicted duration of each phoneme and the mapping relationship with the weight, and can also be determined by the distribution of each phoneme at each moment in its predicted duration. The embodiment of the present invention does not limit this.

[0066] Step 240, based on the decoding module in the initial synthesis model, acoustic decoding is performed on the upsampled features of each phoneme to obtain synthesized speech.

[0067] Specifically, the decoding module in the initial synthesis model performs frame-by-frame acoustic decoding according to the up-sampled features of each phoneme and the position of each phoneme in the phoneme sequence to obtain the synthesized speech of the sample text.

[0068] Based on the above embodiment, step 230 includes:

[0069] Based on the upsampling module in the initial synthesis model and the weight of any phoneme at each moment in the corresponding prediction duration, the feature of the phoneme is upsampled to obtain the upsampled feature of the phoneme;

[0070] The weight of the phoneme at each moment in the corresponding prediction duration is determined based on the distribution of the phoneme in the corresponding prediction duration.

[0071] Considering the hard upsampling method, the linguistic information contained in a phoneme is the same, and there will be a discontinuous mutation at the boundary of two adjacent phonemes, which will lead to unsatisfactory synthesis effect at the phoneme boundary. Therefore, the embodiment of the present invention uses a flexible upsampling method to upsample the phoneme features.

[0072] Furthermore, if the weight is determined by the predicted duration of each phoneme and its mapping relationship with the weight, the mapping relationship may not be fully covered due to the randomness of the phoneme and its corresponding predicted duration, resulting in discontinuity at the boundary when synthesizing the phoneme, which in turn may lead to unsatisfactory synthesis effect at the phoneme boundary. Therefore, the embodiment of the present invention uses the distribution of the phoneme in the corresponding predicted duration to determine the weight.

[0073] Specifically, the upsampling module in the initial synthesis model defines a distribution for each phoneme in the phoneme sequence of the sample text based on its predicted duration. The distribution of the distribution can be used to represent the distribution value of the phoneme at each moment in its corresponding predicted duration. On this basis, the weight of the phoneme at each moment can be determined according to the distribution value at each moment, and then the phoneme is upsampled according to the weight of each phoneme at each moment in its corresponding predicted duration to obtain the upsampling feature of the phoneme. It should be noted that the distribution here can be a Gaussian distribution. The weight of the phoneme at each moment can be determined based on the ratio of the distribution value of the phoneme at each moment to the sum of the distribution values ​​of all phonemes in the phoneme sequence at that moment, and can also be determined based on the mapping relationship between the distribution value and the weight, which is not limited in the embodiment of the present invention.

[0074] The speech synthesis model training method provided by the present invention calculates the weight of each time period of the phoneme in its predicted duration through the distribution of the phoneme in its predicted duration, and upsamples the phoneme based on the weight of each time period of the phoneme in its predicted duration, thereby achieving a smooth transition between phonemes without generating discontinuous mutations between phonemes, improving the effect of speech synthesis, and making the synthesized speech more natural.

[0075] Based on the above embodiments, Figure 3 is a flow chart of determining the distribution of any phoneme in the corresponding predicted duration provided by the present invention. Figure 3 As shown, the distribution of any phoneme in the corresponding predicted duration is determined based on the following steps:

[0076] Step 310, determining the distribution center position of any phoneme based on the predicted duration of the phoneme and the label durations of each phoneme before the phoneme in the phoneme sequence;

[0077] In order to reduce the deviation of the subsequent phoneme distribution center position caused by the accumulation of errors in the previous phoneme prediction duration, an embodiment of the present invention provides a method for calculating the distribution center position of a phoneme, specifically, based on the predicted duration of the phoneme and the label duration of all phonemes before the phoneme position in the phoneme sequence, the time segment occupied by the phoneme in the synthesized speech is located and calculated accordingly.

[0078] It should be noted that, before the position of the phoneme in the phoneme sequence, the number of phonemes in the phoneme sequence is N, the position of the current phoneme in the phoneme sequence is i, 1≤i≤N, then the position before the position of the phoneme in the phoneme sequence is 1 to i-1. The label duration is the target duration of the phoneme, and the target duration is the standard duration set according to the characteristics of the phoneme. Among them, the distribution center position of the current phoneme is specifically obtained by dividing the predicted duration of the current phoneme by 2 and summing the value of the sum of the label durations of all phonemes in the phoneme sequence before the current phoneme position. For example, the number of phonemes in the phoneme sequence is N, the position of the current phoneme in the phoneme sequence is i, 1≤i≤N, then Among them, 1≤j<i,d i is the predicted duration of the current phoneme, T j is the label duration of the jth phoneme in the phoneme sequence.

[0079] Step 320 , determining the distribution of the phoneme based on the predicted duration of the phoneme, the distribution center position of the phoneme, and the distribution discrete parameter of the phoneme.

[0080] Considering that the characteristics of Gaussian distribution are determined by the position parameter and the discrete parameter of the distribution, in the embodiment of the present invention, the distribution of the phoneme in its predicted duration is determined by the distribution center position and the discrete parameter of the phoneme.

[0081] Specifically, the distribution of any phoneme is determined by obtaining the distribution center position of the phoneme and the distribution discrete parameter of the phoneme through the predicted duration of the phoneme. It should be noted that the distribution discrete parameter can be pre-set or calculated based on the characteristics of the phoneme and the predicted duration, and the embodiment of the present invention does not limit this.

[0082] The speech synthesis model training method provided by the present invention calculates the distribution center position of the current phoneme in its predicted duration through the predicted duration of the current phoneme and the label duration of the phoneme before the current phoneme in the phoneme sequence, thereby eliminating phonemes with accumulated errors due to the predicted duration of the phoneme before the current phoneme in the phoneme sequence, so that the distribution center position of each phoneme in its predicted market is roughly accurate, thereby improving the robustness of the model training.

[0083] Based on the above embodiment, the distribution discrete parameter is determined based on the characteristics and predicted duration of the phoneme.

[0084] Considering that improving the naturalness of the generated speech during speech synthesis is also a necessary phoneme to improve the user experience, the preset distributed discrete parameters cannot cope well with the situation where the characteristics and duration of the phonemes in each context are different, which will result in the low naturalness of the generated speech. Therefore, the embodiment of the present invention calculates the distributed discrete parameters of the phoneme in its predicted duration by combining the phoneme features and its predicted duration to obtain the distributed discrete parameters of the phoneme. For example, the characteristics of the phoneme and the specialty of the phoneme can be concatenated and then bidirectionally LSTM (Long Short-Term Memory) encoded, and then the encoding is predicted by a feedforward neural network to obtain the distributed discrete parameters of the phoneme.

[0085] Based on the above embodiments, Figure 4 is a flow chart of a method for determining the weight of any phoneme at each moment in the corresponding prediction duration provided by the present invention. Figure 4 As shown, in step 230, the weight of any phoneme at each moment in the corresponding prediction duration is determined based on the following steps:

[0086] Step 410, based on the distribution of any phoneme in the corresponding prediction duration, determine the distribution value of the phoneme at any moment in the corresponding prediction duration;

[0087] Step 420, determining the weight of any moment based on the distribution value at that moment and the sum of the distribution values ​​of the phoneme at each moment in the corresponding prediction duration.

[0088] Specifically, based on the distribution of any phoneme, the distribution value of the phoneme at any moment of its corresponding prediction duration is obtained, and based on the sum of the distribution values ​​of the phoneme at each moment of its corresponding prediction duration, the partial value of the phoneme at a certain moment is divided by the sum of the partial values ​​of the phoneme at each moment to obtain the weight of any phoneme at that moment.

[0089] The calculation formula for the weight of any phoneme at any time in the corresponding prediction duration is as follows:

[0090]

[0091] In the formula, t represents the current time, i represents the i-th phoneme in the phoneme sequence, j represents the j-th phoneme in the phoneme sequence, and N is the number of phonemes in the phoneme sequence. is the distribution value of the ith phoneme at time t, c i is the distribution center position of the ith phoneme, is the distribution variance of the ith phoneme, is the distribution value of the jth phoneme at time t, c i is the distribution center position of the jth phoneme, The distribution variance j of the j-th phoneme ranges from 1 to N.

[0092] Based on the above embodiments, Figure 5 This is the second training method of a speech synthesis model provided by the present invention. Figure 5 As shown, an embodiment of the present invention provides a method for training a speech synthesis model, comprising:

[0093] Step 510: In the initial synthesis model, the encoding module encodes and models the linguistic information of the sample text. Here, the input linguistic information can be a phoneme ID sequence or a feature sequence containing context tags obtained through front-end analysis. The encoding module can perform nonlinear encoding on the linguistic information through a multi-layer multi-head self-attention network to obtain the features of each phoneme in the phoneme sequence of the sample text.

[0094] Step 520, in the initial synthesis model, the duration prediction module can predict the duration corresponding to each phoneme based on the output of the encoding module. The module first re-encodes the output of the encoding module through a three-layer bidirectional LSTM network so that the encoded hidden vector contains more information about the duration, and then predicts the duration of each phoneme through a feedforward neural network. It should be noted that this module does not have a target duration, so the module will not be driven to update by a duration error. In order to solve the problem of error accumulation, the predicted duration of the duration prediction module is directly input into the subsequent upsampling module and decoding module, and the error of the final acoustic feature is used to drive the update of the duration prediction module.

[0095] Step 530: In the initial synthesis model, the upsampling module upsamples the output of the encoding module to the scale of the acoustic features according to the output of the duration prediction module, so that each frame of acoustic features can obtain its corresponding linguistic information.

[0096] The upsampling modules of most non-autoregressive speech synthesis models are very simple. They directly copy the output of the encoding module according to the target duration of each phoneme. For example, the output sequence of the encoding module is [h1,h2,h3], the target duration is [1,2,2], and the output after upsampling is [h1,h2,h2,h3,h3]. Although this direct copying method is simple, since the linguistic information within a phoneme is the same, there will be a discontinuous mutation at the phoneme boundary, which will lead to unsatisfactory synthesis effect at the phoneme boundary. The attention mechanism mentioned above can be regarded as a soft upsampling method. Each frame of the upsampled sequence is a weighted sum of the output of the encoding module. Therefore, adjacent frames are relatively continuous, and the synthesis effect of phoneme boundaries is better.

[0097] The embodiment of the present invention adopts a Gaussian upsampling method, which defines a single Gaussian distribution for each phoneme. For the ith phoneme, the mean c of the corresponding Gaussian distribution is i As its center position, its calculation formula is:

[0098]

[0099] Among them, d i is the predicted duration of the ith phoneme, T j is the label duration of the j-th phoneme.

[0100] The variance of the Gaussian distribution is obtained through a variance prediction module. The input of the variance prediction module is the duration and the output of the encoding module. The two are concatenated and then passed through a bidirectional LSTM encoding, and then a feedforward neural network is used to predict the variance. It is worth noting that the Gaussian upsampling method is a flexible upsampling method similar to the attention mechanism. Therefore, the feature u obtained by upsampling at the tth moment is t is the output of the encoding module h i The weighted sum of is calculated as follows:

[0101]

[0102] Among them, ω ti is the weight of the i-th phoneme output of the encoding module at the t-th time. The weight is calculated based on the value of each single Gaussian distribution at the current time. The calculation formula is as follows:

[0103]

[0104] Where t represents the current time, i represents the i-th phoneme in the phoneme sequence, j represents the j-th phoneme in the phoneme sequence, and N represents the number of phonemes in the phoneme sequence. is the distribution value of the ith phoneme at time t, c i is the distribution center position of the ith phoneme, is the distribution variance of the ith phoneme, is the distribution value of the jth phoneme at time t, c i is the distribution center position of the jth phoneme, is the distribution variance of the j-th phoneme, and the value of j ranges from 1 to N.

[0105] Gaussian upsampling makes the linguistic information of the phoneme boundary relatively continuous. At the same time, the weighted weight of the corresponding encoding module output can be obtained according to the time corresponding to the acoustic feature, and then the corresponding linguistic information can be obtained. However, since the prediction of the duration model is not completely accurate, and there is a problem of cumulative duration errors, the center position of each phoneme is not accurate, especially for the phonemes at the end of the sentence, the error will be particularly large, and when the error is too large, it may cause the model to go off track. In order to prevent this problem, we introduce the duration extracted from the segmentation model. When calculating the center position of a phoneme, the historical phoneme duration of the current phoneme is replaced by the extracted duration. Using the extracted duration can ensure that the center position of each Gaussian distribution is roughly accurate, avoid the problem of cumulative duration errors, make the model less likely to go off track, and can be trained normally and stably.

[0106] Step 540: The decoding module establishes the conversion relationship between the frame-level phonetic feature sequence (i.e., the output of the upsampling module) and the acoustic feature. The model re-encodes the linguistic features through a three-layer LSTM, and then predicts the acoustic features through a feedforward neural network, and trains the model using the minimum mean square error (MSE) criterion of the acoustic features.

[0107] Figure 6 For Figure 5 The corresponding framework diagram is Figure 6 is a framework diagram of a method for training a speech synthesis model provided by the present invention. Figure 6 As shown in the figure, Input Embedding means input encoding, which encodes the input sample text into a text vector. Positional Encoding means position encoding, which is used to indicate the position of each word in the text. Combining the text vector and position encoding, the phoneme sequence of the sample text can be obtained.

[0108] Multi-Head Attention and Add&Norm as well as FFN and Add&Norm constitute the encoding module in the initial synthesis model. Add&Norm represents the normalized residual connection network, where Add represents the residual connection (ResidualConnection) used to prevent network degradation, and Norm represents LayerNormalization, which is used to normalize the activation values ​​of each layer. FNN is the Feed-Forward Neural Network. Gaussian Upsampler is Gaussian upsampling. Through the encoding module, the characteristics of each phoneme in the phoneme sequence can be obtained.

[0109] Duration Predictor is a duration prediction module. Phone duration is the label duration of the phoneme. The predicted duration obtained by the duration prediction module based on the feature prediction of each phoneme and the pre-annotated label duration of each phoneme can be input into the Gaussian Upsampler module.

[0110] Gaussian Upsampler can determine the distribution center position of any phoneme based on the predicted duration of the phoneme and the label duration of each phoneme before the phoneme, and construct the Gaussian distribution of the phoneme based on this, so as to determine the weight value of the phoneme at each moment in the corresponding duration, and perform upsampling based on this.

[0111] 3LSTM is a three-layer bidirectional LSTM network. Projection is a feedforward neural network used to predict acoustic features. Filterbank is a filter. These three constitute a decoding module, which is used to decode the upsampled features to achieve speech synthesis.

[0112] The speech synthesis model training method provided by the present invention predicts the duration of each phoneme in the synthesized speech in the prediction text by using the duration prediction module in the initial synthesis model, and iteratively updates the parameters of the duration prediction module according to the gap between the sample speech of the sample text and the synthesized speech output by the initial synthesis model, thereby avoiding the accumulation of duration errors during the training of the duration prediction model and improving the performance and accuracy of the speech synthesis model in practical applications.

[0113] Figure 7 Schematic diagram of the speech synthesis method provided by the present invention. Figure 7 As shown, a speech synthesis method provided by an embodiment of the present invention includes:

[0114] Step 710, determining the text to be synthesized;

[0115] Step 720, based on the speech synthesis model, determine the synthesized speech of the text, the speech synthesis model is trained based on the training method of the speech synthesis model provided in any of the above embodiments.

[0116] Specifically, the speech synthesis model trained by the speech synthesis model training method provided in any of the above embodiments completes the speech synthesis of the text to be synthesized. It should be noted that the text to be synthesized can be a single language text or a multi-language mixed text, and can also include Arabic numerals, etc., which is not limited in the embodiments of the present invention.

[0117] The speech synthesis method provided by the present invention completes the speech synthesis of text by using a speech synthesis model trained by the speech synthesis model training method provided by any of the above embodiments, while improving the synthesis efficiency and the naturalness of the synthesized speech, avoiding the accumulation of time errors, thereby improving synthesis efficiency and accuracy.

[0118] The training device for the speech synthesis model provided by the present invention is described below. The training device for the speech synthesis model described below and the training method for the speech synthesis model described above can refer to each other.

[0119] Figure 8 Schematic diagram of the structure of the training device of the speech synthesis model provided by the present invention. Figure 8 As shown, the device includes: a determination module 810 and a training module 820.

[0120] in,

[0121] A determination module 810 is used to determine an initial synthesis model, wherein the initial synthesis model includes a duration prediction module, and the duration prediction module is used to predict the duration of each phoneme in the text in the synthesized speech;

[0122] The training module 820 is used to determine the synthesized speech of the sample text based on the initial synthesis model, and iteratively update the parameters of the duration prediction module based on the gap between the sample speech and the synthesized speech of the sample text to obtain a trained speech synthesis model.

[0123] In an embodiment of the present invention, a determination module 810 is used to determine an initial synthesis model, and the initial synthesis model includes a duration prediction module, and the duration prediction module is used to predict the duration of each phoneme in the text in the synthesized speech; a training module 820 is used to determine the synthesized speech of the sample text based on the initial synthesis model, and iteratively update the parameters of the duration prediction module based on the gap between the sample speech of the sample text and the synthesized speech to obtain a trained speech synthesis model, thereby realizing the use of the duration prediction module in the initial synthesis model to predict the duration of each phoneme in the predicted text in the synthesized speech, and iteratively update the parameters of the duration prediction module based on the gap between the sample speech of the sample text and the synthesized speech output by the initial synthesis model, thereby avoiding the accumulation of duration errors during the training of the duration prediction model and improving the performance and accuracy of the speech synthesis model in practical applications.

[0124] Based on any of the above embodiments, the training module 820 includes:

[0125] The encoding submodule is used to encode the linguistic features of the sample text based on the encoding module in the initial synthesis model to obtain the features of each phoneme in the phoneme sequence of the sample text;

[0126] The duration prediction submodule is used to predict the duration of each phoneme in the synthesized speech based on the duration prediction module and the characteristics of each phoneme, so as to obtain the predicted duration of each phoneme;

[0127] An upsampling submodule, used to upsample the features of each phoneme based on the upsampling module in the initial synthesis model to obtain upsampled features of each phoneme, wherein the length of the upsampled features is determined based on the predicted duration;

[0128] The decoding submodule is used to acoustically decode the upsampled features of each phoneme based on the decoding module in the initial synthesis model to obtain synthesized speech.

[0129] Based on any of the above embodiments, the upsampling submodule includes:

[0130] A weight calculation submodule, for upsampling the features of any phoneme based on the upsampling module in the initial synthesis model and the weight of any phoneme at each moment in the corresponding prediction duration, to obtain the upsampled features of any phoneme;

[0131] The weight of any phoneme at each moment in the corresponding prediction duration is determined based on the distribution of the phoneme in the corresponding prediction duration.

[0132] Based on any of the above embodiments, the weight calculation submodule includes:

[0133] A distribution center determination submodule, used to determine the distribution center position of any phoneme based on the predicted duration of any phoneme and the label durations of each phoneme before any phoneme in the phoneme sequence;

[0134] The distribution determination submodule is used to determine the distribution of any phoneme based on the predicted duration of the phoneme and the distribution center position of the phoneme.

[0135] Based on any of the above embodiments, the distribution determination submodule is specifically used to determine the distribution of any phoneme based on the predicted duration of the phoneme, the distribution center position of the phoneme, and the distribution discrete parameter of the phoneme;

[0136] The distribution discrete parameters are determined based on the characteristics and predicted duration of any phoneme.

[0137] Based on any of the above embodiments, the weight calculation submodule includes:

[0138] A partial value calculation submodule, for determining the distribution value of any phoneme at any moment in the corresponding prediction duration based on the distribution of the phoneme in the corresponding prediction duration;

[0139] The weight value calculation submodule is used to determine the weight of a moment based on the distribution value at any moment and the sum of the distribution values ​​of the phoneme at each moment in the corresponding prediction duration.

[0140] Fig. 9 Schematic diagram of the structure of the speech synthesis device provided by the present invention. Fig. 9 As shown, the device includes: a determination module 910 and a synthesis module 920.

[0141] in,

[0142] A determination module 910, used to determine the text to be synthesized;

[0143] The synthesis module 920 is used to determine the synthesized speech of the text based on a speech synthesis model, where the speech synthesis model is trained based on any speech synthesis model training method provided in the above embodiments.

[0144] In an embodiment of the present invention, a determination module 910 is used to determine the text to be synthesized; a synthesis module 920 is used to determine the synthesized speech of the text based on a speech synthesis model, and the speech synthesis model is trained based on any one of the speech synthesis model training methods provided in the above embodiments. The speech synthesis model trained using the speech synthesis model training method provided in any one of the above embodiments is implemented to complete the speech synthesis of the text, while improving the synthesis efficiency and the naturalness of the synthesized speech, avoiding the accumulation of time errors, thereby improving synthesis efficiency and accuracy.

[0145] Fig.10 The following is a schematic diagram of the physical structure of an electronic device. Fig.10 As shown, the electronic device may include: a processor 1010, a communication interface 1020, a memory 1030 and a communication bus 1040, wherein the processor 1010, the communication interface 1020 and the memory 1030 communicate with each other through the communication bus 1040. The processor 1010 may call the logic instructions in the memory 1030 to execute the training method of the speech synthesis model or the speech synthesis method, wherein the training method of the speech synthesis model includes: determining an initial synthesis model, the initial synthesis model includes a duration prediction module, the duration prediction module is used to predict the duration of each phoneme in the text in the synthesized speech; based on the initial synthesis model, determining the synthesized speech of the sample text, based on the gap between the sample speech and the synthesized speech of the sample text, iteratively updating the parameters of the duration prediction module, and obtaining the trained speech synthesis model. The speech synthesis method includes: determining the text to be synthesized; based on the speech synthesis model, determining the synthesized speech of the text, the speech synthesis model is trained based on the training method of the speech synthesis model described in any one of the above embodiments.

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

[0147] On the other hand, the present invention also provides a computer program product, the computer program product includes a computer program, the computer program can be stored on a non-transitory computer-readable storage medium, when the computer program is executed by a processor, the computer can execute the training method of the speech synthesis model or the speech synthesis method provided by the above methods, wherein the training method of the speech synthesis model includes: determining an initial synthesis model, the initial synthesis model includes a duration prediction module, the duration prediction module is used to predict the duration of each phoneme in the text in the synthesized speech; based on the initial synthesis model, determining the synthesized speech of the sample text, based on the gap between the sample speech and the synthesized speech of the sample text, iteratively updating the parameters of the duration prediction module, and obtaining a trained speech synthesis model. The speech synthesis method includes: determining the text to be synthesized; based on the speech synthesis model, determining the synthesized speech of the text, the speech synthesis model is trained based on the training method of the speech synthesis model described in any one of the above embodiments.

[0148] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the processor executes the training method of the speech synthesis model or the speech synthesis method provided by the above methods, wherein the training method of the speech synthesis model includes: determining an initial synthesis model, the initial synthesis model includes a duration prediction module, the duration prediction module is used to predict the duration of each phoneme in the text in the synthesized speech; based on the initial synthesis model, determining the synthesized speech of the sample text, based on the gap between the sample speech and the synthesized speech of the sample text, iteratively updating the parameters of the duration prediction module to obtain a trained speech synthesis model. The speech synthesis method includes: determining the text to be synthesized; based on the speech synthesis model, determining the synthesized speech of the text, the speech synthesis model is trained based on the training method of the speech synthesis model described in any one of the above embodiments.

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

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

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

Claims

1. A method for training a speech synthesis model, characterized in that: include: Determine an initial synthesis model, wherein the initial synthesis model includes a duration prediction module, wherein the duration prediction module is used to predict the duration of each phoneme in the text in the synthesized speech; Based on the initial synthesis model, the synthesized speech of the sample text is determined, and based on the difference between the sample speech of the sample text and the synthesized speech, the parameters of the duration prediction module are iteratively updated, and the duration prediction module is guided to iteratively update in a direction where the predicted duration is close to the actual duration of each phoneme in the sample speech, without referring to the marked duration, to obtain a trained speech synthesis model; The step of determining the synthesized speech of the sample text based on the initial synthesis model includes: Based on the encoding module in the initial synthesis model, the sample text is encoded with linguistic nonlinear features through a multi-layer multi-head self-attention network to obtain the features of each phoneme in the phoneme sequence of the sample text; Based on the duration prediction module and the characteristics of each phoneme, the duration of each phoneme in the synthesized speech is predicted according to the characteristics of each phoneme and multiple adjacent phonemes to obtain the predicted duration of each phoneme; when predicting the duration, the characteristics of each phoneme are secondary encoded, and the duration of each factor is predicted according to the characteristics of each phoneme containing duration information obtained after the secondary encoding; the duration prediction module secondary encodes the output of the encoding module through a three-layer bidirectional LSTM network, and the encoded hidden layer vector contains information about the duration, and then predicts the duration of each phoneme through a feedforward neural network; Based on the upsampling module in the initial synthesis model, upsampling the features of each phoneme to obtain upsampled features of each phoneme, wherein the length of the upsampled features is determined based on the predicted duration; Based on the decoding module in the initial synthesis model, acoustic decoding is performed on the upsampled features of each phoneme to obtain the synthesized speech; The upsampling module in the initial synthesis model upsamples the features of each phoneme to obtain the upsampled features of each phoneme, including: Based on the upsampling module in the initial synthesis model and the weight of any phoneme at each moment in the corresponding prediction duration, upsampling the feature of any phoneme to obtain the upsampled feature of any phoneme; The weight of any phoneme at each moment in the corresponding predicted duration is determined based on the distribution of any phoneme in the corresponding predicted duration.

2. The method for training a speech synthesis model according to claim 1, characterized in that: The distribution of any phoneme in the corresponding predicted duration is determined based on the following steps: Determining the distribution center position of any phoneme based on the predicted duration of any phoneme and the label durations of each phoneme before any phoneme in the phoneme sequence; The distribution of any phoneme is determined based on the predicted duration of any phoneme, the distribution center position of any phoneme, and the distribution discrete parameter of any phoneme.

3. The method for training a speech synthesis model according to claim 2, characterized in that: The distribution dispersion parameter is determined based on the characteristics and predicted duration of any one of the phonemes.

4. The method for training a speech synthesis model according to claim 1, characterized in that: The weight of any phoneme at each moment in the corresponding prediction duration is determined based on the following steps: Determine, based on the distribution of any phoneme in the corresponding predicted duration, a distribution value of any phoneme at any moment in the corresponding predicted duration; The weight of any moment is determined based on the distribution value at any moment and the sum of the distribution values ​​of any phoneme at each moment in the corresponding prediction duration.

5. A speech synthesis method, characterized in that: include: Determine the text to be synthesized; The synthesized speech of the text is determined based on a speech synthesis model, wherein the speech synthesis model is trained based on the training method of the speech synthesis model according to any one of claims 1 to 4.

6. A training device for a speech synthesis model, characterized in that: include: A determination module, used to determine an initial synthesis model, wherein the initial synthesis model includes a duration prediction module, wherein the duration prediction module is used to predict the duration of each phoneme in the text in the synthesized speech; A training module, for determining the synthesized speech of the sample text based on the initial synthesis model, iteratively updating the parameters of the duration prediction module based on the difference between the sample speech of the sample text and the synthesized speech, guiding the duration prediction module to iteratively update in a direction where the predicted duration is close to the actual duration of each phoneme in the sample speech, without referring to the marked duration, to obtain a trained speech synthesis model; The training module is specifically used for: Based on the encoding module in the initial synthesis model, the sample text is encoded with linguistic nonlinear features through a multi-layer multi-head self-attention network to obtain the features of each phoneme in the phoneme sequence of the sample text; Based on the duration prediction module and the characteristics of each phoneme, the duration of each phoneme in the synthesized speech is predicted according to the characteristics of each phoneme and multiple adjacent phonemes to obtain the predicted duration of each phoneme; when predicting the duration, the characteristics of each phoneme are secondary encoded, and the duration of each factor is predicted according to the characteristics of each phoneme containing duration information obtained after the secondary encoding; the duration prediction module secondary encodes the output of the encoding module through a three-layer bidirectional LSTM network, and the encoded hidden layer vector contains information about the duration, and then predicts the duration of each phoneme through a feedforward neural network; Based on the upsampling module in the initial synthesis model, upsampling the features of each phoneme to obtain upsampled features of each phoneme, wherein the length of the upsampled features is determined based on the predicted duration; Based on the decoding module in the initial synthesis model, acoustic decoding is performed on the upsampled features of each phoneme to obtain the synthesized speech; The training module is also specifically used for: Based on the upsampling module in the initial synthesis model and the weight of any phoneme at each moment in the corresponding prediction duration, upsampling the feature of any phoneme to obtain the upsampled feature of any phoneme; The weight of any phoneme at each moment in the corresponding predicted duration is determined based on the distribution of any phoneme in the corresponding predicted duration.

7. A speech synthesis device, characterized in that: include: A determination module, used for determining the text to be synthesized; A synthesis module is used to determine the synthesized speech of the text based on a speech synthesis model, wherein the speech synthesis model is trained based on the training method of the speech synthesis model described in any one of claims 1 to 4.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, it implements the steps of the training method of the speech synthesis model as described in any one of claims 1 to 4, or implements the steps of the speech synthesis method as described in claim 5.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it implements the steps of the training method of the speech synthesis model as described in any one of claims 1 to 4, or implements the steps of the speech synthesis method as described in claim 5.

Citation Information

Patent Citations

  • Voice synthesis method and device, storage medium and electronic equipment

    CN111583904A

  • Voice synthesis method and device, synthesis model training method and device, medium and equipment

    CN112786011A