A multi-dimensional intelligent error correction method based on Chinese character knowledge graph

Through a multi-dimensional intelligent error correction method based on Chinese character knowledge graph, the graph neural network and convolutional neural network encode Chinese character features, combined with the three-dimensional soft-masked bert model, the existing technology's corrective capabilities in shape-like characters and special symbols are solved. The problem of insufficient significantly improves the error correction accuracy and entity extraction effect.

CN113535975BActive Publication Date: 2024-11-19NANJING SINOVATIO TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110727574.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-29
Publication Date
2024-11-19
Estimated Expiration
2041-06-29

AI Technical Summary

Technical Problem

The existing error correction model performs well in handling the corrective characters of pronunciation, but the corrective ability of characters, special symbols and multi-word continuous errors is insufficient. Especially in short texts in the field of technical investigation, typos and artificial confusion are used. The effect of text analysis has a significant impact.

Method used

Based on the Chinese character knowledge graph, the pronunciation, glyph and semantic features of Chinese characters are encoded using graph neural networks and convolutional neural networks, combined with the three-dimensional soft-masked bert error correction model, and error correction is performed through multi-dimensional feature vectors, and the relationships in the graph are used. and context information for error detection and correction.

Benefits of technology

It significantly improves the correction effect of typos such as homophones and similar characters in text messages, minimizes the impact of typos and artificial confusion on text analysis, and improves the error correction accuracy and entity extraction effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113535975B_ABST
    Figure CN113535975B_ABST
Patent Text Reader

Abstract

The present invention discloses a multi-dimensional intelligent error correction method based on Chinese character knowledge graph, comprising the following steps: (1) in order to characterize the connection between Chinese characters in multiple angles of pronunciation, pinyin, and radical structure, a knowledge graph between Chinese characters is established; (2) using graph neural network GNN and convolutional neural network CNN, different types of relationships in the Chinese character knowledge graph are encoded into two vectors of "pronunciation" and "font", and then adding the existing "semantic" vector, a total of three-dimensional feature vectors are obtained; (3) a three-dimensional soft-masked BERT error correction model is designed, and the three-dimensional feature vectors of the characters are introduced into the error correction model respectively, and the final error correction result is the weighted sum value of the three dimensions. The present invention mainly aims at the characteristics of short texts in the field of technical investigation, and eliminates the influence of typos and artificial confusion on text analysis to the greatest extent.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data analysis and processing, and in particular to a multi-dimensional intelligent error correction method based on a Chinese character knowledge graph. Background Art

[0002] In short texts involved in the technical investigation field, there will be a large amount of data deliberately confused by people, such as replacing individual characters in text messages by means of homophonic characters, similar characters, simplified and traditional characters, etc. to interfere with machine recognition, such as replacing "WeChat" with "prestige" and "good review" with "good ping". In addition, there are also some typos caused by input errors in some texts. If such data is not processed, it will inevitably affect the performance of related algorithm models (including classification, element extraction, semantic recognition).

[0003] Through previous relevant research, it is found that the existing error correction models currently have good correction ability for homophonic characters, general correction ability for similar-shaped characters, and little involvement in special symbols, combined characters, and continuous multi-character errors. Summary of the Invention

[0004] The technical problem to be solved by the present invention is to provide a multi-dimensional intelligent error correction method based on a Chinese character knowledge graph, mainly aiming at the characteristics of short texts in the technical investigation field, and maximizing the elimination of the influence of typos and artificial confusion on text analysis.

[0005] To solve the above technical problem, the present invention provides a multi-dimensional intelligent error correction method based on a Chinese character knowledge graph, including the following steps:

[0006] (1) To represent the connections between Chinese characters in terms of pronunciation, pinyin, and radical structure from multiple perspectives, a knowledge graph between Chinese characters is established;

[0007] (2) Using a graph neural network GNN and a convolutional neural network CNN, different types of relationships in the Chinese character knowledge graph are encoded into two vectors of "pronunciation" and "character shape", and together with the existing "semantic" vector, a total of three-dimensional feature vectors are obtained;

[0008] (3) Design a three-dimensional soft-masked bert error correction model, introduce the three-dimensional feature vectors of characters into the error correction model respectively, and the final error correction result is the weighted sum value of the three dimensions.

[0009] Preferably, in step (2), a graph neural network GNN is used to encode different types of relationships in the Chinese character knowledge graph to obtain the "pronunciation" vector of the Chinese character, specifically: referring to word2vec in natural language processing, the Chinese characters in the Chinese character knowledge graph that can be associated by "pronunciation" are used as each other's context, and iterative training is performed with this as the goal, and finally a representation vector is obtained for each Chinese character, and the similarity of the vectors represents the similarity between the pronunciations of the Chinese characters.

[0010] Preferably, in step (2), based on the graph neural network GNN, different types of relationships in the Chinese character knowledge graph are encoded to obtain the "glyph" vector of the Chinese character: referring to word2vec in natural language processing, the Chinese characters in the Chinese character knowledge graph that can be associated through the "glyph structure" are used as each other's context, and iterative training is performed with this as the goal, and finally a representation vector is obtained for each Chinese character, and the similarity of the vectors represents the similarity between the glyph structures of the Chinese characters.

[0011] Preferably, in step (2), the "supplementary glyph vectors" of all characters are obtained, specifically: based on the convolutional neural network CNN, the images of all characters are encoded into a vector, which represents the graphic structure characteristics of the characters, called the supplementary glyph vector, and the final glyph vector of the Chinese character is the sum of the supplementary glyph vector and the "glyph" vector.

[0012] Preferably, in step (3), designing a three-dimensional soft-masked BERT error correction model specifically includes the following steps:

[0013] (31) Graph construction and multi-dimensional vector establishment: Complete the graph construction and the training of pronunciation and glyph dimension feature vectors, combine the original semantic vectors to form a three-dimensional vector space, and then replace all characters in the text with their corresponding three-dimensional vectors;

[0014] (32) Three-dimensional independent error correction: The three-dimensional vectors are input into three GRU models respectively. The GRU model captures the features of the text context and outputs the error probability of each character. The three-dimensional vectors are multiplied by the error probability to obtain the three-dimensional feature vectors of the wrong characters.

[0015] (33) Recall after three-dimensional fusion: Recall refers to which character in the known text is a typo, and selecting a suitable character from the commonly used Chinese character set as the correction result; based on the three-dimensional feature vector of the typo, the attention weighted summation is performed between different dimensions, and finally a mixed vector is output, which is connected to the subsequent BERT model, and the output result is its correction result.

[0016] The beneficial effect of the present invention is that after multi-dimensional error correction, better results are achieved in restoring typos such as homophones and similar characters in text messages, and the influence of typos and human confusion on text analysis can be eliminated to the greatest extent. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 This is a schematic diagram of an example of the “pronunciation” related path in the Chinese character knowledge graph of the present invention.

[0018] Figure 2 This is a schematic diagram showing an example of similarity after the pronunciation vector is two-dimensionalized in the present invention.

[0019] Figure 3 This is a schematic diagram of an example of a "font" related path in the Chinese character knowledge graph of the present invention.

[0020] Figure 4 A schematic diagram of the training process of supplementing the glyph vectors of the present invention.

[0021] Figure 5 A schematic diagram of the generation process of the supplementary glyph vector of the present invention.

[0022] Figure 6 This is a schematic diagram showing an example of similarity after the glyph vector is two-dimensionalized according to the present invention.

[0023] Figure 7 It is a schematic diagram of the overall structural framework of the error correction model of the present invention. DETAILED DESCRIPTION

[0024] A multi-dimensional intelligent error correction method based on Chinese character knowledge graph includes the following steps:

[0025] (1) To represent the connections between Chinese characters in terms of pronunciation, pinyin, and radical structure, a knowledge graph is established between Chinese characters;

[0026] (2) Using graph neural networks (GNNs) and convolutional neural networks (CNNs), we encode different types of relationships in the Chinese character knowledge graph into two vectors: “pronunciation” and “character shape”. Adding the existing “semantic” vector, we obtain a feature vector with three dimensions.

[0027] (3) Design a three-dimensional soft-masked BERT error correction model and introduce the three-dimensional feature vectors of the characters into the error correction model respectively. The final error correction result is the weighted sum of the three dimensions.

[0028] After in-depth analysis of a large number of actual text samples, it was found that the reason why humans can recognize obfuscated text is because there is a connection between the obfuscated text and the original text in terms of pronunciation and glyph, thus constructing a knowledge graph between Chinese characters.

[0029] In the Chinese character knowledge graph of the present invention, common Chinese characters such as Chinese characters, pinyin, radical structures, and their related elements are presented in the form of a graph, which includes two types of data: "nodes" and "relationships". The specific content is shown in Table 1:

[0030] Table 1 Content of Chinese Character Knowledge Graph

[0031]

[0032]

[0033] The success of existing NLP algorithms is almost all based on word vectors (word2vec), that is, the semantics of vocabulary are vectorized. As a result, each character has its own vector, and the similarity of word vectors between contexts is relatively high. For example, "知" and "道" are often contexts of each other, and the similarity of their semantic vectors is 0.89, while the vector similarity between "知" and "龙" is only 0.13.

[0034] Referring to word vectors here, this project intends to propose a pronunciation vector based on the Chinese character knowledge graph. Referring to the context conditions during word vector training, the pinyin syllables on the same path in the graph are used as contexts for each other, as shown in Figure 1 shown.

[0035] The four syllables "zhang1", "zang1", "zi4", and "yi1" are contexts of each other. Train node2vec until convergence, and finally obtain a vector for each syllable, which is its pronunciation vector. There are multiple paths and the distance is relatively close between "zhang1" and "zang1", while there are very few paths and the distance is relatively far between "zhang1" and "zi1", "yi1". Therefore, the vector similarity between "zhang1" and "zang1" should be much greater than that between "zhang1" and "zi4", "yi1". The actual results are shown in Table 2:

[0036] Table 2 Example of Similarity Results of Partial Pronunciation Vectors

[0037] "zang1" "zi1" "yi1" Similarity results with "zhang1" 0.76 0.15 0.14

[0038] This result will be combined with the semantic and glyph fusion in the following text, directly affecting the effect of error correction. Taking "+莪薇新,经晚给你溜盒号" as an example, the distributions of the pronunciations of "新" and "经" and their corrected pronunciations in the pronunciation vector space are as shown in Figure 2 shown. The error correction results are compared with some other products as shown in Table 3:

[0039] Table 3 Error Correction Results of Homophonic Characters Based on Pronunciation Vectors

[0040]

[0041]

[0042] Vectorizing the glyph structure between Chinese characters is a difficult point. In this project, two methods are adopted to encode it. The first one is similar to the pronunciation vector, that is, the node2vec model related to the glyph relationship in the knowledge graph. For example Figure 3 is a path related to the glyph relationship in the graph.

[0043] In this path, the four Chinese characters "薇", "微", "山", and "出" are each other's contexts. Training node2vec until convergence can obtain the result vector of each character, and it also satisfies the property similar to the pronunciation vector, that is, the vector similarity between "薇" and "微" is greater than that between "薇" and "山", "出".

[0044] However, the above glyph vectors can only be applied to Chinese characters and cannot solve the problem of similarity of special symbols. For example, the similarity between "□" (square symbol) and "口" should be very high, but "□" does not belong to the Chinese character structure, and the glyph relationships such as "decomposition", "combinable", and "radical" in the existing graph cannot connect it with Chinese characters. For the above reasons, a supplementary glyph vector based on CNN (Convolutional Neural Network) is proposed.

[0045] CNN is most commonly used to process image problems. It is good at capturing local features of pictures. Considering that although there are many characters in the computer system, the number of basic strokes that make up the characters is very small. Therefore, as long as the specific glyph features of the characters are captured, they can be encoded into vectors.

[0046] The first step of encoding is to train the CNN model. Here, different font pictures of 3500 Chinese characters are used as training samples. Each character has 8 fonts, for a total of 28000 training samples. The process of generating training samples is as Figure 4 shown. The model objective is to make the model ignore the font and correctly recognize the Chinese characters in the pictures.

[0047] After 10 rounds of final iteration, the recognition accuracy of the model reaches 99.3%, indicating that the model can already capture the features in the Chinese character graphics well at this time. At this time, it is necessary to use the trained CNN model to make a prediction on all character pictures once, and use the penultimate layer vector of the result as the glyph vector of the character. The prediction process is as Figure 5 shown. The final glyph vector of the character is the sum of the CNN supplementary glyph vector and the node2vec glyph vector in the knowledge graph.

[0048] Taking the text "今曰幚莪荬幚莪做事,+莪薇信" as an example, Figure 6The distribution of "幚", "莪", "荬", "薇", "曰" and their corrected results in the glyph vector space is as follows. As shown in Table 4, the pairwise similarity results of some Chinese character glyph vectors are listed here:

[0049] Table 4 Example of Similarity Results of Some Glyph Vectors

[0050]

[0051]

[0052] It can be seen that the glyph vectors do express the glyph structure of the characters. Based on the glyph vectors, the workload and subjectivity brought by manual rules can be avoided. On the basis of the glyph vectors, combined with the semantic and glyph fusion error correction models in the text, the error correction results are compared with some other products as shown in Table 5:

[0053] Table 5 Error Correction Results of Similar-Shaped Characters Based on Glyph Vectors

[0054]

[0055] So far, based on the Chinese character knowledge graph, the following two results have been obtained: the pronunciation vector and glyph vector of the character. Together with the original word vector, each character has three-dimensional vectors. Next, an error correction model will be established based on the three-dimensional feature vectors. (Note: Each Chinese character has three-dimensional vectors of "pronunciation", "glyph", and "word meaning"; but for special symbols such as "+", there are only two vectors of "pronunciation" and "glyph", and its "word meaning" vector is 0; for some symbols without pronunciation such as "┸" (tabulation symbol), there is only a "glyph" vector, and its "pronunciation" and "word meaning" vectors are both 0).

[0056] Here, a three-dimensional soft-masked bert model is proposed, and its model is mainly divided into the following parts:

[0057] 1) Atlas construction and vector establishment: Complete the construction of the atlas and the training of three-dimensional feature vectors, and then replace all characters in the text with their corresponding three-dimensional vectors;

[0058] 2) Three-dimensional independent error correction: Input the three-dimensional vectors into three GRU models respectively. The GRU model can capture the features of the text context, and the output result is the error probability of each character. After multiplying the original three-dimensional vector and the error probability respectively, it is used as the three-dimensional feature vector of the misspelled character. This step is mainly to find the position of the misspelled character;

[0059] 3) Recall after three-dimensional fusion: The so-called recall refers to which character in the known text is a wrong character, and the appropriate character is selected from the commonly used Chinese character set as the correction result; based on the three-dimensional feature vector of the wrong character, the attention weighted sum is performed between different dimensions, and finally a mixed vector is output, which is connected to the subsequent BERT model, and the output result is its correction result. The purpose of performing attention calculation between different dimensions is to learn the correlation between "character shape" and "semantics", for example, characters with "wood radical" are mostly related to plants;

[0060] The architecture diagram of the model is as follows Figure 7 As shown in the figure, the "semantic vector" is a commonly used word vector. The GRU model outputs the error probability of each word in each dimension. After the error probabilities of the three dimensions of "semantics", "font shape" and "pronunciation" are fused, the similarity between the output of the BERT model and the original semantic vector is calculated, and the most similar word is selected from the candidate set as the recall result.

[0061] After multi-dimensional error correction, better results were achieved in restoring typos such as homophones and similar characters in text messages. SpellGCN and this model were trained with the same 500 text message corpus, and then tested with the same 1200 data. The results of manual verification are shown in Table 6:

[0062] Table 6 Comparison of the effects of this model and spellgcn

[0063] spellgcn This model Number of Error Corrections 766 707 Number of correct errors 516 632 Error correction accuracy 62.4% 89.5% Typo recall rate 55% 75% Correction rate of similar-sounding characters 95% 95% Correction rate of similar characters 45% 75% Special character error correction accuracy 55% 80%

[0064] In actual applications, we are more concerned about the entities obtained in text messages (such as WeChat ID, QQ ID, etc.). After the model corrects the typos, the extraction effect of the entities is improved as shown in Table 7:

[0065] Table 7 Comparison of entity extraction effects

[0066] Detection before correction Found after error correction Improvement ratio WeChat 259 384 48.3% QQ 76 92 21.1% url 954 990 4.5%

Claims

1. A multi-dimensional intelligent error correction method based on Chinese character knowledge graph, characterized in that: The steps include: (1) Represent the connections between Chinese characters from multiple perspectives, including pronunciation, pinyin, and radical structure, and establish a knowledge graph between Chinese characters; (2) Using graph neural networks (GNNs) and convolutional neural networks (CNNs), we encode different types of relationships in the Chinese character knowledge graph into two vectors: "pronunciation" and "character shape". Adding the existing "semantic" vector, we obtain a feature vector with three dimensions. (3) Design a three-dimensional soft-masked BERT error correction model, introduce the three-dimensional feature vectors of the characters into the error correction model respectively, and the final error correction result is the weighted sum value of the three dimensions; specifically, the following steps are included: (31) Graph construction and multi-dimensional vector establishment: Complete the graph construction and the training of pronunciation and glyph dimension feature vectors, combine the original semantic vectors to form a three-dimensional vector space, and then replace all characters in the text with their corresponding three-dimensional vectors; (32) Three-dimensional independent error correction: The three-dimensional vectors are input into three GRU models respectively. The GRU model captures the features of the text context and outputs the error probability of each character. The three-dimensional vectors are multiplied by the error probability to obtain the three-dimensional feature vectors of the wrong characters. (33) Recall after three-dimensional fusion: Recall refers to knowing which character in the text is a typo and selecting the appropriate character from the commonly used Chinese character set as the correction result; Based on the three-dimensional feature vector of the wrong character, attention weighted summation is performed between different dimensions, and finally a mixed vector is output, which is connected to the subsequent BERT model, and the output result is its correction result.

2. The multi-dimensional intelligent error correction method based on Chinese character knowledge graph as claimed in claim 1, characterized in that: In step (2), a graph neural network (GNN) is used to encode different types of relationships in the Chinese character knowledge graph to obtain the "pronunciation" vector of the Chinese character. Specifically, referring to word2vec in natural language processing, the Chinese characters in the Chinese character knowledge graph that can be associated by "pronunciation" are used as each other's contexts. With this as the goal, iterative training is performed, and finally a representation vector is obtained for each Chinese character. The similarity of the vectors represents the similarity between the pronunciations of the Chinese characters.

3. The multi-dimensional intelligent error correction method based on Chinese character knowledge graph as claimed in claim 1, characterized in that: In step (2), based on the graph neural network GNN, different types of relationships in the Chinese character knowledge graph are encoded to obtain the "glyph" vector of the Chinese character. Specifically, referring to word2vec in natural language processing, the Chinese characters in the Chinese character knowledge graph that can be associated through "glyph structure" are used as each other's context, and iterative training is performed with this as the goal. Finally, a representation vector is obtained for each Chinese character, and the similarity of the vectors represents the similarity between the glyph structures of the Chinese characters.

4. The multi-dimensional intelligent error correction method based on Chinese character knowledge graph as claimed in claim 1, characterized in that: In step (2), the "supplementary glyph vectors" of all characters are obtained. Specifically, based on the convolutional neural network CNN, the images of all characters are encoded into a vector, which represents the graphic structure characteristics of the character, called the supplementary glyph vector. The final glyph vector of the Chinese character is the sum of the supplementary glyph vector and the "glyph" vector.