An integrated system and method for text error correction and interpretation in large language models

By combining a large language model with a rule base and statistical features to perform multi-dimensional error detection and knowledge consistency verification, this technology solves the problems of insufficient accuracy, lack of interpretability, and illusion in existing technologies. It achieves text error correction with high accuracy, interpretability, and global contextual understanding, and supports human-machine collaborative optimization.

CN122133661APending Publication Date: 2026-06-0210TH RES INST OF CETC
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
10TH RES INST OF CETC
Filing Date
2026-01-21
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

Existing text correction technologies are inadequate in terms of accuracy, interpretability, knowledge consistency verification, and contextual understanding. Furthermore, they lack human-computer collaborative optimization mechanisms, which can easily lead to illusions and poor interactive experiences.

Method used

It employs a large language model combined with a rule base and statistical features for multi-dimensional error detection. Through multi-granular semantic representation, triple verification of knowledge consistency, and an adaptive self-correction mechanism, it generates multiple candidate correction schemes, sorts and explains them, and supports user feedback and iterative optimization.

Benefits of technology

It significantly improves error correction accuracy, enhances interpretability, ensures knowledge consistency and factual accuracy, provides global contextual understanding, reduces costs, and supports human-machine collaborative optimization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122133661A_ABST
    Figure CN122133661A_ABST
Patent Text Reader

Abstract

This invention discloses an integrated system and method for text correction and interpretation using a large language model, relating to the field of natural language processing technology. Addressing the shortcomings of existing text correction technologies, such as insufficient accuracy, lack of knowledge consistency verification, and lack of interpretability, this method includes: receiving the text to be corrected and constructing a multi-granular semantic representation; performing multi-dimensional error detection using a large language model and generating multiple candidate correction schemes; employing a triple knowledge consistency verification mechanism, including internal consistency check, external knowledge verification, and cross-validation; performing multiple rounds of iterative optimization through an adaptive self-correcting feedback loop; and simultaneously generating a detailed explanation including error identification descriptions, correction reasons, and knowledge support. This invention effectively prevents the illusion problem of large language models, significantly improves the reliability and interpretability of text correction, and can be widely applied in scenarios such as intelligent writing assistants and enterprise document proofreading.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of natural language processing technology, specifically to an integrated system and method for text correction and interpretation of a large language model, which can be widely applied to scenarios such as intelligent writing assistants, enterprise document proofreading, educational assistance systems, multilingual translation proofreading, legal document proofreading, medical literature proofreading, news report proofreading, and technical document proofreading. Background Technology

[0002] The statements in this section are provided only as background information in connection with this disclosure and may not constitute prior art.

[0003] With the rapid development of information technology, the production and dissemination of text content have experienced explosive growth. Whether it's business documents, technical documents, news reports, legal documents, or medical records, increasingly higher demands are being placed on text quality. Text correction technology, as an important means of improving text quality, has always been a research hotspot in the field of natural language processing.

[0004] Traditional text correction techniques mainly include the following categories: The first category is rule-based error correction schemes, such as Microsoft Word and Grammarly Basics. These schemes detect and correct errors using predefined grammar rules, spelling dictionaries, and language patterns. Their advantages are clear rules and strong interpretability, but their disadvantages include limited rule coverage and difficulty in handling complex semantic errors, logical errors, and domain-specific errors. For example, for a sentence like "This method is 10 times more efficient than traditional methods," a rule-based scheme cannot determine whether the figure of "10 times" is accurate, nor can it identify any logical contradictions.

[0005] The second category is error correction schemes based on statistical machine learning, such as Conditional Random Fields (CRF), Bidirectional Long Short-Term Memory Network-Conditional Random Fields (BiLSTM-CRF), and Sequence-to-Sequence Models (Seq2Seq). These schemes train models on large-scale labeled data to learn error patterns and correction rules. Their advantage is the ability to handle certain semantic errors, but their disadvantages include heavy reliance on large-scale labeled data, high labeling costs, limited generalization ability, and weak ability to identify error types not present in the training data. Furthermore, these schemes lack interpretability, making it difficult for users to understand why a certain correction is necessary.

[0006] The third category is error correction schemes based on pre-trained language models, such as GECToR and BART for GEC. These schemes utilize the powerful language understanding capabilities of pre-trained language models for error detection and correction. Compared to statistical machine learning schemes, pre-trained models have better semantic understanding and generalization abilities. However, these schemes still suffer from the problem of over-correction, where correct content is mistakenly changed to incorrect content, and they lack knowledge verification mechanisms, failing to guarantee the factual accuracy of the correction results.

[0007] The fourth category is direct prompting schemes based on large language models, such as GPT-4 and Claude. In recent years, large language models have demonstrated remarkable capabilities in natural language processing tasks. Through carefully designed prompts, they can directly perform text correction tasks. The advantages of this type of scheme are its powerful language understanding and generation capabilities, capable of handling complex semantic errors, logical errors, and even a certain degree of domain knowledge errors. However, this type of scheme suffers from the following serious problems: First, the output is unstable; the same output may produce different results. Second, it is prone to "hallucination," generating seemingly reasonable but actually incorrect or false content, such as changing correct technical terms to incorrect expressions or introducing non-existent facts. Third, it lacks self-verification and correction mechanisms, making it impossible to determine whether the generated corrections are correct. Fourth, it is costly, requiring calls to the large language model API for each correction. Fifth, it lacks interpretability, only providing the correction result without offering the reasoning behind the correction.

[0008] Existing patent literature also reflects these problems. For example, Chinese patent CN113408274A discloses a text correction method based on deep learning, but this method mainly targets spelling and grammatical errors, with limited ability to handle semantic and factual errors. Chinese patent CN114611522A discloses a method for detecting and correcting Chinese grammatical errors based on a pre-trained model, but this method lacks a knowledge verification mechanism and is prone to over-correction. US patent US12008333B2 discloses a text generation method based on a large language model, but this method mainly focuses on text generation rather than error correction and does not involve illusion detection or self-correction mechanisms.

[0009] A comprehensive analysis of existing technologies reveals the following five core problems: First, the accuracy of error correction is insufficient. Traditional methods have limited ability to identify errors in deep semantic understanding and domain knowledge. For example, for a sentence like "According to Newton's third law, action is greater than reaction," although grammatically correct, it violates a fundamental principle of physics, and existing methods often fail to identify it.

[0010] Second, there is a lack of explainability. Existing error correction systems typically only provide the corrected result without offering the reasons or justification for the changes. Users struggle to understand why a particular correction was made, and are unable to learn from or improve upon it. This is especially pronounced in educational and professional writing settings, where users need to know the reasons for the errors and the correct way to write them, not just a corrected result.

[0011] Third, there is a lack of knowledge consistency verification. While large language models possess powerful linguistic capabilities, they are prone to generating illusions, producing seemingly reasonable but actually erroneous corrections. Existing solutions lack a systematic self-verification and correction mechanism, failing to guarantee the knowledge correctness and factual accuracy of the corrections. For example, a large language model might mistakenly change "penicillin is an antibiotic" to "penicillin is an antiviral drug," an error that could have serious consequences in medical document proofreading.

[0012] Fourth, weak contextual understanding. Existing methods lack sufficient global semantic understanding of long texts, easily leading to situations where local error correction is reasonable but disrupts the consistency of the entire text. For example, in an academic paper, the first paragraph uses the term "machine learning," while subsequent paragraphs use both "machine learning" and "ML." Existing methods might change "machine learning" to "deep learning" in one place, which, while reasonable in the local context, breaks the consistency of terminology usage throughout the text. Similarly, in a technical document, if the preceding text states "the system supports a maximum of 100 concurrent users," while the following text states "the system can support 1000 concurrent users," existing methods often fail to identify such logical contradictions across paragraphs.

[0013] Fifth, the user experience is poor. Existing error correction systems lack effective user feedback and human-computer collaboration mechanisms. Users cannot provide effective feedback on the error correction results, and the system cannot learn and optimize from user feedback. For uncertain corrections, the system cannot proactively seek user confirmation but directly provides the correction result, which is particularly unsuitable for text error correction in professional fields.

[0014] Therefore, there is an urgent need for a new text correction technology that can effectively solve the illusion problem, improve correction accuracy, enhance interpretability, provide global contextual understanding, and support human-computer collaborative optimization while maintaining the powerful language capabilities of large language models. Summary of the Invention

[0015] The purpose of this invention is to address the problems of insufficient error correction accuracy, lack of knowledge consistency verification, lack of interpretability, weak contextual understanding, and poor interactive experience in existing technologies, especially to effectively prevent the illusion problem of large language models. This invention provides an integrated system and method for text error correction and interpretation of large language models, thereby improving the accuracy and reliability of text error correction in professional fields.

[0016] The technical solution of the present invention is as follows: A method for integrating text error correction and interpretation in a large language model includes: Receive the text to be corrected and configuration parameters, and preprocess the text to be corrected, including sentence segmentation, paragraph segmentation and semantic unit recognition, and construct a multi-granularity semantic representation including sentence level, paragraph level and document level; The text to be corrected is subjected to multi-dimensional error detection using a large language model combined with a rule base and statistical features. Error types are identified and confidence levels are labeled. Specifically, spelling errors, grammatical errors, semantic errors, logical errors, and factual errors are identified and labeled with error types and confidence levels. Based on the detected errors, a large language model is invoked to generate multiple candidate correction schemes (e.g., 3 to 5 candidate correction schemes are generated), and preliminary ranking is performed based on the language model perplexity and fluency scores. Specifically, the preliminary ranking algorithm for candidate correction schemes includes: calculating the language model perplexity of each candidate scheme; evaluating the fluency score of the corrected text; calculating the edit distance between the corrected scheme and the original text; and performing a weighted ranking based on the above indicators. The candidate correction scheme is subjected to triple knowledge consistency verification, which includes internal consistency verification, external knowledge verification, and cross-verification. The internal consistency verification is used to verify the consistency between the corrected text and the context in terms of semantics, logic, style, and structure. The external knowledge verification is used to query the knowledge base or external knowledge sources to perform fact-checking, normative checks, and citation verification. The cross-verification is used to perform multiple independent verifications using different reasoning paths or prompting strategies. Adaptive self-correction is performed based on the verification results. When verification fails, a fallback mechanism is used to retain the original text and mark it as uncertain, or the generation strategy is adjusted based on the verification feedback to regenerate candidate correction schemes and perform iterative optimization. For example, adaptive self-correction is performed based on the verification results. When verification fails, a fallback mechanism is used to retain the original text and mark it as uncertain, or the generation strategy is adjusted based on the verification feedback to regenerate candidate schemes, or the confidence score of candidate schemes is dynamically adjusted, supporting 3 to 5 rounds of iterative optimization. Detailed explanations are generated for the error correction suggestions. These detailed explanations include at least an explanation of the error identification, the reason for the correction, and the supporting knowledge; the detailed explanations also include alternative suggestions and learning suggestions. The error correction results, detailed explanations, and confidence information are output in a structured format.

[0017] Furthermore, the construction of multi-granular semantic representations encompassing sentence-level, paragraph-level, and document-level representations specifically includes: For sentence-level semantic representation, a pre-trained language model is used to generate sentence vector representations to capture the semantic information of the sentence; For paragraph-level semantic representation, identify paragraph topics and semantic relationships between paragraphs; For document-level semantic representation, analyze the document's global structure and logical chain, and identify consistency in terminology usage and coherence of argumentation across paragraphs.

[0018] Furthermore, the error types identified by the multi-dimensional error detection include spelling errors, grammatical errors, semantic errors, logical errors, and factual errors; in: Spelling errors: Character-level error identification, including misspellings, extra words, and missing words; Grammatical errors: Syntactic structure analysis, including subject-verb disagreement, tense errors, and punctuation errors; Semantic errors: Semantic consistency checks, including inappropriate word collocation and semantic contradictions; Logical errors: Errors in logical verification, including incorrect causal relationships and insufficient argumentation; Factual errors: Knowledge base check, including factual statement errors, data errors, and citation errors; The spelling errors are detected using a character-level error recognition method; The grammatical errors are detected by a syntactic structure analysis method, which is used to identify subject-verb disagreement, tense errors, or punctuation errors. The semantic errors are detected by a semantic consistency check method, which is used to identify inappropriate word collocations or semantic contradictions. The logical errors are detected by the argument logic verification method, which is used to identify causal relationship errors or insufficient arguments. The factual errors are detected using a knowledge base comparison check method, which is used to identify factual statement errors, data errors, or citation errors.

[0019] Furthermore, the internal consistency check specifically includes: The semantic coherence between the corrected text and its context is verified by calculating the semantic similarity between the corrected text and its context. Through logical relationship analysis, the completeness and rationality of the revised text in terms of argumentation logic are verified; By comparing stylistic features, the consistency of the revised text with the original text in terms of writing style and language style is verified. Verify whether the corrected text maintains the integrity of the document structure.

[0020] Furthermore, the external knowledge verification specifically includes: The accuracy of factual statements in the candidate correction schemes is verified by querying domain knowledge bases, fact databases, or terminology databases. The candidate modification schemes are checked for language standardization and professional terminology by comparing them with language standardization databases or professional standards. The references in the candidate correction schemes are verified to confirm their accuracy and completeness; Access search engines or authoritative external websites as supplementary knowledge sources to verify information not covered in the local knowledge base.

[0021] Furthermore, the cross-validation specifically includes: For the same candidate correction scheme, design multiple different prompt word strategies for independent verification; The same candidate modification scheme is verified multiple times using different reasoning paths, including forward reasoning and backward reasoning. Compare the consistency of the results from multiple verifications; The overall confidence score of the candidate correction scheme is calculated based on the degree of consistency. The higher the degree of consistency, the higher the overall confidence score.

[0022] Furthermore, the generation strategy adjustment based on verification feedback includes: adjusting the temperature parameter or sampling parameter of the large language model to change the generation determinism according to the type of verification failure, or adding specific reasons for verification failure, improvement suggestions or additional contextual information to the prompt words; The termination conditions for the iterative optimization process include: the generated candidate correction scheme passes the triple verification of knowledge consistency and has a confidence level higher than a preset threshold, or the number of iterations reaches the preset maximum number of iteration rounds, or the difference between the candidate correction schemes generated in two consecutive iterations is less than a preset threshold; that is, the triggering conditions for the adaptive self-correction backoff mechanism include: Validation failed and the confidence level was below the preset threshold; Despite multiple regeneration attempts, the verification still failed. The revised proposal differs too much from the original text, and the verification results are uncertain.

[0023] Furthermore, the detailed explanation for generating the error correction suggestion specifically includes: Construct prompts that include thought chains, requiring the large language model to demonstrate the reasoning process of making incorrect judgments and generating corrective solutions; The generated detailed explanation includes: the specific location of the error in the text, the type and severity of the error, the linguistic rules or domain knowledge basis for correcting the error, the background knowledge or explanation of professional terms related to the error, alternative correction schemes besides the recommended correction scheme, and prevention or learning suggestions for the error; that is, the regenerated strategy adjustment method includes: Adjust the generation parameters of the large language model according to the type of reason for the verification failure; Optimize the prompt word template based on verification feedback; Add contextual information or domain knowledge hints; Adjust the number of candidate solutions generated.

[0024] Furthermore, it should be noted that the calculation method for the confidence score of dynamically adjusted candidate solutions includes: Taking into account error detection confidence, correction scheme quality score, knowledge verification results, and historical feedback data; Increase the confidence score of candidate solutions that pass triple validation; Lower the confidence score for candidate solutions that fail validation; The confidence weights are dynamically adjusted based on user feedback. It should be noted that the user feedback mechanism includes: An interactive interface for accepting or rejecting suggested corrections; Interface for collecting user feedback; Model optimization mechanism based on feedback data; The module for storing and analyzing feedback data.

[0025] Furthermore, the output of the error correction results, detailed explanations, and confidence information in a structured form specifically includes: Generate a difference file containing comparison data between the original text and the corrected text. The difference file supports highlighting the modified locations and different types of errors. Encapsulate error type icons, confidence scores, detailed explanation text, and alternative suggestion lists into a structured data format; The structured data format supports interactive display on the user interface, allowing users to view detailed explanations and accept or reject the proposed modifications. Structured output formats include: A comparison of the original and revised text; Modify the location label and highlighting; Labeling of error type and confidence level information; The detailed explanation is presented in bullet points; A list of alternative recommendations is provided.

[0026] Furthermore, it should be noted that the knowledge base includes: Domain knowledge bases are used to store professional knowledge and concepts for specific domains; A fact database is used to store verifiable factual information; A language specification library is used to store grammar rules, punctuation rules, and writing rules; A terminology database used to store standard terms and definitions for various fields.

[0027] Furthermore, it should be noted that the design of prompt words in the large language model includes: Task Description: Clearly state the goals and requirements of text correction; Contextual information: Provides contextual and background information about the text to be corrected; Domain knowledge: Provides relevant domain knowledge hints based on text type; Output format: Specifies the output format for candidate correction schemes and explanations; Thought chain guidance: The model is required to demonstrate the reasoning process and decision-making basis.

[0028] This invention also proposes an integrated system for text correction and interpretation of a large language model, comprising: The user interface module is used to receive the text to be corrected and configuration parameters. The text preprocessing module is used to preprocess the text to be corrected and construct a multi-granularity semantic representation that includes sentence level, paragraph level and document level; The error detection module is used to perform multi-dimensional error detection on the text to be corrected by using a large language model combined with a rule base and statistical features, identify error types and label confidence levels; The error correction generation module is used to generate multiple candidate correction schemes (e.g., 3 to 5) based on the detected errors by calling a large language model, and to perform preliminary sorting. The knowledge consistency verification module is used to perform triple knowledge consistency verification on the candidate correction scheme, which includes internal consistency check, external knowledge verification and cross-validation. The self-correction module is used to perform adaptive self-correction based on the verification results. When the verification fails, a fallback mechanism is used to retain the original text, or the generation strategy is adjusted based on the verification feedback to regenerate candidate correction schemes and perform iterative optimization (e.g., 3 to 5 rounds of iteration). The explanation generation module is used to generate detailed explanations for error correction suggestions. The detailed explanations include at least the error identification description, the reason for correction, the knowledge support, the alternative suggestions, and the learning suggestions. The results output module is used to output the error correction results, detailed explanations, and confidence information in a structured form, and supports user feedback.

[0029] Compared with existing technologies, the advantages of this invention are: 1. Significantly improves error correction accuracy, increasing it by 10-20% compared to traditional large language model direct error correction solutions, and reducing knowledge error rate by 60-80%, with particularly significant effects in professional domain texts.

[0030] 2. Significantly enhances explainability. The integrated explanation generation mechanism ensures that every correction has a clear reason and basis, reducing the user's understanding cost and improving the learning effect.

[0031] 3. To ensure the consistency of knowledge and the accuracy of facts, the triple verification mechanism effectively prevents the illusion problem of large language models and avoids mistakenly changing correct content to incorrect content or introducing false information.

[0032] 4. Provides global contextual understanding and multi-granular semantic representation, enabling the system to identify global issues across paragraphs and chapters, such as inconsistent terminology, contradictory arguments, and erroneous citations.

[0033] 5. Supports human-machine collaborative optimization. The confidence perception mechanism and user feedback mechanism enable the system to work collaboratively with users, actively seek confirmation for uncertain corrections, and continuously learn from feedback.

[0034] 6. Reduce error correction costs, saving more than 80% of manpower costs compared to manual proofreading, and reducing the number of API calls by 30-50% compared to trial and error methods that call large language models multiple times.

[0035] 7. Wide applicability to various scenarios: It does not rely on labeled data in specific fields. It can be quickly adapted to different fields through flexible configuration of the knowledge base, such as academic writing, business documents, technical documents, medical records, etc.

[0036] 8. Supports multilingual extensions. The core technology framework is language-independent, and multilingual text correction can be supported simply by changing the underlying large language model and knowledge base. Attached Figure Description

[0037] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments recorded in the embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings.

[0038] Figure 1 This is a schematic diagram of a large language model integrated text correction and interpretation system. Figure 2 This is a flowchart of an integrated method for text correction and interpretation in a large language model. Detailed Implementation

[0039] It should be noted that relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0040] The features and performance of the present invention will be further described in detail below with reference to embodiments.

[0041] Example 1 Please see Figure 1 and Figure 2 This invention proposes an integrated method for text correction and interpretation using a large language model. Through the collaborative work of nine core modules, it achieves high accuracy and high interpretability in text correction. In practical application, it includes the following steps: Step S101: Receive the text to be corrected and the configuration parameters.

[0042] User interface module 201 receives the text to be corrected and configuration parameters input by the user. The text to be corrected can be of any length, ranging from a single sentence to a complete document. Configuration parameters include: (1) Error correction levels: There are three levels: basic error correction, deep error correction and professional error correction. Basic error correction mainly targets spelling and grammar errors; deep error correction adds the detection of semantic and logical errors on the basis of basic error correction; professional error correction adds the detection of factual errors and domain knowledge errors on the basis of deep error correction.

[0043] (2) Domain Types: These include multiple domains such as general, academic, business, technology, medical, and legal. Different domains use different knowledge bases and verification rules. For example, the academic domain requires verification of the accuracy of citation formats and academic terminology; the medical domain requires verification of the accuracy of medical terminology and drug names; and the legal domain requires verification of the accuracy of legal citations.

[0044] (3) Output format: Supports multiple formats such as plain text, structured JSON, and visual HTML. Plain text format is suitable for simple text replacement scenarios; structured JSON format is suitable for programmatic processing and system integration; visual HTML format is suitable for user review and interactive correction.

[0045] (4) Confidence threshold: Used to control the output of correction suggestions. Only correction suggestions with a confidence level higher than this threshold will be output. The default threshold is 0.7, which can be adjusted by the user as needed. A higher threshold (e.g., 0.9) will reduce the number of correction suggestions but improve accuracy; a lower threshold (e.g., 0.5) will increase the number of correction suggestions but may include some uncertain corrections.

[0046] (5) Number of iterations: Sets the maximum number of self-correction iterations, which is 5 by default. Users can adjust this parameter according to the complexity of the text and time requirements.

[0047] In this embodiment, it is assumed that the text input by the user to be corrected is an abstract of an academic paper: "This study proposes a new machine learning algorithm, the time complexity of which is..." Compared to traditional algorithms, this algorithm is 10 times more efficient. Experimental results show that the algorithm achieves excellent performance on multiple datasets. Furthermore, the algorithm has good interpretability, helping researchers understand the model's decision-making process. Configuration parameters are set as follows: error correction level is professional, domain type is academic, output format is HTML visualization, confidence threshold is 0.7, and number of iterations is 5.

[0048] Step S102: Text preprocessing.

[0049] The text preprocessing module 202 performs sentence segmentation, paragraph segmentation, and semantic unit recognition on the text to be corrected, and establishes multi-granular semantic representation.

[0050] (1) Sentence segmentation: A hybrid strategy based on punctuation and semantic boundaries is adopted. First, initial sentence segmentation is performed based on sentence-ending punctuation marks such as periods, question marks, and exclamation marks. Then, a pre-trained language model is used to determine whether the sentence segmentation is reasonable. For example, for "The time complexity of this algorithm is..." "Compared to traditional algorithms, the efficiency is improved by 10 times." This sentence, although containing a comma, is a complete sentence and should not be split at the comma. The sentence segmentation result is: Sentence 1: "This study proposes a new machine learning algorithm, whose time complexity is..." "Compared to traditional algorithms, this is 10 times more efficient."; Sentence 2: "Experimental results show that this algorithm achieves excellent performance on multiple datasets."; Sentence 3: "Furthermore, this algorithm has good interpretability, helping researchers understand the model's decision-making process." (2) Segmentation: Identifying paragraph boundaries and paragraph structure. In this embodiment, the input text is a single paragraph, so the segmentation result is 1 paragraph. For multi-paragraph text, the system will identify the semantic relationships between paragraphs, such as parallel relationships, progressive relationships, and contrast relationships.

[0051] (3)Semantic unit recognition: Identify semantic units such as named entities, technical terms, and references. In this embodiment, the identified semantic units include: technical terms "machine learning algorithm", "time complexity", " ", "data set", "interpretability", "decision-making process"; numerical value "10 times"; key verbs "propose", "improve", "obtain", "understand", etc.

[0052] (4)Construction of multi-granularity semantic representations: Construct semantic representations at the sentence level, paragraph level, and document level. The sentence-level semantic representation uses a pre-trained language model (such as BERT, RoBERTa) to generate vector representations for each sentence, with a dimension of 768, capturing the semantic information of the sentence. The paragraph-level semantic representation identifies the paragraph theme as "Performance and interpretability of machine learning algorithms", and the relationship between sentences within the paragraph is a progressive relationship (first introduce the algorithm performance, then introduce the experimental results, and finally introduce the interpretability). The document-level semantic representation analyzes the global structure and identifies that this is an abstract of an academic paper, which should follow academic writing norms and the use of terms should be consistent.

[0053] Step S103: Multi-dimensional error detection.

[0054] The error detection module 203 uses a large language model combined with a rule base and statistical features for multi-dimensional error detection. This module detects five types of errors: (1)Spelling error detection: Adopt a character-level error recognition method. In this embodiment, it is detected that "取的" should be "取得", which is a typical spelling error ("的" is miswritten as "得"). Error location: Sentence 2, characters 15-16; Error type: Spelling error; Confidence: 0.95.

[0055] (2)Grammar error detection: Adopt a syntactic structure analysis method. In this embodiment, no obvious grammar errors are detected, and the subject-predicate-object structure of all sentences is complete and the tenses are consistent.

[0056] (3)Semantic error detection: Adopt a semantic consistency check method. In this embodiment, no obvious semantic errors are detected, the word collocations are reasonable, and the semantics are coherent.

[0057] (4)Logical error detection: Adopt a discourse logic verification method. In this embodiment, a potential logical problem is detected: "The time complexity of this algorithm is , and the efficiency is 10 times higher than that of traditional algorithms". Generally, an algorithm with a time complexity of has low efficiency and is unlikely to be 10 times more efficient than traditional algorithms. This may be a logical contradiction or an incorrect time complexity annotation. Error location: Sentence 1; Error type: Logical error; Confidence: 0.75.

[0058] (5)Factual error detection: The knowledge base comparison and checking method is adopted. The system queries the algorithm complexity database in the knowledge base 208 and finds that the time complexity of common machine learning algorithms is usually , or , The algorithm is relatively rare and inefficient. This further supports the judgment of logical errors.

[0059] Summary of error detection results: 2 errors are detected. Error 1 is a spelling error, "取的" should be "取得" (confidence 0.95); Error 2 is a logical error, the time complexity is contradictory to the 10-fold increase in efficiency (confidence 0.75).

[0060] Step S104: Error correction generation.

[0061] The error correction generation module 204 calls the large language model to generate candidate correction solutions based on the detected errors.

[0062] For Error 1 (spelling error), 3 candidate correction solutions are generated: Candidate solution 1: "The experimental results show that the algorithm has achieved excellent performance on multiple datasets." (Change "取的" to "取得") Candidate solution 2: "The experimental results show that the algorithm has obtained excellent performance on multiple datasets." (Change "取的了" to "获得了") Candidate solution 3: "The experimental results show that the algorithm has reached excellent performance on multiple datasets." (Change "取的了" to "达到了") Initial ranking: According to the language model perplexity, fluency score, and edit distance, candidate solution 1 ranks first (lowest perplexity, shortest edit distance), candidate solution 2 ranks second, and candidate solution 3 ranks third.

[0063] For Error 2 (logical error), 4 candidate correction solutions are generated: Candidate solution 1: "This study proposes a new machine learning algorithm, and the time complexity of this algorithm is , and the efficiency is 10 times higher than that of traditional algorithms." (Change to ) Candidate solution 2: "This study proposes a new machine learning algorithm, and the time complexity of this algorithm is , and the efficiency is 10 times higher than that of traditional algorithms." (Change to ) Candidate Solution 3: "This study proposes a new machine learning algorithm with a time complexity of , which, through optimization, achieves a 10-fold increase in efficiency compared to traditional algorithms." (Add context to explain why the algorithm is more efficient) Candidate Solution 4: "This study proposes a new machine learning algorithm whose running time in practical applications is reduced by 90% compared to traditional algorithms." (Delete the time complexity description and change it to the actual running time description) Preliminary ranking: Candidate Solution 1 ranks first (minimal modification, reasonable logic), Candidate Solution 3 ranks second (preserve the original meaning, add explanation), Candidate Solution 2 ranks third, and Candidate Solution 4 ranks fourth (major modification).

[0064] Step S105: Triple verification of knowledge consistency.

[0065] The knowledge consistency verification module 205 performs triple verification on the candidate correction solutions. The triple verification includes internal consistency check, external knowledge verification, and cross-verification.

[0066] For Candidate Solution 1 "obtained" for Error 1: (1) Internal consistency check: Calculate the semantic similarity between the corrected sentence and the context. Using the cosine similarity method of sentence vectors, the similarity is 0.92, indicating good semantic coherence. Analyze the logical relationship, "obtained excellent performance" is a reasonable expression and conforms to academic writing norms. Check the style consistency, "obtained" is a commonly used verb in academic papers and is consistent with the full text style. Verification result: Passed, confidence level 0.95.

[0067] (2) External knowledge verification: Query the semantic specification library to confirm that "obtained" is the correct verb usage and "qu de" is incorrect. Query the academic writing specification library to confirm that "obtained excellent performance" is a standard academic expression. Verification result: Passed, confidence level 0.98.

[0068] (3) Cross-verification: Use different prompting strategies for verification. Prompt 1: "Which is the correct usage, 'qu de' or 'obtained'?" Model answer: "The correct usage is 'obtained'." Prompt 2: "Is there an error in the sentence 'The algorithm has qu de excellent performance on multiple datasets'?" Model answer: "There is an error, 'qu de' should be changed to 'obtained'." The two verification results are consistent. Verification result: Passed, confidence level 0.96.

[0069] Comprehensive confidence level: (0.95 + 0.98 + 0.96) / 3 = 0.96, which is higher than the threshold of 0.7, and the verification passes.

[0070] For candidate solution 1 of error 2 ": (1) Internal consistency test: The semantic similarity between the corrected sentence and its context is calculated to be 0.88, indicating good semantic coherence. Analyzing the logical relationships, the time complexity is... The statement "efficiency increased tenfold" is logically more reasonable. Algorithm comparison Algorithms with higher complexity may indeed offer significant efficiency improvements. Validation result: Pass, confidence level 0.85.

[0071] (2) External knowledge verification: Query the algorithm complexity knowledge base to confirm. This refers to the complexity of common machine learning algorithms, such as certain matrix operation algorithms. A search of academic paper databases revealed that multiple papers mention this. Algorithm comparison The algorithm shows a significant performance improvement. However, the system cannot confirm the true complexity of the specific algorithm because the original paper did not provide detailed information about the algorithm. Validation result: Partially passed, confidence level 0.70 (uncertainty exists).

[0072] (3) Cross-validation: Validation is performed using different inference paths. Inference path 1: "If the time complexity of an algorithm is O(n), then the time complexity of the algorithm is O(n). ,compared to "How much efficiency improvement does the algorithm offer?" The model answers: "When..." When it is large, compared to Efficiency improvement is approximately Times. If Then it increases by 10 times. Reasoning path 2: "A time complexity of..." The machine learning algorithm described above is 10 times more efficient than traditional algorithms. What would the complexity of the traditional algorithm be? The model answers: "The complexity of the traditional algorithm would be..." Or higher. The two validation results are basically consistent, but both include the assumptions. Validation result: Partially passed, confidence level 0.72.

[0073] Overall confidence level: (0.85+0.70+0.72) / 3=0.76, which is higher than the threshold of 0.7, but the confidence level is not very high and there is uncertainty.

[0074] Step S106: Adaptive self-calibration.

[0075] The self-calibration module 206 performs adaptive self-calibration based on the verification results. Self-calibration includes a rollback mechanism, regeneration, and confidence adjustment.

[0076] Candidate solution 1 for Error 1: Verification passed with a very high confidence level (0.96). No self-correction is required, and the correction suggestion is directly outputted.

[0077] Candidate solution 1 for Error 2: Verification passed, but the confidence level is not very high (0.76), triggering the self-correction process.

[0078] The first round of self-correction: Analyze the reasons for the verification failure and find that the main problem is the inability to confirm the true time complexity of the algorithm in the original text. The system adjusts the generation strategy and adds the guidance "If the accurate time complexity cannot be determined, it is recommended to keep the original text or provide multiple possible options" in the prompt. Regenerate the candidate solutions: New candidate solution 1: "This study proposes a new machine learning algorithm with a time complexity of , which is 10 times more efficient than the traditional algorithm." (Specify the complexity of the traditional algorithm) New candidate solution 2: "This study proposes a new machine learning algorithm that is 10 times more efficient than the traditional algorithm." (Delete the time complexity statement to avoid uncertainty) Verify the new candidate solution 1: Internal consistency check passed (0.90), external knowledge verification passed (0.85, adding the description of the traditional algorithm complexity makes the logic clearer), and cross-validation passed (0.88). Comprehensive confidence level: (0.90 + 0.85 + 0.88) / 3 = 0.88, which is higher than the threshold of 0.7 and significantly higher than the confidence level of the original candidate solution of 0.76. Self-correction is successful, and the new candidate solution 1 is adopted.

[0079] Verify the new candidate solution 2: Internal consistency check passed (0.85), external knowledge verification passed (0.80, deleting the potentially incorrect information), and cross-validation passed (0.82). Comprehensive confidence level: (0.85 + 0.80 + 0.82) / 3 = 0.82, which is also higher than the threshold but lower than the new candidate solution 1.

[0080] Finally, select the new candidate solution 1 as the recommended correction, and provide the new candidate solution 2 to the user as an alternative suggestion.

[0081] Step S107: Explanation generation.

[0082] The explanation generation module 207 generates detailed explanations for each error correction suggestion. The explanations include error identification descriptions, correction reasons, knowledge support, alternative suggestions, and learning suggestions.

[0083] Explanation for Error 1: Error location: Sentence 2, "取的了" Error type: Spelling error Severity: Medium Basis for correction: According to modern Chinese grammar rules, "取得" is the correct verb usage, meaning "to obtain, to achieve". "取的" is an incorrect writing, probably due to an input method error or confusion between "得" and "的".

[0084] Relevant knowledge: "得" is used after a verb to indicate the result or degree, such as "取得, 获得, 做得好"; "的" is used after a modifier, such as "我的书, 红的花". In expressions like "取得成绩", "取得成果", "取得性能", etc., "得" should be used instead of "的".

[0085] Suggestion for correction: Change "取的了" to "取得了". Alternative: It can also be changed to "获得了" or "达到了", which have similar meanings. Learning suggestion: Pay attention to differentiating the usage of "的", "地", and "得", which are common mistakes in Chinese writing. It is recommended to remember the mnemonic: "的" is followed by a noun, "地" is followed by a verb, and "得" is followed by an adjective or a complement.

[0086] Explanation for Error 2: Location of error: In the first sentence, "The time complexity of this algorithm is , which is 10 times more efficient than the traditional algorithm." Type of error: Logical error (possible factual error) Severity: Severe Basis for correction: In algorithm analysis, the time complexity usually indicates lower algorithm efficiency. If this algorithm is 10 times more efficient than the traditional algorithm, then the complexity of the traditional algorithm should be higher (such as or higher), or the actual complexity of this algorithm should be lower (such as or ). The original statement has a logical contradiction, probably due to an incorrect time complexity annotation.

[0087] Relevant knowledge: Time complexity is an important indicator for measuring algorithm efficiency. The common complexities from low to high are as follows: . The lower the complexity, the higher the algorithm efficiency.

[0088] Suggestion for correction: Change "The time complexity of this algorithm is " to "The time complexity of this algorithm is , compared with the traditional algorithm, it is 10 times more efficient." Alternative: If the accurate time complexity is not certain, the time complexity statement can be deleted and changed to "This algorithm is 10 times more efficient than the traditional algorithm." Learning advice: In academic writing, technical details such as time complexity and experimental data must be accurate. It is recommended to carefully verify all technical data before writing the paper to ensure logical consistency. If you are unsure about a particular data point, it is advisable to conduct the experiment again or consult relevant literature.

[0089] Step S108: Structured output.

[0090] The results output module 209 outputs the error correction results, explanations, and confidence information in a structured format. The output includes a text comparison view, a modification tracking view, and a statistical analysis view. Example of output results (JSON format):

[0091] The visual HTML output displays a comparison of modifications, using different colors to mark different types of errors. Users can click to view detailed explanations and accept or reject each correction suggestion.

[0092] Example 2 This embodiment demonstrates how the self-correction module improves the accuracy of error correction through multiple rounds of iterative optimization in complex text correction scenarios.

[0093] Suppose the input text is a medical record: "The patient experienced an allergic reaction after taking penicillin, and it is recommended to switch to a cephalosporin antiviral drug. The patient's body temperature is 38.5 degrees Celsius, blood pressure is 120 / 80 mmHg, and heart rate is 85 beats / min." Round 1 processing: Error detection: The detection of "cephalosporin antiviral drugs" may be an error, as cephalosporins are antibiotics, not antiviral drugs.

[0094] Error correction generation: Generate candidate solution "Switch to cephalosporin antibiotics".

[0095] Knowledge Verification: External knowledge verification queries to a medical knowledge base confirmed that cephalosporins are antibiotics used to treat bacterial infections, not antiviral drugs. Verification passed with a confidence level of 0.85.

[0096] However, cross-validation revealed a problem: if a patient is allergic to penicillin, can they use cephalosporin antibiotics? A search of the drug allergy knowledge base revealed a risk of cross-allergy in penicillin-allergic patients using cephalosporin antibiotics. The confidence level decreased to 0.65, below the threshold of 0.7.

[0097] Second round of self-calibration: Regeneration: Based on validation feedback, a new candidate regimen is generated: "It is recommended to use cephalosporin antibiotics with caution after skin testing, or to switch to other non-β-lactam antibiotics such as azithromycin."

[0098] Knowledge verification: A search of the medical knowledge base confirmed that the recommendation complies with clinical medication guidelines. Verification passed, with a confidence level of 0.88.

[0099] Output correction suggestions, and explain in detail the risk of cross-allergy between penicillin and cephalosporins, as well as alternative treatment options.

[0100] Through multiple rounds of iterative optimization, the system not only corrected the erroneous description of "antiviral drugs," but also discovered potential medication safety issues and provided safer and more professional correction suggestions.

[0101] Example 3 This embodiment demonstrates the adaptation method of the present invention in different application scenarios.

[0102] Scenario 1: Academic paper polishing Knowledge base configuration: Load academic writing standards library, academic terminology library, and citation format library.

[0103] Error detection focuses on: consistency of terminology, standardization of citation format, completeness of logical argumentation, and accuracy of data.

[0104] Adjusted prompts: Emphasizing academic writing standards, requiring the use of formal academic language and avoiding colloquial expressions.

[0105] Verification strategy: Focus on external knowledge verification and query academic databases to verify the accuracy of citations and data.

[0106] Scenario 2: Business Document Proofreading Knowledge base configuration: Load the business writing standards library, business terminology library, and format template library.

[0107] Error detection focuses on: format conformity, polite language, logical clarity, and data accuracy.

[0108] Tips adjusted: Emphasize the formality and politeness of business writing, and pay attention to the use of titles and honorifics.

[0109] Validation strategy: Focus on internal consistency checks to ensure consistent style and clear logic throughout the text.

[0110] Scenario 3: Technical Document Proofreading Knowledge base configuration: Load the technical terminology library, API documentation library, and code style library.

[0111] Error detection focuses on: accuracy of technical terminology, correctness of code examples, and completeness of operation steps.

[0112] The prompt word has been adjusted to emphasize technical accuracy and require verification of all technical details.

[0113] Verification strategy: Focus on external knowledge verification and cross-validation, and query technical documents and API documentation to verify the accuracy of technical information.

[0114] The embodiments described above merely illustrate specific implementation methods of this application, and while the descriptions are detailed and specific, they should not be construed as limiting the scope of protection of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the technical solution of this application, and these modifications and improvements all fall within the scope of protection of this application.

[0115] This background section is provided to generally present the context of the invention. The work of the currently named inventors, the work to the extent described in this background section, and aspects of this section that did not constitute prior art at the time of application are neither expressly nor impliedly acknowledged as prior art to the invention.

Claims

1. A method for integrating text error correction and interpretation in a large language model, characterized in that, include: Receive the text to be corrected and configuration parameters, preprocess the text to be corrected, and construct a multi-granularity semantic representation including sentence level, paragraph level and document level; A large language model is used in conjunction with a rule base and statistical features to perform multi-dimensional error detection on the text to be corrected, identify error types and label confidence levels; Based on the detected errors, the large language model is invoked to generate multiple candidate correction schemes, and they are initially ranked. The candidate correction scheme is subjected to triple knowledge consistency verification, which includes internal consistency check, external knowledge verification and cross-validation. Adaptive self-correction is performed based on the verification results. When verification fails, a rollback mechanism is used to retain the original text, or the generation strategy is adjusted based on the verification feedback to regenerate candidate correction schemes and perform iterative optimization. A detailed explanation is generated for the error correction suggestion, which includes at least an explanation of the error identification, the reason for the correction, and the supporting knowledge. The error correction results, detailed explanations, and confidence information are output in a structured format.

2. The integrated method for text error correction and interpretation of a large language model according to claim 1, characterized in that, The construction includes multi-granularity semantic representations at the sentence, paragraph, and document levels, specifically including: For sentence-level semantic representation, a pre-trained language model is used to generate sentence vector representations to capture the semantic information of the sentence; For paragraph-level semantic representation, identify paragraph topics and semantic relationships between paragraphs; For document-level semantic representation, analyze the document's global structure and logical chain, and identify consistency in terminology usage and coherence of argumentation across paragraphs.

3. The integrated method for text error correction and interpretation of a large language model according to claim 1, characterized in that, The error types identified by the multi-dimensional error detection include spelling errors, grammatical errors, semantic errors, logical errors, and factual errors; The spelling errors are detected using a character-level error recognition method; The grammatical errors are detected by a syntactic structure analysis method, which is used to identify subject-verb disagreement, tense errors, or punctuation errors. The semantic errors are detected by a semantic consistency check method, which is used to identify inappropriate word collocations or semantic contradictions. The logical errors are detected by the argument logic verification method, which is used to identify causal relationship errors or insufficient arguments. The factual errors are detected using a knowledge base comparison check method, which is used to identify factual statement errors, data errors, or citation errors.

4. The integrated method for text error correction and interpretation of a large language model according to claim 1, characterized in that, The internal consistency check specifically includes: The semantic coherence between the corrected text and its context is verified by calculating the semantic similarity between the corrected text and its context. Through logical relationship analysis, the completeness and rationality of the revised text in terms of argumentation logic are verified; By comparing stylistic features, the consistency of the revised text with the original text in terms of writing style and language style is verified. Verify whether the corrected text maintains the integrity of the document structure.

5. The integrated method for text error correction and interpretation of a large language model according to claim 1, characterized in that, The external knowledge verification specifically includes: The accuracy of factual statements in the candidate correction schemes is verified by querying domain knowledge bases, fact databases, or terminology databases. The candidate modification schemes are checked for language standardization and professional terminology by comparing them with language standardization databases or professional standards. The references in the candidate correction schemes are verified to confirm their accuracy and completeness; Access search engines or authoritative external websites as supplementary knowledge sources to verify information not covered in the local knowledge base.

6. The integrated method for text error correction and interpretation of a large language model according to claim 1, characterized in that, The cross-validation specifically includes: For the same candidate correction scheme, design multiple different prompt word strategies for independent verification; The same candidate modification scheme is verified multiple times using different reasoning paths, including forward reasoning and backward reasoning. Compare the consistency of the results from multiple verifications; The overall confidence score of the candidate correction scheme is calculated based on the degree of consistency. The higher the degree of consistency, the higher the overall confidence score.

7. The integrated method for text error correction and interpretation of a large language model according to claim 1, characterized in that, The generation strategy adjustment based on verification feedback includes: adjusting the temperature parameter or sampling parameter of the large language model to change the generation determinism according to the type of verification failure, or adding specific reasons for verification failure, improvement suggestions or additional contextual information to the prompt words; The termination conditions of the iterative optimization process include: the generated candidate correction scheme passes the triple verification of knowledge consistency and the confidence level is higher than the preset threshold, or the number of iterations reaches the preset maximum number of iterations, or the difference between the candidate correction schemes generated in two consecutive iterations is less than the preset threshold.

8. The integrated method for text error correction and interpretation of a large language model according to claim 1, characterized in that, The detailed explanation of the error correction suggestions includes: Construct prompts that include thought chains, requiring the large language model to demonstrate the reasoning process of making incorrect judgments and generating corrective solutions; The generated detailed explanation includes: the specific location of the error in the text, the type and severity of the error, the linguistic rules or domain knowledge basis for correcting the error, the background knowledge or explanation of professional terms related to the error, alternative correction schemes besides the recommended correction scheme, and prevention or learning suggestions for the error.

9. The integrated method for text error correction and interpretation of a large language model according to claim 1, characterized in that, The specific steps of outputting the error correction results, detailed explanations, and confidence information in a structured format include: Generate a difference file containing comparison data between the original text and the corrected text. The difference file supports highlighting the modified locations and different types of errors. Encapsulate error type icons, confidence scores, detailed explanation text, and alternative suggestion lists into a structured data format; The structured data format supports interactive display on the user interface, allowing users to view detailed explanations and accept or reject the proposed modifications.

10. A large language model text error correction and interpretation integrated system, characterized in that, include: The user interface module is used to receive the text to be corrected and configuration parameters. The text preprocessing module is used to preprocess the text to be corrected and construct a multi-granularity semantic representation that includes sentence level, paragraph level and document level; The error detection module is used to perform multi-dimensional error detection on the text to be corrected by using a large language model combined with a rule base and statistical features, identify error types and label confidence levels; The error correction generation module is used to generate multiple candidate correction schemes based on the detected errors by calling a large language model, and to perform preliminary ranking. The knowledge consistency verification module is used to perform triple knowledge consistency verification on the candidate correction scheme, which includes internal consistency check, external knowledge verification and cross-validation. The self-correction module is used to perform adaptive self-correction based on the verification results. When the verification fails, a rollback mechanism is used to retain the original text, or the generation strategy is adjusted based on the verification feedback to regenerate candidate correction schemes and perform iterative optimization. An explanation generation module is used to generate detailed explanations for error correction suggestions. The detailed explanations include at least an error identification description, a reason for correction, and supporting knowledge. The results output module is used to output the error correction results, detailed explanations, and confidence information in a structured form.

Citation Information

Patent Citations

  • Language model training method and label setting method

    CN113408274A

  • Computer intelligent semantic error correction system

    CN114611522A

  • Computer implemented methods for the automated analysis or use of data, including use of a large language model

    US12008333B2