WO2022142105A1 - 文本转语音方法、装置、电子设备及存储介质 - Google Patents
文本转语音方法、装置、电子设备及存储介质 Download PDFInfo
- Publication number
- WO2022142105A1 WO2022142105A1 PCT/CN2021/096524 CN2021096524W WO2022142105A1 WO 2022142105 A1 WO2022142105 A1 WO 2022142105A1 CN 2021096524 W CN2021096524 W CN 2021096524W WO 2022142105 A1 WO2022142105 A1 WO 2022142105A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- text
- converted
- vector
- semantic
- pinyin
- Prior art date
- Legal status (The legal status 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 status listed.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G10—MUSICAL INSTRUMENTS; ACOUSTICS
- G10L—SPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
- G10L13/00—Speech synthesis; Text to speech systems
- G10L13/02—Methods for producing synthetic speech; Speech synthesisers
- G10L13/04—Details of speech synthesis systems, e.g. synthesiser structure or memory management
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/20—Natural language analysis
- G06F40/279—Recognition of textual entities
- G06F40/284—Lexical analysis, e.g. tokenisation or collocates
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/20—Natural language analysis
- G06F40/279—Recognition of textual entities
- G06F40/289—Phrasal analysis, e.g. finite state techniques or chunking
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/30—Semantic analysis
-
- G—PHYSICS
- G10—MUSICAL INSTRUMENTS; ACOUSTICS
- G10L—SPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
- G10L13/00—Speech synthesis; Text to speech systems
- G10L13/08—Text analysis or generation of parameters for speech synthesis out of text, e.g. grapheme to phoneme translation, prosody generation or stress or intonation determination
- G10L13/10—Prosody rules derived from text; Stress or intonation
Definitions
- the present application relates to the field of natural language processing, and in particular, to a text-to-speech method, apparatus, electronic device, and computer-readable storage medium.
- text-to-speech technology (TTS) has also become a hot technical breakthrough direction.
- text-to-speech technologies based on neural networks to improve the effect of data features, but the neural networks used are relatively simple, resulting in further improvements in the accuracy of text-to-speech.
- a text-to-speech method comprising:
- a text-to-speech device comprising:
- a text encoding module configured to receive the text to be converted, perform word embedding and position embedding on the text to be converted, and obtain a text encoding vector
- a part-of-speech tagging module configured to extract semantic information from the text encoding vector, obtain a semantic vector, and perform part-of-speech tagging on the text to be converted to obtain part-of-speech tagging information
- Tone Pinyin prediction module used to perform word segmentation on the text to be converted, obtain a phrase set, use the semantic vector and the part-of-speech tagging information to detect the pitch and pinyin of each group of phrases in the phrase set, and obtain the tone set and pinyin set;
- the tone-pinyin synthesis module is used for synthesizing the tone set and the pinyin set to obtain the voice of the text to be converted.
- An electronic device comprising:
- a processor that executes the instructions stored in the memory to achieve the following steps:
- 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:
- the present application can solve the low accuracy rate of text-to-speech.
- FIG. 1 is a schematic flowchart of a text-to-speech method provided by an embodiment of the present application
- FIG. 2 is a schematic flowchart of S1 in a text-to-speech method provided by an embodiment of the present application
- FIG. 3 is a schematic diagram of a module of a text-to-speech device provided by an embodiment of the present application.
- FIG. 4 is a schematic diagram of the internal structure of an electronic device for implementing a text-to-speech method provided by an embodiment of the present application
- Embodiments of the present application provide a text-to-speech method, and an execution body of the text-to-speech 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. kind.
- the text-to-speech 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 text-to-speech method includes:
- the text to be converted can be obtained according to user input or front-end program push, etc., for example, the user inputs text A to be converted: "urban development requires everyone's contribution”.
- the denoising process may use a regular expression constructed based on a programming language to complete the removal of noises such as emoticons and garbled characters.
- the embodiment of the present application uses the stuttering word segmentation method to perform word segmentation on the denoised text to be converted, and obtains a set of phrases to be converted corresponding to the text to be converted.
- the above text A to be converted "urban development requires everyone's contribution”.
- the corresponding conversion phrase sets are: "city”, “development”, “need”, “everyone”, “contribution”, “out”, “strength”. It can be seen that the number of converted phrase sets is 8, and 8 groups of empty vectors are correspondingly constructed in the embodiment of the present application, wherein the dimension of each group of vectors is 512.
- a one-hot model or a word2vec model may be used to map the set of phrases to be converted into the empty vector to obtain a set of word embedding vectors.
- the set of phrases to be converted is: “city”, “development”, “need”, “everyone”, “contribution”, “out”, “power”, wherein the phrase “city” to be converted is in the text
- a to be converted The position of "urban development requires everyone's contribution” is at the front, and the phrase “power” to be converted is at the end of the text to be converted, so as to obtain the phrase position set corresponding to the phrase set to be converted, and further according to the word2vec model,
- the set of position vectors is obtained by encoding the set of phrase positions.
- the word embedding vector set and the position vector set are combined according to the corresponding relationship, for example, the word embedding vector set is [a,b,c,d], and the position vector set is [r,t,y, u], the combined text encoding vector is [ar,bt,cy,du].
- the text encoding vector is obtained by combining the word embedding vector set and the position vector set, and the vector dimension in the word embedding vector set is 512, it can be seen that the text encoding vector has a The dimension of the vector is larger, so it is necessary to extract semantic information with a smaller dimension of the vector to reduce the computational pressure and facilitate the execution of subsequent steps.
- the step S2 includes: constructing and training a semantic extraction model, when the training is completed, extracting a self-attention calculation mechanism from the semantic extraction model, and using the self-attention calculation mechanism to extract the text encoding vector semantic information to obtain the semantic vector.
- the semantic extraction model adopts the currently disclosed transform model. Therefore, a transform model is constructed and trained first, wherein the transform model includes an encoding layer and a decoding layer, and the encoding layer includes a self-attention computing mechanism. After the training of the transform model is completed, the self-attention computing mechanism is extracted from the transform model.
- the self-attention computing mechanism is a mechanism that considers the semantic and grammatical connections between sentences and between different words in the text to be converted.
- the training semantic extraction model includes: acquiring a training text set and a semantic label set; inputting the training text set into the semantic extraction model, and calculating the similarity between each training text in the training text set and other training texts , obtain a similarity set; normalize the similarity set to obtain a weight set, and use the weight set to generate a coding vector set of the training text set; perform decoding operations on the coding vector set and the training text set, Obtain the semantic prediction set; calculate the error value between the semantic prediction set and the semantic label set, and judge whether the error value is within the preset error range, when the error value between the semantic prediction set and the semantic label set is not Within a preset error range, the internal parameters of the semantic extraction model are adjusted until the error value between the semantic prediction set and the semantic label set is within a preset error range, and the trained semantic extraction model is obtained.
- the semantic extraction model is trained by using the training text set and the semantic label set, such as extracting the training text I from the training text set, converting the training text I into a word vector, and multiplying it with other word vectors in the training text set, such as You, and, me and other word vectors, and then get the similarity, perform a normalization operation on the similarity to get the weight, and then continue to use the weight to multiply the word vectors such as you, and, me, etc., and finally add to construct the training text I. coding vector, and so on, to obtain the coding vector of each training text in the training text set, and sum up to obtain the coding vector set.
- the semantic label set such as extracting the training text I from the training text set, converting the training text I into a word vector, and multiplying it with other word vectors in the training text set, such as You, and, me and other word vectors, and then get the similarity, perform a normalization operation on the similarity to get the weight, and then continue to use the weight to multiply
- transform model decoding layer can be used to perform decoding operations on the encoding vector set and the training text set.
- the embodiment of the present application uses the least squares method to calculate the error value between the semantic prediction set and the semantic label set, until the error value meets the preset requirements, and the trained semantic extraction model is obtained .
- the self-attention computing mechanism is extracted from the trained semantic extraction model, wherein the self-attention computing mechanism extracts the semantic information of the text encoding vector, which is similar to the encoding vector set obtained by training the semantic extraction model, and mainly includes calculating similarities.
- a weight set is obtained from the degree set and the normalized similarity set, and the semantic vector of the text encoding vector is generated by using the weight set.
- the step S3 includes: converting the text to be converted into a word vector to be converted, and performing part-of-speech tagging on the to-be-converted word vector by using a CRF model to obtain the part-of-speech tagging information.
- the Word2Vec model is used to convert the text to be converted into a word vector to be converted.
- the above text A to be converted "City development requires everyone's contribution”
- the text to be converted is converted by the Word2Vec model.
- A is converted into the word vector to be converted:
- a CRF (Conditional Random Field) model is used to perform part-of-speech tagging on the to-be-converted word vector to obtain part-of-speech tagging information, where the part-of-speech tagging information is represented by a single-dimensional vector, such as Among them, 1 indicates that [17...26] represents a noun, 3 indicates that [94...37] is a verb, etc.
- the word segmentation method is used to perform word segmentation on the text to be converted, so as to obtain a phrase set.
- the step S5 includes: inputting the semantic vector and the part-of-speech tagging information into a pre-trained tone pinyin detection model, and using the tone pinyin detection model to detect the tone and tone of each group of phrases in the phrase set. Pinyin to obtain the tone set and the pinyin set.
- the pre-trained tone pinyin detection model includes:
- Step A Construct a tone pinyin detection model to be trained including a multi-head attention network and a linear activation layer.
- the step A includes: constructing the multi-head attention network according to a multi-head attention mechanism; constructing the linear activation layer by using a linear activation function, and combining the multi-head attention network and the linear activation layer to obtain the The tone pinyin detection model to be trained.
- 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 the same as the Transform model of the above S2, including an encoder and a decoder, wherein the encoder includes a multi-head attention mechanism.
- extracting The network layer where the multi-head attention mechanism is located is constructed to obtain the multi-head attention network.
- the present application constructs a linear activation layer to help the attention feature model to be trained to perform model training, wherein the linear activation layer includes a normalization and an activation function, and the activation function can use a Gaussian distribution function.
- the to-be-trained tone pinyin detection model is obtained by combining.
- Step B Receive a part-of-speech text training set and a tone-pinyin label set, and input the part-of-speech text training set into the to-be-trained tone-pinyin detection model for feature extraction to obtain a feature sequence training set.
- the part-of-speech text training set is a set including text and each word part-of-speech in the text collected and sorted out in advance by the user
- the tone-pinyin tag set is a voice set corresponding to the part-of-speech text training set and pinyin set, such as training text X 1 in the part-of-speech text training set: "city (noun) beautifying (verb), is (verb) a (quantifier) difficult (adjective) task (noun)", then in all
- speech Y 1 (y 1 ,y 2 ,..,y n )
- pinyin S 1 (s 1 ,s 2 ,..,s n ) in the predicate text training set, where y n represents the speech Y 1 A speech sequence, where the amplitude, size, etc. of the speech sequence can reflect the audio.
- Extracting to obtain a feature sequence training set includes: using the multi-head attention network to perform an encoding operation on the part-of-speech text training set to obtain the feature sequence training set.
- the manner of performing the encoding operation on the part-of-speech text training set is the same as the programming operation in the Transform model.
- Step C Use the linear activation layer to perform an activation operation on the feature sequence training set to obtain a tone-pinyin prediction set.
- using the linear activation layer to perform an activation operation on the feature sequence training set to obtain a predicted sequence set includes: performing normalization on the feature sequence training set to obtain a feature sequence normalized set, using The Gaussian distribution function calculates the Gaussian distribution of the normalized set of feature sequences, and obtains the tonal pinyin prediction 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 is a probability distribution showing data within a specified range
- the maximum probability distribution of the feature sequence training set is found from the Gaussian distribution, that is, the tonal pinyin prediction set is obtained.
- Step D Calculate the prediction error value of the tone pinyin prediction set and the tone pinyin tag set, and determine the magnitude relationship between the prediction error value and a preset error threshold.
- the squared difference formula is used to calculate the prediction error value of the tone-pinyin prediction set and the tone-pinyin tag set.
- Step E If the prediction error value is greater than the error threshold, adjust the internal parameters of the tone pinyin detection model to be trained, and return to Step B.
- Step F If the prediction error value is less than or equal to the error threshold, obtain the tone pinyin detection model.
- the error value is less than or equal to the error threshold, it indicates that the to-be-trained tone pinyin detection model has strong prediction ability.
- the semantic vector and the part-of-speech tagging information may be input into the tonal pinyin detection model to detect the phrase Collect the tones and pinyin of each group of phrases to obtain the tone set and the pinyin set.
- the tone set and the pinyin set are synthesized by using a vocoder synthesizer, which is a decoder that can realize speech synthesis.
- the pinyin set is input to the vocoder, and the speech of the text to be converted can be obtained.
- word embedding and position embedding are performed on the text to be converted to obtain a text encoding vector, and semantic information is extracted from the text encoding vector to obtain a semantic vector.
- the voice conversion operation is directly performed. Therefore, the embodiment of the present application improves the depth extraction of the text to be converted, and further, the embodiment of the present application combines the part-of-speech tagging information corresponding to the text to be converted.
- the embodiment of the present application further avoids the process of text-to-speech conversion, which is affected by the part of speech Problems that lead to inaccurate pronunciation of speech. Therefore, the text-to-speech method, device and computer-readable storage medium proposed in this application can solve the problem of low accuracy of text-to-speech.
- FIG. 3 it is a schematic diagram of the modules of the text-to-speech apparatus of the present application.
- the text-to-speech apparatus 100 described in this application can be installed in an electronic device.
- the text-to-speech apparatus may include a text encoding module 101 , a part-of-speech tagging module 102 , a tone-pinyin prediction module 103 , and a tone-pinyin 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 text encoding module 101 is configured to receive the text to be converted, perform word embedding and position embedding on the text to be converted, and obtain a text encoding vector;
- the part-of-speech tagging module 102 is configured to extract semantic information from the text encoding vector to obtain a semantic vector, and perform part-of-speech tagging on the text to be converted to obtain part-of-speech tagging information;
- the pitch and pinyin prediction module 103 is used to perform word segmentation on the text to be converted to obtain a phrase set, and use the semantic vector and the part-of-speech tagging information to detect the pitch and pinyin of each group of phrases in the phrase set to obtain the pitch Collection and Pinyin Collection;
- the tone-pinyin synthesis module 104 is configured to synthesize the tone set and the pinyin set to obtain the voice of the text to be converted.
- Each module in the text-to-speech device 100 provided by the embodiment of the present application can use the same means as the above-mentioned text-to-speech method, and the specific implementation steps will not be repeated here, regarding the functions of each module/unit
- the resulting technical effect is the same as that of the above-mentioned text-to-speech method, that is, the text-to-speech solution has a low accuracy rate.
- FIG. 4 it is a schematic structural diagram of an electronic device implementing the text-to-speech 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 text-to-speech 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 text-to-speech 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. text-to-speech programs, etc.), and call data stored in the memory 11 to perform 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 a variety of 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 text-to-speech 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:
- the modules/units integrated in the electronic device 1 may be stored in a computer-readable storage medium.
- the computer-readable storage medium may be volatile or non-volatile, and the computer-readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, Mobile 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 by at least one function, and the like; using the created data, etc.
- the present application also provides a computer-readable storage medium, where the readable storage medium stores a computer program, and when executed by a processor of an electronic device, the computer program can realize:
- modules described as separate components may or may not be physically separated, and 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)
- Theoretical Computer Science (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Health & Medical Sciences (AREA)
- Computational Linguistics (AREA)
- Physics & Mathematics (AREA)
- General Health & Medical Sciences (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Artificial Intelligence (AREA)
- Human Computer Interaction (AREA)
- Acoustics & Sound (AREA)
- Multimedia (AREA)
- Machine Translation (AREA)
Abstract
本申请涉及自然语言处理技术,揭露一种文本转语音方法,包括:接收待转换文本,对所述待转换文本执行字嵌入及位置嵌入,得到文本编码向量,从所述文本编码向量中提取语义信息,得到语义向量,对所述待转换文本执行词性标注,得到词性标注信息,对所述待转换文本执行分词,得到词组集,利用所述语义向量及所述词性标注信息,检测所述词组集中每组词组的音调及拼音,得到音调集及拼音集,合成所述音调集及所述拼音集,得到所述待转换文本的语音。本申请还揭露文本转语音装置、电子设备以及存储介质。本申请可解决文本转语音的准确率较低。
Description
本申请要求于2020年12月31日提交中国专利局、申请号为CN202011640955.5,发明名称为“文本转语音方法、装置、电子设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本申请涉及自然语言处理领域,尤其涉及一种文本转语音方法、装置、电子设备及计算机可读存储介质。
伴随人工智能蓬勃发展,文本转语音技术(TTS)也成为热点的技术突破方向,发明人意识到目前文本转语音技术主要结合中文分词、多音字消歧、韵律划分等传统方法,由于缺少对文本的深度提取,导致文本转语音的准确率较低。也有部分文本转语音技术基于神经网络来提升数据特征的效果,但所使用的神经网络较简单,导致文本转语音的准确率有待进一步提高。
发明内容
一种文本转语音方法,包括:
接收待转换文本,对所述待转换文本执行字嵌入及位置嵌入,得到文本编码向量;
从所述文本编码向量中提取语义信息,得到语义向量;
对所述待转换文本执行词性标注,得到词性标注信息;
对所述待转换文本执行分词,得到词组集;
利用所述语义向量及所述词性标注信息,检测所述词组集中每组词组的音调及拼音,得到音调集及拼音集;
合成所述音调集及所述拼音集,得到所述待转换文本的语音。
一种文本转语音装置,所述装置包括:
文本编码模块,用于接收待转换文本,对所述待转换文本执行字嵌入及位置嵌入,得到文本编码向量;
词性标注模块,用于从所述文本编码向量中提取语义信息,得到语义向量,对所述待转换文本执行词性标注,得到词性标注信息;
音调拼音预测模块,用于对所述待转换文本执行分词,得到词组集,利用所述语义向量及所述词性标注信息,检测所述词组集中每组词组的音调及拼音,得到音调集及拼音集;
音调拼音合成模块,用于合成所述音调集及所述拼音集,得到所述待转换文本的语音。
一种电子设备,所述电子设备包括:
存储器,存储至少一个指令;及
处理器,执行所述存储器中存储的指令以实现如下步骤:
接收待转换文本,对所述待转换文本执行字嵌入及位置嵌入,得到文本编码向量;
从所述文本编码向量中提取语义信息,得到语义向量;
对所述待转换文本执行词性标注,得到词性标注信息;
对所述待转换文本执行分词,得到词组集;
利用所述语义向量及所述词性标注信息,检测所述词组集中每组词组的音调及拼音,得到音调集及拼音集;
合成所述音调集及所述拼音集,得到所述待转换文本的语音。
一种计算机可读存储介质,包括存储数据区和存储程序区,存储数据区存储创建的数据,存储程序区存储有计算机程序;其中,所述计算机程序被处理器执行时实现如下步骤:
接收待转换文本,对所述待转换文本执行字嵌入及位置嵌入,得到文本编码向量;
从所述文本编码向量中提取语义信息,得到语义向量;
对所述待转换文本执行词性标注,得到词性标注信息;
对所述待转换文本执行分词,得到词组集;
利用所述语义向量及所述词性标注信息,检测所述词组集中每组词组的音调及拼音,得到音调集及拼音集;
合成所述音调集及所述拼音集,得到所述待转换文本的语音。
本申请可以解决文本转语音的准确率较低。
图1为本申请一实施例提供的文本转语音方法的流程示意图;
图2为本申请一实施例提供的文本转语音方法中S1的流程示意图;
图3为本申请一实施例提供的文本转语音装置的模块示意图;
图4为本申请一实施例提供的实现文本转语音方法的电子设备的内部结构示意图;
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。
应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
本申请实施例提供一种文本转语音方法,所述文本转语音方法的执行主体包括但不限于服务端、终端等能够被配置为执行本申请实施例提供的该方法的电子设备中的至少一种。换言之,所述文本转语音方法可以由安装在终端设备或服务端设备的软件或硬件来执行,所述软件可以是区块链平台。所述服务端包括但不限于:单台服务器、服务器集群、云端服务器或云端服务器集群等。
参照图1所示,为本申请一实施例提供的文本转语音方法的流程示意图。在本实施例中,所述文本转语音方法包括:
S1、接收待转换文本,对所述待转换文本执行字嵌入及位置嵌入,得到文本编码向量。
本申请实施例中,可根据用户输入或前端程序推送等得到待转换文本,如用户输入待转换文本A:“城市发展,需要每个人贡献出力量”。
进一步地,由于计算机无法有效从当前格式的待转换文本中提取语义信息,需要先将待转换文本转化为向量形式,详细地,参阅图1所示,所述对所述待转换文本执行字嵌入及位置嵌入,得到文本编码向量,包括:
S11、将所述待转换文本执行去噪及分词处理,得到待转换词组集;
由于待转换文本可能包含非文本数据,例如超链接、乱码等,因此需要对待转换文本进行执行去噪处理。本申请实施例中,去噪处理可采用基于编程语言为基础构建的正则表达式,完成去除如表情符号及乱码等噪声。
详细地,本申请实施例利用结巴分词方法,对去噪后的待转换文本执行分词,得到与待转换文本对应的待转换词组集。
S12、根据所述待转换词组集的数量,构建相同数量且向量维度固定的空向量,将所述待转换词组集中每个待转换词组映射至所述空向量中,得到字嵌入向量集;
如上述待转换文本A:“城市发展,需要每个人贡献出力量”对应的转换词组集为:“城市”、“发展”、“需要”、“每个人”、“贡献”、“出”、“力量”。可见转换词组集的数量为8,则本申请实施例对应构建8组空向量,其中每组向量维度均为512。
进一步地,本申请实施例可使用one-hot模型或word2vec模型,将待转换词组集映射至所述空向量中,得到字嵌入向量集。
S13、计算所述待转换词组集中每个待转换词组在所述待转换文本的位置,得到词组 位置集,根据所述词组位置集构建位置向量集;
如上述待转换词组集为:“城市”、“发展”、“需要”、“每个人”、“贡献”、“出”、“力量”,其中待转换词组“城市”在待转换文本A:“城市发展,需要每个人贡献出力量”的位置最靠前,待转换词组“力量”在待转换文本最靠后,从而汇总得到待转换词组集对应的词组位置集,并进一步根据word2vec模型,将所述词组位置集编码得到所述位置向量集。
S14、组合所述字嵌入向量集及所述位置向量集,得到所述文本编码向量。
本申请实施例中,按照对应关系组合所述字嵌入向量集及所述位置向量集,如字嵌入向量集为[a,b,c,d],位置向量集为[r,t,y,u],则组合后的文本编码向量为[ar,bt,cy,du]。
S2、从所述文本编码向量中提取语义信息,得到语义向量。
本申请实施例中,由于所述文本编码向量是由所述字嵌入向量集及所述位置向量集组合得到,且所述字嵌入向量集中向量维度为512,由此可见所述文本编码向量的向量维度更加庞大,因此需要提取出向量维度更小的语义信息,以减轻计算压力,并方便后续步骤执行。
详细地,所述S2包括:构建并训练语义提取模型,当训练完成时,从所述语义提取模型中提取自注意力计算机制,利用所述自注意力计算机制,提取所述文本编码向量的语义信息,得到所述语义向量。
本申请实施例中,所述语义提取模型采用当前已公开的transform模型。故先构建并训练transform模型,其中transform模型包括编码层、解码层,编码层包括自注意力计算机制,当transform模型训练完成后,从transform模型中提取所述自注意力计算机制。其中自注意力计算机制是一种考虑待转换文本中句子与句子之间,不同词语之间的语义以及语法联系的机制。
进一步地,所述训练语义提取模型包括:获取训练文本集及语义标签集;将所述训练文本集输入至语义提取模型中,计算所述训练文本集中每个训练文本与其他训练文本的相似度,得到相似度集;归一化所述相似度集得到权重集,利用所述权重集生成所述训练文本集的编码向量集;对所述编码向量集及所述训练文本集执行解码操作,得到语义预测集;计算所述语义预测集与所述语义标签集的误差值,判断所述误差值是否在预设误差范围内,当所述语义预测集与所述语义标签集的误差值不在预设误差范围内,调整所述语义提取模型的内部参数,直至所述语义预测集与所述语义标签集的误差值在预设误差范围内,得到训练完成的所述语义提取模型。
本申请实施例中,利用训练文本集和语义标签集训练语义提取模型,如从训练文本集中提取训练文本I,将训练文本I转为词向量,并和训练文本集中其他词向量相乘,如you、and、me等词向量,进而得到相似度,对相似度执行归一化操作得到权重,再继续利用权重和you、and、me等词向量相乘,最后相加构建出训练文本I的编码向量,以此类推,得到所述训练文本集内每个训练文本的编码向量,汇总得到所述编码向量集。
进一步地,可采用当前已公开的transform模型解码层的具体操作实例,对所述编码向量集及所述训练文本集执行解码操作。
当解码操作得到语义预测集时,本申请实施例利用最小二乘法计算所述语义预测集与所述语义标签集的误差值,直至误差值满足预设要求,得到训练完成的所述语义提取模型。
进一步地,从训练完成的语义提取模型中提取自注意力计算机制,其中自注意力计算机制提取所述文本编码向量的语义信息,与训练语义提取模型得到编码向量集相似,主要包括计算得到相似度集、归一化相似度集得到权重集,利用权重集生成所述文本编码向量的语义向量。
S3、对所述待转换文本执行词性标注,得到词性标注信息。
详细地,所述S3包括:将所述待转换文本转化为待转换词向量,利用CRF模型对所述待转换词向量执行词性标注,得到所述词性标注信息。
本申请实施例中,利用CRF(Conditional Random Field,条件随机场)模型对所述待转换词向量执行词性标注,得到词性标注信息,其中词性标注信息用单维向量表示,如
中,1表示[17…26]代表的是名词,3表示[94…37]是动词等。
S4、对所述待转换文本执行分词,得到词组集。
本申请实施例中,利用结巴分词方法对所述待转换文本执行分词,得到词组集。
S5、利用所述语义向量及所述词性标注信息,检测所述词组集中每组词组的音调及拼音,得到音调集及拼音集。
详细地,所述S5包括:将所述语义向量及所述词性标注信息输入至预先训练完成的音调拼音检测模型中,利用所述音调拼音检测模型,检测所述词组集中每组词组的音调及拼音,得到所述音调集及所述拼音集。
进一步地,预先训练完成的音调拼音检测模型包括:
步骤A:构建包括多头注意力网络及线性激活层的待训练音调拼音检测模型。
详细地,所述步骤A包括:根据多头注意力机制构建所述多头注意力网络;利用线性激活函数构建所述线性激活层,组合所述多头注意力网络及所述线性激活层,得到所述待训练音调拼音检测模型。
其中,所述根据多头注意力机制构建所述多头注意力网络,包括:接收已训练完成的Transform模型,从所述Transform模型中提取编码器,利用所述编码器内的多头注意力机制,构建得到所述多头注意力网络。
本申请实施例中,用户可提前训练完成Transform模型,所述Transform模型与上述S2的Transform模型相同,包括编码器、解码器,其中编码器中包括多头注意力机制,本申请实施例中,提取所述多头注意力机制所在的网络层,构建得到所述多头注意力网络。
本申请构建线性激活层帮助所述待训练注意力特征模型进行模型训练,其中所述线性激活层包括归一化和激活函数,所述激活函数可使用高斯分布函数。
进一步地,本申请实施例中,按照所述多头注意力网络在前,所述线性激活层在后的原则,组合得到所述待训练音调拼音检测模型。
步骤B:接收词性文本训练集及音调拼音标签集,将所述词性文本训练集输入至所述待训练音调拼音检测模型进行特征提取,得到特征序列训练集。
本申请实施例中,所述词性文本训练集是用户提前收集并整理出的包括文本及文本中每个词语词性的集合,所述音调拼音标签集是与所述词性文本训练集对应的语音集合及拼音集合,如所述词性文本训练集中有训练文本X
1:“城市(名词)美化(动词),是(动词)一项(量词)艰巨的(形容词)任务(名词)”,则在所述词性文本训练集中对应存在语音Y
1=(y
1,y
2,..,y
n)和拼音S
1=(s
1,s
2,..,s
n),其中y
n表示语音Y
1的语音序列,其中语音序列的振幅、大小等可体现出音频。
进一步地,当获得所述词性文本训练集后,利用所述待训练音调拼音检测模型进行特征提取,详细地,所述将所述词性文本训练集输入至所述待训练音调拼音检测模型进行特征提取,得到特征序列训练集,包括:利用所述多头注意力网络,对所述词性文本训练集执行编码操作,得到所述特征序列训练集。
本申请实施例中,对词性文本训练集执行编码操作的方式与Transform模型中编程操作相同。
步骤C:利用所述线性激活层,对所述特征序列训练集执行激活操作,得到音调拼音预测集。
详细地,所述利用所述线性激活层,对所述特征序列训练集执行激活操作,得到预测序列集,包括:对所述特征序列训练集执行归一化得到特征序列归一化集,利用所述高斯分布函数,计算所述特征序列归一化集的高斯分布,根据所述高斯分布得到所述音调拼音预测集。
详细地,所述归一化是将所述特征序列训练集内的数值映射至指定范围内的操作,如将所述特征序列训练集内的数值映射至[0,1]范围内,可有效缩小数值,减轻计算压力。
进一步地,所述利用所述高斯分布函数,计算所述特征序列归一化集的高斯分布,包括:利用所述高斯分布函数计算出所述特征序列归一化集的均值和方差,利用所述特征序列归一化集的均值和方差,求解出所述特征序列归一化集的高斯分布。
由于高斯分布是展现数据在指定范围内的概率分布,故本申请实施例中,从高斯分布中寻找出所述特征序列训练集的最大概率分布,即得到所述音调拼音预测集。
步骤D:计算所述音调拼音预测集与所述音调拼音标签集的预测误差值,并判断所述预测误差值与预设的误差阈值的大小关系。
本申请实施例中,利于平方差公式计算所述音调拼音预测集与所述音调拼音标签集的预测误差值。
步骤E:若所述预测误差值大于所述误差阈值,调整所述待训练音调拼音检测模型的内部参数,并返回步骤B。
步骤F:若所述预测误差值小于或等于所述误差阈值,得到所述音调拼音检测模型。
详细地,当所述误差值小于或等于所述误差阈值,表示所述待训练音调拼音检测模型具有较强的预测能力,。
本申请实施例中,当执行步骤A至步骤F得到训练完成的音调拼音检测模型后,进一步地,可将所述语义向量及所述词性标注信息输入至音调拼音检测模型中,检测所述词组集中每组词组的音调及拼音,得到所述音调集及所述拼音集。
S6、合成所述音调集及所述拼音集,得到所述待转换文本的语音。
本申请实施例中,利用声码合成器合成所述音调集及所述拼音集,声码合成器是一种可实现语音合成的译码器,本申请实施例中,将所述音调集及所述拼音集输入至所述声码合成器,即可得到所述待转换文本的语音。
本申请实施例在执行文本转语音之前,先对待转换文本执行字嵌入及位置嵌入得到文本编码向量,并从所述文本编码向量中提取语义信息得到语义向量,可见并非根据背景技术所述,将待转换文本执行中文分词、多音字消歧操作后直接进行转语音操作,故本申请实施例提高了对待转换文本的深度提取,且进一步地,本申请实施例结合待转换文本对应的词性标注信息,检测出待转换文本的音调集及拼音集,进而根据音调集及拼音集合成出语音,由于词性会影响语音的音调,因此本申请实施例进一步避免了在文本转语音过程中,受词性影响导致语音发音不准确的问题。因此本申请提出的文本转语音方法、装置及计算机可读存储介质,可以解决文本转语音的准确率较低。
如图3所示,是本申请文本转语音装置的模块示意图。
本申请所述文本转语音装置100可以安装于电子设备中。根据实现的功能,所述文本转语音装置可以包括文本编码模块101、词性标注模块102、音调拼音预测模块103及音调拼音合成模块104。本发所述模块也可以称之为单元,是指一种能够被电子设备处理器所执行,并且能够完成固定功能的一系列计算机程序段,其存储在电子设备的存储器中。
在本实施例中,关于各模块/单元的功能如下:
所述文本编码模块101,用于接收待转换文本,对所述待转换文本执行字嵌入及位置嵌入,得到文本编码向量;
所述词性标注模块102,用于从所述文本编码向量中提取语义信息,得到语义向量,对所述待转换文本执行词性标注,得到词性标注信息;
所述音调拼音预测模块103,用于对所述待转换文本执行分词,得到词组集,利用所述语义向量及所述词性标注信息,检测所述词组集中每组词组的音调及拼音,得到音调集及拼音集;
所述音调拼音合成模块104,用于合成所述音调集及所述拼音集,得到所述待转换文本的语音。
本申请实施例所提供的文本转语音装置100中的各个模块能够在使用时基于与上述的文本转语音方法采用相同的手段,具体地实施步骤在此不再赘述,关于各模块/单元的功能所产生技术效果与上述的文本转语音方法的技术效果相同的,即解决文本转语音的准确率较低。
如图4所示,是本申请实现文本转语音方法的电子设备的结构示意图。
所述电子设备1可以包括处理器10、存储器11和总线,还可以包括存储在所述存储器11中并可在所述处理器10上运行的计算机程序,如文本转语音程序12。
其中,所述存储器11至少包括一种类型的可读存储介质,所述可读存储介质包括闪存、移动硬盘、多媒体卡、卡型存储器(例如:SD或DX存储器等)、磁性存储器、磁盘、光盘等。所述存储器11在一些实施例中可以是电子设备1的内部存储单元,例如该电子设备1的移动硬盘。所述存储器11在另一些实施例中也可以是电子设备1的外部存储设备,例如电子设备1上配备的插接式移动硬盘、智能存储卡(Smart Media Card,SMC)、安全数字(Secure Digital,SD)卡、闪存卡(Flash Card)等。进一步地,所述存储器11还可以既包括电子设备1的内部存储单元也包括外部存储设备。所述存储器11不仅可以用于存储安装于电子设备1的应用软件及各类数据,例如文本转语音程序12的代码等,还可以用于暂时地存储已经输出或者将要输出的数据。
所述处理器10在一些实施例中可以由集成电路组成,例如可以由单个封装的集成电路所组成,也可以是由多个相同功能或不同功能封装的集成电路所组成,包括一个或者多个中央处理器(Central Processing unit,CPU)、微处理器、数字处理芯片、图形处理器及各种控制芯片的组合等。所述处理器10是所述电子设备的控制核心(Control Unit),利用各种接口和线路连接整个电子设备的各个部件,通过运行或执行存储在所述存储器11内的程序或者模块(例如执行文本转语音程序等),以及调用存储在所述存储器11内的数据,以执行电子设备1的各种功能和处理数据。
所述总线可以是外设部件互连标准(peripheral component interconnect,简称PCI)总线或扩展工业标准结构(extended industry standard architecture,简称EISA)总线等。该总线可以分为地址总线、数据总线、控制总线等。所述总线被设置为实现所述存储器11以及至少一个处理器10等之间的连接通信。
图4仅示出了具有部件的电子设备,本领域技术人员可以理解的是,图4示出的结构并不构成对所述电子设备1的限定,可以包括比图示更少或者更多的部件,或者组合某些部件,或者不同的部件布置。
例如,尽管未示出,所述电子设备1还可以包括给各个部件供电的电源(比如电池),优选地,电源可以通过电源管理装置与所述至少一个处理器10逻辑相连,从而通过电源管理装置实现充电管理、放电管理、以及功耗管理等功能。电源还可以包括一个或一个以上的直流或交流电源、再充电装置、电源故障检测电路、电源转换器或者逆变器、电源状态指示器等任意组件。所述电子设备1还可以包括多种传感器、蓝牙模块、Wi-Fi模块等,在此不再赘述。
进一步地,所述电子设备1还可以包括网络接口,可选地,所述网络接口可以包括有线接口和/或无线接口(如WI-FI接口、蓝牙接口等),通常用于在该电子设备1与其他电 子设备之间建立通信连接。
可选地,该电子设备1还可以包括用户接口,用户接口可以是显示器(Display)、输入单元(比如键盘(Keyboard)),可选地,用户接口还可以是标准的有线接口、无线接口。可选地,在一些实施例中,显示器可以是LED显示器、液晶显示器、触控式液晶显示器以及OLED(Organic Light-Emitting Diode,有机发光二极管)触摸器等。其中,显示器也可以适当的称为显示屏或显示单元,用于显示在电子设备1中处理的信息以及用于显示可视化的用户界面。
应该了解,所述实施例仅为说明之用,在专利申请范围上并不受此结构的限制。
所述电子设备1中的所述存储器11存储的文本转语音程序12是多个指令的组合,在所述处理器10中运行时,可以实现:
接收待转换文本,对所述待转换文本执行字嵌入及位置嵌入,得到文本编码向量;
从所述文本编码向量中提取语义信息,得到语义向量;
对所述待转换文本执行词性标注,得到词性标注信息;
对所述待转换文本执行分词,得到词组集;
利用所述语义向量及所述词性标注信息,检测所述词组集中每组词组的音调及拼音,得到音调集及拼音集;
合成所述音调集及所述拼音集,得到所述待转换文本的语音。
进一步地,所述电子设备1集成的模块/单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。所述计算机可读存储介质可以是易失性的,也可以是非易失性的,所述计算机可读介质可以包括:能够携带所述计算机程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(ROM,Read-Only Memory)。
进一步地,所述计算机可用存储介质可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序等;存储数据区可存储根据区块链节点的使用所创建的数据等。
本申请还提供一种计算机可读存储介质,所述可读存储介质存储有计算机程序,所述计算机程序在被电子设备的处理器所执行时,可以实现:
接收待转换文本,对所述待转换文本执行字嵌入及位置嵌入,得到文本编码向量;
从所述文本编码向量中提取语义信息,得到语义向量;
对所述待转换文本执行词性标注,得到词性标注信息;
对所述待转换文本执行分词,得到词组集;
利用所述语义向量及所述词性标注信息,检测所述词组集中每组词组的音调及拼音,得到音调集及拼音集;
合成所述音调集及所述拼音集,得到所述待转换文本的语音。
在本申请所提供的几个实施例中,应该理解到,所揭露的设备,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。
所述作为分离部件说明的模块可以是或者也可以不是物理上分开的,作为模块显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能模块的形式实现。
对于本领域技术人员而言,显然本申请不限于上述示范性实施例的细节,而且在不背离本申请的精神或基本特征的情况下,能够以其他的具体形式实现本申请。
因此,无论从哪一点来看,均应将实施例看作是示范性的,而且是非限制性的,本申请的范围由所附权利要求而不是上述说明限定,因此旨在将落在权利要求的等同要件的含义和范围内的所有变化涵括在本申请内。不应将权利要求中的任何附关联图表记视为限制所涉及的权利要求。
本申请所指区块链是分布式数据存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式。区块链(Blockchain),本质上是一个去中心化的数据库,是一串使用密码学方法相关联产生的数据块,每一个数据块中包含了一批次网络交易的信息,用于验证其信息的有效性(防伪)和生成下一个区块。区块链可以包括区块链底层平台、平台产品服务层以及应用服务层等。
此外,显然“包括”一词不排除其他单元或步骤,单数不排除复数。系统权利要求中陈述的多个单元或装置也可以由一个单元或装置通过软件或者硬件来实现。第二等词语用来表示名称,而并不表示任何特定的顺序。
最后应说明的是,以上实施例仅用以说明本申请的技术方案而非限制,尽管参照较佳实施例对本申请进行了详细说明,本领域的普通技术人员应当理解,可以对本申请的技术方案进行修改或等同替换,而不脱离本申请技术方案的精神和范围。
Claims (20)
- 一种文本转语音方法,其中,所述方法包括:接收待转换文本,对所述待转换文本执行字嵌入及位置嵌入,得到文本编码向量;从所述文本编码向量中提取语义信息,得到语义向量;对所述待转换文本执行词性标注,得到词性标注信息;对所述待转换文本执行分词,得到词组集;利用所述语义向量及所述词性标注信息,检测所述词组集中每组词组的音调及拼音,得到音调集及拼音集;合成所述音调集及所述拼音集,得到所述待转换文本的语音。
- 如权利要求1所述的文本转语音方法,其中,所述对所述待转换文本执行字嵌入及位置嵌入,得到文本编码向量,包括:将所述待转换文本执行去噪及分词处理,得到待转换词组集;根据所述待转换词组集的数量,构建相同数量且向量维度固定的空向量,将所述待转换词组集中每个待转换词组映射至所述空向量中,得到字嵌入向量集;计算所述待转换词组集中每个待转换词组在所述待转换文本的位置,得到词组位置集,根据所述词组位置集构建位置向量集;组合所述字嵌入向量集及所述位置向量集,得到所述文本编码向量。
- 如权利要求1所述的文本转语音方法,其中,所述从所述文本编码向量中提取语义信息,得到语义向量,包括:构建并训练语义提取模型,当训练完成时,从所述语义提取模型中提取自注意力计算机制;利用所述自注意力计算机制,提取所述文本编码向量的语义信息,得到所述语义向量。
- 如权利要求3所述的文本转语音方法,其中,所述训练语义提取模型,包括:获取训练文本集及语义标签集;将所述训练文本集输入至所述语义提取模型中,计算所述训练文本集中每个训练文本与其他训练文本的相似度,得到相似度集;归一化所述相似度集得到权重集,利用所述权重集生成所述训练文本集的编码向量集;对所述编码向量集及所述训练文本集执行解码操作,得到语义预测集;计算所述语义预测集与所述语义标签集的误差值,判断所述误差值是否在预设误差范围内;当所述误差值不在所述预设误差范围内,调整所述语义提取模型的内部参数,直至所述误差值在所述预设误差范围内,得到训练完成的所述语义提取模型。
- 如权利要求1所述的文本转语音方法,其中,所述对所述待转换文本执行词性标注,得到词性标注信息,包括:将所述待转换文本转化为待转换词向量,利用CRF模型对所述待转换词向量执行词性标注,得到所述词性标注信息。
- 如权利要求1所述的文本转语音方法,其中,所述利用所述语义向量及所述词性标注信息,检测所述词组集中每组词组的音调及拼音,得到音调集及拼音集,包括:将所述语义向量及所述词性标注信息输入至预先训练完成的音调拼音检测模型中;利用所述音调拼音检测模型,检测所述词组集中每组词组的音调及拼音,得到所述音调集及所述拼音集。
- 如权利要求1至6中任意一项所述的文本转语音方法,其中,所述预先训练完成的音调拼音检测模型,包括:步骤A:构建包括多头注意力网络及线性激活层的待训练音调拼音检测模型;步骤B:接收词性文本训练集及音调拼音标签集,将所述词性文本训练集输入至所述待训练音调拼音检测模型进行特征提取,得到特征序列训练集;步骤C:利用所述线性激活层,对所述特征序列训练集执行激活操作,得到音调拼音预测集;步骤D:计算所述音调拼音预测集与所述音调拼音标签集的预测误差值,并判断所述预测误差值与预设的误差阈值的大小关系;步骤E:若所述预测误差值大于所述误差阈值,调整所述待训练音调拼音检测模型的内部参数,并返回步骤B;步骤F:若所述预测误差值小于或等于所述误差阈值,得到所述音调拼音检测模型。
- 一种文本转语音装置,其中,所述装置包括:文本编码模块,用于接收待转换文本,对所述待转换文本执行字嵌入及位置嵌入,得到文本编码向量;词性标注模块,用于从所述文本编码向量中提取语义信息,得到语义向量,对所述待转换文本执行词性标注,得到词性标注信息;音调拼音预测模块,用于对所述待转换文本执行分词,得到词组集,利用所述语义向量及所述词性标注信息,检测所述词组集中每组词组的音调及拼音,得到音调集及拼音集;音调拼音合成模块,用于合成所述音调集及所述拼音集,得到所述待转换文本的语音。
- 一种电子设备,其中,所述电子设备包括:至少一个处理器;以及,与所述至少一个处理器通信连接的存储器;其中,所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行如下步骤:接收待转换文本,对所述待转换文本执行字嵌入及位置嵌入,得到文本编码向量;从所述文本编码向量中提取语义信息,得到语义向量;对所述待转换文本执行词性标注,得到词性标注信息;对所述待转换文本执行分词,得到词组集;利用所述语义向量及所述词性标注信息,检测所述词组集中每组词组的音调及拼音,得到音调集及拼音集;合成所述音调集及所述拼音集,得到所述待转换文本的语音。
- 如权利要求9所述的电子设备,其中,所述对所述待转换文本执行字嵌入及位置嵌入,得到文本编码向量,包括:将所述待转换文本执行去噪及分词处理,得到待转换词组集;根据所述待转换词组集的数量,构建相同数量且向量维度固定的空向量,将所述待转换词组集中每个待转换词组映射至所述空向量中,得到字嵌入向量集;计算所述待转换词组集中每个待转换词组在所述待转换文本的位置,得到词组位置集,根据所述词组位置集构建位置向量集;组合所述字嵌入向量集及所述位置向量集,得到所述文本编码向量。
- 如权利要求9所述的电子设备,其中,所述从所述文本编码向量中提取语义信息,得到语义向量,包括:构建并训练语义提取模型,当训练完成时,从所述语义提取模型中提取自注意力计算机制;利用所述自注意力计算机制,提取所述文本编码向量的语义信息,得到所述语义向量。
- 如权利要求11所述的电子设备,其中,所述训练语义提取模型,包括:获取训练文本集及语义标签集;将所述训练文本集输入至所述语义提取模型中,计算所述训练文本集中每个训练文本 与其他训练文本的相似度,得到相似度集;归一化所述相似度集得到权重集,利用所述权重集生成所述训练文本集的编码向量集;对所述编码向量集及所述训练文本集执行解码操作,得到语义预测集;计算所述语义预测集与所述语义标签集的误差值,判断所述误差值是否在预设误差范围内;当所述误差值不在所述预设误差范围内,调整所述语义提取模型的内部参数,直至所述误差值在所述预设误差范围内,得到训练完成的所述语义提取模型。
- 如权利要求9所述的电子设备,其中,所述对所述待转换文本执行词性标注,得到词性标注信息,包括:将所述待转换文本转化为待转换词向量,利用CRF模型对所述待转换词向量执行词性标注,得到所述词性标注信息。
- 如权利要求9所述的电子设备,其中,所述利用所述语义向量及所述词性标注信息,检测所述词组集中每组词组的音调及拼音,得到音调集及拼音集,包括:将所述语义向量及所述词性标注信息输入至预先训练完成的音调拼音检测模型中;利用所述音调拼音检测模型,检测所述词组集中每组词组的音调及拼音,得到所述音调集及所述拼音集。
- 如权利要求9至14中任意一项所述的电子设备,其中,所述预先训练完成的音调拼音检测模型,包括:步骤A:构建包括多头注意力网络及线性激活层的待训练音调拼音检测模型;步骤B:接收词性文本训练集及音调拼音标签集,将所述词性文本训练集输入至所述待训练音调拼音检测模型进行特征提取,得到特征序列训练集;步骤C:利用所述线性激活层,对所述特征序列训练集执行激活操作,得到音调拼音预测集;步骤D:计算所述音调拼音预测集与所述音调拼音标签集的预测误差值,并判断所述预测误差值与预设的误差阈值的大小关系;步骤E:若所述预测误差值大于所述误差阈值,调整所述待训练音调拼音检测模型的内部参数,并返回步骤B;步骤F:若所述预测误差值小于或等于所述误差阈值,得到所述音调拼音检测模型。
- 一种计算机可读存储介质,包括存储数据区和存储程序区,其中,所述存储数据区存储创建的数据,所述存储程序区存储有计算机程序;其中,所述计算机程序被处理器执行时实现如下步骤:接收待转换文本,对所述待转换文本执行字嵌入及位置嵌入,得到文本编码向量;从所述文本编码向量中提取语义信息,得到语义向量;对所述待转换文本执行词性标注,得到词性标注信息;对所述待转换文本执行分词,得到词组集;利用所述语义向量及所述词性标注信息,检测所述词组集中每组词组的音调及拼音,得到音调集及拼音集;合成所述音调集及所述拼音集,得到所述待转换文本的语音。
- 如权利要求16所述的计算机可读存储介质,其中,所述对所述待转换文本执行字嵌入及位置嵌入,得到文本编码向量,包括:将所述待转换文本执行去噪及分词处理,得到待转换词组集;根据所述待转换词组集的数量,构建相同数量且向量维度固定的空向量,将所述待转换词组集中每个待转换词组映射至所述空向量中,得到字嵌入向量集;计算所述待转换词组集中每个待转换词组在所述待转换文本的位置,得到词组位置集,根据所述词组位置集构建位置向量集;组合所述字嵌入向量集及所述位置向量集,得到所述文本编码向量。
- 如权利要求16所述的计算机可读存储介质,其中,所述从所述文本编码向量中提取语义信息,得到语义向量,包括:构建并训练语义提取模型,当训练完成时,从所述语义提取模型中提取自注意力计算机制;利用所述自注意力计算机制,提取所述文本编码向量的语义信息,得到所述语义向量。
- 如权利要求18所述的计算机可读存储介质,其中,所述训练语义提取模型,包括:获取训练文本集及语义标签集;将所述训练文本集输入至所述语义提取模型中,计算所述训练文本集中每个训练文本与其他训练文本的相似度,得到相似度集;归一化所述相似度集得到权重集,利用所述权重集生成所述训练文本集的编码向量集;对所述编码向量集及所述训练文本集执行解码操作,得到语义预测集;计算所述语义预测集与所述语义标签集的误差值,判断所述误差值是否在预设误差范围内;当所述误差值不在所述预设误差范围内,调整所述语义提取模型的内部参数,直至所述误差值在所述预设误差范围内,得到训练完成的所述语义提取模型。
- 如权利要求16所述的计算机可读存储介质,其中,所述对所述待转换文本执行词性标注,得到词性标注信息,包括:将所述待转换文本转化为待转换词向量,利用CRF模型对所述待转换词向量执行词性标注,得到所述词性标注信息。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202011640955.5 | 2020-12-31 | ||
| CN202011640955.5A CN112820269B (zh) | 2020-12-31 | 2020-12-31 | 文本转语音方法、装置、电子设备及存储介质 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2022142105A1 true WO2022142105A1 (zh) | 2022-07-07 |
Family
ID=75856433
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2021/096524 Ceased WO2022142105A1 (zh) | 2020-12-31 | 2021-05-27 | 文本转语音方法、装置、电子设备及存储介质 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN112820269B (zh) |
| WO (1) | WO2022142105A1 (zh) |
Cited By (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN116070595A (zh) * | 2023-03-07 | 2023-05-05 | 深圳市北科瑞讯信息技术有限公司 | 语音识别文本纠错方法、装置、电子设备及存储介质 |
| CN116668748A (zh) * | 2023-05-31 | 2023-08-29 | 平安科技(深圳)有限公司 | 基于培训场景的视频推荐方法、装置、设备及存储介质 |
| CN116805487A (zh) * | 2023-06-15 | 2023-09-26 | 平安科技(深圳)有限公司 | 文本纠正模型训练方法、装置、计算机设备及存储介质 |
| CN118571208A (zh) * | 2024-07-31 | 2024-08-30 | 世优(北京)科技股份有限公司 | 语音合成方法及装置 |
| CN118865944A (zh) * | 2024-09-24 | 2024-10-29 | 厦门市一码当先信息科技有限公司 | 一种基于神经网络模型实现小语种音频合成的系统 |
| CN119207379A (zh) * | 2024-09-18 | 2024-12-27 | 平安科技(深圳)有限公司 | 一种语音转换方法、装置、计算机设备及存储介质 |
| CN119993118A (zh) * | 2024-12-30 | 2025-05-13 | 北京捷通华声科技股份有限公司 | 基于音标和语义的语音生成方法及语音生成模型训练方法 |
Families Citing this family (9)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112820269B (zh) * | 2020-12-31 | 2024-05-28 | 平安科技(深圳)有限公司 | 文本转语音方法、装置、电子设备及存储介质 |
| CN113657109B (zh) * | 2021-08-31 | 2025-06-17 | 深圳平安医疗健康科技服务有限公司 | 基于模型的临床术语的标准化方法、装置和计算机设备 |
| CN113822049B (zh) * | 2021-09-29 | 2023-08-25 | 平安银行股份有限公司 | 基于人工智能的地址审核方法、装置、设备及存储介质 |
| CN114529862A (zh) * | 2021-11-11 | 2022-05-24 | 国网浙江省电力有限公司平湖市供电公司 | 一种soe信息的智能监控方法 |
| CN116264072B (zh) * | 2021-12-15 | 2026-04-14 | 航天信息股份有限公司 | 一种语音合成方法、装置及电子设备 |
| CN114781815A (zh) * | 2022-03-29 | 2022-07-22 | 长沙时代跳动科技有限公司 | 基于语音通知的人员调度方法、装置、设备及存储介质 |
| CN115547289A (zh) * | 2022-09-20 | 2022-12-30 | 出门问问信息科技有限公司 | 一种语音合成方法、装置、电子设备及存储介质 |
| CN115662435B (zh) | 2022-10-24 | 2023-04-28 | 福建网龙计算机网络信息技术有限公司 | 一种虚拟教师拟真化语音的生成方法及终端 |
| CN119864012A (zh) * | 2023-10-20 | 2025-04-22 | 北京字跳网络技术有限公司 | 语音合成方法、装置、电子设备和存储介质 |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1121654C (zh) * | 1999-07-29 | 2003-09-17 | 松下电器产业株式会社 | 汉字分段装置 |
| CN106504742A (zh) * | 2016-11-14 | 2017-03-15 | 海信集团有限公司 | 合成语音的传输方法、云端服务器和终端设备 |
| CN110534087A (zh) * | 2019-09-04 | 2019-12-03 | 清华大学深圳研究生院 | 一种文本韵律层级结构预测方法、装置、设备及存储介质 |
| CN112820269A (zh) * | 2020-12-31 | 2021-05-18 | 平安科技(深圳)有限公司 | 文本转语音方法、装置、电子设备及存储介质 |
Family Cites Families (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110288980A (zh) * | 2019-06-17 | 2019-09-27 | 平安科技(深圳)有限公司 | 语音识别方法、模型的训练方法、装置、设备及存储介质 |
| CN110782870B (zh) * | 2019-09-06 | 2023-06-16 | 腾讯科技(深圳)有限公司 | 语音合成方法、装置、电子设备及存储介质 |
| CN111144110B (zh) * | 2019-12-27 | 2024-06-04 | 科大讯飞股份有限公司 | 拼音标注方法、装置、服务器及存储介质 |
| CN111539211A (zh) * | 2020-04-17 | 2020-08-14 | 中移(杭州)信息技术有限公司 | 实体及语义关系识别方法、装置、电子设备及存储介质 |
| CN111813896B (zh) * | 2020-07-13 | 2022-12-02 | 重庆紫光华山智安科技有限公司 | 文本三元组关系识别方法、装置、训练方法及电子设备 |
-
2020
- 2020-12-31 CN CN202011640955.5A patent/CN112820269B/zh active Active
-
2021
- 2021-05-27 WO PCT/CN2021/096524 patent/WO2022142105A1/zh not_active Ceased
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1121654C (zh) * | 1999-07-29 | 2003-09-17 | 松下电器产业株式会社 | 汉字分段装置 |
| CN106504742A (zh) * | 2016-11-14 | 2017-03-15 | 海信集团有限公司 | 合成语音的传输方法、云端服务器和终端设备 |
| CN110534087A (zh) * | 2019-09-04 | 2019-12-03 | 清华大学深圳研究生院 | 一种文本韵律层级结构预测方法、装置、设备及存储介质 |
| CN112820269A (zh) * | 2020-12-31 | 2021-05-18 | 平安科技(深圳)有限公司 | 文本转语音方法、装置、电子设备及存储介质 |
Cited By (8)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN116070595A (zh) * | 2023-03-07 | 2023-05-05 | 深圳市北科瑞讯信息技术有限公司 | 语音识别文本纠错方法、装置、电子设备及存储介质 |
| CN116070595B (zh) * | 2023-03-07 | 2023-07-04 | 深圳市北科瑞讯信息技术有限公司 | 语音识别文本纠错方法、装置、电子设备及存储介质 |
| CN116668748A (zh) * | 2023-05-31 | 2023-08-29 | 平安科技(深圳)有限公司 | 基于培训场景的视频推荐方法、装置、设备及存储介质 |
| CN116805487A (zh) * | 2023-06-15 | 2023-09-26 | 平安科技(深圳)有限公司 | 文本纠正模型训练方法、装置、计算机设备及存储介质 |
| CN118571208A (zh) * | 2024-07-31 | 2024-08-30 | 世优(北京)科技股份有限公司 | 语音合成方法及装置 |
| CN119207379A (zh) * | 2024-09-18 | 2024-12-27 | 平安科技(深圳)有限公司 | 一种语音转换方法、装置、计算机设备及存储介质 |
| CN118865944A (zh) * | 2024-09-24 | 2024-10-29 | 厦门市一码当先信息科技有限公司 | 一种基于神经网络模型实现小语种音频合成的系统 |
| CN119993118A (zh) * | 2024-12-30 | 2025-05-13 | 北京捷通华声科技股份有限公司 | 基于音标和语义的语音生成方法及语音生成模型训练方法 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN112820269B (zh) | 2024-05-28 |
| CN112820269A (zh) | 2021-05-18 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2022142105A1 (zh) | 文本转语音方法、装置、电子设备及存储介质 | |
| CN113205814B (zh) | 语音数据标注方法、装置、电子设备及存储介质 | |
| WO2022134759A1 (zh) | 关键词生成方法、装置、电子设备及计算机存储介质 | |
| CN112466273B (zh) | 语音合成方法、装置、电子设备及存储介质 | |
| CN112002323B (zh) | 语音数据处理方法、装置、计算机设备及存储介质 | |
| WO2022121176A1 (zh) | 语音合成方法、装置、电子设备及可读存储介质 | |
| JP2022145623A (ja) | ヒント情報を提示する方法及び装置並びにコンピュータプログラム | |
| WO2022227190A1 (zh) | 语音合成方法、装置、电子设备及存储介质 | |
| CN113380223B (zh) | 多音字消歧方法、装置、系统及存储介质 | |
| CN114020886A (zh) | 语音意图识别方法、装置、设备及存储介质 | |
| CN114863945A (zh) | 基于文本的语音变声方法、装置、电子设备及存储介质 | |
| CN103050115A (zh) | 识别装置、识别方法、生成装置和生成方法 | |
| CN112507663B (zh) | 基于文本的判断题生成方法、装置、电子设备及存储介质 | |
| CN110852040A (zh) | 一种标点预测模型训练方法及文本标点确定方法 | |
| WO2022121158A1 (zh) | 语音合成方法、装置、电子设备及存储介质 | |
| WO2022141867A1 (zh) | 语音识别方法、装置、电子设备及可读存储介质 | |
| CN114416987A (zh) | 基于人工智能的文本分类方法、装置、设备及存储介质 | |
| CN113160793A (zh) | 基于低资源语言的语音合成方法、装置、设备及存储介质 | |
| CN114038450A (zh) | 方言识别方法、装置、设备及存储介质 | |
| CN107992466A (zh) | 一种基于句式控制的宋词载体文本信息隐藏方法、系统 | |
| CN113889145B (zh) | 语音核验方法、装置、电子设备及介质 | |
| CN115565529A (zh) | 基于语音识别的3d模型控制方法、装置、设备和存储介质 | |
| CN111985231A (zh) | 无监督角色识别方法、装置、电子设备及存储介质 | |
| CN115273800B (zh) | 基于人工智能的文言文语音合成方法、装置、设备及介质 | |
| CN118135996A (zh) | 语音合成方法、装置、设备及存储介质 |
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: 21912866 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: 21912866 Country of ref document: EP Kind code of ref document: A1 |
