Text-to-speech method, apparatus, device, and medium
By combining the internal penalty and external reward of the diffusion model to optimize the text-to-speech model, the limitations of the diffusion model in emotion and rhythm control are solved, and the naturalness and stability of the speech are improved, making it suitable for information transmission in financial and medical scenarios.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- PING AN TECH (SHENZHEN) CO LTD
- Filing Date
- 2026-01-09
- Publication Date
- 2026-06-12
AI Technical Summary
Existing diffusion models have limitations in generating speech in terms of emotional expression and rhythm control, resulting in poor information delivery in key scenarios and affecting user trust and reception.
By combining the original training loss of the diffusion model as an internal regularization penalty with an external human preference reward, a combined optimization objective is constructed to optimize the text-to-speech diffusion model, ensuring the naturalness and stability of the generated speech.
It achieves improved naturalness and quality in generated speech, conforms to human auditory preferences, enhances the credibility and accuracy of key information transmission, and meets the professional requirements of financial and medical scenarios.
Smart Images

Figure CN121708901B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of speech synthesis technology, and in particular to a text-to-speech method, apparatus, device, and medium. Background Technology
[0002] With the development of deep learning, text-to-speech technology based on diffusion models has attracted widespread attention due to its ability to generate high-quality, high-fidelity speech. Diffusion models generate speech waveforms through a progressive denoising process. However, despite its excellent performance in terms of sound fidelity, this model still has limitations in accurately modeling subtle and crucial vocal features such as intonation, rhythm, and emotional expression. This can result in generated speech that, while clear and understandable, lacks the natural fluency and emotional variation of human speech, sounding monotonous or mechanical. In financial scenarios, such as when automatically broadcasting dynamic market data or investment risk warnings, this lack of emotional variation and rhythmic control may weaken the authority and persuasiveness of the information, affecting customers' reception and trust in key financial information. In medical scenarios, such as when clearly explaining complex treatment plans or providing health guidance to patients, overly flat and impersonal speech lacking empathy and warmth may fail to effectively alleviate patient anxiety and even affect their adherence to important medical advice. Summary of the Invention
[0003] This invention provides a text-to-speech method, apparatus, computer device, and medium to address the technical problem that while speech generated by a diffusion probability model is faithful to the original, it lacks naturalness and may affect the effectiveness of information transmission and reception in critical scenarios requiring emotional expression and trust building.
[0004] Firstly, a text-to-speech method is provided, including:
[0005] Get text data;
[0006] Based on a pre-trained text-to-speech diffusion model, the text data is subjected to multi-step denoising processing to generate initial speech data.
[0007] The initial speech data is evaluated based on a pre-defined reward model to generate a reward score;
[0008] A penalty score is generated based on the original training loss of the pre-trained text-to-speech diffusion model.
[0009] Based on reward and penalty scores, the parameters of the text-to-speech diffusion model are updated, and the updated text-to-speech diffusion model is used to convert the text data to generate the target speech data.
[0010] Secondly, a text-to-speech device is provided, comprising:
[0011] The acquisition module is used to acquire text data;
[0012] The first generation module is used to perform multi-step denoising on text data based on a pre-trained text-to-speech diffusion model to generate initial speech data.
[0013] The second generation module is used to evaluate the initial voice data based on a preset reward model and generate a reward score.
[0014] The third generation module is used to generate penalty scores based on the original training loss of the pre-trained text-to-speech diffusion model.
[0015] The model optimization module is used to update the parameters of the text-to-speech diffusion model based on reward and penalty scores. The fourth generation module is used to convert text data using the updated text-to-speech diffusion model to generate target speech data.
[0016] Thirdly, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the above-described text-to-speech method.
[0017] Fourthly, a computer-readable storage medium is provided, which stores a computer program that, when executed by a processor, implements the steps of the above-described text-to-speech method.
[0018] The aforementioned text-to-speech method, apparatus, computer equipment, and storage medium utilize the original training loss of the diffusion model as an internal regularization penalty term. This loss is combined with external human preference rewards to construct a combined optimization objective to optimize the text-to-speech diffusion model. This ensures the stability of the optimization process during reinforcement learning fine-tuning, effectively maintaining the model's inherent high-quality waveform generation capability while pursuing higher human preference scores, thus guaranteeing the stability and reliability of the optimized model. A good balance is achieved between naturalness, stability, computational efficiency, and content accuracy. This significantly improves the quality and naturalness of the generated speech while maintaining low latency, making it more in line with human auditory preferences. In financial scenarios, this optimization enhances the naturalness of professional expressions while ensuring absolute accuracy in the pronunciation of key figures and risk warnings, maintaining the rigor and credibility of financial information transmission. In medical scenarios, the optimized speech enhances the friendliness and reassuring effect of guidance statements while strictly ensuring clear pronunciation and unambiguous content of medical terminology, meeting the safety and standardization requirements of medical communication. Attached Figure Description
[0019] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This is a schematic diagram of an application environment for a text-to-speech method according to an embodiment of the present invention;
[0021] Figure 2 This is a flowchart illustrating a text-to-speech method according to an embodiment of the present invention;
[0022] Figure 3 yes Figure 2 A schematic diagram of a specific implementation method for step S20;
[0023] Figure 4 yes Figure 2 A schematic diagram of a specific implementation method for step S30;
[0024] Figure 5 yes Figure 2 A schematic diagram of a specific implementation of step S40;
[0025] Figure 6 This is a schematic diagram of the optimization process of the text-to-speech diffusion model in one embodiment of the present invention;
[0026] Figure 7 This is a schematic diagram of a text-to-speech device according to an embodiment of the present invention;
[0027] Figure 8 This is a schematic diagram of the structure of a computer device according to an embodiment of the present invention;
[0028] Figure 9 This is another structural schematic diagram of a computer device according to one embodiment of the present invention. Detailed Implementation
[0029] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0030] The text-to-speech method provided in this invention can be applied to, for example... Figure 1In this application environment, the client communicates with the server via a network. The server acquires text data; based on a pre-trained text-to-speech diffusion model, it performs multi-step denoising on the text data to generate initial speech data; it evaluates the initial speech data based on a preset reward model to generate a reward score; it generates a penalty score based on the original training loss of the pre-trained text-to-speech diffusion model; based on the reward and penalty scores, it updates the parameters of the text-to-speech diffusion model, and then uses the updated model to convert the text data to generate the target speech data. By using the original training loss of the diffusion model as an internal regularization penalty term, combined with an external human preference reward, a combined optimization objective is constructed to optimize the text-to-speech diffusion model. This ensures the stability of the optimization process during reinforcement learning fine-tuning, effectively maintaining the model's inherent high-quality waveform generation capability while pursuing higher human preference scores, thus guaranteeing the stability and reliability of the optimized model. A good balance is achieved between naturalness, stability, computational efficiency, and content accuracy, thereby significantly improving the quality and naturalness of the generated speech while maintaining low latency, making it more in line with human auditory preferences. The client can be, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices. The server can be implemented using a standalone server or a server cluster consisting of multiple servers. The invention will now be described in detail through specific embodiments.
[0031] Please see Figure 2 As shown, Figure 2 A flowchart illustrating a text-to-speech method provided in an embodiment of the present invention includes the following steps:
[0032] S10: Obtain text data.
[0033] In this step, the text data can come from a variety of input interfaces, including real-time user input, local text files, structured databases, or natural language text obtained from remote network interfaces.
[0034] Optionally, after acquiring text data, it is usually necessary to perform preprocessing operations, such as text cleaning, word segmentation, and punctuation standardization, to ensure that the text format meets the standard requirements of the model input.
[0035] For example, in a financial context, text data can be used for market sentiment analysis, such as "Its commercial real estate loan exposure, as shown on page 42 of the financial statement notes, has exceeded the warning line, requiring vigilance during a downward cycle." In a medical context, text data can be used for records of clinical diagnosis and treatment processes, such as "On the third day after surgery, the patient had no fever, and the drainage fluid was light red, approximately 30ml per day. Physical examination: the incision dressing was dry, and there was no redness or swelling around it. The recovery process is considered to be progressing smoothly."
[0036] S20: Based on a pre-trained text-to-speech diffusion model, the text data undergoes multi-step denoising processing to generate initial speech data.
[0037] In this step, a pre-trained text-to-speech diffusion model is loaded, and text data is input into the model to generate corresponding speech feature conditions. Initial noise waveforms are sampled from a standard Gaussian distribution, and based on these speech feature conditions, a T-step iterative denoising process is performed through the diffusion model. At each step t (from T to 1), the model receives the current noisy speech, time step information, and speech feature conditions, predicts the noise components of the current step, and calculates cleaner speech using a denoising formula. After T iterations, the initial speech data is finally obtained.
[0038] In one embodiment of this application, a specific model training scheme is provided, namely, based on a pre-trained text-to-speech diffusion model, before performing multi-step denoising processing on text data to generate initial speech data, specifically including the following steps:
[0039] A text-to-speech diffusion model architecture is constructed, which includes a text encoder and a diffusion denoising probability model.
[0040] Obtain a text-speech dataset as the training dataset, which consists of text sequences and their corresponding real speech waveforms;
[0041] Based on text sequences, speech feature conditions are generated through a text encoder;
[0042] A diffusion time step is randomly sampled from the preset noise schedule;
[0043] Based on the real speech waveform and the sampling diffusion time step, a forward diffusion process is performed to generate a noisy speech waveform and the corresponding real added noise;
[0044] The noisy speech waveform, diffusion time step, and speech feature conditions are input into the diffusion denoising probability model to predict noise and obtain the predicted noise.
[0045] The diffusion training loss is calculated based on the difference between the predicted noise and the actual added noise.
[0046] Based on the diffusion training loss, the parameters of the text encoder and the diffusion denoising probability model are updated using the gradient backpropagation algorithm.
[0047] When the preset convergence condition is met, the iterative training stops, and the pre-trained text-to-speech diffusion model is obtained.
[0048] In this embodiment, firstly, the basic architecture of the text-to-speech diffusion model is constructed, comprising two components: a text encoder and a diffusion denoising probabilistic model. The text encoder is responsible for converting the input text sequence into a feature representation with semantic information, while the diffusion denoising probabilistic model is tasked with reconstructing a clear speech waveform from noise. Secondly, a text-speech dataset is acquired as the model's training data. This dataset consists of text sequences and their corresponding real speech waveforms, ensuring that the model can establish an accurate mapping relationship between text content and speech signals during the learning process.
[0049] During training, speech feature conditions are generated by a text encoder based on the input text sequence. These conditions serve as guiding information for the subsequent diffusion process. Then, a diffusion time step is randomly sampled from a pre-defined noise scheduling strategy. This time step determines the noise addition intensity in the current training iteration. Based on the real speech waveform and the sampled diffusion time step, a forward diffusion process is executed. This involves adding Gaussian noise to the original speech according to the mathematical principles of the diffusion model, generating a noisy speech waveform, and simultaneously recording the actual added noise value as a training supervision signal.
[0050] Furthermore, the noisy speech waveform, diffusion time step, and speech feature conditions are jointly input into the diffusion denoising probabilistic model, whose task is to predict the noise components added in the current step. The diffusion training loss is calculated by comparing the difference between the noise predicted by the model and the actual added noise. This loss function typically uses mean squared error to directly measure the model's accuracy on the noise estimation task. Based on the calculated diffusion training loss, the parameters of both the text encoder and the diffusion denoising probabilistic model are updated simultaneously using the gradient backpropagation algorithm, enabling the two components to co-optimize during training. The text encoder learns how to generate more discriminative conditional features, while the diffusion denoising probabilistic model improves its ability to recover speech from noise.
[0051] Furthermore, the above training steps are iteratively executed on the dataset to form a continuously optimizing learning process. When the preset convergence conditions are met, such as the training loss stabilizing, the validation set performance no longer improving, or the preset maximum number of iterations is reached, the training process is stopped, and the resulting text-to-speech diffusion model is the completed training result.
[0052] Optionally, the text-to-speech diffusion model is a non-autoregressive TTS (Text-to-Speech) diffusion model, such as WaveGrad2R, a reproducible version based on the WaveGrad2 architecture.
[0053] In one embodiment of this application, such as Figure 3As shown, a specific speech data generation scheme is provided. In S20, based on a pre-trained text-to-speech diffusion model, the text data undergoes multi-step denoising processing to generate initial speech data, specifically including the following steps S21-S23:
[0054] S21: Input the text data into the pre-trained text-to-speech diffusion model, and encode the text data through the text encoder to generate a text conditional vector.
[0055] In this step, text data is input into a pre-trained text-to-speech diffusion model. A text encoder performs deep semantic analysis on the text data, extracting its phonetic features, prosodic structure, and semantic content to generate a text conditional vector containing rich speech generation guidance information. This vector serves as the core control signal for subsequent generation processes, ensuring that the output speech maintains consistency with the input text in content, intonation, and rhythm.
[0056] By using the above method, the text condition vector is used as a navigation signal in the generation process to ensure a high degree of consistency between the speech content and the text semantics.
[0057] S22: Construct Gaussian noise that matches the text conditional vector.
[0058] In this step, random noise is sampled from a standard Gaussian distribution, and a noise basis matching the text conditional vector is constructed using this random noise. This noise basis serves as the starting point for speech generation; its randomness ensures the uniqueness of each generation result, while the Gaussian distribution properties provide mathematical tractability for the inverse denoising process of the diffusion model.
[0059] S23: Input the text conditional vector and Gaussian noise into the diffusion denoising probability model, perform multi-step iterative denoising processing on the Gaussian noise based on the text conditional vector, and generate the initial speech data corresponding to the text data.
[0060] In this step, the text conditional vector and Gaussian noise are input into the diffusion denoising probabilistic model, initiating a multi-step iterative denoising process. In each denoising step, guided by the text conditional vector, the model predicts and removes a portion of the noise components from the current noisy speech, gradually clarifying the speech waveform. This iterative process typically involves hundreds to thousands of steps, each step bringing the speech signal closer to the target distribution, ultimately generating initial speech data that precisely corresponds to the semantic content of the input text.
[0061] Through the above methods, the multi-step iterative denoising mechanism generates high-quality, high-fidelity speech waveforms using a progressive refinement strategy, ensuring both high-quality generation and good repeatability and stability. It overcomes common problems in traditional speech synthesis, such as unnatural sound and abrupt rhythm, achieving a smooth and natural conversion from text to speech.
[0062] In one embodiment of this application, a specific speech data generation scheme is provided. In S23, based on a pre-trained text-to-speech diffusion model, the text data undergoes multi-step denoising processing to generate initial speech data, specifically including the following steps S231-S234:
[0063] S231: Determine the total number of time steps for denoising iterations based on text conditional vectors.
[0064] In this step, the total number of denoising steps required is dynamically calculated based on the semantic complexity of the text and the preset quality requirements, so as to ensure the precision and naturalness of the final speech waveform.
[0065] S232: Starting from the initial time step of the total number of time steps, for any time step, input the Gaussian noise and text condition vector corresponding to the current time step into the diffusion denoising probability model to obtain the prediction noise corresponding to the current step.
[0066] S233: Remove the prediction noise from the Gaussian noise to obtain the Gaussian noise for the next time step.
[0067] S234: Use the Gaussian noise of the next time step as the noise of the current step, and proceed to the next iteration step until the termination condition of the total number of time steps is reached, generating the denoised initial speech data.
[0068] For steps S232-S234, starting from the initial time step of the total time steps, the following operations are performed for each time step: First, the Gaussian noise corresponding to the current time step and the text conditional vector are input into the diffusion denoising probability model. This model, guided by text semantics, predicts the noise components that should be removed from the current noise. Second, according to the inverse generation formula of the diffusion model, the predicted noise component is subtracted from the current Gaussian noise to obtain the Gaussian noise of the next time step with lower noise intensity and clearer speech structure. Then, the updated Gaussian noise is used as the input for a new round of iteration, and the above noise prediction and removal process is repeated. The above steps are executed cyclically until the termination condition of the total time steps is reached, that is, the time step is zero. At this time, the Gaussian noise has been gradually transformed into a speech waveform with clear semantic structure and natural prosodic features, that is, the initial speech data after denoising.
[0069] For example, taking the generation of 5 seconds of speech as an example, setting T=800 steps, the following iterative process is performed: Steps 800-600 (coarse noise reduction stage): focusing on the establishment of global semantic structure, processing time per step: 12ms, semantic alignment: improved from 0.1 to 0.4; Steps 599-200 (fine adjustment stage): optimizing timbre and prosodic features, processing time per step: 15ms, sound quality score: improved from 0.3 to 0.8; Steps 199-1 (fine-tuning and improvement stage): improving the naturalness of details, processing time per step: 18ms, naturalness score: improved from 0.7 to 0.95; Step 0 (final output): outputting a standard audio format with a sampling rate of 44.1kHz and a depth of 16 bits.
[0070] By using the above method, Gaussian noise is gradually converted into a high-quality speech waveform that conforms to the semantics of the text through progressively refining the waveform, in order to capture the subtle harmonic structure, breathing transitions and emotional rhythms in human speech, and generate natural speech that is close to that of a real person.
[0071] S30: Evaluate the initial speech data based on a preset reward model and generate a reward score.
[0072] In this step, the original training objective of the diffusion model is essentially to pursue the fidelity of data reconstruction, ensuring that the generated speech closely approximates the statistical distribution of the training data at the acoustic feature level. However, this objective does not cover the optimization of human subjective listening experience, such as naturalness and comfort. In real-world business scenarios, the naturalness and emotional expressiveness of speech output have become key factors influencing user retention and satisfaction. Therefore, this application proposes introducing a pre-set reward model. The generated speech data and its corresponding text conditions are input into this reward model to obtain a corresponding reward score. This score comprehensively reflects the performance of the generated speech in terms of naturalness, intelligibility, or overall quality; a higher score indicates that the speech quality is more in line with human auditory preferences.
[0073] Optionally, the preset reward model includes, but is not limited to, UTMOS (a system for automatically evaluating the naturalness of speech), NISQA (a non-intrusive speech quality assessment model), or other applicable speech quality assessment systems, which are not specifically limited here.
[0074] For example, the text-to-speech diffusion model generates an initial version of a risk warning speech based on the input text data. The UTMOS model quantifies and scores the clarity, professionalism, and credibility of the synthesized speech. For instance, the risk warning speech "Current market volatility has exceeded historical thresholds; it is recommended to reduce leverage" receives a score of 0.85 (out of 1) if the synthesized speech is delivered smoothly, emphasizes key points, and has no mechanical pauses; however, if the speech contains unnatural pitch changes or unclear pronunciation of key terms, its score drops to 0.62. In medical scenarios, the text-to-speech diffusion model generates initial postoperative rehabilitation guidance speech based on text data. The NISQA model adapted for medical scenarios comprehensively evaluates the speech quality from three dimensions: understandability, friendliness, and accuracy of medical terminology. For example, for the postoperative rehabilitation guidance voice message, "Please record the color and amount of incision exudate daily. If bright red or purulent discharge appears, please contact the department immediately," if the synthesized voice has the characteristics of moderate speaking speed, gentle tone, and accurate pronunciation of medical terminology, the reward model can give it 0.92 points; if the voice rhythm is too fast or the terminology is pronounced harshly, the score will drop to 0.70 points.
[0075] In one embodiment of this application, such as Figure 4 As shown, a specific reward score generation scheme is provided. In S30, the initial speech data is evaluated based on a preset reward model to generate a reward score, which specifically includes the following steps S31-S33:
[0076] S31: Input the initial speech data and its corresponding text condition vector into the preset reward model.
[0077] S32: The initial speech data is evaluated for naturalness using a preset reward model, and an evaluation result is generated;
[0078] The naturalness assessment includes at least one of the following: acoustic quality analysis, prosodic naturalness assessment, semantic conformity judgment, and overall auditory evaluation.
[0079] S33: Based on the evaluation results, a reward score is generated using a weighted aggregation algorithm.
[0080] For steps S31-S33, firstly, the initial speech data generated by the text-to-speech diffusion model and its corresponding text condition vector are input into a preset reward model. The text condition vector serves as a contextual reference for evaluation, ensuring that the reward model assesses the matching quality of the speech based on an understanding of the semantic intent of the text.
[0081] Furthermore, the pre-defined reward model performs a multi-dimensional naturalness assessment on the initial input speech data. This assessment process includes: acoustic quality analysis, used to detect the signal-to-noise ratio of the speech waveform, harmonic structure integrity, and the presence of artificial noise or distortion; prosodic naturalness assessment, used to analyze the rationality of intonation fluctuations, rhythmic fluency, and accuracy of stress placement; semantic conformity judgment, used to assess whether the speech content accurately conveys the meaning of the text based on text conditional vectors, including the clarity of keyword pronunciation and the appropriateness of semantic stress; and overall auditory perception evaluation, used to comprehensively judge whether the speech has natural human speech characteristics, such as appropriate breathing sounds, natural onset and decay.
[0082] Furthermore, the preset reward model generates quantitative evaluation results based on the aforementioned multi-dimensional assessment and analysis. Finally, a reward score is generated based on the multi-dimensional evaluation results through weighted aggregation.
[0083] Optionally, the speech data is input into the preset reward model in the form of waveform or spectrogram, and the text condition vector is input into the preset reward model in the form of embedding vector.
[0084] For example, taking a risk warning voice message in a financial scenario, the waveform of the risk warning voice message (3.2 seconds in length) and its corresponding text condition vector are input into the reward model. The reward model performs the following: Detecting the accuracy of the numerical announcement: the pronunciation clarity of "$45.2" scores 0.93; assessing the appropriateness of the risk tone: the tension level is moderate, scoring 0.82; analyzing the correctness of professional terminology: the pronunciation accuracy of "volatility" scores 0.95. The final output is a weighted average comprehensive reward score of 0.87 and a confidence level of 0.91.
[0085] S40: Generate penalty scores based on the original training loss of the pre-trained text-to-speech diffusion model.
[0086] In this step, the original training loss of the diffusion model during the generation process is calculated as a penalty score. The original training loss is the objective function optimized by the diffusion model in the pre-training stage, which is specifically a measure of the difference between the predicted noise and the actual added noise.
[0087] In one embodiment of this application, such as Figure 5 As shown, a specific penalty score generation scheme is provided. In S40, the penalty score is generated based on the original training loss of the pre-trained text-to-speech diffusion model, specifically including the following steps S41-S43:
[0088] S41: Obtain the predicted noise of the pre-trained text-to-speech diffusion model at each time step during the multi-step iterative denoising process.
[0089] S42: Calculate the original training loss of the pre-trained text-to-speech diffusion model based on the predicted noise and the actual added noise at the corresponding time step.
[0090] For steps S41-S42, during the multi-step iterative denoising process performed by the text-to-speech diffusion model, in each denoising step from time step T to 1, when the model receives noisy speech x... t When time step number t and text condition vector c are used as input, the output noise prediction value is... θ (x) t (c, t) will be fully recorded. At the same time, a noise prediction trajectory sequence is maintained, which fully records the stepwise estimation of the noise components by the model throughout the generation process.
[0091] The noise prediction trajectory sequence is as follows:
[0092]
[0093] Subsequently, based on the forward process theory of the text-to-speech diffusion model, the actual added noise corresponding to each time step is calculated. According to the mathematical definition of the diffusion model, from the original speech x0 to the noisy speech x... t The forward process expression is used to calculate the theoretically true noise value added in step t. t .
[0094] The forward process expression is:
[0095]
[0096] in, The actual noise added at this time step.
[0097] Then, by comparing the predicted noise with the actual noise, the original training loss of the pre-trained text-to-speech diffusion model is calculated.
[0098] Optionally, the loss function, which fully replicates the optimization objective of the model during the pre-training phase, can be in the form of mean squared error:
[0099]
[0100] Aggregate the losses from all time steps to obtain the overall original training loss:
[0101]
[0102] S43: Generate penalty scores based on the original training loss.
[0103] In this step, the training loss value is mapped to a penalty score using a monotonically decreasing function:
[0104]
[0105] in, A negative exponential or negative linear function is typically used to ensure that the greater the loss, the higher the penalty score.
[0106] S50: Based on the reward score and penalty score, update the parameters of the text-to-speech diffusion model, and use the updated text-to-speech diffusion model to convert the text data and generate the target speech data.
[0107] In this step, a combined optimization objective is constructed by combining reward and penalty scores. This objective is then used to update the parameters of the text-to-speech diffusion model via policy gradient updates. This allows the model to significantly improve the naturalness and auditory experience of the synthesized speech while maintaining speech intelligibility. The resulting optimized model shows significant improvements in objective evaluation metrics and achieves a higher preference rate in subjective human evaluation. Subsequently, based on this optimized text-to-speech diffusion model, high-quality target speech data can be generated and output.
[0108] By incorporating the original training loss of the diffusion model as a regularization penalty into the reward function of reinforcement learning, the aim is to balance the relationship between external reward optimization and the stability of the generated structure within the model. This prevents the model from overfitting in order to conform to the reward model, maintains the temporal coherence and acoustic structure of the generated audio, and thus fundamentally improves the stability of the fine-tuning process and the final speech quality.
[0109] In one embodiment of this application, a specific target speech data generation scheme is provided. In S50, the parameters of the text-to-speech diffusion model are updated based on the reward score and the penalty score, and the text data is converted using the updated text-to-speech diffusion model to obtain the target speech data. Specifically, this includes the following steps S51-S53:
[0110] S51: Construct a combined reward function based on reward scores and penalty scores.
[0111] In this step, external reward scores are combined with internal penalty scores to construct a combined reward function for reinforcement learning, thereby achieving co-optimization of external human preferences and internal model consistency.
[0112] The combined reward function is:
[0113]
[0114] in, θ is the combined reward function; θ is the model parameters; c is the text condition vector; The distribution of textual conditions in the training data; To randomly sample a text condition c from the text distribution of the training data; x0 is the speech data generated by the model being optimized in the current iteration; T is the denoising trajectory, T = (x0 + x0 + x0) / ( ...) T x T-1 (, ..., x0); To generate, given model parameters θ and text condition vector c The model probability distribution; As a reward weight; The quality score given by the preset reward model; For penalty weighting; Noise added to the real thing; This refers to the noise predicted by the model.
[0115] S52: Based on the combined reward function, the parameters of the text-to-speech diffusion model are updated through the policy gradient optimization algorithm to obtain the updated text-to-speech diffusion model.
[0116] In this step, the generation behavior of the text-to-speech diffusion model is first transformed into a Markov decision process, where each denoising step is considered an independent decision action, and the complete generation sequence constitutes a decision trajectory. A combined reward function provides a clear optimization objective for this decision process. This function integrates external reward scores reflecting human subjective preferences with penalty scores ensuring consistency in the model's internal generation, thus forming a composite optimization objective that balances auditory experience and acoustic integrity. Based on the combined reward function, the reward for each trajectory is calculated by sampling multiple rounds of generation trajectories, and the model parameters are adjusted along directions that increase the probability of generating high-reward trajectories. During the update process, the original diffusion loss acts as a stabilizer, ensuring that the model pursues higher naturalness scores without compromising its learned accurate waveform generation capabilities. By continuously executing the optimization loop, the model parameters gradually converge to a new equilibrium state until the model converges or reaches the preset training duration. The resulting optimized text-to-speech model not only generates speech that better suits human preferences in terms of naturalness and clarity, but also maintains a robust internal diffusion denoising mechanism, effectively avoiding acoustic structure degradation or semantic content distortion that may result from excessive pursuit of reward scores.
[0117] Specifically, in order to fine-tune the pre-trained text-to-speech diffusion model using reinforcement learning, its T-step inverse denoising process is first formalized as a finite-time Markov Decision Process (MDP), as defined below:
[0118] State (s) tThe state at denoising time step t is defined as the text condition c and the current noisy frequency x. T-t The combination, namely .
[0119] Action (a) t At state st, the model's action is to generate less noisy audio for the next time step, i.e. .
[0120] Strategy (π) θ The model's strategy is defined by the parameters θ of the pre-trained text-to-speech diffusion model.
[0121] Reward (R): The reward is only given in the final step of the generation process (i.e., when the final clean audio x0 is generated). This reward is provided by an external reward model (such as UTMOS) and is denoted as r(x0, c) to evaluate the overall naturalness of the generated audio.
[0122] Furthermore, traditional reinforcement learning (RLHF) methods based on human feedback aim to maximize the expected cumulative reward. However, directly applying them to speech synthesis tasks can easily lead to unstable optimization or even model performance degradation. Based on this, this application proposes a diffusion loss-guided policy optimization (DLPO) combined reward function. Here, αr(x0, c) is the external reward term: a pre-defined reward model score scaled by weight α, driving the model to generate speech that better matches human auditory preferences; The diffusion loss penalty term: the original objective function (i.e., the predicted noise) from the pre-training stage of the diffusion model is used as the penalty term. θ With real noise The mean squared error between the two sides is introduced as a negative reward (penalty). The weight β controls the strength of its influence on the optimization process. By introducing diffusion loss as an internal regularization term, it is possible to guide the model to adapt to human feedback (achieved by r(x0, c)) while effectively constraining it from deviating from the powerful waveform generation ability learned in the pre-training stage (achieved by r(x0, c)). This ensures the stability of the fine-tuning process and the overall quality of the final speech, thereby fundamentally improving the overall quality of the speech.
[0123] For example, in a financial scenario, the basic text-to-speech diffusion model generates a risk warning message with an external reward score of 0.75 and an internal penalty score of 0.008. The weights of the external reward and internal penalty are 1 and 0.5, respectively, resulting in a combined reward of 0.746. The model parameters are updated using a policy gradient algorithm to analyze which model decisions (such as certain denoising steps) led to this combined reward score. Iterative updates are then performed to increase the probability of generating high-reward decisions and decrease the probability of generating low-reward decisions, ultimately yielding an optimized text-to-speech diffusion model.
[0124] Through the aforementioned method, and after optimization using a diffusion loss-guided strategy, the model can generate higher-quality speech with the same number of denoising steps. While achieving acceptable quality, the required number of denoising steps is reduced, thus significantly lowering inference latency. This method effectively addresses the computational inefficiency of traditional diffusion models due to their reliance on multi-step iterative denoising processes, achieving a significant improvement in the quality and naturalness of generated speech while maintaining low latency, making it more in line with human auditory preferences.
[0125] In practical application scenarios, such as Figure 6 The diagram illustrates the optimization process of a text-to-speech diffusion model. First, the pre-trained model (Ppre) generates initial speech data based on the input text data. Then, this speech is input to a combined reward function for evaluation. This function calculates a combined reward score by integrating external human preference rewards and internal diffusion loss penalties. Next, based on this reward score, the model parameters are updated using a policy gradient algorithm (Model Update), adjusting the model parameters from the initial state Ppre towards the optimization direction. The updated model enters the next iteration (Step 2), generating speech again and being evaluated by the reward function. This process is repeated (Step 3...) until the model converges to a stable and better-performing state P0. This diagram visually illustrates the closed-loop optimization mechanism of generation-evaluation-update, demonstrating the dynamic process of the model gradually improving itself under the guidance of external rewards and internal capability constraints.
[0126] S53: Input the text data into the updated text-to-speech diffusion model to generate the target speech data.
[0127] In this step, text data is input into a text-to-speech diffusion model fine-tuned through reinforcement learning. Compared to the base model, the optimized model incorporates pronunciation prosody, emotional expression, and rhythm control strategies learned from human preference data during the conversion process, while maintaining the stability of the acoustic structure through internal consistency constraints. For example, when processing financial risk warning text, the model automatically enhances the clarity of numbers and technical terms and imparts an appropriate serious tone to the speech; while in medical guidance text, it adopts a gentler speaking speed and ensures the accuracy of medical terminology pronunciation. The optimized text-to-speech diffusion model transforms the text into a high-quality, highly natural-sounding speech waveform, i.e., the target speech data.
[0128] As can be seen, in the above scheme, the original training loss of the diffusion model is used as an internal regularization penalty term, combined with the external human preference reward to construct a combined optimization objective to optimize the text-to-speech diffusion model. This ensures the stability of the optimization process during reinforcement learning fine-tuning, effectively maintaining the model's inherent high-quality waveform generation capability while pursuing higher human preference scores, thus guaranteeing the stability and reliability of the optimized model. A good balance is achieved between naturalness, stability, computational efficiency, and content accuracy, significantly improving the quality and naturalness of the generated speech while maintaining low latency, making it more in line with human auditory preferences. In financial scenarios, this optimization enhances the naturalness of professional expression while ensuring the absolute accuracy of pronunciation of key figures and risk warnings, maintaining the rigor and credibility of financial information transmission. In medical scenarios, the optimized speech enhances the friendliness and reassuring effect of guidance statements while strictly ensuring the clear pronunciation and unambiguous content of medical terminology, meeting the safety and standardization requirements of medical communication.
[0129] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0130] In one embodiment, a text-to-speech device is provided, which corresponds one-to-one with the text-to-speech methods described in the above embodiments. For example... Figure 7 As shown, the text-to-speech device includes: an acquisition module 101, a first generation module 102, a second generation module 103, a third generation module 104, a model optimization module 105, and a fourth generation module 106. Detailed descriptions of each functional module are as follows:
[0131] Module 101 is used to acquire text data;
[0132] The first generation module 102 is used to perform multi-step denoising on text data based on a pre-trained text-to-speech diffusion model to generate initial speech data.
[0133] The second generation module 103 is used to evaluate the initial speech data based on a preset reward model and generate a reward score;
[0134] The third generation module 104 is used to generate a penalty score based on the original training loss of the pre-trained text-to-speech diffusion model.
[0135] The model optimization module 105 is used to update the parameters of the text-to-speech diffusion model based on the reward score and the penalty score. The fourth generation module 106 is used to convert the text data through the updated text-to-speech diffusion model to generate the target speech data.
[0136] In one embodiment, the device further includes a model training module, specifically used for:
[0137] A text-to-speech diffusion model architecture is constructed, which includes a text encoder and a diffusion denoising probability model.
[0138] Obtain a text-speech dataset as the training dataset, which consists of text sequences and their corresponding real speech waveforms;
[0139] Based on text sequences, speech feature conditions are generated through a text encoder;
[0140] A diffusion time step is randomly sampled from the preset noise schedule;
[0141] Based on the real speech waveform and the sampling diffusion time step, a forward diffusion process is performed to generate a noisy speech waveform and the corresponding real added noise;
[0142] The noisy speech waveform, diffusion time step, and speech feature conditions are input into the diffusion denoising probability model to predict noise and obtain the predicted noise.
[0143] The diffusion training loss is calculated based on the difference between the predicted noise and the actual added noise.
[0144] Based on the diffusion training loss, the parameters of the text encoder and the diffusion denoising probability model are updated using the gradient backpropagation algorithm.
[0145] When the preset convergence condition is met, the iterative training stops, and the pre-trained text-to-speech diffusion model is obtained.
[0146] In one embodiment, the first generation module 102 is specifically used for:
[0147] Text data is input into a pre-trained text-to-speech diffusion model, and the text data is encoded by a text encoder to generate a text conditional vector.
[0148] Construct Gaussian noise that matches the text conditional vector;
[0149] The text conditional vector and Gaussian noise are input into the diffusion denoising probability model. Based on the text conditional vector, a multi-step iterative denoising process is performed on the Gaussian noise to generate the initial speech data corresponding to the text data.
[0150] In one embodiment, the first generation module 102 is further configured to:
[0151] The total number of time steps for denoising iterations is determined based on text conditional vectors;
[0152] Starting from the initial time step of the total number of time steps, for any time step, the Gaussian noise and text conditional vector corresponding to the current time step are input into the diffusion denoising probability model to obtain the prediction noise corresponding to the current step;
[0153] Remove the prediction noise from the Gaussian noise to obtain the Gaussian noise for the next time step;
[0154] The Gaussian noise of the next time step is used as the noise of the current step, and the process continues until the termination condition of the total number of time steps is reached, generating the denoised initial speech data.
[0155] In one embodiment, the second generation module 103 is specifically used for:
[0156] Input the initial speech data and its corresponding text condition vector into the preset reward model;
[0157] The initial speech data is evaluated for naturalness using a pre-set reward model to generate evaluation results. The naturalness evaluation includes at least one of the following: acoustic quality analysis, prosodic naturalness evaluation, semantic conformity judgment, and overall listening experience evaluation.
[0158] Based on the evaluation results, a reward score is generated using a weighted aggregation algorithm.
[0159] In one embodiment, the third generation module 104 is specifically used for:
[0160] Obtain the predicted noise of the pre-trained text-to-speech diffusion model at each time step during the multi-step iterative denoising process;
[0161] The original training loss of the pre-trained text-to-speech diffusion model is calculated based on the predicted noise and the actual added noise at the corresponding time step.
[0162] A penalty score is generated based on the original training loss.
[0163] In one embodiment, the model optimization module 105 is specifically used for:
[0164] Construct a combined reward function based on reward and penalty scores;
[0165] Based on the combined reward function, the parameters of the text-to-speech diffusion model are updated using the policy gradient optimization algorithm to obtain the updated text-to-speech diffusion model.
[0166] In one embodiment, the fourth generation module 106 is specifically used for:
[0167] The text data is input into the updated text-to-speech diffusion model to generate the target speech data.
[0168] This invention provides a text-to-speech device that uses the original training loss of a diffusion model as an internal regularization penalty term, combined with an external human preference reward, to construct a combinatorial optimization objective to optimize the text-to-speech diffusion model. This ensures the stability of the optimization process during reinforcement learning fine-tuning, effectively maintaining the model's inherent high-quality waveform generation capability while pursuing higher human preference scores, thus guaranteeing the stability and reliability of the optimized model. It achieves a good balance between naturalness, stability, computational efficiency, and content accuracy, significantly improving the quality and naturalness of the generated speech while maintaining low latency, making it more in line with human auditory preferences. In financial scenarios, this optimization enhances the naturalness of professional expressions while ensuring the absolute accuracy of pronunciation of key figures and risk warnings, maintaining the rigor and credibility of financial information transmission. In medical scenarios, the optimized speech enhances the friendliness and reassuring effect of guidance statements while strictly ensuring the clear pronunciation and unambiguous content of medical terminology, meeting the safety and standardization requirements of medical communication.
[0169] For specific limitations regarding the text-to-speech device, please refer to the limitations of the text-to-speech method above, which will not be repeated here. Each module in the aforementioned text-to-speech device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the corresponding operations of each module.
[0170] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 8 As shown, the computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile and / or volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used to communicate with external clients via a network connection. When executed by the processor, the computer program implements the functions or steps of a text-to-speech method on the server side.
[0171] In one embodiment, a computer device is provided, which may be a client, and its internal structure diagram may be as follows: Figure 9As shown, the computer device includes a processor, memory, network interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used to communicate with an external server via a network connection. When executed by the processor, the computer program implements the functions or steps of a text-to-speech method on the client side.
[0172] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to perform the following steps:
[0173] Get text data;
[0174] Based on a pre-trained text-to-speech diffusion model, the text data is subjected to multi-step denoising processing to generate initial speech data.
[0175] The initial speech data is evaluated based on a pre-defined reward model to generate a reward score;
[0176] A penalty score is generated based on the original training loss of the pre-trained text-to-speech diffusion model.
[0177] Based on reward and penalty scores, the parameters of the text-to-speech diffusion model are updated, and the updated text-to-speech diffusion model is used to convert the text data to generate the target speech data.
[0178] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:
[0179] Get text data;
[0180] Based on a pre-trained text-to-speech diffusion model, the text data is subjected to multi-step denoising processing to generate initial speech data.
[0181] The initial speech data is evaluated based on a pre-defined reward model to generate a reward score;
[0182] A penalty score is generated based on the original training loss of the pre-trained text-to-speech diffusion model.
[0183] Based on reward and penalty scores, the parameters of the text-to-speech diffusion model are updated, and the updated text-to-speech diffusion model is used to convert the text data to generate the target speech data.
[0184] It should be noted that the functions or steps that can be implemented by the computer-readable storage medium or computer device described above can be referred to the relevant descriptions on the server side and client side in the foregoing method embodiments. To avoid repetition, they will not be described one by one here.
[0185] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0186] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0187] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.
Claims
1. A text-to-speech method, characterized in that, include: Get text data; Based on a pre-trained text-to-speech diffusion model, the text data is subjected to multi-step denoising processing to generate initial speech data. The initial voice data is evaluated based on a preset reward model to generate a reward score; A penalty score is generated based on the original training loss of the pre-trained text-to-speech diffusion model. Based on the reward score and the penalty score, the parameters of the text-to-speech diffusion model are updated, and the text data is converted using the updated text-to-speech diffusion model to generate target speech data; The pre-trained text-to-speech diffusion model performs multi-step denoising on the text data to generate initial speech data, specifically including: The text data is input into the pre-trained text-to-speech diffusion model, and the text data is encoded by a text encoder to generate a text conditional vector. Construct Gaussian noise that matches the text conditional vector; The text conditional vector and the Gaussian noise are input into the diffusion denoising probability model. Based on the text conditional vector, a multi-step iterative denoising process is performed on the Gaussian noise to generate the initial speech data corresponding to the text data. The step of evaluating the initial speech data based on a preset reward model and generating a reward score specifically includes: The initial speech data and its corresponding text condition vector are input into the preset reward model; The initial speech data is evaluated for naturalness using the preset reward model to generate an evaluation result, wherein the naturalness evaluation includes at least one of the following: acoustic quality analysis, prosodic naturalness evaluation, semantic conformity judgment, and overall listening experience evaluation. Based on the evaluation results, the reward score is generated using a weighted aggregation algorithm; The step of generating a penalty score based on the original training loss of the pre-trained text-to-speech diffusion model specifically includes: Obtain the predicted noise of the pre-trained text-to-speech diffusion model at each time step during the multi-step iterative denoising process; The original training loss of the pre-trained text-to-speech diffusion model is calculated based on the predicted noise and the actual added noise at the corresponding time step. A penalty score is generated based on the original training loss.
2. The text-to-speech method according to claim 1, characterized in that, The pre-trained text-to-speech diffusion model performs multi-step denoising on the text data. Before generating the initial speech data, it also includes: A text-to-speech diffusion model architecture is constructed, wherein the text-to-speech diffusion model includes a text encoder and a diffusion denoising probability model; A text-speech dataset is obtained as the training dataset, wherein the text-speech dataset consists of text sequences and their corresponding real speech waveforms; Based on the text sequence, speech feature conditions are generated by the text encoder; A diffusion time step is randomly sampled from the preset noise schedule; Based on the real speech waveform and the sampling diffusion time step, a forward diffusion process is performed to generate a noisy speech waveform and the corresponding real added noise; The noisy speech waveform, diffusion time step, and speech feature conditions are input into the diffusion denoising probability model to predict noise and obtain the predicted noise. The diffusion training loss is calculated based on the difference between the predicted noise and the actual added noise. Based on the aforementioned diffusion training loss, the parameters of the text encoder and the diffusion denoising probability model are updated using the gradient backpropagation algorithm. When the preset convergence condition is met, the iterative training stops, and the pre-trained text-to-speech diffusion model is obtained.
3. The text-to-speech method according to claim 1, characterized in that, The step of inputting the text conditional vector and the Gaussian noise into the diffusion denoising probability model, performing multi-step iterative denoising processing on the Gaussian noise based on the text conditional vector, and generating the initial speech data corresponding to the text data specifically includes: The total number of time steps for the denoising iteration is determined based on the text conditional vector. Starting from the initial time step of the total number of time steps, for any time step, the Gaussian noise and text conditional vector corresponding to the current time step are input into the diffusion denoising probability model to obtain the prediction noise corresponding to the current step; Remove the prediction noise from the Gaussian noise to obtain the Gaussian noise for the next time step; The Gaussian noise of the next time step is used as the noise of the current step, and the process continues until the termination condition of the total number of time steps is reached, generating the denoised initial speech data.
4. The text-to-speech method according to claim 1, characterized in that, The step of updating the parameters of the text-to-speech diffusion model based on the reward score and the penalty score, and then converting the text data using the updated text-to-speech diffusion model to generate target speech data, specifically includes: Based on the reward score and the penalty score, construct a combined reward function; Based on the combined reward function, the parameters of the text-to-speech diffusion model are updated using a policy gradient optimization algorithm to obtain the updated text-to-speech diffusion model. The text data is input into the updated text-to-speech diffusion model to generate the target speech data.
5. A text-to-speech device, characterized in that, include: The acquisition module is used to acquire text data; The first generation module is used to perform multi-step denoising on the text data based on a pre-trained text-to-speech diffusion model to generate initial speech data. The second generation module is used to evaluate the initial voice data based on a preset reward model and generate a reward score; The third generation module is used to generate a penalty score based on the original training loss of the pre-trained text-to-speech diffusion model. The model optimization module is used to update the parameters of the text-to-speech diffusion model based on the reward score and the penalty score. The fourth generation module is used to convert the text data through the updated text-to-speech diffusion model to generate target speech data. The first generation module is specifically used for: Text data is input into a pre-trained text-to-speech diffusion model, and the text data is encoded by a text encoder to generate a text conditional vector. Construct Gaussian noise that matches the text conditional vector; The text conditional vector and Gaussian noise are input into the diffusion denoising probability model. Based on the text conditional vector, a multi-step iterative denoising process is performed on the Gaussian noise to generate the initial speech data corresponding to the text data. The second generation module is specifically used for: Input the initial speech data and its corresponding text condition vector into the preset reward model; The initial speech data is evaluated for naturalness using a pre-set reward model to generate evaluation results. The naturalness evaluation includes at least one of the following: acoustic quality analysis, prosodic naturalness evaluation, semantic conformity judgment, and overall listening experience evaluation. Based on the evaluation results, a reward score is generated using a weighted aggregation algorithm; The third generation module is specifically used for: Obtain the predicted noise of the pre-trained text-to-speech diffusion model at each time step during the multi-step iterative denoising process; The original training loss of the pre-trained text-to-speech diffusion model is calculated based on the predicted noise and the actual added noise at the corresponding time step. A penalty score is generated based on the original training loss.
6. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the text-to-speech method as described in any one of claims 1 to 4.
7. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the text-to-speech method as described in any one of claims 1 to 4.