Text processing, model training and speech synthesis method, device, system and medium
By splitting non-standardized words into sub-non-standardized words and performing text standardization based on their patterns, the problems of high learning difficulty and high maintenance cost in existing technologies are solved, achieving more efficient and better text standardization results.
Patent Information
- Application Number
- CN202210395460.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-14
- Publication Date
- 2026-02-13
- Estimated Expiration
- 2042-04-14
AI Technical Summary
The diversity and complexity of non-standardized words in existing technologies increase the learning difficulty and maintenance cost of text annotation models, thus affecting the effectiveness of text standardization models.
Non-standardized words are broken down into sub-non-standardized words consisting of simple numbers, letters, or symbols. Text standardization is then performed based on the patterns of these sub-non-standardized words, including identification, splitting, and sorting. Annotators and converter models are then used for training and conversion.
It achieves higher efficiency and better performance in text standardization tasks, simplifies the design and construction of annotators and transformers, and improves the accuracy and applicability of text standardization models.
Smart Images

Figure CN114822491B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of speech synthesis, in particular, to a text processing method, device and system, a storage medium and a model training method, device and system, a storage medium and a speech synthesis method, device and system, and a storage medium. BACKGROUND
[0002] Text normalization (TN) is a very important link in a text to speech (TTS) system, and is crucial for semantic understanding of speech synthesis. Text normalization is the process of converting a non-standard word (NSW) into a spoken-form word (SFW) to eliminate ambiguity.
[0003] Most of the current text normalization implementations are based on non-standard words. The diversity and complexity of non-standard words increase the difficulty of learning and maintenance cost of text annotation models. SUMMARY
[0004] In order to at least partially solve the problems existing in the prior art, an acoustic model training method, device and system, and a storage medium, and a speech synthesis method, device and system, and a storage medium are provided.
[0005] According to an aspect of the present application, an acoustic model training method is provided, comprising: obtaining a to-be-processed text; identifying a non-standard word from the to-be-processed text; splitting the non-standard word in the to-be-processed text to obtain splitting information, wherein the splitting information includes a sub-non-standard word of the non-standard word contained in the to-be-processed text and type information of the sub-non-standard word, and the sub-non-standard word is a pure number, a pure letter or a pure symbol; and based on the splitting information, the to-be-processed text is arranged to obtain text normalization data, the text normalization data includes a sub-non-standard word sequence extracted from the to-be-processed text, a standard character sequence in the to-be-processed text except the sub-non-standard word sequence, and label information, the label information includes type information of each sub-non-standard word in the non-standard word sequence and type information of each standard character in the standard character sequence.
[0006] According to another aspect of the present application, a model training method is also provided, comprising: obtaining the to-be-processed text and the splitting information involved in the text processing method of the preceding claims; taking the to-be-processed text as the input of the annotator model and taking the splitting information as the target output of the annotator model, and training the annotator model.
[0007] According to another aspect of the present application, there is also provided a speech synthesis method, comprising: obtaining a text to be synthesized; processing the text to be synthesized by using the text processing method to obtain text normalization data corresponding to the text to be synthesized, or inputting the text to be synthesized into a tagger model involved in the model training method to obtain split information corresponding to the text to be synthesized, and collating the text to be synthesized based on the split information corresponding to the text to be synthesized to obtain text normalization data corresponding to the text to be synthesized; inputting the text normalization data corresponding to the text to be synthesized into a converter model to obtain a read-form word text corresponding to the text to be synthesized; and converting the read-form word text into speech to obtain target speech.
[0008] According to another aspect of the present application, there is also provided a text processing apparatus, comprising: an obtaining module configured to obtain a text to be processed; an identifying module configured to identify a non-normalized word from the text to be processed; a splitting module configured to split the non-normalized word in the text to be processed to obtain split information, wherein the split information comprises a sub-non-normalized word of the non-normalized word contained in the text to be processed and type information of the sub-non-normalized word, and the sub-non-normalized word is a pure number, a pure letter or a pure symbol; and a collating module configured to collate the text to be processed based on the split information to obtain text normalization data, wherein the text normalization data comprises a sequence of sub-non-normalized words extracted from the text to be processed, a sequence of standard characters in the text to be processed except the sequence of sub-non-normalized words, and label information, and the label information comprises type information of each sub-non-normalized word in the sequence of non-normalized words and type information of each standard character in the sequence of standard characters.
[0009] According to another aspect of the present application, there is also provided a model training apparatus, comprising: an obtaining module configured to obtain a text to be processed and split information involved in the text processing method; and a training module configured to train a tagger model by taking the text to be processed as an input of the tagger model and taking the split information as a target output of the tagger model.
[0010] According to another aspect of the present application, there is also provided a speech synthesis device, comprising: an obtaining module configured to obtain a text to be synthesized; a processing or inputting module configured to process the text to be synthesized by using the text processing method to obtain text normalization data corresponding to the text to be synthesized, or input the text to be synthesized into a labeler model involved in the model training method to obtain split information corresponding to the text to be synthesized, and collate the text to be synthesized based on the split information corresponding to the text to be synthesized to obtain the text normalization data corresponding to the text to be synthesized; an inputting module configured to input the text normalization data corresponding to the text to be synthesized into a converter model to obtain a read-form word text corresponding to the text to be synthesized; and a converting module configured to convert the read-form word text into speech to obtain target speech.
[0011] According to another aspect of the present application, there is also provided a text processing system, comprising a processor and a memory, wherein the memory stores computer program instructions, and the computer program instructions are used to execute the text processing method when executed by the processor.
[0012] According to another aspect of the present application, there is also provided a model training system, comprising a processor and a memory, wherein the memory stores computer program instructions, and the computer program instructions are used to execute the model training method when executed by the processor.
[0013] According to another aspect of the present application, there is also provided a speech synthesis system, comprising a processor and a memory, wherein the memory stores computer program instructions, and the computer program instructions are used to execute the speech synthesis method when executed by the processor.
[0014] According to another aspect of the present application, there is also provided a storage medium, wherein the storage medium stores program instructions, and the program instructions are used to execute the text processing method when executed.
[0015] According to another aspect of the present application, there is also provided a storage medium, wherein the storage medium stores program instructions, and the program instructions are used to execute the model training method when executed.
[0016] According to another aspect of the present application, there is also provided a storage medium, wherein the storage medium stores program instructions, and the program instructions are used to execute the speech synthesis method when executed.
[0017] According to the technical solution, the non-standardized words in the to-be-processed text are recognized and split, and the to-be-processed text is arranged based on the split information to obtain text standardization data, so that fine-grained conversion of the text standardization data can be realized. The text standardization data obtained by the scheme can be used for training the annotator in the text standardization model or for further conversion of the reading form words, so that the final text standardization task becomes simpler, more efficient and better in performance.
[0018] A series of simplified forms are introduced in the summary, which will be described in detail in the specific embodiments. The summary part does not mean to try to limit the key features and essential technical features of the claimed technical solutions, nor to try to determine the protection scope of the claimed technical solutions.
[0019] The advantages and features of the present application will be described in detail below with reference to the accompanying drawings. BRIEF DESCRIPTION OF DRAWINGS
[0020] The following drawings of the present application are hereby incorporated as part of the present application for understanding the present application. The embodiments of the present application and the description thereof shown in the drawings are used to explain the principles of the present application. In the drawings,
[0021] Figure 1 A schematic flowchart of a text processing method according to one embodiment of the present application is shown;
[0022] Figure 2 A schematic flowchart of a text processing method according to one embodiment of the present application is shown;
[0023] Figure 3 A schematic flowchart of a model training method according to one embodiment of the present application is shown;
[0024] Figure 4 A schematic flowchart of a speech synthesis method according to one embodiment of the present application is shown;
[0025] Figure 5 A schematic block diagram of a text processing apparatus according to one embodiment of the present application is shown;
[0026] Figure 6 A schematic block diagram of a model training apparatus according to one embodiment of the present application is shown;
[0027] Figure 7 A schematic block diagram of a speech synthesis apparatus according to one embodiment of the present application is shown. DETAILED DESCRIPTION
[0028] In the following description, numerous specific details are provided in order to provide a thorough understanding of the present application. One of ordinary skill in the art will realize, however, that the application can be practiced without one or more of these details. In other instances, well-known features have not been described in detail in order not to unnecessarily obscure the present application.
[0029] Text normalization is generally implemented by splitting a text normalization model into a tagger and a converter in technical implementation, which constitutes a pipeline as a whole. The main role of the tagger is to identify the type and boundary of the non-standardized word, and the converter is to further convert the non-standardized word into a read-form word based on the result of the tagger, so as to realize text normalization.
[0030] The inventors find that the type and boundary information of the non-standardized word in the text normalization dataset is crucial to the text normalization model, and the complexity of the non-standardized word will also determine the difficulty of the converter. In the existing text normalization technology, due to the complex internal combination mode and external collocation mode of the non-standardized word, there are cases such as multiple sub-patterns of the same type of non-standardized word, too long non-standardized word, ambiguous non-standardized word category, etc., which will increase the difficulty of designing / building the tagger and the converter as a whole, and further affect the final effect of the text normalization model. For example, for a neural network-based tagger, the model needs to learn to predict the type and boundary of the non-standardized word, and the diversity and complexity of the non-standardized word will increase the difficulty of model learning. In addition, for the converter based on the non-standardized word, a function set needs to be constructed for all sub-patterns of the non-standardized word, and the function is complex and has high maintenance cost.
[0031] To at least partially solve the above technical problems, embodiments of the present application provide a text processing, model training and speech synthesis method, device and system and storage medium. The text processing, model training and speech synthesis method and device according to embodiments of the present application improve the existing speech synthesis system and optimize the text normalization task therein. The present application divides non-standardized words into sub-non-standardized words containing only simple numbers, only simple letters or only simple symbols. The mode of the sub-non-standardized words is simple, and it is easier to realize the conversion of read-form words based thereon. For example, the speech synthesis system can include a tagger and a converter. When performing the text normalization task of modeling context information using a neural network, the tagger in its model can identify and extract the text to be processed based on the mode of the sub-non-standardized words, and the converter converts the read-form words based on the mode of the sub-non-standardized words. Since the mode structure of the sub-non-standardized words is simple, the design and construction of the standardizer and the converter are easier, and therefore the implementation efficiency of the text normalization task is higher and the expected performance is better. The text processing, model training and speech synthesis method provided by embodiments of the present application can be applied to various fields using speech synthesis technology, such as language translation, map navigation, voice assistants, education, entertainment and other software applications, and smart speakers, home appliances, robots and other hardware devices.
[0032] First, a text processing method according to embodiments of the present application will be described with reference to Figure 1 Figure 1 A schematic flowchart of a text processing method 1000 according to embodiments of the present application is shown. As Figure 1 shown, the text processing method includes steps S1100, S1200, S1300 and S1400.
[0033] In step S1100, a text to be processed is obtained.
[0034] The text to be processed can be any form of text, including but not limited to text in txt format, word format or pdf format. The text to be processed can include Chinese, English, Japanese and other language characters, abbreviations, Arabic numerals, punctuation marks or other special symbols such as “%”, “‰”, “#” and the like.
[0035] The text to be processed can include standardized words and non-standardized words, or only non-standardized words. The non-standardized words can be a combination of numbers, letters, symbols and abbreviations, or any combination thereof. The non-standardized words can be divided into date type non-standardized words, number type non-standardized words, letter type non-standardized words and symbol type non-standardized words according to type. <date>, time class <time>, quantifier class <quantifier>, real numbers <real>, currency <money>• mathematical expression class 、编号类(序数类) <cardinal> 、电报数字类 <digit> 等多种类型。每一种类型的非标准化词又可进一步分成不同的子模式,例如DATE类型的非标准化词可分为年月日(2021 / 10 / 09)、年月(2021 / 10)、月日(10 / 09)、年月日-年月日(2021 / 10 / 01-2021 / 10 / 09)等多种子模式。
[0036] 待处理文本可以由用户直接编辑输入,也可以是现有的需要处理的文本库中的全部或部分文本。示例性地,待处理文本可以是一句话。例如,待处理文本为"原配陆静华(1898-1968年6月23日),1918年结婚,生一子二女”。
[0037] 步骤S1200,从待处理文本中识别非标准化词。
[0038] 步骤S1200可以采用现有的或将来可能出现的任何合适的能够识别非标准化词的识别算法来实现。例如,可以通过标注器识别待处理文本中的非标准化词。示例性而非限制性地,标注器可以是诸如常规TTS系统中的标注器。当然,可选地,标注器也可以是独立的模块,不依附TTS系统而存在。在一个示例中,可以将待处理文本输入TTS系统中进行非标准化词的识别,该TTS系统可以是现有的或将来可能出现的任何合适的具备语言分析处理能力的系统。示例性地,TTS系统接收输入的待处理文本后,可以首先进行语种判断,例如判定该文本属于中文还是英文或是其他语种,然后根据对应语种的语法规则进行文本结构的判断。示例性地,当待处理文本为整段文字时,TTS系统可以将整段文字切分为单个的句子,并基于切分好的句子进行包括识别非标准化词在内的后续处理。
[0039] 识别非标准化词的过程是从待处理文本中将非标准化词标记出的过程,包括识别并标记非标准化词的类型和非标准化词的边界。示例性地,TTS系统可以是基于规则的,也可以是基于神经网络的,或者是同时基于规则和神经网络的等。基于神经网络的TTS系统可以包括有上述标注器,由标注器识别并标记待处理文本中的非标准化词,并输出非标准化词的类型和非标准化词的边界信息。如前所述,非标准化词可以是例如数字、字母、符号、缩略语等。在一个示例中,可以将待处理文本"预计2021 / 10 / 09号开学”输入TTS系统中,TTS系统中的标注器识别其中的非标准化词"2021 / 10 / 09”,表示为"NSW:2021 / 10 / 09”。同时,标注器标注并输出非标准化词的类型为"日期 <date> ”、标记并输出非标准化词的边界为"[4,13]”。
[0040] 步骤S1300,对待处理文本中的非标准化词进行拆分,以获得拆分信息,其中,拆分信息包括待处理文本中包含的非标准化词的子非标准化词及子非标准化词的类型信息,其中,子非标准化词为单纯的数字、单纯的字母或单纯的符号。
[0041] 可以通过非标准化词拆分模型执行步骤S1300中的非标准化词的拆分。示例性而非限制性地,可以在TTS系统中加载该非标准化词拆分模型,以实现在TTS系统中的非标准化词拆分。当然,可选地,非标准化词拆分模型也可以是独立的模型,不依附TTS系统而存在。该非标准化词拆分模型可以是基于规则的,根据设定的拆分规则将上述步骤S1200中的识别到的非标准化词转换为子非标准化词。拆分规则可以包括将单个或多个连续的单纯数字、单个或多个连续的单纯字母、或单个或多个连续的单纯的符号等形式的字串作为一个子非标准化词。例如:非标准化词拆分模型可以将非标准化词"2021 / 10 / 01-2021 / 10 / 07”拆分为子非标准化词"2021”、" / ”、"10”、" / ”、"01”、"-”、"2021”、" / ”、"10”、" / ”、"07”;每个子非标准化词的类型分别为"DIGIT”、"SLASH_YEAR”、"CARDINAL”、"SLASH_MONTH”、"DAY_CARDINAL”、"HYPHEN_RANGE”、"DIGIT”、"SLASH_YEAR”、"CARDINAL”、"SLASH_MONTH”、"DAY_CARDINAL”。在该示例中,拆分出的子非标准化词包括单纯的数字"2021”、"10”、"07”、"01”,以及单纯的符号"-”、" / ”。
[0042] 在以上示例中,"DIGIT”表示电报数字类,其读法为数字的电报读法。例如,"拨打报警电话110”这句话中的"110”就属于电报读法,逐字符读出每个数字即可。"SLASH_YEAR”表示日期中"年”后面的用于划界的符号,例如" / ”、"-”等。"SLASH_MONTH”表示日期中"月”后面的用于划界的符号,例如" / ”、"-”等。"CARDINAL”表示编号类,其读法为数字的数值读法。例如,"23点59分”中的"23”和"59”都属于数值读法。"DAY_CARDINAL”表示位于日期类NSW末尾的表示"DAY”的数字,转换为朗读形式词时需要添加"日 / 号”。例如,"2021 / 09 / 06”中的"06”,转换时需要在"06”的转换结果后面添加"日 / 号”。"HYPHEN_RANGE”表示读作"到 / 至”的横杠等符号,表示一种区间。
[0043] 步骤S1400,基于拆分信息对待处理文本进行整理,以获得文本标准化数据,其中,文本标准化数据包括从待处理文本中提取出的子非标准化词序列、待处理文本中除子非标准化词序列以外的标准字符序列以及标签信息,标签信息包括非标准化词序列中的每个子非标准化词的类型信息以及标准字符序列中的每个标准字符的类型信息。
[0044] 可以理解,对于一段待处理文本而言,将识别到的非标准化词拆分为若干个子非标准化词,每个子非标准化词又匹配固定的类型信息。一段非标准化词中的所有的子非标准化词及其类型信息连接在一起,可以组成子非标准化词序列和该序列的标签信息。标签信息包括每个子非标准化词的类型信息。将一段非标准化词拆分为子非标准化词后得到的子非标准化词序列及其标签信息中,子非标准化词的数量与其类型信息的数量是一致的。例如,在将非标准化词"2021 / 10 / 01-2021 / 10 / 07”拆分为子非标准化词的示例中,拆分后的子非标准化词的数量为11个,相应地,其得到的标签信息中的类型信息的数量也是11个。由此可以保证拆分后的子非标准化词可以在后续的处理操作中可以被完整和准确地识别到。
[0045] 在一个示例中,对于包括标准化词和非标准化词的待处理文本,基于拆分信息,将其中的非标准化词拆分后,提取出子非标准化词与子非标准化词的类型信息;此外,针对其中的标准化词,可以提取出这些标准化词中的每个标准字符及标准字符的类型信息。标准化词的类型信息和非标准化词的类型信息视为标签信息。将这些提取出来的非标准化词、标准字符以及各自的类型信息按照预设的格式整理后得到包括子非标准化词序列、除子非标准化词序列以外的标准字符序列以及标签信息在内的文本标准化数据。
[0046] 示例性而非限制性地,整理的格式规则可以包括:每个子非标准化词和每个标准字符按照各自在待处理文本中的原本顺序依次排列,例如依次排列为第一列或第一行;与此同时,与每个非标准化词和每个标准字符对应的类型信息也按照该次序排列,例如排列为第二列或第二行;并且,每个非标准化词和每个标准字符与其对应的类型信息关联性排列,例如,排列在同一行或同一列上。
[0047] 图2示出根据本发明一个实施例的对待处理文本进行文本处理的示意性流程图。参见 图2,示出待处理文本为"预计2021 / 10 / 09号开学”。针对该文本,可以首先通过标注器从中识别非标准化词,包括提取该标准化词并识别其类型和边界信息。"预计2021 / 10 / 09号开学”中的非标准化词是"2021 / 10 / 09”,其类型是"日期 <date> ”,边界为"[4,13]”。随后,可以将非标准化词的识别结果输入非标准化词拆分模型。非标准化词拆分模型可以输出子非标准化词序列及其类型信息。参考 图2,示出"预计2021 / 10 / 09号开学”的子非标准化词(SUB_NSW)序列及其类型信息。
[0048] 随后,对于待处理文本"预计2021 / 10 / 09号开学”,基于拆分信息可以将其整理为如下格式:
[0049]
[0050] 在上述示例中,"SELF”为标准字符的类型信息,代表为非文本标准化(非TN)数据段或者为无需转换的片段,"所见即所读”,转换时直接转换为字符或片段本来的读法即可。剩余类型信息的含义已在上文描述,此处不再赘述。
[0051] 在一个实施例中,通过 图1所示的文本处理方法1000获得的文本标准化数据可以用作标注器的训练数据。
[0052] 示例性地,可以通过第一标注器实现 图1中的步骤S1200。即,第一标注器可以用于从待处理文本中识别非标准化词。识别出的非标准化词可以进一步进行拆分等处理。示例性地,可以将通过文本处理方法1000处理获得的拆分信息作为第二标注器的目标输出,并将待处理文本作为第二标注器的输入,来对第二标注器进行训练。第二标注器可以用于从待处理文本中识别子非标准化词。第一标注器和第二标注器可以都是用于文本标准化任务的标注器模型。相比于第一标注器来说,第二标注器可以实现从待处理文本到子非标准化词的转换,而无需再进行额外的拆分。即,通过第一标注器识别并进一步拆分获得的拆分信息可以作为第二标注器的训练数据。这样训练获得的第二标注器便于后续进行子非标准化词的快速、直接转换。
[0053] 在另一个实施例中,通过 图1所示的文本处理方法1000获得的文本标准化数据可以用于进行后续的转换,以将其转换为朗读形式词文本,进而用于合成目标语音或进一步用于其他目的。
[0054] 示例性地,上述第一标注器和第二标注器可以包括诸如spaCy词性标注模型。可以采用合适的模型训练方法例如基于Spark分布式平台进行模型训练和调优。在训练的过程中,可以根据实际情况扩展非标准化词和 / 或子非标准化词的类型,同时可以确保每个非标准化词和 / 或子非标准化词的类别是相互独立的,不存在类别歧义。
[0055] 根据上述技术方案,通过识别并拆分待处理文本中的非标准化词,并基于拆分信息对待处理文本进行整理来获得文本标准化数据,可以实现文本标准化数据的细粒度转换。这种方案获得的文本标准化数据无论用于训练文本标准化模型中的标注器还是用于进一步的朗读形式词转换,都可以使得最终的文本标准化任务变得更简单、效率更高、性能更好。
[0056] 示例性地,在步骤S1400之后,该方法1000还包括步骤S1500,将文本标准化数据输入转换器模型,以获得与待处理文本相对应的朗读形式词文本。
[0057] 示例性地,转换器模型可以是TTS系统中的转换器模型。通过该转换器模型可以将由步骤S1400得到的文本标准化数据转换为相应的朗读形式词文本。示例性地,可以通过训练样本集训练该转换器模型,该训练样本集可以由包括子非标准化词序列在内的文本标准化数据集与朗读形式词文本集组成。在另一个示例中,对于训练好的转换器模型,在其输入端输入一组由子非标准化词序列和标准字符序列与其标签信息组成的标准化文本数据之后,可以在其输出端得到对应的朗读形式词文本。例如,将下述标准化文本数据输入训练好的转换器模型中:
[0058]
[0059] 由此可以得到朗读形式词文本"二零二一年十月零九”的输出结果。
[0060] 示例性地,TTS系统可以通过标注器模型(例如上述第二标注器)和转换器模型共同来完成一个文本标准化任务。由于转换器模型是基于子非标准化词的模式,相对于传统TTS系统中的转换器而言,不需要额外根据非标准化词的边界来构建模型,因此模型的结构和算法均更简单,从而完成文本标准化任务的效率更高。
[0061] 示例性地,在步骤S1500之后,该方法1000还包括步骤S1600,在子非标准化词序列中存在特定子非标准化词的情况下,基于预设的位置调整规则调整朗读形式词文本中的与特定子非标准化词对应的朗读形式词的位置,以获得经调整的朗读形式词文本。其中,特定子非标准化词所对应的非标准化词属于预设调整类型。
[0062] 示例性地,步骤S1500的一种实现形式可以包括:首先通过转换器模型将单纯的子非标准化词和单纯的标准字符一一对应转化为对应数量的朗读形式词,然后将该朗读形式词按照顺序拼接为朗读形式词文本,作为标准化数据的初始转换结果。
[0063] 对于仅由标准字符组成的序列,可以直接按原本的顺序进行拼接,得到朗读形式词文本,即上述得到的标注化数据的初始转换结果可以作为最终的标准化数据转换结果。对于包括子非标准化词的序列,则还需要考虑其中是否存在特定子非标准化词。如果不存在特定子非标准化词,则可以直接按照原本的顺序进行拼接。如果存在特定子非标准化词,则可以基于预设的位置调整规则调整朗读形式词文本中的与特定子非标准化词对应的朗读形式词的位置,以获得经调整的朗读形式词文本,并以调整后的朗读形式词文本作为最终的标准化数据转换结果。
[0064] 示例性地,特定子非标准化词可以是由预设调整类型的非标准化词转换而来的。该预设调整类型可以是任何非标准化词中的子非标准化词的排列顺序与对应的朗读形式词的排列顺序不一致的类型。
[0065] 示例性地,预设调整类型可以包括以下一种或多种:分数类型、货币类型、度量衡类型、时间类型。分数类型可以包括以下一种或多种:百分数类型、千分数类型、万分数类型、或者包含分子和分母的采用分数表达式表示的常规分数类型。例如,百分数类型可以是例如"30%”,千分数类型可以是例如"10‰”,常规分数类型可以是例如"1 / 2”等。货币类型可以是例如"¥20”,其读作"20元 / 块”。度量衡类型可以是例如"20m2”,其读作"20平方米”。时间类型可以是例如"3am”,其读作"上午3点”。
[0066] 示例性地,位置调整规则例如位置交换规则。以包含非标准化词"30%”为例:其通过步骤S1300可以被拆分为子非标准化词"30”、"%”,对应的子非标准化词类型分别为CARDINAL、VERBATIM;接着通过步骤S1400和步骤S1500的转换器模型得到转换后的朗读形式词分别为"三十”、"百分之”。如果按照原有的顺序拼接,则会得到"三十百分之”的错误结果,因此可以将朗读形式词"三十”和"百分之”交换位置后再进行拼接,以得到正确的朗读形式词文本。
[0067] 上述技术方案考虑了在对非标准化词进行细分的基础上进行朗读形式词文本的转换时,可能导致少量词的错位问题,并且针对该问题进行相应的规则设定与位置调整。由此,充分保证了文本标准化任务的准确性,增强了使用该方案进行文本标准化任务的适用性。
[0068] 示例性地,步骤S1300包括步骤S1310,基于预设对齐规则对待处理文本中的非标准化词进行拆分,以获得拆分信息。
[0069] 由上述步骤S1200可以识别待处理文本中的非标准化词和非标准化词的类型和边界信息。在一个示例中,可以采用训练好的由多层卷积神经网络构成的拆分模型实现对非标准化词的拆分,并获得拆分信息。
[0070] 在另一个示例中,也可以基于预设的对齐规则对待处理文本中的非标准化词进行拆分,以将非标准化词转换为子非标准化词序列并获得子非标准化词的类型信息。基于预设的对齐规则构建的非标准化词拆分模型可以以非标准化词的子模式为单位,为每一个非标准化词的子模式设计子非标准化词对齐规则、子非标准化词的类别序列,并建立非标准化词子模式与子非标准化词、子非标准化词类型信息的转换关系。
[0071] 示例性地,预设对齐规则包括第一规则部分、第二规则部分和第三规则部分。其中,第一规则部分用于表示非标准化词的匹配模式,第二规则部分用于表示非标准化词的拆分模式,第三规则部分用于表示拆分后的子非标准化词所对应的类型信息。
[0072] 示例性地,对于预设对齐规则的规则格式,为了便于标识,第一规则部分、第二规则部分与第三规则部分之间可以通过符号";;;”分割开。示例性地,第一规则部分可以包括表示非标准化词的匹配模式的正则表达式。示例性地,第二规则部分可以包括以连续数字、连续字母、连续符号等形式的字串作为拆分逻辑、用以将非标准化词拆分成子非标准化词序列的正则表达式。示例性地,第三规则部分可以包括各拆分后的子非标准化词所对应的类型信息的类型序列,可以用符号",”分割。
[0073] 示例性地,步骤S1310可以包括步骤S1311和步骤S1312。其中,步骤S1311,对于待处理文本中的任一非标准化词,将该非标准化词与规则库中的至少一条预设对齐规则进行匹配;步骤S1312,如果该非标准化词与任一条预设对齐规则中的第一规则部分匹配上,则按照该预设对齐规则中的第二规则部分将该非标准化词拆分成多个子非标准化词,并确定该预设对齐规则中的第三规则部分所对应的类型信息为该非标准化词中的子非标准化词所对应的类型信息。
[0074] 示例性地,可以基于预设的对齐规则构建前述非标准化词拆分模型。在将非标准化词"2021 / 10 / 09”和其类型信息与边界信息输入到非标准化词拆分模型中后,由于该模型中可以包括以下规则:(\d{3,4})(-| / |\.)(1[0-2]|[0]?\d)(-| / |\.)(3
[01] |[0-2]?\d);;;(\d+)([ / ])(\d+)([ / ])(\d+);;;DIGIT,SLASH_YEAR,CARDINAL,SLASH_MONTH,DAY_CARDINAL”。因此,非标准化词"2021 / 10 / 09”可以被此规则的第一规则部分"\d{3,4})(-| / |\.)(1[0-2]|[0]?\d)(-| / |\.)(3
[01] |[0-2]?\d)”所匹配;因此,可以按照此规则的第二规则部分"(\d+)([ / ])(\d+)([ / ])(\d+)”将其拆分为子非标准化词序列"2021、 / 、10、 / 、09”;同时根据规则的第三规则部分,表示拆分后的子非标准化词的类型序列为"DIGIT,SLASH_YEAR,CARDINAL,SLASH_MONTH,DAY_CARDINAL”。
[0075] 可以理解,上述规则表达式仅为拆分非标准化词的一个示例,对于不同类型的非标准化词可以采用不同的规则表达式,在此不做赘述。
[0076] 根据上述技术方案,可以基于预设规则将非标准化词拆分为子非标准化词,并获得包括非标准化词在内的拆分信息。该预设规则的表达式结构简单,便于快速匹配不同类型的非标准化词,并按照相应的规则完成准确的拆分。
[0077] 示例性地,与属于预设调整类型的非标准化词对应的预设对齐规则还包括第四规则部分,第四规则部分用于表示将子非标准化词所对应的朗读形式词交换位置。
[0078] 对于前述示例中,属于预设调整类型的特定非标准化词,诸如属于分数类型、货币类型、度量衡类型或时间类型等的非标准化词,还可以在对其拆分过程中,根据预设的第四规则部分对其进行对齐处理。示例性地,在对前述示例中的非标准化词拆分模型进行构建时,加上第四规则部分诸如表示将子非标准化词所对应的朗读形式词交换位置的规则表达式,例如包括针对百分数形式的非标准化词"30%”的规则:
[0079] "(\d+[%]);;;
[0080] (\d+)(%);;;
[0081] CARDINAL,VERBATIM;;;
[0082] 1,0”
[0083] 其中"1,0”表示如果非标准化词被此规则中的第一规则部分匹配,则由基于该规则拆分后的子非标准化词在经过转换器模型转化为朗读形式词后,拼接的顺序是先拼接第2个朗读形式词,再拼接第1个朗读形式词,最终生成拼接后的朗读形式词文本。
[0084] 根据上述技术方案,在对非标准化词的拆分阶段,预先设定针对特殊的非标准化词进行位置调整的对齐规则,便于后期按照该规则进行朗读形式词的转换。这种方案对于按照流水线(pipeline)执行的TTS系统来说,能显著提高文本标准化任务的效率和准确性。
[0085] 根据本发明的另一方面,还提供一种模型训练方法。 图3示出了本发明实施例的模型训练方法300的示意性流程图。该方法300包括步骤S310和步骤S320。
[0086] 步骤S310,获取如上述文本处理方法1000中涉及的待处理文本和拆分信息。示例性地,获取的待处理文本可以是包括非标准化词在内的句子文本。拆分信息可以为由前述步骤S1300得到的拆分信息。即,此步骤获取的待处理文本和拆分信息是对应的。
[0087] 步骤S320,将待处理文本作为标注器模型的输入,将拆分信息作为标注器模型的目标输出,对标注器模型进行训练。
[0088] 示例性地,将待处理文本输入标注器模型,标注器模型可以输出预测的拆分信息。可以根据预测的拆分信息和步骤S310获取的拆分信息计算损失函数,并通过损失函数优化该标注器模型。
[0089] 可以理解,上述标注器模型与前述示例中的第二标注器类似,在此不再赘述。
[0090] 根据本发明的另一方面,还提供一种语音合成方法。 图4示出了本发明实施例的语音合成方法400的示意性流程图。该方法包括以下步骤。
[0091] 步骤S410,获取待合成文本。示例性地,待合成文本可以是包括非标准化词在内的文本。待合成文本类似前述步骤S1100获取的待处理文本,不再赘述。
[0092] 步骤S420,利用上述文本处理方法1000中的步骤S1200至步骤S1400对待合成文本进行处理,或者,将待合成文本输入如上述模型训练方法300中的标注器模型,以获得与待合成文本相对应的拆分信息,并基于与待合成文本相对应的拆分信息对待合成文本进行整理,以获得与待合成文本相对应的文本标准化数据。可以理解,上述标注器模型可以是通过上述模型训练方法300训练好的模型,将新的待合成文本输入到该标注器模型的输入端,可以在其输出端得到针对该待合成文本的拆分信息。
[0093] 步骤S430,将与待合成文本相对应的文本标准化数据输入转换器模型,以获得与待合成文本相对应的朗读形式词文本。示例性地,转换器模型可以为前述示例中的转换器模型,在此不再赘述。
[0094] 步骤S440,将朗读形式词文本转换为语音,以获得目标语音。可以采用任何现有的或者将来可能出现的文本转语音的方法将朗读形式词文本转换为语音,以获得目标语音,本发明不对此进行限制。
[0095] 根据本发明另一方面,提供一种文本处理装置。 图5示出了根据本发明一个实施例的文本处理装置500的示意性框图。如 图5所示,文本处理装置包括获取模块510、识别模块520、拆分模块530和整理模块540。
[0096] 获取模块510用于获取待处理文本。
[0097] 识别模块520用于从待处理文本中识别非标准化词。
[0098] 拆分模块530用于对待处理文本中的非标准化词进行拆分,以获得拆分信息,其中,拆分信息包括待处理文本中包含的非标准化词的子非标准化词及子非标准化词的类型信息,其中,子非标准化词为单纯的数字、单纯的字母或单纯的符号。
[0099] 整理模块540用于基于拆分信息对待处理文本进行整理,以获得文本标准化数据,文本标准化数据包括从待处理文本中提取出的子非标准化词序列、待处理文本中除子非标准化词序列以外的标准字符序列以及标签信息,标签信息包括非标准化词序列中的每个子非标准化词的类型信息以及标准字符序列中的每个标准字符的类型信息。
[0100] 根据本发明另一方面,提供一种模型训练装置。 图6示出了根据本发明一个实施例的模型训练装置600的示意性框图。如 图6所示,模型训练装置包括获取模块610和训练模块620。
[0101] 获取模块610用于获取文本处理方法1000中涉及的待处理文本和拆分信息。
[0102] 训练模块620用于将待处理文本作为标注器模型的输入,将拆分信息作为标注器模型的目标输出,对标注器模型进行训练。
[0103] 根据本发明另一方面,提供一种语音合成装置。 图7示出了根据本发明一个实施例的语音合成装置700的示意性框图。 图7所示,根据本发明实施例的语音合成装置700包括获取模块710、处理或输入模块720、输入模块730和合成模块740。
[0104] 获取模块710用于获取待合成文本。
[0105] 处理或输入模块720用于利用上述文本处理方法1000对待合成文本进行处理,以获得与待合成文本相对应的文本标准化数据,或者,将待合成文本输入上述模型训练300中涉及的标注器模型,以获得与待合成文本相对应的拆分信息,并基于与待合成文本相对应的拆分信息对待合成文本进行整理,以获得与待合成文本相对应的文本标准化数据。
[0106] 输入模块730用于将与待合成文本相对应的文本标准化数据输入转换器模型,以获得与待合成文本相对应的朗读形式词文本。
[0107] 转换模块740用于将朗读形式词文本转换为语音,以获得目标语音。
[0108] 根据本发明另一方面,提供一种文本处理系统。文本处理系统包括处理器和存储器,其中,所述存储器中存储有计算机程序指令,所述计算机程序指令被所述处理器运行时用于执行上述文本处理方法1000。
[0109] 根据本发明另一方面,提供一种模型训练系统。模型训练系统包括处理器和存储器,其中,所述存储器中存储有计算机程序指令,所述计算机程序指令被所述处理器运行时用于执行上述模型训练方法300。
[0110] 根据本发明另一方面,提供一种语音合成系统。语音合成系统包括处理器和存储器,其中,所述存储器中存储有计算机程序指令,所述计算机程序指令被所述处理器运行时用于执行上述语音合成方法400。
[0111] 根据本发明另一方面,提供一种存储介质,在所述存储介质上存储了程序指令,所述程序指令在运行时用于执行上述文本处理方法1000。
[0112] 根据本发明另一方面,提供一种存储介质,在所述存储介质上存储了程序指令,所述程序指令在运行时用于执行上述模型训练方法300。
[0113] 根据本发明另一方面,提供一种存储介质,在所述存储介质上存储了程序指令,所述程序指令在运行时用于执行上述语音合成方法400。
[0114] 本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。
[0115] 在本申请所提供的几个实施例中,应该理解到,所揭露的设备和方法,可以通过其它的方式实现。例如,以上所描述的设备实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个设备,或一些特征可以忽略,或不执行。
[0116] 类似地,应当理解,为了精简本发明并帮助理解各个发明方面中的一个或多个,在对本发明的示例性实施例的描述中,本发明的各个特征有时被一起分组到单个实施例、图、或者对其的描述中。然而,并不应将该本发明的方法解释成反映如下意图:即所要求保护的本发明要求比在每个权利要求中所明确记载的特征更多的特征。更确切地说,如相应的权利要求书所反映的那样,其发明点在于可以用少于某个公开的单个实施例的所有特征的特征来解决相应的技术问题。因此,遵循具体实施方式的权利要求书由此明确地并入该具体实施方式,其中每个权利要求本身都作为本发明的单独实施例。
[0117] 本领域的技术人员可以理解,除了特征之间相互排斥之外,可以采用任何组合对本说明书(包括伴随的权利要求、摘要和附图)中公开的所有特征以及如此公开的任何方法或者设备的所有过程或单元进行组合。除非另外明确陈述,本说明书(包括伴随的权利要求、摘要和附图)中公开的每个特征可以由提供相同、等同或相似目的的替代特征来代替。
[0118] 本发明的各个部件实施例可以以硬件实现,或者以在一个或者多个处理器上运行的软件模块实现,或者以它们的组合实现。本领域的技术人员应当理解,可以在实践中使用微处理器或者数字信号处理器(DSP)来实现根据本发明实施例的声学模型训练系统或语音合成系统中的一些模块的一些或者全部功能。本发明还可以实现为用于执行这里所描述的方法的一部分或者全部的装置程序(例如,计算机程序和计算机程序产品)。这样的实现本发明的程序可以存储在计算机可读介质上,或者可以具有一个或者多个信号的形式。这样的信号可以从因特网网站上下载得到,或者在载体信号上提供,或者以任何其他形式提供。
[0119] 应该注意的是上述实施例对本发明进行说明而不是对本发明进行限制,并且本领域技术人员在不脱离所附权利要求的范围的情况下可设计出替换实施例。在权利要求中,不应将位于括号之间的任何参考符号构造成对权利要求的限制。单词"包含”不排除存在未列在权利要求中的元件或步骤。位于元件之前的单词"一”或"一个”不排除存在多个这样的元件。本发明可以借助于包括有若干不同元件的硬件以及借助于适当编程的计算机来实现。在列举了若干装置的单元权利要求中,这些装置中的若干个可以是通过同一个硬件项来具体体现。单词第一、第二、以及第三等的使用不表示任何顺序。可将这些单词解释为名称。
[0120] 以上所述,仅为本发明的具体实施方式或对具体实施方式的说明,本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。本发明的保护范围应以权利要求的保护范围为准。 < / date> < / date> < / digit> < / cardinal> < / money> < / real> < / quantifier> < / time> < / date>
Claims
1. A text processing method, comprising: obtaining a text to be processed; identifying a non-standardized word from the text to be processed; splitting the non-standardized word in the text to be processed to obtain split information, wherein the split information comprises a sub-non-standardized word of the non-standardized word contained in the text to be processed and type information of the sub-non-standardized word, and the sub-non-standardized word is a pure number, a pure letter or a pure symbol; processing the text to be processed based on the split information to obtain text standardized data, the text standardized data comprising a sub-non-standardized word sequence extracted from the text to be processed, a standard character sequence other than the sub-non-standardized word sequence in the text to be processed, and label information, the label information comprising type information of each sub-non-standardized word in the non-standardized word sequence and type information of each standard character in the standard character sequence; inputting the text standardized data into a converter model to obtain a read-form word text corresponding to the text to be processed; in a case where a specific sub-non-standardized word exists in the sub-non-standardized word sequence, adjusting a position of a read-form word corresponding to the specific sub-non-standardized word in the read-form word text based on a preset position adjustment rule to obtain an adjusted read-form word text; wherein the non-standardized word corresponding to the specific sub-non-standardized word belongs to a preset adjustment type; wherein the preset adjustment type comprises one or more of the following: a fraction type, a currency type, a measurement type, and a time type, and the position adjustment rule comprises swapping the read-form word corresponding to the specific sub-non-standardized word.
2. The method of claim 1, wherein, the splitting the non-standardized word in the text to be processed to obtain split information comprises: splitting the non-standardized word in the text to be processed based on a preset alignment rule to obtain the split information.
3. The method of claim 2, wherein, the preset alignment rule comprises a first rule part, a second rule part and a third rule part, the first rule part is used to represent a matching mode of a non-standardized word, the second rule part is used to represent a splitting mode of a non-standardized word, and the third rule part is used to represent type information corresponding to a split sub-non-standardized word, the splitting the non-standardized word in the text to be processed based on a preset alignment rule to obtain the split information comprises: for any non-standardized word in the text to be processed, matching the non-standardized word with at least one preset alignment rule in a rule library; if the non-standardized word matches the first rule part in any preset alignment rule, splitting the non-standardized word into a plurality of sub-non-standardized words according to the second rule part in the preset alignment rule, and determining that the type information corresponding to the third rule part in the preset alignment rule is the type information corresponding to the sub-non-standardized word in the non-standardized word.
4. The method of claim 3, wherein, the preset alignment rule corresponding to the non-standardized word belonging to the preset adjustment type further comprises a fourth rule part, and the fourth rule part is used to represent swapping the read-form word corresponding to the sub-non-standardized word.
5. A model training method, comprising: obtaining the to-be-processed text and the split information according to any one of claims 1-4; training a tagger model by taking the to-be-processed text as input and the split information as target output.
6. A speech synthesis method, comprising: obtaining a to-be-synthesized text; processing the to-be-synthesized text by using the text processing method according to claim 1 to obtain text normalization data corresponding to the to-be-synthesized text, or inputting the to-be-synthesized text into the tagger model according to claim 5 to obtain split information corresponding to the to-be-synthesized text, and collating the to-be-synthesized text based on the split information corresponding to the to-be-synthesized text to obtain text normalization data corresponding to the to-be-synthesized text; inputting the text normalization data corresponding to the to-be-synthesized text into a converter model to obtain a read-form word text corresponding to the to-be-synthesized text; and converting the read-form word text into speech to obtain target speech.
7. A text processing apparatus, comprising: an obtaining module configured to obtain a to-be-processed text; a recognition module configured to recognize a non-normalized word from the to-be-processed text; a split module configured to split the non-normalized word in the to-be-processed text to obtain split information, wherein the split information comprises a sub-non-normalized word of the non-normalized word contained in the to-be-processed text and type information of the sub-non-normalized word, and the sub-non-normalized word is a pure number, a pure letter or a pure symbol; a collation module configured to collate the to-be-processed text based on the split information to obtain text normalization data, wherein the text normalization data comprises a sub-non-normalized word sequence extracted from the to-be-processed text, a standard character sequence other than the sub-non-normalized word sequence in the to-be-processed text, and label information comprising type information of each sub-non-normalized word in the non-normalized word sequence and type information of each standard character in the standard character sequence; an input module configured to input the text normalization data into a converter model to obtain a read-form word text corresponding to the to-be-processed text; an adjustment module configured to, in a case where a specific sub-non-normalized word exists in the sub-non-normalized word sequence, adjust a position of a read-form word corresponding to the specific sub-non-normalized word in the read-form word text based on a preset position adjustment rule to obtain an adjusted read-form word text, wherein the non-normalized word corresponding to the specific sub-non-normalized word belongs to a preset adjustment type, and the preset adjustment type comprises one or more of a fraction type, a currency type, a measurement type and a time type, and the position adjustment rule comprises swapping the read-form word corresponding to the specific sub-non-normalized word.
8. A model training apparatus, comprising: an obtaining module configured to obtain a to-be-processed text and split information according to any one of claims 1-4; The training module is configured to train the tagger model by taking the text to be processed as input and the split information as target output.
9. A speech synthesis device, comprising: An obtaining module configured to obtain text to be synthesized; A processing or inputting module configured to process the text to be synthesized by using the text processing method in claim 1 to obtain text normalization data corresponding to the text to be synthesized, or input the text to be synthesized into the tagger model in claim 5 to obtain split information corresponding to the text to be synthesized, and arrange the text to be synthesized based on the split information corresponding to the text to be synthesized to obtain text normalization data corresponding to the text to be synthesized; An inputting module configured to input the text normalization data corresponding to the text to be synthesized into the converter model to obtain read-form word text corresponding to the text to be synthesized; And A converting module configured to convert the read-form word text into speech to obtain target speech.
10. A text processing system comprising a processor and a memory, wherein, The memory stores computer program instructions, which, when executed by the processor, are configured to perform the text processing method in any one of claims 1 to 4.
11. A model training system comprising a processor and a memory, wherein, The memory stores computer program instructions, which, when executed by the processor, are configured to perform the model training method in claim 5.
12. A speech synthesis system comprising a processor and a memory, wherein, The memory stores computer program instructions, which, when executed by the processor, are configured to perform the speech synthesis method in claim 6.
13. A storage medium, which stores program instructions, the program instructions, when executed, are configured to perform the text processing method in any one of claims 1 to 4.
14. A storage medium, which stores program instructions, the program instructions, when executed, are configured to perform the model training method in claim 5.
15. A storage medium, which stores program instructions, the program instructions, when executed, are configured to perform the speech synthesis method in claim 6.
Citation Information
Patent Citations
Method and device for processing text data
CN102184167A
Text regularization model training method and apparatus, and text regularization method and apparatus
CN107680579A