Text error correction method based on knowledge enhancement
Through the knowledge-enhanced text error correction method, the error correction task is decomposed into multiple subtasks, which solves the problems of semantic drift and insufficient supervision of fact verification in the prior art, and achieves higher error correction accuracy and reliability.
Patent Information
- Application Number
- CN202411646853.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-18
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2044-11-18
AI Technical Summary
The existing text error correction technology has semantic drift and insufficient supervision of fact verification, resulting in low accuracy and reliability of error correction.
Using knowledge-enhanced text error correction methods, we will avoid excessive correction and insufficient fact verification through steps such as subject information extraction, problem generation, evidence retrieval, question answering and scoring sorting.
It effectively avoids semantic drift and insufficient fact verification supervision, improves the accuracy and reliability of text error correction, and ensures that the corrected information remains consistent with trusted knowledge sources.
Smart Images

Figure CN119670732A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of natural language processing, and in particular to a text error correction method based on knowledge enhancement. Background Art
[0002] With the evolution of society and the innovation of technology, the dramatic changes in human lifestyles have profoundly affected the use of language and characters. In the digital age, text creation activities have therefore shown explosive growth. This change has not only made text creation more convenient and popular, but has also brought a series of new problems and challenges, especially errors in the text, such as grammatical errors, which not only threaten the readability and professionalism of the text, but also constitute an obstacle for readers to accurately understand the text information.
[0003] With the continuous development of natural language processing technology, automatic text correction technology has emerged. This technology aims to use computer-assisted systems to improve text quality, reduce errors in grammar, spelling, punctuation, etc., and provide writing suggestions to improve the accuracy and professionalism of language expression. However, text correction is not easy. Errors in Chinese content are more hidden. Its unique language characteristics, such as the lack of clear word boundaries, highly dependent on context-dependent semantic understanding, and complex grammatical structure, bring additional challenges to the design and implementation of automatic correction systems. Generally speaking, the classification of errors can be summarized into eight main types: improper collocation, improper word order, redundant components, incomplete components, chaotic structure, illogical, unclear meaning, and inconsistent facts. Among them, errors inconsistent with facts are the most challenging. This error refers to the fact that in language expression, due to improper use of grammar, the meaning conveyed by the sentence deviates from the actual situation or logic. This type of error is usually caused by improper collocation of sentence components such as subject, predicate, and object, or incorrect use of tense, voice, and quantifiers. To achieve effective correction of these errors, the model not only needs to master grammatical rules, but also has rich external common sense knowledge. Error correction requires careful examination of the grammatical structure of the sentence to ensure the correct use of grammatical elements such as tense, voice, subject, predicate and object, and at the same time, judging whether the meaning expressed by the sentence is consistent with the facts based on the context.
[0004] Existing text error correction technologies have begun to explore the use of fact-verification datasets for remote supervised learning. By masking certain tokens in the statement and training the model to restore the original statement, more training data can be obtained. Although this method has promoted the development of forward error correction technology to a certain extent, there are still two problems. On the one hand, the model may over-modify the text during the correction process, resulting in the loss of the original intent, that is, there is semantic drift; on the other hand, there is a lack of sufficient forward error correction annotation data, and the constraints of fact verification cannot be fully utilized to guide the correction process, that is, there is insufficient fact verification supervision; due to semantic drift and insufficient fact verification supervision, the accuracy and reliability of text error correction are low; Summary of the invention
[0005] In order to solve the problem that the above-mentioned prior art has semantic drift and insufficient fact-checking supervision, resulting in low accuracy and reliability of text correction, the present invention proposes a text correction method based on knowledge enhancement, which effectively avoids semantic drift and insufficient fact-checking supervision in the text correction process, and improves the accuracy and reliability of text correction.
[0006] In order to achieve the above technical effects, the technical solution of the present invention is as follows:
[0007] A text error correction method based on knowledge enhancement comprises the following steps:
[0008] S1. Obtain an input text sentence, preprocess the input text sentence, and obtain the main information of the input text sentence;
[0009] S2. Based on the subject information and the input text sentence, generate a question set, and retrieve factual evidence related to the subject information to obtain an evidence chain;
[0010] S3. answer the question set based on the chain of evidence to obtain answers corresponding to the question set;
[0011] S4. Combining the answer with the question set to obtain a candidate modification;
[0012] S5. Performing a fidelity score on the candidate modifications, sorting the score results to obtain a score sorting result, and determining a final answer for correcting the input text sentence based on the score sorting result.
[0013] Preferably, the preprocessing of the input text sentence includes: identifying all the main information in the input text sentence that affects the meaning of the input text sentence, and expressing the identified main information as an index answer as follows:
[0014]
[0015] Among them, I x represents the main information set of the input text sentence χ, Represents the kth subject information in the subject information set.
[0016] Preferably, generating a question set based on the subject information and the input text sentence includes:
[0017] The input text sentence is used as the context and the subject information is used as the answer, and is input into the preset question generator G, and the calculation expression of the output question set is as follows:
[0018]
[0019] Among them, Q i represents the problem set, Represents the i-th subject information, i=1,2,3...,k.
[0020] Preferably, the factual evidence database is used to retrieve the factual evidence related to the subject information, and the evidence chain is obtained as follows:
[0021] E={E1,E2,...,E K}
[0022] Among them, E represents the set of evidence chains, K Indicates the chain of evidence corresponding to each subject information.
[0023] Preferably, answering the question set based on the chain of evidence to obtain answers corresponding to the question set includes:
[0024] Answer the question set Q using the set of evidence chains E as the context of the question set i , and the set of evidence chains E and the set of questions Q i The input is serially connected to the preset question-answering model, and the question set Q is output. i The corresponding answer The calculation expression is as follows:
[0025]
[0026] Among them, F(.) represents the preset question-answering model.
[0027] Preferably, the step of converting the answer into a declarative statement by combining the answer with the question set and taking the declarative statement as a candidate for modification comprises:
[0028] The answer With the problem set Q i As a combined input of the preset question-answer-to-declarative sentence model, the calculation expression for outputting the declarative sentence using the question-answer-to-declarative sentence model is as follows:
[0029]
[0030] Among them, C i represents the declarative sentence as a candidate for modification, and M(.) represents the question-answer-to-declarative sentence model.
[0031] Preferably, the calculation expression for scoring the fidelity of the candidate modification is as follows:
[0032] v(C i )=ROUGE-1(C i,χ)+DocNLI(C i ,ε)
[0033] Among them, v(C i ) represents the scoring result, ROUGE-1(.) represents the first comprehensive index scoring function, DocNLI(.) represents the second comprehensive index scoring function, and ε represents the answer context.
[0034] Preferably, the scoring results are sorted using a scoring function to obtain a scoring sorting result, and the candidate modification corresponding to the scoring result with the highest score in the scoring sorting result is used as the final answer.
[0035] Preferably, the calculation expression of the final answer is as follows:
[0036]
[0037] Among them, Y represents the final answer, Indicates that V(C i ) obtains the scoring function of the variable corresponding to the maximum value.
[0038] The present invention also proposes a text error correction system based on knowledge enhancement, comprising:
[0039] The main body extraction module is used to pre-process the input text sentence to obtain the main body information of the input text sentence;
[0040] A question generation module, used to generate a question set according to the subject information and the input text sentence;
[0041] An evidence retrieval module is used to retrieve factual evidence related to the subject information and obtain an evidence chain;
[0042] A question-answering module, used to answer the question set according to the chain of evidence and obtain answers corresponding to the question set;
[0043] A question-answer-to-statement module, used to convert the answer and the question set into a declarative statement, and use the declarative statement as a candidate for modification;
[0044] The scoring and sorting module is used to score the candidate modifications for fidelity, sort the scoring results, obtain the scoring and sorting results, and determine the final answer for error correction of the input text sentence based on the scoring and sorting results.
[0045] Compared with the prior art, the technical solution of the present invention has the following beneficial effects:
[0046] The present invention proposes a text error correction method based on knowledge enhancement. By simulating the process of human error correction, the factual error correction task is firstly decomposed into subtasks, including subject information extraction, question generation, evidence retrieval, question answering, question-answer combination conversion to statement and scoring sorting, so as to avoid over-correction and solve the problem of semantic drift; then, by extracting the subject information of the input text sentence, generating questions, and retrieving factual evidence related to the subject information, obtaining the evidence chain, answering the question set according to the evidence, and obtaining the answers corresponding to the question set, by asking questions, finding answers in the evidence, and evaluating the credibility of each correction according to the consistency with the evidence, the insufficient supervision of fact verification is effectively avoided; then, the answer to the answer is combined with the question set to convert it into a candidate modification of the declarative sentence, and finally the final answer for input text sentence error correction is determined by scoring sorting, which can not only effectively identify and correct the erroneous information in the text, but also ensure that the corrected information is consistent with the credible knowledge source, thereby improving the accuracy and reliability of text error correction. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 A flowchart of a text error correction method based on knowledge enhancement proposed in an embodiment of the present invention is shown;
[0048] Figure 2 A diagram showing a text correction framework based on factual evidence proposed in an embodiment of the present invention;
[0049] Figure 3 A block diagram of a text error correction system based on knowledge enhancement proposed in an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0050] The accompanying drawings are only used for illustrative purposes and are not to be construed as limiting the present invention;
[0051] It is understandable to those skilled in the art that some well-known contents may be omitted in the drawings;
[0052] In order to facilitate understanding of this embodiment, first, the prior art information of this embodiment is introduced as follows:
[0053] With the development of deep learning and large model technology, the academic research in the field of common sense error correction has gradually shifted from traditional rule-based proofreading methods to more intelligent syntactic analysis and knowledge-driven models, especially Transformer-based pre-trained language models. Mainstream research methods have evolved roughly in the two directions of syntactic analysis and knowledge graphs, and in recent years, hybrid methods that combine the two have also emerged.
[0054] FEC of syntactic analysis enhances the model's understanding of text semantics and syntactic relations by parsing sentence structures (such as dependency and component analysis). Research under this method mainly relies on incorporating syntactic information into pre-trained language models to improve their ability to understand complex sentences and semantic relations. Typical research includes the Syntax-BERT model, which embeds the syntactic tree structure into the BERT model to enhance syntactic information, thereby significantly improving the ability to understand complex syntactic structures. In addition, Dep-SAWR improves the model's ability to identify semantic errors through dependency parsing, further proving the effectiveness of syntactic structure information in complex text error detection.
[0055] The FEC of the knowledge graph helps the model make more accurate common sense judgments by providing structured background knowledge support. Especially in text error correction in specific fields, the knowledge graph can effectively supplement the model with real-world context and domain knowledge. In this direction, the COMET model uses knowledge graphs to generate common sense knowledge, combines external graphs with the Transformer model, and thus gives the model rich contextual knowledge, significantly improving the performance of common sense reasoning. K-BERT embeds the knowledge graph into the BERT model to enhance the model's background knowledge, thereby more accurately identifying and correcting errors in complex texts.
[0056] In recent years, the combination of syntactic analysis and knowledge graphs has brought new development directions to common sense error correction. By combining syntactic information and knowledge graphs, the model shows higher robustness in semantic understanding and common sense judgment. The development of this hybrid method demonstrates the academic community's efforts to continuously improve the field of common sense error correction.
[0057] In the field of invention, the mainstream technologies for text common sense error correction can be roughly divided into two technical routes: syntactic analysis and knowledge graphs and knowledge databases. Since syntactic analysis has a good effect on the semantic understanding and analysis capabilities of the stand-in model, many inventions have proposed different text common sense error correction solutions based on syntactic analysis.
[0058] Hu Dingxin et al. proposed a method for enhancing the factuality of automatic summarization based on syntactic structure deletion. The method constructs a syntactic dependency tree through syntactic dependency analysis, then traverses the syntactic dependency tree and tries to prune it to generate a candidate set. Finally, multiple fact evaluation index models are used to evaluate the candidate set, and the best error correction result is output according to the evaluation result. Different from the above method of first using syntactic analysis to prune and generate new sentences and then using the model to evaluate, Jiang Shengyi et al. proposed to first use a pre-trained model to encode the target sentence to obtain its original semantic features, and then use syntactic dependency analysis to generate a dependency syntactic tree and its distance matrix. After the dependency syntactic information is processed by the attention mechanism, it is combined with the original semantic features to form a new semantic feature. Finally, the feature is input into the classifier to output the probability distribution of the predicted label. Although syntactic analysis provides strong technical support in semantic error correction, it still has limitations in the understanding of specific semantics. Therefore, knowledge graph technology has gradually become another effective way to supplement syntactic analysis. Li Yulin et al. proposed a semantic error judgment method based on dynamic associative knowledge network. The dynamic associative knowledge network simulates the associative memory function of the brain by establishing knowledge associative relationships and setting the associative strength of knowledge associative relationships by imitating the strength of the human brain's associations with different knowledge. This method extracts noun terms and their related relationship pairs in the text and retrieves matching associative relationships in the dynamic associative knowledge network. The associative coupling degree of the terms is obtained by calculating the associative strength, and finally the classification model is used to judge the consistency of the terms in the context. Similarly, Lu Jiang et al. proposed to extract the first entity, the second entity and their related words in the text, and determine the entity to be corrected and the entity after correction by combining the preset knowledge graph. Then, the corrected text data is generated based on these entities to achieve text correction. Different from this, Huang Dengrong et al. proposed to first segment and vectorize the input text, use the knowledge base to retrieve relevant factual text, and then extract and combine entities to construct prompts and judge entity relationships to form triples, and then construct multi-tuples and generate question sets, and finally locate the wrong entities and sentences, call the large language model for correction, and display the real information to the user.
[0059] To overcome this challenge, existing text error correction technologies have begun to explore the use of fact-verification datasets for remote supervised learning. By masking certain tokens in the statement and training the model to restore the original statement, more training data can be obtained. Although this method has promoted the development of forward error correction technology to a certain extent, there are still two problems. On the one hand, the model may over-modify the text during the correction process, resulting in the loss of the original intent, that is, there is semantic drift; on the other hand, there is a lack of sufficient forward error correction annotation data, and the constraints of fact verification cannot be fully utilized to guide the correction process, that is, there is insufficient fact verification supervision; due to semantic drift and insufficient fact verification supervision, the accuracy and reliability of text error correction are low;
[0060] In order to solve these problems, the present invention designs a new framework that combines fact verification and iterative text editing, that is, proposes a text correction method based on knowledge enhancement.
[0061] The technical solution of the present invention is further described below in conjunction with the accompanying drawings and embodiments.
[0062] Example 1
[0063] like Figure 1 and Figure 2 As shown, this embodiment proposes a text error correction method based on knowledge enhancement, which provides a novel text fact error correction framework. The framework adopts a zero-sample learning method. The execution process of the framework starts with extracting key subject information from the input text sentence using dependency syntactic analysis technology and using it as a potential declarative answer. Subsequently, for each identified subject information, the framework generates a series of questions. These questions are then used to retrieve relevant factual evidence from authoritative knowledge bases such as Baidu Encyclopedia and Wikipedia. On this basis, the framework uses a preset question-answering model to answer each question with the retrieved information as the context. Each set of questions and their corresponding answers are then converted into a declarative sentence form to form a series of candidate correction schemes. Finally, these candidate correction schemes are evaluated and ranked through a comprehensive scoring mechanism to determine the final answer for input text sentence correction. The innovation of this framework lies in its iterative correction strategy and in-depth use of authoritative information, aiming to improve the accuracy and reliability of the correction process. More specifically, the method includes the following steps:
[0064] S1. Obtain an input text sentence, preprocess the input text sentence, and obtain the main information of the input text sentence;
[0065] In S1, the primary goal of the subject extraction of the input text sentence is to identify the subject information with substantive meaning in the sentence, such as subject, predicate, object, etc. Since factual errors usually exist in these subject information, these subject information will become the focus of query in the question generation step. The extraction results of the sentence subject information will determine the progress of subsequent steps, and these extraction results are irreversible. In order to maximize the recall rate of the model, the Spacy tool is used to extract all noun blocks and named entities, and the LTP tool language cloud is used to extract nouns, verbs, adjectives, adverbs, noun phrases, verb phrases, etc. Therefore, the input text sentence is preprocessed, including: identifying all the subject information in the input text sentence that affects the expression meaning of the input text sentence, and representing the identified subject information as an index answer as:
[0066]
[0067] Among them, I χ represents the main information set of the input text sentence χ, represents the kth subject information in the subject information set; for example Figure 2 The main information of the input text sentence in is "Guangzhou", "China", and "Capital".
[0068] S2. Based on the subject information and the input text sentence, generate a question set, and retrieve factual evidence related to the subject information to obtain an evidence chain;
[0069] In S2, after obtaining the subject information, the accuracy of the subject information is actively questioned, which requires the generation of relevant questions in preparation for finding relevant answers in the evidence chain later. In this step, a question generator G is designed, whose function is to generate corresponding questions based on the input sentence as the context and the subject information unit as the answer. More specifically,
[0070] The step of generating a question set based on the subject information and the input text sentence comprises:
[0071] The input text sentence is used as the context and the subject information is used as the answer, and is input into the preset question generator G, and the calculation expression of the output question set is as follows:
[0072]
[0073] Among them, Q i represents the problem set, Represents the i-th subject information, i=1,2,3...,k.
[0074] In this process, MixQG is used as the question generator G of this method; MixQG is a neural network-based question generator that uses a sequence-to-sequence (seq2seq) architecture. It can analyze the input text, extract key information, generate diverse questions, and generate appropriate question types based on the context. In order to ensure that the generated questions can cover the extracted factual errors and a wide diversity of candidate objects, MixQG is trained on 9 question-answer datasets with different answer types, including Boolean, multiple choice, extractive, and abstract answers. For example, in Figure 2 In the example, three questions will be generated for the proposed subject information "Guangzhou, China, capital", namely: "Where is the capital of China?", "What is Guangzhou in China?".
[0075] Once the subject information and related questions of the statement are obtained, the next task is to find relevant factual evidence for each subject to form a relevant chain of evidence. Since the selection of the chain of evidence has an important impact on the modification effect of the final model, it is necessary to ensure that the selected chain of evidence is objective, accurate and authoritative. To this end, authoritative encyclopedia materials such as Wikipedia and Baidu Encyclopedia are selected as relevant factual evidence databases. Using the factual evidence database, the factual evidence related to the subject information is retrieved, and the chain of evidence is obtained as follows:
[0076] E={E1,E2,...,E K}
[0077] Among them, E represents the set of evidence chains, K Indicates the chain of evidence corresponding to each subject information.
[0078] S3. answer the question set based on the chain of evidence to obtain answers corresponding to the question set;
[0079] In the answer-finding step S3, the goal is to identify the given evidence E that is relevant to each question Q i The corresponding correct information unit is used as the answer In order to achieve this goal, in this step, the question set is answered based on the evidence chain to obtain the answers corresponding to the question set, including:
[0080] Answer the question set Q using the set of evidence chains E as the context of the question set i , and the set of evidence chains E and the set of questions Q i The input is serially connected to the preset question-answering model, and the question set Q is output. i The corresponding answer The calculation expression is as follows:
[0081]
[0082] Among them, F(.) represents the preset question-answering model. Here, UnifiedQA-v2 is used as the question-answering model. UnifiedQA-v2 is an abstract question-answering model based on T5. It adopts a sequence-to-sequence (seq2seq) learning method, which can process input text and generate corresponding output. At the same time, it is easy to integrate with existing systems to provide a natural question-answering experience. Among them, T5 is a neural network framework that has been trained on 13 QA datasets and can handle various types of questions. For example: for the questions generated by unit 2, "Where is the capital of China?", "Guangzhou is the capital of what?", "Guangzhou is what in China?", the answers "Beijing City", "Capital of Guangdong Province", and "Prefecture-level cities under the jurisdiction of Guangdong Province" can be found in the evidence chain respectively.
[0083] S4. Combining the answer with the question set to convert it into a declarative statement, and using the declarative statement as a candidate for modification;
[0084] In S4, after obtaining the question and the corresponding answer, they are combined together and converted into a declarative sentence as a candidate revision. Previous studies have mainly focused on the extraction of answer types when question-answer pairs are converted into declarative sentences. In order to adapt to different types of questions and answers, this embodiment trains a sequence-to-sequence question-answer-to-declarative sentence model, which generates declarative sentences based on question-answer pairs of three given data sets. Among them, the QA2D data set is used to extract answer types, the BoolQ data set is used to process Boolean answers, and the SciTail data set covers questions and answers in the field of science. The question-answer-to-declarative sentence model is a T5 model fine-tuned based on these three data sets, denoted by M. Therefore, the combination of the answer and the question set is converted into a declarative sentence, and the declarative sentence is used as a candidate revision, including:
[0085] The answer With the problem set Q i As a combined input of the preset question-answer-to-declarative sentence model, the calculation expression for outputting the declarative sentence using the question-answer-to-declarative sentence model is as follows:
[0086]
[0087] Among them, C i represents the declarative sentence as a candidate modification, and M(.) represents the question-answer-to-declarative sentence model. For example, after the question generated in this step and the retrieved answer are combined and transformed, the candidate modifications can be obtained respectively: 1. "Beijing is the capital of China", 2. "Guangzhou is the capital of Guangdong Province", 3. "Guangzhou is a prefecture-level city under the jurisdiction of Guangdong Province, China".
[0088] S5. Performing a fidelity score on the candidate modifications, sorting the score results to obtain a score sorting result, and determining a final answer for correcting the input text sentence based on the score sorting result.
[0089] In S5, in order to determine the final answer, this step adopts a method based on fidelity scoring. By using the entailment score to evaluate the consistency between each candidate modification and the chain of evidence, the RoBERTa-large model trained on the DocNLI dataset is used to calculate the entailment relationship between documents and sentences. DocNLI is a large-scale document-level natural language inference (NLI) dataset that contains premises and assumptions of various types and length ranges, which helps to improve the performance of the model in document-level reasoning problems such as QA, summarization, and fact checking. The RoBERTa model is an improved version of BERT. By increasing the model size, using a larger batch size and more training data, removing the next sentence prediction (NSP) task in training, introducing dynamic masking and improving text encoding, the pre-training performance is improved. RoBERTa-large is a version of RoBERTa with more parameters and higher model capacity, and has powerful language understanding capabilities. In addition, in order to ensure the consistency between the revised results and the original statements, the Rouge-1 score is also included as a reference for scoring. The Rouge-1 score is generally used to measure the similarity between the automatically generated text and the reference text, so as to evaluate the quality of the generated results. It mainly focuses on word overlap. It calculates the recall rate (the ratio of the number of matching words to the total number of words in the reference text), the precision rate (the ratio of the number of matching words to the total number of words in the generated text) and the F1 score (the harmonic mean of the precision and the recall rate).
[0090] The fidelity score combines the Rouge-1 score with the DocNLI score to ensure the accuracy of the correction and the coherence of the text. More specifically, the calculation expression for the fidelity score of the candidate modification is as follows:
[0091] V(C i )=ROUGE-1(C i ,χ)+DocNLI(C i ,ε)
[0092] Among them, V(C i ) represents the scoring result, ROUGE-1(.) represents the first comprehensive index scoring function, DocNLI(.) represents the second comprehensive index scoring function, and ε represents the answer context.
[0093] The scoring results are sorted using a scoring function to obtain a scoring sorting result, and the candidate modification corresponding to the scoring result with the highest score in the scoring sorting result is used as the final answer.
[0094] The calculation expression of the final answer is as follows:
[0095]
[0096] Among them, Y represents the final answer, Indicates that V(C i ) obtains the scoring function of the variable corresponding to the maximum value.
[0097] In this embodiment, by simulating the process of human error correction, the factual error correction task is first decomposed into subtasks, including subject information extraction, question generation, evidence retrieval, question answering, question-answer combination conversion to statement and scoring sorting, so as to avoid over-correction and solve the problem of semantic drift; then, by extracting the subject information of the input text sentence, generating questions, and retrieving factual evidence related to the subject information, obtaining the chain of evidence, answering the question set based on the evidence, and obtaining the answers corresponding to the question set, by asking questions, looking for answers in the evidence, and evaluating the credibility of each correction based on the consistency with the evidence, the factual verification supervision is effectively avoided. The answer to the answer is then combined with the question set to convert it into a candidate modification of the declarative sentence, and finally the final answer for input text sentence correction is determined by scoring sorting, which can not only effectively identify and correct the erroneous information in the text, but also ensure that the corrected information is consistent with the trusted knowledge source, thereby improving the accuracy and reliability of text correction.
[0098] It should be noted that this embodiment proposes a text common sense error correction framework based on facts, which aims to avoid semantic drift and insufficient fact-checking supervision in the text error correction process, improve the accuracy and reliability of text error correction, and facilitate solving the problem of text fact errors that are widely present in the current social media and network environment. By imitating the process of human correction of factual errors, the text error correction method based on knowledge enhancement proposed in this embodiment decomposes the fact error correction task into five subtasks: subject extraction, question generation, evidence retrieval, question answering, and scoring sorting. This framework can not only effectively identify and correct erroneous information in the text, but also ensure that the corrected information is consistent with the trusted knowledge source, thereby improving the authenticity and reliability of the correction results. After experimental verification, this method provides a novel and effective method for automatic text fact error correction. Not only does it perform well in experiments, but also due to its iterative correction strategy and deep use of authoritative materials, the framework has high interpretability and application potential. Future work can explore the extension of this framework to a wider range of application scenarios, such as fact checking of social media posts and news articles, and inconsistency identification in multimedia tasks.
[0099] It is also necessary to state in particular that the advantages of the text error correction method based on knowledge enhancement proposed in this embodiment are:
[0100] (1) A method for updating a dynamic knowledge base is proposed. The traditional grammatical error correction model is limited by the static knowledge base and cannot reflect the latest knowledge status in a timely manner. In particular, its correction effect is limited when facing factual errors or common sense errors that change over time. The model proposed in this embodiment relies on a dynamically updateable knowledge base to effectively deal with such errors.
[0101] (2) A method with low sample dependence is proposed. The scarcity of training samples of factual errors is one of the challenges of existing research. The text correction method based on knowledge enhancement proposed in this embodiment decomposes the factual correction task into multiple mature subtasks in natural language processing and utilizes pre-trained models in these fields to achieve high performance in the factual correction task even if the samples are scarce.
[0102] (3) The proposed method can avoid the problem of semantic drift. During the grammatical error correction process, the model may over-modify the text, resulting in the phenomenon of "semantic drift". This framework adopts an iterative editing strategy, refines the error correction process to the tag and entity level, and combines the constraints of fact verification to provide precise control and guidance for each edit. This method allows the factual error correction system to gradually correct errors within the framework of fact verification, effectively avoiding the phenomenon of semantic drift.
[0103] Example 2
[0104] This embodiment further experimentally verifies a text error correction method based on knowledge enhancement proposed in the above embodiment. In order to comprehensively evaluate the proposed text error correction framework based on factual evidence, experiments were conducted on two widely recognized fact-checking datasets: FEVER and SCI-FACT. Both datasets are derived from well-known fact-checking projects and contain statements written by humans that are supported or refuted by evidence. They are ideal choices for evaluating the performance of fact error correction models.
[0105] As a comparative method, MASKCORRECT from the field of fake news identification is adopted, which consists of a masker and a sequence-to-sequence (Seq2Seq) corrector. The masker identifies and masks units that may contain false information by learning a fact verifier or explanation model, while the Seq2Seq corrector learns how to fill these masked parts with factual information. For the zero-shot baseline, two post-processing editing frameworks are selected, which are trained to remove fictional content from summaries, namely REVISEREF and COMPEDIT. REVISEREF is trained on synthetic data, where fictional samples are created by entity exchange. COMPEDIT learns to correct factual errors through sentence compression, and the training data is generated by an independent perturbator inserting entities in faithful sentences.
[0106] Experimental results show that this method is significantly superior to traditional methods.
[0107] Example 3
[0108] See also Figure 3 , this embodiment proposes a text error correction system based on knowledge enhancement, including:
[0109] The main body extraction module is used to pre-process the input text sentence to obtain the main body information of the input text sentence;
[0110] A question generation module, used to generate a question set according to the subject information and the input text sentence;
[0111] An evidence retrieval module is used to retrieve factual evidence related to the subject information and obtain an evidence chain;
[0112] A question-answering module, used to answer the question set according to the chain of evidence and obtain answers corresponding to the question set;
[0113] A question-answer-to-statement module, used to convert the answer and the question set into a declarative statement, and use the declarative statement as a candidate for modification;
[0114] The scoring and sorting module is used to score the candidate modifications for fidelity, sort the scoring results, obtain the scoring and sorting results, and determine the final answer for error correction of the input text sentence based on the scoring and sorting results.
[0115] In this embodiment, by simulating the process of human error correction, the factual error correction task is first decomposed into subtasks, including subject information extraction, question generation, evidence retrieval, question answering, question-answer combination conversion to statement and scoring sorting, so as to avoid over-correction and solve the problem of semantic drift; then, by extracting the subject information of the input text sentence, generating questions, and retrieving factual evidence related to the subject information, obtaining the chain of evidence, answering the question set based on the evidence, and obtaining the answers corresponding to the question set, by asking questions, looking for answers in the evidence, and evaluating the credibility of each correction based on the consistency with the evidence, the factual verification supervision is effectively avoided. The answer to the answer is then combined with the question set to convert it into a candidate modification of the declarative sentence, and finally the final answer for input text sentence correction is determined by scoring sorting, which can not only effectively identify and correct the erroneous information in the text, but also ensure that the corrected information is consistent with the trusted knowledge source, thereby improving the accuracy and reliability of text correction.
[0116] Obviously, the above embodiments of the present invention are only examples for clearly illustrating the present invention, and are not intended to limit the implementation methods of the present invention. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all implementation methods here. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the claims of the present invention.
Claims
1. A text error correction method based on knowledge enhancement, characterized in that: The following steps are involved: S1. Obtain an input text sentence, preprocess the input text sentence, and obtain the main information of the input text sentence; S2. Based on the subject information and the input text sentence, generate a question set, and retrieve factual evidence related to the subject information to obtain an evidence chain; S3. answer the question set based on the chain of evidence to obtain answers corresponding to the question set; S4. Combining the answer with the question set to convert it into a declarative statement, and using the declarative statement as a candidate for modification; S5. Performing a fidelity score on the candidate modifications, sorting the score results to obtain a score sorting result, and determining a final answer for correcting the input text sentence based on the score sorting result.
2. The text error correction method based on knowledge enhancement according to claim 1 is characterized in that: The preprocessing of the input text sentence includes: identifying all the subject information in the input text sentence that affects the meaning of the input text sentence, and expressing the identified subject information as an index answer as follows: Among them, I χ represents the main information set of the input text sentence χ, Represents the kth subject information in the subject information set.
3. The text error correction method based on knowledge enhancement according to claim 2 is characterized in that: The generating a question set based on the subject information and the input text sentence comprises: The input text sentence is used as the context and the subject information is used as the answer, and is input into the preset question generator G, and the calculation expression of the output question set is as follows: Among them, Q i represents the problem set, Represents the i-th subject information, i=1,2,3...,k.
4. The text error correction method based on knowledge enhancement according to claim 3 is characterized in that: Using the factual evidence database, we searched for factual evidence related to the subject information and obtained the following chain of evidence: E={E1,E2,...,E K } Among them, E represents the set of evidence chains, E K Indicates the chain of evidence corresponding to each subject information.
5. The text error correction method based on knowledge enhancement according to claim 4 is characterized in that: The step of answering the question set based on the chain of evidence to obtain answers corresponding to the question set includes: Answer the question set Q using the set of evidence chains E as the context of the question set i , and the set of evidence chains E and the set of questions Q i The input is serially connected to the preset question-answering model, and the question set Q is output. i The corresponding answer The calculation expression is as follows: Among them, F(.) represents the preset question-answering model.
6. The text error correction method based on knowledge enhancement according to claim 5 is characterized in that: The combining of the answer and the question set into a declarative statement, and taking the declarative statement as a candidate for modification, comprises: The answer With the problem set Q i As a combined input of the preset question-answer-to-declarative sentence model, the calculation expression for outputting the declarative sentence using the question-answer-to-declarative sentence model is as follows: Among them, C i represents the declarative sentence as a candidate for modification, and M(.) represents the question-answer-to-declarative sentence model.
7. The text error correction method based on knowledge enhancement according to claim 6 is characterized in that: The calculation expression for scoring the fidelity of the candidate modification is as follows: in, represents the scoring result, ROUGE-1(.) represents the first comprehensive index scoring function, DocNLI(.) represents the second comprehensive index scoring function, and ε represents the answer context.
8. The text error correction method based on knowledge enhancement according to claim 7 is characterized in that: The scoring results are sorted using a scoring function to obtain a scoring sorting result, and the candidate modification corresponding to the scoring result with the highest score in the scoring sorting result is used as the final answer.
9. The text error correction method based on knowledge enhancement according to claim 8 is characterized in that: The calculation expression of the final answer is as follows: Among them, Y represents the final answer, Indicates that Get the scoring function of the variable corresponding to the maximum value.
10. A text error correction system based on knowledge enhancement, characterized in that: include: The main body extraction module is used to pre-process the input text sentence to obtain the main body information of the input text sentence; A question generation module, used to generate a question set according to the subject information and the input text sentence; An evidence retrieval module is used to retrieve factual evidence related to the subject information and obtain an evidence chain; A question-answering module, used to answer the question set according to the chain of evidence and obtain answers corresponding to the question set; A question-answer-to-statement module, used to convert the answer and the question set into a declarative statement, and use the declarative statement as a candidate for modification; The scoring and sorting module is used to score the candidate modifications for fidelity, sort the scoring results, obtain the scoring and sorting results, and determine the final answer for error correction of the input text sentence based on the scoring and sorting results.
Citation Information
Patent Citations
Text error correction method and device, equipment and medium
CN112380840A
Text error-correcting method, apparatus, electronic device and readable storage medium
US20220198137A1