A knowledge-enhanced text correction method
By using a knowledge-enhanced approach to simulate the human error correction process and decompose the error correction task into multiple sub-tasks, the problems of semantic drift and insufficient fact-checking supervision in existing technologies are solved, thereby improving the accuracy and reliability of text error correction.
Patent Information
- Application Number
- CN202411646853.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-18
- Publication Date
- 2026-01-02
- Estimated Expiration
- 2044-11-18
AI Technical Summary
Existing text correction technologies suffer from semantic drift and insufficient fact-checking supervision, resulting in low accuracy and reliability of error correction.
By employing a knowledge-enhanced approach, through subject information extraction, question generation, evidence retrieval, question answering, question-answer combination and statement conversion, and scoring and ranking, the human error correction process is simulated to avoid overcorrection and ensure that the corrected information is consistent with the credible knowledge source.
It improves the accuracy and reliability of text correction, effectively identifies and corrects errors in text, and ensures that the corrected information is consistent with credible knowledge sources, avoiding semantic drift and insufficient fact-checking supervision.
Smart Images

Figure CN119670732B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of natural language processing, and particularly relates to a text correction method based on knowledge enhancement. BACKGROUND
[0002] With the evolution of society and the innovation of technology, the dramatic changes in human lifestyle have a profound impact on the use of language and characters; in the digital age, the explosive growth of text creation activities has brought about a series of new problems and challenges, especially the errors in the text, such as grammatical errors, which not only threaten the readability and professionalism of the text, but also hinder the accurate understanding of the text information by the readers.
[0003] With the continuous development of natural language processing technology, automatic text correction technology has emerged, which aims to use computer aided systems to improve the quality of the text, 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, and the errors in Chinese content are more hidden, and its unique language characteristics, such as lack of clear word boundaries, high dependence on contextual 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 sequence, redundant components, incomplete components, structural confusion, illogicality, unclear meaning, and inconsistency with facts. Among them, the error of inconsistency with facts is the most challenging, which refers to the deviation of the meaning conveyed by the sentence from the true situation or logic due to improper use of grammar in language expression. This type of error is usually caused by improper collocation of sentence components such as subject, predicate, and object, or incorrect use of time, aspect, quantity, etc. To effectively correct these errors, the model not only needs to master the grammatical rules, but also needs to have rich external common sense knowledge. Correction requires careful examination of the grammatical structure of the sentence to ensure the correct use of time, aspect, subject-predicate-object, and other grammatical elements, and to judge whether the meaning expressed by the sentence is consistent with the facts in combination with the context.
[0004] Existing text correction technology begins to explore the use of fact verification datasets for remote supervision learning, by shielding certain tokens in the statement and training the model to restore the original statement, to obtain more training data, although this method has promoted the development of forward correction technology to some extent, but there are still two problems, on the one hand, the model may modify the text excessively in the correction process, resulting in the loss of the original intention, i.e. semantic drift; on the other hand, there is a lack of sufficient forward correction annotation data, which cannot fully utilize the constraints of fact checking to guide the correction process, i.e. insufficient fact checking supervision; due to semantic drift and insufficient fact checking supervision, the accuracy and reliability of text correction are low; SUMMARY
[0005] To solve the problem of semantic drift and insufficient fact checking supervision in the prior art, resulting in low accuracy and reliability of text correction, the application provides 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] To achieve the above technical effects, the technical scheme of the application is as follows:
[0007] A text correction method based on knowledge enhancement, comprising the following steps:
[0008] S1. Obtain an input text sentence, preprocess the input text sentence to obtain the main information of the input text sentence;
[0009] S2. Based on the main information and the input text sentence, generate a question set, and retrieve fact evidence related to the main information to obtain an evidence chain;
[0010] S3. Based on the evidence chain, answer the question set to obtain the answer corresponding to the question set;
[0011] S4. Combine the answer and the question set to obtain a candidate modification;
[0012] S5. Score the fidelity of the candidate modification, sort the scoring results to obtain a scoring and sorting result, and determine the final answer for correcting the input text sentence based on the scoring and sorting result.
[0013] Preferably, the preprocessing of the input text sentence comprises: identifying all main information in the input text sentence that affects the expression meaning of the input text sentence, and representing the identified main information as an index answer:
[0014]
[0015] wherein I x represents the main information set of the input text sentence χ, represents the kth main information in the main information set.
[0016] Preferably, the generation of the question set based on the main information and the input text sentence comprises:
[0017] The input text sentence is input as the context and the main information is input as the answer into a pre-set question generator G, and the calculation expression of the question set is as follows:
[0018]
[0019] wherein Q i represents a question set, represents the i-th subject information, i = 1, 2, 3,..., k.
[0020] Preferably, a fact evidence database is utilized to retrieve fact evidence related to the subject information, and the evidence chain is obtained as follows:
[0021] E = {E1, E2,..., Ek} K}
[0022] wherein E represents a set of evidence chains, K represents an evidence chain corresponding to each subject information.
[0023] Preferably, the question set is answered based on the evidence chain, and an answer corresponding to the question set is obtained, including:
[0024] the set of evidence chains E is taken as a context of the question set Q i , and the set of evidence chains E and the question set Q i are input in series to a preset question and answer model, and an answer corresponding to the question set Q i is output. The calculation expression of the answer corresponding to the question set Q i is as follows:
[0025]
[0026] wherein F(.) represents the preset question and answer model.
[0027] Preferably, the answer and the question set are combined to convert into a declarative sentence, and the declarative sentence is taken as a candidate modification, including:
[0028] the answer and the question set Q i are input in combination to a preset question and answer to declarative sentence model, and the calculation expression of the declarative sentence output by the question and answer to declarative sentence model is as follows:
[0029]
[0030] wherein C i represents the declarative sentence as a candidate modification, and M(.) represents the question and answer to declarative sentence model.
[0031] Preferably, the calculation expression of the fidelity score of the candidate modification is as follows:
[0032] v(C i ) = ROUGE-1(C i, χ) + DocNLI (C i , ε)
[0033] wherein v(C i ) represents a scoring result, ROUGE-1(.) represents a first comprehensive index scoring function, DocNLI(.) represents a second comprehensive index scoring function, and ε represents a context of an answer.
[0034] Preferably, the scoring result is sorted by using a scoring function to obtain a scoring sorting result, and a candidate modification corresponding to a scoring result with the highest score in the scoring sorting result is taken as the final answer.
[0035] Preferably, the final answer is calculated according to the following expression:
[0036]
[0037] wherein Y represents a final answer, and wherein f represents a scoring function of a variable corresponding to a maximum value of v(C i ).
[0038] The application further provides a text correction system based on knowledge enhancement, comprising:
[0039] a subject extraction module, configured to pre-process an input text sentence to obtain subject information of the input text sentence;
[0040] a question generation module, configured to generate a question set according to the subject information and the input text sentence;
[0041] an evidence retrieval module, configured to retrieve factual evidence related to the subject information to obtain an evidence chain;
[0042] an answer module, configured to answer the question set according to the evidence chain to obtain answers corresponding to the question set;
[0043] a question-answer statement conversion module, configured to combine and convert the answers and the question set into a declarative sentence, and take the declarative sentence as a candidate modification;
[0044] a scoring and sorting module, configured to score the candidate modification in terms of fidelity, sort scoring results to obtain a scoring sorting result, and determine a final answer for text correction of the input text sentence based on the scoring sorting result.
[0045] Compared with the prior art, the technical scheme of the application has the following beneficial effects:
[0046] The application provides a knowledge-enhanced text correction method, which simulates the process of human error correction, first decomposes the factual error correction task into subtasks, including subject information extraction, question generation, evidence retrieval, question answering, question and answer combination into statements, and scoring and sorting, to avoid over-correction and solve the problem of semantic drift; then the subject information of the input text sentence is extracted, the question is generated, and the factual evidence related to the subject information is retrieved to obtain the evidence chain, the question set is answered according to the evidence, the answer corresponding to the question set is obtained, the credibility of each correction is evaluated according to the consistency with the evidence, and the problem of insufficient factual verification supervision is effectively avoided; the answered answer and the question set are combined into a candidate modification of a statement sentence, and finally the final answer for correcting the input text sentence is determined through scoring and sorting, which not only can effectively identify and correct the error information in the text, but also can ensure that the corrected information is consistent with the reliable knowledge source, thereby improving the accuracy and reliability of text correction. BRIEF DESCRIPTION OF DRAWINGS
[0047] Figure 1 A flow chart of a knowledge-enhanced text correction method is shown in the embodiment of the application.
[0048] Figure 2 A text correction framework based on factual basis is shown in the embodiment of the application.
[0049] Figure 3 A knowledge-enhanced text correction system is shown in the embodiment of the application. DETAILED DESCRIPTION
[0050] The drawings are only used for illustrative description and cannot be understood as a limitation on the application;
[0051] It is understandable for those skilled in the art that some known content in the drawings can be omitted;
[0052] In order to facilitate the understanding of the embodiment, first, the prior art information of the embodiment is introduced as follows:
[0053] With the development of deep learning and large model technology, the research on common sense error correction in the academic field gradually shifts from traditional rule-based proofreading methods to more intelligent syntactic analysis and knowledge-driven models, especially pre-trained language models based on Transformer. The mainstream research methods roughly evolve along two directions of syntactic analysis and knowledge graph, and in recent years, hybrid methods combining the two have also appeared.
[0054] FEC based on syntax analysis enhances the model's understanding of text semantics and syntactic relationships by parsing sentence structures such as dependency relationships and constituent analysis. Research in this approach mainly relies on integrating syntactic information into pre-trained language models to improve their ability to understand complex sentence structures and semantic relationships. Typical research includes the Syntax-BERT model, which embeds syntactic tree structures into the BERT model to enhance syntactic information and significantly improve the understanding of complex syntactic structures. In addition, Dep-SAWR improves the model's ability to identify semantic errors through dependency parsing, further demonstrating the effectiveness of syntactic structure information in complex text error detection.
[0055] FEC based on knowledge graph enhances the model's ability to make more accurate common sense judgments by providing structured background knowledge. Especially in the correction of text in specific fields, knowledge graphs can provide effective supplements of real-world context and domain knowledge for the model. In this direction, the COMET model uses knowledge graphs to generate common sense knowledge, combining external graphs with Transformer models to give the model rich contextual knowledge, significantly improving the performance of common sense reasoning. K-BERT enhances the model's background knowledge by embedding knowledge graphs into the BERT model, allowing it to more accurately identify and correct errors in complex text.
[0056] In recent years, the combination of syntax analysis and knowledge graphs has brought new directions to the correction of common sense errors. By integrating syntactic information and knowledge graphs, models have shown higher robustness in semantic understanding and common sense judgment. The development of this hybrid method demonstrates the academic community's continuous efforts to improve in the field of common sense error correction.
[0057] In the field of invention, the mainstream technology of text common sense error correction can also be roughly divided into two technical routes: syntax analysis and knowledge graph, knowledge database. Since syntax analysis has good effects on the semantic understanding and analysis ability of the surrogate model, multiple inventions have proposed different text common sense error correction schemes based on syntax analysis.
[0058] Hu Dingxin et al. proposed an automatic summarization fact enhancement method based on syntax structure pruning, which constructs a syntax dependency tree through syntax dependency analysis, then traverses the syntax dependency tree and tries to prune to generate a candidate set, finally uses multiple fact evaluation index models to evaluate the candidate set, and outputs the best correction result according to the evaluation result. Unlike the above method, which first uses syntax analysis to crop and generate new sentences, and then uses model evaluation, Jiang Shengyi et al. proposed a method that first encodes the target sentence using a pre-trained model to obtain its original semantic features, and then generates a dependency syntax tree and its distance matrix using syntax dependency analysis. After the dependency syntax information is processed through the attention mechanism, it is combined with the original semantic features to form new semantic features. Finally, the feature is input into the classifier to output the probability distribution of the predicted label. Although syntax analysis provides strong technical support for semantic correction, it still has limitations in understanding specific semantics. Therefore, knowledge graph technology has gradually become another effective way to supplement syntax analysis. Li Yulin et al. proposed a semantic error judgment method based on dynamic associative knowledge network. The dynamic associative knowledge network simulates the brain's associative memory function by establishing knowledge association relationships and setting the strength of the knowledge association relationship according to the strength of the brain's association of different knowledge. This method extracts the noun terms and their related relationship pairs in the text and retrieves matching association relationships in the dynamic associative knowledge network. The association coupling degree of the terms is obtained by calculating the association strength, and finally a classification model is used to judge the consistency of the terms in the context. Similarly, Lu Jiang et al. proposed a method that extracts the first entity, second entity, and their relationship words from the text, and determines the error-corrected entity and its corrected entity based on the pre-set knowledge graph. Then, the corrected text data is generated based on these entities, thereby realizing text correction. Unlike this, Huang Dengrong et al. proposed a method that first splits and vectorizes the input text, retrieves related factual texts using a knowledge base, extracts and combines entities, constructs prompts and judges entity relationships to form triples, constructs multiple groups and generates a question set, and finally locates the error entity and sentence, calls a large language model for correction, and displays the true information to the user.
[0059] To overcome this challenge, existing text correction technology has begun to explore the use of fact verification datasets for remote supervision learning, by masking certain tokens in the statement and training the model to restore the original statement, thereby obtaining more training data. Although this method has promoted the development of forward correction technology to some extent, it still has two problems, one is that the model may modify the text excessively during the correction process, leading to the loss of the original intent, i.e. semantic drift; the other is the lack of sufficient forward correction annotation data, which cannot fully utilize the constraints of fact verification to guide the correction process, i.e. insufficient fact verification supervision. Due to semantic drift and insufficient fact verification supervision, the accuracy and reliability of text correction are low;
[0060] To solve these problems, the present application designs a new framework combining factual verification and iterative text editing, that is, a text correction method based on knowledge enhancement is proposed.
[0061] The technical solutions of the present application will be further described below in combination with the drawings and examples.
[0062] Example 1
[0063] As shown in Figure 1 and Figure 2 , the present embodiment proposes a text correction method based on knowledge enhancement, which provides a novel framework for correcting factual errors in text. The framework uses a zero-shot learning method. The execution process of the framework starts with extracting key subject information from the input text sentence using dependency syntax analysis technology, and taking it as the potential statement answer. Then, 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 Baike and Wikipedia. On this basis, the framework uses a pre-set question and answer model to answer each question in the context of the retrieved information. Each set of questions and their corresponding answers is then converted into a statement form to form a series of candidate correction schemes. Finally, through a comprehensive scoring mechanism, these candidate correction schemes are evaluated and ranked to determine the final answer for input text sentence correction. The innovation of this framework lies in its iterative correction strategy and deep utilization 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 to obtain subject information of the input text sentence;
[0065] In S1, the primary goal of subject extraction of the input text sentence is to identify the subject information in the sentence that has substantive meaning, such as the subject, predicate, object, etc. Since factual errors usually exist in these subject information, these subject information will become the focus of the query in the question generation step. The extraction results of the sentence subject information will determine the subsequent steps, and these extraction results have the characteristics of irreversibility. In order to maximize the recall rate of the model, all noun chunks and named entities are extracted using the Spacy tool, and nouns, verbs, adjectives, adverbs, noun phrases, verb phrases, etc. are extracted using the LTP tool language cloud. Therefore, the preprocessing of the input text sentence includes: identifying all 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:
[0066]
[0067] wherein I χ represents a set of subject information of an input text sentence χ, represents the kth subject information in the set of subject information; for example Figure 2 The subject information of the input text sentence in the example is “Guangzhou”, “China”, and “capital”.
[0068] S2. Generating a set of questions based on the subject information and the input text sentence, and retrieving fact evidence related to the subject information to obtain an evidence chain;
[0069] In S2, after obtaining the subject information, the accuracy of these subject information is actively questioned, which requires generating relevant questions for later use in finding relevant answers in the evidence chain. This step designs a question generator G, which functions to generate corresponding questions based on the input sentence as the context and the subject information unit as the answer. More specifically,
[0070] The generating of the set of questions based on the subject information and the input text sentence comprises:
[0071] The input text sentence is input as the context and the subject information as the answer into a pre-set question generator G, and the calculation expression of the output set of questions is as follows:
[0072]
[0073] wherein Q i represents a set of questions, represents the ith subject information, i = 1, 2, 3,..., k.
[0074] In this process, MixQG is used as the question generator G of the method; MixQG is a neural network-based question generator that adopts a sequence-to-sequence (seq2seq) architecture. It can extract key information by analyzing the input text and generate diverse questions, and also generate appropriate question types according to the context. In order to ensure that the generated questions can cover the extracted fact errors and the extensive diversity of candidate objects, MixQG is trained on 9 question-answer datasets with different answer types, including Boolean, multiple-choice, extraction, and abstract answers. For example, in Figure 2 , three questions will be generated for the proposed subject information “Guangzhou”, “China”, and “capital”, which are “Where is the capital of China?”, “What is the capital of Guangzhou?”, and “What is Guangzhou in China?”.
[0075] Once the main information and related issues of the statements are obtained, the next task is to find relevant factual evidence for each subject to form a chain of evidence. Since the selection of the chain of evidence has a significant impact on the final modification effect of the model, it is essential to ensure that the selected chain of evidence is objective, accurate, and authoritative. Therefore, authoritative encyclopedias such as Wikipedia and Baidu Encyclopedia are used as relevant factual evidence databases. Using these databases, factual evidence related to the stated subject information is retrieved, resulting in the following chain of evidence:
[0076] E = {E1, E2, ..., E} K}
[0077] Where E represents the set of evidence chains, K This represents the chain of evidence corresponding to each entity's information.
[0078] S3. Based on the chain of evidence, answer the set of questions to obtain the answers corresponding to the set of questions;
[0079] In the S3 answer-finding step, the goal is to identify the relevant evidence in the given evidence E for each question Q. i The corresponding correct information unit serves as the answer. To achieve this goal, this step involves answering the set of questions based on the chain of evidence to obtain the answers corresponding to the set of questions, including:
[0080] The set of evidence chains E is used as the context of the question set Q to answer the question set. i and the set of evidence E and the set of questions Q i The input is fed into a preset question-answering model, and the question set Q is output. i Corresponding answer The calculation expression is as follows:
[0081]
[0082] Here, F(.) represents the preset question-answering model. UnifiedQA-v2 is used as the question-answering model. UnifiedQA-v2 is an abstract question-answering model based on T5, employing a sequence-to-sequence (seq2seq) learning method. It can process input text and generate corresponding outputs, and it is easy to integrate with existing systems, providing a natural question-answering experience. T5 is a neural network framework that, after training on 13 QA datasets, can handle various types of questions. For example, for the questions generated in Unit 2, "Where is the capital of China?", "What is Guangzhou the capital of?", and "What is Guangzhou in China?", the evidence chain can find the answers "Beijing", "Capital of Guangdong Province", and "Prefecture-level city under the jurisdiction of Guangdong Province", respectively.
[0083] S4. converting the combination of the answer and the question set into a declarative sentence, taking the declarative sentence as a candidate 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 correction. Previous studies mainly focus on the extraction of answer types when converting question and answer pairs into declarative sentences. In order to adapt to different types of questions and answers, the embodiment trains a sequence-to-sequence question and answer to declarative sentence model that generates declarative sentences based on the given question and answer pairs of three data sets. Among them, the QA2D data set is used to extract the answer type, the BoolQ data set is used to process Boolean answers, and the SciTail data set covers the question and answer in the field of science. The question and answer to declarative sentence model is a T5 model fine-tuned based on the three data sets, denoted as M. Therefore, the conversion of the answer and the question set into a declarative sentence, taking the declarative sentence as a candidate modification, includes:
[0085] converting the answer and the question set Q i As a preset combination input of the question and answer to declarative sentence model, the calculation expression of outputting the declarative sentence by the question and answer to declarative sentence model is as follows:
[0086]
[0087] wherein C i represents a declarative sentence as a candidate modification, and M(.) represents a question and answer to declarative sentence model. For example, the combination of the question generated in this step and the retrieved answer after conversion can obtain the candidate modifications: 1. “Beijing is the capital of China”, 2. “Guangzhou is the capital of Guangdong Province”, 3. “Guangzhou is a prefecture-level city in Guangdong Province, China”.
[0088] S5. scoring the candidate modification for fidelity, sorting the scoring results to obtain a scoring and sorting result, and determining a final answer for correcting the input text sentence based on the scoring and sorting result.
[0089] In S5, in order to determine the final answer, a method based on fidelity score is adopted in this step, which evaluates the consistency between each candidate modification and the evidence chain by using entailment score, and a RoBERTa-large model trained on DocNLI dataset is used to calculate the entailment relationship between the document and the sentence. DocNLI is a large-scale document-level natural language inference (NLI) dataset, which contains various types and various length ranges of premises and hypotheses, and helps to improve the performance of models in document-level reasoning problems such as QA, summary, fact checking, etc. RoBERTa model is an improved version of BERT, which increases the model size, uses larger batch size, more training data, removes the next sentence prediction (NSP) task in training, introduces dynamic masking and improves text encoding, and improves the pre-training performance. RoBERTa-large is a version of RoBERTa with more parameters and higher model capacity, which has strong language understanding ability. In addition, in order to ensure the consistency of the modified result and the original statement, Rouge-1 score is also included as a reference for scoring. Rouge-1 score is generally used to measure the similarity between automatically generated text and reference text to evaluate the quality of generated results, mainly focusing on word overlap, which calculates recall (ratio of matching words to total words in reference text), precision (ratio of matching words to total words in generated text) and F1 score (harmonic mean of precision and recall).
[0090] Fidelity score combines Rouge-1 score and DocNLI score to ensure the accuracy of the modification and the coherence of the text. More specifically, the calculation expression of the fidelity score of the candidate modification is as follows:
[0091] V(C i )=ROUGE-1(C i ,χ)+DocNLI(C i ,ε)
[0092] Where 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 context of the answer .
[0093] The scoring function is used to sort the scoring results to obtain a scoring sorted result, and the candidate modification corresponding to the highest scoring result in the scoring sorted result is taken as the final answer.
[0094] The calculation expression of the final answer is as follows:
[0095]
[0096] wherein Y represents the final answer, represents the score function of the variable corresponding to the maximum value of V(C i ).
[0097] In this embodiment, by simulating the process of human correcting errors, the fact error correction task is first decomposed into subtasks, including subject information extraction, question generation, evidence retrieval, question answering, question and answer combination into statement, and scoring and sorting, to avoid over-correction and solve the problem of semantic drift; then by extracting the subject information of the input text sentence, generating a question, and retrieving the fact evidence related to the subject information, an evidence chain is obtained, the question set is answered according to the evidence, and the answer corresponding to the question set is obtained, the credibility of each correction is evaluated according to the consistency with the evidence, and the problem of insufficient fact checking supervision is effectively avoided; then the answered answer and the question set are combined into a candidate modification of a statement sentence, and finally the final answer for correcting the input text sentence is determined through scoring and sorting, which not only can effectively identify and correct the error information in the text, but also can ensure that the corrected information is consistent with the reliable knowledge source, thereby improving the accuracy and reliability of text correction.
[0098] It should be particularly pointed out that the embodiment proposes a text common sense error correction framework based on fact basis, which aims to avoid semantic drift and insufficient fact checking supervision in the text correction process, improve the accuracy and reliability of text correction, and facilitate the solution to the widespread text fact error problem in the current social media and network environment. By simulating the process of human correcting fact errors, the knowledge-enhanced text correction method proposed in this embodiment decomposes the fact error correction task into five subtasks: subject extraction, question generation, evidence retrieval, question answering, and scoring and sorting. This framework not only can effectively identify and correct error information in the text, but also can ensure that the corrected information is consistent with the reliable knowledge source, thereby improving the authenticity and reliability of the correction result. Through experimental verification, this method provides a novel and effective method for automatic text fact error correction. It not only performs well in experiments, but also has high interpretability and application potential due to its iterative correction strategy and deep use of authoritative materials. Future work can explore the extension of this framework to more extensive application scenarios, such as fact checking of social media posts and news articles, and inconsistency identification in multimedia tasks.
[0099] It should be particularly pointed out that the embodiment proposes a knowledge-enhanced text correction method, which has the following advantages:
[0100] (1) A dynamic knowledge base updating method is proposed. Traditional grammar correction models are limited by static knowledge bases and cannot reflect the latest knowledge state in a timely manner, especially when facing time-varying factual errors or common sense errors, their correction effect is limited. The model proposed in this embodiment relies on a dynamically updated knowledge base, effectively dealing with such errors.
[0101] (2) A low sample dependent method is proposed. The scarcity of factual error training samples is one of the challenges of existing research. The text correction method based on knowledge enhancement proposed in this embodiment divides the factual correction task into multiple mature subtasks in natural language processing, and uses pre-trained models in these fields to achieve high performance even with few samples in the factual correction task.
[0102] (3) The proposed method can avoid semantic drift. In the process of grammar correction, the model may over-modify the text, leading to the "semantic drift" phenomenon. This framework uses an iterative editing strategy to refine the correction process to the token and entity level, and combines factual verification constraints to provide precise control and guidance for each edit. This method allows the factual error correction system to gradually correct errors under the framework of factual verification, effectively avoiding the semantic drift phenomenon.
[0103] Embodiment 2
[0104] This embodiment further experimentally verifies the text correction method based on knowledge enhancement proposed in the above embodiment. In order to comprehensively evaluate the text factual error correction framework based on facts proposed, experiments were conducted on two widely recognized fact-checking datasets: FEVER and SCI-FACT. Both of these datasets are derived from well-known fact-checking projects and contain statements written by humans that are supported or refuted by evidence, making them ideal choices for evaluating the performance of factual error correction models.
[0105] As a comparative method, MASKCORRECT in the fake news recognition field was used, 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 an explanation model, while the Seq2Seq corrector learns how to fill these masked parts with factual information. For the zero-sample baseline, two post-processing editing frameworks were 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 swapping. COMPEDIT learns to correct factual errors through sentence compression, and the training data is generated by an independent perturber inserting entities in faithful sentences.
[0106] The experimental results show that the method is obviously superior to the traditional method.
[0107] Embodiment 3
[0108] Referring to Figure 3 The embodiment provides a text correction system based on knowledge enhancement, which comprises:
[0109] a subject extraction module configured to pre-process an input text sentence to obtain subject information of the input text sentence;
[0110] a question generation module configured to generate a question set according to the subject information and the input text sentence;
[0111] an evidence retrieval module configured to retrieve factual evidence related to the subject information to obtain an evidence chain;
[0112] a question and answer module configured to answer the question set according to the evidence chain to obtain answers corresponding to the question set;
[0113] a question and answer to statement module configured to combine and convert the answers and the question set into a statement sentence as a candidate modification;
[0114] a scoring and sorting module configured to score the candidate modification in terms of fidelity, sort the scoring result to obtain a scoring and sorting result, and determine a final answer for correcting the input text sentence based on the scoring and sorting result.
[0115] In the 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 and answer combination to statement and scoring and sorting, to avoid over-correction and solve the problem of semantic drift; then the subject information of the input text sentence is extracted, questions are generated, factual evidence related to the subject information is retrieved to obtain an evidence chain, the questions are answered according to the evidence to obtain answers corresponding to the questions, the credibility of each correction is evaluated according to the consistency with the evidence, and the problem of insufficient factual verification supervision is effectively avoided; the answers and the question set are combined and converted into a statement sentence as a candidate modification, and finally the final answer for correcting the input text sentence is determined through scoring and sorting, which not only effectively identifies and corrects the error information in the text, but also ensures that the corrected information is consistent with the reliable knowledge source, thereby improving the accuracy and reliability of text correction.
[0116] Obviously, the above embodiments of the present application are only examples for clearly explaining the present application, and are not intended to limit the embodiments of the present application. Based on the above description, other different forms of changes or variations can be made by those skilled in the art. Here, it is not necessary and also impossible to exhaust all the embodiments. Any modification, equivalent replacement and improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the claims of the present application.
Claims
1. A knowledge-enhanced based text correction method, characterized in that, The method comprises the following steps: S1. obtaining an input text sentence, preprocessing the input text sentence to obtain subject information of the input text sentence; S2. generating a question set based on the subject information and the input text sentence, and retrieving factual evidence related to the subject information to obtain an evidence chain; The generating of the question set based on the subject information and the input text sentence comprises: inputting the input text sentence as context and the main information as answer into a preset question generator G , and outputting a calculation expression of the question set as follows: wherein, represents a problem set, represents a first i subject information, ; using the fact evidence database, searching for fact evidence related to the subject information, obtaining the evidence chain as follows: wherein, represents a set of evidence chains, represents an evidence chain corresponding to each subject information; S3. answering the question set based on the evidence chain to obtain answers corresponding to the question set, comprising: The set of the evidence chain Answer the question set as context for the question set. and the set of the chain of evidence and the set of problems The inputs are fed into a preset question-answering model, and the question set is output. Corresponding answer The calculation expression is as follows: wherein, represents a preset question and answer model; S4. combining the answers and the question set to convert into a declarative sentence, and taking the declarative sentence as a candidate modification; S5. performing fidelity scoring on the candidate modification, sorting the scoring results to obtain a scoring sorting result, and determining a final answer for error correction of the input text sentence based on the scoring sorting result.
2. The knowledge enhancement based text correction method according to claim 1, wherein, The preprocessing of the input text sentence comprises identifying all subject information affecting the expression meaning of the input text sentence, and representing the identified subject information as an index answer as: in, Indicates input text statement The main information set, Represents the first in the main information set k Individual entity information. 3.The knowledge-enhanced text correction method based on knowledge augmentation according to claim 2, characterized in that, The combining of the answers and the question set to convert into a declarative sentence, and taking the declarative sentence as a candidate modification comprises: The answer With the question set As a combination input of the preset question-answer-to-statement model, a computational expression of the statement sentence output by the question-answer-to-statement model is as follows: wherein, represents a declarative sentence as a candidate modification, represents a question-to-declarative sentence model.
4. The knowledge augmentation based text correction method of claim 3, wherein, The calculation expression of the fidelity scoring on the candidate modification is as follows: wherein, represents a score result, represents a first composite indicator scoring function, represents a second composite indicator scoring function, represents an answer in the context of.
5. The knowledge augmentation based text correction method of claim 4, wherein, The scoring function is used to sort the scoring results to obtain a scoring sorting result, and the candidate modification corresponding to the highest scoring result in the scoring sorting result is taken as the final answer.
6. The knowledge enhancement based text correction method of claim 5, wherein, The calculation expression of the final answer is as follows: wherein, represents the final answer, represents such that the score function of the variable corresponding to the maximum.
7. A knowledge-enhanced based text correction system, the system is implemented based on the knowledge-enhanced based text correction method according to any one of claims 1-6, characterized in that, Comprise: A subject extraction module for preprocessing an input text sentence to obtain subject information of the input text sentence; A question generation module for generating a question set according to the subject information and the input text sentence; An evidence retrieval module for retrieving factual evidence related to the subject information to obtain an evidence chain; An answer module for answering the question set based on the evidence chain to obtain answers corresponding to the question set; An answer-to-statement module for combining the answers and the question set to convert into a declarative sentence, and taking the declarative sentence as a candidate modification; A scoring and sorting module for performing fidelity scoring on the candidate modification, sorting the scoring results to obtain a scoring sorting result, and determining a final answer for error correction of the input text sentence based on the scoring sorting result.
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