A Chinese spelling correction method based on pre-trained phonetic and glyph knowledge enhancement

By introducing pronunciation and grapheme knowledge into Chinese spelling correction, combined with the BERT model and specific pre-training tasks, the problem of spelling errors caused by pronunciation and grapheme confusion is solved, and the accuracy and efficiency of the spelling correction system are improved.

CN114970503BActive Publication Date: 2024-10-29HARBIN INST OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210598799.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-30
Publication Date
2024-10-29
Estimated Expiration
2042-05-30

AI Technical Summary

Technical Problem

It is difficult for existing technology to effectively handle errors caused by confusion of pronunciation and glyphs in Chinese spelling correction, and there are differences between the Masked language model task in the BERT pre-training stage and Chinese spelling correction technology.

Method used

Using pre-training based pronunciation and glyph knowledge enhancement method, by mapping the pinyin and Cangjie code of Chinese characters to trainable embeddings, GRU network coding is used to obtain the pronunciation and glyph feature vectors, and combined with the BERT model, specific pre-training tasks and masks are performed Strategies to improve the applicability of the model to Chinese spelling correction.

Benefits of technology

It achieves more accurate correction of spelling errors caused by confusion of pronunciation or glyphs, improves the accuracy and efficiency of the Chinese spelling correction system, and is suitable for applications such as search engines, automatic article scoring, and optical character recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114970503B_ABST
    Figure CN114970503B_ABST
Patent Text Reader

Abstract

The present invention proposes a Chinese spelling correction method based on pre-trained enhanced knowledge of pronunciation and glyphs. It belongs to the field of natural language processing technology. The purpose of the present invention is to improve the accuracy of Chinese spelling correction technology, better solve spelling errors caused by confusion between pronunciation or glyphs, and save time for manual review. The present invention first takes out the pinyin and Cangjie code sequence corresponding to the text to be corrected from the database, and then inputs the text and the pinyin and Cangjie code sequence into the model together. The model integrates the contextual semantic information and pronunciation and glyph knowledge of the text, and gives spelling correction suggestions. The present invention also adopts a specific mask strategy and pre-training task, and pre-trains on a large-scale Chinese corpus to obtain a pre-trained language model that is more suitable for Chinese spelling correction technology. The present invention can be used in various text correction scenarios, which improves the efficiency of verifying articles.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of natural language processing, and in particular relates to a Chinese spelling correction method based on pre-trained phonetic and glyph knowledge enhancement. Background Art

[0002] With the rapid development of the Internet, the amount of text has increased rapidly. Traditional manual spelling correction can no longer adapt to the increasing amount of electronic text information. Faced with these endless articles, manual word-by-word verification is obviously unrealistic. The development of natural language processing technology makes it possible for machines to automatically correct spelling errors in text. In addition, text error correction technology guarantees the performance of many common applications and plays an important role in search engines, automatic article scoring, optical character recognition and other applications.

[0003] However, the current keyword extraction technology is not very mature and still has a lot to be improved. The Chinese spelling check system with enhanced pronunciation and glyphs proposed in the present invention attempts to solve the following difficulties:

[0004] 1. Most spelling errors in Chinese texts are related to the pronunciation and glyphs of characters. According to statistics, 76% of the errors are related to similar pronunciation, 46% are related to similar glyphs, and 29% are related to both. Therefore, the present invention integrates the knowledge of the pronunciation and glyphs of characters while understanding how to correct the errors;

[0005] 2. Most of the latest technologies are based on pre-trained language models represented by BERT, but there are differences between the Masked language model task in the BERT pre-training stage and the Chinese spelling correction technology. Therefore, the present invention adopts a specific mask strategy and pre-training task, and pre-trains on a large-scale Chinese corpus to obtain a pre-trained language model that is more suitable for Chinese spelling correction technology. Summary of the invention

[0006] The purpose of the present invention is to solve the problems in the prior art and propose a Chinese spelling correction method based on pre-trained pronunciation and glyph knowledge enhancement. The method can better solve spelling errors caused by confusion of pronunciation or glyph.

[0007] The present invention is implemented by the following technical scheme. The present invention proposes a Chinese spelling correction method based on pre-trained pronunciation and glyph knowledge enhancement, and the method specifically includes:

[0008] Step 1: For the input text, the pinyin and Cangjie code of each Chinese character are taken from the database as the pronunciation and shape knowledge;

[0009] Step 2: Map the pinyin and Cangjie code of the Chinese character to a trainable embedding, and then embed the pinyin sequence and Cangjie code sequence for encoding to obtain the phonetic and glyph feature vectors of the Chinese character;

[0010] Step 3: Use the language model pre-trained on a large amount of Chinese text using a specific pre-training task as an encoder, input the text's phonetic and glyphic feature vectors into the model together with the text, and obtain the contextual representation of the word at each position;

[0011] Step 4: Use the classifier of the vocabulary size to select the character corresponding to the classification result with the highest score as the correction result for the position.

[0012] Furthermore, the GRU network is used to encode the pinyin sequence and the Cangjie code sequence of the Chinese characters respectively. The specific process includes the following steps:

[0013] Step 2.1, for each character input, obtain its pinyin sequence and Cangjie code sequence;

[0014] Step 2.2: Map the initial consonants, finals, and tones in the pinyin sequence of the character to trainable embeddings, and map each character code in the Cangjie code sequence of the character to a trainable embedding. The embedding dimension is set to 768.

[0015] Step 2.3: Use two GRU networks as the phonetic encoder and glyph encoder respectively, take the pinyin sequence and Cangjie code sequence of each Chinese character as input, and use the hidden layer of the GRU network at the last moment of the sequence as the phonetic and glyph feature vector of the character.

[0016] Furthermore, the pronunciation and glyph feature vectors obtained in step 2 are used as one of the inputs of the BERT model and are input into the BERT model together, so as to obtain the contextual representation of the position; the BERT model, whose input includes five parts: Token Embeddings, Position Embeddings, Segment Embeddings, Phonetic Embeddings and Graphic Embeddings; Phonetic Embeddings and Graphic Embeddings correspond to the pronunciation feature vector and glyph feature vector obtained by GRU encoding in step 2, respectively, and the embeddings of these five parts are added together at the input end and input into the BERT model after passing through LayerNorm.

[0017] Furthermore, in step 4, the classifier with the vocabulary size is used to share the weight matrix with the TokenEmbeddings of the BERT model;

[0018] Perform a vocabulary size classification for each position. Specifically, take the context representation hi output by the last hidden layer of the BERT model for classification.

[0019] P(y i = j | X) = softmax(Wh i )[j],

[0020] Where W is a trainable parameter of the classifier. The Token Embeddings layer of BERT and W share weights. The two are semantically similar. Each row of the weight matrix corresponds to each word in the vocabulary, and the size is R. |V|*H , where |V| represents the vocabulary size and H represents the hidden layer dimension size.

[0021] Furthermore, the specific pre-training task is a confusion set-based pre-training task suitable for the CSC task, which randomly replaces 15% of the tokens in the corpus, where:

[0022] (1) In 50% of cases, characters with similar pronunciation are replaced, and in 25% of cases, characters with similar glyphs are replaced. Considering the different frequencies of errors related to pronunciation and errors related to glyphs, different proportions are assigned to these two types of similar characters during replacement. Similar characters are obtained from a public confusion set.

[0023] (2) In 10% of cases, the tokens are replaced with any Chinese character in the vocabulary. The size of the confusion set is limited, but spelling errors are caused by arbitrary character errors. In order to improve the generalization ability, the selected tokens are replaced with random characters in the vocabulary.

[0024] (3) In 15% of cases, it remains unchanged.

[0025] Furthermore, the pre-trained model used in step 3 is pre-trained using three pre-training tasks that are more suitable for the Chinese spelling correction task, namely, the character prediction task, the pinyin prediction task, and the Cangjie code prediction task; the context representation h of the output of the last hidden layer of the BERT model is taken i , used for prediction.

[0026] Furthermore, the character prediction task is similar to the MLM task, predicting the correct character at the mask position, selecting the character with the highest score as the prediction result, and sharing the BERT's Token Embeddings layer and classifier weights.

[0027] Furthermore, the pinyin prediction task predicts the correct pinyin of the characters at the mask position; it is divided into three prediction subtasks: initial consonants, final consonants, and tones. The initial consonants, final consonants, and tones with the highest scores are selected as the prediction results. The feature embeddings of the initial consonants, final consonants, and tones are weighted and shared with the corresponding classifiers to calculate the feature embedding and h. i The similarity between them is such that related embeddings are pulled closer together and unrelated embeddings are pulled further apart.

[0028] Furthermore, the Cangjie code prediction task predicts the correct Cangjie code sequence of the characters at the mask position, which is regarded as a multi-label classification task. The code with a score greater than a certain threshold after sigmoid is selected as the prediction result; the feature embedding of the Cangjie code and the classifier are weighted to calculate the Cangjie code embedding and h i The similarity between them is such that related embeddings are pulled closer together and unrelated embeddings are pulled further apart.

[0029] Furthermore, during the pre-training process, 1.04 million Chinese wiki data and 2.5 million news corpora were collected, from which 7,000,000 sentences were randomly selected as pre-training data.

[0030] The Chinese spelling correction method based on pre-trained word pronunciation and word shape knowledge enhancement involved in the present invention integrates the word shape and word pronunciation characteristics of Chinese characters into the model by introducing external knowledge of pinyin and Cangjie code, and relies on a pre-training method suitable for spelling check technology on a large amount of Chinese text, so as to obtain a Chinese spelling correction system that better utilizes word pronunciation and word shape knowledge. Since most spelling errors are caused by using wrong characters with similar pinyin or similar word shape, such as text obtained by using pinyin input method or optical character recognition, the user of the method of the present invention can easily find spelling errors in the article and save verification time. In addition, the method of the present invention can be applied to search engines, and modifying wrong characters input by users can help the system better understand the retrieval requirements; or it can be applied to the automatic scoring system of articles, by analyzing the number of spelling errors in the article, it is used as one of the important references for scoring; or it can be applied to the optical character recognition system, and the Chinese spelling correction system is applied to the post-processing step of the image-to-text recognition result; or it can be directly applied to news texts with low tolerance for spelling errors. With the help of this method, the verification personnel can save a lot of time and quickly lock possible spelling errors. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Figure 1 Flow chart of an embodiment of the method of the present invention;

[0032] Figure 2 A model structure diagram of a Chinese spelling correction model enhanced with phonetic and glyphic knowledge in the present invention;

[0033] Figure 3 This is the model structure diagram during the pre-training of the Chinese spelling correction model enhanced by pre-trained pronunciation and glyph knowledge in the present invention; Specific implementation manners

[0034] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without making creative efforts shall fall within the protection scope of the present invention.

[0035] In conjunction with Figure 1-Figure 3 , the present invention proposes a Chinese spelling correction method enhanced by pre-trained pronunciation and glyph knowledge, and the method specifically includes:

[0036] Step 1: For the input text, take out the pinyin and Cangjie code of each Chinese character from the database as pronunciation and glyph knowledge;

[0037] In Chinese texts, most spelling mistakes are caused by similar pronunciations or similar glyphs. Therefore, a Chinese spelling correction system needs to integrate the knowledge of character similarity while understanding how to correct mistakes. For example, in the sentence "I think watching movies is very meaningful", the wrong character "事" should be changed to the character "思". If only semantics is considered, changing the character "事" to the character "义" is also feasible. However, considering the reasons for spelling mistakes made by language users, the pinyin of the character "思" and the character "事" is closer. Therefore, changing it to "思" is a better choice. Therefore, the present invention uses the knowledge of pronunciation and glyph to guide the Chinese spelling correction method. In Chinese, pinyin represents the pronunciation of a character, which is composed of an initial, a final, and a tone. The Cangjie code can represent the glyph composition of a Chinese character. In the Cangjie code, Chinese characters are represented by character codes. Letters A to Y each represent a character code, and each character code represents a glyph. For example, G corresponds to "土" and R corresponds to "口". The Cangjie code sequence of a character can show the glyph composition structure of the character, which enables the Cangjie code to be used to measure the glyph similarity between two characters. The closer the Cangjie codes of two characters are, the more similar their glyphs are.

[0038] Step 2: Map the pinyin and Cangjie code of the Chinese character to trainable embeddings, and then encode the pinyin sequence and the Cangjie code sequence embeddings to obtain the pronunciation and glyph feature vectors of the Chinese character;

[0039] This step is to convert the information of human-readable pronunciation and glyph into a machine-readable vector. The pinyin of each Chinese character is composed of three parts: initial consonant, final vowel and tone; the Cangjie code of each Chinese character is a Cangjie code sequence with a maximum length of 5. The present invention maps the initial consonant, final vowel, tone and each Cangjie code to a trainable embedding respectively, and then uses the pronunciation and glyph encoder to encode the feature embedding of the pinyin and Cangjie code sequence to obtain the pronunciation and glyph feature vector of the character.

[0040] The GRU network is used to encode the pinyin sequence and Cangjie code sequence of Chinese characters respectively. The specific process includes the following steps:

[0041] Step 2.1, for each character c input, obtain its pinyin sequence and Cangjie code sequence;

[0042] Step 2.2: Map the initial consonants, finals, and tones in the pinyin sequence of the character to trainable embeddings, and map each character code in the Cangjie code sequence of the character to a trainable embedding. The embedding dimension is set to 768.

[0043] Step 2.3: Use two GRU networks as the phonetic encoder and glyph encoder respectively, take the pinyin sequence and Cangjie code sequence of each Chinese character as input, and use the hidden layer of the GRU network at the last moment of the sequence as the phonetic and glyph feature vector of the character.

[0044] Step 3: Use the language model pre-trained on a large amount of Chinese text using a specific pre-training task as an encoder, input the text's phonetic and glyphic features into the model together with the text, and obtain the contextual representation of the word at each position;

[0045] The pronunciation and glyph feature vectors obtained in step 2 are used as one of the inputs of the BERT model and are input into the BERT model together, so as to obtain the contextual representation of the position; the BERT model, whose input includes five parts: TokenEmbeddings, Position Embeddings, Segment Embeddings, Phonetic Embeddings and Graphic Embeddings; Phonetic Embeddings and Graphic Embeddings correspond to the pronunciation feature vector and glyph feature vector obtained by GRU encoding in step 2 respectively, and the embeddings of these five parts are added together at the input end and input into the BERT model together after passing through LayerNorm.

[0046] The pre-trained model used in step 3 adopts a new mask strategy that is more suitable for the Chinese spelling correction task and is pre-trained on a large-scale corpus.

[0047] In the field of Chinese spelling correction, the latest technologies mostly rely on the powerful semantic representation ability of pre-trained language models. Most auto-encoding language models represented by BERT use the pre-training task of Masked language model (MLM). In the pre-training stage of BERT's MLM, masks are randomly performed. 80% of them are replaced by special markers "[MASK]", 10% use random characters in the vocabulary to replace the MASK characters, and 10% remain unchanged. However, this MASK strategy is actually not completely consistent with the Chinese spelling correction task:

[0048] (1) In most cases, the characters to be predicted in the MLM task are “[MASK]” marks, and in most cases, the characters to be predicted in the CSC task are Chinese characters;

[0049] (2) There is no obvious relationship between the input “[MASK]” token and the output character in the MLM task, while the incorrect input characters in the CSC task are usually similar to the output characters in terms of glyph or pronunciation;

[0050] This leads to the inconsistency problem between pre-training and fine-tuning. Therefore, the language model pre-trained in this way is not the most suitable for CSC tasks.

[0051] The present invention proposes a confusion set-based pre-training task suitable for CSC tasks. Similar to the MLM task, a certain percentage of input tokens are randomly replaced, and then the model is expected to recover them. Specifically, 15% of the tokens in the corpus are replaced.

[0052] The specific pre-training task is a confusion set-based pre-training task suitable for the CSC task, which randomly replaces 15% of the tokens in the corpus, where:

[0053] (1) In 50% of cases, characters with similar pronunciations are replaced, and in 25% of cases, characters with similar glyphs are replaced. Most Chinese spelling errors are related to glyphs and pronunciations. We hope that the model can pay attention to this phenomenon. Considering the different frequencies of errors related to pronunciation and errors related to glyphs, different proportions are assigned to these two types of similar characters during replacement. Similar characters are obtained from the public confusion set.

[0054] (2) In 10% of cases, the tokens are replaced with any Chinese character in the vocabulary. The size of the confusion set is limited, but spelling errors are caused by arbitrary character errors. In order to improve the generalization ability, the selected tokens are replaced with random characters in the vocabulary.

[0055] (3) 15% of the time, it remains unchanged. If all tokens to be predicted during pre-training are “misspelled”, the model will tend to make correct decisions for all inputs.

[0056] During the pre-training process, 1.04 million Chinese wiki data and 2.5 million news corpora were collected, from which 7,000,000 sentences were randomly selected as pre-training data.

[0057] The pre-training model used in step 3 is pre-trained using three pre-training tasks that are more suitable for Chinese spelling correction tasks, namely, character prediction task, pinyin prediction task, and Cangjie code prediction task; during pre-training, the model needs to predict the correct character at the mask position. Considering that the pronunciation and glyph features are added externally by design, in order to better learn the knowledge of pronunciation and glyphs, the present invention designs two other similar pre-training tasks, namely, pinyin prediction and Cangjie code prediction. Therefore, the model contains three prediction tasks. Take the context representation h output by the last hidden layer of the BERT model i , used for prediction.

[0058] The character prediction task is similar to the MLM task. It predicts the correct character at the mask position, selects the character with the highest score as the prediction result, and shares the BERT Token Embeddings layer and classifier weights.

[0059] The pinyin prediction task predicts the correct pinyin of the characters at the mask position; it is divided into three prediction subtasks: initial consonants, final consonants, and tones. The initial consonants, final consonants, and tones with the highest scores are selected as the prediction results. The feature embeddings of the initial consonants, final consonants, and tones are weighted and shared with the corresponding classifiers to calculate the feature embedding and h. i The similarity between them is such that related embeddings are pulled closer together and unrelated embeddings are pulled further apart.

[0060] The Cangjie code prediction task predicts the correct Cangjie code sequence of the characters at the mask position, which is regarded as a multi-label classification task. The code with a score greater than a certain threshold after sigmoid is selected as the prediction result; the feature embedding of the Cangjie code and the classifier are weighted to calculate the Cangjie code embedding and h i The similarity between them is such that related embeddings are pulled closer together and unrelated embeddings are pulled further apart.

[0061] Step 4: Use the vocabulary size classifier to select the character corresponding to the classification result with the highest score as the correction result for the position. This step is to perform a vocabulary size classification on each position. If the character corresponding to the classification result is the same as the input character of the position, the system indicates that there is no error in the position. Otherwise, the position is corrected to the character corresponding to the classification result.

[0062] In step 4, use the classifier with the vocabulary size and share its weight matrix with the TokenEmbeddings of the BERT model;

[0063] Perform a vocabulary size classification for each position. Specifically, take the context representation h output by the last hidden layer of the BERT model i , used for classification,

[0064] P(y i = j | X = softmax(Wh i )[j],

[0065] Where W is a trainable parameter of the classifier. The Token Embeddings layer of BERT and W share weights. The two are semantically similar. Each row of the weight matrix corresponds to each word in the vocabulary, and the size is R. |V|*H , where |V| represents the vocabulary size and H represents the hidden layer dimension size. Such weight sharing can reduce the number of parameters and speed up convergence.

[0066] Example

[0067] According to the above steps, a simple automatic Chinese spelling correction module can be implemented in the present invention. The module can be embedded in any existing system to achieve a plug-and-play effect. The specific beneficial effects of the invention are as follows:

[0068] This embodiment follows Figure 1 The process shown in the figure is carried out to build a Chinese spelling correction system based on pre-trained pronunciation and glyph knowledge enhancement. After the system implemented by the present invention is started, the pre-trained model and the pinyin and Cangjie code database will be loaded into the memory first. After that, the system will take out the pinyin and Cangjie code sequence corresponding to the text from the database according to the text input by the user, and then input the text and the pinyin and Cangjie code sequence into the model together. The model will integrate the contextual semantic information and pronunciation and glyph knowledge of the text to give spelling correction suggestions.

[0069] The above is a detailed introduction to the Chinese spelling correction method based on pre-trained pronunciation and glyph knowledge enhancement proposed by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as limiting the present invention.

Claims

1. A Chinese spelling correction method based on pre-trained phonetic and glyph knowledge enhancement, It is characterized in that The method specifically comprises: Step 1: For the input text, the pinyin and Cangjie code of each Chinese character are taken from the database as the pronunciation and shape knowledge; Step 2: Map the pinyin and Cangjie code of the Chinese character to a trainable embedding, and then embed the pinyin sequence and Cangjie code sequence for encoding to obtain the phonetic and glyph feature vectors of the Chinese character; Step 3: Use the language model pre-trained on a large amount of Chinese text using a specific pre-training task as an encoder, input the text's phonetic and glyphic feature vectors into the model together with the text, and obtain the contextual representation of the word at each position; Step 4: Use the classifier with the vocabulary size to select the character corresponding to the classification result with the highest score as the correction result for that position. The pronunciation and glyph feature vectors obtained in step 2 are used as one of the inputs of the BERT model and are input into the BERT model together, so as to obtain the contextual representation of the position; the BERT model, whose input includes five parts: TokenEmbeddings, Position Embeddings, Segment Embeddings, Phonetic Embeddings and Graphic Embeddings; Phonetic Embeddings and Graphic Embeddings correspond to the pronunciation feature vector and glyph feature vector obtained by GRU encoding in step 2, respectively, and the embeddings of these five parts are added together at the input end and input into the BERT model after passing through LayerNorm.

2. The method according to claim 1, It is characterized in that The GRU network is used to encode the pinyin sequence and Cangjie code sequence of Chinese characters respectively. The specific process includes the following steps: Step 2.1, for each character input, obtain its pinyin sequence and Cangjie code sequence; Step 2.2: Map the initial consonants, finals, and tones in the pinyin sequence of the character to trainable embeddings, and map each character code in the Cangjie code sequence of the character to a trainable embedding. The embedding dimension is set to 768. Step 2.3: Use two GRU networks as the phonetic encoder and glyph encoder respectively, take the pinyin sequence and Cangjie code sequence of each Chinese character as input, and use the hidden layer of the GRU network at the last moment of the sequence as the phonetic and glyph feature vector of the character.

3. The method according to claim 1, It is characterized in that In step 4, use the classifier with the vocabulary size and share its weight matrix with the Token Embeddings of the BERT model; Perform a vocabulary size classification for each position. Specifically, take the context representation h output by the last hidden layer of the BERT model i , used for classification, P(y i =j|X)=softmax(Wh i )[j], Where W is a trainable parameter of the classifier. The Token Embeddings layer of BERT and W share weights. The two are semantically similar. Each row of the weight matrix corresponds to each word in the vocabulary, and the size is R. |V|*H , where |V| represents the vocabulary size and H represents the hidden layer dimension size.

4. The method according to claim 3, It is characterized in that The specific pre-training task is a confusion set-based pre-training task suitable for the CSC task, which randomly replaces 15% of the tokens in the corpus, where: (1) In 50% of cases, characters with similar pronunciation are replaced, and in 25% of cases, characters with similar glyphs are replaced. Considering the different frequencies of errors related to pronunciation and errors related to glyphs, different proportions are assigned to these two types of similar characters during replacement. Similar characters are obtained from a public confusion set. (2) In 10% of cases, the tokens are replaced with any Chinese character in the vocabulary. The size of the confusion set is limited, but spelling errors are caused by arbitrary character errors. In order to improve the generalization ability, the selected tokens are replaced with random characters in the vocabulary. (3) In 15% of cases, it remains unchanged.

5. The method according to claim 4, It is characterized in that The pre-trained model used in step 3 is pre-trained using three pre-training tasks that are more suitable for the Chinese spelling correction task, namely the character prediction task, the pinyin prediction task, and the Cangjie code prediction task; the context representation h of the output of the last hidden layer of the BERT model is taken i , used for prediction.

6. The method according to claim 5, It is characterized in that The character prediction task is similar to the MLM task. It predicts the correct character at the mask position, selects the character with the highest score as the prediction result, and shares the BERT Token Embeddings layer and classifier weights.

7. The method according to claim 6, It is characterized in that The pinyin prediction task predicts the correct pinyin of the characters at the mask position; it is divided into three prediction subtasks: initial consonants, final consonants, and tones. The initial consonants, final consonants, and tones with the highest scores are selected as the prediction results. The feature embeddings of the initial consonants, final consonants, and tones are weighted and shared with the corresponding classifiers to calculate the feature embedding and h. i The similarity between them is such that related embeddings are pulled closer together and unrelated embeddings are pulled further apart.

8. The method according to claim 7, It is characterized in that The Cangjie code prediction task predicts the correct Cangjie code sequence of the characters at the mask position, which is regarded as a multi-label classification task. The code with a score greater than a certain threshold after sigmoid is selected as the prediction result; the feature embedding of the Cangjie code and the classifier are weighted to calculate the Cangjie code embedding and h i The similarity between them is such that related embeddings are pulled closer together and unrelated embeddings are pulled further apart.

9. The method according to claim 8, It is characterized in that During the pre-training process, 1.04 million Chinese wiki data and 2.5 million news corpora were collected, from which 7,000,000 sentences were randomly selected as pre-training data.

Citation Information

Patent Citations

  • Chinese character confusion-prone set construction method based on multi-modal model

    CN112990353A

  • Chinese spelling error correction method and device based on multiple representations and multiple pre-training models

    CN113627158A