A digital regularization method, device, equipment and storage medium

By obtaining digital attribute labels and context information and using neural network models to perform digital regularization, the problem of low accuracy of digital regularization in the prior art is solved, and a higher accuracy and concise process is achieved, which is suitable for multilingual texts.

CN114548049BActive Publication Date: 2025-01-07IFLYTEK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210202517.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-02
Publication Date
2025-01-07
Estimated Expiration
2042-03-02

AI Technical Summary

Technical Problem

The digital regularization method in existing speech synthesis relies on regular translation and cannot make full use of context information, resulting in low accuracy of digital regularization results in different languages, especially when languages ​​involving lattice changes such as Russian, the error rate is high.

Method used

By obtaining the digital attribute labels and context information in the original text, the neural network model is used to regularize the numbers into word representations in the same language as the text, and the sequence-to-sequence model structure is used to divide and regularize the number strings with attribute labels and context information. Handle and avoid summarizing rules for different languages.

Benefits of technology

It improves the accuracy of the results of digital regularization, simplifies the processing flow, eliminates ambiguity, and applies to multilingual texts to digital regularization, which enhances the intelligibility of speech synthesis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114548049B_ABST
    Figure CN114548049B_ABST
Patent Text Reader

Abstract

The present application discloses a method, apparatus, device and storage medium for digital regularization. The present application determines the attribute labels of the numbers in the original text containing the numbers to be regularized. The attributes of the numbers can be related attributes that affect the results of digital regularization. On this basis, based on the attribute labels of the numbers and the contextual information of the numbers in the original text, the numbers are regularized into word representations in the same language as the original text to obtain the regularized results of the numbers. The present application scheme does not need to summarize digital regularization rules for different languages, the process is more concise, and the contextual information of the numbers in the original text can be fully utilized during digital regularization, which can eliminate some ambiguous problems in the regularization results and improve the accuracy of the regularization results. Furthermore, the digital regularization process also refers to the attribute labels of the numbers, that is, it takes into account the influence of different attributes of the numbers on the regularization, which helps to further improve the accuracy of the regularization results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of text analysis, and more specifically, to a digital regularization method, apparatus, device and storage medium. Background Art

[0002] With the rapid development of speech synthesis acoustic modeling capabilities, the bottleneck of front-end text analysis technology has become increasingly prominent. The intelligibility of speech synthesis containing text related to numbers is highly dependent on the regularization ability of numbers. In speech synthesis applications, banking, insurance and other fields have high requirements for the transcription of numbers. Users in these fields are also more sensitive to the correctness of the pronunciation of numbers. Incorrect number regularization will seriously affect the user experience. Therefore, number regularization is a very critical link for the promotion and popularization of speech synthesis.

[0003] At present, the common practice of digital regularization in speech synthesis is to use rules to perform regularized transcription of numbers to text. Since the digital regularization rules of different languages ​​are different, the existing methods need to summarize the digital regularization rules of various languages. In addition, some rules are not comprehensive enough and have many exceptions. Take Russian as an example. This Slavic language involves a lot of case changes. Different case changes will lead to different digital regularization results. Therefore, the results of digital regularization processing using rules are not very accurate. Summary of the invention

[0004] In view of the above problems, the present application is proposed to provide a digital regularization method, device, equipment and storage medium to simplify the digital regularization processing process and improve the accuracy of the digital regularization processing results. The specific scheme is as follows:

[0005] In a first aspect of the present application, a digital regularization method is provided, comprising:

[0006] Get the original text containing numbers;

[0007] Determine the attributes of the numbers contained in the original text to obtain attribute labels of the numbers;

[0008] Based on the attribute label of the number and the context information of the number in the original text, the number is regularized into a word representation in the same language as the original text to obtain a regularized result of the number.

[0009] Preferably, the normalizing the number into a word representation in the same language as the original text based on the attribute label of the number and the context information of the number in the original text comprises:

[0010] Inputting the original text with the attribute tag marked with numbers into a preset first regularization module to obtain an output regularized text, wherein the regularized text contains a regularization result of the numbers, and the regularization result is a word representation of the numbers regularized into the same language as the original text;

[0011] The first regularization module is configured to predict the internal state representation of the regularization result of the output number by combining the attribute label of the number in the input original text and the context information of the number.

[0012] Preferably, before normalizing the number into a word representation in the same language as the original text based on the attribute label of the number and the context information of the number in the original text, the method further comprises:

[0013] Divide the continuous numbers in the original text into at least one number string according to the set number of digits;

[0014] The step of normalizing the number into a word representation in the same language as the original text based on the attribute label of the number and the context information of the number in the original text comprises:

[0015] Based on the attribute labels of the numbers in the number string, the number string and the context information of the number string in the original text, each number in the original text is regularized into a word representation in the same language as the original text.

[0016] Preferably, dividing the continuous numbers in the original text into at least one digital string according to the set number of digits as a unit includes:

[0017] Determining the language category of the original text;

[0018] Obtaining a preset number of digital division digits corresponding to the language category of the original text as the set number of digits;

[0019] The continuous numbers in the original text are divided into at least one number string according to the set number of digits.

[0020] Preferably, dividing the continuous numbers in the original text into at least one number string according to the set number of digits as a unit includes:

[0021] For the continuous numbers in the original text, a number string is divided every the set number of digits in order from the lowest digit to the highest digit;

[0022] If the last digit string divided from a continuous number is less than the set number of digits, the highest digit is padded with 0 to the set number of digits.

[0023] Preferably, the step of normalizing each number in the original text into a word representation in the same language as the original text based on the attribute labels of the numbers in the number string, the number string, and context information of the number string in the original text comprises:

[0024] Inputting the original text with attribute labels marked with numbers and after dividing the continuous numbers into digital strings according to the set number of digits into the pre-trained second regularization module to obtain an output regularized text, wherein the regularized text contains the regularization result of the numbers, and the regularization result is the number regularized into a word representation of the same language as the original text;

[0025] The second regularization module is configured to predict the internal state representation of the regularization result of the output number by combining the attribute label of the number in the input original text, the number string and the context information of the number string in the original text.

[0026] Preferably, the second regularization module is a neural network model, and the training process of the neural network model includes:

[0027] Obtaining a training text, and regularizing numbers in the training text into a target text represented by words in the same language;

[0028] Adding attribute tags to the numbers in the training text;

[0029] Divide the continuous numbers in the training text into at least one number string according to the set number of digits;

[0030] Put the attributes marked with numbers into the neural network model to get the predicted regularized text output by the model;

[0031] The predicted regularized text is close to the target text as a training goal, and the neural network model is trained until convergence.

[0032] Preferably, dividing the continuous numbers in the training text into at least one digital string according to the set number of digits as a unit includes:

[0033] Determining the language category of the training text;

[0034] Obtaining a preset number of digital division digits corresponding to the language category of the training text as the set number of digits;

[0035] The continuous numbers in the training text are divided into at least one number string according to the set number of digits.

[0036] Preferably, determining the attributes of the numbers contained in the original text to obtain the attribute tags of the numbers includes:

[0037] Inputting the original text into a pre-trained digital attribute prediction model to obtain the attribute labels of the numbers in the original text output by the model;

[0038] The digital attribute prediction model is trained by using training texts containing numbers as training samples and using attribute labels of numbers marked in the training texts as sample labels.

[0039] Preferably, the training text includes texts in multiple different languages.

[0040] Preferably, the digital attribute tag includes at least one of the following:

[0041] The language tag of the text in which the number appears, the cardinal or ordinal number tag, the gender tag, and the case tag.

[0042] Preferably, the neural network model is a sequence-to-sequence model structure.

[0043] In a second aspect of the present application, a digital regularization device is provided, comprising:

[0044] A text acquisition unit, used for acquiring original text containing numbers;

[0045] An attribute label determination unit, used to determine the attribute of the number contained in the original text to obtain the attribute label of the number;

[0046] A regularization unit is used to regularize the number into a word representation in the same language as the original text based on the attribute label of the number and the context information of the number in the original text, so as to obtain a regularized result of the number.

[0047] A third aspect of the present application provides a digital regularization device, comprising: a memory and a processor;

[0048] The memory is used to store programs;

[0049] The processor is used to execute the program to implement each step of the digital regularization method described above.

[0050] According to a fourth aspect of the present application, a storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, each step of the digital regularization method described above is implemented.

[0051] By means of the above technical scheme, the digital regularization method of the present application determines the attributes of the numbers contained in the original text containing the numbers to be regularized, and obtains the attribute labels of the numbers. The attributes of the numbers can be related attributes that affect the results of digital regularization, such as the masculine / feminine nature of the numbers, cardinal numbers / ordinal numbers, case, etc. On this basis, based on the attribute labels of the numbers and the contextual information of the numbers in the original text, the numbers are regularized into word representations in the same language as the original text to obtain the regularization results of the numbers. The scheme of the present application does not need to summarize digital regularization rules for different languages, the process is more concise, and the contextual information of the numbers in the original text can be fully utilized during digital regularization, which can eliminate some ambiguous problems in the regularization results and improve the accuracy of the regularization results. On this basis, the digital regularization process also refers to the attribute labels of the numbers, that is, it considers the influence of different attributes of the numbers on the regularization, which helps to further improve the accuracy of the regularization results. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present application. Also, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:

[0053] Figure 1 A schematic diagram of a process flow of a digital regularization method provided in an embodiment of the present application;

[0054] Figure 2 The following example shows the regularized representation of the Russian number 1 in different cases.

[0055] Figure 3 A schematic diagram of a training corpus acquisition process provided in an embodiment of the present application;

[0056] Figure 4 Another flow chart of the digital regularization method provided in the embodiment of the present application

[0057] Figure 5 A further flow chart of the digital regularization method provided in the embodiment of the present application;

[0058] Figure 6 A schematic diagram of the structure of a digital regularization device provided in an embodiment of the present application;

[0059] Figure 7 A schematic diagram of the structure of a digital regularization device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0060] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0061] The present application provides a number regularization scheme, which can be applied to solve the number regularization task in various languages, such as regularizing the numbers contained in Chinese sentences into Chinese words, or regularizing the numbers contained in English sentences into English words, etc. Taking the number regularization task in the Chinese context as an example, the original text is: This shirt is worth 125 yuan. The text after regularizing the numbers in the original text is: This shirt is worth one hundred and twenty-five yuan. That is, the number "125" is regularized to "one hundred and twenty-five".

[0062] Digital regularization can be applied to various task scenarios. For example, in a speech synthesis task, if the original text of the speech to be synthesized contains numbers, the numbers need to be regularized into word representations of the same language first, and then the regularized text is used for speech synthesis. The accuracy of the digital regularization result is crucial to the intelligibility of the subsequent speech synthesis.

[0063] However, traditional rule-based digital regularization solutions generally have the problem of incomplete rule coverage, resulting in low accuracy of digital regularization results. To this end, this case provides an optimized digital regularization solution to improve the accuracy of digital regularization results.

[0064] The present application solution can be implemented based on a terminal with data processing capabilities, which can be a mobile phone, computer, server, cloud, etc.

[0065] Next, combine Figure 1 The digital regularization method of the present application may include the following steps:

[0066] Step S100: Obtain original text containing numbers.

[0067] Specifically, the number regularization method of the present application is to solve the problem that when regularizing numbers in a regular manner, the context information of the numbers cannot be fully utilized, and the regularization results of numbers in different contexts may be different. Therefore, when regularizing numbers, the present application obtains the original text containing the numbers to be regularized. When regularizing numbers, the context information of the numbers in the original text can be fully utilized to eliminate some ambiguity problems in the regularization results.

[0068] The original text contains numbers and non-number texts, wherein the numbers are the numbers to be regularized, and the original text may include one or more groups of numbers to be regularized, wherein a group of numbers refers to a continuous string of numbers.

[0069] Let's take the following example to illustrate:

[0070] I spent a total of 12,340 yuan in 2021.

[0071] The above original text contains two number strings, namely "2021" and "12340". The two number strings can both be used as numbers to be regularized. Of course, one or more of them can be selected as numbers to be regularized according to actual needs.

[0072] Furthermore, the language of the original text (ie, the language of the non-digital text) may be a variety of different languages, such as Chinese, English, Russian, etc.

[0073] For example, the original text can be in Chinese, such as:

[0074] This shirt costs 125 yuan.

[0075] The original text can also be in English, such as:

[0076] This shirt costs 125 dollars.

[0077] Step S110: Determine the attributes of the numbers contained in the original text and obtain the attribute labels of the numbers.

[0078] Specifically, in the original texts of different languages, the attributes of numbers in different contexts have many different changes, and the attributes of numbers will affect the representation of the number regularization results. In order to facilitate more accurate subsequent number regularization processing, the attributes of the numbers in the original text are determined in this step to obtain the attribute labels of the numbers.

[0079] Optionally, there may be multiple attribute tags for numbers. This embodiment illustrates several optional situations, such as: the language tag of the text in which the number is located, the cardinal number or ordinal number tag, the masculine or feminine tag, the case tag, etc.

[0080] Next, the above-mentioned attribute tags are explained respectively:

[0081] (1) The language tag of the text containing the number (hereinafter referred to as the language tag), that is, the language of the original text containing the number.

[0082] (2) Cardinality tags:

[0083] Cardinal numbers refer to numerals that describe the quantity of things. Mathematically, they are numbers that can be compared in magnitude. Cardinal numbers can function as the subject, object, attributive, predicative, or appositive in a sentence. Cardinal numbers mainly indicate the number of things or people.

[0084] Most of the Arabic numerals used in daily life are cardinal numbers.

[0085] The following examples use numbers as cardinal numbers (in Chinese):

[0086] 3.1415926 (decimal)

[0087] 6 + 7 + 8 = 21 (mathematical equation)

[0088] ¥1000.00 (currency)

[0089] 21:12 (score)

[0090] (3) Ordinal number tags:

[0091] Ordinal numbers refer to numerals that indicate order. Ordinal numbers can function as the subject, object, attributive, or predicative in a sentence. There is a certain corresponding relationship between cardinal numbers and ordinal numbers. In Chinese, the representation of ordinal numbers is relatively simple. Just adding '第' before the number can indicate that the number is an ordinal number. There are also some obvious rules in English. For example, generally add 'th' to the ordinal number. However, in some languages, there is no such good regular pattern in the correspondence between cardinal numbers and ordinal numbers, which is also part of the reason for the deficiencies of existing rule-based digital regularization methods.

[0092] The following examples use numbers as ordinal numbers:

[0093] 5 / 6 (in Italian, the denominator part of the fraction is used as an ordinal number)

[0094] 30 / 08 / 2020 (in German, the day part of the date is used as an ordinal number)

[0095] 09:23 (in Tibetan, the hour part of the time is used as an ordinal number)

[0096] The 1st place (in Chinese, 1 is an ordinal number, and in Chinese, the pronunciation of the basic word and the ordinal number is the same)

[0097] 6 th (In English, generally 'th' is added to the ordinal number.)

[0098] (4) Masculine and feminine tags:

[0099] Nouns have gender distinctions: feminine, masculine, or neuter. For some languages, different genders can also cause differences in word writing.

[0100] Taking Russian as an example, 1 as a cardinal number has the following three different writing forms for different genders:

[0101] Table 1:

[0102] Russian cardinal numbers (Arabic numerals) Positive neutral Negative 1 Odini Odno Odna

[0103] (5) Case label:

[0104] Case is the relationship between a word and other words in a language. When a noun is inflected, it takes on a grammatical function. For example, when a noun is in the accusative case, it becomes an object no matter where it is placed in the sentence. Of course, not all languages ​​have case grammar, such as Chinese. Different languages ​​with case grammar do not have completely corresponding case classifications. For example, Russian has 6 cases, and Arabic has 3 cases.

[0105] Different case changes will also lead to different digital regularization. Taking Russian 1 as an example, the regularization representation under different case changes can be seen in Figure 2 shown.

[0106] Explanation of 6 cells in Russian:

[0107] One-case: used for subject. I read books, I am the subject, use one-case.

[0108] Second case: When used with nouns, it indicates the owner of a thing or the subordinate relationship of things. For example, the teacher's computer, here the teacher is in the second case.

[0109] The third frame: Give frame. For example: Give me a book. The person being given is me, so I am the third frame.

[0110] Fourth case: used with transitive verbs to indicate the direct object of an action. For example: We love our motherland. Love is a verb, and the object of direct request is our motherland, so our motherland is in the fourth case.

[0111] The fifth grid: The tool grid indicates what is used. For example: I write with a fountain pen. The fountain pen is the fifth grid.

[0112] Six-frame: can only be used with prepositions that require six-frame.

[0113] Step S120: based on the attribute label of the number and the context information of the number in the original text, the number is regularized into a word representation in the same language as the original text to obtain a regularized result of the number.

[0114] Specifically, in this step, during the number regularization process, the number is regularized into a word representation in the same language as the original text, with reference to the attribute label of the number determined previously and the context information of the number in the original text, to obtain a regularized result of the number.

[0115] By adopting the digital regularization method provided in the embodiment of the present application, there is no need to summarize digital regularization rules for different languages, the process is more concise, and the contextual information of the numbers in the original text can be fully utilized during digital regularization, which can eliminate some ambiguous problems in the regularization results and improve the accuracy of the regularization results. On this basis, the digital regularization process also refers to the attribute labels of the numbers, that is, it takes into account the influence of different attributes of the numbers on the regularization, which helps to further improve the accuracy of the regularization results and effectively solves the problems existing in multi-language digital regularization in the prior art.

[0116] In some embodiments of the present application, the above step S110 is introduced to determine the attributes of the numbers contained in the original text and obtain an optional implementation method of the attribute tags of the numbers.

[0117] In this embodiment, the prediction task of the digital attribute label can be implemented based on the neural network model. Specifically, the application can pre-train the digital attribute prediction model. The digital attribute prediction model can adopt a variety of different network structures, for example, a combination structure of Conv&BiLstm&Attention can be adopted. Of course, other optional neural network structures can also be adopted.

[0118] When training a numerical attribute prediction model, training texts containing numbers can be used as training samples, and attribute labels of numbers marked in the training texts can be used as sample labels.

[0119] It can be understood that in order to ensure that the digital attribute prediction model can predict the attributes of numbers in texts of different languages, the training text used to train the model in this embodiment may include texts in multiple different languages, that is, to allow the model to fully learn the relationship between the attribute labels of numbers in texts of different languages ​​and the contextual information of numbers.

[0120] After the model training is completed, the original text containing the numbers to be regularized is input into the trained digital attribute prediction model to obtain the attribute labels of the numbers in the original text output by the model.

[0121] In some embodiments of the present application, the above-mentioned step S120 is introduced, in which the number is regularized into a word representation in the same language as the original text based on the attribute label of the number and the context information of the number in the original text to obtain the regularized result of the number.

[0122] In an optional implementation, the digital regularization process may be implemented based on a preconfigured first regularization module.

[0123] Specifically, the first regularization module can be configured to predict the internal state representation of the regularization result of the output number in combination with the attribute label of the number in the input original text and the context information of the number. On this basis, in the embodiment of the present application, the original text marked with the attribute label of the number can be input into the first regularization module to obtain the output regularized text. The regularized text contains the regularization result of the number, and the regularization result is the number regularized into a word representation of the same language as the original text.

[0124] The first regularization module may be implemented in a variety of forms, such as a functional module configured according to a digital regularization rule set by a user, or implemented in a form based on a neural network model.

[0125] Taking the first regularization module using a neural network model as an example for explanation, the first regularization module can be defined as a first regularization model.

[0126] Specifically, the first regularized model can be pre-trained, and the first regularized model can adopt a sequence-to-sequence Seq2Seq model structure, so as to improve the stability of the model, especially for languages ​​with scarce corpus. The Seq2Seq model structure can adopt a combination structure of Conv&BiLstm&Attention&Lstm. Of course, other optional neural network structures can also be used.

[0127] By pre-training the first regularized model, it can be configured to predict the internal state representation of the regularized result of the output number by combining the attribute label of the number in the input original text and the context information of the number.

[0128] Specifically, the training data of the first regularization model may include:

[0129] The training corpus consists of training texts annotated with numerical attribute tags and target texts, wherein the target text is a text in which the numbers in the training texts are regularized into words in the same language.

[0130] It can be understood that in order to ensure that the first regularization model can perform regularization processing on numbers in texts of different languages, the training texts used to train the model in this embodiment may include texts in multiple different languages, that is, to allow the model to fully learn the relationship between the regularization results of numbers in texts of different languages ​​and the attribute labels and contextual information of the numbers.

[0131] After the first regularized model is trained, the original text with attribute labels marked with numbers can be input into the first regularized model to obtain the regularized text output by the model, wherein the regularized text contains the regularized results of the numbers, and the regularized results are the numbers regularized into word representations in the same language as the original text.

[0132] This embodiment introduces an optional implementation method for obtaining training corpus, combining Figure 3 As shown:

[0133] First, a training text set is obtained. The training text set contains training texts in different languages, and each training text contains a number to be regularized.

[0134] For each training text, the language of the training text is first determined through language discrimination. Then, in the matching relationship between each language and the digital regularization rule set in advance, the digital regularization rule matching the language of the training text is searched, and then the numbers in the training text are regularized according to the found digital regularization rule.

[0135] It should be noted that the present application can pre-organize the basic rules for digital regularization conversion processing in different languages. Of course, the organized rules may not cover all digital regularization processing situations, that is, the results after digital regularization conversion may be inaccurate. Based on this, the present application can further introduce a process of manual proofreading and confirmation, that is, the digital regularization results after rule-based conversion are further confirmed and proofread by humans.

[0136] For the text that has been manually confirmed and proofread, the digital attribute prediction model can be further used to predict the attribute labels of the numbers therein. Of course, in order to ensure the accuracy of the attribute label prediction, the process of manual proofreading and confirming the attribute labels can also be further introduced. After manual confirmation and proofreading, the target text is obtained. Based on this, the training corpus is composed of the training text and the processed target text.

[0137] In some embodiments of the present application, when regularizing numbers in a text, if a continuous string of numbers in the text is considered as a whole, the size of the numbers may be infinite, resulting in a very large input space for the model and a large number of non-login numbers.

[0138] In addition, the applicant of this case found through research that there is a pattern in the regularization of continuous digital strings. Generally, a fixed number of digits is used as a basic unit, and then some unit words are added. Taking English as an example, 123 can be regularized into one hundred twenty-three, and 123000 can be regularized into One hundred twenty threethousand, where thousand is the unit. There are similar unit words related to numerals such as million.

[0139] Furthermore, the applicant of this case also found that for different languages, the division length (that is, the number of digits) when dividing a continuous digital string may also vary. Based on this, the number of digital division digits corresponding to each language can be sorted out.

[0140] Based on the above research, it can be seen that dividing the continuous number string in the text according to the set number of digits can maintain the strong correlation of the number string in the text sentence meaning after division, which is more conducive to accurately obtaining the regularization result of the number, and reduces the input vocabulary space of the model, which is more conducive to training the number regularization model.

[0141] This embodiment provides another digital regularization method, referring to Figure 4 It can be seen that the method may include the following steps:

[0142] Step S200: Obtain the original text containing numbers.

[0143] Step S210: Determine the attributes of the numbers contained in the original text and obtain the attribute tags of the numbers.

[0144] Steps S200 - S210 in this embodiment correspond one-to-one to steps S100 - S110 in the aforementioned embodiment, and are described in detail above and will not be repeated here.

[0145] Step S220: Divide the continuous numbers in the original text into at least one number string according to the set number of digits.

[0146] Compared with the above-mentioned embodiment, the present embodiment adds a process of dividing the continuous numbers in the original text into digital strings according to the set number of digits.

[0147] Optionally, the division process may include:

[0148] S1. Determine the language category of the original text.

[0149] S2. Obtain a preset number of digital division digits corresponding to the language category of the original text as the set number of digits.

[0150] The embodiments of the present application illustrate the correspondence between several types of languages ​​and the number of digits to be divided into numbers, such as: the number of digits to be divided into numbers corresponding to Chinese can be 4 digits, the number of digits to be divided into numbers corresponding to English and French can be 3 digits, and so on.

[0151] S3. Divide the continuous numbers in the original text into at least one number string according to the set number of digits.

[0152] Specifically, when the continuous numbers are divided according to the set number of bits as a unit, a number string may be divided every the set number of bits in order from the lower bit to the higher bit.

[0153] If the last digit string divided from a continuous number is less than the set number of digits, the highest digit is padded with 0 to the set number of digits.

[0154] The following are some examples:

[0155] If the original text is in English, set the number of digits to 3 and the consecutive numbers to "123000":

[0156] When dividing, select three consecutive digits "000" from the low position of the continuous number to divide it into a digital string, and further select three consecutive digits "123" in the high position direction, and finally divide the continuous number into two digital strings, namely "123" and "000".

[0157] Step S230: based on the attribute labels of the numbers in the number string, the number string and the context information of the number string in the original text, regularize each number in the original text into a word representation in the same language as the original text.

[0158] Specifically, compared to the above-mentioned embodiment, in the process of number regularization processing, the number regularization processing is performed on the number string after the continuous numbers in the original text are divided, and the attribute label of the number and the context-related information of the number string in the original text are considered at the same time to obtain the number regularization result. By dividing the continuous numbers in the original text into number strings, the strong correlation of the number strings after division in the text sentence meaning can be maintained, which is more conducive to accurately obtaining the number regularization result.

[0159] In some embodiments of the present application, the above-mentioned step S230 is introduced, which is an optional implementation method of regularizing each number in the original text into a word representation in the same language as the original text based on the attribute labels of the numbers in the number string, the number string and the context information of the number string in the original text.

[0160] In an optional implementation, the digital regularization process can be implemented based on a preconfigured second regularization module.

[0161] Specifically, the second regularization module can be configured to predict the internal state representation of the regularization result of the output number in combination with the attribute label of the number in the input original text, the number string and the context information of the number string in the original text. On this basis, in the embodiment of the present application, the original text marked with the attribute label of the number and after the continuous numbers are divided into the number string according to the set number of bits is input into the preset second regularization module to obtain the output regularized text, which contains the regularization result of the number, and the regularization result is the number regularized into a word representation of the same language as the original text.

[0162] The second regularization module may be implemented in a variety of forms, such as a functional module configured according to a digital regularization rule set by a user, or implemented in a form based on a neural network model.

[0163] Taking the second regularization module using a neural network model as an example for explanation, the second regularization module can be defined as a second regularization model.

[0164] Specifically, the second regularized model can be pre-trained, and the second regularized model can adopt a sequence-to-sequence Seq2Seq model structure, so as to improve the stability of the model, especially for languages ​​with scarce corpus. The Seq2Seq model structure can adopt a combination structure of Conv&BiLstm&Attention&Lstm. Of course, other optional neural network structures can also be used.

[0165] By pre-training the second regularized model, it can be configured to combine the attribute labels of the numbers in the input original text, the number string and the context information of the number string in the original text to predict the internal state representation of the regularized result of the output number.

[0166] Specifically, the training data of the second regularization model may include:

[0167] The training corpus consists of training texts and target texts that are marked with attribute tags with numbers and divided into digital strings according to the set number of digits. The target text is the text in which the numbers in the training text are regularized into words of the same language.

[0168] It can be understood that in order to ensure that the second regularization model can perform regularization processing on numbers in texts of different languages, the training texts used to train the model in this embodiment may include texts in multiple different languages, that is, to allow the model to fully learn the relationship between the regularization results of numbers in texts of different languages ​​and the attribute labels and contextual information of the numbers.

[0169] The embodiment of the present application provides an optional training method for a second regularization model, which may specifically include the following steps:

[0170] S1. Obtain training text, and regularize numbers in the training text into target text represented by words in the same language.

[0171] The training text may be in multiple languages ​​and may include numbers to be regularized.

[0172] The process of obtaining the target text corresponding to the training text can refer to Figure 3 And the corresponding text introduction.

[0173] S2. Add attribute labels to the numbers in the training text.

[0174] Specifically, the attribute labels in the training text can be predicted by the digital attribute prediction model. Of course, if the accuracy is taken into consideration, a manual verification process of the attribute labels can also be added. After the attribute labels of the numbers are determined, attribute labels are added to the numbers in the training text. There are many types of attribute labels, and the details can be referred to the relevant introduction in the previous article.

[0175] S3. Divide the continuous numbers in the training text into at least one number string according to the set number of digits.

[0176] Specifically, the set number of digits for dividing the continuous numbers in the training text may be determined according to the language category of the training text, and then the continuous numbers in the training text may be divided into at least one digit string according to the determined set number of digits.

[0177] S4. Input the training text after the attribute labels marked with numbers and dividing the numbers into digital strings according to the set number of digits into the second regularization model to obtain the predicted regularization text output by the model.

[0178] S5. Taking the predicted regularized text approaching the target text as a training goal, training the second regularized model until convergence.

[0179] The training method of the second regularized model provided in this embodiment adds the operation of dividing the training text into digital strings. Compared with inputting the continuous digital string into the model as a whole, the input vocabulary space of the model is greatly reduced after dividing it into digital strings, which is more conducive to training the second regularized model.

[0180] After the second regularization model is trained, the original text marked with attribute labels of numbers and after the continuous numbers are divided into digital strings according to the set number of digits can be input into the pre-trained second regularization model to obtain the regularized text output by the model, wherein the regularized text contains the regularization results of the numbers, and the regularization results are the numbers regularized into word representations in the same language as the original text.

[0181] In this embodiment, a second regularization model is used to regularize numbers. The input of the second regularization model is pre-processed with number string division, that is, the continuous number strings in the original text are divided according to the set number of digits corresponding to the type of the original text. This can maintain a strong correlation between the number strings after division and the meaning of the text, and is more conducive to accurately obtaining the regularization results of the numbers.

[0182] Next, combine Figure 5Introduce a processing flow for digital regularization of original text containing numbers:

[0183] The original text is passed through a digital attribute prediction model to predict the attribute labels of the numbers contained therein, including the language label, cardinality / ordinal number label, masculine / feminine label, and case label of the original text where the number is located.

[0184] Among them, the digital attribute prediction model can adopt the combined structure of Conv&BiLstm&Attention.

[0185] Furthermore, for the original text, the continuous numbers in it can be divided into digital strings according to the set number of digits as word segmentation units. The text content other than numbers in the original text is also segmented, and then the word segmentation units corresponding to numbers and the word segmentation units corresponding to non-numbers are encoded to obtain the vector representation of the original text: w1n2w3…n i-1 w i .

[0186] The original text is divided into i units, w represents non-numeric segmentation units, and n represents numeric segmentation units.

[0187] Furthermore, the numeric attribute labels in the original text are also encoded into vector form to obtain the vector representation of the attribute labels. The vector representation of the attribute labels is merged with the vector representation of the original text to obtain the merged vector NewInput: w1n2 * w3…n i-1 * w i .

[0188] n * The vector representation of the word segmentation unit representing the number in the original text is merged with the vector representation of the attribute label of the word segmentation unit of the number, such as adding, multiplying or concatenating the vector representations.

[0189] The merged vector NewInput is input into the pre-trained second regularization model to obtain the text output by the second regularization model containing the digital regularization representation.

[0190] Among them, the second regularization model can adopt a Seq2Seq model structure, such as a combined structure of Conv&BiLstm&Attention&Lstm.

[0191] The digital regularization scheme provided in this embodiment can be applied to regularization of numbers in multilingual texts. Moreover, the digital regularization transcription is performed through a unified regularization model, which makes up for the problems of insufficient use of context information and possible ambiguous conflicts caused by rules in existing rule-based digital regularization methods, and improves the accuracy of digital regularization results.

[0192] Moreover, when the model is used for digital regularization, digital attribute labels are taken into consideration, which can solve the problem of regularization errors caused by changes in lattice attributes in existing rule-based digital regularization methods.

[0193] Among them, when dividing the connected numbers in the original text, the division length can be adjusted according to the language of the original text. Through the division of the number string, the strong correlation of the number string after division in the text sentence meaning can be maintained, which is more conducive to accurately obtaining the regularization result of the number, and reduces the input vocabulary space of the regularization model, which is more conducive to training the regularization model.

[0194] The digital regularization device provided in the embodiment of the present application is described below. The digital regularization device described below and the digital regularization method described above can be referred to in correspondence with each other.

[0195] See also Figure 6 , Figure 6 A schematic diagram of the structure of a digital regularization device disclosed in an embodiment of the present application.

[0196] like Figure 6 As shown, the device may include:

[0197] A text acquisition unit 11, used to acquire the original text containing numbers;

[0198] An attribute label determination unit 12, used to determine the attribute of the number contained in the original text to obtain the attribute label of the number;

[0199] The regularization unit 13 is used to regularize the number into a word representation in the same language as the original text based on the attribute label of the number and the context information of the number in the original text, so as to obtain a regularized result of the number.

[0200] The digital regularization device of the present application determines the attributes of each number contained in the original text containing the numbers to be regularized, and obtains the attribute labels of the numbers. The attributes of the numbers can be related attributes that affect the results of digital regularization, such as the masculine / feminine nature of the numbers, cardinal numbers / ordinal numbers, case, etc. On this basis, based on the attribute labels of the numbers and the contextual information of the numbers in the original text, the numbers are regularized into word representations in the same language as the original text to obtain the regularization results of the numbers. The device of the present application does not need to summarize digital regularization rules for different languages, and the process is more concise. In addition, the contextual information of the numbers in the original text can be fully utilized during digital regularization, which can eliminate some ambiguous problems in the regularization results and improve the accuracy of the regularization results. On this basis, the digital regularization process also refers to the attribute labels of the numbers, that is, it takes into account the influence of different attributes of the numbers on the regularization, which helps to further improve the accuracy of the regularization results.

[0201] Optionally, the process in which the attribute label determining unit determines the attribute of the number contained in the original text to obtain the attribute label of the number may include:

[0202] Inputting the original text into a pre-trained digital attribute prediction model to obtain the attribute labels of the numbers in the original text output by the model;

[0203] The digital attribute prediction model is trained by using training texts containing numbers as training samples and using attribute labels of numbers marked in the training texts as sample labels.

[0204] Optionally, the training text may include texts in multiple different languages.

[0205] Optionally, the attribute tag of the number may include at least one of the following: a language tag of the text in which the number is located, a cardinal number or ordinal number tag, a masculine or feminine tag, and a case tag.

[0206] Optionally, the process of the regularization unit regularizing the number into a word representation in the same language as the original text based on the attribute label of the number and the context information of the number in the original text may include:

[0207] Inputting the original text with the attribute label marked with numbers into the pre-trained first regularization module to obtain an output regularized text, wherein the regularized text contains the regularization result of the numbers, and the regularization result is the number regularized into a word representation of the same language as the original text;

[0208] The first regularization module is configured to predict the internal state representation of the regularization result of the output number by combining the attribute label of the number in the input original text and the context information of the number.

[0209] Optionally, the first regularization module may take the form of a neural network model.

[0210] Optionally, the device of the present application may further include:

[0211] A digital string division unit, used for dividing the continuous numbers in the original text into at least one digital string according to a set number of digits before the regularization unit is executed;

[0212] Based on this, the process of the regularization unit regularizing the number into a word representation of the same language as the original text based on the attribute label of the number and the context information of the number in the original text may include:

[0213] Based on the attribute labels of the numbers in the number string, the number string and the context information of the number string in the original text, each number in the original text is regularized into a word representation in the same language as the original text.

[0214] Optionally, the process of the digital string division unit dividing the continuous numbers in the original text into at least one digital string according to the set number of digits may include:

[0215] Determining the language category of the original text;

[0216] Obtaining a preset number of digital division digits corresponding to the language category of the original text as the set number of digits;

[0217] The continuous numbers in the original text are divided into at least one number string according to the set number of digits.

[0218] Optionally, the process of the digital string division unit dividing the continuous numbers in the original text into at least one digital string according to the set number of digits as a unit may include:

[0219] For the continuous numbers in the original text, a number string is divided every the set number of digits in order from the lowest digit to the highest digit;

[0220] If the last digit string divided from a continuous number is less than the set number of digits, the highest digit is padded with 0 to the set number of digits.

[0221] Optionally, the process of the regularization unit regularizing each number in the original text into a word representation in the same language as the original text based on the attribute labels of the numbers in the number string, the number string, and the context information of the number string in the original text may include:

[0222] Inputting the original text with attribute labels marked with numbers and after dividing the continuous numbers into digital strings according to the set number of digits into the pre-trained second regularization module to obtain an output regularized text, wherein the regularized text contains the regularization result of the numbers, and the regularization result is the number regularized into a word representation of the same language as the original text;

[0223] The second regularization module is configured to predict the internal state representation of the regularization result of the output number by combining the attribute label of the number in the input original text, the number string and the context information of the number string in the original text.

[0224] Optionally, the second regularization module may take the form of a neural network model, such as the second regularization module may adopt a second regularization model.

[0225] Optionally, the device of the present application may further include:

[0226] The second regularization model training unit is used to train the second regularization model. The training process includes:

[0227] Obtaining a training text, and regularizing numbers in the training text into a target text represented by words in the same language;

[0228] Adding attribute tags to the numbers in the training text;

[0229] Divide the continuous numbers in the training text into at least one number string according to the set number of digits;

[0230] Input the training text with attribute labels marked with numbers and after dividing the numbers into digital strings according to the set number of digits into the second regularization model to obtain the predicted regularized text output by the model;

[0231] Taking the predicted regularized text approaching the target text as a training goal, the second regularized model is trained until convergence.

[0232] The training texts mentioned above may include texts in multiple different languages.

[0233] Optionally, the second regularization model may be a sequence-to-sequence model structure.

[0234] The digital regularization device provided in the embodiment of the present application can be applied to digital regularization devices, such as terminals: mobile phones, computers, etc. Optionally, Figure 7 The hardware structure diagram of the digital regularization device is shown in FIG. Figure 7 ,The hardware structure of the digital regularization device may include: at least one processor 1, at least one communication interface 2, at least one memory 3, and at least one communication bus 4;

[0235] In the embodiment of the present application, the number of the processor 1, the communication interface 2, the memory 3, and the communication bus 4 is at least one, and the processor 1, the communication interface 2, and the memory 3 communicate with each other through the communication bus 4;

[0236] The processor 1 may be a central processing unit CPU, or an application-specific integrated circuit ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of the present invention, etc.;

[0237] The memory 3 may include a high-speed RAM memory, and may also include a non-volatile memory, such as at least one disk memory;

[0238] The memory stores a program, and the processor can call the program stored in the memory, wherein the program is used to:

[0239] Get the original text containing numbers;

[0240] Determine the attributes of the numbers contained in the original text to obtain attribute labels of the numbers;

[0241] Based on the attribute label of the number and the context information of the number in the original text, the number is regularized into a word representation in the same language as the original text to obtain a regularized result of the number.

[0242] Optionally, the detailed functions and extended functions of the program may refer to the above description.

[0243] The embodiment of the present application further provides a storage medium, which may store a program suitable for execution by a processor, wherein the program is used to:

[0244] Get the original text containing numbers;

[0245] Determine the attributes of the numbers contained in the original text to obtain attribute labels of the numbers;

[0246] Based on the attribute label of the number and the context information of the number in the original text, the number is regularized into a word representation in the same language as the original text to obtain a regularized result of the number.

[0247] Optionally, the detailed functions and extended functions of the program may refer to the above description.

[0248] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0249] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can refer to each other.

[0250] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A digital regularization method, characterized in that: include: Get the original text containing numbers; Determine the attributes of the numbers contained in the original text to obtain attribute labels of the numbers, where the attributes of the numbers are relevant attributes that affect the results of digital regularization; Divide the continuous numbers in the original text into at least one number string according to the set number of digits; Inputting the original text with attribute tags marked with numbers and after dividing the continuous numbers into digital strings according to the set number of digits into a preset second regularization module to obtain an output regularized text, wherein the regularized text contains the regularization result of the numbers, and the regularization result is the number regularized into a word representation of the same language as the original text; Among them, the second regularization module is configured to predict the internal state representation of the regularized result of the output number by combining the attribute labels of the numbers in the input original text, the number string and the context information of the number string in the original text, and the second regularization module is a neural network model.

2. The method according to claim 1, characterized in that The step of dividing the continuous numbers in the original text into at least one number string according to the set number of digits, comprises: Determining the language category of the original text; Obtaining a preset number of digital division digits corresponding to the language category of the original text as the set number of digits; The continuous numbers in the original text are divided into at least one number string according to the set number of digits.

3. The method according to claim 2, characterized in that The step of dividing the continuous numbers in the original text into at least one number string according to the set number of digits as a unit includes: For the continuous numbers in the original text, a number string is divided every the set number of digits in order from the lowest digit to the highest digit; If the last digit string divided from a continuous number is less than the set number of digits, the highest digit is padded with 0 to the set number of digits.

4. The method according to claim 1, characterized in that: The training process of the second regularization module includes: Obtaining a training text, and regularizing numbers in the training text into a target text represented by words in the same language; Adding attribute tags to the numbers in the training text; Divide the continuous numbers in the training text into at least one number string according to the set number of digits; Input the training text with attribute labels marked with numbers and after dividing the numbers into digital strings according to the set number of digits into the second regularization module to obtain the predicted regularized text output by the second regularization module; Taking the predicted regularized text approaching the target text as a training goal, the second regularization module is trained until convergence.

5. The method according to claim 4, characterized in that The step of dividing the continuous numbers in the training text into at least one number string according to the set number of digits, comprises: Determining the language category of the training text; Obtaining a preset number of digital division digits corresponding to the language category of the training text as the set number of digits; The continuous numbers in the training text are divided into at least one number string according to the set number of digits.

6. The method according to claim 1, characterized in that The step of determining the attributes of the numbers contained in the original text to obtain the attribute labels of the numbers includes: Inputting the original text into a pre-trained digital attribute prediction model to obtain the attribute labels of the numbers in the original text output by the model; The digital attribute prediction model is trained by using training texts containing numbers as training samples and using attribute labels of numbers marked in the training texts as sample labels.

7. The method according to claim 4 or 6, characterized in that: The training texts include texts in multiple different languages.

8. The method according to any one of claims 1 to 6, characterized in that: The digital attribute tag includes at least one of the following: The language tag, cardinality tag, ordinal tag, gender tag, and grammatical case tag of the text containing the number.

9. The method according to claim 1, characterized in that: The neural network model is a sequence-to-sequence model structure.

10. A digital regularization device, characterized in that: include: A text acquisition unit, used for acquiring original text containing numbers; An attribute label determination unit, used to determine the attributes of the numbers contained in the original text to obtain the attribute labels of the numbers, wherein the attributes of the numbers are relevant attributes that affect the results of the digital regularization; A digital string division unit, used for dividing the continuous numbers in the original text into at least one digital string according to the set number of digits; A regularization unit, for inputting an original text with attribute labels marked with numbers and after dividing continuous numbers into digital strings according to a set number of digits into a pre-trained second regularization module, to obtain an output regularized text, wherein the regularized text contains a regularization result of the numbers, and the regularization result is a word representation of the numbers regularized into the same language as the original text; Among them, the second regularization module is configured to predict the internal state representation of the regularized result of the output number by combining the attribute labels of the numbers in the input original text, the number string and the context information of the number string in the original text, and the second regularization module is a neural network model.

11. A digital regularization device, characterized in that include: Memory and processor; The memory is used to store programs; The processor is used to execute the program to implement each step of the digital regularization method according to any one of claims 1 to 9.

12. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, each step of the digital regularization method according to any one of claims 1 to 9 is implemented.

Citation Information

Patent Citations

  • Text regularization model training method and apparatus, and text regularization method and apparatus

    CN107680579A

  • Text transformation model training method and apparatus, and text transformation method and apparatus

    CN107680580A