WO2022121158A1 - Speech synthesis method and apparatus, and electronic device and storage medium - Google Patents

Speech synthesis method and apparatus, and electronic device and storage medium Download PDF

Info

Publication number
WO2022121158A1
WO2022121158A1 PCT/CN2021/083186 CN2021083186W WO2022121158A1 WO 2022121158 A1 WO2022121158 A1 WO 2022121158A1 CN 2021083186 W CN2021083186 W CN 2021083186W WO 2022121158 A1 WO2022121158 A1 WO 2022121158A1
Authority
WO
WIPO (PCT)
Prior art keywords
character
vector
attention
sequence
feature
Prior art date
Application number
PCT/CN2021/083186
Other languages
French (fr)
Chinese (zh)
Inventor
孙奥兰
王健宗
程宁
Original Assignee
平安科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2022121158A1 publication Critical patent/WO2022121158A1/en

Links

Images

Classifications

    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
    • G10L13/00Speech synthesis; Text to speech systems
    • G10L13/02Methods for producing synthetic speech; Speech synthesisers
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
    • G10L13/00Speech synthesis; Text to speech systems
    • G10L13/02Methods for producing synthetic speech; Speech synthesisers
    • G10L13/04Details of speech synthesis systems, e.g. synthesiser structure or memory management
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
    • G10L13/00Speech synthesis; Text to speech systems
    • G10L13/08Text analysis or generation of parameters for speech synthesis out of text, e.g. grapheme to phoneme translation, prosody generation or stress or intonation determination

Definitions

  • the present application relates to the field of speech synthesis, and in particular, to a speech synthesis method, apparatus, electronic device, and computer-readable storage medium.
  • a speech synthesis method comprising:
  • Receive character text carry out pinyin replacement of described character text, obtain character pinyin, utilize pre-built alphabet, calculate the character position of described character pinyin in described alphabet;
  • the attention feature model includes a multi-head attention network and a character feature extraction network
  • the character vector is input into a pre-built pronunciation pause prediction model to obtain a pronunciation pause sequence
  • Residual connection is performed on the character feature sequence and the pronunciation pause sequence to obtain a speech sequence, and a pre-built vocode synthesizer is used to perform speech synthesis on the speech sequence to obtain the synthesized speech of the character text.
  • a speech synthesis device comprising:
  • a character vector building module is used to receive character text, replace the character text with pinyin, obtain character pinyin, and use a pre-built alphabet to calculate the character position of the character pinyin in the alphabet, and to calculate the character position of the character And described character pinyin performs encoding operation, obtains character vector;
  • a character feature sequence extraction module for inputting the character vector into the pre-trained attention feature model, wherein the attention feature model includes a multi-head attention network and a character feature extraction network, using the multi-head attention network Perform attention calculation on the character vector to obtain an attention vector, perform residual connection on the attention vector and the character vector to obtain a character attention vector, and use the character feature extraction network to pay attention to the character
  • the force vector performs feature extraction to obtain character feature sequences
  • a pronunciation pause sequence extraction module for inputting the character vector into a pre-built pronunciation pause prediction model to obtain a pronunciation pause sequence
  • a speech synthesis module for performing residual connection on the character feature sequence and the pronunciation pause sequence to obtain a speech sequence, and using a pre-built vocoder to perform speech synthesis on the speech sequence to obtain the character text synthesized speech.
  • An electronic device comprising:
  • a processor that executes the instructions stored in the memory to achieve the following steps:
  • Receive character text carry out pinyin replacement of described character text, obtain character pinyin, utilize pre-built alphabet, calculate the character position of described character pinyin in described alphabet;
  • the attention feature model includes a multi-head attention network and a character feature extraction network
  • the character vector is input into a pre-built pronunciation pause prediction model to obtain a pronunciation pause sequence
  • Residual connection is performed on the character feature sequence and the pronunciation pause sequence to obtain a speech sequence, and a pre-built vocode synthesizer is used to perform speech synthesis on the speech sequence to obtain the synthesized speech of the character text.
  • a computer-readable storage medium comprising a storage data area and a storage program area, the storage data area stores data created, and the storage program area stores a computer program; wherein, the computer program is executed by a processor The following steps are implemented:
  • Receive character text carry out pinyin replacement of described character text, obtain character pinyin, utilize pre-built alphabet, calculate the character position of described character pinyin in described alphabet;
  • the attention feature model includes a multi-head attention network and a character feature extraction network
  • the character vector is input into a pre-built pronunciation pause prediction model to obtain a pronunciation pause sequence
  • Residual connection is performed on the character feature sequence and the pronunciation pause sequence to obtain a speech sequence, and a pre-built vocode synthesizer is used to perform speech synthesis on the speech sequence to obtain the synthesized speech of the character text.
  • the present application can solve the problem that the synthesized speech is not smooth and natural enough.
  • FIG. 1 is a schematic flowchart of a speech synthesis method provided by an embodiment of the present application.
  • FIG. 2 is a detailed schematic flowchart of S6 in a speech synthesis method provided by an embodiment of the present application
  • FIG. 3 is a schematic block diagram of a speech synthesis apparatus provided by an embodiment of the present application.
  • FIG. 4 is a schematic diagram of an internal structure of an electronic device for implementing a speech synthesis method provided by an embodiment of the present application
  • the embodiments of the present application provide a speech synthesis method, and the execution subject of the speech synthesis method includes, but is not limited to, at least one of electronic devices that can be configured to execute the method provided by the embodiments of the present application, such as a server and a terminal.
  • the speech synthesis method can be executed by software or hardware installed in a terminal device or a server device, and the software can be a blockchain platform.
  • the server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, and the like.
  • the speech synthesis method includes:
  • the character text input by the user is acceptable, for example, the user input character text A: "Hello, today's trip is accompanied by heavy rain and strong wind, please pay attention to safety". Then described character text A is carried out phonetic replacement, obtain character phonetic B: " nihao, jintianchuxingbanyoubaoyukuangfeng, qingzhuyianquan ", wherein in the embodiment of the application, described character text is carried out phonetic replacement, obtain character phonetic, comprise: utilize JAVA Pinyin4j in the language, builds a pinyin replacement program; uses the pinyin replacement program to perform pinyin replacement on the character text to obtain the character pinyin.
  • pinyin4j is located in net.sourceforge.pinyin4j in JAVA language, so use import net.sourceforge.pinyin4j to import pinyin4j to obtain the pinyin replacement program.
  • the alphabet is constructed by using pinyin.
  • a corresponds to 1
  • b corresponds to 2
  • c corresponds to 3
  • the above-mentioned character pinyin B "nihao, jintianchuxingbanyoubaoyukuangfeng, qingzhuyianquan" uses the The alphabet is constructed to obtain character positions including numbers.
  • the embodiment of the present application adopts a one-hot encoding method to perform encoding operations on the character position and the character pinyin to obtain a character vector.
  • the attention feature model before performing the S3, the attention feature model needs to be trained.
  • the training of the attention feature model includes:
  • Step A constructing an attention feature model to be trained including the multi-head attention network and the character feature extraction network.
  • the step A includes: constructing the multi-head attention network according to a multi-head attention mechanism; constructing the character feature extraction network according to a convolutional neural network; combining the multi-head attention network and the character feature extraction network, The attention feature model to be trained is obtained.
  • constructing the multi-head attention network according to the multi-head attention mechanism includes: receiving a trained Transform model, extracting an encoder from the Transform model, and using the multi-head attention mechanism in the encoder to construct Get the multi-head attention network.
  • the user can train and complete the Transform model in advance.
  • the Transform model is a deep learning model that can realize classification or fitting, including an encoder and a decoder, wherein the encoder includes a multi-head attention mechanism.
  • the network layer where the multi-head attention mechanism is located is extracted to construct the multi-head attention network.
  • the attention feature model to be trained is obtained by combining.
  • Step B Receive a training text set and a training label set, input the training text set into the attention feature model to be trained for feature extraction, and obtain a feature sequence training set.
  • the training text set is a text set collected and sorted out by a user in advance
  • the training label set is a voice set corresponding to the training text set.
  • Obtaining a feature sequence training set includes: performing pinyin replacement on the training text set to obtain a pinyin training set, calculating the character positions of the pinyin training set in the alphabet, obtaining a position training set, and comparing the pinyin training set and Perform an encoding operation on the position training set to obtain a vector training set, and use the multi-head attention network to perform an attention calculation on the vector training set to obtain an attention vector set; train the attention vector set and the vector training set Perform residual connection on the set to obtain an attention vector training set; use the character feature extraction network to perform feature extraction on the attention vector training set to obtain the feature sequence training set.
  • attention calculation is performed on the vector training set to obtain the attention vector set.
  • the present application uses the following formula to perform residual connection on the attention vector set and the vector training set:
  • result attention represents the attention vector training set
  • s represents the attention vector set
  • p represents the vector training set
  • the convolution operation in the character feature extraction network is used to sequentially perform feature extraction on each attention vector in the attention vector training set, and then the feature sequence training set is obtained.
  • the convolution operation is a convolution calculation operation based on a convolution kernel, and the size of the convolution kernel is set to 3*3 in this application, so as to obtain the feature sequence training set.
  • Step C Build multiple linear activation layers.
  • the present application constructs a linear activation layer to help the attention feature model to be trained for model training, wherein the linear activation layer includes normalization and activation function, and the activation function can use a Gaussian distribution function.
  • Step D use the multi-layer linear activation layer to perform an activation operation on the feature sequence training set to obtain a prediction sequence set.
  • using the multi-layer linear activation layer to perform an activation operation on the feature sequence training set to obtain a prediction sequence set includes: performing normalization on the feature sequence training set to obtain a feature sequence normalized set , using the Gaussian distribution function to calculate the Gaussian distribution of the normalized set of feature sequences, and obtain the predicted sequence set according to the Gaussian distribution.
  • the normalization is an operation of mapping the values in the feature sequence training set to a specified range. For example, mapping the values in the feature sequence training set to the [0,1] range, it can Scale down the values to reduce computational stress.
  • calculating the Gaussian distribution of the normalized set of feature sequences by using the Gaussian distribution function includes: using the Gaussian distribution function to calculate the mean and variance of the normalized set of feature sequences, and using the Gaussian distribution function to calculate the mean and variance of the normalized set of feature sequences. The mean and variance of the normalized set of feature sequences are calculated, and the Gaussian distribution of the normalized set of feature sequences is obtained.
  • the Gaussian distribution represents the probability distribution of data within a specified range
  • the maximum probability distribution of the training set of feature sequences is found from the Gaussian distribution, that is, the set of prediction sequences is obtained.
  • Step E Calculate the error value between the predicted sequence set and the training label set, and determine the magnitude relationship between the error value and a preset error threshold.
  • the squared difference formula is used to calculate the error value between the predicted sequence set and the training label set.
  • Step F If the error value is greater than the error threshold, adjust the internal parameters of the attention feature model to be trained, and return to Step B.
  • Step G If the error value is less than or equal to the error threshold, obtain the attention feature models of the multi-head attention network and the character feature extraction network.
  • the error value is less than or equal to the error threshold, it indicates that the attention feature model to be trained has strong character feature extraction capability, and the training is completed to obtain the attention feature model.
  • the character vector can be input into the pre-trained attention feature model.
  • the training stages in S4 and S3 are similar, and both use the principle of the multi-head attention mechanism of the encoder in the Transform model to perform the attention calculation to obtain the attention vector.
  • character attention represents the character attention vector
  • m represents the attention vector
  • u represents the character vector
  • the S6 includes:
  • the normalization is as described above, the operation of mapping the value in the character attention vector to a specified range.
  • the value in the character attention vector is mapped to the range of [0, 1]. .
  • performing a convolution operation on the normalized vector to obtain a character convolution vector includes: constructing a convolution kernel according to a preset convolution kernel dimension; using the convolution kernel to perform a convolution operation on the normalized vector Convolution operation to obtain the character convolution vector.
  • the residual connection is the same as the above, and the character convolution vector and the character attention vector are correspondingly added to obtain the character feature sequence.
  • the pronunciation pause prediction model is formed based on a plurality of fast Fourier transform modules.
  • 10 fast Fourier transform modules are used to form the pronunciation pause prediction model.
  • the S7 includes: transforming the character pinyin into a word vector to obtain a pinyin vector; inputting the pinyin vector and the character vector into the pronunciation pause prediction model, and using the pronunciation pause prediction model for all Perform Fourier transform on the pinyin vector and the character vector to obtain a Fourier transform sequence; perform pronunciation pause prediction on the Fourier transform sequence to obtain the pronunciation pause sequence.
  • the fast Fourier transform is a fast algorithm of discrete Fourier transform (DFT), which can predict the Fourier transform sequence corresponding to the character vector and the pinyin vector, wherein the Fourier transform sequence includes speech frequency, Amplitude and phase, and the articulation pause sequence can be obtained through the Fourier transform sequence.
  • DFT discrete Fourier transform
  • the vocoder is a decoder that can realize speech synthesis, including a channel vocoder, a formant vocoder, a pattern vocoder, a linear prediction vocoder, encoder, quadrature function vocoder, etc.
  • the synthesized speech of the character text can be obtained by inputting the speech sequence into the vocoding synthesizer.
  • speech synthesis is performed in two parts. First, a pre-trained attention feature model is used to perform feature extraction on character text to obtain character feature sequences. Second, a pronunciation pause prediction model is used to predict the pronunciation pause sequence of character text. Finally, the character feature sequence and the pronunciation pause sequence are performed residual connection to obtain a speech sequence, and a pre-built vocode synthesizer is used to perform speech synthesis on the speech sequence to obtain the synthesized speech of the character text.
  • the present application not only predicts the character feature sequence, but also adds the prediction process of the pronunciation pause sequence, so the synthesized speech is closer to natural in frequency amplitude, etc. Human voice, so the speech synthesis method, device and computer-readable storage medium proposed in this application can solve the problem that the synthesized speech is not smooth and natural enough.
  • FIG. 3 it is a block diagram of the speech synthesis apparatus of the present application.
  • the speech synthesis apparatus 100 described in this application can be installed in an electronic device.
  • the speech synthesis apparatus may include a character vector construction module 101 , a character feature sequence extraction module 102 , a pronunciation pause sequence extraction module 103 and a speech synthesis module 104 .
  • the modules described in the present invention can also be called units, which refer to a series of computer program segments that can be executed by the electronic device processor and can perform fixed functions, and are stored in the memory of the electronic device.
  • each module/unit is as follows:
  • the character vector construction module 101 is used for receiving character text, performing pinyin substitution on the character text to obtain the character pinyin, and calculating the character position of the character pinyin in the alphabet using a pre-built alphabet, and for all the characters in the alphabet. Describe character position and described character pinyin to carry out encoding operation, obtain character vector;
  • the character feature sequence extraction module 102 is configured to input the character vector into a pre-trained attention feature model, wherein the attention feature model includes a multi-head attention network and a character feature extraction network, using the multi-head attention network
  • the attention network performs attention calculation on the character vector, obtains the attention vector, performs residual connection on the attention vector and the character vector, obtains the character attention vector, and uses the character feature extraction network to extract the character. Perform feature extraction on the character attention vector to obtain a character feature sequence;
  • the pronunciation pause sequence extraction module 103 is used to input the character vector into a pre-built pronunciation pause prediction model to obtain a pronunciation pause sequence;
  • the speech synthesis module 104 is used to perform residual connection on the character feature sequence and the pronunciation pause sequence to obtain a speech sequence, and use a pre-built vocoder to perform speech synthesis on the speech sequence to obtain the speech sequence. Synthesized speech for character text.
  • Each module in the speech synthesis apparatus 100 provided by the embodiment of the present application can use the same means as the above-mentioned speech synthesis method, and the specific implementation steps will not be repeated here.
  • the technical effect is the same as that of the above-mentioned speech synthesis method, that is, the problem that the synthesized speech is not smooth and natural is solved.
  • FIG. 4 it is a schematic structural diagram of an electronic device implementing the speech synthesis method of the present application.
  • the electronic device 1 may include a processor 10, a memory 11 and a bus, and may also include a computer program stored in the memory 11 and executable on the processor 10, such as a speech synthesis program 12.
  • the memory 11 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, mobile hard disk, multimedia card, card-type memory (for example: SD or DX memory, etc.), magnetic memory, magnetic disk, CD etc.
  • the memory 11 may be an internal storage unit of the electronic device 1 in some embodiments, such as a mobile hard disk of the electronic device 1 .
  • the memory 11 may also be an external storage device of the electronic device 1, such as a pluggable mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital) equipped on the electronic device 1. , SD) card, flash memory card (Flash Card), etc.
  • the memory 11 may also include both an internal storage unit of the electronic device 1 and an external storage device.
  • the memory 11 can not only be used to store application software installed in the electronic device 1 and various types of data, such as the code of the speech synthesis program 12, etc., but also can be used to temporarily store data that has been output or will be output.
  • the processor 10 may be composed of integrated circuits, for example, may be composed of a single packaged integrated circuit, or may be composed of multiple integrated circuits packaged with the same function or different functions, including one or more integrated circuits.
  • Central Processing Unit CPU
  • microprocessor digital processing chip
  • graphics processor and combination of various control chips, etc.
  • the processor 10 is the control core (Control Unit) of the electronic device, and uses various interfaces and lines to connect the various components of the entire electronic device, by running or executing the program or module (for example, executing the program) stored in the memory 11. speech synthesis program, etc.), and call data stored in the memory 11 to execute various functions of the electronic device 1 and process data.
  • the bus may be a peripheral component interconnect (PCI for short) bus or an extended industry standard architecture (Extended industry standard architecture, EISA for short) bus or the like.
  • PCI peripheral component interconnect
  • EISA Extended industry standard architecture
  • the bus can be divided into address bus, data bus, control bus and so on.
  • the bus is configured to implement connection communication between the memory 11 and at least one processor 10 and the like.
  • FIG. 4 only shows an electronic device with components. Those skilled in the art can understand that the structure shown in FIG. 4 does not constitute a limitation on the electronic device 1, and may include fewer or more components than those shown in the drawings. components, or a combination of certain components, or a different arrangement of components.
  • the electronic device 1 may also include a power supply (such as a battery) for powering the various components, preferably, the power supply may be logically connected to the at least one processor 10 through a power management device, so that the power management
  • the device implements functions such as charge management, discharge management, and power consumption management.
  • the power source may also include one or more DC or AC power sources, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, and any other components.
  • the electronic device 1 may further include various sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.
  • the electronic device 1 may also include a network interface, optionally, the network interface may include a wired interface and/or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is usually used in the electronic device 1 Establish a communication connection with other electronic devices.
  • a network interface optionally, the network interface may include a wired interface and/or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is usually used in the electronic device 1 Establish a communication connection with other electronic devices.
  • the electronic device 1 may further include a user interface, and the user interface may be a display (Display), an input unit (eg, a keyboard (Keyboard)), optionally, the user interface may also be a standard wired interface or a wireless interface.
  • the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode, organic light-emitting diode) touch device, and the like.
  • the display may also be appropriately called a display screen or a display unit, which is used for displaying information processed in the electronic device 1 and for displaying a visualized user interface.
  • the speech synthesis program 12 stored in the memory 11 in the electronic device 1 is a combination of multiple instructions, and when running in the processor 10, it can realize:
  • Receive character text carry out pinyin replacement of described character text, obtain character pinyin, utilize pre-built alphabet, calculate the character position of described character pinyin in described alphabet;
  • the attention feature model includes a multi-head attention network and a character feature extraction network
  • the character vector is input into a pre-built pronunciation pause prediction model to obtain a pronunciation pause sequence
  • Residual connection is performed on the character feature sequence and the pronunciation pause sequence to obtain a speech sequence, and a pre-built vocode synthesizer is used to perform speech synthesis on the speech sequence to obtain the synthesized speech of the character text.
  • the modules/units integrated in the electronic device 1 may be stored in a computer-readable storage medium.
  • the computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, removable hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory) .
  • the computer usable storage medium may mainly include a stored program area and a stored data area, wherein the stored program area may store an operating system, an application program required for at least one function, and the like; using the created data, etc.
  • the present application also provides a computer-readable storage medium.
  • the computer-readable storage medium may be volatile or non-volatile.
  • the readable storage medium stores a computer program, and the computer program is stored in the When executed by the processor of the electronic device, it can achieve:
  • Receive character text carry out pinyin replacement of described character text, obtain character pinyin, utilize pre-built alphabet, calculate the character position of described character pinyin in described alphabet;
  • the attention feature model includes a multi-head attention network and a character feature extraction network
  • the character vector is input into a pre-built pronunciation pause prediction model to obtain a pronunciation pause sequence
  • Residual connection is performed on the character feature sequence and the pronunciation pause sequence to obtain a speech sequence, and a pre-built vocode synthesizer is used to perform speech synthesis on the speech sequence to obtain the synthesized speech of the character text.
  • modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
  • each functional module in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units can be implemented in the form of hardware, or can be implemented in the form of hardware plus software function modules.
  • the blockchain referred to in this application is a new application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm.
  • Blockchain essentially a decentralized database, is a series of data blocks associated with cryptographic methods. Each data block contains a batch of network transaction information to verify its Validity of information (anti-counterfeiting) and generation of the next block.
  • the blockchain can include the underlying platform of the blockchain, the platform product service layer, and the application service layer.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computational Linguistics (AREA)
  • Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • Acoustics & Sound (AREA)
  • Multimedia (AREA)
  • Machine Translation (AREA)

Abstract

A speech synthesis method and a speech synthesis apparatus (100), and an electronic device (1) and a storage medium. The method comprises: obtaining a character vector, and performing attention calculation on the character vector by using a multi-head attention network to obtain an attention vector (S4); performing a residual connection on the attention vector and the character vector to obtain a character attention vector (S5); performing feature extraction on the character attention vector by using a character feature extraction network to obtain a character feature sequence (S6); and inputting the character vector into a pre-built pronunciation pause prediction model to obtain a pronunciation pause sequence (S7); performing a residual connection on the character feature sequence and the pronunciation pause sequence to obtain a speech sequence, and performing speech synthesis on the speech sequence by using a pre-built vocoder to obtain a synthesized speech of a character text (S8). The problem that the synthesized speech is not smooth and natural enough can be solved.

Description

语音合成方法、装置、电子设备及存储介质Speech synthesis method, device, electronic device and storage medium
本申请要求于2020年12月11日提交中国专利局、申请号为CN202011452787.7,发明名称为“语音合成方法、装置、电子设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application filed on December 11, 2020 with the application number CN202011452787.7 and the title of the invention is "Speech Synthesis Method, Device, Electronic Device and Storage Medium", the entire content of which is approved by Reference is incorporated in this application.
技术领域technical field
本申请涉及语音合成领域,尤其涉及一种语音合成方法、装置、电子设备及计算机可读存储介质。The present application relates to the field of speech synthesis, and in particular, to a speech synthesis method, apparatus, electronic device, and computer-readable storage medium.
背景技术Background technique
随着深度学习的迅速发展,基于深度学习网络的语音合成方法如雨后春笋般涌现,发明人意识到目前常用的语音合成方法包括LSTM合成法、BERT合成法等,虽然此类方法都可实现语音合成,但由于缺乏对语音自然度及流畅度的改善,导致出现所合成出的语音不够平滑及自然的问题。With the rapid development of deep learning, speech synthesis methods based on deep learning networks have sprung up. The inventor realized that the commonly used speech synthesis methods include LSTM synthesis method, BERT synthesis method, etc. Although these methods can realize speech synthesis However, due to the lack of improvement of speech naturalness and fluency, the synthesized speech is not smooth and natural.
发明内容SUMMARY OF THE INVENTION
一种语音合成方法,包括:A speech synthesis method, comprising:
接收字符文本,将所述字符文本进行拼音置换,得到字符拼音,利用预构建的字母表,计算所述字符拼音在所述字母表的字符位置;Receive character text, carry out pinyin replacement of described character text, obtain character pinyin, utilize pre-built alphabet, calculate the character position of described character pinyin in described alphabet;
对所述字符位置及所述字符拼音执行编码操作,得到字符向量;performing encoding operation on the character position and the character pinyin to obtain a character vector;
将所述字符向量输入至预训练完成的注意力特征模型中,其中所述注意力特征模型包括多头注意力网络、字符特征提取网络;Inputting the character vector into the pre-trained attention feature model, wherein the attention feature model includes a multi-head attention network and a character feature extraction network;
利用所述多头注意力网络对所述字符向量执行注意力计算,得到注意力向量;Use the multi-head attention network to perform attention calculation on the character vector to obtain an attention vector;
对所述注意力向量及所述字符向量执行残差连接,得到字符注意力向量;performing residual connection on the attention vector and the character vector to obtain a character attention vector;
利用所述字符特征提取网络,对所述字符注意力向量执行特征提取,得到字符特征序列;Using the character feature extraction network to perform feature extraction on the character attention vector to obtain a character feature sequence;
将所述字符向量输入至预构建的发音停顿预测模型,得到发音停顿序列;The character vector is input into a pre-built pronunciation pause prediction model to obtain a pronunciation pause sequence;
将所述字符特征序列及所述发音停顿序列执行残差连接,得到语音序列,利用预构建的声码合成器,对所述语音序列执行语音合成,得到所述字符文本的合成语音。Residual connection is performed on the character feature sequence and the pronunciation pause sequence to obtain a speech sequence, and a pre-built vocode synthesizer is used to perform speech synthesis on the speech sequence to obtain the synthesized speech of the character text.
一种语音合成装置,所述装置包括:A speech synthesis device, the device comprising:
字符向量构建模块,用于接收字符文本,将所述字符文本进行拼音置换,得到字符拼音,利用预构建的字母表,计算所述字符拼音在所述字母表的字符位置,对所述字符位置及所述字符拼音执行编码操作,得到字符向量;A character vector building module is used to receive character text, replace the character text with pinyin, obtain character pinyin, and use a pre-built alphabet to calculate the character position of the character pinyin in the alphabet, and to calculate the character position of the character And described character pinyin performs encoding operation, obtains character vector;
字符特征序列提取模块,用于将所述字符向量输入至预训练完成的注意力特征模型中,其中所述注意力特征模型包括多头注意力网络、字符特征提取网络,利用所述多头注意力网络对所述字符向量执行注意力计算,得到注意力向量,对所述注意力向量及所述字符向量执行残差连接,得到字符注意力向量,利用所述字符特征提取网络,对所述字符注意力向量执行特征提取,得到字符特征序列;A character feature sequence extraction module for inputting the character vector into the pre-trained attention feature model, wherein the attention feature model includes a multi-head attention network and a character feature extraction network, using the multi-head attention network Perform attention calculation on the character vector to obtain an attention vector, perform residual connection on the attention vector and the character vector to obtain a character attention vector, and use the character feature extraction network to pay attention to the character The force vector performs feature extraction to obtain character feature sequences;
发音停顿序列提取模块,用于将所述字符向量输入至预构建的发音停顿预测模型,得到发音停顿序列;A pronunciation pause sequence extraction module, for inputting the character vector into a pre-built pronunciation pause prediction model to obtain a pronunciation pause sequence;
语音合成模块,用于将所述字符特征序列及所述发音停顿序列执行残差连接,得到语音序列,利用预构建的声码合成器,对所述语音序列执行语音合成,得到所述字符文本的合成语音。A speech synthesis module for performing residual connection on the character feature sequence and the pronunciation pause sequence to obtain a speech sequence, and using a pre-built vocoder to perform speech synthesis on the speech sequence to obtain the character text synthesized speech.
一种电子设备,所述电子设备包括:An electronic device comprising:
存储器,存储至少一个指令;及a memory that stores at least one instruction; and
处理器,执行所述存储器中存储的指令以实现如下步骤:A processor that executes the instructions stored in the memory to achieve the following steps:
接收字符文本,将所述字符文本进行拼音置换,得到字符拼音,利用预构建的字母表,计算所述字符拼音在所述字母表的字符位置;Receive character text, carry out pinyin replacement of described character text, obtain character pinyin, utilize pre-built alphabet, calculate the character position of described character pinyin in described alphabet;
对所述字符位置及所述字符拼音执行编码操作,得到字符向量;performing encoding operation on the character position and the character pinyin to obtain a character vector;
将所述字符向量输入至预训练完成的注意力特征模型中,其中所述注意力特征模型包括多头注意力网络、字符特征提取网络;Inputting the character vector into the pre-trained attention feature model, wherein the attention feature model includes a multi-head attention network and a character feature extraction network;
利用所述多头注意力网络对所述字符向量执行注意力计算,得到注意力向量;Use the multi-head attention network to perform attention calculation on the character vector to obtain an attention vector;
对所述注意力向量及所述字符向量执行残差连接,得到字符注意力向量;performing residual connection on the attention vector and the character vector to obtain a character attention vector;
利用所述字符特征提取网络,对所述字符注意力向量执行特征提取,得到字符特征序列;Using the character feature extraction network to perform feature extraction on the character attention vector to obtain a character feature sequence;
将所述字符向量输入至预构建的发音停顿预测模型,得到发音停顿序列;The character vector is input into a pre-built pronunciation pause prediction model to obtain a pronunciation pause sequence;
将所述字符特征序列及所述发音停顿序列执行残差连接,得到语音序列,利用预构建的声码合成器,对所述语音序列执行语音合成,得到所述字符文本的合成语音。Residual connection is performed on the character feature sequence and the pronunciation pause sequence to obtain a speech sequence, and a pre-built vocode synthesizer is used to perform speech synthesis on the speech sequence to obtain the synthesized speech of the character text.
一种计算机可读存储介质,包括存储数据区和存储程序区,存储数据区存储创建的数据,存储程序区存储有计算机程序;其中,所述计算机程序被处理器执行时实现如下步骤:A computer-readable storage medium, comprising a storage data area and a storage program area, the storage data area stores data created, and the storage program area stores a computer program; wherein, the computer program is executed by a processor The following steps are implemented:
接收字符文本,将所述字符文本进行拼音置换,得到字符拼音,利用预构建的字母表,计算所述字符拼音在所述字母表的字符位置;Receive character text, carry out pinyin replacement of described character text, obtain character pinyin, utilize pre-built alphabet, calculate the character position of described character pinyin in described alphabet;
对所述字符位置及所述字符拼音执行编码操作,得到字符向量;performing encoding operation on the character position and the character pinyin to obtain a character vector;
将所述字符向量输入至预训练完成的注意力特征模型中,其中所述注意力特征模型包括多头注意力网络、字符特征提取网络;Inputting the character vector into the pre-trained attention feature model, wherein the attention feature model includes a multi-head attention network and a character feature extraction network;
利用所述多头注意力网络对所述字符向量执行注意力计算,得到注意力向量;Use the multi-head attention network to perform attention calculation on the character vector to obtain an attention vector;
对所述注意力向量及所述字符向量执行残差连接,得到字符注意力向量;performing residual connection on the attention vector and the character vector to obtain a character attention vector;
利用所述字符特征提取网络,对所述字符注意力向量执行特征提取,得到字符特征序列;Using the character feature extraction network to perform feature extraction on the character attention vector to obtain a character feature sequence;
将所述字符向量输入至预构建的发音停顿预测模型,得到发音停顿序列;The character vector is input into a pre-built pronunciation pause prediction model to obtain a pronunciation pause sequence;
将所述字符特征序列及所述发音停顿序列执行残差连接,得到语音序列,利用预构建的声码合成器,对所述语音序列执行语音合成,得到所述字符文本的合成语音。Residual connection is performed on the character feature sequence and the pronunciation pause sequence to obtain a speech sequence, and a pre-built vocode synthesizer is used to perform speech synthesis on the speech sequence to obtain the synthesized speech of the character text.
本申请可以解决合成出的语音不够平滑及自然的问题。The present application can solve the problem that the synthesized speech is not smooth and natural enough.
附图说明Description of drawings
图1为本申请一实施例提供的语音合成方法的流程示意图;1 is a schematic flowchart of a speech synthesis method provided by an embodiment of the present application;
图2为本申请一实施例提供的语音合成方法中S6的详细流程示意图;2 is a detailed schematic flowchart of S6 in a speech synthesis method provided by an embodiment of the present application;
图3为本申请一实施例提供的语音合成装置的模块示意图;3 is a schematic block diagram of a speech synthesis apparatus provided by an embodiment of the present application;
图4为本申请一实施例提供的实现语音合成方法的电子设备的内部结构示意图;4 is a schematic diagram of an internal structure of an electronic device for implementing a speech synthesis method provided by an embodiment of the present application;
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The realization, functional characteristics and advantages of the purpose of the present application will be further described with reference to the accompanying drawings in conjunction with the embodiments.
具体实施方式Detailed ways
应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。It should be understood that the specific embodiments described herein are only used to explain the present application, but not to limit the present application.
本申请实施例提供一种语音合成方法,所述语音合成方法的执行主体包括但不限于服务端、终端等能够被配置为执行本申请实施例提供的该方法的电子设备中的至少一种。换言之,所述语音合成方法可以由安装在终端设备或服务端设备的软件或硬件来执行,所述软件可以是区块链平台。所述服务端包括但不限于:单台服务器、服务器集群、云端服务器或云端服务器集群等。The embodiments of the present application provide a speech synthesis method, and the execution subject of the speech synthesis method includes, but is not limited to, at least one of electronic devices that can be configured to execute the method provided by the embodiments of the present application, such as a server and a terminal. In other words, the speech synthesis method can be executed by software or hardware installed in a terminal device or a server device, and the software can be a blockchain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, and the like.
参照图1所示,为本申请一实施例提供的语音合成方法的流程示意图。在本实施例中,所述语音合成方法包括:Referring to FIG. 1 , a schematic flowchart of a speech synthesis method provided by an embodiment of the present application is shown. In this embodiment, the speech synthesis method includes:
S1、接收字符文本,将所述字符文本进行拼音置换,得到字符拼音,利用预构建的字母表,计算所述字符拼音在所述字母表的字符位置。S1. Receive character text, perform pinyin substitution on the character text to obtain the character pinyin, and use a pre-built alphabet to calculate the character position of the character pinyin in the alphabet.
本申请较佳实施例中,可接受用户输入的字符文本,如用户输入字符文本A:“你好,今天出行伴有暴雨狂风,请注意安全”。则对所述字符文本A进行拼音置换,得到字符拼音B:“nihao,jintianchuxingbanyoubaoyukuangfeng,qingzhuyianquan”,其中本申请实施例中,所述将所述字符文本进行拼音置换,得到字符拼音,包括:利用JAVA语言中的pinyin4j,构建拼音置换程序;利用所述拼音置换程序,将所述字符文本进行拼音置换,得到所述字符拼音。In the preferred embodiment of the present application, the character text input by the user is acceptable, for example, the user input character text A: "Hello, today's trip is accompanied by heavy rain and strong wind, please pay attention to safety". Then described character text A is carried out phonetic replacement, obtain character phonetic B: " nihao, jintianchuxingbanyoubaoyukuangfeng, qingzhuyianquan ", wherein in the embodiment of the application, described character text is carried out phonetic replacement, obtain character phonetic, comprise: utilize JAVA Pinyin4j in the language, builds a pinyin replacement program; uses the pinyin replacement program to perform pinyin replacement on the character text to obtain the character pinyin.
其中pinyin4j在JAVA语言中处于net.sourceforge.pinyin4j,因此使用import net.sourceforge.pinyin4j导入pinyin4j,得到所述拼音置换程序。Wherein pinyin4j is located in net.sourceforge.pinyin4j in JAVA language, so use import net.sourceforge.pinyin4j to import pinyin4j to obtain the pinyin replacement program.
本申请实施例中,利用拼音构建得到所述字母表,如在所述字母表中,a对应1、b对应2、c对应3,则上述字符拼音B:“nihao,jintianchuxingbanyoubaoyukuangfeng,qingzhuyianquan”利用所述字母表构建得到包括数字的字符位置。In the embodiment of the present application, the alphabet is constructed by using pinyin. For example, in the alphabet, a corresponds to 1, b corresponds to 2, and c corresponds to 3, then the above-mentioned character pinyin B: "nihao, jintianchuxingbanyoubaoyukuangfeng, qingzhuyianquan" uses the The alphabet is constructed to obtain character positions including numbers.
S2、对所述字符位置及所述字符拼音执行编码操作,得到字符向量。S2. Perform an encoding operation on the character position and the character pinyin to obtain a character vector.
详细地,本申请实施例采用one-hot编码方法,对所述字符位置及所述字符拼音执行编码操作,得到字符向量。In detail, the embodiment of the present application adopts a one-hot encoding method to perform encoding operations on the character position and the character pinyin to obtain a character vector.
S3、将所述字符向量输入至预训练完成的注意力特征模型中,其中所述注意力特征模型包括多头注意力网络、字符特征提取网络。S3. Input the character vector into the pre-trained attention feature model, where the attention feature model includes a multi-head attention network and a character feature extraction network.
本申请实施例中,在执行所述S3之前,需训练所述注意力特征模型,详细地,所述训练所述注意力特征模型,包括:In this embodiment of the present application, before performing the S3, the attention feature model needs to be trained. In detail, the training of the attention feature model includes:
步骤A:构建包括所述多头注意力网络及所述字符特征提取网络的待训练注意力特征模型。Step A: constructing an attention feature model to be trained including the multi-head attention network and the character feature extraction network.
详细地,所述步骤A包括:根据多头注意力机制构建所述多头注意力网络;根据卷积神经网络构建所述字符特征提取网络;组合所述多头注意力网络及所述字符特征提取网络,得到所述待训练注意力特征模型。In detail, the step A includes: constructing the multi-head attention network according to a multi-head attention mechanism; constructing the character feature extraction network according to a convolutional neural network; combining the multi-head attention network and the character feature extraction network, The attention feature model to be trained is obtained.
其中,所述根据多头注意力机制构建所述多头注意力网络,包括:接收已训练完成的Transform模型,从所述Transform模型中提取编码器,利用所述编码器内的多头注意力机制,构建得到所述多头注意力网络。Wherein, constructing the multi-head attention network according to the multi-head attention mechanism includes: receiving a trained Transform model, extracting an encoder from the Transform model, and using the multi-head attention mechanism in the encoder to construct Get the multi-head attention network.
本申请实施例中,用户可提前训练完成Transform模型,所述Transform模型是一种可实现分类或拟合的深度学习模型,包括编码器、解码器,其中编码器中包括多头注意力机制,本申请实施例中,提取所述多头注意力机制所在的网络层,构建得到所述多头注意力网络。In the embodiment of the present application, the user can train and complete the Transform model in advance. The Transform model is a deep learning model that can realize classification or fitting, including an encoder and a decoder, wherein the encoder includes a multi-head attention mechanism. In the application embodiment, the network layer where the multi-head attention mechanism is located is extracted to construct the multi-head attention network.
进一步地,本申请实施例中,按照所述多头注意力网络在前,所述字符特征提取网络在后的原则,组合得到所述待训练注意力特征模型。Further, in the embodiment of the present application, according to the principle that the multi-head attention network is in front and the character feature extraction network is in the back, the attention feature model to be trained is obtained by combining.
步骤B:接收训练文本集及训练标签集,将所述训练文本集输入至所述待训练注意力特征模型进行特征提取,得到特征序列训练集。Step B: Receive a training text set and a training label set, input the training text set into the attention feature model to be trained for feature extraction, and obtain a feature sequence training set.
本申请实施例中,所述训练文本集是用户提前收集并整理出的文本集合,所述训练标签集是与所述训练文本集对应的语音集合,如所述训练文本集中有训练文本X 1:“恶劣的环境,不适宜出门郊游”,则在所述训练标签集中对应存在语音Y 1=(y 1,y 2,..,y n),其中y n表示语音Y 1的语音序列。 In the embodiment of the present application, the training text set is a text set collected and sorted out by a user in advance, and the training label set is a voice set corresponding to the training text set. For example, the training text set contains a training text X 1 : "bad environment, not suitable for outing", then there is corresponding speech Y 1 =(y 1 ,y 2 ,..,y n ) in the training label set, where y n represents the speech sequence of speech Y 1 .
进一步地,当获得所述训练文本集后,利用所述待训练注意力特征模型进行特征提取,详细地,所述将所述训练文本集输入至所述待训练注意力特征模型进行特征提取,得到特征序列训练集,包括:将所述训练文本集进行拼音置换,得到拼音训练集,计算所述拼音训练集在所述字母表的字符位置,得到位置训练集,对所述拼音训练集及所述位置训练集执行编码操作,得到向量训练集,利用所述多头注意力网络对所述向量训练集执行注意力 计算,得到注意力向量集;对所述注意力向量集及所述向量训练集执行残差连接,得到注意力向量训练集;利用所述字符特征提取网络,对所述注意力向量训练集执行特征提取,得到所述特征序列训练集。Further, after the training text set is obtained, the attention feature model to be trained is used for feature extraction, and in detail, the training text set is input into the attention feature model to be trained for feature extraction, Obtaining a feature sequence training set includes: performing pinyin replacement on the training text set to obtain a pinyin training set, calculating the character positions of the pinyin training set in the alphabet, obtaining a position training set, and comparing the pinyin training set and Perform an encoding operation on the position training set to obtain a vector training set, and use the multi-head attention network to perform an attention calculation on the vector training set to obtain an attention vector set; train the attention vector set and the vector training set Perform residual connection on the set to obtain an attention vector training set; use the character feature extraction network to perform feature extraction on the attention vector training set to obtain the feature sequence training set.
详细地,在对所述训练文本集执行拼音置换、字符位置计算及编码操作得到所述向量训练集的过程,与上述S1、S2类似,在此不再赘述。In detail, the process of obtaining the vector training set by performing pinyin replacement, character position calculation and encoding operations on the training text set is similar to the above S1 and S2, and will not be repeated here.
本申请实施例中,根据上述Transform模型内编码器的多头注意力机制原理,对所述向量训练集执行注意力计算,得到所述注意力向量集。In the embodiment of the present application, according to the principle of the multi-head attention mechanism of the encoder in the Transform model, attention calculation is performed on the vector training set to obtain the attention vector set.
进一步地,本申请利用如下公式,对所述注意力向量集及所述向量训练集执行残差连接:Further, the present application uses the following formula to perform residual connection on the attention vector set and the vector training set:
result attention=s+p result attention = s+p
其中,result attention表示所述注意力向量训练集,s表示所述注意力向量集,p表示所述向量训练集。 Wherein, result attention represents the attention vector training set, s represents the attention vector set, and p represents the vector training set.
本申请实施例中,利用所述字符特征提取网络内的卷积操作,依次对所述注意力向量训练集中每个注意力向量执行特征提取,进而得到所述特征序列训练集。其中,所述卷积操作是一种基于卷积核进行卷积计算的操作,本申请设定卷积核大小为3*3,从而得到所述特征序列训练集。In the embodiment of the present application, the convolution operation in the character feature extraction network is used to sequentially perform feature extraction on each attention vector in the attention vector training set, and then the feature sequence training set is obtained. The convolution operation is a convolution calculation operation based on a convolution kernel, and the size of the convolution kernel is set to 3*3 in this application, so as to obtain the feature sequence training set.
步骤C:构建多层线性激活层。Step C: Build multiple linear activation layers.
在得到所述待训练注意力特征模型,并利用所述待训练注意力特征模型进行特征提取得到特征序列训练集后,本申请构建线性激活层帮助所述待训练注意力特征模型进行模型训练,其中所述线性激活层包括归一化和激活函数,所述激活函数可使用高斯分布函数。After obtaining the attention feature model to be trained, and using the attention feature model to be trained to perform feature extraction to obtain a feature sequence training set, the present application constructs a linear activation layer to help the attention feature model to be trained for model training, Wherein the linear activation layer includes normalization and activation function, and the activation function can use a Gaussian distribution function.
步骤D:利用所述多层线性激活层,对所述特征序列训练集执行激活操作,得到预测序列集。Step D: use the multi-layer linear activation layer to perform an activation operation on the feature sequence training set to obtain a prediction sequence set.
详细地,所述利用所述多层线性激活层,对所述特征序列训练集执行激活操作,得到预测序列集,包括:对所述特征序列训练集执行归一化得到特征序列归一化集,利用所述高斯分布函数,计算所述特征序列归一化集的高斯分布,根据所述高斯分布得到所述预测序列集。In detail, using the multi-layer linear activation layer to perform an activation operation on the feature sequence training set to obtain a prediction sequence set includes: performing normalization on the feature sequence training set to obtain a feature sequence normalized set , using the Gaussian distribution function to calculate the Gaussian distribution of the normalized set of feature sequences, and obtain the predicted sequence set according to the Gaussian distribution.
详细地,所述归一化是将所述特征序列训练集内的数值映射至指定范围内的操作,如将所述特征序列训练集内的数值映射至[0,1]范围内,可有效缩小数值,减轻计算压力。Specifically, the normalization is an operation of mapping the values in the feature sequence training set to a specified range. For example, mapping the values in the feature sequence training set to the [0,1] range, it can Scale down the values to reduce computational stress.
进一步地,所述利用所述高斯分布函数,计算所述特征序列归一化集的高斯分布,包括:利用所述高斯分布函数计算出所述特征序列归一化集的均值和方差,利用所述特征序列归一化集的均值和方差,求解出所述特征序列归一化集的高斯分布。Further, calculating the Gaussian distribution of the normalized set of feature sequences by using the Gaussian distribution function includes: using the Gaussian distribution function to calculate the mean and variance of the normalized set of feature sequences, and using the Gaussian distribution function to calculate the mean and variance of the normalized set of feature sequences. The mean and variance of the normalized set of feature sequences are calculated, and the Gaussian distribution of the normalized set of feature sequences is obtained.
由于高斯分布是展现数据在指定范围内的概率分布,故本申请实施例中,从高斯分布中寻找出所述特征序列训练集的最大概率分布,即得到所述预测序列集。Since the Gaussian distribution represents the probability distribution of data within a specified range, in the embodiment of the present application, the maximum probability distribution of the training set of feature sequences is found from the Gaussian distribution, that is, the set of prediction sequences is obtained.
步骤E:计算所述预测序列集与所述训练标签集的误差值,并判断所述误差值与预设的误差阈值的大小关系。Step E: Calculate the error value between the predicted sequence set and the training label set, and determine the magnitude relationship between the error value and a preset error threshold.
本申请实施例中,利于平方差公式计算所述预测序列集与所述训练标签集的误差值。In the embodiment of the present application, the squared difference formula is used to calculate the error value between the predicted sequence set and the training label set.
步骤F:若所述误差值大于所述误差阈值,调整所述待训练注意力特征模型的内部参数,并返回步骤B。Step F: If the error value is greater than the error threshold, adjust the internal parameters of the attention feature model to be trained, and return to Step B.
步骤G:若所述误差值小于或等于所述误差阈值,得到所述多头注意力网络及所述字符特征提取网络的注意力特征模型。Step G: If the error value is less than or equal to the error threshold, obtain the attention feature models of the multi-head attention network and the character feature extraction network.
详细地,当所述误差值小于或等于所述误差阈值,表示所述待训练注意力特征模型具有较强的字符特征提取能力,则训练完成得到所述注意力特征模型。Specifically, when the error value is less than or equal to the error threshold, it indicates that the attention feature model to be trained has strong character feature extraction capability, and the training is completed to obtain the attention feature model.
本申请实施例中,当执行步骤A至步骤G得到训练完成的所述注意力特征模型,进一步地,可将所述字符向量输入至预训练完成的注意力特征模型中。In the embodiment of the present application, when steps A to G are performed to obtain the trained attention feature model, further, the character vector can be input into the pre-trained attention feature model.
S4、利用所述多头注意力网络对所述字符向量执行注意力计算,得到注意力向量。S4. Use the multi-head attention network to perform attention calculation on the character vector to obtain an attention vector.
本申请实施例中,S4与S3中训练阶段相似,均利用Transform模型内编码器的多头注意力机制原理,执行注意力计算,得到所述注意力向量。In the embodiment of the present application, the training stages in S4 and S3 are similar, and both use the principle of the multi-head attention mechanism of the encoder in the Transform model to perform the attention calculation to obtain the attention vector.
S5、对所述注意力向量及所述字符向量执行残差连接,得到字符注意力向量。S5. Perform residual connection on the attention vector and the character vector to obtain a character attention vector.
本申请实施例中,利用如下公式,对所述注意力向量及所述字符向量执行残差连接,得到字符注意力向量:In the embodiment of the present application, the following formula is used to perform residual connection on the attention vector and the character vector to obtain a character attention vector:
character attention=m+u character attention =m+u
其中,character attention表示所述字符注意力向量,m表示所述注意力向量,u表示所述字符向量。 Wherein, character attention represents the character attention vector, m represents the attention vector, and u represents the character vector.
S6、利用所述字符特征提取网络,对所述字符注意力向量执行特征提取,得到字符特征序列。S6. Using the character feature extraction network, perform feature extraction on the character attention vector to obtain a character feature sequence.
本申请实施例中,参阅图2所示,所述S6包括:In the embodiment of the present application, referring to FIG. 2 , the S6 includes:
S61、对所述字符注意力向量执行归一化,得到字符归一化向量;S61, performing normalization on the character attention vector to obtain a character normalization vector;
S62、对所述归一化向量执行卷积操作,得到字符卷积向量;S62, perform a convolution operation on the normalized vector to obtain a character convolution vector;
S63、对所述字符卷积向量与所述字符注意力向量执行残差连接,得到所述字符特征序列。S63. Perform residual connection on the character convolution vector and the character attention vector to obtain the character feature sequence.
其中归一化如上所述,将所述字符注意力向量内的数值映射至指定范围内的操作,本申请实施例,将所述字符注意力向量内的数值映射至[0,1]范围内。The normalization is as described above, the operation of mapping the value in the character attention vector to a specified range. In this embodiment of the present application, the value in the character attention vector is mapped to the range of [0, 1]. .
详细地,所述对所述归一化向量执行卷积操作,得到字符卷积向量,包括:根据预设卷积核维度构建卷积核;利用所述卷积核对所述归一化向量执行卷积操作,得到所述字符卷积向量。In detail, performing a convolution operation on the normalized vector to obtain a character convolution vector includes: constructing a convolution kernel according to a preset convolution kernel dimension; using the convolution kernel to perform a convolution operation on the normalized vector Convolution operation to obtain the character convolution vector.
进一步地,所述残差连接与上述相同,将所述字符卷积向量与所述字符注意力向量对应相加,得到所述字符特征序列。Further, the residual connection is the same as the above, and the character convolution vector and the character attention vector are correspondingly added to obtain the character feature sequence.
S7、将所述字符向量输入至预构建的发音停顿预测模型,得到发音停顿序列。S7. Input the character vector into a pre-built pronunciation pause prediction model to obtain a pronunciation pause sequence.
详细地,所述发音停顿预测模型是基于多个快速傅里叶变换模块组建得到,本申请实施例中,利用10个快速傅里叶变换模块,组建得到所述发音停顿预测模型。In detail, the pronunciation pause prediction model is formed based on a plurality of fast Fourier transform modules. In the embodiment of the present application, 10 fast Fourier transform modules are used to form the pronunciation pause prediction model.
详细地,所述S7包括:将所述字符拼音进行词向量转化,得到拼音向量;将所述拼音向量及所述字符向量输入至所述发音停顿预测模型,利用所述发音停顿预测模型对所述拼音向量及所述字符向量执行傅里叶变换,得到傅里叶变换序列;对所述傅里叶变换序列执行发音停顿预测,得到所述发音停顿序列。In detail, the S7 includes: transforming the character pinyin into a word vector to obtain a pinyin vector; inputting the pinyin vector and the character vector into the pronunciation pause prediction model, and using the pronunciation pause prediction model for all Perform Fourier transform on the pinyin vector and the character vector to obtain a Fourier transform sequence; perform pronunciation pause prediction on the Fourier transform sequence to obtain the pronunciation pause sequence.
所述快速傅里叶变换是离散傅氏变换(DFT)的快速算法,可预测所述字符向量及所述拼音向量对应的傅里叶变换序列,其中所述傅里叶变换序列包括语音频率、振幅及相位,并通过所述傅里叶变换序列可得到所述发音停顿序列。The fast Fourier transform is a fast algorithm of discrete Fourier transform (DFT), which can predict the Fourier transform sequence corresponding to the character vector and the pinyin vector, wherein the Fourier transform sequence includes speech frequency, Amplitude and phase, and the articulation pause sequence can be obtained through the Fourier transform sequence.
S8、将所述字符特征序列及所述发音停顿序列执行残差连接,得到语音序列,利用预构建的声码合成器,对所述语音序列执行语音合成,得到所述字符文本的合成语音。S8, performing residual connection on the character feature sequence and the pronunciation pause sequence to obtain a speech sequence, and using a pre-built vocoder synthesizer to perform speech synthesis on the speech sequence to obtain the synthesized speech of the character text.
本申请实施例中,所述声码合成器是一种可实现语音合成的译码器,包括通道式声码器、共振峰声码器、图案声码器、线性预测声码器、相关声码器、正交函数声码器等。本申请实施例中,将所述语音序列输入至所述声码合成器,即可得到所述字符文本的合成语音。In the embodiment of the present application, the vocoder is a decoder that can realize speech synthesis, including a channel vocoder, a formant vocoder, a pattern vocoder, a linear prediction vocoder, encoder, quadrature function vocoder, etc. In the embodiment of the present application, the synthesized speech of the character text can be obtained by inputting the speech sequence into the vocoding synthesizer.
本申请实施例将语音合成分为两部分执行,首先利用预训练完成的注意力特征模型,对字符文本执行特征提取,得到字符特征序列,其次利用发音停顿预测模型,预测字符文本的发音停顿序列,最后将所述字符特征序列及所述发音停顿序列执行残差连接得到语音序列,利用预构建的声码合成器,对所述语音序列执行语音合成,得到所述字符文本的合成语音,相比于背景技术中单纯使用LSTM、BERT等模型进行合成来说,本申请不仅预测出字符特征序列,同时也添加了发音停顿序列的预测过程,因此所合成出的语音在频率振幅等更加接近自然人声,因此本申请提出的语音合成方法、装置及计算机可读存储介质, 可以解决合成出的语音不够平滑及自然的问题。In this embodiment of the present application, speech synthesis is performed in two parts. First, a pre-trained attention feature model is used to perform feature extraction on character text to obtain character feature sequences. Second, a pronunciation pause prediction model is used to predict the pronunciation pause sequence of character text. Finally, the character feature sequence and the pronunciation pause sequence are performed residual connection to obtain a speech sequence, and a pre-built vocode synthesizer is used to perform speech synthesis on the speech sequence to obtain the synthesized speech of the character text. Compared with simply using LSTM, BERT and other models for synthesis in the background technology, the present application not only predicts the character feature sequence, but also adds the prediction process of the pronunciation pause sequence, so the synthesized speech is closer to natural in frequency amplitude, etc. Human voice, so the speech synthesis method, device and computer-readable storage medium proposed in this application can solve the problem that the synthesized speech is not smooth and natural enough.
如图3所示,是本申请语音合成装置的模块示意图。As shown in FIG. 3 , it is a block diagram of the speech synthesis apparatus of the present application.
本申请所述语音合成装置100可以安装于电子设备中。根据实现的功能,所述语音合成装置可以包括字符向量构建模块101、字符特征序列提取模块102、发音停顿序列提取模块103及语音合成模块104。本发所述模块也可以称之为单元,是指一种能够被电子设备处理器所执行,并且能够完成固定功能的一系列计算机程序段,其存储在电子设备的存储器中。The speech synthesis apparatus 100 described in this application can be installed in an electronic device. According to the realized functions, the speech synthesis apparatus may include a character vector construction module 101 , a character feature sequence extraction module 102 , a pronunciation pause sequence extraction module 103 and a speech synthesis module 104 . The modules described in the present invention can also be called units, which refer to a series of computer program segments that can be executed by the electronic device processor and can perform fixed functions, and are stored in the memory of the electronic device.
在本实施例中,关于各模块/单元的功能如下:In this embodiment, the functions of each module/unit are as follows:
所述字符向量构建模块101,用于接收字符文本,将所述字符文本进行拼音置换,得到字符拼音,利用预构建的字母表,计算所述字符拼音在所述字母表的字符位置,对所述字符位置及所述字符拼音执行编码操作,得到字符向量;The character vector construction module 101 is used for receiving character text, performing pinyin substitution on the character text to obtain the character pinyin, and calculating the character position of the character pinyin in the alphabet using a pre-built alphabet, and for all the characters in the alphabet. Describe character position and described character pinyin to carry out encoding operation, obtain character vector;
所述字符特征序列提取模块102,用于将所述字符向量输入至预训练完成的注意力特征模型中,其中所述注意力特征模型包括多头注意力网络、字符特征提取网络,利用所述多头注意力网络对所述字符向量执行注意力计算,得到注意力向量,对所述注意力向量及所述字符向量执行残差连接,得到字符注意力向量,利用所述字符特征提取网络,对所述字符注意力向量执行特征提取,得到字符特征序列;The character feature sequence extraction module 102 is configured to input the character vector into a pre-trained attention feature model, wherein the attention feature model includes a multi-head attention network and a character feature extraction network, using the multi-head attention network The attention network performs attention calculation on the character vector, obtains the attention vector, performs residual connection on the attention vector and the character vector, obtains the character attention vector, and uses the character feature extraction network to extract the character. Perform feature extraction on the character attention vector to obtain a character feature sequence;
所述发音停顿序列提取模块103,用于将所述字符向量输入至预构建的发音停顿预测模型,得到发音停顿序列;The pronunciation pause sequence extraction module 103 is used to input the character vector into a pre-built pronunciation pause prediction model to obtain a pronunciation pause sequence;
所述语音合成模块104,用于将所述字符特征序列及所述发音停顿序列执行残差连接,得到语音序列,利用预构建的声码合成器,对所述语音序列执行语音合成,得到所述字符文本的合成语音。The speech synthesis module 104 is used to perform residual connection on the character feature sequence and the pronunciation pause sequence to obtain a speech sequence, and use a pre-built vocoder to perform speech synthesis on the speech sequence to obtain the speech sequence. Synthesized speech for character text.
本申请实施例所提供的语音合成装置100中的各个模块能够在使用时基于与上述的语音合成方法采用相同的手段,具体地实施步骤在此不再赘述,关于各模块/单元的功能所产生技术效果与上述的语音合成方法的技术效果相同,即解决合成出的语音不够平滑及自然的问题。Each module in the speech synthesis apparatus 100 provided by the embodiment of the present application can use the same means as the above-mentioned speech synthesis method, and the specific implementation steps will not be repeated here. The technical effect is the same as that of the above-mentioned speech synthesis method, that is, the problem that the synthesized speech is not smooth and natural is solved.
如图4所示,是本申请实现语音合成方法的电子设备的结构示意图。As shown in FIG. 4 , it is a schematic structural diagram of an electronic device implementing the speech synthesis method of the present application.
所述电子设备1可以包括处理器10、存储器11和总线,还可以包括存储在所述存储器11中并可在所述处理器10上运行的计算机程序,如语音合成程序12。The electronic device 1 may include a processor 10, a memory 11 and a bus, and may also include a computer program stored in the memory 11 and executable on the processor 10, such as a speech synthesis program 12.
其中,所述存储器11至少包括一种类型的可读存储介质,所述可读存储介质包括闪存、移动硬盘、多媒体卡、卡型存储器(例如:SD或DX存储器等)、磁性存储器、磁盘、光盘等。所述存储器11在一些实施例中可以是电子设备1的内部存储单元,例如该电子设备1的移动硬盘。所述存储器11在另一些实施例中也可以是电子设备1的外部存储设备,例如电子设备1上配备的插接式移动硬盘、智能存储卡(Smart Media Card,SMC)、安全数字(Secure Digital,SD)卡、闪存卡(Flash Card)等。进一步地,所述存储器11还可以既包括电子设备1的内部存储单元也包括外部存储设备。所述存储器11不仅可以用于存储安装于电子设备1的应用软件及各类数据,例如语音合成程序12的代码等,还可以用于暂时地存储已经输出或者将要输出的数据。Wherein, the memory 11 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, mobile hard disk, multimedia card, card-type memory (for example: SD or DX memory, etc.), magnetic memory, magnetic disk, CD etc. The memory 11 may be an internal storage unit of the electronic device 1 in some embodiments, such as a mobile hard disk of the electronic device 1 . In other embodiments, the memory 11 may also be an external storage device of the electronic device 1, such as a pluggable mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital) equipped on the electronic device 1. , SD) card, flash memory card (Flash Card), etc. Further, the memory 11 may also include both an internal storage unit of the electronic device 1 and an external storage device. The memory 11 can not only be used to store application software installed in the electronic device 1 and various types of data, such as the code of the speech synthesis program 12, etc., but also can be used to temporarily store data that has been output or will be output.
所述处理器10在一些实施例中可以由集成电路组成,例如可以由单个封装的集成电路所组成,也可以是由多个相同功能或不同功能封装的集成电路所组成,包括一个或者多个中央处理器(Central Processing unit,CPU)、微处理器、数字处理芯片、图形处理器及各种控制芯片的组合等。所述处理器10是所述电子设备的控制核心(Control Unit),利用各种接口和线路连接整个电子设备的各个部件,通过运行或执行存储在所述存储器11内的程序或者模块(例如执行语音合成程序等),以及调用存储在所述存储器11内的数据,以执行电子设备1的各种功能和处理数据。In some embodiments, the processor 10 may be composed of integrated circuits, for example, may be composed of a single packaged integrated circuit, or may be composed of multiple integrated circuits packaged with the same function or different functions, including one or more integrated circuits. Central Processing Unit (CPU), microprocessor, digital processing chip, graphics processor and combination of various control chips, etc. The processor 10 is the control core (Control Unit) of the electronic device, and uses various interfaces and lines to connect the various components of the entire electronic device, by running or executing the program or module (for example, executing the program) stored in the memory 11. speech synthesis program, etc.), and call data stored in the memory 11 to execute various functions of the electronic device 1 and process data.
所述总线可以是外设部件互连标准(peripheral component interconnect,简称PCI)总 线或扩展工业标准结构(extended industry standard architecture,简称EISA)总线等。该总线可以分为地址总线、数据总线、控制总线等。所述总线被设置为实现所述存储器11以及至少一个处理器10等之间的连接通信。The bus may be a peripheral component interconnect (PCI for short) bus or an extended industry standard architecture (Extended industry standard architecture, EISA for short) bus or the like. The bus can be divided into address bus, data bus, control bus and so on. The bus is configured to implement connection communication between the memory 11 and at least one processor 10 and the like.
图4仅示出了具有部件的电子设备,本领域技术人员可以理解的是,图4示出的结构并不构成对所述电子设备1的限定,可以包括比图示更少或者更多的部件,或者组合某些部件,或者不同的部件布置。FIG. 4 only shows an electronic device with components. Those skilled in the art can understand that the structure shown in FIG. 4 does not constitute a limitation on the electronic device 1, and may include fewer or more components than those shown in the drawings. components, or a combination of certain components, or a different arrangement of components.
例如,尽管未示出,所述电子设备1还可以包括给各个部件供电的电源(比如电池),优选地,电源可以通过电源管理装置与所述至少一个处理器10逻辑相连,从而通过电源管理装置实现充电管理、放电管理、以及功耗管理等功能。电源还可以包括一个或一个以上的直流或交流电源、再充电装置、电源故障检测电路、电源转换器或者逆变器、电源状态指示器等任意组件。所述电子设备1还可以包括多种传感器、蓝牙模块、Wi-Fi模块等,在此不再赘述。For example, although not shown, the electronic device 1 may also include a power supply (such as a battery) for powering the various components, preferably, the power supply may be logically connected to the at least one processor 10 through a power management device, so that the power management The device implements functions such as charge management, discharge management, and power consumption management. The power source may also include one or more DC or AC power sources, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, and any other components. The electronic device 1 may further include various sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.
进一步地,所述电子设备1还可以包括网络接口,可选地,所述网络接口可以包括有线接口和/或无线接口(如WI-FI接口、蓝牙接口等),通常用于在该电子设备1与其他电子设备之间建立通信连接。Further, the electronic device 1 may also include a network interface, optionally, the network interface may include a wired interface and/or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is usually used in the electronic device 1 Establish a communication connection with other electronic devices.
可选地,该电子设备1还可以包括用户接口,用户接口可以是显示器(Display)、输入单元(比如键盘(Keyboard)),可选地,用户接口还可以是标准的有线接口、无线接口。可选地,在一些实施例中,显示器可以是LED显示器、液晶显示器、触控式液晶显示器以及OLED(Organic Light-Emitting Diode,有机发光二极管)触摸器等。其中,显示器也可以适当的称为显示屏或显示单元,用于显示在电子设备1中处理的信息以及用于显示可视化的用户界面。Optionally, the electronic device 1 may further include a user interface, and the user interface may be a display (Display), an input unit (eg, a keyboard (Keyboard)), optionally, the user interface may also be a standard wired interface or a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode, organic light-emitting diode) touch device, and the like. The display may also be appropriately called a display screen or a display unit, which is used for displaying information processed in the electronic device 1 and for displaying a visualized user interface.
应该了解,所述实施例仅为说明之用,在专利申请范围上并不受此结构的限制。It should be understood that the embodiments are only used for illustration, and are not limited by this structure in the scope of the patent application.
所述电子设备1中的所述存储器11存储的语音合成程序12是多个指令的组合,在所述处理器10中运行时,可以实现:The speech synthesis program 12 stored in the memory 11 in the electronic device 1 is a combination of multiple instructions, and when running in the processor 10, it can realize:
接收字符文本,将所述字符文本进行拼音置换,得到字符拼音,利用预构建的字母表,计算所述字符拼音在所述字母表的字符位置;Receive character text, carry out pinyin replacement of described character text, obtain character pinyin, utilize pre-built alphabet, calculate the character position of described character pinyin in described alphabet;
对所述字符位置及所述字符拼音执行编码操作,得到字符向量;performing encoding operation on the character position and the character pinyin to obtain a character vector;
将所述字符向量输入至预训练完成的注意力特征模型中,其中所述注意力特征模型包括多头注意力网络、字符特征提取网络;Inputting the character vector into the pre-trained attention feature model, wherein the attention feature model includes a multi-head attention network and a character feature extraction network;
利用所述多头注意力网络对所述字符向量执行注意力计算,得到注意力向量;Use the multi-head attention network to perform attention calculation on the character vector to obtain an attention vector;
对所述注意力向量及所述字符向量执行残差连接,得到字符注意力向量;performing residual connection on the attention vector and the character vector to obtain a character attention vector;
利用所述字符特征提取网络,对所述字符注意力向量执行特征提取,得到字符特征序列;Using the character feature extraction network to perform feature extraction on the character attention vector to obtain a character feature sequence;
将所述字符向量输入至预构建的发音停顿预测模型,得到发音停顿序列;The character vector is input into a pre-built pronunciation pause prediction model to obtain a pronunciation pause sequence;
将所述字符特征序列及所述发音停顿序列执行残差连接,得到语音序列,利用预构建的声码合成器,对所述语音序列执行语音合成,得到所述字符文本的合成语音。Residual connection is performed on the character feature sequence and the pronunciation pause sequence to obtain a speech sequence, and a pre-built vocode synthesizer is used to perform speech synthesis on the speech sequence to obtain the synthesized speech of the character text.
进一步地,所述电子设备1集成的模块/单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。所述计算机可读介质可以包括:能够携带所述计算机程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(ROM,Read-Only Memory)。Further, if the modules/units integrated in the electronic device 1 are implemented in the form of software functional units and sold or used as independent products, they may be stored in a computer-readable storage medium. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, removable hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory) .
进一步地,所述计算机可用存储介质可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序等;存储数据区可存储根据区块链节点的使用所创建的数据等。Further, the computer usable storage medium may mainly include a stored program area and a stored data area, wherein the stored program area may store an operating system, an application program required for at least one function, and the like; using the created data, etc.
本申请还提供一种计算机可读存储介质,所述计算机可读存储介质可以是易失性的,也可以是非易失性的,所述可读存储介质存储有计算机程序,所述计算机程序在被电子设 备的处理器所执行时,可以实现:The present application also provides a computer-readable storage medium. The computer-readable storage medium may be volatile or non-volatile. The readable storage medium stores a computer program, and the computer program is stored in the When executed by the processor of the electronic device, it can achieve:
接收字符文本,将所述字符文本进行拼音置换,得到字符拼音,利用预构建的字母表,计算所述字符拼音在所述字母表的字符位置;Receive character text, carry out pinyin replacement of described character text, obtain character pinyin, utilize pre-built alphabet, calculate the character position of described character pinyin in described alphabet;
对所述字符位置及所述字符拼音执行编码操作,得到字符向量;performing encoding operation on the character position and the character pinyin to obtain a character vector;
将所述字符向量输入至预训练完成的注意力特征模型中,其中所述注意力特征模型包括多头注意力网络、字符特征提取网络;Inputting the character vector into the pre-trained attention feature model, wherein the attention feature model includes a multi-head attention network and a character feature extraction network;
利用所述多头注意力网络对所述字符向量执行注意力计算,得到注意力向量;Use the multi-head attention network to perform attention calculation on the character vector to obtain an attention vector;
对所述注意力向量及所述字符向量执行残差连接,得到字符注意力向量;performing residual connection on the attention vector and the character vector to obtain a character attention vector;
利用所述字符特征提取网络,对所述字符注意力向量执行特征提取,得到字符特征序列;Using the character feature extraction network to perform feature extraction on the character attention vector to obtain a character feature sequence;
将所述字符向量输入至预构建的发音停顿预测模型,得到发音停顿序列;The character vector is input into a pre-built pronunciation pause prediction model to obtain a pronunciation pause sequence;
将所述字符特征序列及所述发音停顿序列执行残差连接,得到语音序列,利用预构建的声码合成器,对所述语音序列执行语音合成,得到所述字符文本的合成语音。Residual connection is performed on the character feature sequence and the pronunciation pause sequence to obtain a speech sequence, and a pre-built vocode synthesizer is used to perform speech synthesis on the speech sequence to obtain the synthesized speech of the character text.
在本申请所提供的几个实施例中,应该理解到,所揭露的设备,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。In the several embodiments provided in this application, it should be understood that the disclosed apparatus, apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are only illustrative. For example, the division of the modules is only a logical function division, and there may be other division manners in actual implementation.
所述作为分离部件说明的模块可以是或者也可以不是物理上分开的,作为模块显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
另外,在本申请各个实施例中的各功能模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能模块的形式实现。In addition, each functional module in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware, or can be implemented in the form of hardware plus software function modules.
对于本领域技术人员而言,显然本申请不限于上述示范性实施例的细节,而且在不背离本申请的精神或基本特征的情况下,能够以其他的具体形式实现本申请。It will be apparent to those skilled in the art that the present application is not limited to the details of the above-described exemplary embodiments, but that the present application can be implemented in other specific forms without departing from the spirit or essential characteristics of the present application.
因此,无论从哪一点来看,均应将实施例看作是示范性的,而且是非限制性的,本申请的范围由所附权利要求而不是上述说明限定,因此旨在将落在权利要求的等同要件的含义和范围内的所有变化涵括在本申请内。不应将权利要求中的任何附关联图表记视为限制所涉及的权利要求。Accordingly, the embodiments are to be regarded in all respects as illustrative and not restrictive, and the scope of the application is to be defined by the appended claims rather than the foregoing description, which is therefore intended to fall within the scope of the claims. All changes within the meaning and scope of the equivalents of , are included in this application. Any accompanying reference signs in the claims should not be construed as limiting the involved claims.
本申请所指区块链是分布式数据存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式。区块链(Blockchain),本质上是一个去中心化的数据库,是一串使用密码学方法相关联产生的数据块,每一个数据块中包含了一批次网络交易的信息,用于验证其信息的有效性(防伪)和生成下一个区块。区块链可以包括区块链底层平台、平台产品服务层以及应用服务层等。The blockchain referred to in this application is a new application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm. Blockchain, essentially a decentralized database, is a series of data blocks associated with cryptographic methods. Each data block contains a batch of network transaction information to verify its Validity of information (anti-counterfeiting) and generation of the next block. The blockchain can include the underlying platform of the blockchain, the platform product service layer, and the application service layer.
此外,显然“包括”一词不排除其他单元或步骤,单数不排除复数。系统权利要求中陈述的多个单元或装置也可以由一个单元或装置通过软件或者硬件来实现。第二等词语用来表示名称,而并不表示任何特定的顺序。Furthermore, it is clear that the word "comprising" does not exclude other units or steps and the singular does not exclude the plural. Several units or means recited in the system claims can also be realized by one unit or means by means of software or hardware. Second-class terms are used to denote names and do not denote any particular order.
最后应说明的是,以上实施例仅用以说明本申请的技术方案而非限制,尽管参照较佳实施例对本申请进行了详细说明,本领域的普通技术人员应当理解,可以对本申请的技术方案进行修改或等同替换,而不脱离本申请技术方案的精神和范围。Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application rather than limitations. Although the present application has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present application can be Modifications or equivalent substitutions can be made without departing from the spirit and scope of the technical solutions of the present application.

Claims (20)

  1. 一种语音合成方法,其中,所述方法包括:A speech synthesis method, wherein the method comprises:
    接收字符文本,将所述字符文本进行拼音置换,得到字符拼音,利用预构建的字母表,计算所述字符拼音在所述字母表的字符位置;Receive character text, carry out pinyin replacement of described character text, obtain character pinyin, utilize pre-built alphabet, calculate the character position of described character pinyin in described alphabet;
    对所述字符位置及所述字符拼音执行编码操作,得到字符向量;performing encoding operation on the character position and the character pinyin to obtain a character vector;
    将所述字符向量输入至预训练完成的注意力特征模型中,其中所述注意力特征模型包括多头注意力网络、字符特征提取网络;Inputting the character vector into the pre-trained attention feature model, wherein the attention feature model includes a multi-head attention network and a character feature extraction network;
    利用所述多头注意力网络对所述字符向量执行注意力计算,得到注意力向量;Use the multi-head attention network to perform attention calculation on the character vector to obtain an attention vector;
    对所述注意力向量及所述字符向量执行残差连接,得到字符注意力向量;performing residual connection on the attention vector and the character vector to obtain a character attention vector;
    利用所述字符特征提取网络,对所述字符注意力向量执行特征提取,得到字符特征序列;Using the character feature extraction network to perform feature extraction on the character attention vector to obtain a character feature sequence;
    将所述字符向量输入至预构建的发音停顿预测模型,得到发音停顿序列;The character vector is input into a pre-built pronunciation pause prediction model to obtain a pronunciation pause sequence;
    将所述字符特征序列及所述发音停顿序列执行残差连接,得到语音序列,利用预构建的声码合成器,对所述语音序列执行语音合成,得到所述字符文本的合成语音。Residual connection is performed on the character feature sequence and the pronunciation pause sequence to obtain a speech sequence, and a pre-built vocode synthesizer is used to perform speech synthesis on the speech sequence to obtain the synthesized speech of the character text.
  2. 如权利要求1所述的语音合成方法,其中,所述利用所述字符特征提取网络,对所述字符注意力向量执行特征提取,得到字符特征序列,包括:The speech synthesis method according to claim 1, wherein the feature extraction is performed on the character attention vector by using the character feature extraction network to obtain a character feature sequence, comprising:
    对所述字符注意力向量执行归一化,得到字符归一化向量;performing normalization on the character attention vector to obtain a character normalization vector;
    对所述归一化向量执行卷积操作,得到字符卷积向量;Perform a convolution operation on the normalized vector to obtain a character convolution vector;
    对所述字符卷积向量与所述字符注意力向量执行残差连接,得到所述字符特征序列。A residual connection is performed on the character convolution vector and the character attention vector to obtain the character feature sequence.
  3. 如权利要求2所述的语音合成方法,其中,所述对所述归一化向量执行卷积操作,得到字符卷积向量,包括:The speech synthesis method according to claim 2, wherein, performing a convolution operation on the normalized vector to obtain a character convolution vector, comprising:
    根据预设卷积核维度构建卷积核;Construct the convolution kernel according to the preset convolution kernel dimension;
    利用所述卷积核对所述归一化向量执行卷积操作,得到所述字符卷积向量。Perform a convolution operation on the normalized vector by using the convolution kernel to obtain the character convolution vector.
  4. 如权利要求1所述的语音合成方法,其中,所述将所述字符向量输入至预构建的发音停顿预测模型,得到发音停顿序列,包括:The speech synthesis method according to claim 1, wherein the character vector is input into a pre-built pronunciation pause prediction model to obtain a pronunciation pause sequence, comprising:
    将所述字符拼音进行词向量转化,得到拼音向量;The character pinyin is transformed into a word vector to obtain a pinyin vector;
    将所述拼音向量及所述字符向量输入至所述发音停顿预测模型,利用所述发音停顿预测模型对所述拼音向量及所述字符向量执行傅里叶变换,得到傅里叶变换序列;The pinyin vector and the character vector are input into the pronunciation pause prediction model, and the pronunciation pause prediction model is utilized to perform Fourier transform on the pinyin vector and the character vector to obtain a Fourier transform sequence;
    对所述傅里叶变换序列执行发音停顿预测,得到所述发音停顿序列。Perform pronunciation pause prediction on the Fourier transform sequence to obtain the pronunciation pause sequence.
  5. 如权利要求1所述的语音合成方法,其中,所述预训练完成的注意力特征模型,包括:The speech synthesis method of claim 1, wherein the pre-trained attention feature model comprises:
    步骤A:构建包括所述多头注意力网络及所述字符特征提取网络的待训练注意力特征模型;Step A: constructing an attention feature model to be trained including the multi-head attention network and the character feature extraction network;
    步骤B:接收训练文本集及训练标签集,将所述训练文本集输入至所述待训练注意力特征模型进行特征提取,得到特征序列训练集;Step B: receiving a training text set and a training label set, inputting the training text set to the attention feature model to be trained for feature extraction, and obtaining a feature sequence training set;
    步骤C:构建多层线性激活层;Step C: Build a multi-layer linear activation layer;
    步骤D:利用所述多层线性激活层,对所述特征序列训练集执行激活操作,得到预测序列集;Step D: using the multi-layer linear activation layer to perform an activation operation on the feature sequence training set to obtain a prediction sequence set;
    步骤E:计算所述预测序列集与所述训练标签集的误差值,并判断所述误差值与预设的误差阈值的大小关系;Step E: Calculate the error value between the predicted sequence set and the training label set, and determine the magnitude relationship between the error value and a preset error threshold;
    步骤F:若所述误差值大于所述误差阈值,调整所述待训练注意力特征模型的内部参数,并返回步骤B;Step F: if the error value is greater than the error threshold, adjust the internal parameters of the attention feature model to be trained, and return to Step B;
    步骤G:若所述误差值小于或等于所述误差阈值,得到所述注意力特征模型。Step G: If the error value is less than or equal to the error threshold, obtain the attention feature model.
  6. 如权利要求5所述的语音合成方法,其中,所述将所述训练文本集输入至所述待训练注意力特征模型进行特征提取,得到特征序列训练集,包括:The speech synthesis method according to claim 5, wherein the inputting the training text set into the attention feature model to be trained for feature extraction to obtain a feature sequence training set, comprising:
    将所述训练文本集进行拼音置换,得到拼音训练集;Pinyin replacement is carried out to the training text set to obtain a pinyin training set;
    计算所述拼音训练集在所述字母表的字符位置,得到位置训练集;Calculate the character positions of the pinyin training set in the alphabet to obtain the position training set;
    对所述拼音训练集及所述位置训练集执行编码操作,得到向量训练集;performing encoding operations on the pinyin training set and the position training set to obtain a vector training set;
    利用所述多头注意力网络对所述向量训练集执行注意力计算,得到注意力向量集;Use the multi-head attention network to perform attention calculation on the vector training set to obtain an attention vector set;
    对所述注意力向量集及所述向量训练集执行残差连接,得到注意力向量训练集;performing a residual connection on the attention vector set and the vector training set to obtain an attention vector training set;
    利用所述字符特征提取网络,对所述注意力向量训练集执行特征提取,得到所述特征序列训练集。Using the character feature extraction network, feature extraction is performed on the attention vector training set to obtain the feature sequence training set.
  7. 如权利要求1至6中任意一项所述的语音合成方法,其中,所述利用所述多层线性激活层,对所述特征序列训练集执行激活操作,得到预测序列集,包括:The speech synthesis method according to any one of claims 1 to 6, wherein the using the multi-layer linear activation layer to perform an activation operation on the feature sequence training set to obtain a prediction sequence set, comprising:
    对所述特征序列训练集执行归一化得到特征序列归一化集;Performing normalization on the feature sequence training set to obtain a feature sequence normalization set;
    计算所述特征序列归一化集的高斯分布,根据所述高斯分布,计算得到所述预测序列集。Calculate the Gaussian distribution of the normalized set of feature sequences, and calculate the predicted sequence set according to the Gaussian distribution.
  8. 一种语音合成装置,其中,所述装置包括:A speech synthesis device, wherein the device comprises:
    字符向量构建模块,用于接收字符文本,将所述字符文本进行拼音置换,得到字符拼音,利用预构建的字母表,计算所述字符拼音在所述字母表的字符位置,对所述字符位置及所述字符拼音执行编码操作,得到字符向量;A character vector building module is used to receive character text, replace the character text with pinyin, obtain character pinyin, and use a pre-built alphabet to calculate the character position of the character pinyin in the alphabet, and to calculate the character position of the character And described character pinyin performs encoding operation, obtains character vector;
    字符特征序列提取模块,用于将所述字符向量输入至预训练完成的注意力特征模型中,其中所述注意力特征模型包括多头注意力网络、字符特征提取网络,利用所述多头注意力网络对所述字符向量执行注意力计算,得到注意力向量,对所述注意力向量及所述字符向量执行残差连接,得到字符注意力向量,利用所述字符特征提取网络,对所述字符注意力向量执行特征提取,得到字符特征序列;A character feature sequence extraction module for inputting the character vector into the pre-trained attention feature model, wherein the attention feature model includes a multi-head attention network and a character feature extraction network, using the multi-head attention network Perform attention calculation on the character vector to obtain an attention vector, perform residual connection on the attention vector and the character vector to obtain a character attention vector, and use the character feature extraction network to pay attention to the character The force vector performs feature extraction to obtain character feature sequences;
    发音停顿序列提取模块,用于将所述字符向量输入至预构建的发音停顿预测模型,得到发音停顿序列;A pronunciation pause sequence extraction module, for inputting the character vector into a pre-built pronunciation pause prediction model to obtain a pronunciation pause sequence;
    语音合成模块,用于将所述字符特征序列及所述发音停顿序列执行残差连接,得到语音序列,利用预构建的声码合成器,对所述语音序列执行语音合成,得到所述字符文本的合成语音。A speech synthesis module for performing residual connection on the character feature sequence and the pronunciation pause sequence to obtain a speech sequence, and using a pre-built vocoder to perform speech synthesis on the speech sequence to obtain the character text synthesized speech.
  9. 一种电子设备,其中,所述电子设备包括:An electronic device, wherein the electronic device comprises:
    至少一个处理器;以及,at least one processor; and,
    与所述至少一个处理器通信连接的存储器;其中,a memory communicatively coupled to the at least one processor; wherein,
    所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行如下步骤:The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the steps of:
    接收字符文本,将所述字符文本进行拼音置换,得到字符拼音,利用预构建的字母表,计算所述字符拼音在所述字母表的字符位置;Receive character text, carry out pinyin replacement of described character text, obtain character pinyin, utilize pre-built alphabet, calculate the character position of described character pinyin in described alphabet;
    对所述字符位置及所述字符拼音执行编码操作,得到字符向量;performing encoding operation on the character position and the character pinyin to obtain a character vector;
    将所述字符向量输入至预训练完成的注意力特征模型中,其中所述注意力特征模型包括多头注意力网络、字符特征提取网络;Inputting the character vector into the pre-trained attention feature model, wherein the attention feature model includes a multi-head attention network and a character feature extraction network;
    利用所述多头注意力网络对所述字符向量执行注意力计算,得到注意力向量;Use the multi-head attention network to perform attention calculation on the character vector to obtain an attention vector;
    对所述注意力向量及所述字符向量执行残差连接,得到字符注意力向量;performing residual connection on the attention vector and the character vector to obtain a character attention vector;
    利用所述字符特征提取网络,对所述字符注意力向量执行特征提取,得到字符特征序列;Using the character feature extraction network to perform feature extraction on the character attention vector to obtain a character feature sequence;
    将所述字符向量输入至预构建的发音停顿预测模型,得到发音停顿序列;The character vector is input into a pre-built pronunciation pause prediction model to obtain a pronunciation pause sequence;
    将所述字符特征序列及所述发音停顿序列执行残差连接,得到语音序列,利用预构建的声码合成器,对所述语音序列执行语音合成,得到所述字符文本的合成语音。Residual connection is performed on the character feature sequence and the pronunciation pause sequence to obtain a speech sequence, and a pre-built vocode synthesizer is used to perform speech synthesis on the speech sequence to obtain the synthesized speech of the character text.
  10. 如权利要求9所述的电子设备,其中,所述利用所述字符特征提取网络,对所述字符注意力向量执行特征提取,得到字符特征序列,包括:The electronic device according to claim 9, wherein, performing feature extraction on the character attention vector by using the character feature extraction network to obtain a character feature sequence, comprising:
    对所述字符注意力向量执行归一化,得到字符归一化向量;performing normalization on the character attention vector to obtain a character normalization vector;
    对所述归一化向量执行卷积操作,得到字符卷积向量;Perform a convolution operation on the normalized vector to obtain a character convolution vector;
    对所述字符卷积向量与所述字符注意力向量执行残差连接,得到所述字符特征序列。A residual connection is performed on the character convolution vector and the character attention vector to obtain the character feature sequence.
  11. 如权利要求10所述的电子设备,其中,所述对所述归一化向量执行卷积操作,得到字符卷积向量,包括:The electronic device according to claim 10, wherein, performing a convolution operation on the normalized vector to obtain a character convolution vector, comprising:
    根据预设卷积核维度构建卷积核;Construct the convolution kernel according to the preset convolution kernel dimension;
    利用所述卷积核对所述归一化向量执行卷积操作,得到所述字符卷积向量。Perform a convolution operation on the normalized vector by using the convolution kernel to obtain the character convolution vector.
  12. 如权利要求9所述的电子设备,其中,所述将所述字符向量输入至预构建的发音停顿预测模型,得到发音停顿序列,包括:The electronic device according to claim 9, wherein the character vector is input into a pre-built pronunciation pause prediction model to obtain a pronunciation pause sequence, comprising:
    将所述字符拼音进行词向量转化,得到拼音向量;The character pinyin is transformed into a word vector to obtain a pinyin vector;
    将所述拼音向量及所述字符向量输入至所述发音停顿预测模型,利用所述发音停顿预测模型对所述拼音向量及所述字符向量执行傅里叶变换,得到傅里叶变换序列;The pinyin vector and the character vector are input into the pronunciation pause prediction model, and the pronunciation pause prediction model is utilized to perform Fourier transform on the pinyin vector and the character vector to obtain a Fourier transform sequence;
    对所述傅里叶变换序列执行发音停顿预测,得到所述发音停顿序列。Perform pronunciation pause prediction on the Fourier transform sequence to obtain the pronunciation pause sequence.
  13. 如权利要求9所述的电子设备,其中,所述预训练完成的注意力特征模型,包括:The electronic device according to claim 9, wherein the pre-trained attention feature model comprises:
    步骤A:构建包括所述多头注意力网络及所述字符特征提取网络的待训练注意力特征模型;Step A: constructing an attention feature model to be trained including the multi-head attention network and the character feature extraction network;
    步骤B:接收训练文本集及训练标签集,将所述训练文本集输入至所述待训练注意力特征模型进行特征提取,得到特征序列训练集;Step B: receiving a training text set and a training label set, inputting the training text set to the attention feature model to be trained for feature extraction, and obtaining a feature sequence training set;
    步骤C:构建多层线性激活层;Step C: Build a multi-layer linear activation layer;
    步骤D:利用所述多层线性激活层,对所述特征序列训练集执行激活操作,得到预测序列集;Step D: using the multi-layer linear activation layer to perform an activation operation on the feature sequence training set to obtain a prediction sequence set;
    步骤E:计算所述预测序列集与所述训练标签集的误差值,并判断所述误差值与预设的误差阈值的大小关系;Step E: Calculate the error value between the predicted sequence set and the training label set, and determine the magnitude relationship between the error value and a preset error threshold;
    步骤F:若所述误差值大于所述误差阈值,调整所述待训练注意力特征模型的内部参数,并返回步骤B;Step F: if the error value is greater than the error threshold, adjust the internal parameters of the attention feature model to be trained, and return to Step B;
    步骤G:若所述误差值小于或等于所述误差阈值,得到所述注意力特征模型。Step G: If the error value is less than or equal to the error threshold, obtain the attention feature model.
  14. 如权利要求13所述的电子设备,其中,所述将所述训练文本集输入至所述待训练注意力特征模型进行特征提取,得到特征序列训练集,包括:The electronic device according to claim 13, wherein the inputting the training text set into the attention feature model to be trained to perform feature extraction to obtain a feature sequence training set, comprising:
    将所述训练文本集进行拼音置换,得到拼音训练集;Pinyin replacement is carried out to the training text set to obtain a pinyin training set;
    计算所述拼音训练集在所述字母表的字符位置,得到位置训练集;Calculate the character positions of the pinyin training set in the alphabet to obtain the position training set;
    对所述拼音训练集及所述位置训练集执行编码操作,得到向量训练集;performing encoding operations on the pinyin training set and the position training set to obtain a vector training set;
    利用所述多头注意力网络对所述向量训练集执行注意力计算,得到注意力向量集;Use the multi-head attention network to perform attention calculation on the vector training set to obtain an attention vector set;
    对所述注意力向量集及所述向量训练集执行残差连接,得到注意力向量训练集;performing a residual connection on the attention vector set and the vector training set to obtain an attention vector training set;
    利用所述字符特征提取网络,对所述注意力向量训练集执行特征提取,得到所述特征序列训练集。Using the character feature extraction network, feature extraction is performed on the attention vector training set to obtain the feature sequence training set.
  15. 如权利要求9至14中任意一项所述的电子设备,其中,所述利用所述多层线性激活层,对所述特征序列训练集执行激活操作,得到预测序列集,包括:The electronic device according to any one of claims 9 to 14, wherein, using the multi-layer linear activation layer to perform an activation operation on the feature sequence training set to obtain a prediction sequence set, comprising:
    对所述特征序列训练集执行归一化得到特征序列归一化集;Performing normalization on the feature sequence training set to obtain a feature sequence normalization set;
    计算所述特征序列归一化集的高斯分布,根据所述高斯分布,计算得到所述预测序列集。Calculate the Gaussian distribution of the normalized set of feature sequences, and calculate the predicted sequence set according to the Gaussian distribution.
  16. 一种计算机可读存储介质,包括存储数据区和存储程序区,其中,所述存储数据区存储创建的数据,所述存储程序区存储有计算机程序;其中,所述计算机程序被处理器执行时实现如下步骤:A computer-readable storage medium, comprising a storage data area and a storage program area, wherein the storage data area stores created data, and the storage program area stores a computer program; wherein, when the computer program is executed by a processor Implement the following steps:
    接收字符文本,将所述字符文本进行拼音置换,得到字符拼音,利用预构建的字母表,计算所述字符拼音在所述字母表的字符位置;Receive character text, carry out pinyin replacement of described character text, obtain character pinyin, utilize pre-built alphabet, calculate the character position of described character pinyin in described alphabet;
    对所述字符位置及所述字符拼音执行编码操作,得到字符向量;performing encoding operation on the character position and the character pinyin to obtain a character vector;
    将所述字符向量输入至预训练完成的注意力特征模型中,其中所述注意力特征模型包括多头注意力网络、字符特征提取网络;Inputting the character vector into the pre-trained attention feature model, wherein the attention feature model includes a multi-head attention network and a character feature extraction network;
    利用所述多头注意力网络对所述字符向量执行注意力计算,得到注意力向量;Use the multi-head attention network to perform attention calculation on the character vector to obtain an attention vector;
    对所述注意力向量及所述字符向量执行残差连接,得到字符注意力向量;performing residual connection on the attention vector and the character vector to obtain a character attention vector;
    利用所述字符特征提取网络,对所述字符注意力向量执行特征提取,得到字符特征序列;Using the character feature extraction network to perform feature extraction on the character attention vector to obtain a character feature sequence;
    将所述字符向量输入至预构建的发音停顿预测模型,得到发音停顿序列;The character vector is input into a pre-built pronunciation pause prediction model to obtain a pronunciation pause sequence;
    将所述字符特征序列及所述发音停顿序列执行残差连接,得到语音序列,利用预构建的声码合成器,对所述语音序列执行语音合成,得到所述字符文本的合成语音。Residual connection is performed on the character feature sequence and the pronunciation pause sequence to obtain a speech sequence, and a pre-built vocode synthesizer is used to perform speech synthesis on the speech sequence to obtain the synthesized speech of the character text.
  17. 如权利要求16所述的计算机可读存储介质,其中,所述利用所述字符特征提取网络,对所述字符注意力向量执行特征提取,得到字符特征序列,包括:The computer-readable storage medium according to claim 16, wherein, performing feature extraction on the character attention vector by using the character feature extraction network to obtain a character feature sequence, comprising:
    对所述字符注意力向量执行归一化,得到字符归一化向量;performing normalization on the character attention vector to obtain a character normalization vector;
    对所述归一化向量执行卷积操作,得到字符卷积向量;Perform a convolution operation on the normalized vector to obtain a character convolution vector;
    对所述字符卷积向量与所述字符注意力向量执行残差连接,得到所述字符特征序列。A residual connection is performed on the character convolution vector and the character attention vector to obtain the character feature sequence.
  18. 如权利要求17所述的计算机可读存储介质,其中,所述对所述归一化向量执行卷积操作,得到字符卷积向量,包括:The computer-readable storage medium of claim 17, wherein the performing a convolution operation on the normalized vector to obtain a character convolution vector, comprising:
    根据预设卷积核维度构建卷积核;Construct the convolution kernel according to the preset convolution kernel dimension;
    利用所述卷积核对所述归一化向量执行卷积操作,得到所述字符卷积向量。Perform a convolution operation on the normalized vector by using the convolution kernel to obtain the character convolution vector.
  19. 如权利要求16所述的计算机可读存储介质,其中,所述将所述字符向量输入至预构建的发音停顿预测模型,得到发音停顿序列,包括:The computer-readable storage medium of claim 16, wherein the inputting the character vector into a pre-built pronunciation pause prediction model to obtain a pronunciation pause sequence, comprising:
    将所述字符拼音进行词向量转化,得到拼音向量;The character pinyin is transformed into a word vector to obtain a pinyin vector;
    将所述拼音向量及所述字符向量输入至所述发音停顿预测模型,利用所述发音停顿预测模型对所述拼音向量及所述字符向量执行傅里叶变换,得到傅里叶变换序列;The pinyin vector and the character vector are input into the pronunciation pause prediction model, and the pronunciation pause prediction model is utilized to perform Fourier transform on the pinyin vector and the character vector to obtain a Fourier transform sequence;
    对所述傅里叶变换序列执行发音停顿预测,得到所述发音停顿序列。Perform pronunciation pause prediction on the Fourier transform sequence to obtain the pronunciation pause sequence.
  20. 如权利要求16所述的计算机可读存储介质,其中,所述预训练完成的注意力特征模型,包括:The computer-readable storage medium of claim 16, wherein the pre-trained attention feature model comprises:
    步骤A:构建包括所述多头注意力网络及所述字符特征提取网络的待训练注意力特征模型;Step A: constructing an attention feature model to be trained including the multi-head attention network and the character feature extraction network;
    步骤B:接收训练文本集及训练标签集,将所述训练文本集输入至所述待训练注意力特征模型进行特征提取,得到特征序列训练集;Step B: receiving a training text set and a training label set, inputting the training text set into the attention feature model to be trained for feature extraction, and obtaining a feature sequence training set;
    步骤C:构建多层线性激活层;Step C: Build a multi-layer linear activation layer;
    步骤D:利用所述多层线性激活层,对所述特征序列训练集执行激活操作,得到预测序列集;Step D: using the multi-layer linear activation layer to perform an activation operation on the feature sequence training set to obtain a prediction sequence set;
    步骤E:计算所述预测序列集与所述训练标签集的误差值,并判断所述误差值与预设的误差阈值的大小关系;Step E: Calculate the error value between the predicted sequence set and the training label set, and determine the magnitude relationship between the error value and a preset error threshold;
    步骤F:若所述误差值大于所述误差阈值,调整所述待训练注意力特征模型的内部参数,并返回步骤B;Step F: if the error value is greater than the error threshold, adjust the internal parameters of the attention feature model to be trained, and return to Step B;
    步骤G:若所述误差值小于或等于所述误差阈值,得到所述注意力特征模型。Step G: If the error value is less than or equal to the error threshold, obtain the attention feature model.
PCT/CN2021/083186 2020-12-11 2021-03-26 Speech synthesis method and apparatus, and electronic device and storage medium WO2022121158A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011452787.7 2020-12-11
CN202011452787.7A CN112509554A (en) 2020-12-11 2020-12-11 Speech synthesis method, speech synthesis device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
WO2022121158A1 true WO2022121158A1 (en) 2022-06-16

Family

ID=74972920

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/083186 WO2022121158A1 (en) 2020-12-11 2021-03-26 Speech synthesis method and apparatus, and electronic device and storage medium

Country Status (2)

Country Link
CN (1) CN112509554A (en)
WO (1) WO2022121158A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112509554A (en) * 2020-12-11 2021-03-16 平安科技(深圳)有限公司 Speech synthesis method, speech synthesis device, electronic equipment and storage medium
CN113112985B (en) * 2021-04-21 2022-01-18 合肥工业大学 Speech synthesis method based on deep learning
CN114154459A (en) * 2021-10-28 2022-03-08 北京搜狗科技发展有限公司 Speech recognition text processing method and device, electronic equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190172443A1 (en) * 2017-12-06 2019-06-06 International Business Machines Corporation System and method for generating expressive prosody for speech synthesis
CN110534089A (en) * 2019-07-10 2019-12-03 西安交通大学 A kind of Chinese speech synthesis method based on phoneme and rhythm structure
CN110782870A (en) * 2019-09-06 2020-02-11 腾讯科技(深圳)有限公司 Speech synthesis method, speech synthesis device, electronic equipment and storage medium
CN110808027A (en) * 2019-11-05 2020-02-18 腾讯科技(深圳)有限公司 Voice synthesis method and device and news broadcasting method and system
CN111899716A (en) * 2020-08-03 2020-11-06 北京帝派智能科技有限公司 Speech synthesis method and system
CN112509554A (en) * 2020-12-11 2021-03-16 平安科技(深圳)有限公司 Speech synthesis method, speech synthesis device, electronic equipment and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190172443A1 (en) * 2017-12-06 2019-06-06 International Business Machines Corporation System and method for generating expressive prosody for speech synthesis
CN110534089A (en) * 2019-07-10 2019-12-03 西安交通大学 A kind of Chinese speech synthesis method based on phoneme and rhythm structure
CN110782870A (en) * 2019-09-06 2020-02-11 腾讯科技(深圳)有限公司 Speech synthesis method, speech synthesis device, electronic equipment and storage medium
CN110808027A (en) * 2019-11-05 2020-02-18 腾讯科技(深圳)有限公司 Voice synthesis method and device and news broadcasting method and system
CN111899716A (en) * 2020-08-03 2020-11-06 北京帝派智能科技有限公司 Speech synthesis method and system
CN112509554A (en) * 2020-12-11 2021-03-16 平安科技(深圳)有限公司 Speech synthesis method, speech synthesis device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN112509554A (en) 2021-03-16

Similar Documents

Publication Publication Date Title
WO2022121158A1 (en) Speech synthesis method and apparatus, and electronic device and storage medium
WO2022121176A1 (en) Speech synthesis method and apparatus, electronic device, and readable storage medium
US8527276B1 (en) Speech synthesis using deep neural networks
CN110264991A (en) Training method, phoneme synthesizing method, device, equipment and the storage medium of speech synthesis model
US11488577B2 (en) Training method and apparatus for a speech synthesis model, and storage medium
WO2022227190A1 (en) Speech synthesis method and apparatus, and electronic device and storage medium
WO2022116420A1 (en) Speech event detection method and apparatus, electronic device, and computer storage medium
WO2022121157A1 (en) Speech synthesis method and apparatus, electronic device and storage medium
WO2022142105A1 (en) Text-to-speech conversion method and apparatus, electronic device, and storage medium
WO2021151344A1 (en) Somethod and apparatus for song synthesis, and computer readable storage medium
CN113345431B (en) Cross-language voice conversion method, device, equipment and medium
CN113642316B (en) Chinese text error correction method and device, electronic equipment and storage medium
CN113096242A (en) Virtual anchor generation method and device, electronic equipment and storage medium
CN104126200A (en) Acoustic processing unit
CN113205814B (en) Voice data labeling method and device, electronic equipment and storage medium
WO2022194062A1 (en) Disease label detection method and apparatus, electronic device, and storage medium
WO2021189984A1 (en) Speech synthesis method and apparatus, and device and computer-readable storage medium
CN115953997A (en) Unsupervised alignment of text-to-speech synthesis using neural networks
WO2021208700A1 (en) Method and apparatus for speech data selection, electronic device, and storage medium
WO2022121152A1 (en) Smart dialog method, apparatus, electronic device, and storage medium
CN114155832A (en) Speech recognition method, device, equipment and medium based on deep learning
CN116564322A (en) Voice conversion method, device, equipment and storage medium
CN115114408B (en) Multi-mode emotion classification method, device, equipment and storage medium
WO2022141867A1 (en) Speech recognition method and apparatus, and electronic device and readable storage medium
JP7349523B2 (en) Speech recognition method, speech recognition device, electronic device, storage medium computer program product and computer program

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21901875

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21901875

Country of ref document: EP

Kind code of ref document: A1