Speech synthesis model training method, speech synthesis method and speech synthesis device

Through the combined model of the skeleton network, the above style encoding network and the prediction network, dialogue style features are extracted and training is optimized, which solves the problems of insufficient speech synthesis authenticity and dialogue adaptability in the existing technology, and generates a highly matched dialogue situation Voice improves the interactive experience in scenarios such as intelligent customer service.

CN118658448APending Publication Date: 2024-09-17MASHANG CONSUMER FINANCE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410131624.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-01-29
Publication Date
2024-09-17

AI Technical Summary

Technical Problem

It is difficult for existing speech synthesis technology to generate speech that is realistic and highly adapted to the conversation situation. Especially in scenarios such as intelligent customer service, synthesized speech often lacks the ability to express emotions and simulate conversational styles.

Method used

Using a combined model of the skeleton network, the above style coding network and the prediction network, the conversation style features are extracted from the sample conversation speech, and combined with the phoneme sequence of the conversation text for speech synthesis processing, the training model is optimized to generate a dialogue style that is close to the real person. Voice, with the ability to perceive conversation situations.

Benefits of technology

The speech synthesis model is realized to be able to output speech that is close to the conversational style of real people and highly adapted to the conversation situation, improving the naturalness and reliability of the interactive experience in scenarios such as intelligent customer service.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118658448A
    Figure CN118658448A
Patent Text Reader

Abstract

The invention discloses a speech synthesis model training method, a speech synthesis method and a speech synthesis device, which are used for enabling synthesized speech to be more real and to be highly adaptive to a dialogue situation. The training method comprises: through a skeleton network of a speech synthesis model, extracting a first dialogue style feature from a sample dialogue speech, and synthesizing a first synthesized speech of a dialogue text based on the first dialogue style feature and a phoneme sequence of the dialogue text, the dialogue text being a text of the sample dialogue speech; extracting previous dialogue style features from previous dialogue voice of the sample dialogue voice through a previous dialogue style coding network of the voice synthesis model; performing style prediction on the dialogue text based on the previous dialogue style feature, the first dialogue style feature and the phoneme sequence through a prediction network of a speech synthesis model to obtain a second dialogue style feature; and based on the first synthetic speech and the second dialogue style feature, performing optimization training on 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 speech processing technology, and in particular to a training method for a speech synthesis model, a speech synthesis method and a device. Background Art

[0002] The continuous progress of deep learning technology has promoted the continuous development and progress of text-to-speech (TTS) technology and applications. TTS technology uses deep networks to build a text-to-speech conversion relationship, so that the input text can be synthesized into voice data. In voice dialogue scenarios, it is usually required that the synthesized voice is authentic and highly adaptable to the dialogue context. Summary of the invention

[0003] The purpose of the embodiments of the present application is to provide a model training method, a speech synthesis method and a device, so as to make the synthesized speech more realistic and highly adaptable to the dialogue situation.

[0004] In order to achieve the above objectives, the present application embodiment adopts the following technical solutions:

[0005] In a first aspect, an embodiment of the present application provides a method for training a speech synthesis model, comprising:

[0006] Extracting a first dialogue style feature from the sample dialogue speech through a skeleton network of a speech synthesis model, and performing speech synthesis processing based on the first dialogue style feature and a phoneme sequence of a dialogue text to obtain a first synthesized speech of the dialogue text, wherein the dialogue text is a text of the sample dialogue speech;

[0007] Extracting the conversation style of the context speech of the sample conversation speech through the context style encoding network of the speech synthesis model to obtain the context conversation style feature;

[0008] By using the prediction network of the speech synthesis model, based on the above dialogue style feature, the first dialogue style feature and the phoneme sequence, the style prediction of the dialogue text is performed to obtain a second dialogue style feature;

[0009] The speech synthesis model is optimized and trained based on the first synthesized speech and the second dialogue style features.

[0010] In a second aspect, an embodiment of the present application provides a speech synthesis method, comprising:

[0011] Acquire a phoneme sequence of a target dialogue text to be synthesized and a preceding dialogue speech of the target dialogue text;

[0012] Extracting the conversation style of the above conversation speech to obtain the conversation style features;

[0013] Based on the above dialogue style features and the phoneme sequence, performing style prediction on the target dialogue text to obtain the dialogue style features of the target dialogue text;

[0014] The speech synthesis process is performed based on the dialogue style feature and the phoneme sequence to obtain the synthesized speech of the target dialogue text. In a third aspect, the embodiment of the present application provides a training device for a speech synthesis model, comprising:

[0015] A first synthesis unit is used to extract a first dialogue style feature from the sample dialogue speech through a skeleton network of a speech synthesis model, and perform speech synthesis processing based on the first dialogue style feature and a phoneme sequence of a dialogue text to obtain a first synthesized speech of the dialogue text, wherein the dialogue text is a text of the sample dialogue speech;

[0016] A first extraction unit is used to extract the conversation style of the context of the sample conversation speech through the context style encoding network of the speech synthesis model to obtain the context conversation style feature;

[0017] A first prediction unit is configured to perform style prediction on the dialogue text based on the above dialogue style feature, the first dialogue style feature and the phoneme sequence through a prediction network of the speech synthesis model to obtain a second dialogue style feature;

[0018] A training unit is used to optimize the speech synthesis model based on the first synthesized speech and the second dialogue style features.

[0019] In a fourth aspect, an embodiment of the present application provides a speech synthesis device, including:

[0020] An acquisition unit, used for acquiring a phoneme sequence of a target dialogue text to be synthesized and a preceding dialogue speech of the target dialogue text;

[0021] A second extraction unit is used to extract the conversation style of the above conversation speech to obtain the above conversation style feature;

[0022] A second prediction unit is used to perform style prediction on the target dialogue text based on the above dialogue style feature and the phoneme sequence to obtain the dialogue style feature of the target dialogue text;

[0023] The second synthesis unit is used to perform speech synthesis processing based on the dialogue style features and the phoneme sequence to obtain the synthesized speech of the target dialogue text.

[0024] In a fifth aspect, an embodiment of the present application provides an electronic device, comprising: a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement the training method of the speech synthesis model as described in the first aspect; or, the processor is configured to execute the instructions to implement the speech synthesis method as described in the second aspect.

[0025] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, which, when the instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to execute the training method of the speech synthesis model as described in the first aspect; or, when the instructions in the storage medium are executed by the processor of an electronic device, enables the electronic device to execute the speech synthesis method as described in the second aspect.

[0026] In the seventh aspect, an embodiment of the present application also provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute part or all of the steps in the method described in the first aspect or the second aspect.

[0027] At least one of the above-mentioned technical solutions adopted in the embodiments of the present application can achieve the following beneficial effects: adopting a speech synthesis model having a skeleton network, a context style encoding network and a prediction network, and adopting sample conversation speech, context conversation speech of the sample conversation speech and the phoneme sequence of the conversation text of the sample conversation speech as training data; introducing the real person conversation style into the training process of the speech synthesis model, extracting the first conversation style feature representing the conversation style from the sample conversation speech through the skeleton network, and synthesizing the corresponding first synthesized speech for the conversation text on this basis in combination with the phoneme sequence of the conversation text, so that the skeleton network can fully learn the real person conversation style of the sample conversation speech, and learn the mapping relationship from text to conversation style and then to synthesized speech, so as to have the ability to simulate conversation style, and can be used to synthesize speech that is highly close to the real person conversation style for the input text; secondly, the matching characteristics of the context conversation style are also utilized to convert the context conversation style of the sample conversation speech into the phoneme sequence of the conversation text. In the training process of the speech synthesis model, the text dialogue style is introduced, and the text dialogue style features are extracted from the text dialogue speech through the text style encoding network, and then the style of the dialogue text is predicted based on the text dialogue style features, the first dialogue style features and the phoneme sequence through the prediction network to obtain the second dialogue style features, so that the first dialogue style features can be used as labels to assist the learning of the prediction network, so that the prediction network can refer to the first dialogue style features during the training process and learn how to match the corresponding dialogue style for the text dialogue style, so that it has the ability to perceive the dialogue situation and can assist the skeleton network to output synthesized speech that is highly adapted to the dialogue situation; finally, based on the first synthesized speech and the second dialogue style features, the speech synthesis model is optimized and trained, so that the trained speech synthesis model can output synthesized speech that is close to the real person's dialogue style and highly adapted to the dialogue situation, and is suitable for dialogue scenarios with speech synthesis needs. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0029] Figure 1 A flowchart of a method for training a speech synthesis model provided for one embodiment of the present application;

[0030] Figure 2A A flowchart of a method for training a speech synthesis model provided in another embodiment of the present application;

[0031] Figure 2B A flowchart of a method for training a speech synthesis model provided in accordance with another embodiment of the present application;

[0032] Figure 3 A schematic diagram of the structure of a speech synthesis model provided for one embodiment of the present application;

[0033] Figure 4 A flowchart of a training method for a style encoding network provided in accordance with an embodiment of the present application;

[0034] Figure 5 A flowchart of a speech synthesis method provided for one embodiment of the present application;

[0035] Figure 6 A flowchart of a speech synthesis method provided for another embodiment of the present application;

[0036] Figure 7 A flowchart of a conversation processing method provided for one embodiment of the present application;

[0037] Figure 8 A schematic diagram of the structure of a training device for a speech synthesis model provided in one embodiment of the present application;

[0038] Fig. 9 A schematic diagram of a speech synthesis device provided in accordance with an embodiment of the present invention

[0039] Fig.10 A schematic diagram of the structure of an electronic device provided for one embodiment of the present application. DETAILED DESCRIPTION

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

[0041] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here. In addition, "and / or" in the specification and claims generally represents at least one of the connected objects, and the character " / " generally represents that the objects associated with each other are in an "or" relationship.

[0042] Some concept descriptions:

[0043] Speech style: an acoustic comprehensive feature that assists in the expression of semantic content and emotion in speech performance, including but not limited to: speech speed, rhythm and emotion.

[0044] StyleTTS2: A highly anthropomorphic TTS synthesis model architecture based on speech style modeling.

[0045] Acoustic model: Since the input of TTS technology is text and the output is sound, text mainly conveys semantics, while sound contains not only semantics but also timbre, rhythm, emotion, speaking speed, pitch, volume change, etc., so sound contains richer information than text. The acoustic model is the core model responsible for converting text with low total information into sound with high information content. Its output can be sound or some characteristic expression of sound, such as linear spectrogram or mel spectrogram.

[0046] Diffusion model: Diffusion model is a generative model. Diffusion model includes two processes, namely forward diffusion process and reverse diffusion process. The forward diffusion process is to gradually add Gaussian noise to the original true value data until it becomes random noise, while the reverse generation process is the denoising process, that is, gradually denoising a random noise, and finally generating data close to the original true value. This is also the solution process of the diffusion model and the parameter part that is continuously optimized during the training of the diffusion model.

[0047] In conversation scenarios such as intelligent customer service, it is not only required to provide the other party with a near-real-life interactive experience, but also to make the entire conversation interaction process natural and reliable. This requires the synthesized voice to have a highly realistic effect, remove the mechanical feeling, and be highly adaptable to the conversation context, and be able to match the other party's emotional changes, so as to truly achieve the voice synthesis effect of "what style should I use to respond to the other party's emotional expression". For example, in the intelligent customer service scenario, when the user's tone is very anxious, the customer service uses a soothing and comforting voice; when the user's tone is arrogant, the customer service uses a certified and serious voice; when the user's tone is very pleasant, the customer service uses a pleasant and appreciative voice, and so on.

[0048] In order to achieve the above-mentioned purpose, an embodiment of the present application provides a training method for a speech synthesis model, which adopts a speech synthesis model with a skeleton network, a context style encoding network and a prediction network, and adopts sample conversation speech, context conversation speech of the sample conversation speech and the phoneme sequence of the conversation text of the sample conversation speech as training data; introduces the real person conversation style into the training process of the speech synthesis model, extracts the first conversation style feature representing the conversation style from the sample conversation speech through the skeleton network, and synthesizes the corresponding first synthesized speech for the conversation text on this basis in combination with the phoneme sequence of the conversation text, so that the skeleton network can fully learn the real person conversation style of the sample conversation speech, and learn the mapping relationship from text to conversation style and then to synthesized speech, so as to have the ability to simulate the conversation style, and can be used to synthesize speech that is highly close to the real person conversation style for the input text; secondly, the matching characteristics of the context conversation style are also utilized to convert the context conversation style of the sample conversation speech into the phoneme sequence of the conversation text. In the training process of the speech synthesis model, the text dialogue style is introduced, and the text dialogue style features are extracted from the text dialogue speech through the text style encoding network, and then the style of the dialogue text is predicted based on the text dialogue style features, the first dialogue style features and the phoneme sequence through the prediction network to obtain the second dialogue style features, so that the first dialogue style features can be used as labels to assist the learning of the prediction network, so that the prediction network can refer to the first dialogue style features during the training process and learn how to match the corresponding dialogue style for the text dialogue style, so that it has the ability to perceive the dialogue situation and can assist the skeleton network to output synthesized speech that is highly adapted to the dialogue situation; finally, based on the first synthesized speech and the second dialogue style features, the speech synthesis model is optimized and trained, so that the trained speech synthesis model can output synthesized speech that is close to the real person's dialogue style and highly adapted to the dialogue situation, and is suitable for dialogue scenarios with speech synthesis needs.

[0049] Based on the same inventive concept, an embodiment of the present application also provides a speech synthesis method, which utilizes the matching characteristics of the context dialogue style to introduce the previous dialogue style of the target dialogue text into the speech synthesis process, extracts the previous dialogue style features from the previous dialogue speech of the target dialogue text, and on this basis combines the phoneme features to predict the corresponding dialogue style features for the target dialogue text, so that the predicted dialogue style features are not only close to the real person's dialogue style, but also compatible with the previous dialogue style features; speech synthesis processing is performed based on the dialogue style features, so that a synthesized speech that is close to the real person's dialogue style and highly adapted to the dialogue scenario can be obtained.

[0050] The speech synthesis method provided in the embodiment of the present application can be applied not only to various non-dialogue scenarios with speech synthesis requirements, but also to various dialogue scenarios with speech synthesis requirements. For example, in an intelligent customer service scenario, a corresponding response text is determined based on the received user dialogue voice, and then based on the phoneme sequence of the response text and the voice style features of the user dialogue voice, a dialogue style feature that is close to a real person's dialogue style and is compatible with the user's dialogue style is matched to the response text, and the corresponding speech is synthesized for the response text based on the dialogue style features.

[0051] For example, in a consultation scenario, the corresponding response text is determined based on the received user consultation voice, and then based on the phoneme sequence of the response text and the voice style characteristics of the user consultation voice, the response text is matched with dialogue style characteristics that are close to a real person's dialogue style and adapted to the user's dialogue style, and the corresponding speech is synthesized for the response text based on the dialogue style characteristics.

[0052] It should be understood that the application of the speech synthesis method provided in the embodiments of the present application to the above-mentioned intelligent customer service scenarios and consultation scenarios is merely an exemplary description and should not be understood as a limitation on the application of the speech synthesis method.

[0053] It should be understood that the training method of the speech synthesis model and the speech synthesis method provided in the embodiments of the present application can be executed by an electronic device, specifically by a processor of the electronic device. The electronic device can be a terminal device, such as a smart phone, a tablet computer, a laptop computer, a desktop computer, an intelligent voice interaction device, a smart home appliance, a smart watch, a vehicle terminal, an aircraft, etc.; or, the electronic device can also be a server, such as an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.

[0054] The technical solutions provided by various embodiments of the present application are described in detail below in conjunction with the accompanying drawings.

[0055] See also Figure 1 , is a flow chart of a method for training a speech synthesis model provided by an embodiment of the present application, the method comprising the following steps:

[0056] S102, obtaining a sample conversation speech, a previous conversation speech of the sample conversation speech, and a phoneme sequence of a conversation text of the sample conversation speech.

[0057] The sample conversation voice is the voice of the designated speaker in the historical conversation. The speaker of the previous conversation voice is different from the designated speaker. The sample conversation voice and its previous conversation voice vary according to the conversation scenario. As an example, in the intelligent customer service scenario, the designated speaker is the customer service, the sample conversation voice is the customer service voice obtained in the historical conversation, and the previous conversation voice is the previous user voice of the customer service voice.

[0058] The phoneme sequence includes the phonemes of each character in the conversation text. Phonemes are the smallest speech units divided according to the natural properties of speech. The phoneme of each character consists of the pinyin of the character and the identifier representing the tone of the pinyin. For example, 1 indicates that the tone is the first tone, 2 indicates that the tone is the second tone, 3 indicates that the tone is the third tone, 4 indicates that the tone is the fourth tone, 5 indicates that the tone is the light tone, etc. The phoneme sequence corresponding to the target text "Hello, what is your name?" is {ni2 hao3,qing3wen4 ni2 jiao4 shen2 me5 ming2 zi3?}. The phoneme sequence can reflect the speaker characteristics of the sample conversation speech from the perspective of text.

[0059] S104, extracting a first dialogue style feature from the sample dialogue speech through a skeleton network of a speech synthesis model, and performing speech synthesis processing based on the first dialogue style feature and a phoneme sequence to obtain a first synthesized speech of the dialogue text.

[0060] As an example, Figure 2A As shown, the speech synthesis model includes a skeleton network, a prediction network and a contextual style encoding network.

[0061] The first dialogue style feature is used to reflect the dialogue style of the sample dialogue speech from the perspective of speech. The first dialogue style feature may include, for example, but is not limited to, a first speech style feature and a first prosody feature.

[0062] The first speech style feature is contained in the auxiliary semantic content and emotional expression in the sample conversation speech, and can reflect the speech speed, emotion, etc. of the sample conversation speech. The first speech style feature can be obtained by extracting the style feature of the sample conversation speech by the skeleton network in various ways, and the embodiment of the present application is not limited to this. As an example, Figure 2B As shown, first, spectral features (such as Mel spectrum) are extracted from the sample conversation speech, and then the spectral features are encoded in speech style through a skeleton network to obtain a first speech style feature.

[0063] The first prosodic feature represents the true prosody of the sample conversational speech. Since the prosody of speech is usually related to the pitch and volume of speech, in order to accurately represent the prosody of the sample conversational speech, the first prosodic feature may include at least one of the following prosodic features: a first pitch feature, a first volume feature, etc. The first pitch feature represents the true pitch of the sample conversational speech, and the first volume feature represents the true volume of the sample conversational speech. The first prosodic feature can be obtained by extracting the prosodic feature of the sample conversational speech through a skeleton network in various ways, and the embodiments of the present application are not limited to this. As an example, as shown in FIG2 , spectral features (such as Mel spectrum) are first extracted from the sample conversational speech, and then the spectral features are prosodic encoded through the skeleton network to obtain the first prosodic feature.

[0064] The skeleton network is the basic structure of the speech synthesis model, which not only has the function of extracting style features, but also has the function of speech synthesis, and can convert text into corresponding synthesized speech based on the extracted features. In the above S104, since the first dialogue style reflects the dialogue style of the sample dialogue speech from the perspective of speech, and the phoneme sequence reflects the speaker characteristics of the sample dialogue speech from the perspective of text, speech synthesis processing based on the two is helpful to synthesize speech that is highly close to the dialogue style of a real person.

[0065] In the embodiment of the present application, the skeleton network can perform speech synthesis processing in various appropriate ways, which can be set according to actual needs, and the embodiment of the present application does not limit this. In one embodiment, the phoneme sequence is text-encoded by the skeleton network to obtain phoneme features, and then speech synthesis processing is performed based on the phoneme features and the first dialogue style features to obtain the first synthesized speech.

[0066] In another embodiment, a phoneme sequence is text-encoded through a skeleton network to obtain phoneme features, and spectral features (such as Mel-spectrogram) are extracted from the sample conversation text; then, the phoneme features are aligned based on the spectral features through the skeleton network to obtain aligned phoneme features, and speech synthesis is performed based on the aligned phoneme features and the first conversation style features to obtain a first synthesized speech.

[0067] Since each character in the conversation text corresponds to a different number of speech frames, aligning the phoneme features based on the spectral features is equivalent to transforming the phoneme sequence from the character level to the frame level, that is, transforming the phoneme of each character in the conversation text into the phoneme of each speech frame, which can more accurately reflect the speaker characteristics of the sample conversation speech from the perspective of the text.

[0068] The alignment of phoneme features can be achieved in various ways, which are not limited in the embodiments of the present application. As an example, an alignment process (Align) is performed between the spectrum feature and the phoneme feature to obtain an alignment matrix; then, the phoneme feature and the alignment matrix are dot-multiplied to obtain the aligned phoneme feature. Among them, the alignment matrix represents the mapping relationship between the spectrum feature and the phoneme feature, such as how many speech frames the phoneme of each character corresponds to.

[0069] In this implementation, the phoneme features are aligned based on the spectral features, and the phoneme sequence is transformed from the character level to the frame level, which can more accurately reflect the speaker characteristics of the sample conversation speech from the perspective of text; then, speech synthesis processing is performed based on the aligned phoneme features and the first conversation style features, which is not only more natural and closer to the real person's conversation style, but also can avoid the problems of shadowing and repetition in the synthesized speech, so that the auditory effect of the synthesized speech is better.

[0070] In practical applications, the synthesis network can have various appropriate forms, which can be set according to actual needs, and the embodiments of the present application do not limit this. As an example, the synthesis network can adopt an acoustic model commonly used in the art. As another example, Figure 3 As shown, the skeleton network can adopt a generative adversarial network architecture, which specifically includes a text encoder (TextEncoder), a text aligner (Text Aligner), a speech style encoder (Style Encoder), a prosody style encoder (Prosody Style Encoder), a speech feature extractor (Pitch and Energy Predictor), a decoder (Decoder) and a discriminator (Discriminator).

[0071] The process of synthesizing the first synthetic speech based on the sample conversation speech and phoneme sequence by the skeleton network of this architecture is as follows:

[0072] The phoneme sequence is encoded by the text encoder to obtain the phoneme feature. The phoneme sequence and the spectral features of the sample conversation speech are aligned by the text aligner to obtain the alignment matrix. The aligned phoneme feature can be obtained by performing a dot multiplication operation on the phoneme feature and the alignment matrix.

[0073] At the same time, the spectral features of the sample conversational speech are respectively encoded by the speech style encoder and the prosody style encoder to obtain two first speech style features sx and sy, which are concatenated to obtain the first speech style features finally used for speech synthesis. The spectral features of the sample conversational speech are also extracted by the speech feature extractor for prosody features to obtain the first prosody features, specifically including the first pitch feature and the first volume feature.

[0074] After the aligned phoneme features, the first voice style features and the first prosody features are decoded by a decoder, a first synthesized speech is obtained.

[0075] In addition, the first synthesized speech and the sample conversation speech are also input into the discriminator for matching to determine the similarity between the two, and then evaluate the effect of the first synthesized speech, so as to optimize the speech synthesis process of the skeleton network.

[0076] S106, extracting the conversation style of the previous conversation speech through the context style encoding network of the speech synthesis model to obtain the context conversation style features.

[0077] The context style encoding network has a dialogue style extraction function and can extract corresponding dialogue style features from any dialogue speech. In the above S106, since the context dialogue speech contains the dialogue context of the sample dialogue speech, the context style encoding network is used to extract the dialogue style of the context dialogue speech. The dialogue style features obtained can reflect the context dialogue style of the sample dialogue speech from the perspective of speech, so the extracted dialogue style features are called context dialogue style features.

[0078] Considering that the dialogue context is mainly affected by the auxiliary semantic content and emotional expression in the speech performance of the previous dialogue, the style features of the previous dialogue include the style features of the previous speech. The style features of the previous speech are contained in the auxiliary semantic content and emotional expression in the speech performance of the previous dialogue, and can reflect the speech speed, emotion, etc. of the speech of the previous dialogue.

[0079] S108, using the prediction network of the speech synthesis model, based on the above dialogue style features, the first dialogue style features and the phoneme sequence, perform style prediction on the dialogue text to obtain a second dialogue style feature.

[0080] The prediction network has a style prediction function and can predict the corresponding dialogue style based on the phoneme sequence of any text. Since the dialogue style here is predicted, it is different from the first dialogue style feature directly extracted from the sample dialogue speech, so it is called the second dialogue style feature. In the above S108, by introducing the above dialogue style feature and the first dialogue style feature on the basis of the phoneme sequence, the prediction network can learn the matching relationship between the context dialogue styles, and match the current dialogue style that is adapted to the above dialogue style for the dialogue text based on this matching relationship, thereby helping to assist the skeleton network to output a synthetic speech that is highly adapted to the dialogue context.

[0081] The second dialogue style feature is used to reflect the dialogue style of the sample dialogue speech from the perspective of speech. The second dialogue style feature may include, for example, but is not limited to, the second voice style feature and the second prosody feature. Among them, the second voice style feature is contained in the auxiliary semantic content expression and emotional expression expressed in the dialogue text, and can reflect the speech speed, emotion, etc. of the sample dialogue text. The second prosody feature represents the predicted prosody of the dialogue text. Since the prosody of speech is usually related to the pitch, volume, and length of speech, in order to enable the second prosody feature that the prediction network can accurately predict to accurately represent the prosody of the sample dialogue speech, the second prosody feature may include at least one of the following prosody features: a second pitch feature, a second volume feature, and a second length feature.

[0082] In the embodiment of the present application, the second dialogue style feature can be obtained by predicting the style of the dialogue text in various ways, which can be set according to actual needs, and the embodiment of the present application does not limit this. In one embodiment, the above dialogue style feature includes the above voice style feature, and the above S108 includes the following steps: extracting the rhythmic text feature from the phoneme sequence; based on the rhythmic text feature, the above voice style feature and the first voice style feature, predicting the voice style of the dialogue text to obtain the second voice style feature; based on the second voice style feature and the rhythmic text feature, predicting the rhythm of the dialogue text to obtain the second rhythm feature. The second pitch feature represents the predicted pitch of the dialogue text, the second volume feature represents the predicted volume of the dialogue text, and the second sound length feature represents the predicted sound length of the dialogue text.

[0083] Since the rhythm of the sample conversational speech is contained in the phoneme sequence, the prosodic text feature can reflect the rhythm of the sample conversational speech from the perspective of text. Since the speech style of the following speech is mainly affected by the speech style of the preceding speech and the phoneme sequence of the following speech itself, speech style prediction based on the prosodic text feature and the preceding speech style feature can refer to the preceding speech style to quickly and accurately match the corresponding speech style for the conversation text, and obtain a second speech style feature that is highly adapted to the preceding speech style feature. On this basis, the first speech style feature is also introduced as a reference in the speech style prediction process, which helps the prediction network learn the matching relationship between the context speech styles from the first speech style feature, and further improves the adaptability of the second speech style feature to the preceding speech style feature.

[0084] Secondly, since the rhythm of the following speech is affected by the voice style and phoneme sequence of the following speech itself, rhythm prediction based on the second voice style features and prosodic text features can quickly and accurately match the corresponding rhythm for the dialogue text and obtain a second prosodic feature that is more suitable for the second voice style features.

[0085] The speech style prediction of the dialogue text can be achieved in various ways, which are not limited in the embodiments of the present application. As an example, the prosodic text feature includes the prosodic text sub-feature of each phoneme in the phoneme sequence, and the prosodic text sub-feature is extracted from the corresponding phoneme, which can be the rhythm of the character corresponding to the phoneme. Accordingly, the speech style prediction of the dialogue text includes the following steps: splicing the prosodic text sub-feature of each phoneme in the phoneme sequence with the above speech style feature to obtain a spliced ​​feature; based on the spliced ​​feature and the first speech style feature, the speech style prediction of the dialogue text is performed to obtain a second speech style feature.

[0086] The concatenation feature includes the concatenation sub-feature of each phoneme in the phoneme sequence. The concatenation sub-feature of each phoneme is obtained by concatenating the prosodic text sub-feature of the phoneme with the above speech style feature.

[0087] In this example, by concatenating the prosodic text sub-features of each phoneme with the previous speech style features for speech style prediction, not only can the previous speech style be integrated into each phoneme of the dialogue text to obtain a second speech style feature that is more compatible with the previous speech style features, but also a certain degree of independence between the prosodic text features and the previous speech style features can be ensured, thus avoiding parameter complexity, thereby improving the efficiency of speech style prediction and ultimately improving the efficiency of the entire model training process.

[0088] Of course, in some other examples, without considering the complexity of parameters, the prosodic text sub-features of each phoneme and the above-mentioned speech style features can be added or multiplied and then applied to style prediction.

[0089] In another embodiment of the present application, considering that in some dialogue scenarios, the previous dialogue speech of the sample dialogue speech cannot be obtained, for example, in the intelligent customer service scenario, when the sample dialogue speech is the first customer service speech obtained from the historical dialogue, the sample dialogue speech does not have the previous user speech. In this case, the second dialogue style feature can be obtained by style prediction in the following manner: through the prediction network, based on the zero vector feature, the first dialogue style feature and the phoneme sequence, the style prediction of the dialogue text is performed to obtain the second dialogue style feature. Among them, the zero vector feature refers to the feature where the feature value of each dimension is zero, and the dimension of the zero vector feature can be set according to actual needs, which is not limited in the embodiment of the present application.

[0090] Specifically, based on the prosodic text feature, the zero vector feature and the first voice style feature, the voice style of the dialogue text is predicted to obtain the second voice style feature; based on the second voice style feature and the prosodic text feature, the rhythm of the dialogue text is predicted to obtain the second rhythm feature.

[0091] In this embodiment, for the first customer service speech, style prediction is performed based on the zero vector feature, the first conversation style feature, and the phoneme sequence, which can maintain the consistency in scale of the above conversation style features of all sample conversation speech, thereby ensuring the accuracy of the style prediction result.

[0092] It is worth noting that in the above dialogue scenario, the number of the first customer service voice is much smaller than the number of non-first customer service voices to ensure the training effect of the speech synthesis model.

[0093] In practical applications, the prediction network can have various appropriate structures, which can be set according to actual needs, and the embodiments of the present application do not limit this. As an example, Figure 3 As shown, the prediction network includes a prosody text encoder, a style diffusion module, a duration predictor, a pitch predictor, and a volume predictor.

[0094] Among them, the prosodic text encoder is used to extract prosodic text features from the phoneme sequence. The style diffusion module is used to predict the speech style of the dialogue text based on the prosodic text features, the previous speech style features and the first speech style features when the sample dialogue text is not the first customer service voice, and to obtain the second speech style features based on the prosodic text features, the zero vector features and the first speech style features when the sample dialogue text is the first customer service voice. The sound length predictor is used to predict the sound length of the dialogue text based on the second speech style features and the prosodic text features to obtain the second sound length features. The pitch predictor is used to predict the pitch of the dialogue text based on the second speech style features and the prosodic text features to obtain the second pitch features. The volume predictor is used to predict the sound length of the dialogue text based on the second speech style features and the prosodic text features to obtain the second sound length features.

[0095] S110, optimizing and training a speech synthesis model based on the first synthesized speech and the second dialogue style features.

[0096] In one embodiment, the skeleton network, the above-mentioned style encoding network and the prediction network can be synchronously trained as a whole. Specifically, the above S110 includes the following steps: Step A1, based on the difference information between the first synthesized speech and the sample conversation speech, determine the synthesis loss; Step A2, based on the difference information between the first conversation style feature and the second conversation style feature, determine the style prediction loss; Step A3, weighted sum the synthesis loss and the style prediction loss to obtain the total loss; Step A4, based on the total loss, perform multiple optimization training on the speech synthesis model as a whole until the preset training stop condition is met. Among them, the preset training stop condition can be set according to actual needs, such as the number of optimization training times reaches a preset number or the total loss converges, etc., and the embodiment of the present application does not limit this.

[0097] For example, the parameters of the skeleton network and the parameters of the prediction network are adjusted based on the total loss; then, the steps of extracting the first dialogue style feature from the sample dialogue speech through the skeleton network to adjusting the parameters of the skeleton network and the parameters of the prediction network based on the total loss are repeated on the skeleton network and the prediction network after the parameters are adjusted until the preset training stop condition is met.

[0098] In another embodiment, the backbone network may be optimized and trained a certain number of times first, and then the optimized and trained backbone network and the prediction network are trained together. Specifically, the above S110 includes the following steps: Step B1, based on the difference information between the first synthesized speech and the sample conversation speech, the skeleton network is optimized and trained N times, and the skeleton network after the Nth optimization training is used as a candidate skeleton network, where N is an integer greater than 1; Step B2, extracting the first conversation style feature from the sample conversation speech through the candidate skeleton network, and performing speech synthesis processing based on the first conversation style feature and the phoneme sequence to obtain the first synthesized speech of the conversation text; Step B3, based on the difference information between the sample conversation speech and the first synthesized speech obtained by the candidate skeleton network, and the difference information between the second conversation style feature obtained by the prediction network and the first conversation style feature obtained by the candidate skeleton network, the candidate skeleton network and the prediction network are optimized and trained M times, where M is an integer greater than 1.

[0099] Specifically, in the above step B1, the synthesis loss is determined based on the difference information between the first synthesized speech and the sample conversation speech; then, the parameters of the skeleton network are adjusted based on the synthesis loss, and the above steps of extracting the first conversation style feature from the sample conversation speech to adjusting the parameters of the skeleton network based on the synthesis loss are repeated N times on the skeleton network after the parameters are adjusted; the skeleton network after the Nth parameter adjustment is used as a candidate skeleton network.

[0100] In the above step B3, the synthesis loss is determined based on the difference information between the sample conversation speech and the first synthesized speech obtained by the candidate skeleton network, and the style prediction loss is determined based on the difference information between the second conversation style feature obtained by the prediction network and the first conversation style feature obtained by the candidate skeleton network; then, the synthesis loss and the style prediction loss are weightedly summed to obtain the total loss, and the parameters of the candidate skeleton network and the parameters of the prediction network are adjusted based on the total loss; the above steps of extracting the first conversation style feature from the sample conversation speech through the skeleton network of the speech synthesis model to adjusting the parameters of the candidate skeleton network and the parameters of the prediction network based on the total loss are repeated M times for the entire speech synthesis model after parameter adjustment; the speech synthesis model composed of the above style encoding network, the skeleton network after the Mth parameter adjustment, and the prediction network after the Mth parameter adjustment is used as the speech synthesis model in the application stage.

[0101] In practical applications, N and M can be set according to actual needs. Different training data sets correspond to different N and M, which is not limited in the embodiments of the present application.

[0102] In this implementation, by first optimizing the backbone network for a certain number of times, the backbone network can have a general prototype and thus have a certain ability to synthesize speech in a style close to that of a real person; on this basis, the optimized and trained backbone network is then trained together with the above-mentioned style encoding network and prediction network. The backbone network can be used to assist the training of the above-mentioned style encoding network and prediction network, accelerate their convergence, reduce their convergence speed, and then quickly train a speech synthesis model that can synthesize speech in a style close to that of a real person and that is highly adapted to the conversation scenario.

[0103] In another embodiment of the present application, considering that the accuracy of the preceding conversation style features extracted by the preceding conversation style encoding network will also affect the prediction process of the following conversation style features, if the preceding conversation style encoding network is mixed with the skeleton network and the prediction network for training according to the traditional model training method, although the accuracy of extracting the preceding conversation style features can be improved, it will affect the training stability of the speech synthesis model, as well as the consistency of the speech synthesis model in the training stage and the application stage.

[0104] Based on this, before the above S106, the training method of the speech synthesis model provided in the embodiment of the present application may also include a training method for the above style encoding network. Figure 4 As shown, the method may include the following steps:

[0105] S402, extracting a third speech style feature from the sample conversation speech through the speech style coding network of the basic model, and extracting a third prosody feature from the sample conversation speech through the feature extraction network of the basic model.

[0106] The basic model may adopt various acoustic models with speech synthesis function, which is not limited in the embodiments of the present application. As an example, the basic model may adopt the StyleTTS model.

[0107] The third voice style features and connotations are the auxiliary semantic content and emotional expression in the sample dialogue speech performance, which can reflect the speech speed, emotion, etc. of the sample dialogue speech. Figure 1 The method for acquiring the first voice style feature in the illustrated embodiment is similar and will not be described in detail.

[0108] The third prosody feature represents the real prosody of the sample conversational speech. The third prosody feature may include at least one of the following prosody features: a third pitch feature, a third volume feature, etc. The third pitch feature represents the real pitch of the sample conversational speech, and the third volume feature represents the real volume of the sample conversational speech. The acquisition method of the third prosody feature is similar to Figure 1 The method for acquiring the first rhythmic feature in the illustrated embodiment is similar and will not be described in detail.

[0109] S404, performing speech synthesis processing based on the third speech style feature, the third prosodic feature and the phoneme sequence through the decoding network of the basic model to obtain a second synthesized speech of the dialogue text.

[0110] The specific implementation method of S404 is Figure 1 The specific implementation of S104 in the illustrated embodiment is similar and will not be described in detail.

[0111] S406, performing prosody prediction on the dialogue text based on the third prosody feature and the phoneme sequence through the prediction network of the basic model to obtain a fourth prosody feature.

[0112] The specific implementation of S406 is the same as Figure 1 The specific implementation of obtaining the second prosody feature in S108 in the illustrated embodiment is similar and will not be described in detail.

[0113] S408, optimizing and training the basic model based on the difference information between the second synthesized speech and the sample conversation speech, and the difference information between the third prosodic feature and the fourth prosodic feature.

[0114] The specific implementation of S408 above is Figure 1 The specific implementation method of optimizing the backbone network in the illustrated embodiment is similar and will not be described in detail.

[0115] S410, using the speech style coding network in the optimized trained basic model as the above style coding network.

[0116] The optimized and trained speech style coding network has the ability to accurately extract style and can be used as the above style coding network in the speech synthesis model and its parameters can be frozen.

[0117] In this embodiment, a speech style encoding network in a pre-trained basic model is used as the context style encoding network and the parameters are frozen, which can ensure that the context style encoding network is trained separately rather than mixed with the skeleton network and the prediction network. This can improve the accuracy of extracting the context dialogue style features while improving the training stability of the speech synthesis model and the consistency of the speech synthesis model in the training stage and the application stage.

[0118] One or more embodiments of the present application provide a method for training a speech synthesis model, which adopts a speech synthesis model having a skeleton network, a context style encoding network and a prediction network, and adopts sample conversation speech, context conversation speech of the sample conversation speech and a phoneme sequence of a conversation text of the sample conversation speech as training data; introduces the real person conversation style into the training process of the speech synthesis model, extracts a first conversation style feature representing the conversation style from the sample conversation speech through the skeleton network, and synthesizes a corresponding first synthesized speech for the conversation text on this basis in combination with the phoneme sequence of the conversation text, so that the skeleton network can fully learn the real person conversation style of the sample conversation speech, and learn the mapping relationship from text to conversation style and then to synthesized speech, thereby having the ability to simulate the conversation style, and can be used to synthesize speech that is highly close to the real person conversation style for the input text; secondly, the matching characteristics of the context conversation style are also utilized to convert the context conversation style of the sample conversation speech into a real person conversation style feature; In the training process of the speech synthesis model, the conversation style is introduced. The conversation style features are extracted from the conversation speech through the conversation style encoding network. Then, the prediction network predicts the style of the conversation text based on the conversation style features, the first conversation style features and the phoneme sequence to obtain the second conversation style features, so that the first conversation style features can be used as labels to assist the learning of the prediction network. The prediction network can refer to the first conversation style features during the training process and learn how to match the conversation style with the corresponding conversation style, so that it has the ability to perceive the conversation situation and can assist the skeleton network to output the synthesized speech that is highly adapted to the conversation situation. Finally, based on the first synthesized speech and the second conversation style features, the speech synthesis model is optimized and trained, so that the trained speech synthesis model can output the synthesized speech that is close to the real person's conversation style and highly adapted to the conversation situation, and is suitable for conversation scenarios with speech synthesis needs.

[0119] Based on the same inventive concept, the present application embodiment also provides a speech synthesis method. Figure 5 , is a flow chart of a speech synthesis method provided by an embodiment of the present application, the method comprising the following steps:

[0120] S502, obtaining a phoneme sequence of a target dialogue text to be synthesized and a previous dialogue speech of the target dialogue text.

[0121] The target dialogue text is a response text to the above dialogue speech. The phoneme sequence of the target dialogue text includes the phonemes of each character in the target dialogue text.

[0122] S504, extracting the dialogue style of the above dialogue speech to obtain the above dialogue style features.

[0123] The specific implementation of S504 is the same as Figure 1 The specific implementation of S106 in the illustrated embodiment is similar and will not be described in detail.

[0124] In one embodiment, if the preceding conversation speech of the target conversation text is not obtained, a preset zero vector feature is used as the preceding conversation style feature.

[0125] S506: Based on the above dialogue style features and phoneme sequence, perform style prediction on the target dialogue text to obtain dialogue style features of the target dialogue text.

[0126] In one embodiment, the dialogue style features include speech style features and prosody features. The above S506 includes the following steps: extracting prosody text features from the phoneme sequence; performing speech style prediction on the target dialogue text based on the prosody text features and the previous dialogue style features to obtain speech style features; performing prosody prediction on the target dialogue text based on the speech style features and the prosody text features to obtain prosody features.

[0127] Specifically, the prosodic text feature includes the prosodic text sub-feature of each phoneme in the phoneme sequence. Based on the prosodic text feature and the previous conversation style feature, the target conversation text is predicted to obtain the speech style feature, including: concatenating the prosodic text sub-feature of each phoneme in the phoneme sequence with the previous conversation style feature to obtain the concatenated feature; and based on the concatenated feature, the target conversation text is predicted to obtain the speech style feature.

[0128] The specific implementation of S506 is the same as Figure 1 The specific implementation of S108 in the illustrated embodiment is similar and will not be described in detail.

[0129] S508, performing speech synthesis processing based on the dialogue style features and the phoneme sequence to obtain synthesized speech of the target dialogue text.

[0130] In one embodiment, the prosodic features include at least one of a pitch feature and a volume feature and a length feature. The above S508 includes the following steps: text encoding the phoneme sequence to obtain the phoneme feature; aligning the phoneme feature based on the length feature to obtain an aligned phoneme feature; performing speech synthesis processing based on at least one of the pitch feature and the volume feature, the aligned phoneme feature value and the voice style feature to obtain a synthesized speech.

[0131] Specifically, the phoneme features are aligned based on the sound length features to obtain aligned phoneme features, including: upsampling the sound length features to obtain an alignment matrix; and performing a dot product operation on the phoneme features and the alignment matrix to obtain the aligned phoneme features.

[0132] The specific implementation of S508 above is Figure 1 The specific implementation of S104 in the illustrated embodiment is similar and will not be described in detail.

[0133] The speech synthesis method provided in the embodiment of the present application can be implemented by a speech synthesis model trained by the training method of the speech synthesis model provided in the embodiment of the present application. Specifically, the above S504 can be implemented by the above style encoding network of the speech synthesis model, the above S506 can be implemented by the prediction network of the speech synthesis model, and the above S508 can be implemented by the skeleton network of the speech synthesis model.

[0134] Combine the following Figure 3 The speech synthesis model shown provides a detailed description of the speech synthesis method provided in the embodiment of the present application.

[0135] like Figure 6 As shown, the phoneme sequence of the target dialogue text is encoded by the text encoder to obtain phoneme features, and is encoded by the prosodic text encoder to obtain prosodic text features.

[0136] The conversation speech is extracted through the conversation style encoding network to obtain the conversation style features. The conversation style features are concatenated with the prosodic text features and then predicted through the style diffusion module to obtain the speech style features.

[0137] The pitch of the speech style features and the prosodic text features is predicted by the pitch predictor to obtain the pitch features, the volume of the speech style features and the prosodic text features is predicted by the volume predictor to obtain the volume features, and the length of the speech style features and the prosodic text features is predicted by the length predictor to obtain the length features.

[0138] The alignment matrix is ​​obtained by upsampling the sound length feature, and the phoneme feature and the alignment matrix are multiplied to obtain the aligned phoneme feature.

[0139] After the aligned phoneme features, voice style features, pitch features and sound length features are decoded by the decoder, the synthesized speech of the target dialogue text is obtained.

[0140] The speech synthesis method provided by one or more embodiments of the present application utilizes the matching characteristics of the contextual dialogue style to introduce the previous dialogue style of the target dialogue text into the speech synthesis process, extracts the previous dialogue style features from the previous dialogue speech of the target dialogue text, and on this basis combines the phoneme features to predict the corresponding dialogue style features for the target dialogue text, so that the predicted dialogue style features are not only close to the real person's dialogue style, but also compatible with the previous dialogue style features; speech synthesis processing is performed based on the dialogue style features, so that synthesized speech that is close to the real person's dialogue style and highly compatible with the dialogue scenario can be obtained.

[0141] The speech synthesis method provided in the embodiment of the present application can be applied to various conversation scenarios with speech synthesis requirements. In the conversation scenario, the above conversation speech is the user's conversation speech, and the target conversation text is the response text to the user's conversation speech. Based on this, the embodiment of the present application also provides a conversation processing method. Please refer to Figure 7 , is a flow chart of a conversation processing method provided by an embodiment of the present application, the method comprising the following steps:

[0142] S702, receiving user conversation speech, and determining a phoneme sequence of a response text for the user conversation speech.

[0143] In one embodiment, speech recognition technology may be used to convert the user conversation speech into user conversation text; then, a response text corresponding to the user conversation text is searched from a corpus as the response text for the user conversation speech.

[0144] In another embodiment, speech recognition technology can be used to convert the user conversation speech into user conversation text; then, based on understanding the semantics of the user conversation text, natural language understanding (NLU) technology and natural language generation (NLG) technology are used to generate corresponding response text for the user conversation text as the response text for the user conversation speech.

[0145] S704, extracting the conversation style of the user's conversation speech to obtain the conversation style features.

[0146] The specific implementation of the above S704 is Figure 5 The specific implementation of S504 in the illustrated embodiment is similar and will not be described in detail.

[0147] S706: Based on the above conversation style features and phoneme sequence, perform style prediction on the response text to obtain the conversation style features of the response text.

[0148] The specific implementation of the above S706 is Figure 5 The specific implementation of S506 in the illustrated embodiment is similar and will not be described in detail.

[0149] S708, performing speech synthesis processing based on the dialogue style features and the phoneme sequence, and outputting synthesized speech of the response text.

[0150] The specific implementation of S708 above is Figure 5 The specific implementation of S508 in the illustrated embodiment is similar and will not be described in detail.

[0151] In another embodiment of the present application, if the user dialogue voice is the first user dialogue voice in the process of dialogue with the user, then before the above S102, the dialogue processing method provided in the embodiment of the present application may also include the following steps: obtaining a preset phoneme sequence of the opening remarks text; based on the preset zero vector feature and the phoneme sequence of the opening remarks text, performing style prediction on the opening remarks text to obtain opening style features; performing speech synthesis processing based on the opening style features and the phoneme sequence of the opening remarks text, and outputting the synthesized speech of the opening remarks text.

[0152] In this embodiment, for the synthesized speech of the opening text, style prediction is performed based on the zero vector feature, the first dialogue style feature, and the phoneme sequence, which can maintain the consistency of the scale of the above dialogue style features of all dialogue speech, thereby ensuring the accuracy of the style prediction result.

[0153] The conversation processing method provided by one or more embodiments of the present application utilizes the matching characteristics of the context conversation style, introduces the conversation style of the user conversation speech as the previous conversation style of the response text, extracts the previous conversation style features from the user conversation speech, and on this basis combines the phoneme features to predict the corresponding conversation style features for the response text, so that the predicted conversation style features are not only close to the real person's conversation style, but also adapt to the user's conversation style; speech synthesis processing is performed based on the conversation style features, and a synthesized speech that is close to the real person's conversation style and highly adapted to the user's conversation style can be obtained, thereby improving the quality of conversation with the user and effectively reducing the business risks generated during the conversation with the user.

[0154] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0155] Based on the same inventive concept, the present application also provides a training device for a speech synthesis model. Figure 8 , which is a structural diagram of a speech synthesis model training device 800 provided in one embodiment of the present application, wherein the device 800 includes: a first synthesis unit 810, a first extraction unit 820, a first prediction unit 830 and a training unit 840.

[0156] The first synthesis unit 810 is used to extract a first dialogue style feature from the sample dialogue speech through the skeleton network of the speech synthesis model, and perform speech synthesis processing based on the first dialogue style feature and the phoneme sequence of the dialogue text to obtain a first synthesized speech of the dialogue text, where the dialogue text is the text of the sample dialogue speech.

[0157] The first extraction unit 820 is used to extract the conversation style of the context of the sample conversation speech through the context style encoding network of the speech synthesis model to obtain the context conversation style feature.

[0158] The first prediction unit 830 is used to perform style prediction on the dialogue text based on the above dialogue style feature, the first dialogue style feature and the phoneme sequence through the prediction network of the speech synthesis model to obtain a second dialogue style feature.

[0159] The training unit 840 is used to optimize the speech synthesis model based on the first synthesized speech and the second dialogue style features.

[0160] Obviously, the training device for the speech synthesis model provided in the embodiment of the present application can be used as the above Figure 1 The execution body of the training method of the speech synthesis model shown in FIG. Figure 1 The functions realized are as follows. Since the principles are the same, they will not be described in detail.

[0161] Based on the same inventive concept, the present application also provides a speech synthesis device. Fig. 9, is a structural diagram of a speech synthesis device 900 provided in an embodiment of the present application, the device 900 includes: an acquisition unit 910, a second extraction unit 920, a second prediction unit 930 and a second synthesis unit 940.

[0162] The acquisition unit 910 is used to acquire the phoneme sequence of the target dialogue text to be synthesized and the previous dialogue speech of the target dialogue text.

[0163] The second extraction unit 920 is used to extract the conversation style of the above conversation speech to obtain the above conversation style feature.

[0164] The second prediction unit 930 is used to perform style prediction on the target dialogue text based on the above dialogue style feature and the phoneme sequence to obtain the dialogue style feature of the target dialogue text.

[0165] The second synthesis unit 940 is used to perform speech synthesis processing based on the dialogue style feature and the phoneme sequence to obtain synthesized speech of the target dialogue text.

[0166] Obviously, the speech synthesis device provided in the embodiment of the present application can be used as the above Figure 5 The execution body of the speech synthesis method shown in FIG. Figure 5 The functions realized are as follows. Since the principles are the same, they will not be described in detail.

[0167] Fig.10 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present application. Fig.10 At the hardware level, the electronic device includes a processor, and optionally also includes an internal bus, a network interface, and a memory. The memory may include a memory, such as a high-speed random access memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage. Of course, the electronic device may also include hardware required for other services.

[0168] The processor, network interface and memory can be interconnected through an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.10 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0169] The memory is used to store the program. Specifically, the program may include a program code, and the program code includes a computer operation instruction. The memory may include a memory and a non-volatile memory, and provides instructions and data to the processor.

[0170] The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it, forming a training device for the speech synthesis model at the logical level. The processor executes the program stored in the memory and is specifically used to perform the following operations:

[0171] Extracting a first dialogue style feature from the sample dialogue speech through a skeleton network of a speech synthesis model, and performing speech synthesis processing based on the first dialogue style feature and a phoneme sequence of a dialogue text to obtain a first synthesized speech of the dialogue text, wherein the dialogue text is a text of the sample dialogue speech;

[0172] Extracting the conversation style of the context speech of the sample conversation speech through the context style encoding network of the speech synthesis model to obtain the context conversation style feature;

[0173] By using the prediction network of the speech synthesis model, based on the above dialogue style feature, the first dialogue style feature and the phoneme sequence, the style prediction of the dialogue text is performed to obtain a second dialogue style feature;

[0174] The speech synthesis model is optimized and trained based on the first synthesized speech and the second dialogue style features.

[0175] Alternatively, the processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it, forming a speech synthesis device at the logical level. The processor executes the program stored in the memory and is specifically used to perform the following operations:

[0176] Acquire a phoneme sequence of a target dialogue text to be synthesized and a preceding dialogue speech of the target dialogue text;

[0177] Extracting the conversation style of the above conversation speech to obtain the conversation style features;

[0178] Based on the above dialogue style features and the phoneme sequence, performing style prediction on the target dialogue text to obtain the dialogue style features of the target dialogue text;

[0179] Speech synthesis processing is performed based on the dialogue style features and the phoneme sequence to obtain synthesized speech of the target dialogue text.

[0180] The above application Figure 1 The method performed by the training device of the speech synthesis model disclosed in the embodiment shown, or the above-mentioned method of the present application Figure 5 The method performed by the speech synthesis device disclosed in the illustrated embodiment can be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in the processor or an instruction in the form of software. The above processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application can be directly embodied as being executed by a hardware decoding processor, or can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a mature storage medium in the field such as random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.

[0181] The electronic device may also perform Figure 1 The method and the training device of the speech synthesis model are implemented in Figures 1 to 4 Alternatively, the electronic device may also perform the functions of the embodiments shown. Figure 5 The method and the speech synthesis device are implemented in Figure 5 , Figure 6 , Figure 7 The functions of the illustrated embodiment will not be described in detail in the embodiments of the present application.

[0182] Of course, in addition to software implementation, the electronic device of the present application does not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc. That is to say, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0183] The embodiment of the present application also provides a computer-readable storage medium, which stores one or more programs, wherein the one or more programs include instructions, which, when executed by a portable electronic device including a plurality of application programs, enable the portable electronic device to execute Figure 1 The method of the embodiment shown is specifically used to perform the following operations:

[0184] Extracting a first dialogue style feature from the sample dialogue speech through a skeleton network of a speech synthesis model, and performing speech synthesis processing based on the first dialogue style feature and a phoneme sequence of a dialogue text to obtain a first synthesized speech of the dialogue text, wherein the dialogue text is a text of the sample dialogue speech;

[0185] Extracting the conversation style of the context speech of the sample conversation speech through the context style encoding network of the speech synthesis model to obtain the context conversation style feature;

[0186] By using the prediction network of the speech synthesis model, based on the above dialogue style feature, the first dialogue style feature and the phoneme sequence, the style prediction of the dialogue text is performed to obtain a second dialogue style feature;

[0187] The speech synthesis model is optimized and trained based on the first synthesized speech and the second dialogue style features.

[0188] Alternatively, when the instruction is executed by a portable electronic device including a plurality of application programs, the portable electronic device can execute Figure 5 The method of the embodiment shown is specifically used to perform the following operations:

[0189] Acquire a phoneme sequence of a target dialogue text to be synthesized and a preceding dialogue speech of the target dialogue text;

[0190] Extracting the conversation style of the above conversation speech to obtain the conversation style features;

[0191] Based on the above dialogue style features and the phoneme sequence, performing style prediction on the target dialogue text to obtain the dialogue style features of the target dialogue text;

[0192] Speech synthesis processing is performed based on the dialogue style features and the phoneme sequence to obtain synthesized speech of the target dialogue text.

[0193] An embodiment of the present application also provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute part or all of the steps in the training method of the speech synthesis model or the speech synthesis method provided in the embodiment of the present application.

[0194] In short, the above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

[0195] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.

[0196] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0197] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0198] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

Claims

1. A method for training a speech synthesis model, characterized in that: include: Extracting a first dialogue style feature from the sample dialogue speech through a skeleton network of a speech synthesis model, and performing speech synthesis processing based on the first dialogue style feature and a phoneme sequence of a dialogue text to obtain a first synthesized speech of the dialogue text, wherein the dialogue text is a text of the sample dialogue speech; Extracting the conversation style of the context speech of the sample conversation speech through the context style encoding network of the speech synthesis model to obtain the context conversation style feature; By using the prediction network of the speech synthesis model, based on the above dialogue style feature, the first dialogue style feature and the phoneme sequence, the style prediction of the dialogue text is performed to obtain a second dialogue style feature; The speech synthesis model is optimized and trained based on the first synthesized speech and the second dialogue style features.

2. The method according to claim 1, characterized in that The above-mentioned dialogue style feature includes the above-mentioned voice style feature, the first dialogue style feature includes the first voice style feature, and the second dialogue style feature includes the second voice style feature and the second prosody feature; The step of performing style prediction on the dialogue text based on the above dialogue style feature, the first dialogue style feature, and the phoneme sequence to obtain a second dialogue style feature includes: extracting prosodic text features from the phoneme sequence; Based on the prosodic text feature, the previous text voice style feature and the first voice style feature, the voice style prediction of the dialogue text is performed to obtain the second voice style feature; Based on the second voice style feature and the prosodic text feature, prosody prediction is performed on the dialogue text to obtain the second prosodic feature.

3. The method according to claim 2, characterized in that The prosodic text feature includes a prosodic text sub-feature of each phoneme in the phoneme sequence; The step of performing speech style prediction on the dialogue text based on the prosodic text feature, the previous dialogue style feature, and the first speech style feature to obtain the second speech style feature includes: Concatenate the prosodic text sub-feature of each phoneme in the phoneme sequence with the above speech style feature to obtain a concatenated feature; Based on the concatenated feature and the first voice style feature, voice style prediction is performed on the dialogue text to obtain the second voice style feature.

4. The method according to claim 1, characterized in that: The performing speech synthesis processing based on the first dialogue style feature and the phoneme sequence of the dialogue text to obtain a first synthesized speech of the dialogue text includes: Performing text encoding on the phoneme sequence to obtain phoneme features; Extracting spectral features from the sample conversation speech; Performing alignment processing on the phoneme features based on the frequency spectrum features to obtain aligned phoneme features; Speech synthesis processing is performed based on the aligned phoneme features and the first dialogue style features to obtain the first synthesized speech.

5. The method according to claim 4, characterized in that The aligning process of the phoneme features based on the spectrum features to obtain aligned phoneme features includes: Performing an alignment process between the spectral feature and the phoneme feature to obtain an alignment matrix; A dot product operation is performed on the phoneme feature and the alignment matrix to obtain the aligned phoneme feature.

6. The method according to claim 1, characterized in that The optimizing and training the speech synthesis model based on the first synthesized speech and the second dialogue style feature includes: Based on the difference information between the first synthesized speech and the sample conversation speech, performing N optimization trainings on the skeleton network, and using the skeleton network after the N-th optimization training as a candidate skeleton network, where N is an integer greater than 1; Extracting a first dialogue style feature from the sample dialogue speech through the candidate skeleton network, and performing speech synthesis processing based on the currently extracted first dialogue style feature and the phoneme sequence to obtain a first synthesized speech of the dialogue text; Based on the difference information between the sample conversation speech and the first synthesized speech obtained by the candidate skeleton network, and the difference information between the second conversation style feature obtained by the prediction network and the first conversation style feature obtained by the candidate skeleton network, the candidate skeleton network and the prediction network are optimized and trained M times, where M is an integer greater than 1.

7. The method according to claim 1, characterized in that Before extracting the conversation style of the context conversation speech of the sample conversation speech through the context style encoding network of the speech synthesis model, the method further includes: Extracting a third speech style feature from the sample conversation speech through a speech style encoding network of the base model, and extracting a third prosody feature from the sample conversation speech through a feature extraction network of the base model; Performing speech synthesis processing based on the third speech style feature, the third prosodic feature and the phoneme sequence through the decoding network of the basic model to obtain a second synthesized speech of the dialogue text; Performing prosody prediction on the dialogue text based on the third prosody feature and the phoneme sequence through the prediction network of the basic model to obtain a fourth prosody feature; Based on the difference information between the second synthesized speech and the sample conversation speech, and the difference information between the third prosodic feature and the fourth prosodic feature, optimizing and training the basic model; The speech style coding network in the optimized trained basic model is used as the above style coding network.

8. The method according to any one of claims 1 to 7, characterized in that The sample conversation voice is a customer service voice obtained from a historical conversation, and the preceding conversation voice is a preceding user voice of the customer service voice; In the case where the sample conversation speech is the first customer service speech in the historical conversation, the second conversation style feature is obtained by performing style prediction in the following manner: The prediction network is used to perform style prediction on the dialogue text based on the zero vector feature, the first dialogue style feature, and the phoneme sequence to obtain the second dialogue style feature.

9. A speech synthesis method, characterized in that: include: Acquire a phoneme sequence of a target dialogue text to be synthesized and a preceding dialogue speech of the target dialogue text; Extracting the conversation style of the above conversation speech to obtain the conversation style features; Based on the above dialogue style features and the phoneme sequence, performing style prediction on the target dialogue text to obtain the dialogue style features of the target dialogue text; Speech synthesis processing is performed based on the dialogue style features and the phoneme sequence to obtain synthesized speech of the target dialogue text.

10. The method according to claim 9, characterized in that The dialogue style features include voice style features and prosody features; The method of performing style prediction on the target dialogue text based on the above dialogue style features and the phoneme sequence to obtain the dialogue style features of the target dialogue text includes: extracting prosodic text features from the phoneme sequence; Based on the prosodic text feature and the previous conversation style feature, performing speech style prediction on the target conversation text to obtain the speech style feature; Based on the speech style features and the prosodic text features, prosody prediction is performed on the target dialogue text to obtain the prosodic features.

11. The method according to claim 10, characterized in that The prosodic text feature includes a prosodic text sub-feature of each phoneme in the phoneme sequence; The method of performing speech style prediction on the target dialogue text based on the prosodic text feature and the previous dialogue style feature to obtain the speech style feature includes: Concatenating the prosodic text sub-feature of each phoneme in the phoneme sequence with the above-mentioned dialogue style feature to obtain a concatenated feature; The speech style of the target dialogue text is predicted based on the concatenated features to obtain the speech style features.

12. The method according to claim 10, characterized in that The rhythmic features include at least one of a pitch feature and a volume feature and a length feature; The performing speech synthesis processing based on the dialogue style feature and the phoneme sequence to obtain the synthesized speech of the target dialogue text includes: Performing text encoding on the phoneme sequence to obtain phoneme features; Performing alignment processing on the phoneme features based on the sound length features to obtain aligned phoneme features; The synthesized speech is obtained by performing speech synthesis processing based on at least one of the pitch feature and the volume feature, the aligned phoneme feature value, and the speech style feature.

13. The method according to claim 12, characterized in that The aligning process of the phoneme features based on the sound length features to obtain aligned phoneme features includes: Upsampling the tone length feature to obtain an alignment matrix; A dot product operation is performed on the phoneme feature and the alignment matrix to obtain the aligned phoneme feature.

14. The method according to any one of claims 9 to 13, characterized in that Before performing style prediction on the target dialogue text based on the above dialogue style features and the phoneme sequence to obtain the dialogue style features of the target dialogue text, the method further includes: If the preceding conversation speech of the target conversation text is not obtained, the preset zero vector feature is used as the preceding conversation style feature.

15. A training device for a speech synthesis model, characterized in that: include: A first synthesis unit is used to extract a first dialogue style feature from the sample dialogue speech through a skeleton network of a speech synthesis model, and perform speech synthesis processing based on the first dialogue style feature and a phoneme sequence of a dialogue text to obtain a first synthesized speech of the dialogue text, wherein the dialogue text is a text of the sample dialogue speech; A first extraction unit is used to extract the conversation style of the context of the sample conversation speech through the context style encoding network of the speech synthesis model to obtain the context conversation style feature; A first prediction unit is configured to perform style prediction on the dialogue text based on the above dialogue style feature, the first dialogue style feature and the phoneme sequence through a prediction network of the speech synthesis model to obtain a second dialogue style feature; A training unit is used to optimize the speech synthesis model based on the first synthesized speech and the second dialogue style features.

16. A speech synthesis device, characterized in that: include: An acquisition unit, used for acquiring a phoneme sequence of a target dialogue text to be synthesized and a preceding dialogue speech of the target dialogue text; A second extraction unit is used to extract the conversation style of the above conversation speech to obtain the above conversation style feature; A second prediction unit is used to perform style prediction on the target dialogue text based on the above dialogue style feature and the phoneme sequence to obtain the dialogue style feature of the target dialogue text; The second synthesis unit is used to perform speech synthesis processing based on the dialogue style features and the phoneme sequence to obtain the synthesized speech of the target dialogue text.

17. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the training method of the speech synthesis model as described in any one of claims 1 to 8; or, the processor is configured to execute the instructions to implement the speech synthesis method as described in any one of claims 9 to 14.

18. A computer-readable storage medium, characterized in that: When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the training method of the speech synthesis model as described in any one of claims 1 to 8; or, when the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the speech synthesis method as described in any one of claims 9 to 14.

19. A computer program product, characterized in that The computer program product comprises a non-transitory computer-readable storage medium storing a computer program, wherein the computer program is operable to cause a computer to execute part or all of the steps in the method according to any one of claims 1 to 8 or any one of claims 9 to 14.