Speech synthesis method, device, electronic device and storage medium
By utilizing speech synthesis methods in multiple parallel languages and auxiliary languages, the problem of low resource language speech synthesis model training difficulty and low naturalness is solved, and the stability and naturalness of the speech synthesis model are improved, making it suitable for industrial applications.
Patent Information
- Application Number
- CN202111486785.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-07
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2041-12-07
Smart Images

Figure CN114170996B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of natural language processing, and in particular to a speech synthesis method, device, electronic device and storage medium. Background Art
[0002] With the continuous expansion of artificial intelligence business, the demand for speech synthesis in low-resource languages (i.e. languages with scarce corpus resources) is becoming increasingly urgent. However, the speech data of low-resource languages is extremely limited and the cost of collecting them is much higher than that of high-resource languages (i.e. languages with abundant corpus resources), which brings great difficulties to speech synthesis in low-resource languages.
[0003] At present, a low-resource end-to-end speech synthesis method is usually used to achieve speech synthesis for low-resource languages. This speech synthesis method utilizes the duality between speech synthesis and speech recognition. Through a small amount of text-speech parallel corpus, the speech synthesis model synthesizes speech for the speech recognition model, and the speech recognition model generates text for the speech synthesis model. The two are iteratively trained together to finally complete the training process of the two models.
[0004] Although the above method can construct a speech synthesis model using fewer corpus resources and reduce the difficulty of model construction, it increases the pronunciation error rate of the synthesized speech, making it difficult to correct errors in industrial applications. In addition, since the speech synthesis model and speech recognition model are difficult to train, this will result in low naturalness and recognition rate of the final synthesized speech. Summary of the invention
[0005] The present invention provides a speech synthesis method, device, electronic equipment and storage medium to solve the defects in the prior art.
[0006] The present invention provides a speech synthesis method, comprising:
[0007] Obtain the text to be synthesized in the target language;
[0008] Inputting the text to be synthesized into a target speech synthesis model to obtain speech data of the text to be synthesized output by the target speech synthesis model;
[0009] The target speech synthesis model is trained based on a first text sample carrying a speech tag, a second text sample, and a third text sample carrying a phoneme sequence label; the first text sample is a text sample of multiple parallel languages, the second text sample is a text sample of the target language, and the third text sample is a text sample of an auxiliary language;
[0010] The auxiliary language is a language in the same language family as the target language, and the corpus resources of the auxiliary language are more than the corpus resources of the target language. The second text sample and the third text sample share a unified phoneme system.
[0011] According to a speech synthesis method provided by the present invention, the step of inputting the text to be synthesized into a target speech synthesis model to obtain speech data of the text to be synthesized output by the target speech synthesis model comprises:
[0012] Based on the encoder of the target speech synthesis model, the text to be synthesized is encoded to obtain a phoneme sequence of the text to be synthesized, and based on the decoder of the target speech synthesis model, the phoneme sequence is decoded to obtain the speech data;
[0013] Accordingly, the target speech synthesis model is trained based on the following method:
[0014] Based on the first text sample, training a first initial model including an initial decoder to obtain a candidate decoder;
[0015] Based on the third text sample, training a second initial model including the candidate decoder and the initial encoder to obtain a candidate encoder;
[0016] Based on the second text sample, or based on the second text sample and the third text sample, the third initial model including the candidate encoder and the candidate decoder is fine-tuned to obtain the target speech synthesis model.
[0017] According to a speech synthesis method provided by the present invention, based on the first text sample, training a first initial model including an initial decoder to obtain a candidate decoder includes:
[0018] Performing universal character encoding on the first text sample to determine a universal character corresponding to the first text sample;
[0019] Inputting the universal character into the first initial model, extracting features of the universal character by the first initial model to obtain character features, and decoding the character features by the initial decoder to obtain a decoding result;
[0020] Based on the voice tag carried by the first text sample and the decoding result, the first initial model is trained to obtain a trained first initial model, and the decoder included in the trained first initial model is the candidate decoder.
[0021] According to a speech synthesis method provided by the present invention, based on the second text sample and the third text sample, a third initial model including the candidate encoder and the candidate decoder is fine-tuned to obtain the target speech synthesis model, including:
[0022] Sampling text samples from the sample set consisting of the second text sample and the third text sample with sampling probabilities corresponding to each language to obtain a sampling result;
[0023] Based on the sampling results, the third initial model is fine-tuned to obtain the target speech synthesis model.
[0024] According to a speech synthesis method provided by the present invention, the phoneme sequence label is determined based on the following method:
[0025] Obtaining a target language dictionary and an auxiliary language dictionary under the phoneme system;
[0026] Based on the target language dictionary and the auxiliary language dictionary, a matching algorithm is used to convert the third text sample into phonemes to determine the phoneme sequence label.
[0027] According to a speech synthesis method provided by the present invention, the third text sample also carries a speech tag;
[0028] Accordingly, the step of obtaining the target language dictionary and the auxiliary language dictionary under the phoneme system includes:
[0029] Acquire an initial target language dictionary and an initial auxiliary language dictionary, and determine a first phoneme representation of each word in the second text sample based on the initial target language dictionary, and determine a second phoneme representation of each word in the third text sample based on the initial auxiliary language dictionary;
[0030] If the difference between the voice tag carried by the second text sample and the voice tag carried by the third text sample is within a preset range, mapping the first phoneme representation and the second phoneme representation to the same phoneme representation;
[0031] Based on the same phoneme representation, the initial target language dictionary and the initial auxiliary language dictionary are updated to obtain an update result, and based on the update result, the target language dictionary and the auxiliary language dictionary are respectively obtained.
[0032] According to a speech synthesis method provided by the present invention, the target language dictionary and the auxiliary language dictionary are obtained based on the update result, respectively, including:
[0033] Determine a third phoneme representation of each word in the second text sample based on the update result corresponding to the initial target language dictionary, and determine a first phoneme sequence corresponding to the second text sample based on the third phoneme representation of each word in the second text sample;
[0034] Determining a fourth phoneme representation of each word in the third text sample based on an update result corresponding to the initial auxiliary language dictionary, and determining a second phoneme sequence corresponding to the third text sample based on the fourth phoneme representation of each word in the third text sample;
[0035] If the first phoneme sequence corresponds to the voice tag carried by the second text sample, and the second phoneme sequence corresponds to the voice tag carried by the third text sample, it is determined that the target language dictionary is an updated result corresponding to the initial target language dictionary, and the auxiliary language dictionary is an updated result corresponding to the initial auxiliary language dictionary.
[0036] The present invention also provides a speech synthesis device, comprising:
[0037] A text acquisition module, used to acquire the text to be synthesized in the target language;
[0038] A speech synthesis module, used for inputting the text to be synthesized into a target speech synthesis model to obtain speech data of the text to be synthesized output by the target speech synthesis model;
[0039] The target speech synthesis model is trained based on a first text sample carrying a speech tag, a second text sample, and a third text sample carrying a phoneme sequence label; the first text sample is a text sample of multiple parallel languages, the second text sample is a text sample of the target language, and the third text sample is a text sample of an auxiliary language;
[0040] The auxiliary language is a language in the same language family as the target language, and the corpus resources of the auxiliary language are more than the corpus resources of the target language. The second text sample and the third text sample share a unified phoneme system.
[0041] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of any of the above-mentioned speech synthesis methods are implemented.
[0042] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned speech synthesis methods are implemented.
[0043] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the steps of any of the above-mentioned speech synthesis methods are implemented.
[0044] In the speech synthesis method, device, electronic device and storage medium provided by the present invention, in the process of training to obtain the target speech synthesis model, since the first text sample represents the text samples of multiple parallel languages, the introduction of the first text sample can improve the stability of the target speech synthesis model during the training process. Since the two different languages, the auxiliary language and the target language, share a unified phoneme system, the use of the second text sample and the third text sample can greatly reduce the total number of text samples required in the training process, thereby reducing the difficulty of building the target speech synthesis model. Moreover, the introduction of the third text sample allows the auxiliary language, which has richer corpus resources and shares a unified phoneme system with the target language, to be considered in the training process. Since phonemes can represent pronunciation, the use of the auxiliary language can reduce the pronunciation error rate of the speech data output by the final target synthetic speech model, improve the naturalness and recognition rate of the speech data, and avoid the phenomenon that it is difficult to correct errors in industrial applications. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on the drawings in the following description without creative work.
[0046] Figure 1 It is a flow chart of the speech synthesis method provided by the present invention;
[0047] Figure 2 It is a schematic diagram of the training process of the first initial model in the speech synthesis method provided by the present invention;
[0048] Figure 3 It is a structural schematic diagram of the speech synthesis device provided by the present invention;
[0049] Figure 4 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0050] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0051] In recent years, end-to-end speech synthesis models have been able to synthesize speech close to that of humans. However, training such neural network-based end-to-end speech synthesis models requires a large amount of annotated parallel corpora, which are expensive to obtain. For languages with scarce parallel corpora, it is difficult to build a similarly natural speech synthesis system.
[0052] Traditional speech synthesis models such as hidden Markov models or recurrent neural network models use less corpus, but have high requirements for annotation accuracy. At the same time, the naturalness of the synthesized speech is low, and it is often accompanied by a more obvious machine sound. The end-to-end speech synthesis model uses text encoding, acoustic autoregression or parallel modeling, attention mechanism, and duration modeling methods to greatly improve the stability of synthesized speech, but greatly increase the number of trainable parameters, thereby increasing the scale requirements of parallel corpus. In order to reduce the amount of data required for the end-to-end speech synthesis model, a low-resource end-to-end speech synthesis method is usually used to achieve speech synthesis in low-resource languages. This speech synthesis method uses the duality between speech synthesis and speech recognition. Through a small amount of text-speech parallel corpus, the speech synthesis model synthesizes speech for the speech recognition model, and the speech recognition model generates text for the speech synthesis model. The two are iteratively trained together to finally complete the training process of the two models.
[0053] Although the above method can use less corpus resources to build a speech synthesis model, reducing the difficulty of model construction, the synthesized speech of the speech synthesis model is far inferior to the general end-to-end speech synthesis model, which increases the pronunciation error rate of the synthesized speech, and it is difficult to correct errors in industrial applications. In addition, since the speech synthesis model and the speech recognition model are difficult to train, both are randomly initialized, which will result in low naturalness and recognition rate of the final synthesized speech. To this end, a speech synthesis method is provided in an embodiment of the present invention.
[0054] Figure 1 FIG. 1 is a flow chart of a speech synthesis method provided in an embodiment of the present invention. Figure 1 As shown, the method includes:
[0055] S1, obtaining the text to be synthesized in the target language;
[0056] S2, inputting the text to be synthesized into a target speech synthesis model to obtain speech data of the text to be synthesized output by the target speech synthesis model;
[0057] The target speech synthesis model is trained based on a first text sample carrying a speech tag, a second text sample, and a third text sample carrying a phoneme sequence label; the first text sample is a text sample of multiple parallel languages, the second text sample is a text sample of the target language, and the third text sample is a text sample of an auxiliary language;
[0058] The auxiliary language is a language in the same language family as the target language, and the corpus resources of the auxiliary language are more than the corpus resources of the target language. The second text sample and the third text sample share a unified phoneme system.
[0059] Specifically, the speech synthesis method provided in the embodiment of the present invention is performed by a speech synthesis device, which can be configured in a server, which can be a local server or a cloud server. The local server can be a computer, a tablet computer, a smart phone, etc., which is not specifically limited in the embodiment of the present invention. Among them, speech synthesis refers to converting text into corresponding speech data. Speech data can include data such as speech waveform and speech spectrum. Since a sound can be represented by information such as speech waveform and speech spectrum, the corresponding pronunciation can be obtained by obtaining the above-mentioned speech data.
[0060] First, step S1 is performed to obtain a text to be synthesized in a target language. The target language refers to a language with less corpus resources, such as Thai, Spanish, etc. The text to be synthesized refers to a text corresponding to the target language that needs to be synthesized into speech data.
[0061] Then, step S2 is performed to introduce the target speech synthesis model, input the text to be synthesized into the target speech synthesis model, encode and decode the text to be synthesized through the target speech synthesis model, and output the speech data of the text to be synthesized. The speech data is the speech waveform and speech spectrum corresponding to the text to be synthesized.
[0062] Here, the target speech synthesis model can be a trained neural network model, which can be trained by a first text sample carrying a speech label, a second text sample, and a third text sample carrying a phoneme sequence label. Taking into account the characteristics of different languages, in order to ensure the effect of the target speech synthesis model, the target speech synthesis model can correspond to the target language, that is, for different target languages that need to perform speech synthesis, different target speech synthesis models can be applied for speech synthesis. That is, the target language corresponds to the target speech synthesis model.
[0063] The first text sample refers to text samples in multiple parallel languages, and the second text sample refers to text samples in the target language. Both carry speech tags, that is, the speech corresponding to the first text sample and the second text sample. Multiple parallel languages can be understood as multiple languages with a balanced distribution. For example, it can include different writing systems such as Latin alphabet, Cyrillic, Devanagari, Arabic, etc. The scale of the corpus resources for each parallel language does not need to be very large.
[0064] The third text sample refers to text samples in an auxiliary language. The auxiliary language refers to a language within the same language family as the target language, and the corpus resources of the auxiliary language are more than those of the target language. That is, the auxiliary language can be any language within the language family of the target language with more corpus resources than the target language. For example, if the target language is Thai, the language family of the target language is the Sino-Tibetan language family. Since the corpus resources of Chinese in the Sino-Tibetan language family are more than those of Thai, when the corpus resources of Thai are relatively scarce, Chinese can be used as the auxiliary language for Thai. If the target language is Spanish, the language family of the target language is the Indo-European language family. Since the corpus resources of English in the Indo-European language family are more than those of Spanish, when the corpus resources of Spanish are relatively scarce, English can be used as the auxiliary language for Spanish.
[0065] Here, the third text sample carries a phoneme sequence tag, that is, the phoneme sequence of the third text sample. This phoneme sequence refers to a set of phoneme representations used to characterize the pronunciation of the third text sample in actual speech. Usually, in each language, each word has a phoneme representation, which can be used to characterize the pronunciation of the word in actual speech. For example, the word "洒" in Chinese can be represented by [sa3] for its pronunciation, so [sa3] can be used as the phoneme representation of the word "洒". The word in Thai can be represented by [sa4] for its pronunciation, so [sa4] can be used as the phoneme representation of the word .
[0066] The second text sample and the third text sample share a unified phoneme system, that is, the second text sample and the third text sample are characterized using a unified phoneme system. In the embodiments of the present invention, for the same pronunciation in different languages, the same phoneme representation is used, and for different tones, different annotations can be adopted.
[0067] Here, the target speech synthesis model may include an encoder and a decoder, which can be first trained with a first text sample to obtain a decoder that can be applied to multiple parallel languages; then the decoder can be spliced with an untrained encoder to obtain a spliced model, and the spliced model can be trained with a third text sample to obtain a trained model; finally, the trained model can be trained with a second text sample to finally obtain the target speech synthesis model. It can be understood that in the three stages of training involved in the above training process, the first two stages of training can be regarded as a pre-training process before the third stage of training, and the third stage of training can be regarded as a fine-tuning process after the pre-training process. The training method of pre-training process plus fine-tuning process can make the training process of the target speech synthesis model hot-started instead of randomly initialized, which can alleviate the overfitting and poor stability of the model due to the small amount of corpus in the target language and improve the quality of the final synthesized speech.
[0068] The speech synthesis method provided in the embodiment of the present invention first obtains the text to be synthesized in the target language; then the text to be synthesized is input into the target speech synthesis model to obtain the speech data of the text to be synthesized output by the target speech synthesis model. The target speech synthesis model is trained by using the first text sample, the second text sample and the third text sample as training samples. In the process of training the target speech synthesis model, since the first text sample represents the text samples of multiple parallel languages, the introduction of the first text sample can improve the stability of the target speech synthesis model during the training process. Since the two different languages of the auxiliary language and the target language share a unified phoneme system, the use of the second text sample and the third text sample can greatly reduce the total number of text samples required in the training process, thereby reducing the difficulty of building the target speech synthesis model. Moreover, the introduction of the third text sample allows the auxiliary language with rich corpus resources and sharing a unified phoneme system with the target language to be considered in the training process. Since phonemes can represent pronunciation, the use of the auxiliary language can reduce the pronunciation error rate of the speech data output by the final target synthesis speech model, improve the naturalness and recognition rate of the speech data, and avoid the phenomenon that it is difficult to correct errors in industrial applications.
[0069] On the basis of the above embodiment, the speech synthesis method provided in the embodiment of the present invention, wherein the text to be synthesized is input into a target speech synthesis model to obtain speech data of the text to be synthesized output by the target speech synthesis model, comprises:
[0070] Based on the encoder of the target speech synthesis model, the text to be synthesized is encoded to obtain a phoneme sequence of the text to be synthesized, and based on the decoder of the target speech synthesis model, the phoneme sequence is decoded to obtain the speech data;
[0071] Accordingly, the target speech synthesis model is trained based on the following method:
[0072] Based on the first text sample, training a first initial model including an initial decoder to obtain a candidate decoder;
[0073] Based on the third text sample, training a second initial model including the candidate decoder and the initial encoder to obtain a candidate encoder;
[0074] Based on the second text sample, or based on the second text sample and the third text sample, the third initial model including the candidate encoder and the candidate decoder is fine-tuned to obtain the target speech synthesis model.
[0075] Specifically, in an embodiment of the present invention, after the text to be synthesized is input into the target speech synthesis model, the text to be synthesized can be encoded by the encoder of the target speech synthesis model to obtain a phoneme sequence of the text to be synthesized, and then the phoneme sequence can be input into the decoder of the target speech synthesis model, and the phoneme sequence can be decoded by the decoder to obtain speech data. Among them, the phoneme sequence can be used to characterize the speech features corresponding to the text to be synthesized. When encoding the text to be synthesized, the encoder can first segment the text to be synthesized to obtain each word contained in the text to be synthesized, and then the words can be distributedly encoded to obtain the phoneme representation corresponding to each word, and then the phoneme representation corresponding to each word can form a phoneme sequence according to the order of each word in the text to be synthesized.
[0076] Since the target speech synthesis model includes an encoder and a decoder, when training the target speech synthesis model, the first initial model including the initial decoder can be trained according to the first text sample to obtain a candidate decoder. The first initial model can be a neural network model, which can include an untrained encoder, and the untrained encoder is spliced with the initial decoder to obtain the first initial model.
[0077] After training, the first initial model can obtain a conventional speech synthesis model, in which the encoder can have the function of extracting character features in the text. The candidate decoder can be the decoder in the conventional speech synthesis model, and the input of the candidate decoder can be character features and the output can be speech data. Since the first text sample is a text sample of multiple parallel languages, the candidate decoder can be applicable to multiple languages and can have a better decoding function.
[0078] In the embodiment of the present invention, the candidate decoder may be a dual decoder structure of Tacotron-2 or other decoder structures, which is not specifically limited here.
[0079] Then, the second initial model including the candidate decoder and the initial encoder can be trained according to the third text sample to obtain the candidate encoder. The initial encoder and the candidate decoder can be spliced to obtain the second initial model, which is an untrained encoder. The second initial model can be trained by the third text sample. When the second initial model is trained, the encoder is the candidate encoder. Since the third text sample carries a phoneme sequence label, the candidate encoder obtained by training can have the function of extracting phoneme sequences, and the candidate encoder can be considered as a shared phoneme representation model.
[0080] It is understandable that the candidate decoders included in the second initial model can be the model parameters of the decoders in the conventional speech synthesis model that are loaded, so that the second initial model can maintain training stability and accelerate the convergence of the model. In this process, whether the target language participates in the training does not significantly affect the final result. Since the phoneme representation of the auxiliary language used in this process is consistent with the target language, and the number of text samples of the auxiliary language involved in the training is much larger than the number of text samples of the target language, this process of training the second initial model can help generate the target speech synthesis model.
[0081] Finally, the third initial model including the candidate encoder and the candidate decoder can be fine-tuned according to the second text sample, or based on the second text sample and the third text sample, to obtain the target speech synthesis model. The candidate encoder and the candidate decoder can be spliced to obtain the third initial model. Since the second text sample is a text sample of the target language, the third initial model can be trained by the second text sample. The training process can be regarded as a fine-tuning process. After the training is completed, the target speech synthesis model capable of performing speech synthesis on the point synthesis text of the target speech is obtained.
[0082] In addition, due to the limited corpus resources of the target language, fine-tuning the third initial model using the second text sample alone can easily cause overfitting. Therefore, the third initial model can be collaboratively trained based on the second text sample and combined with the third text sample. This can reduce the risk of overfitting during training and improve the pronunciation accuracy of the synthesized speech.
[0083] It can be understood that after the candidate encoder is concatenated with the candidate decoder, the input of the candidate decoder is changed from character features to a phoneme sequence.
[0084] In the embodiment of the present invention, the input of the decoder included in the target speech synthesis model is a phoneme sequence, which can make the model more stable, reduce the difficulty of pronunciation error correction, and be more suitable for industrial applications compared to direct character input. Moreover, the specific training method of the target speech synthesis model is given in this embodiment, which is carried out in three stages, which can alleviate the phenomenon of overfitting and poor stability of the model caused by the small amount of corpus resources in the target language, improve the quality of the final synthesized speech, and make the speech synthesis more accurate.
[0085] On the basis of the above embodiment, the speech synthesis method provided in the embodiment of the present invention, based on the first text sample, training the first initial model including the initial decoder to obtain the candidate decoder, includes:
[0086] Performing universal character encoding on the first text sample to determine a universal character corresponding to the first text sample;
[0087] Inputting the universal character into the first initial model, extracting features of the universal character by the first initial model to obtain character features, and decoding the character features by the initial decoder to obtain a decoding result;
[0088] Based on the voice tag carried by the first text sample and the decoding result, the first initial model is trained to obtain a trained first initial model, and the decoder included in the trained first initial model is the candidate decoder.
[0089] Specifically, in an embodiment of the present invention, when obtaining a candidate decoder, the first text sample may be firstly subjected to universal character encoding to determine the universal character corresponding to the first text sample. Before performing universal character encoding, the first text sample may be preprocessed, and the preprocessing may include converting the numbers, special symbols, and other contents in the first text sample into corresponding texts; then, for languages without word segmentation boundaries in parallel languages, such as Chinese, Thai, and other languages, the word segmentation tool may be used to first perform word segmentation on the corresponding text sample, and add word segmentation boundaries, which may be spaces, etc. Then, special start and end tags are added at the beginning and end of the first text sample.
[0090] Then, universal character encoding is performed on the first text sample obtained by preprocessing to obtain universal characters corresponding to the first text sample. Here, Unicode can be used for universal character encoding, and the encoding method adopted can be UTF-8, UTF-16, etc. In an embodiment of the present invention, the first text sample can be directly mapped to a number, and the number is the universal character corresponding to the first text sample.
[0091] It is understandable that in order to maximize the use of the language knowledge contained in the text word level, no normalization operation may be performed on the first text sample itself, including but not limited to case transcription, text conversion to phonemes, etc.
[0092] Then, the obtained universal characters are input into the first initial model, and the first initial model extracts features of the universal characters to obtain character features, and the initial decoder decodes the character features to obtain decoding results.
[0093] Finally, according to the speech tag carried by the first text sample and the decoding result obtained by the initial decoder, the first initial model is trained to obtain the trained first initial model, and the decoder contained in the trained first initial model is the candidate decoder. Here, the loss function of the first initial model can be calculated by the speech tag carried by the first text sample and the decoding result obtained by the initial decoder, and the model parameters of the first initial model are continuously adjusted by the loss function until the loss function converges, that is, the training is completed, and the trained first initial model is obtained, that is, a conventional speech synthesis model.
[0094] In order to ensure the stability of the trained speech synthesis model, the first initial model can be trained using a training strategy from easy to difficult and step by step. Specifically, during training, the number of languages in the training corpus can be gradually increased, rather than directly adding all text samples of all languages to the training at the beginning. For example, at the beginning of the training, the most common Latin letters such as English monolingual text samples are used for training. After the acoustic model is iterated to the preset number of rounds, text samples of languages with simpler pronunciation rules are added, such as Spanish, German, etc. Finally, text samples of languages with more complex pronunciation rules, or even languages whose text itself is not phonetic, such as Thai, Chinese, etc., are added. In the process of training, the training corpus gradually becomes more diverse and rich, and the difficulty of training continues to increase. Among them, the preset number of rounds can be set as needed, and is not specifically limited here.
[0095] Figure 2 This is a schematic diagram of the training process of the first initial model, such as Figure 2 As shown, the training process may include multiple sub-processes, and the number of first text samples corresponding to each sub-process gradually increases. For example, the first sub-process uses English (EnUs) text samples and encodes them in Unicode to obtain universal characters, such as [99, 104, 105, 110, 97], etc. Among them, each universal character represents a language. Finally, the universal characters are input into the encoder of the first initial model to obtain character features, and the character features are input into the decoder of the first initial model to obtain decoding results. The first initial model is trained for the first sub-process according to the decoding results and the speech data labels corresponding to the English text samples.
[0096] After the first sub-process training is completed, German (DeDe), Spanish (SpEs), and Japanese (JaJp) text samples can be added to the English text samples, and Unicode encoding can be performed to obtain universal characters, such as [99, 104, 105, 110, 97], etc. Finally, the universal characters are input into the encoder of the model trained by the first sub-process to obtain character features, and the character features are input into the decoder of the model to obtain decoding results. According to the decoding results and the speech data labels corresponding to the English text samples, the model is trained for the second sub-process. This can be extended to more languages.
[0097] In the embodiment of the present invention, when training the first initial model, the universal character encoding process is introduced to simplify the training process of the first initial model.
[0098] On the basis of the above embodiment, the speech synthesis method provided in the embodiment of the present invention, based on the second text sample and the third text sample, fine-tunes the third initial model including the candidate encoder and the candidate decoder to obtain the target speech synthesis model, including:
[0099] Sampling text samples from the sample set consisting of the second text sample and the third text sample with sampling probabilities corresponding to each language to obtain a sampling result;
[0100] Based on the sampling results, the third initial model is fine-tuned to obtain the target speech synthesis model.
[0101] Specifically, in the embodiment of the present invention, when the third initial model is collaboratively trained by the second text sample and the third text sample, the sample sampling probability can be introduced to increase the sampling probability of the text sample of the target language, that is, to increase the sampling probability of the second text sample. The sampling probability of the second text sample and the third text sample is calculated as follows:
[0102]
[0103]
[0104] Among them, N i is the number of text samples in language i, l i is an intermediate variable, β is a configurable parameter, and β = 0.2, p i is the sampling probability of language i during training.
[0105] From the sample set consisting of the second text sample and the third text sample, the sampling probability calculated by the above formula can be used to perform text sample sampling to obtain a sampling result, which can include a sampling result corresponding to the second text sample and a sampling result corresponding to the third text sample.
[0106] Finally, the third initial model is fine-tuned in combination with the sampling results to obtain the target speech synthesis model.
[0107] In the embodiment of the present invention, the sampling probability calculated by the above formula is similar to the stratified sampling method, which substantially increases the probability of occurrence of text samples of the target language during training and reduces the probability of occurrence of text samples of the auxiliary language. During fine-tuning, adding the auxiliary language can alleviate the risk of overfitting caused by the small amount of target language data. At the same time, since the phoneme representation of the auxiliary language and the target language is shared, the diversity of phoneme combinations during training can be expanded during fine-tuning, thereby improving the stability of the target speech synthesis model and further helping the text to be synthesized in the target language to be synthesized into a more accurate pronunciation.
[0108] On the basis of the above embodiment, in the speech synthesis method provided in the embodiment of the present invention, the phoneme sequence label is determined based on the following method:
[0109] Obtaining a target language dictionary and an auxiliary language dictionary under the phoneme system;
[0110] Based on the target language dictionary and the auxiliary language dictionary, a matching algorithm is used to convert the third text sample into phonemes to determine the phoneme sequence label.
[0111] Specifically, in an embodiment of the present invention, when determining the phoneme sequence label carried by the third text sample, the target language dictionary and the auxiliary language dictionary under the phoneme system can be first obtained, and the phoneme system refers to the phoneme system shared by the second text sample and the third text sample, that is, the phoneme system shared by the target language and the auxiliary language. The target language dictionary and the auxiliary language dictionary here can be obtained by adjusting the initial target language dictionary and the initial auxiliary language dictionary through a matching algorithm or a pre-trained model, and are not specifically limited here. The target language dictionary and the auxiliary language dictionary can contain each word and the corresponding phoneme representation.
[0112] Then, through the target language dictionary and the auxiliary language dictionary obtained above, a matching algorithm can be used to convert the third text sample into phonemes, and then determine the phoneme sequence label of the third text sample. Here, the matching algorithm used can be a forward matching algorithm or a backward matching algorithm. Taking the forward matching algorithm as an example, the algorithm for converting the third text sample into phonemes through the forward matching algorithm is shown in Table 1:
[0113] Table 1 Forward matching algorithm
[0114]
[0115] In an embodiment of the present invention, a target language dictionary and an auxiliary language dictionary under a phoneme system are used, and a matching algorithm is combined to convert the third text sample into phonemes to determine the phoneme sequence labels, which can improve the efficiency of determining the phoneme sequence labels and thereby improve the efficiency of acquiring the target speech synthesis model.
[0116] Based on the above embodiment, in the speech synthesis method provided in the embodiment of the present invention, the third text sample also carries a speech tag;
[0117] Accordingly, the step of obtaining the target language dictionary and the auxiliary language dictionary under the phoneme system includes:
[0118] Acquire an initial target language dictionary and an initial auxiliary language dictionary, and determine a first phoneme representation of each word in the second text sample based on the initial target language dictionary, and determine a second phoneme representation of each word in the third text sample based on the initial auxiliary language dictionary;
[0119] If the difference between the voice tag carried by the second text sample and the voice tag carried by the third text sample is within a preset range, mapping the first phoneme representation and the second phoneme representation to the same phoneme representation;
[0120] Based on the same phoneme representation, the initial target language dictionary and the initial auxiliary language dictionary are updated to obtain an update result, and based on the update result, the target language dictionary and the auxiliary language dictionary are respectively obtained.
[0121] Specifically, in an embodiment of the present invention, the third text sample carries not only a phoneme sequence label but also a voice label. Accordingly, when obtaining the target language dictionary and the auxiliary language dictionary under the phoneme system, the initial target language dictionary and the initial auxiliary language dictionary can be obtained first. The initial target language dictionary and the initial auxiliary language dictionary refer to dictionaries that are generally available on the market. For example, if the target language is Thai and the auxiliary language is Chinese, the initial target language dictionary is a Thai dictionary and the initial auxiliary language dictionary is a Chinese dictionary. The initial target language dictionary and the initial auxiliary language dictionary both contain each word and the phoneme representation corresponding to each word.
[0122] Then, the text can be converted to phonemes for each word in the second text sample based on the initial target language dictionary to determine the first phoneme representation of each word in the second text sample, and the text can be converted to phonemes for each word in the third text sample based on the initial auxiliary language dictionary to determine the second phoneme representation of each word in the third text sample. That is, the phoneme representation corresponding to each word in the second text sample is searched in the initial target language dictionary, which is the first phoneme representation; the phoneme representation corresponding to each word in the third text sample is searched in the initial auxiliary language dictionary, which is the second phoneme representation.
[0123] Here, the second text sample can be firstly segmented to obtain the words contained therein, and then the first phoneme representation of each word can be determined by a forward matching algorithm or a corresponding model. The third text sample can be firstly segmented to obtain the words contained therein, and then the second phoneme representation of each word can be determined by a matching algorithm or a corresponding model. The selection of the matching algorithm or the corresponding model can be determined according to the pronunciation rules of the target language and the auxiliary language. For languages with more complex pronunciation rules, the matching algorithm can be used to determine the phoneme representation, and for languages with simpler pronunciation rules, the corresponding model can be used to determine the phoneme representation. For example, if the target language is Thai and the auxiliary language is Chinese, its pronunciation rules are more complex. At this time, in order to ensure the accuracy of the determination of the phoneme representation, the matching algorithm can be used to determine the phoneme representation. For another example, if the target language is Spanish and the auxiliary language is English, its pronunciation rules are relatively simple. At this time, the corresponding model can be used to determine the phoneme representation.
[0124] The corresponding model can adopt a Transformer-based sequence-to-sequence model, which can reduce manual intervention and lower the cost of building the target speech synthesis model.
[0125] Then, it is determined whether the difference between the voice tag carried by the second text sample and the voice tag carried by the third text sample is within a preset range, which can be set as needed and is not specifically limited here. The determination process can be implemented manually or by a speech recognition model, which is not specifically limited here.
[0126] When the difference between the two is within a preset range, it can be considered that the two are pronounced the same, and at this time the first phoneme representation and the second phoneme representation are mapped to the same phoneme representation.
[0127] Then, the initial target language dictionary and the initial auxiliary language dictionary can be updated according to the same phoneme representation to obtain an update result. The update result may include the update result corresponding to the initial target language dictionary and the update result corresponding to the initial auxiliary language dictionary. The update process may be to replace the first phoneme representation corresponding to the same phoneme representation in the initial target language dictionary with the same phoneme representation, and to replace the second phoneme representation corresponding to the same phoneme representation in the initial auxiliary language dictionary with the same phoneme representation, and thus complete the update.
[0128] Finally, according to the update results, the target language dictionary and the auxiliary language dictionary can be obtained respectively. For example, the update result corresponding to the initial target language dictionary can be directly used as the target language dictionary, and the update result corresponding to the initial auxiliary language dictionary can be used as the auxiliary language dictionary.
[0129] In the embodiment of the present invention, a method of obtaining a target language dictionary and an auxiliary language dictionary by determining differences in voice tags is provided, which can simplify the process of obtaining the target language dictionary and the auxiliary language dictionary and improve the acquisition efficiency.
[0130] On the basis of the above-mentioned embodiment, in the speech synthesis method provided in the embodiment of the present invention, the update result, respectively obtaining the target language dictionary and the auxiliary language dictionary, comprises:
[0131] Determine a third phoneme representation of each word in the second text sample based on the update result corresponding to the initial target language dictionary, and determine a first phoneme sequence corresponding to the second text sample based on the third phoneme representation of each word in the second text sample;
[0132] Determining a fourth phoneme representation of each word in the third text sample based on an update result corresponding to the initial auxiliary language dictionary, and determining a second phoneme sequence corresponding to the third text sample based on the fourth phoneme representation of each word in the third text sample;
[0133] If the first phoneme sequence corresponds to the voice tag carried by the second text sample, and the second phoneme sequence corresponds to the voice tag carried by the third text sample, it is determined that the target language dictionary is an updated result corresponding to the initial target language dictionary, and the auxiliary language dictionary is an updated result corresponding to the initial auxiliary language dictionary.
[0134] Specifically, in an embodiment of the present invention, when the target language dictionary and the auxiliary language dictionary are obtained respectively according to the update results, the third phoneme representation of each word in the second text sample can be determined according to the update results corresponding to the initial target language dictionary, that is, the text is converted into phonemes for each word in the second text sample based on the update results again, using a matching algorithm or a corresponding model to determine the third phoneme representation of each word, and according to the third phoneme representation of each word in the second text sample, the words are arranged in the order of each word to obtain the first phoneme sequence corresponding to the second text sample.
[0135] According to the update result corresponding to the initial auxiliary language dictionary, the fourth phoneme representation of each word in the third text sample is determined, that is, according to the update result, the matching algorithm or the corresponding model is used to perform text-to-phoneme conversion on each word in the third text sample to determine the fourth phoneme representation of each word, and according to the fourth phoneme representation of each word in the third text sample, the words are arranged in the order of each word to obtain the second phoneme sequence corresponding to the third text sample.
[0136] Determine whether the first phoneme sequence corresponds to the voice tag carried by the second text sample, and whether the second phoneme sequence corresponds to the voice tag carried by the third text sample, that is, determine whether the first phoneme sequence can be used to represent the voice tag carried by the second text sample, and whether the second phoneme sequence can be used to represent the voice tag carried by the third text sample, that is, determine whether the first phoneme sequence is appropriate, and whether the second phoneme sequence is appropriate. If both correspond, then it can be determined that the target language dictionary is the update result corresponding to the initial target language dictionary, and the auxiliary language dictionary is the update result corresponding to the initial auxiliary language dictionary. Otherwise, if it is not completely corresponding, continue to perform the above mapping action and update action until both correspond.
[0137] In the embodiment of the present invention, when determining the target language dictionary and the auxiliary language dictionary, a judgment on whether the phoneme sequence is appropriate is introduced, thereby further improving the accuracy of the target language dictionary and the auxiliary language dictionary.
[0138] In summary, the speech synthesis method provided in the embodiment of the present invention, with the help of language knowledge shared between languages, uses auxiliary languages with rich corpus to assist in training, and improves the diversity of phoneme combinations during the training of the target language synthesis model. When the target language corpus is small, the phoneme representation is used as the input of the decoder to reduce the error correction cost of pronunciation errors, and the corpus of other languages is used for hot start and pre-training to improve the stability and synthesized sound quality of the target speech synthesis model. When training the target speech synthesis model, three stages of decoder hot start, encoder pre-training and target language fine-tuning are adopted. By using the auxiliary language with rich corpus resources and the target language for collaborative training, it is finally achieved that only a small amount of corpus resources of the target language are used to obtain a synthesized speech with good naturalness and pronunciation accuracy. Among them, hot start and pre-training have the same meaning, both for the target speech synthesis model, and are intended to explain that the target speech synthesis model is not randomly initialized during training, but is hot started and pre-trained.
[0139] like Figure 3 As shown, based on the above embodiment, an embodiment of the present invention provides a speech synthesis device, including:
[0140] A text acquisition module 31 is used to acquire the text to be synthesized in the target language;
[0141] A speech synthesis module 32, used for inputting the text to be synthesized into a target speech synthesis model to obtain speech data of the text to be synthesized output by the target speech synthesis model;
[0142] The target speech synthesis model is trained based on a first text sample carrying a speech tag, a second text sample, and a third text sample carrying a phoneme sequence label; the first text sample is a text sample of multiple parallel languages, the second text sample is a text sample of the target language, and the third text sample is a text sample of an auxiliary language;
[0143] The auxiliary language is a language in the same language family as the target language, and the corpus resources of the auxiliary language are more than the corpus resources of the target language. The second text sample and the third text sample share a unified phoneme system.
[0144] On the basis of the above embodiment, in the speech synthesis device provided in the embodiment of the present invention, the speech synthesis module is used for:
[0145] Based on the encoder of the target speech synthesis model, the text to be synthesized is encoded to obtain a phoneme sequence of the text to be synthesized, and based on the decoder of the target speech synthesis model, the phoneme sequence is decoded to obtain the speech data;
[0146] Accordingly, a training module is also included, including:
[0147] A first training submodule, configured to train a first initial model including an initial decoder based on the first text sample to obtain a candidate decoder;
[0148] A second training submodule is used to train a second initial model including the candidate decoder and the initial encoder based on the third text sample to obtain a candidate encoder;
[0149] The third training submodule is used to fine-tune the third initial model including the candidate encoder and the candidate decoder based on the second text sample, or based on the second text sample and the third text sample, to obtain the target speech synthesis model.
[0150] On the basis of the above embodiment, in the speech synthesis device provided in the embodiment of the present invention, the first training submodule is used for:
[0151] Performing universal character encoding on the first text sample to determine a universal character corresponding to the first text sample;
[0152] Inputting the universal character into the first initial model, extracting features of the universal character by the first initial model to obtain character features, and decoding the character features by the initial decoder to obtain a decoding result;
[0153] Based on the voice tag carried by the first text sample and the decoding result, the first initial model is trained to obtain a trained first initial model, and the decoder included in the trained first initial model is the candidate decoder.
[0154] On the basis of the above embodiment, in the speech synthesis device provided in the embodiment of the present invention, the third training submodule is used for:
[0155] Sampling text samples from the sample set consisting of the second text sample and the third text sample with sampling probabilities corresponding to each language to obtain a sampling result;
[0156] Based on the sampling results, the third initial model is fine-tuned to obtain the target speech synthesis model.
[0157] On the basis of the above embodiment, the speech synthesis device provided in the embodiment of the present invention further includes a phoneme sequence label determination module, which is used to:
[0158] Obtaining a target language dictionary and an auxiliary language dictionary under the phoneme system;
[0159] Based on the target language dictionary and the auxiliary language dictionary, a matching algorithm is used to convert the third text sample into phonemes to determine the phoneme sequence label.
[0160] Based on the above embodiment, in the speech synthesis device provided in the embodiment of the present invention, the third text sample also carries a speech tag;
[0161] Accordingly, the phoneme sequence label determination module is specifically used to:
[0162] Acquire an initial target language dictionary and an initial auxiliary language dictionary, and determine a first phoneme representation of each word in the second text sample based on the initial target language dictionary, and determine a second phoneme representation of each word in the third text sample based on the initial auxiliary language dictionary;
[0163] If the difference between the voice tag carried by the second text sample and the voice tag carried by the third text sample is within a preset range, mapping the first phoneme representation and the second phoneme representation to the same phoneme representation;
[0164] Based on the same phoneme representation, the initial target language dictionary and the initial auxiliary language dictionary are updated to obtain an update result, and based on the update result, the target language dictionary and the auxiliary language dictionary are respectively obtained.
[0165] On the basis of the above embodiment, in the speech synthesis device provided in the embodiment of the present invention, the phoneme sequence label determination module is further used for:
[0166] Determine a third phoneme representation of each word in the second text sample based on the update result corresponding to the initial target language dictionary, and determine a first phoneme sequence corresponding to the second text sample based on the third phoneme representation of each word in the second text sample;
[0167] Determining a fourth phoneme representation of each word in the third text sample based on an update result corresponding to the initial auxiliary language dictionary, and determining a second phoneme sequence corresponding to the third text sample based on the fourth phoneme representation of each word in the third text sample;
[0168] If the first phoneme sequence corresponds to the voice tag carried by the second text sample, and the second phoneme sequence corresponds to the voice tag carried by the third text sample, it is determined that the target language dictionary is an updated result corresponding to the initial target language dictionary, and the auxiliary language dictionary is an updated result corresponding to the initial auxiliary language dictionary.
[0169] Specifically, the functions of each module in the speech synthesis device provided in the embodiment of the present invention correspond one-to-one to the operation flow of each step in the above method embodiment, and the effects achieved are also consistent. Please refer to the above embodiment for details, which will not be repeated in the embodiment of the present invention.
[0170] Figure 4 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 4 As shown, the electronic device may include: a processor (processor) 410, a communication interface (Communications Interface) 420, a memory (memory) 830 and a communication bus 440, wherein the processor 410, the communication interface 420, and the memory 430 communicate with each other through the communication bus 440. The processor 410 can call the logic instructions in the memory 430 to execute the speech synthesis method provided in the above embodiments, which includes: obtaining a text to be synthesized in a target language; inputting the text to be synthesized into a target speech synthesis model to obtain speech data of the text to be synthesized output by the target speech synthesis model; wherein the target speech synthesis model is trained based on a first text sample carrying a speech tag, a second text sample, and a third text sample carrying a phoneme sequence label; the first text sample is a text sample of multiple parallel languages, the second text sample is a text sample of the target language, and the third text sample is a text sample of an auxiliary language; the auxiliary language is a language in the same language family as the target language, and the corpus resources of the auxiliary language are more than the corpus resources of the target language, and the second text sample and the third text sample share a unified phoneme system.
[0171] In addition, the logic instructions in the above-mentioned memory 430 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0172] On the other hand, the present invention also provides a computer program product, which includes a computer program, which can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the speech synthesis method provided in the above embodiments, the method including: obtaining a text to be synthesized in a target language; inputting the text to be synthesized into a target speech synthesis model to obtain speech data of the text to be synthesized output by the target speech synthesis model; wherein the target speech synthesis model is trained based on a first text sample carrying a speech tag, a second text sample, and a third text sample carrying a phoneme sequence label; the first text sample is a text sample of multiple parallel languages, the second text sample is a text sample of the target language, and the third text sample is a text sample of an auxiliary language; the auxiliary language is a language in the same language family as the target language, and the corpus resources of the auxiliary language are more than the corpus resources of the target language, and the second text sample and the third text sample share a unified phoneme system.
[0173] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the processor executes the speech synthesis method provided in the above embodiments, the method comprising: obtaining a text to be synthesized in a target language; inputting the text to be synthesized into a target speech synthesis model to obtain speech data of the text to be synthesized output by the target speech synthesis model; wherein the target speech synthesis model is trained based on a first text sample carrying a speech tag, a second text sample, and a third text sample carrying a phoneme sequence label; the first text sample is a text sample of multiple parallel languages, the second text sample is a text sample of the target language, and the third text sample is a text sample of an auxiliary language; the auxiliary language is a language in the same language family as the target language, and the corpus resources of the auxiliary language are more than the corpus resources of the target language, and the second text sample and the third text sample share a unified phoneme system.
[0174] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0175] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0176] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A speech synthesis method, It is characterized in that include: Obtain the text to be synthesized in the target language; Inputting the text to be synthesized into a target speech synthesis model to obtain speech data of the text to be synthesized output by the target speech synthesis model; The target speech synthesis model is trained based on a first text sample carrying a speech tag, a second text sample, and a third text sample carrying a phoneme sequence label; the first text sample is a text sample of multiple parallel languages, the second text sample is a text sample of the target language, and the third text sample is a text sample of an auxiliary language; The auxiliary language is a language in the same language family as the target language, and the corpus resources of the auxiliary language are more than the corpus resources of the target language, and the second text sample and the third text sample share a unified phoneme system; The target speech synthesis model is trained based on the following method: Based on the first text sample, training a first initial model including an initial decoder to obtain a candidate decoder; Based on the third text sample, training a second initial model including the candidate decoder and the initial encoder to obtain a candidate encoder; Based on the second text sample, or based on the second text sample and the third text sample, the third initial model including the candidate encoder and the candidate decoder is fine-tuned to obtain the target speech synthesis model.
2. The speech synthesis method according to claim 1, It is characterized in that The step of inputting the text to be synthesized into a target speech synthesis model to obtain speech data of the text to be synthesized output by the target speech synthesis model includes: Based on the encoder of the target speech synthesis model, the text to be synthesized is encoded to obtain the phoneme sequence of the text to be synthesized, and based on the decoder of the target speech synthesis model, the phoneme sequence is decoded to obtain the speech data.
3. The speech synthesis method according to claim 1, It is characterized in that The step of training a first initial model including an initial decoder based on the first text sample to obtain a candidate decoder includes: Performing universal character encoding on the first text sample to determine a universal character corresponding to the first text sample; Inputting the universal character into the first initial model, extracting features of the universal character by the first initial model to obtain character features, and decoding the character features by the initial decoder to obtain a decoding result; Based on the voice tag carried by the first text sample and the decoding result, the first initial model is trained to obtain a trained first initial model, and the decoder included in the trained first initial model is the candidate decoder.
4. The speech synthesis method according to claim 1, It is characterized in that Based on the second text sample and the third text sample, fine-tuning the third initial model including the candidate encoder and the candidate decoder to obtain the target speech synthesis model includes: Sampling text samples from the sample set consisting of the second text sample and the third text sample with sampling probabilities corresponding to each language to obtain a sampling result; Based on the sampling results, the third initial model is fine-tuned to obtain the target speech synthesis model.
5. The speech synthesis method according to any one of claims 1 to 4, It is characterized in that The phoneme sequence label is determined based on the following method: Obtaining a target language dictionary and an auxiliary language dictionary under the phoneme system; Based on the target language dictionary and the auxiliary language dictionary, a matching algorithm is used to convert the third text sample into phonemes to determine the phoneme sequence label.
6. The speech synthesis method according to claim 5, It is characterized in that The third text sample also carries a voice tag; Accordingly, the step of obtaining the target language dictionary and the auxiliary language dictionary under the phoneme system includes: Acquire an initial target language dictionary and an initial auxiliary language dictionary, and determine a first phoneme representation of each word in the second text sample based on the initial target language dictionary, and determine a second phoneme representation of each word in the third text sample based on the initial auxiliary language dictionary; If the difference between the voice tag carried by the second text sample and the voice tag carried by the third text sample is within a preset range, mapping the first phoneme representation and the second phoneme representation to the same phoneme representation; Based on the same phoneme representation, the initial target language dictionary and the initial auxiliary language dictionary are updated to obtain an update result, and based on the update result, the target language dictionary and the auxiliary language dictionary are respectively obtained.
7. The speech synthesis method according to claim 6, It is characterized in that The target language dictionary and the auxiliary language dictionary are obtained based on the update result, respectively, including: Determine a third phoneme representation of each word in the second text sample based on the update result corresponding to the initial target language dictionary, and determine a first phoneme sequence corresponding to the second text sample based on the third phoneme representation of each word in the second text sample; Determine a fourth phoneme representation of each word in the third text sample based on the update result corresponding to the initial auxiliary language dictionary, and determine a second phoneme sequence corresponding to the third text sample based on the fourth phoneme representation of each word in the third text sample; If the first phoneme sequence corresponds to the voice tag carried by the second text sample, and the second phoneme sequence corresponds to the voice tag carried by the third text sample, it is determined that the target language dictionary is an updated result corresponding to the initial target language dictionary, and the auxiliary language dictionary is an updated result corresponding to the initial auxiliary language dictionary.
8. A speech synthesis device, It is characterized in that include: A text acquisition module, used to acquire the text to be synthesized in the target language; A speech synthesis module, used for inputting the text to be synthesized into a target speech synthesis model to obtain speech data of the text to be synthesized output by the target speech synthesis model; The target speech synthesis model is trained based on a first text sample carrying a speech tag, a second text sample, and a third text sample carrying a phoneme sequence label; the first text sample is a text sample of multiple parallel languages, the second text sample is a text sample of the target language, and the third text sample is a text sample of an auxiliary language; The auxiliary language is a language in the same language family as the target language, and the corpus resources of the auxiliary language are more than the corpus resources of the target language, and the second text sample and the third text sample share a unified phoneme system; The target speech synthesis model is trained based on the following method: Based on the first text sample, training a first initial model including an initial decoder to obtain a candidate decoder; Based on the third text sample, training a second initial model including the candidate decoder and the initial encoder to obtain a candidate encoder; Based on the second text sample, or based on the second text sample and the third text sample, the third initial model including the candidate encoder and the candidate decoder is fine-tuned to obtain the target speech synthesis model.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the program, the steps of the speech synthesis method according to any one of claims 1 to 7 are implemented.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the speech synthesis method according to any one of claims 1 to 7 are implemented.
