CN112395864B - Text error correction model training method, text error correction method and related device - Google Patents

Text error correction model training method, text error correction method and related device Download PDF

Info

Publication number
CN112395864B
CN112395864B CN202011342345.7A CN202011342345A CN112395864B CN 112395864 B CN112395864 B CN 112395864B CN 202011342345 A CN202011342345 A CN 202011342345A CN 112395864 B CN112395864 B CN 112395864B
Authority
CN
China
Prior art keywords
word
noise
text
letter
corrected
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011342345.7A
Other languages
Chinese (zh)
Other versions
CN112395864A (en
Inventor
许国伟
丁文彪
刘子韬
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Century TAL Education Technology Co Ltd
Original Assignee
Beijing Century TAL Education Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Century TAL Education Technology Co Ltd filed Critical Beijing Century TAL Education Technology Co Ltd
Priority to CN202011342345.7A priority Critical patent/CN112395864B/en
Publication of CN112395864A publication Critical patent/CN112395864A/en
Application granted granted Critical
Publication of CN112395864B publication Critical patent/CN112395864B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/232Orthographic correction, e.g. spell checking or vowelisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/284Lexical analysis, e.g. tokenisation or collocates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/044Recurrent networks, e.g. Hopfield networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Abstract

The embodiment of the invention provides a text error correction model training method, a text error correction method and a related device, wherein the text error correction model training method comprises the following steps: acquiring a noise text by using a text error correction model; acquiring noise word characteristics of the noise words, wherein the noise word characteristics comprise noise word letter dependence information and word dependence information of a noise text; acquiring each training possible predicted word and the training word predicted probability thereof according to the noise word characteristics, and acquiring corresponding word similarity according to each training word predicted probability and the word accurate probability of the accurate word corresponding to the noise word; and obtaining text similarity according to the word similarity, adjusting parameters of the text error correction model according to the text similarity until the obtained text similarity meets a similarity threshold, and finishing the training of the text error correction model. The text error correction model training method, the text error correction method and the related device provided by the embodiment of the invention can achieve the effect of text error correction.

Description

Text error correction model training method, text error correction method and related device
Technical Field
The embodiment of the invention relates to the field of computers, in particular to a text error correction model training method, a text error correction method and a related device.
Background
With the development of artificial intelligence technology, the application of natural language processing technology is more and more extensive.
However, when a natural language processing system processes text with noise, the degradation of its processing performance is significant, such as: spam recognition systems, through elaborate means such as: the automatic identification of the junk mail identification system is bypassed by near-sound characters, letter sequence change, simple letter replacement and the like; or for systems that require further processing of the text, advanced error correction processing of noisy text is also required.
However, in the prior art, the effect of error correction and identification on the noise text is poor.
Therefore, how to improve the effect of text error correction becomes a technical problem that needs to be solved by those skilled in the art.
Disclosure of Invention
The embodiment of the invention provides a text error correction model training method, a text error correction method and a related device, which are used for improving the error correction effect on a text.
In order to solve the above problem, an embodiment of the present invention provides a text error correction model training method, including:
acquiring a noise text by using a text error correction model, wherein the noise text comprises noise words;
performing the following for each of the noise words:
acquiring noise word characteristics of the noise words, wherein the noise word characteristics comprise letter dependence information of each noise letter of the noise words and word dependence information of each noise word of the noise text;
acquiring training possible prediction words and training word prediction probabilities of the training possible prediction words according to the noise word characteristics, and acquiring corresponding word similarity according to the training word prediction probabilities and the word accuracy probability of the accurate word corresponding to the noise word;
and adjusting parameters of the text error correction model according to the word similarity until the obtained word similarity meets a similarity threshold, and finishing the training of the text error correction model.
And when the word similarity of the noise text is obtained, obtaining the text similarity according to the word similarity, adjusting the parameters of the text error correction model according to the text similarity until the obtained text similarity meets a similarity threshold, and finishing the training of the text error correction model.
In order to solve the above problem, an embodiment of the present invention provides a text error correction method, including:
acquiring a text to be corrected by using a text correction model obtained by training according to the text correction model training method, wherein the text to be corrected comprises words to be corrected;
acquiring the characteristics of each word to be corrected of the text to be corrected, wherein the characteristics of the word to be corrected comprise letter dependence information of each letter to be corrected of the word to be corrected and word dependence information of each word to be corrected of the text to be corrected;
and obtaining each predicted word according to the characteristics of each word to be corrected to obtain a text after error correction.
In order to solve the above problem, an embodiment of the present invention provides a text error correction model training apparatus, including:
a noise text obtaining unit adapted to obtain a noise text using a text error correction model, the noise text including noise words;
a similarity obtaining unit adapted to perform the following operations for each of the noise words:
acquiring noise word characteristics of the noise words, wherein the noise word characteristics comprise letter dependence information of each noise letter of the noise words and word dependence information of each noise word of the noise text;
acquiring training possible prediction words and training word prediction probability vectors of the training possible prediction words according to the noise word characteristics, and acquiring corresponding word similarity according to the training word prediction probability vectors and word accurate probability vectors of accurate words corresponding to the noise words;
and the text error correction model acquisition unit is suitable for acquiring text similarity according to the word similarity when acquiring the word similarity of the noise text, adjusting parameters of the text error correction model according to the text similarity until the acquired text similarity meets a similarity threshold value, and finishing the training of the text error correction model.
In order to solve the above problem, an embodiment of the present invention provides a text error correction apparatus, including:
the text to be corrected acquiring unit is suitable for acquiring a text to be corrected by utilizing the text correction model obtained by training with the text correction model training method, wherein the text to be corrected comprises words to be corrected;
the word feature acquiring unit to be corrected is suitable for acquiring each word feature to be corrected of the text to be corrected, wherein the word feature to be corrected comprises letter dependence information of each letter to be corrected of the word to be corrected and word dependence information of each word to be corrected of the text to be corrected;
and the corrected text acquisition unit is suitable for acquiring each predicted word according to each corrected word characteristic to obtain a corrected text.
To solve the above problem, an embodiment of the present invention provides a storage medium storing a program adapted for training a text correction model to implement the method for training a text correction model according to any one of the preceding claims, or a storage medium storing a program adapted for correcting a text to implement the method for correcting a text according to any one of the preceding claims.
To solve the above problem, an embodiment of the present invention provides an apparatus, including at least one memory and at least one processor; the memory stores a program that is called by the processor to perform the text correction model training method according to any one of the preceding claims or the text correction method according to any one of the preceding claims.
Compared with the prior art, the technical scheme of the invention has the following advantages:
the text error correction model training method and the related device provided by the embodiment of the invention are characterized in that the text error correction model training method comprises the steps of obtaining a noise text by using a text error correction model, obtaining word similarity of each noise word of the noise text, obtaining the text similarity by using the word similarity, adjusting parameters of the text error correction model based on the text similarity to obtain a trained text error correction model, obtaining noise word characteristics of the noise word when obtaining the word similarity, wherein the noise word characteristics comprise not only letter dependence information of each noise letter of the noise word but also word dependence information of each noise word of the noise text, obtaining each training possible predicted word and a training word prediction probability vector of each training possible predicted word according to the noise word characteristics, and combining the word accurate probability vector of the accurate word corresponding to the noise word to realize the acquisition of the word similarity. Thus, when the text error correction model training method provided by the embodiment of the invention is used for predicting words by using the text error correction model to be trained, the information used in word prediction is increased based on the dependency information between the noise letters in one noise word and the dependency information between the noise words in the noise text, so that the accuracy of text error correction model training can be improved, the accuracy of text error correction by using the trained text error correction model is further improved, and the text error correction effect is improved.
In an alternative scheme, the text error correction model training method provided by the embodiment of the invention further comprises the steps of obtaining noise letter characteristics of each noise letter of the noise word; acquiring possible predicted letters of the noise letter characteristics and letter prediction probability vectors of the possible predicted letters according to the noise letter characteristics of the noise words and accurate words corresponding to the noise words, and acquiring letter similarity according to the letter prediction probability vectors and the letter accurate probability vectors of the accurate letters corresponding to the noise letters; and when the letter similarity and the word similarity of the noise text are obtained, obtaining the text similarity according to the letter similarity and the word similarity. Therefore, according to the text error correction model training method provided by the embodiment of the invention, when the text similarity is obtained, not only is the word level prediction performed, and further the word similarity at the word level is obtained, but also the letter level prediction is performed, and further the letter level similarity is obtained, and both the word similarity and the letter similarity are used as the basis for adjusting the parameters of the text error correction model, and the letter level prediction is performed, so that the word similarity predicted by the noise word and the letter similarity predicted by the noise letter of the noise word are obtained, the accuracy of the text error correction model training can be further improved, and the accuracy of the text error correction performed by the trained text error correction model is further improved.
Drawings
FIG. 1 is a flow chart of a text correction model training method according to an embodiment of the present invention;
FIG. 2 is a block diagram of a text error correction model training method according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating a noise word feature obtaining step of the text error correction model training method according to an embodiment of the present invention;
FIG. 4 is another schematic flow chart of a text correction model training method according to an embodiment of the present invention;
FIG. 5 is a flow chart of a text error correction method according to an embodiment of the present invention;
FIG. 6 is a block diagram of a text error correction method according to an embodiment of the present invention;
FIG. 7 is a block diagram of a text error correction model training apparatus according to an embodiment of the present invention;
FIG. 8 is a block diagram of a text correction apparatus according to an embodiment of the present invention;
fig. 9 is an alternative hardware device architecture of an electronic device provided in an embodiment of the present invention.
Detailed Description
In the prior art, the effect of error correction and identification of a noise text is poor.
In order to improve the effect of error correction recognition on a noisy text, an embodiment of the present invention provides a text error correction model training method, including:
acquiring a noise text by using a text error correction model, wherein the noise text comprises noise words;
performing the following for each of the noise words:
acquiring noise word characteristics of the noise words, wherein the noise word characteristics comprise letter dependence information of each noise letter of the noise words and word dependence information of each noise word of the noise text;
acquiring training possible prediction words and training word prediction probability vectors of the training possible prediction words according to the noise word characteristics, and acquiring corresponding word similarity according to the training word prediction probability vectors and word accurate probability vectors of accurate words corresponding to the noise words;
and when the word similarity of the noise text is obtained, obtaining the text similarity according to the word similarity, adjusting the parameters of the text error correction model according to the text similarity until the obtained text similarity meets a similarity threshold, and finishing the training of the text error correction model.
Therefore, the text error correction model training method provided by the embodiment of the invention obtains the noise text by using the text error correction model, then obtains the word similarity of each noise word of the noise text, then obtains the text similarity by using the word similarity, and realizes the parameter adjustment of the text error correction model based on the text similarity to obtain the trained text error correction model, and when obtaining the word similarity, firstly obtains the noise word characteristics of the noise word, wherein the noise word characteristics include not only the letter dependence information of each noise letter of the noise word, but also the word dependence information of each noise word of the noise text, then obtains the training word prediction probability vectors of each training possible prediction word and each training possible prediction word according to the noise word characteristics, and then combines the word accuracy probability vectors of the accurate word corresponding to the noise word, and obtaining word similarity.
Thus, when the text error correction model training method provided by the embodiment of the invention is used for predicting words by using the text error correction model to be trained, the information used in word prediction is increased based on the dependency information between the noise letters in one noise word and the dependency information between the noise words in the noise text, so that the accuracy of text error correction model training can be improved, the accuracy of text error correction by using the trained text error correction model is further improved, and the text error correction effect is improved.
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1 and fig. 2, fig. 1 is a flow chart of a text error correction model training method according to an embodiment of the present invention; fig. 2 is a schematic block structure diagram of a text correction model training method according to an embodiment of the present invention.
As shown in the figure, the method for training a text correction model according to the embodiment of the present invention includes the following steps:
step S10: noise text is obtained using a text error correction model, the noise text including noise words.
In order to train the text correction model, the noise text is first obtained and includes noise words, it is easily understood that the noise text also has an accurate text corresponding thereto, and each noise word of the noise text also has an accurate word corresponding thereto.
It should be noted that the noise word described herein refers to a letter combination capable of forming a word, and may be an english word, or a pinyin of a chinese character or other letter combinations.
In one embodiment, the noise words and hence the noise text may be obtained by obtaining respective noise letters.
As shown in fig. 2, a dashed box 10 indicates a text error correction model to be trained, which includes an encoder module, an LSTM CELL module, and a Prediction layer module, and there are 3 models shown in the figure, but there is only one model actually, where the 3 shown are representations of processing different noise words in time sequence.
When the noise text is input, the letters c11, c12, … … and c1m1 of the first word w1 are input in sequence, then the letters c21, c22, … … and c2m2 of the second word w2 are input in sequence until the letters cn1, cn2, … … and cnmn of the last word wn are input, and the input of the noise words of the noise text is realized.
In one embodiment, to determine whether a word has been entered, a word terminator may be placed after each noisy word so that the word terminator is received after each letter of the first word has been entered to indicate that the entry of the first word has been completed.
And S11, acquiring the noise word characteristics of the noise word.
And acquiring noise word characteristics of the noise words after the noise words are obtained, wherein the acquired noise word characteristics comprise letter dependence information of each noise letter of the noise words and word dependence information of each noise word of the noise text in order to improve the accuracy of model training.
It is easy to understand that the letter-dependent information refers to the correlation between the noise letters in the noise word; and the word dependence information realizes the mutual relation among the noise words in the noise text.
Referring to fig. 3 in conjunction with fig. 2, fig. 3 is a flow chart illustrating a noise word feature obtaining step of the text error correction model training method according to the embodiment of the present invention.
As shown in the figure, in order to obtain the noise word feature, the text error correction model training method provided by the embodiment of the present invention may include:
step S110: obtaining initial noise word features of each noise word of the noise text, wherein the initial noise word features comprise letter dependence information of each noise letter of the noise word.
In order to obtain the noise word features, initial noise word features are firstly obtained, namely, letter dependence information among noise letters of input noise words is extracted through the noise letters, and the initial noise word features containing the letter dependence information are obtained.
As shown in fig. 2, in a specific embodiment, the initial noise word feature of the noise word may be obtained by using an encode module, that is, the noise letters of the noise word are sequentially input into the encode module according to the noise letter arrangement order of the noise word, and the initial noise word feature of each noise word is obtained after passing through the encode module.
It is easy to understand that, since the obtaining of each initial noise word feature only depends on the specific content of a specific noise word, the step of obtaining the initial noise word feature of each noise word of the noise text may include;
and when the word ending symbol is obtained, obtaining the noise word before the word ending symbol, and obtaining the initial noise word characteristic of the noise word until obtaining the initial noise word characteristic of each noise word.
Therefore, after each noise word is received, the initial noise word characteristic of the noise word can be directly obtained, and the data processing speed is improved.
Step S111: and acquiring the noise word characteristics of each noise word according to the sequence of the initial noise word characteristics of each noise word, wherein the noise word characteristics comprise letter dependence information of each noise letter of the noise word and word dependence information of each noise word of the noise text.
After the initial noise word features are obtained, the noise word features are further obtained based on the initial noise word features, that is, word dependence information of each noise word of the noise text is obtained and is represented by the noise word features.
As shown in fig. 2, in a specific embodiment, the LSTM CELL module may be used to obtain the noise word features, and it is easy to understand that since the noise word features include not only the letter-dependent information of each noise letter of the noise word, but also the word-dependent information of each noise word of the noise text, it is required to obtain the noise word sequence based on the noise word sequence, and therefore, the sequence of each initial noise word feature obtained through step S111 may be input into the LSTM CELL module to obtain each noise word feature, that is, as shown in fig. 2, when the noise word features are obtained by the LSTM CELL module, the arrow shown by the dashed box a in the figure requires information of different noise words.
S12, obtaining training possible prediction words and training word prediction probabilities of the training possible prediction words according to the noise word characteristics, and obtaining corresponding word similarity according to the training word prediction probabilities and the word accuracy probabilities of the accurate words corresponding to the noise words.
After the noise word features are obtained, further according to the noise word features, obtaining each training possible predicted word and each training word predicted probability corresponding to the same noise word features, where the number of training possible predicted words may be multiple, for example: assuming that there are 3, respectively a1, a2, and A3, and the training word prediction probability of a1 is P1, the training word prediction probability of a2 is P2, and the training word prediction probability of A3 is P3, and of course, the sum of P1, P2, and P3 is 1, then the training word prediction probabilities of a1, a2, and A3 may constitute a training word prediction probability vector (P1P 2P 3).
After the training probable prediction words and the training word prediction probabilities of the training probable prediction words are obtained, in order to obtain corresponding word similarity to achieve training of the text error correction model, the accurate words corresponding to the noise words and the word accuracy probabilities of the accurate words can be further obtained, in combination with the above case, if the accurate words are a1, the word accuracy probability of the accurate words a1 is 1, and the word accuracy probability vectors of the corresponding training probable prediction words a1, a2, and A3 are (100).
And obtaining the prediction probability of each training word and the word accuracy probability of the accurate word, and further obtaining the corresponding word similarity.
In one embodiment, the corresponding word similarity may be obtained by training the computation of the cross entropy of the word prediction probability vector and the word accuracy probability vector. The operation mode of cross entropy operation is mature, the word similarity can be guaranteed to be obtained, and the accuracy of the obtained word similarity is guaranteed.
It is easily understood that, as in the foregoing case, if a1 is an exact word, the closer the value of the training word prediction probability P1 of a1 is to 1, the higher the calculated word similarity.
And S13, when the word similarity of the noise text is obtained, obtaining the text similarity according to the word similarity.
After the word similarity is obtained, in order to adjust the parameters of the text error correction model, the text similarity can be further obtained based on the word similarity, so that the word similarity of each noise word is converted into a text similarity, and the performability of parameter adjustment is ensured.
In a specific embodiment, for convenience of calculation, a sum of the similarity may be obtained according to the word similarity, so as to obtain the text similarity. Of course, in other embodiments, the text similarity may be obtained in other manners, such as: mean, variance, etc
It should be noted that, when obtaining the word similarity of each noise word of the noise text, the word similarity may be determined by determining whether the word similarity of each noise word of the noise text is completely obtained in a judging manner, or may be achieved by actively sending the word similarity of each noise word of the noise text to obtain a message after obtaining all the word similarities.
And S14, judging whether the text similarity meets the similarity threshold, if so, executing a step S15, and if not, executing a step S16.
And after the text similarity is obtained, judging whether the text similarity meets a similarity threshold, if so, indicating that the accuracy of the text error correction model meets the accuracy requirement, executing a step S15, and if not, executing a step S16.
And S15, finishing the training of the text correction model.
S16, adjusting the parameters of the text correction model according to the text similarity, and turning to execute the step S10.
It should be noted that, in order to ensure the referential property of the comparison between the text similarity and the similarity threshold, the same noise text may be selected when the step S10 is executed again after the parameter adjustment of the text error correction model is performed.
Thus, the text error correction model training method provided by the embodiment of the invention is based on the dependency information between the noise letters in one noise word and the dependency information between the noise words in the noise text when the text error correction model to be trained is trained, so that the information used in word prediction is increased, the accuracy of the text error correction model training can be improved, the accuracy of text error correction by using the trained text error correction model is further improved, and the text error correction effect is improved.
In another specific embodiment, in order to further improve the accuracy of the training of the text error correction model, an embodiment of the present invention further provides a method for training the text error correction model, please refer to fig. 4, and fig. 4 is another schematic flow chart of the method for training the text error correction model according to the embodiment of the present invention.
As shown in the figure, the method for training a text correction model according to the embodiment of the present invention includes:
step S20: and acquiring the noise text by using a text error correction model.
Please refer to the related description of step S10 shown in fig. 1, and details of step S20 are not repeated herein.
Step S21: and acquiring noise letter characteristics of each noise letter of the noise word and noise word characteristics of the noise word.
For details of obtaining the noise word feature in step S21, please refer to the related description of step S11 shown in fig. 1, which is not repeated herein.
In addition to obtaining the noise word features of the noise words, it is also necessary to obtain the noise letter features of the individual noise letters of the noise words.
In one embodiment, since the noise letters of the noise word are sequentially obtained, the noise letter characteristics of the noise letters can be obtained simultaneously with the obtaining of the noise letters. Therefore, the acquisition of the noise letter characteristic of the prior noise letter is carried out at the same time of the acquisition of the subsequent noise letter, thereby shortening the required time.
With continued reference to fig. 2, in one embodiment, the acquisition of the noise alphabet feature may be implemented using an encoder coding module.
Of course, when a word end symbol is set behind each noise word of the noise text, the step of obtaining the noise letter characteristics of each noise letter of the noise word may include:
and obtaining each noise letter of the noise word according to the sequence of the noise word, and obtaining a noise letter characteristic sequence according to each noise letter until the word end symbol is obtained.
Therefore, the noise letter characteristics of the noise letters of the noise words can be sequentially acquired by taking the noise words as units, so that the corresponding accurate words and accurate letters can be conveniently determined.
In one embodiment, in order to reduce the influence of error information caused by a noise word, a multi-head attention mechanism coding module may be used to obtain noise letter characteristics of each noise letter of the noise word.
Step S22: and acquiring possible predicted letters of the noise letter characteristics and letter prediction probabilities of the possible predicted letters according to the noise letter characteristics of the noise words and accurate words corresponding to the noise words, and acquiring letter similarity according to the letter prediction probabilities and the letter accuracy probabilities of the accurate letters corresponding to the noise letters.
In order to achieve the acquisition of the similarity of letters, after obtaining the noise letter characteristics, determining an accurate word according to the noise letter characteristics and the noise word of the noise letter corresponding to the noise letter characteristics, and obtaining each possible predicted letter of the noise letter characteristics according to the noise letter characteristics and the accurate word, of course, obtaining a plurality of possible predicted letters according to the same noise letter characteristics, and obtaining the letter prediction probability of each possible predicted letter, as shown in fig. 2, when the input noise letter is C11, assuming that 3 possible predicted letters are obtained by obtaining the noise letter characteristics by using an encoder coding module and obtaining the possible predicted letters by using a decoder decoding module: y11', Y11", Y11"', and simultaneously obtaining letter prediction probabilities for each possible predicted letter as: p11', P11 "', each probability constituting a letter prediction probability vector (P11 'P11"'), and the sum of P11', P11 "' being 1.
Of course, the number of the obtained possible predicted letters corresponding to the specific noise letter characteristics may also be 2, 4, and so on, and the specific number may be set as required.
Specifically, when a word end symbol is set after each noise word of the noise text, the possible predicted letters and the letter prediction probability may be obtained as follows:
and when the word end symbol is obtained, obtaining each possible predicted letter of the noise letter characteristic and the letter prediction probability of each possible predicted letter according to each noise letter characteristic of the noise word and the accurate word corresponding to the noise word of the noise letter.
That is, although the letter prediction probability is obtained in units of letters, in order to facilitate the determination of an accurate word, the division of a noise word is realized by using a word end symbol, and when the word end symbol is obtained, the letter prediction probabilities of possible predicted letters and each possible predicted letter are performed.
After each possible predicted letter of the noise letter characteristic and the letter prediction probability of each possible predicted letter, in order to obtain the letter similarity, the accurate letter corresponding to the noise letter and the letter accuracy probability of the accurate letter are obtained, if the accurate letter is P11 ", the letter accuracy probability of the accurate letter P11" is 1, the letter accuracy probabilities of the other possible predicted letters are 0, and each probability constitutes a letter accuracy probability vector (010).
And then, acquiring the letter similarity through the letter prediction probability and the letter accuracy probability.
Specifically, the letter similarity may be obtained by calculation of the cross entropy of the letter prediction probability vector and the letter accuracy probability vector. The operation mode of the cross entropy operation is mature, the acquisition of the letter similarity can be ensured, and the accuracy of the acquired letter similarity is ensured.
Step S23: and acquiring training word prediction probabilities of all training possible prediction words and all training possible prediction words according to the noise word characteristics, and acquiring corresponding word similarity according to the training word prediction probabilities and the word accuracy probabilities of accurate words corresponding to the noise words.
For details of step S23, please refer to the contents of step S12 shown in fig. 1, which is not repeated herein.
Step S24: and when the letter similarity and the word similarity of the noise text are obtained, obtaining the text similarity according to the letter similarity and the word similarity.
After the letter similarity and the word similarity are obtained, the text similarity is obtained according to the letter similarity and the word similarity, so that preparation is made for subsequent parameter adjustment of a text error correction model, the letter similarity and the word similarity can be referred, the accuracy of the similarity can be improved, the performability of parameter adjustment can be ensured, and the adjustment of parameters to different directions caused by different letter similarities or word similarities is avoided.
Of course, when the letter similarity and the word similarity are obtained simultaneously, the sum of the similarity can be obtained according to the word similarity and the letter similarity to obtain the text similarity, so that the complexity of obtaining the text similarity is simplified.
Step S25: and judging whether the text similarity meets the similarity threshold, if so, executing the step S26, and if not, executing the step S27.
Step S26: and finishing the training of the text error correction model.
Step S27: and adjusting parameters of the text error correction model according to the text similarity.
For details of steps S25-S2, please refer to the contents of steps S14-S16 shown in FIG. 1, which are not repeated herein
Therefore, according to the text error correction model training method provided by the embodiment of the invention, when the text similarity is obtained, not only is the word level prediction performed, and further the word similarity at the word level is obtained, but also the letter level prediction is performed, and further the letter level similarity is obtained, and both the word similarity and the letter similarity are used as the basis for adjusting the parameters of the text error correction model, and the letter level prediction is performed, so that the word similarity predicted by the noise word and the letter similarity predicted by the noise letter of the noise word are obtained, the accuracy of the text error correction model training can be further improved, and the accuracy of the text error correction performed by the trained text error correction model is further improved.
In order to improve the accuracy of text error correction, an embodiment of the present invention further provides a text error correction method, please refer to fig. 5 and fig. 6, fig. 5 is a schematic flow diagram of the text error correction method provided in the embodiment of the present invention, and fig. 6 is a schematic block structure diagram of the text error correction method provided in the embodiment of the present invention.
As shown in the figure, the text error correction method provided by the embodiment of the present invention includes:
step S30: and acquiring a text to be corrected by using the text correction model obtained by training by using the text correction model training method, wherein the text to be corrected comprises words to be corrected.
When text error correction is performed on a text to be corrected, firstly, the text to be corrected is obtained, and the text to be corrected comprises words to be corrected.
In a specific embodiment, the acquisition of the text to be corrected can be realized by acquiring the letters to be corrected of each word to be corrected.
As shown in fig. 6, a dashed box 20 indicates the trained text error correction model, which includes an encoder module, an LSTM CELL module, and a Prediction layer module, as shown in the figure, 3 models are shown, but there is only one model actually, where the 3 shown are representations of processing different words to be corrected in time sequence.
When the noise text is input, the letters L11, L12, … … and L1m1 of the first word W1 are input in sequence, then the letters L21, L22, … … and L2m2 of the second word W2 are input in sequence until the letters Lt1, Lt2, … … and Ltmt of the last word Wt are input, and the input of the noise words of the noise text is realized.
In one embodiment, to determine whether a word has been entered, a word terminator may be placed after each noisy word so that the word terminator is received after each letter of the first word has been entered to indicate that the entry of the first word has been completed.
Step S31: acquiring the characteristics of each word to be corrected of the text to be corrected, wherein the characteristics of the word to be corrected comprise letter dependence information of each letter to be corrected of the word to be corrected and word dependence information of each word to be corrected of the text to be corrected.
And acquiring the word characteristics to be corrected of the word to be corrected after the word to be corrected is obtained, wherein the acquired word characteristics to be corrected comprise letter dependence information of each letter to be corrected of the word to be corrected and word dependence information of each word to be corrected of the text to be corrected in order to improve the accuracy of model training.
In a specific implementation manner, in order to obtain the word features to be corrected, the step of obtaining each word feature to be corrected of the text to be corrected by the text correction model training method provided in the embodiment of the present invention may include:
acquiring initial word features to be corrected of each word to be corrected of the text to be corrected, wherein the initial word features to be corrected comprise letter dependence information of each letter to be corrected of the word to be corrected;
acquiring the character of the word to be corrected of each word to be corrected according to the sequence of the initial character of the word to be corrected of each word to be corrected, wherein the character of the word to be corrected comprises letter dependence information of each letter to be corrected of the word to be corrected and word dependence information of each word to be corrected of the text to be corrected.
In order to obtain the characteristics of the words to be corrected, firstly, the characteristics of the initial words to be corrected are obtained, namely, the letter dependence information among the letters to be corrected is extracted through the input letters to be corrected of the words to be corrected, so that the characteristics of the initial words to be corrected containing the letter dependence information are obtained.
As shown in fig. 6, in a specific embodiment, the encoder encoding module may be used to obtain the initial word-to-be-corrected features of the word to be corrected, that is, the letters to be corrected of each word to be corrected of the encoder encoding module are sequentially input according to the arrangement sequence of the letters to be corrected of the word to be corrected, and after passing through the encoder encoding module, the initial word-to-be-corrected features of each word to be corrected are obtained.
It is easy to understand that, since the obtaining of the characteristics of each initial word to be corrected only depends on the specific content of a specific word to be corrected, the step of obtaining the characteristics of the initial word to be corrected of each word to be corrected of the text to be corrected may include;
and when the word ending symbol is obtained, obtaining the word to be corrected before the word ending symbol, and obtaining the initial word feature to be corrected of the word to be corrected until the initial word feature to be corrected of each word to be corrected is obtained.
Therefore, after receiving a word to be corrected, the initial word feature to be corrected of the word to be corrected can be directly obtained, and the data processing speed is improved.
After the initial word feature to be corrected is obtained, the word feature to be corrected is further obtained based on the initial word feature to be corrected, that is, the word dependence information of each word to be corrected of the text to be corrected is obtained and is represented by the word feature to be corrected.
As shown in fig. 6, in a specific embodiment, the LSTM CELL module may be used to obtain the characteristics of the word to be corrected, and it is easy to understand that since the characteristics of the word to be corrected include not only the letter-dependent information of each letter to be corrected of the word to be corrected, but also the word-dependent information of each word to be corrected of the text to be corrected, it is required to obtain the characteristics based on the sequence of the word to be corrected, and therefore, the obtained sequence of each initial word to be corrected may be input to the LSTM CELL module to obtain the characteristics of each word to be corrected, that is, as shown in fig. 6, when the characteristics of the word to be corrected are obtained by using the LSTM CELL module, the arrow shown by the dashed box B in the figure needs information of different words to be corrected.
Step S32: and obtaining each predicted word according to the characteristics of each word to be corrected to obtain a text after error correction.
After the word feature to be corrected is obtained, the corresponding predicted word is further obtained according to the word feature to be corrected, all the predicted words corresponding to the text to be corrected are obtained, and the text after correction can be obtained.
In a specific embodiment, in order to obtain an error correction text and reduce difficulty in obtaining the error correction text, the step of obtaining each predicted word according to each error correction word feature includes:
obtaining each possible prediction word group and the word prediction probability of each possible prediction word in each possible prediction word group according to each word feature to be corrected;
and acquiring the possible predicted word with the maximum word prediction probability in each possible predicted word group to obtain each predicted word and the corrected text.
It should be noted that a group of possible predicted words includes each possible predicted word corresponding to a feature of a word to be corrected.
For the characteristics of a plurality of words to be corrected, the same number of possible predicted word groups are required to be obtained, and each possible predicted word group comprises a plurality of possible predicted words, of course, in order to finally determine the predicted words, the word prediction probability of each possible predicted word is also obtained while each possible predicted word is obtained,
and then determining the word with the maximum prediction probability in the possible prediction words as the prediction word, thereby obtaining the corrected text.
As shown in fig. 6, for the text W1W2 … … Wt to be corrected, after the text correction method provided by the embodiment of the present invention is performed, W1 ' W2 ' … … Wt ' is obtained.
Therefore, when the text to be corrected is corrected, the text error correction method provided by the embodiment of the invention not only obtains the dependency information between the letters to be corrected in the words to be corrected, but also obtains the dependency information between the words to be corrected in the text to be corrected, so that the information used in word prediction is increased, the text error correction can be improved, and the text error correction effect is improved.
In the following, the text error correction model training apparatus and the text error correction apparatus provided by the embodiment of the present invention are introduced, and the text error correction model training apparatus and the text error correction apparatus described below may be regarded as functional module architectures that are required to be set by an electronic device (e.g., a PC) to respectively implement the text error correction model training method or the text error correction method provided by the embodiment of the present invention. The contents of the text error correction model training apparatus and the text error correction apparatus described below may be referred to in correspondence with the contents of the text error correction model training method and the text error correction method described above, respectively.
Fig. 7 is a block diagram of a text error correction model training apparatus provided in an embodiment of the present invention, where the text error correction model training apparatus is applicable to both a client and a server, and referring to fig. 7, the text error correction model training apparatus may include:
a noise text obtaining unit 100 adapted to obtain a noise text using a text error correction model, the noise text including noise words;
a similarity obtaining unit 110 adapted to perform the following operations for each of the noise words:
acquiring noise word characteristics of the noise words, wherein the noise word characteristics comprise letter dependence information of each noise letter of the noise words and word dependence information of each noise word of the noise text;
acquiring training possible prediction words and training word prediction probability vectors of the training possible prediction words according to the noise word characteristics, and acquiring corresponding word similarity according to the training word prediction probability vectors and word accurate probability vectors of accurate words corresponding to the noise words;
the text error correction model obtaining unit 120 is adapted to, when obtaining each word similarity of the noise text, obtain a text similarity according to each word similarity, adjust parameters of the text error correction model according to the text similarity until the obtained text similarity satisfies a similarity threshold, and end training of the text error correction model.
In a specific embodiment, the similarity obtaining unit 110 is adapted to perform the following operations on each of the noise words:
acquiring noise letter characteristics of each noise letter of the noise word;
acquiring possible predicted letters of the noise letter characteristics and letter prediction probability vectors of the possible predicted letters according to the noise letter characteristics of the noise words and accurate words corresponding to the noise words, and acquiring letter similarity according to the letter prediction probability vectors and the letter accurate probability vectors of the accurate letters corresponding to the noise letters;
the text correction model obtaining unit 120 is adapted to, when obtaining each word similarity of the noise text, obtain text similarities according to each word similarity, and includes:
and when the letter similarity and the word similarity of the noise text are obtained, obtaining the text similarity according to the letter similarity and the word similarity.
Optionally, the similarity obtaining unit 110 is adapted to obtain a noise word feature of the noise word, and includes:
acquiring initial noise word characteristics of each noise word of the noise text, wherein the initial noise word characteristics comprise letter dependence information of each noise letter of the noise word;
and acquiring the noise word characteristics of each noise word according to the sequence of the initial noise word characteristics of each noise word, wherein the noise word characteristics comprise letter dependence information of each noise letter of the noise word and word dependence information of each noise word of the noise text.
Optionally, a word ending symbol is set behind each noise word of the noise text;
the similarity obtaining unit 110, adapted to obtain the noise letter characteristics of each noise letter of the noise word, includes:
obtaining each noise letter of the noise word according to the sequence of the noise word, and obtaining a noise letter characteristic sequence according to each noise letter until the word end symbol is obtained;
the similarity obtaining unit 110 is adapted to obtain, according to the noise letter features of the noise letters and the accurate words corresponding to the noise words of the noise letters, each possible predicted letter of the noise letter features and the letter prediction probability vector of each possible predicted letter, and includes:
and when the word end symbol is obtained, obtaining each possible predicted letter of the noise letter characteristic and a letter prediction probability vector of each possible predicted letter according to each noise letter characteristic of the noise word and an accurate word corresponding to the noise word of the noise letter.
Optionally, the similarity obtaining unit 110 is adapted to obtain an initial noise word feature of each noise word of the noise text, and includes:
and when the word ending symbol is obtained, obtaining the noise word before the word ending symbol, and obtaining the initial noise word characteristic of the noise word until obtaining the initial noise word characteristic of each noise word.
Optionally, the similarity obtaining unit 110 is adapted to obtain the noise letter characteristics of the respective noise letters of the noise words, and includes:
and acquiring the noise letter characteristics of each noise letter of the noise word by using a multi-head attention mechanism coding module.
Optionally, the similarity obtaining unit 110, adapted to obtain the text similarity according to each letter similarity and each word similarity, includes:
and obtaining the sum of the similarity according to the letter similarity and the word similarity to obtain the text similarity.
Thus, the text error correction model training device provided by the embodiment of the invention is based on the dependency information between the noise letters in one noise word and the dependency information between the noise words in the noise text when the text error correction model to be trained is trained, so that the information used in word prediction is increased, the accuracy of the text error correction model training can be improved, the accuracy of text error correction by using the trained text error correction model is further improved, and the text error correction effect is improved.
To solve the foregoing problems, an embodiment of the present invention further provides a text correction device, please refer to fig. 8, where fig. 8 is a block diagram of the text correction device provided in the embodiment of the present invention, the text correction device can be applied to both a client and a server, and referring to fig. 8, the recommended topic determination device can include:
the text to be corrected acquiring unit 200 is adapted to acquire a text to be corrected by using a text correction model obtained by training according to the text correction model training method, where the text to be corrected includes words to be corrected;
a word feature acquiring unit 210 to be corrected, adapted to acquire each word feature to be corrected of the text to be corrected, where the word feature to be corrected includes letter dependency information of each letter to be corrected of the word to be corrected and word dependency information of each word to be corrected of the text to be corrected;
the corrected text obtaining unit 220 is adapted to obtain each predicted word according to each of the corrected word features, so as to obtain a corrected text.
Optionally, the corrected text obtaining unit 220 is adapted to obtain each predicted word according to each of the features of the word to be corrected, and the obtained corrected text includes:
obtaining each possible prediction word group and the word prediction probability of each possible prediction word in each possible prediction word group according to each word feature to be corrected;
and acquiring the possible predicted word with the maximum word prediction probability in each possible predicted word group to obtain each predicted word and the corrected text.
Optionally, the word feature acquiring unit 210 to be corrected, adapted to acquire each word feature to be corrected of the text to be corrected, includes:
acquiring initial word features to be corrected of each word to be corrected of the text to be corrected, wherein the initial word features to be corrected comprise letter dependence information of each letter to be corrected of the word to be corrected;
acquiring the character of the word to be corrected of each word to be corrected according to the sequence of the initial character of the word to be corrected of each word to be corrected, wherein the character of the word to be corrected comprises letter dependence information of each letter to be corrected of the word to be corrected and word dependence information of each word to be corrected of the text to be corrected.
Therefore, when the text to be corrected is corrected, the text correction device provided by the embodiment of the invention not only obtains the dependency information between the letters to be corrected in the words to be corrected, but also obtains the dependency information between the words to be corrected in the text to be corrected, so that the information used in word prediction is increased, the text correction can be improved, and the text correction effect is improved.
Of course, the embodiment of the present invention further provides an apparatus, and the apparatus provided in the embodiment of the present invention may load the program module architecture in a program form, so as to implement the text error correction model training method or the text method provided in the embodiment of the present invention; the hardware device can be applied to an electronic device with specific data processing capacity, and the electronic device can be: such as a terminal device or a server device.
Optionally, fig. 9 shows an optional hardware device architecture of the device provided in the embodiment of the present invention, which may include: at least one memory 3 and at least one processor 1; the memory stores a program which is called by the processor to execute the text correction model training method or the text correction method, in addition, at least one communication interface 2 and at least one communication bus 4; the processor 1 and the memory 3 may be located in the same electronic device, for example, the processor 1 and the memory 3 may be located in a server device or a terminal device; the processor 1 and the memory 3 may also be located in different electronic devices.
As an alternative implementation of the disclosure of the embodiment of the present invention, the memory 3 may store a program, and the processor 1 may call the program to execute the text error correction model training method or the text error correction method provided by the above-mentioned embodiment of the present invention.
In the embodiment of the invention, the electronic device can be a tablet computer, a notebook computer and other devices capable of determining the recommended titles.
In the embodiment of the present invention, 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 complete mutual communication through the communication bus 4; it is clear that the communication connection of the processor 1, the communication interface 2, the memory 3 and the communication bus 4 shown in fig. 7 is only an alternative;
optionally, the communication interface 2 may be an interface of a communication module, such as an interface of a GSM module;
the processor 1 may be a central processing unit CPU or a Specific Integrated circuit asic (application Specific Integrated circuit) or one or more Integrated circuits configured to implement an embodiment of the invention.
The memory 3 may comprise a high-speed RAM memory and may also comprise a non-volatile memory, such as at least one disk memory.
It should be noted that the above-mentioned apparatus may also include other devices (not shown) that may not be necessary to the disclosure of the embodiments of the present invention; these other components may not be necessary to understand the disclosure of embodiments of the present invention, which are not individually described herein.
Embodiments of the present invention further provide a computer-readable storage medium, where computer-executable instructions are stored, and when executed by a processor, the instructions may implement the text error correction model training method or the text error correction method as described above.
The computer executable instructions stored in the storage medium provided by the embodiment of the invention utilize a text error correction model to obtain a noise text, then perform word similarity obtaining on each noise word of the noise text, then utilize the word similarity to obtain the text similarity, and realize parameter adjustment of the text error correction model based on the text similarity to obtain a trained text error correction model, and when obtaining the word similarity, firstly obtain the noise word characteristics of the noise word, wherein the noise word characteristics include not only the letter dependence information of each noise letter of the noise word, but also the word dependence information of each noise word of the noise text, then obtain the training word prediction probability vectors of each training possible prediction word and each training possible prediction word according to the noise word characteristics, and then combine the word accuracy probability vectors of the accurate word corresponding to the noise word, and obtaining word similarity. Thus, the text error correction model training method provided by the embodiment of the invention is based on the dependency information between the noise letters in one noise word and the dependency information between the noise words in the noise text when the word is predicted by using the text error correction model to be trained, so that the information used in word prediction is increased, the accuracy of text error correction model training can be improved, the accuracy of text error correction by using the trained text error correction model is further improved, and the text error correction effect is improved.
The embodiments of the present invention described above are combinations of elements and features of the present invention. Unless otherwise mentioned, the elements or features may be considered optional. Each element or feature may be practiced without being combined with other elements or features. In addition, the embodiments of the present invention may be configured by combining some elements and/or features. The order of operations described in the embodiments of the present invention may be rearranged. Some configurations of any embodiment may be included in another embodiment, and may be replaced with corresponding configurations of the other embodiment. It is obvious to those skilled in the art that claims that are not explicitly cited in each other in the appended claims may be combined into an embodiment of the present invention or may be included as new claims in a modification after the filing of the present application.
Embodiments of the invention may be implemented by various means, such as hardware, firmware, software, or a combination thereof. In a hardware configuration, the method according to an exemplary embodiment of the present invention may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), processors, controllers, micro-controllers, microprocessors, and the like.
In a firmware or software configuration, embodiments of the present invention may be implemented in the form of modules, procedures, functions, and the like. The software codes may be stored in memory units and executed by processors. The memory unit is located inside or outside the processor, and may transmit and receive data to and from the processor via various known means.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Although the embodiments of the present invention have been disclosed, the present invention is not limited thereto. Various changes and modifications may be effected therein by one skilled in the art without departing from the spirit and scope of the invention as defined in the appended claims.

Claims (14)

1. A text correction model training method is characterized by comprising the following steps:
acquiring a noise text by using a text error correction model, wherein the noise text comprises noise words;
performing the following for each of the noise words:
acquiring noise word characteristics of the noise words, wherein the noise word characteristics comprise letter dependence information of each noise letter of the noise words and word dependence information of each noise word of the noise text;
acquiring training possible prediction words and training word prediction probabilities of the training possible prediction words according to the noise word characteristics, and acquiring corresponding word similarity according to the training word prediction probabilities and the word accuracy probability of the accurate word corresponding to the noise word;
and when the word similarity of the noise text is obtained, obtaining the text similarity according to the word similarity, adjusting the parameters of the text error correction model according to the text similarity until the obtained text similarity meets a similarity threshold, and finishing the training of the text error correction model.
2. The method of text correction model training as recited in claim 1, wherein the step of performing the following operations on each of the noise words further comprises:
acquiring noise letter characteristics of each noise letter of the noise word;
acquiring possible predicted letters of the noise letter characteristics and letter prediction probability vectors of the possible predicted letters according to the noise letter characteristics of the noise words and accurate words corresponding to the noise words, and acquiring letter similarity according to the letter prediction probability vectors and the letter accurate probability vectors of the accurate letters corresponding to the noise letters;
when the word similarity of the noise text is obtained, the step of obtaining the text similarity according to the word similarity comprises the following steps:
and when the letter similarity and the word similarity of the noise text are obtained, obtaining the text similarity according to the letter similarity and the word similarity.
3. The text correction model training method of claim 2, wherein the step of obtaining the noise word feature of the noise word comprises:
acquiring initial noise word characteristics of each noise word of the noise text, wherein the initial noise word characteristics comprise letter dependence information of each noise letter of the noise word;
and acquiring the noise word characteristics of each noise word according to the sequence of the initial noise word characteristics of each noise word, wherein the noise word characteristics comprise letter dependence information of each noise letter of the noise word and word dependence information of each noise word of the noise text.
4. The text error correction model training method according to claim 3, wherein a word end symbol is set after each noise word of the noise text;
the step of obtaining the noise letter characteristics of each noise letter of the noise word comprises:
obtaining each noise letter of the noise word according to the sequence of the noise word, and obtaining a noise letter characteristic sequence according to each noise letter until the word end symbol is obtained;
the step of obtaining each possible predicted letter of the noise letter characteristic and the letter prediction probability vector of each possible predicted letter according to the noise letter characteristic of the noise letter and the accurate word corresponding to the noise word of the noise letter comprises:
and when the word end symbol is obtained, obtaining each possible predicted letter of the noise letter characteristic and a letter prediction probability vector of each possible predicted letter according to each noise letter characteristic of the noise word and an accurate word corresponding to the noise word of the noise letter.
5. The method of training a text correction model according to claim 4, wherein the step of obtaining initial noise word features of each of the noise words of the noise text comprises:
and when the word ending symbol is obtained, obtaining the noise word before the word ending symbol, and obtaining the initial noise word characteristic of the noise word until obtaining the initial noise word characteristic of each noise word.
6. The method of text error correction model training as defined in claim 2, wherein the step of obtaining the noise letter characteristic of each noise letter of the noise word comprises obtaining the noise letter characteristic of each noise letter of the noise word using a multi-head attention mechanism coding module.
7. The method for training the text correction model according to claim 2, wherein the step of obtaining the text similarity according to the respective letter similarities and the respective word similarities comprises:
and obtaining the sum of the similarity according to the letter similarity and the word similarity to obtain the text similarity.
8. A text error correction method, comprising:
acquiring a text to be corrected by using the text correction model obtained by training according to the text correction model training method of any one of claims 1 to 7, wherein the text to be corrected comprises words to be corrected;
acquiring the characteristics of each word to be corrected of the text to be corrected, wherein the characteristics of the word to be corrected comprise letter dependence information of each letter to be corrected of the word to be corrected and word dependence information of each word to be corrected of the text to be corrected;
and obtaining each predicted word according to the characteristics of each word to be corrected to obtain a text after error correction.
9. The text error correction method of claim 8, wherein the step of obtaining each predicted word according to the characteristics of each word to be error corrected to obtain the text after error correction comprises:
obtaining each possible prediction word group and the word prediction probability of each possible prediction word in each possible prediction word group according to each word feature to be corrected;
and acquiring the possible predicted word with the maximum word prediction probability in each possible predicted word group to obtain each predicted word and the corrected text.
10. The text error correction method of claim 9, wherein the step of obtaining the characteristics of each word to be corrected of the text to be corrected comprises:
acquiring initial word features to be corrected of each word to be corrected of the text to be corrected, wherein the initial word features to be corrected comprise letter dependence information of each letter to be corrected of the word to be corrected;
acquiring the character of the word to be corrected of each word to be corrected according to the sequence of the initial character of the word to be corrected of each word to be corrected, wherein the character of the word to be corrected comprises letter dependence information of each letter to be corrected of the word to be corrected and word dependence information of each word to be corrected of the text to be corrected.
11. A text correction model training apparatus, comprising:
a noise text obtaining unit adapted to obtain a noise text using a text error correction model, the noise text including noise words;
a similarity obtaining unit adapted to perform the following operations for each of the noise words:
acquiring noise word characteristics of the noise words, wherein the noise word characteristics comprise letter dependence information of each noise letter of the noise words and word dependence information of each noise word of the noise text;
acquiring training possible prediction words and training word prediction probability vectors of the training possible prediction words according to the noise word characteristics, and acquiring corresponding word similarity according to the training word prediction probability vectors and word accurate probability vectors of accurate words corresponding to the noise words;
and the text error correction model acquisition unit is suitable for acquiring text similarity according to the word similarity when acquiring the word similarity of the noise text, adjusting parameters of the text error correction model according to the text similarity until the acquired text similarity meets a similarity threshold value, and finishing the training of the text error correction model.
12. A text correction apparatus, comprising:
a text to be corrected acquiring unit, adapted to acquire a text to be corrected by using the text correction model trained by the text correction model training method according to any one of claims 1 to 7, wherein the text to be corrected includes words to be corrected;
the word feature acquiring unit to be corrected is suitable for acquiring each word feature to be corrected of the text to be corrected, wherein the word feature to be corrected comprises letter dependence information of each letter to be corrected of the word to be corrected and word dependence information of each word to be corrected of the text to be corrected;
and the corrected text acquisition unit is suitable for acquiring each predicted word according to each corrected word characteristic to obtain a corrected text.
13. A storage medium storing a program adapted for text correction model training to implement the text correction model training method according to any one of claims 1 to 7, or a storage medium storing a program adapted for text correction to implement the text correction method according to any one of claims 8 to 10.
14. An electronic device comprising at least one memory and at least one processor; the memory stores a program that the processor calls to execute the text correction model training method according to any one of claims 1 to 7 or the text correction method according to any one of claims 8 to 10.
CN202011342345.7A 2020-11-26 2020-11-26 Text error correction model training method, text error correction method and related device Active CN112395864B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011342345.7A CN112395864B (en) 2020-11-26 2020-11-26 Text error correction model training method, text error correction method and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011342345.7A CN112395864B (en) 2020-11-26 2020-11-26 Text error correction model training method, text error correction method and related device

Publications (2)

Publication Number Publication Date
CN112395864A CN112395864A (en) 2021-02-23
CN112395864B true CN112395864B (en) 2021-04-06

Family

ID=74604001

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011342345.7A Active CN112395864B (en) 2020-11-26 2020-11-26 Text error correction model training method, text error correction method and related device

Country Status (1)

Country Link
CN (1) CN112395864B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115659958B (en) * 2022-12-27 2023-03-21 中南大学 Chinese spelling error checking method

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110147549A (en) * 2019-04-19 2019-08-20 阿里巴巴集团控股有限公司 For executing the method and system of text error correction

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7640158B2 (en) * 2005-11-08 2009-12-29 Multimodal Technologies, Inc. Automatic detection and application of editing patterns in draft documents
CN108874174B (en) * 2018-05-29 2020-04-24 腾讯科技(深圳)有限公司 Text error correction method and device and related equipment
CN111310440B (en) * 2018-11-27 2023-05-30 阿里巴巴集团控股有限公司 Text error correction method, device and system
CN109885828A (en) * 2019-01-14 2019-06-14 平安科技(深圳)有限公司 Word error correction method, device, computer equipment and medium based on language model

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110147549A (en) * 2019-04-19 2019-08-20 阿里巴巴集团控股有限公司 For executing the method and system of text error correction

Also Published As

Publication number Publication date
CN112395864A (en) 2021-02-23

Similar Documents

Publication Publication Date Title
CN112509555B (en) Dialect voice recognition method, device, medium and electronic equipment
US20220092031A1 (en) Data compression method and computing device
JP6677419B2 (en) Voice interaction method and apparatus
CN112270200B (en) Text information translation method and device, electronic equipment and storage medium
CN108574494B (en) Coding and decoding method and device
CN114757176A (en) Method for obtaining target intention recognition model and intention recognition method
CN116884391B (en) Multimode fusion audio generation method and device based on diffusion model
CN112395864B (en) Text error correction model training method, text error correction method and related device
CN111563391A (en) Machine translation method and device and electronic equipment
CN112417874A (en) Named entity recognition method and device, storage medium and electronic device
CN112949290A (en) Text error correction method and device and communication equipment
CN116306610A (en) Model training method and device, natural language processing method and device
CN107832341B (en) AGNSS user duplicate removal statistical method
CN112735392B (en) Voice processing method, device, equipment and storage medium
CN114519346A (en) Decoding processing method, device, equipment and medium based on language model
CN111506717B (en) Question answering method, device, equipment and storage medium
CN114417834A (en) Text processing method and device, electronic equipment and readable storage medium
CN110222693B (en) Method and device for constructing character recognition model and recognizing characters
US11651246B2 (en) Question inference device
CN111626059A (en) Information processing method and device
CN111384976A (en) Storage method and reading method of sparse check matrix
CN115905702B (en) Data recommendation method and system based on user demand analysis
CN114218937B (en) Data error correction method and device and electronic equipment
US20230128346A1 (en) Method, device, and computer program product for task processing
CN115840808B (en) Technological project consultation method, device, server and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant