A text processing method, device and equipment

Through the scoring method based on alternative rules and language models, the input text is converted into a phoneme sequence, which solves the problem of low text processing accuracy in the existing technology and achieves a more efficient and controllable text conversion effect, which is suitable for large-scale applications. .

CN115101042BActive Publication Date: 2024-09-24NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202210505480.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-10
Publication Date
2024-09-24
Estimated Expiration
2042-05-10

AI Technical Summary

Technical Problem

The existing technology has low accuracy when converting input text into regularized text for generating phoneme sequences. It is especially difficult to ensure accuracy when dealing with complex contexts, and the cost of maintaining and training the model is high.

Method used

Non-standard words are converted into alternative semantic character sequences based on preset alternative rules, and the alternative texts are scored through the language model, and the text with the highest semantic fluency is selected as the final result to generate a phoneme sequence.

Benefits of technology

It improves the accuracy of text processing, reduces the cost of model training and data preparation, reduces calculation and memory usage, avoids uncontrollable errors, and is suitable for large-scale applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115101042B
    Figure CN115101042B
Patent Text Reader

Abstract

The present application discloses a text processing method, device and equipment. The text processing method comprises: obtaining a first text information to be processed; converting non-standard words in the first text information into at least one alternative first semantic character sequence based on a preset alternative rule, wherein the first semantic character sequence does not contain non-standard words; generating an alternative text set corresponding to the first text information according to the at least one alternative first semantic character sequence; scoring each alternative text in the alternative text set according to the semantics of each alternative text, and selecting a target alternative text from each alternative text as the second text information for generating a phoneme sequence corresponding to the first text information according to the scoring result. The method solves the problem of low accuracy in converting input text into a readable regularized text for generating a phoneme sequence.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a text processing method, device and equipment. Background Art

[0002] With the development of computer technology, the application of text-to-speech (TTS) technology has become more and more widespread. The so-called TTS is a technology that synthesizes input text into playable human speech. It can give machines the ability to speak and is widely used in audiobook reading, customer service, home entertainment, and human-computer interaction. Input text information often contains non-standard characters that are ambiguous and difficult to pronounce directly and correctly. Therefore, before synthesizing speech, the input text information needs to be processed into regularized text information. Regularized text information is readable and standardized text information. A phoneme sequence is generated based on the text information for synthesizing speech. An accurate phoneme sequence can synthesize natural and accurate speech. Therefore, it is particularly important to process the input text into regularized text information for generating a phoneme sequence.

[0003] In the prior art, the input text is generally normalized by using a rule-based or neural network model-based or a combination of the two. In the rule-based processing method, the rules need to be summarized in advance, which has the defect of poor universality and a bottleneck in accuracy in complex contexts. In addition, the rule preparation work is complex and time-consuming, and the rule maintenance is difficult. In the processing method based on the neural network model, it is necessary to model the task of sequence-to-sequence conversion. The predicted conversion results have certain uncontrollability and are difficult to learn and repair quickly in a short time. The idea of ​​the existing combination of the two is to use the neural network model to determine the category of non-standard characters in the input text, and then perform normalization processing based on the rules according to the category. However, the category design is more difficult. Too many categories will cause the problem of insufficient and unbalanced data. Too few categories will make the coverage not comprehensive enough and it is difficult to ensure accuracy. In addition, when it is necessary to add categories and training data, it may be necessary to redesign the categories and annotate the data, which is difficult to maintain.

[0004] Therefore, how to improve the accuracy of converting input text into regularized text for generating phoneme sequences in order to synthesize speech naturally and accurately is a problem that needs to be solved. Summary of the invention

[0005] The text processing method provided by the embodiment of the present application solves the problem of low accuracy in converting input text into readable regularized text for generating phoneme sequences.

[0006] An embodiment of the present application provides a text processing method, including: obtaining first text information to be processed; converting non-standard words in the first text information into at least one alternative first semantic character sequence based on a preset alternative rule, and generating an alternative text set corresponding to the first text information according to the at least one alternative first semantic character sequence; scoring each alternative text in the alternative text set according to the semantics of each alternative text, and selecting a target alternative text from the various alternative texts according to the scoring result as second text information for generating a phoneme sequence corresponding to the first text information.

[0007] Optionally, the method also includes: converting non-standard words in the first text information into a second semantic character sequence based on preset standard rules, wherein the second semantic character sequence does not contain non-standard words; generating a target text corresponding to the first text information according to the second semantic character sequence; obtaining a score for the target text; and when the score for the target text is greater than or equal to a preset threshold, using the target text as second text information for generating a phoneme sequence corresponding to the first text information.

[0008] Optionally, before converting the non-standard words in the first text information into at least one candidate first semantic character sequence based on a preset candidate rule, the method further includes: determining that the score for the target text is less than the preset threshold.

[0009] Optionally, the method of converting the non-standard words in the first text information into at least one alternative first semantic character sequence based on a preset alternative rule includes: splitting the non-standard words into one or more subsequences, wherein there is at least one target subsequence containing the non-standard words in the subsequences; converting the target subsequence into at least one semantic character subsequence, wherein the semantic character subsequence does not contain the non-standard words; and combining the semantic character subsequences to obtain at least one alternative first semantic character sequence corresponding to the non-standard words according to the combination result.

[0010] Optionally, before splitting the non-standard word into one or more subsequences, the method further includes: determining a splitting method; splitting the non-standard word into one or more subsequences includes: splitting the non-standard word into one or more subsequences according to the determined splitting method.

[0011] Optionally, obtaining at least one alternative first semantic character sequence corresponding to the non-standard word according to the combination result includes: obtaining at least one alternative first semantic character sequence corresponding to the non-standard word according to a set of combination results corresponding to each splitting method.

[0012] Optionally, obtaining at least one alternative first semantic character sequence corresponding to the non-standard word based on the set of combination results corresponding to each splitting method includes: after filtering the set of combination results corresponding to each splitting method, obtaining at least one alternative first semantic character sequence corresponding to the non-standard word.

[0013] Optionally, the converting of non-standard words in the first text information into at least one alternative first semantic character sequence based on a preset alternative rule includes: determining a category to which the non-standard words belong, and converting the non-standard words into at least one alternative first semantic character sequence by a conversion function corresponding to the category.

[0014] Optionally, scoring each alternative text in the alternative text set according to the semantics of each alternative text, and selecting a target alternative text from the alternative texts according to the scoring results, includes: scoring each alternative text separately through a language model to obtain a scoring result including the scores of each alternative text, wherein the scores are used to characterize the semantic fluency of the corresponding alternative text; and determining the alternative text corresponding to the highest score in the scoring results as the target alternative text.

[0015] Optionally, the method further includes: acquiring a training sample, wherein the training sample is a text sample; and training a basic model based on the training sample to obtain the language model.

[0016] Optionally, the training samples include positive samples carrying a first identifier and negative samples carrying a second identifier.

[0017] An embodiment of the present application also provides a text processing device, including: a to-be-processed text acquisition unit, used to acquire a first text information to be processed; a non-standard word conversion unit, used to convert the non-standard words in the first text information into at least one alternative first semantic character sequence based on a preset alternative rule, wherein the first semantic character sequence does not contain non-standard words; an alternative text generation unit, used to generate an alternative text set corresponding to the first text information according to the at least one alternative first semantic character sequence; a scoring unit, used to score each alternative text in the alternative text set according to the semantics of each alternative text, and select a target alternative text from the various alternative texts according to the scoring result as the second text information for generating a phoneme sequence corresponding to the first text information.

[0018] An embodiment of the present application further provides an electronic device, comprising: a memory, and a processor; the memory is used to store a computer program, and after the computer program is run by the processor, the method provided in the embodiment of the present application is executed.

[0019] Compared with the prior art, this application has the following advantages:

[0020] The embodiments of the present application provide a text processing method, device and electronic device, which converts non-standard words in a first text message into at least one alternative first semantic character sequence based on a preset alternative rule, wherein the first semantic character sequence does not contain non-standard words; generates an alternative text set corresponding to the first text message according to the at least one alternative first semantic character sequence; scores each alternative text in the alternative text set according to the semantics of each alternative text, and selects a target alternative text from each alternative text according to the scoring result as the second text information for generating a phoneme sequence corresponding to the first text message. The alternative result set is generated based on the preset alternative rule, avoiding the problem of uncontrollable errors. By scoring each alternative text according to the semantics of each alternative text to select the final result, complex sentences can be processed according to semantic information, thereby improving the accuracy of text processing. Further, by performing semantic scoring through a language model, the semantic encoding ability of the language model can be effectively utilized to process complex sentences according to global semantic information. Moreover, the language model has low requirements for training data, reducing the manpower consumption required for preparing training data and model training, and the model has low complexity, which can reduce the time consumption and memory usage of system calculation. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 is a schematic diagram of the system environment provided by an embodiment of the present application;

[0022] Figure 2 is a processing flow chart of a text processing method provided by one embodiment of the present application;

[0023] Figure 3 It is a text processing flow chart provided by one embodiment of the present application;

[0024] Figure 4 It is a schematic diagram of a text processing system provided by one embodiment of the present application;

[0025] Figure 5 is a schematic diagram of a text processing device provided by one embodiment of the present application;

[0026] Figure 6 It is a schematic diagram of an electronic device provided by this application. DETAILED DESCRIPTION

[0027] Many specific details are described in the following description to facilitate a full understanding of the present application. However, the present application can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of the present application, so the present application is not limited by the specific implementation disclosed below.

[0028] The embodiments of the present application provide a text processing method, device, electronic device and storage medium, which are described one by one in the following embodiments.

[0029] For ease of understanding, the system environment provided in this application is first described.

[0030] TTS can be applied to scenarios such as audio book reading, customer service, home entertainment, and human-computer interaction, and can be divided into two parts: front-end and back-end.

[0031] Please refer to Figure 1 , the figure includes: a front-end processing system 101 for speech synthesis and a back-end processing system 102 for speech synthesis. Among them, the front-end processing system for speech synthesis is used to analyze the input text information and convert the text information into a phoneme sequence, so as to determine the accurate pronunciation of the characters contained in the text information. As shown in the figure, the front-end processing system for speech synthesis includes: a regularization processing device 101-1 and a phoneme sequence generation device 101-2; the regularization processing device is used to analyze and process the input text information and convert it into regularized text information; the phoneme sequence generation device is used to generate an ambiguous phoneme sequence according to the regularized text information. The back-end processing system for speech synthesis is used to obtain the phoneme sequence generated by the front-end processing system for speech synthesis, and generate corresponding audio data according to the phoneme sequence. Further, the back-end processing system for speech synthesis includes: an acoustic model 102-1 and a vocoder 102-2. The acoustic model is used to convert the phoneme sequence into a spectral feature. The vocoder is used to convert the spectral feature into the corresponding audio data.

[0032] It can be understood that the system environment given above is an embodiment of the TTS system and does not constitute a limitation on the method provided in the embodiment of the present application.

[0033] The following combination Figure 2 and Figure 3 A text processing method provided in one embodiment of the present application is described in detail. Figure 2 The text processing method shown includes: step S201 to step S204.

[0034] Step S201: obtaining first text information to be processed.

[0035] The first text information to be processed is information of text that needs to be synthesized for speech. In the process of converting from text to speech, the first text information needs to be converted into a phoneme sequence, and then the sound is synthesized according to the phoneme sequence. The accuracy of the phoneme sequence directly affects the accuracy of the synthesized sound. Therefore, in order to ensure the accuracy of the phoneme sequence, it is necessary to process the first text information into regularized text information for generating the phoneme sequence, especially to accurately convert the non-standard words contained in the first text information into a character sequence with corresponding semantics and reasonable pronunciation, so as to generate regularized text information corresponding to the first text information and directly used to generate the phoneme sequence, that is, the second text information. This processing process is text normalization (TN), and the second text information can be understood as regularized text.

[0036] The text processing method provided in this embodiment integrates a rule-based text processing method, specifically generating an alternative text set corresponding to the first text information based on a preset alternative rule, scoring each alternative text in the alternative text set, and selecting a target alternative text from each alternative text according to the scoring result as the second text information for generating a phoneme sequence corresponding to the first text information, and the second text information is a readable regularized text information. The problem of uncontrollable errors is avoided by generating an alternative result set based on rules. By selecting the final result according to the semantic score of each alternative text, the statement can be processed according to the semantic information to improve the accuracy of text conversion. The so-called rule refers to the use of regular expressions or WFST (Weighted Finite State Transducer) to represent the rule. By analyzing the corpus, the rules and application order are summarized in advance based on the characteristics of context keywords and non-standard word patterns (such as digital symbols), thereby realizing the conversion of non-standard words to standard character sequences such as Chinese character sequences. For example, the "time" keyword appears in the context and the digital symbols form the "XX:XX" pattern, and the digital symbol string is converted into a time expression.

[0037] This step is to obtain the first text information. The first text information can be text information that requires speech synthesis, which is extracted from the content displayed on the interface, for example, the content displayed on the audio reading screen; or it can be text information that requires speech synthesis obtained from a file according to instructions. The first text information can be a complex sentence, or it can be at least part of the sentences divided by punctuation marks for the text that requires speech synthesis. Preferably, the first text information is a Chinese context text that needs to be synthesized into Chinese pronunciation and contains characters that cannot be directly read, specifically a text whose main language is Chinese characters.

[0038] In this embodiment, considering that the rule-based text processing takes less time, occupies less memory, and the output result is controllable, the original text information that needs to be regularized can be converted based on the preset standard rules. If the conversion result meets the requirements, it is used as the second text information. Otherwise, the original text information is used as the first text information and converted into the second text information in the subsequent steps. The actual implementation specifically includes the following processing: based on the preset standard rules, the non-standard words in the first text information are converted into a second semantic character sequence, wherein the second semantic character sequence does not contain non-standard words; according to the second semantic character sequence, a target text corresponding to the first text information is generated; a score for the target text is obtained; when the score for the target text is greater than or equal to a preset threshold, the target text is used as the second text information for generating a phoneme sequence corresponding to the first text information. Preferably, before the non-standard words in the first text information are converted into at least one alternative first semantic character sequence based on the preset alternative rules, it also includes: determining that the score for the target text is less than the preset threshold. Among them, the non-standard words in the first text information are converted into the second semantic character sequence based on the preset standard rules, and the non-standard words in the first text information can be converted into the second semantic character sequence using a standard rule converter. The first text information that cannot be converted into a more accurate semantics by the standard rule converter is filtered out after being processed with the standard rule converter first, and then the filtered first text information is converted into the second text information through subsequent steps. This can make full use of the advantages of the standard rule converter in that the memory overhead is controllable and the time consumption is short, improve the processing efficiency, and thus better meet the needs of large-scale application of products.

[0039] Step S202: converting non-standard words in the first text information into at least one candidate first semantic character sequence based on a preset candidate rule, wherein the first semantic character sequence does not contain non-standard words.

[0040] This step is to convert the non-standard words in the first text information into at least one alternative first semantic character sequence. During implementation, the alternative rule generator can split the non-standard words based on the preset alternative rules, generate multiple conversion results with corresponding semantics for the split non-standard words, and generate multiple possible alternative texts on this basis in the subsequent steps. For example, the alternative rule generator splits a non-standard word such as "1 / 4", and the possible conversion results are: "one quarter", "one to four", "January 4th", "One Four", and multiple alternative texts are generated based on all possible conversion results.

[0041] The non-standard words are words that contain characters that are not directly readable and ambiguous in the text, such as numbers, symbols or special characters. These characters that are not directly readable and ambiguous in non-standard words often have multiple possible pronunciations, and their pronunciations are associated with the context, and they often have different pronunciations in different contexts. Therefore, before generating a phoneme sequence for synthesized speech, the non-standard words need to be processed into a standardized readable semantic character sequence to determine the accurate pronunciation and eliminate pronunciation ambiguity. The standardized readable characters are preferably characters based on Chinese character pronunciation. For example, 2-3, 20, @, etc. are non-standard words. For another example, interpreting 2019 as a year or a number, interpreting 10:30 as time or a game score, etc., all have multiple possible pronunciations, and it is necessary to rely on their respective contexts to determine their semantics before generating an accurate phoneme sequence. Based on the preset alternative rules, the alternative text set is generated, which avoids the uncontrollable error problem of generating alternative texts, so that the conversion result is controllable.

[0042] In this embodiment, the non-standard word can also be split into one or more subsequences, the conversion results of each subsequence are recorded according to the splitting method, and the conversion results are arbitrarily combined according to the original word order to generate an alternative first semantic character sequence corresponding to the non-standard word. Specifically, the non-standard word in the first text information is converted into at least one alternative first semantic character sequence based on a preset alternative rule, including: splitting the non-standard word into one or more subsequences, wherein there is at least one target subsequence containing a non-standard word in the subsequence; converting the target subsequence into at least one semantic character subsequence, wherein the semantic character subsequence does not contain a non-standard word; combining the semantic character subsequences, and obtaining at least one alternative first semantic character sequence corresponding to the non-standard word according to the combination result. Further, before the non-standard word is split into one or more subsequences, it also includes: determining a splitting method; the non-standard word is split into one or more subsequences, including: splitting the non-standard word into one or more subsequences according to the determined splitting method. It can be understood that the splitting can be to split the non-standard word into multiple subsequences according to a determined splitting method; or it can be not to split the non-standard word, that is, to take the non-standard word as the target subsequence as a whole. Specifically, the splitting method can be determined according to the characteristics of the non-standard word itself and / or the word segmentation features contained in the first text information containing the non-standard word. The word segmentation features contained in the first text information include but are not limited to the part-of-speech features, named entity features and other features of each word segmentation in the first text information. For example, according to one splitting method, the non-standard word "1 / 4-1 / 9" can be split into three subsequences: "1 / 4", "-", "1 / 9", and these three subsequences all contain non-standard words, so three target subsequences are obtained. For another example, according to another splitting method, "1 / 4-1 / 9" can also be taken as a target subsequence as a whole. Preferably, the target subsequence split from the non-standard word in the first text information is converted into a corresponding semantic character subsequence, and the semantic character subsequences are arbitrarily combined according to the original word order of the target subsequence in the non-standard word or the first text information. Different splitting methods will result in different combination results. Preferably, obtaining at least one alternative first semantic character sequence corresponding to the non-standard word according to the combination result includes: obtaining at least one alternative first semantic character sequence corresponding to the non-standard word according to the set of combination results corresponding to each splitting method. Further, obtaining at least one alternative first semantic character sequence corresponding to the non-standard word according to the set of combination results corresponding to each splitting method includes: obtaining at least one alternative first semantic character sequence corresponding to the non-standard word after screening the set of combination results corresponding to each splitting method.For example, the first text is "Winter swimming competition will be held from 1 / 4 to 1 / 9", and "1 / 4 to 1 / 9" is split into non-standard words through word segmentation. The non-standard words are split into two target subsequences of "1 / 4" and "1 / 9", and each target subsequence is converted into a corresponding set of semantic character subsequences with corresponding semantics, "1 / 4" corresponds to "one quarter", "one or four", "one to four", "January 4th", and "1 / 9" corresponds to "one ninth", "one or nine", "one to nine", "January 9th", etc. According to the word order of the target subsequences in the non-standard words, the semantic character subsequences in the set of two semantic character subsequences are combined to obtain an alternative first semantic character sequence for the non-standard word.

[0043] Preferably, the non-standard word is converted into at least one alternative first semantic character sequence based on a conversion function. The method of converting the non-standard word in the first text information into at least one alternative first semantic character sequence based on a preset alternative rule includes: determining the category to which the non-standard word belongs, and converting the non-standard word into at least one alternative first semantic character sequence through a conversion function corresponding to the category.

[0044] Step S203: generating a candidate text set corresponding to the first text information according to the at least one candidate first semantic character sequence.

[0045] This step is to generate a candidate text set corresponding to the first text information, including one or more candidate texts. In implementation, a non-standard word can correspond to one or more candidate first semantic character sequences, so that a first text information corresponds to one or more candidate texts.

[0046] In this embodiment, the method further includes separating the non-standard words from the first text information, specifically including: identifying at least one of the non-Chinese characters, numbers, symbols or unreadable characters in the first text information; segmenting the first text information according to a preset granularity, and determining the non-standard words from the multiple segmented words obtained by segmentation. An example of an unreadable character is a special character, such as "-", "@", etc. At least part of the one or more non-standard words separated is converted into an alternative first semantic character sequence with corresponding semantics. Different ways of separating the non-standard words from the first text information will result in different numbers of alternative texts in the alternative result set. The more non-standard words are separated, the more alternative texts will be in the alternative text set. For example, "4.5-6.7 tons of apples are consumed each year", "4.5-6.7" is taken as a non-standard word as a whole, or it is separated into three non-standard words "4.5", "-" and "6.7", which will result in different numbers of alternative texts. If it is taken as a non-standard word as a whole, the number of alternative texts will be less. For another example, "a winter swimming competition will be held from 1 / 4 to 1 / 9". If the non-standard words are split according to "1 / 4", "-", and "1 / 9", then "1 / 4" and "1 / 9" have 4 conversion methods respectively, and "-" has 5 conversion methods. The alternative text set will have 4*4*5, a total of 80 alternative results. If "1 / 4-1 / 9" is considered as a whole, the number of alternative results will be significantly reduced. During implementation, based on the characteristics of the word segmentation processing of the first text information, the non-standard words are split out from the first text information in a specific way, and the corresponding alternative conversion results are recorded according to the different splitting methods of the non-standard words from the first text information, so that the number of alternative texts is controlled within a certain range. Specifically, the generating of an alternative text set corresponding to the first text information according to the at least one alternative first semantic character sequence includes: determining at least one of the following feature information for at least part of the multiple segmented words obtained by segmentation: part-of-speech feature, named entity feature, and non-standard word feature of the segmented words; separating non-standard words from the first text information according to at least one of the feature information, generating at least one alternative first semantic character sequence corresponding to the non-standard words, combining the alternative first semantic character sequence and the text in the first text information that does not include the non-standard words, and obtaining an alternative text set corresponding to the first text information according to the combination result; wherein the combining includes: combining the alternative first semantic character sequence with the text that does not include the non-standard words according to the word order of the non-standard words in the first text information.

[0047] Step S204: scoring each candidate text in the candidate text set according to the semantics of each candidate text, and selecting a target candidate text from the candidate texts according to the scoring result as the second text information for generating a phoneme sequence corresponding to the first text information.

[0048] This step is to score each candidate text according to the semantics of the candidate text, and select the target candidate text as the second text information obtained by regularization. A language model based on machine learning can be used for semantic scoring. Among them, the step of scoring each candidate text according to the semantics of each candidate text in the candidate text set, and selecting the target candidate text from the candidate text according to the scoring result, includes: scoring each candidate text separately through a language model to obtain a scoring result containing the scores of each candidate text, and the score is used to characterize the semantic fluency of the corresponding candidate text; the candidate text corresponding to the highest score in the scoring result is determined as the target candidate text. The language model is constructed by adding a linear layer for outputting the score based on the ALBERT model. The language model is a model that can be adaptively trained, and its input can be the second text information, and the output is the semantic fluency score of the text (i.e., the scoring result), and the higher the score, the more fluent the input sentence.

[0049] In this embodiment, it also includes: obtaining a training sample, the training sample is a text sample; training the basic model based on the training sample to obtain the language model. Wherein, the training sample includes a positive sample carrying a first identifier and a negative sample carrying a second identifier. The basic model refers to a model before training that is constructed by adding a linear layer for outputting a score based on the ALBERT model. Preferably, the first identifier is an identifier that represents that the semantic score of the corresponding text sample is greater than or equal to a preset threshold, which can be understood as the first identifier indicating that the corresponding text sample is semantically smooth. The second identifier is an identifier that represents that the semantic score of the corresponding text sample is less than a preset threshold, which can be understood as the second identifier indicating that the corresponding text sample is semantically incoherent. Preferably, the positive sample carrying the first identifier is a training sample that carries the first identifier, and the first identifier correctly reflects the true semantic fluency of the text sample. The negative sample carrying the second identifier is a training sample that carries the second identifier, and the score does not correctly reflect the true semantic fluency of the text sample.

[0050] Furthermore, in order to make the model have a certain degree of generalization, the present embodiment also provides a method for preparing training samples. The first training sample is obtained by manually annotated regularized text, the second training sample is obtained by manually annotated regularized text and its corresponding original text, and the third training sample is reviewed through network text to expand the training sample set. Use rich training samples to train the basic model, and the output of the language model obtained after training can effectively reflect the language fluency of the text (such as a sentence). During implementation, training samples can be arbitrarily extracted from the first training sample, the second training sample and the third training sample to participate in the pre-training of the model. Specifically, the language model is trained using at least one of the first training sample, the second training sample and the third training sample; wherein the first training sample is generated based on the regularized text obtained by manual annotation and the semantic fluency score of the regularized text is set to the first score; the second training sample is generated by the following processing: obtaining the regularized text information obtained by manual annotation and the corresponding original text information; generating an alternative result set corresponding to the original text information, eliminating the alternative text consistent with the regularized text information from the alternative result set corresponding to the original text information, setting the semantic fluency score of the alternative text obtained after elimination to the second score, and the alternative text set to the second score and the second score constitute the second training sample; the third training sample is generated by the following processing: obtaining open source text information in the network; filtering out text information containing keywords with specified characteristics from the open source text information, setting the semantic fluency score of the filtered text information to the first score, and the text information set to the first score and the first score constitute the third training sample. Among them, the first score can be understood as the first identifier, such as setting the first score to 1, indicating semantic fluency; the second score can be understood as the second identifier, such as setting the second score to 0, indicating semantic fluency. Of course, the first score and the second score can also be set to other scores. Among them, the first training sample and the third training sample can be understood as positive samples carrying the first identifier. Although the second training sample carries the second score, it can correctly characterize the true semantic fluency of its corresponding text, so it is a positive sample. The open source text information is preferably an NLP data set, and the NLP data set is generally obtained from a web page and obtained through data cleaning and screening. Since these texts appear in the web page after manual sorting and screening, they can be considered as semantically fluent sentences. Among them, the keywords with specified features refer to words that can be converted into non-standard characters and maintain semantic fluency after conversion. For example: keywords are words containing features such as zero, one, two, three, four, five, six, seven, eight, nine, ten, one hundred, one thousand, ten thousand, one hundred million, and one trillion. For another example, the keywords are "percent", "zero point", "zero point zero", words representing proportion, date, etc. The text containing these keywords selected from the open source text information is given a score of 1.Specifically, the keywords may be filtered out from the open source text information according to a preset expression.

[0051] By selecting the second text information that is ultimately used to generate the phoneme sequence through the language model score, the semantic encoding capability of the language model can be effectively utilized, so that complex sentences can be processed according to the global semantic information of the input text, thereby improving the conversion accuracy. In addition, the model has low complexity and low requirements for training samples, which can reduce computational time and memory usage, and reduce the manpower required for data preparation and model training.

[0052] Please refer to Figure 3 , the text processing flow chart shown in the figure includes: S301, input text. That is, obtain the text information to be processed, and first input it into the standard rule converter for processing. S302, the standard rule converter converts the input text into the rule conversion text. S303, the scoring model calculates the semantic fluency score of the rule conversion text. S304, judge whether the semantic fluency score of the rule conversion text is greater than the preset score threshold. If so, execute S305; if not, execute S306. S305, output the rule conversion text. That is, determine that the accuracy of the rule conversion text meets the requirements, and use it to generate a factor sequence for speech synthesis. S306, if the semantic fluency of the rule conversion text does not meet the requirements, then further input the input text into the alternative rule generator. The alternative rule generator obtains the input text and generates an alternative text set corresponding to the input text. S307, the scoring model calculates the semantic fluency score of each alternative text in the alternative text set. S308, select the alternative text with the highest score. S309, output the alternative text. That is, determine whether the accuracy of an alternative text generated by the alternative rule generator meets the requirements, and use it to generate a factor sequence for speech synthesis. In this process, the scoring model can be understood as the language model. First, the text to be processed is input into the standard rule converter for conversion to obtain a rule conversion text, and the rule conversion text is scored. If its semantic fluency score is higher than the threshold, it is considered that the rule conversion text is a reliable conversion result, and it is output to generate a phoneme sequence, which can be used for TTS to obtain accurate pronunciation. If its semantic fluency score is higher than the threshold or lower than the threshold, an alternative text set is generated for the input text and the alternative text with the highest score is selected for scoring. Thus, while improving the accuracy of complex text disambiguation, it can reduce the time-consuming text regularization processing and control the memory overhead of the computing resources used to process the text within a certain range, meeting the needs of large-scale application of products. In practical applications, the alternative rule generator and the standard rule converter can split non-standard words based on their respective preset rules and convert them in the same or different ways, without limitation.

[0053] For example, the first text information input is "We plan to go to Shanghai on 1 / 4". The standard rule converter converts it into "We plan to go to Shanghai on 1:4", and the language model scores it as 0.1045, which is lower than the preset score threshold. Therefore, the first text information is input into the alternative rule generator, and the alternative text set obtained includes: We plan to go to Shanghai on January 4th, We plan to go to Shanghai on 1:4, We plan to go to Shanghai on 1:4, We plan to go to Shanghai on 1:4; We plan to go to Shanghai on 1:4; The language model scores the above four alternative texts, and the scores are: 0.9546, 0.1045, 0.2154, 0.0198 respectively, so the second text information selected from the above alternative text set is: We plan to go to Shanghai on January 4th.

[0054] It should be noted that, in the absence of conflict, the features given in this embodiment and other embodiments of the present application can be combined with each other, and steps S201 and S202 or similar terms do not limit the steps to be executed sequentially.

[0055] So far, the method provided by the present embodiment has been described, in which an alternative result set is generated based on a preset alternative rule, thereby avoiding the problem of uncontrollable errors. By scoring each alternative text according to the semantics of each alternative text to select the final result, complex sentences can be processed according to semantic information, thereby improving the accuracy of text processing. Furthermore, by performing semantic scoring through a language model, the semantic encoding ability of the language model can be effectively utilized to process complex sentences according to global semantic information. Moreover, the language model has low requirements for training data, which reduces the manpower required for preparing training data and model training. At the same time, the model has low complexity, which can reduce the time consumption and memory usage of system calculations.

[0056] Based on the above embodiment, one embodiment of the present application provides a text processing system. For the description of the corresponding parts, please refer to the description of the corresponding parts of the above system environment and the embodiment. Figure 4 The system will be described. Figure 4 The text processing system shown includes: a candidate rule generator 401 and a semantic fluency scoring module 402 .

[0057] The alternative rule generator 401 is used to convert the non-standard words in the first text information to be processed into at least one alternative first semantic character sequence based on the preset alternative rules, and generate an alternative text set corresponding to the first text information according to the at least one alternative first semantic character sequence. Specifically, the alternative rule generator separates the non-standard words from the first text information, and converts the separated non-standard words based on the preset alternative rules to obtain multiple conversion results corresponding to them, as the alternative first semantic character sequences, and multiple alternative texts can be obtained accordingly. For example, the non-standard word "1 / 4" is separated, and possible conversion results are: "one quarter", "one to four", "January 4th", "One Four". Therefore, for a sentence containing "1 / 4", at least 4 conversion sentences can be obtained as alternative texts.

[0058] In the present embodiment, different non-standard words can be split from the first text information with different granularities or in different ways, and the number of non-standard words may also be different, and the alternative character sequences and their numbers obtained after the conversion of different numbers of non-standard words may be different, and the obtained alternative texts and their numbers may also be different. Therefore, the corresponding alternative texts are recorded according to the different splitting methods of non-standard words. In view of the fact that the processing efficiency will be affected when the number of alternative texts is too large, therefore, according to the part-of-speech features, named entity features, and non-standard word features of the first text information segmentation, the segmentation method is determined so that the number of alternative texts is within the processable range. For example, for "1 / 4-1 / 9 winter swimming competition held", according to the semantic features of the entity words "held" and "competition", "1 / 4-1 / 9" as a whole is split out from the sentence (i.e., text) as a non-label word for conversion processing, thereby reducing the number of generated alternative texts.

[0059] The semantic fluency scoring module 402 is used to score each candidate text in the candidate text set according to the semantics of each candidate text, and select a target candidate text from each candidate text as the second text information for generating a phoneme sequence corresponding to the first text information according to the scoring result. Specifically, the semantic fluency of the candidate text is scored using a language model. The language model is obtained by training the basic model and can more accurately determine the semantic fluency score of the candidate text. The conversion of non-standard words and the first text information is a semantic related problem. The language model can encode semantic information well and can be applied to score the candidate texts generated by the conversion to select semantically coherent texts from multiple candidate texts. Please refer to the description of the language model in the above embodiment.

[0060] The system provided in this embodiment also includes: a standard rule converter 403. The standard rule converter is used to convert the original text information that needs to be regularized into converted text information for generating a phoneme sequence based on a preset standard rule. Correspondingly, the semantic fluency scoring module is used to determine the semantic fluency score of the converted text information; determine whether the semantic fluency score of the converted text information is lower than the preset score threshold, and if so, use the original text information as the first text information. Among them, the standard rules in the standard rule converter and the alternative rules in the alternative rule generator can be the same or different; the screening methods of non-standard words in the standard rule converter and the alternative rule generator can be the same or different. The standard rule converter separates non-standard words from the first text information based on the preset standard rules, and converts the separated non-standard words to obtain multiple conversion results corresponding to them, and selects one result from the multiple conversion results according to the semantics to generate the converted text information obtained based on the preset standard rules.

[0061] So far, the system provided by this embodiment has been described. In the system, the alternative rule generator generates an alternative result set based on preset alternative rules, avoiding the problem of uncontrollable errors. The semantic fluency scoring module selects the final result according to the semantic score of each alternative text, and can process complex sentences according to semantic information, thereby improving the accuracy of text processing.

[0062] Corresponding to the first embodiment, another embodiment of the present application provides a text processing device. Figure 5 , Figure 5 The text processing device shown comprises:

[0063] A to-be-processed text acquisition unit 501 is used to acquire first text information to be processed;

[0064] A non-standard word conversion unit 502, configured to convert the non-standard word in the first text information into at least one candidate first semantic character sequence based on a preset candidate rule, wherein the first semantic character sequence does not contain a non-standard word;

[0065] An alternative text generating unit 503, configured to generate an alternative text set corresponding to the first text information according to the at least one alternative first semantic character sequence;

[0066] The scoring unit 504 is used to score each candidate text in the candidate text set according to the semantics of each candidate text, and select a target candidate text from the candidate texts according to the scoring result as the second text information for generating a phoneme sequence corresponding to the first text information.

[0067] Optionally, the device also includes a standard rule conversion unit, which is used to: convert non-standard words in the first text information into a second semantic character sequence based on preset standard rules, wherein the second semantic character sequence does not contain non-standard words; generate a target text corresponding to the first text information according to the second semantic character sequence; obtain a score for the target text; when the score for the target text is greater than or equal to a preset threshold, use the target text as second text information for generating a phoneme sequence corresponding to the first text information.

[0068] Optionally, the standard rule conversion unit is further used to: before converting the non-standard words in the first text information into at least one alternative first semantic character sequence based on a preset alternative rule, determine that the score for the target text is less than the preset threshold.

[0069] Optionally, the non-standard word conversion unit 502 is specifically used to: split the non-standard word into one or more subsequences, wherein there is at least one target subsequence containing a non-standard word in the subsequences; convert the target subsequence into at least one semantic character subsequence, wherein the semantic character subsequence does not contain a non-standard word; and combine the semantic character subsequences to obtain at least one alternative first semantic character sequence corresponding to the non-standard word according to the combination result.

[0070] Optionally, the non-standard word conversion unit 502 is specifically used to: before splitting the non-standard word into one or more subsequences, determine a splitting method, and split the non-standard word into one or more subsequences according to the determined splitting method.

[0071] Optionally, the non-standard word conversion unit 502 is specifically used to obtain at least one candidate first semantic character sequence corresponding to the non-standard word according to a set of combination results corresponding to each splitting method.

[0072] Optionally, the non-standard word conversion unit 502 is specifically used to obtain at least one candidate first semantic character sequence corresponding to the non-standard word after screening the set of combination results corresponding to each splitting method.

[0073] Optionally, the non-standard word conversion unit 502 is specifically used to: determine the category to which the non-standard word belongs, and convert the non-standard word into at least one candidate first semantic character sequence through a conversion function corresponding to the category.

[0074] Optionally, the scoring unit 504 is specifically used to: score each alternative text separately through a language model to obtain a scoring result including the scores of each alternative text, wherein the score is used to characterize the semantic fluency of the corresponding alternative text; and determine the alternative text corresponding to the highest score in the scoring result as the target alternative text.

[0075] Optionally, the scoring unit 504 is further used to: obtain a training sample, where the training sample is a text sample; and train a basic model based on the training sample to obtain the language model.

[0076] Optionally, the training samples include positive samples carrying a first identifier and negative samples carrying a second identifier.

[0077] Based on the above embodiment, one embodiment of the present application provides an electronic device. For the relevant parts, please refer to the corresponding description of the above embodiment. Figure 6 The electronic device shown in the figure includes: a memory 601 and a processor 602; the memory is used to store a computer program, and after the computer program is run by the processor, the method provided in the embodiment of the present application is executed.

[0078] Based on the above embodiment, one embodiment of the present application provides a computer-readable storage medium. For the relevant parts, please refer to the corresponding description of the above embodiment. The schematic diagram of the computer-readable storage medium is similar to Figure 6 The computer-readable storage medium stores one or more computer instructions, and the one or more computer instructions are executed by a processor to implement the method provided in the embodiment of the present application.

[0079] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0080] Although the present application is disclosed as above in the form of a preferred embodiment, it is not intended to limit the present application. Any technical personnel in this field may make possible changes and modifications without departing from the spirit and scope of the present application. Therefore, the scope of protection of the present application shall be based on the scope defined by the claims of the present application.

Claims

1. A text processing method, characterized in that: include: Obtaining first text information to be processed; Based on a preset standard rule, converting non-standard words in the first text information into a second semantic character sequence, wherein the second semantic character sequence does not contain non-standard words; generating a target text corresponding to the first text information according to the second semantic character sequence; obtaining a score for the target text; when the score for the target text is greater than or equal to a preset threshold, using the target text as second text information for generating a phoneme sequence corresponding to the first text information; When it is determined that the score for the target text is less than the preset threshold, converting the non-standard words in the first text information into at least one alternative first semantic character sequence based on a preset alternative rule, wherein the first semantic character sequence does not contain the non-standard words; generating an alternative text set corresponding to the first text information according to the at least one alternative first semantic character sequence; Scoring each candidate text in the candidate text set according to its semantics, and selecting a target candidate text from the candidate texts according to the scoring result as second text information for generating a phoneme sequence corresponding to the first text information.

2. The method according to claim 1, characterized in that The converting the non-standard word in the first text information into at least one alternative first semantic character sequence based on a preset alternative rule includes: Splitting the non-standard word into one or more subsequences, wherein at least one target subsequence containing the non-standard word exists in the subsequences; Converting the target subsequence into at least one semantic character subsequence, wherein the semantic character subsequence does not contain non-standard words; The semantic character subsequences are combined, and at least one candidate first semantic character sequence corresponding to the non-standard word is obtained according to the combination result.

3. The method according to claim 2, characterized in that Before splitting the non-standard word into one or more subsequences, the method further includes: Determine the split method; The step of splitting the non-standard word into one or more subsequences includes: The non-standard word is split into one or more subsequences according to the determined splitting method.

4. The method according to claim 3, characterized in that The step of obtaining at least one candidate first semantic character sequence corresponding to the non-standard word according to the combination result includes: At least one candidate first semantic character sequence corresponding to the non-standard word is obtained according to a set of combination results corresponding to each splitting method.

5. The method according to claim 4, characterized in that The step of obtaining at least one candidate first semantic character sequence corresponding to the non-standard word according to the set of combination results corresponding to each splitting mode includes: After screening the set of combination results corresponding to each splitting method, at least one candidate first semantic character sequence corresponding to the non-standard word is obtained.

6. The method according to claim 1, characterized in that The converting the non-standard word in the first text information into at least one alternative first semantic character sequence based on a preset alternative rule includes: The category to which the non-standard word belongs is determined, and the non-standard word is converted into at least one candidate first semantic character sequence by using a conversion function corresponding to the category.

7. The method according to claim 1, characterized in that Scoring each candidate text in the candidate text set according to the semantics of each candidate text, and selecting a target candidate text from each candidate text according to the scoring result, includes: Scoring each candidate text respectively through a language model to obtain a scoring result including the scores of each candidate text, wherein the scores are used to characterize the semantic fluency of the corresponding candidate text; The candidate text corresponding to the highest score in the scoring results is determined as the target candidate text.

8. The method according to claim 7, characterized in that The method further comprises: Obtaining a training sample, where the training sample is a text sample; The basic model is trained based on the training samples to obtain the language model.

9. The method according to claim 8, characterized in that The training samples include positive samples carrying a first identifier and negative samples carrying a second identifier.

10. A text processing device, characterized in that: include: A to-be-processed text acquisition unit, used to acquire first text information to be processed; A standard rule conversion unit, configured to: convert non-standard words in the first text information into a second semantic character sequence based on a preset standard rule, wherein the second semantic character sequence does not contain non-standard words; generate a target text corresponding to the first text information according to the second semantic character sequence; obtain a score for the target text; and when the score for the target text is greater than or equal to a preset threshold, use the target text as second text information for generating a phoneme sequence corresponding to the first text information; The standard rule conversion unit is further used to: before converting the non-standard words in the first text information into at least one alternative first semantic character sequence based on a preset alternative rule, determine that the score for the target text is less than the preset threshold; a non-standard word conversion unit, configured to convert the non-standard word in the first text information into at least one candidate first semantic character sequence based on a preset candidate rule, wherein the first semantic character sequence does not contain the non-standard word; An alternative text generating unit, configured to generate an alternative text set corresponding to the first text information according to the at least one alternative first semantic character sequence; A scoring unit is used to score each candidate text in the candidate text set according to the semantics of each candidate text, and select a target candidate text from the candidate texts according to the scoring result as the second text information for generating a phoneme sequence corresponding to the first text information.

11. An electronic device, characterized in that: include: A memory and a processor; the memory is used to store a computer program, and after the computer program is run by the processor, the method described in any one of claims 1 to 9 is executed.

Citation Information

Patent Citations

  • Method and system for text message normalization based on character transformation and unsupervised of web data

    CN103703459A

  • Sentence smoothness and syntactic scoring model training method and device

    CN110188351A

  • Text processing method and device, computer storage medium and electronic equipment

    CN111145722A

  • Data processing method and device, and computer storage medium

    CN111178042A

  • Text processing method and device, computer storage medium and electronic equipment

    CN111191421A