A training method, device, equipment and medium for a speech synthesis model

Through the encoding and decoding process of the parameter encoder and the speech synthesis model, only one piece of speech corpus can be used to train the speech synthesis model, which solves the problems of training complexity and low efficiency in the existing technology and achieves high-quality speech synthesis.

CN113870827BActive Publication Date: 2024-10-29PING AN TECH (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Existing speech synthesis models require a large amount of speech corpus during the training process, making the training complex and inefficient.

Method used

The training speech information is encoded through the parameter encoder, and the training text information is encoded and decoded with the speech synthesis model. The embedded information and phoneme data are used for decoding to realize the training of the speech synthesis model. Only one speech corpus can be trained. Model.

Benefits of technology

It improves the training efficiency of the speech synthesis model and can generate high-quality, highly natural speech information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113870827B_ABST
    Figure CN113870827B_ABST
Patent Text Reader

Abstract

The present application relates to artificial intelligence technology, and provides a training method, device, equipment and medium for a speech synthesis model. The method includes: obtaining a training sample, the training sample includes training speech information and training text information corresponding to the training speech information, and the content indicated by the training speech information and the training text information is the same; encoding the training speech information through a parameter encoder to obtain embedded information of the training speech information; encoding the training text information through a speech synthesis model to obtain phoneme data of the training text information; decoding the embedded information and the phoneme data through the speech synthesis model to obtain target speech information; training the speech synthesis model according to the training speech information and the target speech information to obtain a trained speech synthesis model, which can improve the training efficiency of the speech synthesis model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] Speech synthesis models are used to achieve speech synthesis. Speech synthesis refers to the technology of generating artificial speech through mechanical and electronic methods. It is a technology that converts text information into understandable and fluent spoken output. However, during the training process of existing speech synthesis models, a large amount of speech corpus is required as training samples, and the playback time of the same speech corpus may be as long as several hours or even dozens of hours, which increases the difficulty of obtaining training samples and makes the training process of speech synthesis models more complicated. Summary of the invention

[0003] The embodiments of the present application provide a method, apparatus, device and medium for training a speech synthesis model, which can train the speech synthesis model using a single speech corpus, and can conveniently implement the training of the speech synthesis model, thereby improving the training efficiency of the speech synthesis model.

[0004] On the one hand, an embodiment of the present application provides a method for training a speech synthesis model, the method comprising:

[0005] Acquire a training sample, where the training sample includes training voice information and training text information corresponding to the training voice information, and the training voice information and the training text information indicate the same content;

[0006] The training speech information is encoded by a parameter encoder to obtain embedded information of the training speech information;

[0007] The training text information is encoded by a speech synthesis model to obtain phoneme data of the training text information;

[0008] The embedded information and phoneme data are decoded and processed by the speech synthesis model to obtain the target speech information;

[0009] The speech synthesis model is trained according to the training speech information and the target speech information to obtain a trained speech synthesis model.

[0010] In one embodiment, the specific implementation process of encoding the training voice information through the parameter encoder to obtain the embedded information of the training voice information is:

[0011] Performing frequency domain conversion on the training speech information to obtain the frequency spectrum characteristics of the training speech information;

[0012] The spectrum features are characterized and learned through parameter encoder to obtain the parameters of normal distribution;

[0013] A normal distribution is constructed based on the parameters of the normal distribution, and the embedded information is sampled from the constructed normal distribution.

[0014] In one embodiment, the specific implementation process of encoding the training text information through the speech synthesis model to obtain the phoneme data of the training text information is as follows:

[0015] Perform word segmentation on the training text information through the speech synthesis model to obtain a text string;

[0016] The text string is converted into a phoneme sequence through the grapheme-to-phoneme (G2P) module in the speech synthesis model;

[0017] The phoneme sequence is subjected to phoneme encoding processing by the phoneme encoder in the speech synthesis model to obtain phoneme data.

[0018] In one embodiment, the specific implementation process of decoding the embedded information and phoneme data through the speech synthesis model to obtain the target speech information is as follows:

[0019] The embedded information and phoneme data are decoded by the context decoder in the speech synthesis model to obtain the speech spectrum;

[0020] The speech spectrum is converted through the vocoder in the speech synthesis model to obtain speech information.

[0021] In one embodiment, the specific implementation process of decoding the embedded information and phoneme data through the context decoder in the speech synthesis model to obtain the speech spectrum is as follows:

[0022] Through the context decoder in the speech synthesis model, the embedded information and phoneme data are context-decoded in an autoregressive mode to obtain the speech spectrum.

[0023] In one embodiment, the following process may also be implemented:

[0024] Obtain the text information to be synthesized;

[0025] The trained speech synthesis model is used to encode the text information to be synthesized to obtain the phoneme data of the text information to be synthesized;

[0026] The trained speech synthesis model is used to decode the phoneme data of the text information to be synthesized to obtain the predicted speech information;

[0027] Output predicted speech information.

[0028] In one embodiment, the specific implementation process of obtaining the text information to be synthesized is:

[0029] When a speech synthesis instruction for the text information to be synthesized is detected, obtaining historical speech information of the user who outputs the text information to be synthesized;

[0030] Analyze and process historical voice information to obtain the user's acoustic characteristics;

[0031] The specific implementation process of decoding the phoneme data of the text information to be synthesized through the trained speech synthesis model to obtain the predicted speech information is as follows:

[0032] The trained speech synthesis model decodes the phoneme data and acoustic features of the text information to be synthesized to obtain the predicted speech information.

[0033] On the other hand, an embodiment of the present application provides a training device for a speech synthesis model, the training device for the speech synthesis model comprising:

[0034] An acquisition unit, used to acquire a training sample, the training sample includes training voice information and training text information corresponding to the training voice information, and the training voice information and the training text information indicate the same content;

[0035] A processing unit, used for encoding the training speech information through a parameter encoder to obtain embedded information of the training speech information;

[0036] The processing unit is further used to encode the training text information through the speech synthesis model to obtain the phoneme data of the training text information;

[0037] The processing unit is further used to decode the embedded information and the phoneme data through the speech synthesis model to obtain the target speech information;

[0038] The processing unit is also used to train the speech synthesis model according to the training speech information and the target speech information to obtain the trained speech synthesis model.

[0039] On the other hand, an embodiment of the present application provides an electronic device, including a processor, a memory and a communication interface, wherein the processor, the memory and the communication interface are interconnected, wherein the memory is used to store a computer program that supports a terminal to execute the above method, the computer program includes program instructions, and the processor is configured to call the program instructions to execute the following steps: obtaining a training sample, the training sample includes training voice information and training text information corresponding to the training voice information, and the content indicated by the training voice information and the training text information is the same; encoding the training voice information through a parameter encoder to obtain embedded information of the training voice information; encoding the training text information through a speech synthesis model to obtain phoneme data of the training text information; decoding the embedded information and the phoneme data through the speech synthesis model to obtain target voice information; training the speech synthesis model according to the training voice information and the target voice information to obtain a trained speech synthesis model.

[0040] On the other hand, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. The computer program includes program instructions, and when the program instructions are executed by a processor, the processor executes the above-mentioned training method of the speech synthesis model.

[0041] In an embodiment of the present application, a training sample is obtained, the training sample includes training voice information and training text information corresponding to the training voice information, and the content indicated by the training voice information and the training text information is the same; the training voice information is encoded by a parameter encoder to obtain embedded information of the training voice information; the training text information is encoded by a speech synthesis model to obtain phoneme data of the training text information; the embedded information and the phoneme data are decoded by the speech synthesis model to obtain target voice information; the speech synthesis model is trained according to the training voice information and the target voice information to obtain a trained speech synthesis model, and the speech synthesis model can be trained using a single speech corpus, which can conveniently implement the training of the speech synthesis model and improve the training efficiency of the speech synthesis model. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0043] Figure 1 It is a flowchart of a method for training a speech synthesis model provided in an embodiment of the present application;

[0044] Figure 2It is a schematic diagram of the architecture of a training system for a speech synthesis model provided in an embodiment of the present application;

[0045] Figure 3 It is a flowchart of a speech synthesis method provided in an embodiment of the present application;

[0046] Figure 4 It is a schematic diagram of the architecture of a speech synthesis system provided in an embodiment of the present application;

[0047] Figure 5 It is a structural schematic diagram of a training device for a speech synthesis model provided in an embodiment of the present application;

[0048] Figure 6 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0049] An embodiment of the present application relates to a speech synthesis model and provides a training method for a speech synthesis model. The training method for the speech synthesis model is based on training speech information and training text information corresponding to the training speech information, so as to realize the training of the speech synthesis model. That is to say, the embodiment of the present application can train the speech synthesis model using only one speech corpus, which can conveniently realize the training of the speech synthesis model and improve the training efficiency of the speech synthesis model.

[0050] The number of training voice information may be one or more, which is not limited by the embodiments of the present application. When the number of training voice information is more than one, different training voice information corresponds to different training text information. The embodiments of the present application may train the speech synthesis model once based on each training voice information and the training text information corresponding to the training voice information, and iteratively train the speech synthesis model through multiple training voice information and multiple training text information to obtain a trained speech synthesis model.

[0051] Each training text message may consist of one or more text strings. For example, assuming that the training text message is "Happy Birthday to you", then the training voice message corresponding to the training text message is the audio data about "Happy Birthday to you" input by a user. Existing speech synthesis models require a large amount of voice information (such as audio data about the same training text message input by different users) during the training process, and the playback time of a voice message may be as long as several hours or even dozens of hours. The present application can train the speech synthesis model based on a single training voice message corresponding to the same training text message. That is to say, the embodiment of the present application can train the speech synthesis model using a voice corpus, and can ensure that the trained speech synthesis model can synthesize high-quality and natural speech information.

[0052] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.

[0053] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0054] See also Figure 1 , Figure 1 is a flow chart of a method for training a speech synthesis model provided in an embodiment of the present application; Figure 1 The training method of the speech synthesis model shown can be performed by a first electronic device, and the scheme includes but is not limited to steps S101 to S105, wherein:

[0055] S101, obtaining a training sample, where the training sample includes training voice information and training text information corresponding to the training voice information, and the training voice information and the training text information indicate the same content.

[0056] The first electronic device can obtain a training sample, and the training voice information in the training sample can be a single training voice information, that is, audio data input by a user. For example, if a user inputs audio data about "Happy Birthday to you", the first electronic device can use the audio data as training voice information, and the training text information corresponding to the training voice information can be "Happy Birthday to you".

[0057] It is understandable that the training sample can be input by the user to the first electronic device, for example, the first electronic device collects training voice information through a microphone, and collects training text information corresponding to the training voice information through the input device of the first electronic device (such as a touch panel or keyboard, etc.). Optionally, the training sample can also be obtained by the first electronic device from a local memory, or obtained by the first electronic device from other devices, or downloaded by the first electronic device through the Internet, which is not limited by the embodiments of the present application.

[0058] Among them, the first electronic device can be any one or more of a smart phone, a tablet computer, a laptop computer, a desktop computer, an intelligent vehicle-mounted device, and an intelligent wearable device. Optionally, the first electronic device can also be a server, which can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. In other words, the server can be an independent server, or it can be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.

[0059] S102, encoding the training speech information through a parameter encoder to obtain embedded information of the training speech information.

[0060] In one embodiment, the first electronic device can perform frequency domain conversion on the training voice information to obtain the spectral features of the training voice information, characterize and learn the spectral features through a parameter encoder to obtain the parameters of a normal distribution, i.e., the mean and variance, and then construct a normal distribution based on the parameters of the normal distribution, and sample from the constructed normal distribution to obtain embedded information (embedding). The embodiment of the present application characterizes and learns the spectral features through a parameter encoder to obtain the parameters of a normal distribution, i.e., the mean and variance, and then constructs a normal distribution based on the parameters of the normal distribution, and samples from the constructed normal distribution to obtain embedded information, thereby improving the generalization ability of speech synthesis.

[0061] by Figure 2 Taking the architectural diagram of the training system of the speech synthesis model shown as an example, the first electronic device can perform frequency domain conversion on the training speech information to obtain the spectral features of the training speech information, input the spectral features into a parameter encoder, characterize and learn the spectral features through the parameter encoder to obtain the parameters of the normal distribution, namely the mean and variance, and then construct a normal distribution based on the parameters of the normal distribution, and sample from the constructed normal distribution to obtain embedded information.

[0062] Among them, the parameter encoder can be a variational auto-encoder (VAE). The VAE encoder is a neural network whose input is the data point x (i.e., the spectral features of the target speech information) and whose output is the latent vector z. The parameter of the VAE encoder is θ, so the VAE encoder can be expressed as qθ(z|x). To be more specific, assume that x is a 784-dimensional black and white image vector. The VAE encoder needs to encode the 728-dimensional data x into the latent space z, and the dimension of the latent space z is much smaller than 784, which requires the VAE encoder to learn a method to effectively compress the data into this low-dimensional space. In addition, we assume that z is normally distributed. The process of the encoder outputting z can actually be decomposed into two steps: 1) First, the VAE encoder outputs the parameters (mean, variance) of the normal distribution, and the parameters of the normal distribution are different for each data point; 2) The noise is fused with the normal distribution and sampled from it to obtain the output (i.e., embedded information).

[0063] Among them, embedding is a way to convert discrete variables into continuous vector representation. In neural networks, embedding is very useful because it can not only reduce the spatial dimension of discrete variables, but also represent the variable meaningfully. In other words, embedding can convert large sparse vectors into a low-dimensional space that retains semantic relationships.

[0064] S103, encoding the training text information through a speech synthesis model to obtain phoneme data of the training text information.

[0065] The speech synthesis model in the embodiment of the present application may include a G2P module and a phoneme encoder.

[0066] In one embodiment, the first electronic device may perform word segmentation processing on the training text information to obtain a text string, and then convert the text string into a phoneme sequence through a G2P module, and perform phoneme encoding processing on the phoneme sequence through a phoneme encoder to obtain encoded phoneme data.

[0067] by Figure 2 Taking the architectural diagram of the training system of the speech synthesis model shown as an example, the first electronic device can perform word segmentation on the training text information to obtain a text string, input the text string into the G2P module, and then convert the text string into a phoneme sequence through the G2P module, and perform phoneme encoding on the phoneme sequence through a phoneme encoder to obtain encoded phoneme data.

[0068] Among them, phoneme is the smallest unit of speech divided according to the natural properties of speech. From the perspective of acoustic properties, phoneme is the smallest unit of speech divided from the perspective of sound quality. From the perspective of physiological properties, one pronunciation action forms a phoneme. For example, "ma" contains two pronunciation actions, "m" and "a", which are two phonemes. The sound produced by the same pronunciation action is the same phoneme, and the sounds produced by different pronunciation actions are different phonemes. For example, in "ma-mi", the two "m" have the same pronunciation action, which is the same phoneme, and the pronunciation actions of "a" and "i" are different, which are different phonemes. The analysis of phonemes is generally described based on pronunciation actions. For example, the pronunciation action of "m" is: the upper lip and lower lip are closed, the vocal cords vibrate, and the airflow flows out of the nasal cavity to pronounce.

[0069] The G2P module uses a recurrent neural network (RNN) and long short-term memory units (LSTM) to achieve the conversion from English words to phonemes. The phoneme encoder can encode the phoneme sequence according to the base-period parameter, amplitude parameter and spectrum parameter to obtain the encoded phoneme data. Specifically, the base-period parameter, amplitude parameter and spectrum parameter can be smoothed by interpolation to obtain the encoded phoneme data.

[0070] For the fundamental frequency parameter and amplitude parameter, the parameter value can be calculated step by step with one audio frame (for example, one audio frame = 180 sampling points, 8kHz sampling rate). The spectrum parameter is calculated by linear predictive coding (LPC), and the calculation formula is:

[0071] A n / (1+a1Z-1+a2Z -2 …+a 10 Z -10 )

[0072] A n is the amplitude parameter, Z and a1…a 10 is the LPC parameter.

[0073] S104, decoding the embedded information and phoneme data through a speech synthesis model to obtain target speech information.

[0074] In a specific implementation, the speech synthesis model may further include a context decoder and a vocoder. The first electronic device may decode the embedded information and the encoded phoneme data through the context decoder, generate a speech spectrum in a sequence-to-sequence manner, and then convert the generated speech spectrum into a speech waveform through the vocoder to obtain the target speech information.

[0075] Exemplarily, the vocoder in the embodiment of the present application can be a Griffin-Lim vocoder or a MelGan vocoder, etc. Among them, the Griffin-Lim vocoder is an algorithm for reconstructing speech when only the amplitude spectrum is known and the phase spectrum is unknown. It is an iterative algorithm, and the iterative process is as follows: first randomly initialize a phase spectrum; synthesize new speech by using the phase spectrum and the known amplitude spectrum through an inverse short-time Fourier transform (ISTFT); perform a short-time Fourier transform (STFT) on the synthesized speech to obtain a new amplitude spectrum and phase spectrum; discard the new amplitude spectrum, and synthesize speech with the phase spectrum and the known amplitude spectrum, and repeat. The MelGAN vocoder can quickly generate audio based on Generative Adversarial Networks (GAN). MelGAN is a non-autoregressive feedforward convolutional architecture. GAN is used to realize the generation of original audio, and high-quality speech information can still be generated without the introduction of additional distillation and perceptual loss.

[0076] In one embodiment, the first electronic device can input the embedded information and the encoded phoneme data into the attention module, weight the embedded information and the encoded phoneme data through the attention weight to obtain the encoded information, and then decode the encoded information through the context decoder to obtain the speech spectrum.

[0077] Exemplarily, the attention module may include SENet (Squeeze-and-Excitation Networks) or CBAM (Convolutional Block Attention Module). The principle of SENet is to automatically obtain the importance of each feature channel through learning, and then enhance the useful features and suppress the features that are not very useful for the current task according to this importance. CBAM contains two independent sub-modules, the Channel Attention Module (CAM) and the Spatial Attention Module (Spartial Attention Module, SAM), which perform channel and spatial attention respectively. This not only saves parameters and computing power, but also ensures that it can be integrated into the existing network architecture as a plug-and-play module.

[0078] by Figure 2Taking the architecture diagram of the training system of the speech synthesis model shown in FIG. 1 as an example, the first electronic device can input the embedded information and the encoded phoneme data into the attention module, and weight the embedded information and the encoded phoneme data through the attention weight to obtain the encoded information. Then the first electronic device can input the encoded information into the context decoder, and decode the encoded information through the context decoder to obtain the speech spectrum. Furthermore, the first electronic device can input the speech spectrum into the vocoder, and convert the generated speech spectrum into a speech waveform through the vocoder to obtain the target speech information.

[0079] In one embodiment, the first electronic device may perform context decoding on the embedded information and the phoneme data using an autoregressive mode through a context decoder in the speech synthesis model to obtain a speech spectrum.

[0080] In a specific implementation, the context decoder may include an autoregressive module. An autoregressive model (AR) is a statistical method for processing time series, which uses the previous periods of the same variable, such as x, i.e., x1 to x t-1 To predict this period x t That is, the autoregressive module can predict the next possible word according to the previous content, thereby obtaining the speech spectrum. In this application, the context decoding is performed in an autoregressive manner, which can ensure that the synthesized speech frames are smoother and the synthesized content is more natural.

[0081] In one embodiment, the context decoder may include a bidirectional encoder representation module based on a transformer (Bidirectional Encoder Representations from Transformers, BERT). The essence of BERT is to learn a good feature representation for a word by running a self-supervised learning method based on a corpus. The so-called self-supervised learning refers to supervised learning running on data without manual annotation.

[0082] S105, training the speech synthesis model according to the training speech information and the target speech information to obtain a trained speech synthesis model.

[0083] In a specific implementation, the first electronic device can compare the training voice information with the target voice information in the training sample to obtain a loss value of the speech synthesis model, and then train the speech synthesis model based on the loss value to obtain a trained speech synthesis model.

[0084] Through the embodiments of the present application, a single corpus can be used to train a speech synthesis model, and it is ensured that the trained speech synthesis model can generate high-quality and naturally expressed speech information.

[0085] In an embodiment of the present application, a training sample is obtained, the training sample includes training voice information and training text information corresponding to the training voice information, and the content indicated by the training voice information and the training text information is the same; the training voice information is encoded by a parameter encoder to obtain embedded information of the training voice information; the training text information is encoded by a speech synthesis model to obtain phoneme data of the training text information; the embedded information and the phoneme data are decoded by the speech synthesis model to obtain target voice information; the speech synthesis model is trained according to the training voice information and the target voice information to obtain a trained speech synthesis model, and the speech synthesis model can be trained using a single speech corpus, which can conveniently implement the training of the speech synthesis model and improve the training efficiency of the speech synthesis model.

[0086] See also Figure 3 , Figure 3 is a flow chart of a speech synthesis method provided by an embodiment of the present application; the speech synthesis method may be executed by a second electronic device, and the scheme may include but is not limited to steps S301 to S304, wherein:

[0087] S301, obtaining text information to be synthesized.

[0088] For example, the second electronic device runs a reading client, and the reading client provides a listening function. If the user submits a listening instruction for a certain text information (such as a novel or poem, etc.), the first electronic device can obtain the text information after detecting the listening instruction, wherein the text information is the text information to be synthesized. For another example, in a scene where the user is driving or in a bumpy environment and it is inconvenient to browse the device, a conversation interface in the instant messaging client includes at least one text information. If the user needs to convert a certain text information into voice, the user can submit a voice conversion instruction for the text information, and the second electronic device can obtain the text information after detecting the voice conversion instruction, wherein the text information is the text information to be synthesized. For another example, when the user interacts with the intelligent customer service client in the second electronic device, if the user submits interactive information to the intelligent customer service client through the second electronic device (the type of interactive information can be text or voice), the intelligent customer service client can determine the text information to be output to the user based on the interactive information, wherein the text information is the text information to be synthesized. For another example, during the electronic navigation process of the second electronic device, the second electronic device can obtain navigation information (such as indicating to go straight ahead, turn left or turn right, etc.), wherein the navigation information is the information to be synthesized. For another example, during the process of intelligent diagnosis and treatment or remote consultation, if the patient is unable to browse the device due to physical reasons (for example, the patient cannot move his body and there is a certain distance between the second electronic device and the patient), then the text information input by the peer user, where the text information is the text information to be synthesized, for example, taking intelligent diagnosis and treatment as an example, the peer user may refer to an intelligent diagnosis and treatment assistant; taking remote consultation as an example, the peer user may refer to a doctor, which is not limited by the embodiments of the present application.

[0089] The second electronic device may be any one or more of a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart vehicle-mounted device, and a smart wearable device. Exemplarily, the second electronic device may be a device running a reading client, an instant messaging client, or an intelligent customer service client. The second electronic device and the first electronic device may be the same device or different devices, which is not limited by the embodiments of the present application.

[0090] S302, encoding the text information to be synthesized through the trained speech synthesis model to obtain phoneme data of the text information to be synthesized.

[0091] The trained speech synthesis model may include a G2P module and a phoneme encoder.

[0092] In a specific implementation, when the second electronic device needs to perform speech synthesis on the text information to be synthesized, the text information to be synthesized can be input into the trained speech synthesis model, and the trained speech synthesis model can perform word segmentation processing on the text information to be synthesized to obtain a text string, and then convert the text string into a phoneme sequence through the G2P module, and perform phoneme encoding processing on the phoneme sequence through the phoneme encoder to obtain encoded phoneme data. The context decoder decodes the embedded information and the encoded phoneme data, generates a speech spectrum in a sequence-to-sequence manner, and then converts the generated speech spectrum into a speech waveform through the vocoder to obtain predicted speech information, and then outputs the predicted speech information.

[0093] by Figure 4 Taking the schematic diagram of the speech synthesis system shown in FIG. 1 as an example, the second electronic device can perform word segmentation processing on the text information to be synthesized to obtain a text string, and input the text string into the G2P module. Then, the G2P module converts the text string into a phoneme sequence, and inputs the phoneme sequence into a phoneme encoder. The phoneme encoder performs phoneme encoding processing on the phoneme sequence to obtain encoded phoneme data.

[0094] It should be noted that the implementation logic and Figure 1 The implementation logic of encoding the training text information in the embodiment shown is similar. The specific implementation process of step S302 can be found in Figure 1 The relevant description of the specific implementation process shown in step S103 in the illustrated embodiment is not repeated here.

[0095] S303, decoding the phoneme data of the text information to be synthesized through the trained speech synthesis model to obtain predicted speech information.

[0096] The trained speech synthesis model may also include a context decoder and a vocoder.

[0097] In a specific implementation, the second electronic device decodes the preset embedded information and the encoded phoneme data through a context decoder, generates a speech spectrum in a sequence-to-sequence manner, and then converts the generated speech spectrum into a speech waveform through a vocoder to obtain predicted speech information, and then outputs the predicted speech information.

[0098] by Figure 4 Taking the schematic diagram of the speech synthesis system shown in FIG. 1 as an example, after the second electronic device obtains the encoded phoneme data, it can input the phoneme data into a context decoder, and decode the preset embedded information and the encoded phoneme data through the context decoder to obtain a speech spectrum. The second electronic device inputs the speech spectrum into a vocoder, and then the vocoder converts the speech spectrum into a speech waveform to obtain predicted speech information.

[0099] The preset embedding information is pre-set embedding information. For example, the voice information of a specific user is converted into the frequency domain to obtain the spectral features of the voice information, the spectral features are characterized and learned by a parameter encoder to obtain the parameters of a normal distribution, and then a normal distribution is constructed based on the parameters of the normal distribution, and the preset embedding information is sampled from the constructed normal distribution. Based on this, the trained speech synthesis model decodes the above-mentioned preset embedding information and the phoneme data of the text information to be synthesized for any text information to be synthesized to obtain the predicted voice information. For another example, the voice information of each user among multiple users is converted into the frequency domain to obtain the spectral features of the voice information, the spectral features are characterized and learned by a parameter encoder to obtain the parameters of a normal distribution, and then a normal distribution is constructed based on the parameters of the normal distribution, and the embedding information of each user is sampled from the constructed normal distribution. Based on this, if the user of the second device wants to use the voice of a target user (for example, Andy Lau) among multiple users, then the user of the second electronic device can select the embedded information of the target user through the second electronic device, and the second electronic device uses the embedded information selected by the user of the second electronic device as the preset embedded information, decodes the preset embedded information and the phoneme data of the text information to be synthesized, and obtains predicted voice information, which can ensure that the predicted voice information is highly matched with the audio data input by the target user for the text information to be synthesized, thereby ensuring that the predicted voice information meets the user's wishes, thereby improving user stickiness.

[0100] It should be noted that the implementation logic and Figure 1 The implementation logic of decoding the phoneme data of the training text information in the embodiment shown is similar. The specific implementation process of step S303 can be found in Figure 1 The relevant description of the specific implementation process shown in step S104 in the illustrated embodiment is not repeated here.

[0101] S304: output predicted speech information.

[0102] In a specific implementation, after the second electronic device obtains the predicted voice information, it can display the voice information. After the user performs a play operation on the voice information (for example, single-clicking or long pressing the voice information, etc.), the second electronic device can generate a play instruction in response to the play operation and play the predicted voice information. Alternatively, after the second electronic device obtains the predicted voice information, it can directly play the predicted voice information. By directly playing the predicted voice information, the embodiment of the present application can facilitate the user to know the specific content of the text information to be synthesized without browsing the second electronic device.

[0103] In one embodiment, when the second electronic device detects a speech synthesis instruction for the text information to be synthesized, it can obtain historical voice information of the user who outputs the text information to be synthesized, analyze and process the historical voice information to obtain the user's acoustic characteristics, and decode and process the phoneme data and acoustic characteristics of the text information to be synthesized through a trained speech synthesis model to obtain predicted voice information.

[0104] In an embodiment of the present application, after detecting a speech conversion instruction for the text information to be synthesized, the second electronic device can analyze the historical speech information of the user who outputs the text information to be synthesized, obtain parameters such as the user's timbre, and perform speech synthesis on the text information to be synthesized based on the determined timbre and other parameters, so that the predicted speech information after speech synthesis is closer to the pronunciation of the user.

[0105] In one embodiment, after detecting the voice conversion instruction for the text information to be synthesized, the second electronic device can perform emotion analysis on the text information to be synthesized to obtain parameters such as tone for characterizing the emotion, and perform speech synthesis on the text information to be synthesized based on the determined parameters such as tone, which can reduce the mechanical feeling of the predicted speech information after speech synthesis and make the predicted speech information after speech synthesis more natural.

[0106] In an embodiment of the present application, text information to be synthesized is obtained, the text information to be synthesized is encoded by a trained speech synthesis model to obtain phoneme data of the text information to be synthesized, the phoneme data of the text information to be synthesized is decoded by the trained speech synthesis model to obtain predicted speech information, and the predicted speech information is output, which can ensure the high quality and naturalness of the predicted speech information.

[0107] An embodiment of the present application further provides a computer storage medium, in which program instructions are stored. When the program instructions are executed, they are used to implement the corresponding methods described in the above embodiments.

[0108] See also Figure 5 , Figure 5 It is a structural schematic diagram of a training device for a speech synthesis model provided in an embodiment of the present application.

[0109] In one implementation of the device of the embodiment of the present application, the device includes the following structure.

[0110] An acquiring unit 501 is used to acquire a training sample, wherein the training sample includes training voice information and training text information corresponding to the training voice information, and the training voice information and the training text information indicate the same content;

[0111] A processing unit 502 is used to encode the training voice information through a parameter encoder to obtain embedded information of the training voice information;

[0112] The processing unit 502 is further configured to encode the training text information through a speech synthesis model to obtain phoneme data of the training text information;

[0113] The processing unit 502 is further configured to decode the embedded information and the phoneme data through the speech synthesis model to obtain target speech information;

[0114] The processing unit 502 is further used to train the speech synthesis model according to the training speech information and the target speech information to obtain a trained speech synthesis model.

[0115] In one embodiment, the processing unit 502 encodes the training voice information through a parameter encoder to obtain embedded information of the training voice information, including:

[0116] Performing frequency domain conversion on the training voice information to obtain frequency spectrum features of the training voice information;

[0117] The spectral features are characterized and learned by the parameter encoder to obtain parameters of a normal distribution;

[0118] A normal distribution is constructed based on the parameters of the normal distribution, and the embedded information is obtained by sampling from the constructed normal distribution.

[0119] In one embodiment, the processing unit 502 encodes the training text information through a speech synthesis model to obtain phoneme data of the training text information, including:

[0120] Perform word segmentation processing on the training text information through the speech synthesis model to obtain a text string;

[0121] The text string is converted into a phoneme sequence by a G2P module in the speech synthesis model;

[0122] The phoneme sequence is subjected to phoneme encoding processing by a phoneme encoder in the speech synthesis model to obtain the phoneme data.

[0123] In one embodiment, the processing unit 502 decodes the embedded information and the phoneme data through the speech synthesis model to obtain the target speech information, including:

[0124] Decoding the embedded information and the phoneme data through a context decoder in the speech synthesis model to obtain a speech spectrum;

[0125] The speech spectrum is converted by the vocoder in the speech synthesis model to obtain the target speech information.

[0126] In one embodiment, the processing unit 502 decodes the embedded information and the phoneme data through a context decoder in the speech synthesis model to obtain a speech spectrum, including:

[0127] The context decoder in the speech synthesis model uses an autoregressive mode to perform context decoding on the embedded information and the phoneme data to obtain the speech spectrum.

[0128] In one embodiment, the acquisition unit 501 is further used to acquire the text information to be synthesized;

[0129] The processing unit 502 is further configured to encode the text information to be synthesized by using the trained speech synthesis model to obtain phoneme data of the text information to be synthesized;

[0130] The processing unit 502 is further configured to decode the phoneme data of the text information to be synthesized by using the trained speech synthesis model to obtain predicted speech information;

[0131] The device may further include an output unit 503;

[0132] The output unit 503 is used to output the predicted speech information.

[0133] In one embodiment, the acquiring unit 501 acquires the text information to be synthesized, including:

[0134] When a speech synthesis instruction for the text information to be synthesized is detected, acquiring historical speech information of a user who outputs the text information to be synthesized;

[0135] Analyzing and processing the historical voice information to obtain the acoustic features of the user;

[0136] The processing unit 502 decodes the phoneme data of the text information to be synthesized through the trained speech synthesis model to obtain predicted speech information, including:

[0137] The trained speech synthesis model is used to decode the phoneme data of the text information to be synthesized and the acoustic features to obtain the predicted speech information.

[0138] In an embodiment of the present application, a training sample is obtained, the training sample includes training voice information and training text information corresponding to the training voice information, and the content indicated by the training voice information and the training text information is the same; the training voice information is encoded by a parameter encoder to obtain embedded information of the training voice information; the training text information is encoded by a speech synthesis model to obtain phoneme data of the training text information; the embedded information and the phoneme data are decoded by the speech synthesis model to obtain target voice information; the speech synthesis model is trained according to the training voice information and the target voice information to obtain a trained speech synthesis model, and the speech synthesis model can be trained using a single speech corpus, which can conveniently implement the training of the speech synthesis model and improve the training efficiency of the speech synthesis model.

[0139] See also Figure 6 , Figure 6 6 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device in the embodiment of the present application includes a power supply module and other structures, and includes a processor 601, a memory 602, and a communication interface 603. The processor 601, the memory 602, and the communication interface 603 can exchange data, and the processor 601 implements the corresponding data processing solution.

[0140] The memory 602 may include a volatile memory, such as a random-access memory (RAM); the memory 602 may also include a non-volatile memory, such as a flash memory, a solid-state drive (SSD), etc.; the memory 602 may also include a combination of the above-mentioned types of memory.

[0141] The processor 601 may be a central processing unit (CPU) 601. The processor 601 may also be a combination of a CPU and a GPU. In an electronic device, multiple CPUs and GPUs may be included as needed to perform corresponding data processing. In one embodiment, the memory 602 is used to store program instructions. The processor 601 may call program instructions to implement various methods involved in the embodiments of the present application.

[0142] In a first possible implementation, the processor 601 of the electronic device calls the program instructions stored in the memory 602 to perform the following operations:

[0143] Acquire a training sample, wherein the training sample includes training voice information and training text information corresponding to the training voice information, and the training voice information and the training text information indicate the same content;

[0144] Encoding the training speech information through a parameter encoder to obtain embedded information of the training speech information;

[0145] Encoding the training text information through a speech synthesis model to obtain phoneme data of the training text information;

[0146] Decoding the embedded information and the phoneme data through the speech synthesis model to obtain target speech information;

[0147] The speech synthesis model is trained according to the training speech information and the target speech information to obtain a trained speech synthesis model.

[0148] In one embodiment, when the processor 601 encodes the training voice information through the parameter encoder to obtain the embedded information of the training voice information, the processor 601 specifically performs the following operations:

[0149] Performing frequency domain conversion on the training voice information to obtain frequency spectrum features of the training voice information;

[0150] The spectral features are characterized and learned by the parameter encoder to obtain parameters of a normal distribution;

[0151] A normal distribution is constructed based on the parameters of the normal distribution, and the embedded information is obtained by sampling from the constructed normal distribution.

[0152] In one embodiment, when the processor 601 encodes the training text information through the speech synthesis model to obtain the phoneme data of the training text information, the processor 601 specifically performs the following operations:

[0153] Perform word segmentation processing on the training text information through the speech synthesis model to obtain a text string;

[0154] The text string is converted into a phoneme sequence by a G2P module in the speech synthesis model;

[0155] The phoneme sequence is subjected to phoneme encoding processing by a phoneme encoder in the speech synthesis model to obtain the phoneme data.

[0156] In one embodiment, when the processor 601 decodes the embedded information and the phoneme data through the speech synthesis model to obtain the target speech information, the processor 601 specifically performs the following operations:

[0157] Decoding the embedded information and the phoneme data through a context decoder in the speech synthesis model to obtain a speech spectrum;

[0158] The speech spectrum is converted by the vocoder in the speech synthesis model to obtain the target speech information.

[0159] In one embodiment, when the processor 601 decodes the embedded information and the phoneme data through the context decoder in the speech synthesis model to obtain the speech spectrum, the processor 601 specifically performs the following operations:

[0160] The context decoder in the speech synthesis model uses an autoregressive mode to perform context decoding on the embedded information and the phoneme data to obtain the speech spectrum.

[0161] In one embodiment, the processor 601 calls the program instructions stored in the memory 602 and is further configured to perform the following operations:

[0162] Obtain the text information to be synthesized;

[0163] Encoding the text information to be synthesized by using the trained speech synthesis model to obtain phoneme data of the text information to be synthesized;

[0164] Decoding the phoneme data of the text information to be synthesized by using the trained speech synthesis model to obtain predicted speech information;

[0165] The communication interface 603 calls the program instructions stored in the memory 602 to output the predicted voice information.

[0166] In one embodiment, when the processor 601 obtains the text information to be synthesized, it specifically performs the following operations:

[0167] When a speech synthesis instruction for the text information to be synthesized is detected, acquiring historical speech information of a user who outputs the text information to be synthesized;

[0168] Analyzing and processing the historical voice information to obtain the acoustic features of the user;

[0169] When the processor 601 decodes the phoneme data of the text information to be synthesized through the trained speech synthesis model to obtain predicted speech information, the processor 601 specifically performs the following operations:

[0170] The trained speech synthesis model is used to decode the phoneme data of the text information to be synthesized and the acoustic features to obtain the predicted speech information.

[0171] In an embodiment of the present application, a training sample is obtained, the training sample includes training voice information and training text information corresponding to the training voice information, and the content indicated by the training voice information and the training text information is the same; the training voice information is encoded by a parameter encoder to obtain embedded information of the training voice information; the training text information is encoded by a speech synthesis model to obtain phoneme data of the training text information; the embedded information and the phoneme data are decoded by the speech synthesis model to obtain target voice information; the speech synthesis model is trained according to the training voice information and the target voice information to obtain a trained speech synthesis model, and the speech synthesis model can be trained using a single speech corpus, which can conveniently implement the training of the speech synthesis model and improve the training efficiency of the speech synthesis model.

[0172] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM). The computer-readable storage medium can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application required for a function, etc.; the data storage area can store data created according to the use of blockchain nodes, etc.

[0173] Among them, the blockchain referred to in this application is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.

[0174] The above disclosure is only part of the embodiments of the present application, which certainly cannot be used to limit the scope of rights of the present application. Ordinary technicians in this field can understand that all or part of the processes of implementing the above embodiments and making equivalent changes according to the claims of this application are still within the scope of the invention.

Claims

1. A method for training a speech synthesis model, characterized in that: include: Acquire a training sample, wherein the training sample includes training voice information and training text information corresponding to the training voice information, and the training voice information and the training text information indicate the same content; Performing frequency domain conversion on the training voice information to obtain frequency spectrum features of the training voice information; The spectrum features are characterized and learned by a parameter encoder to obtain parameters of a normal distribution; Constructing a normal distribution based on the parameters of the normal distribution, and sampling from the constructed normal distribution to obtain the embedded information of the training speech information; Perform word segmentation processing on the training text information through the speech synthesis model to obtain a text string; The text string is converted into a phoneme sequence by a word-to-phoneme G2P module in the speech synthesis model; Performing phoneme encoding processing on the phoneme sequence through the phoneme encoder in the speech synthesis model to obtain phoneme data of the training text information; Decoding the embedded information and the phoneme data through a context decoder in the speech synthesis model to obtain a speech spectrum; The speech spectrum is converted by a vocoder in the speech synthesis model to obtain target speech information; Training the speech synthesis model according to the training speech information and the target speech information to obtain a trained speech synthesis model; Obtain the text information to be synthesized; Encoding the text information to be synthesized by using the trained speech synthesis model to obtain phoneme data of the text information to be synthesized; Decoding the phoneme data of the text information to be synthesized by using the trained speech synthesis model to obtain predicted speech information; The predicted voice information is outputted.

2. The method according to claim 1, characterized in that The method of decoding the embedded information and the phoneme data by a context decoder in the speech synthesis model to obtain a speech spectrum includes: The context decoder in the speech synthesis model uses an autoregressive mode to perform context decoding on the embedded information and the phoneme data to obtain the speech spectrum.

3. The method according to claim 1, characterized in that The step of obtaining the text information to be synthesized includes: When a speech synthesis instruction for the text information to be synthesized is detected, acquiring historical speech information of a user who outputs the text information to be synthesized; Analyzing and processing the historical voice information to obtain the acoustic features of the user; The decoding process of the phoneme data of the text information to be synthesized by the trained speech synthesis model to obtain predicted speech information includes: The trained speech synthesis model is used to decode the phoneme data of the text information to be synthesized and the acoustic features to obtain the predicted speech information.

4. A training device for a speech synthesis model, characterized in that: The device comprises: An acquiring unit, configured to acquire a training sample, wherein the training sample includes training voice information and training text information corresponding to the training voice information, wherein the training voice information and the training text information indicate the same content; A processing unit, configured to perform frequency domain conversion on the training voice information to obtain frequency spectrum features of the training voice information; perform characterization learning on the frequency spectrum features through a parameter encoder to obtain parameters of a normal distribution; construct a normal distribution based on the parameters of the normal distribution, and sample from the constructed normal distribution to obtain embedded information of the training voice information; The processing unit is further configured to perform word segmentation processing on the training text information through the speech synthesis model to obtain a text string; convert the text string to obtain a phoneme sequence through a word-to-phoneme G2P module in the speech synthesis model; and perform phoneme encoding processing on the phoneme sequence through a phoneme encoder in the speech synthesis model to obtain phoneme data of the training text information; The processing unit is further used to decode the embedded information and the phoneme data through the context decoder in the speech synthesis model to obtain a speech spectrum; and convert the speech spectrum through the vocoder in the speech synthesis model to obtain target speech information; The processing unit is further used to train the speech synthesis model according to the training speech information and the target speech information to obtain a trained speech synthesis model; The acquisition unit is further used to acquire the text information to be synthesized; The processing unit is further used to encode the text information to be synthesized through the trained speech synthesis model to obtain phoneme data of the text information to be synthesized; and decode the phoneme data of the text information to be synthesized through the trained speech synthesis model to obtain predicted speech information; An output unit is used to output the predicted speech information.

5. An electronic device, characterized in that: It includes a processor, a memory and a communication interface, wherein the processor, the memory and the communication interface are interconnected, wherein the memory is used to store computer program instructions, and the processor is configured to execute the program instructions to implement the training method of the speech synthesis model as described in any one of claims 1-3.

6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, which, when executed by a processor, are used to execute the training method for a speech synthesis model as described in any one of claims 1-3.

Citation Information

Patent Citations

  • Speech synthesis model training method and device, computer equipment and storage medium

    CN111133506A

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

    CN112786006A