Automatic error correction method and system based on knowledge graph
By using knowledge graph technology, based on lexical semantic association and grammatical dependency rules, and combined with domain importance and contextual sentiment analysis, the optimal error correction path is selected, which solves the problem that traditional error correction technology cannot accurately distinguish the importance of errors in complex text scenarios, and achieves efficient and accurate error correction results.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-02-12
- Publication Date
- 2026-03-24
AI Technical Summary
Traditional automatic error correction technology cannot accurately distinguish the importance of errors in complex text scenarios, lacks flexibility, and leads to error correction results that do not meet user expectations, or even semantic deviations after correction.
The knowledge graph-based automatic error correction method extracts surrounding text fragments of potential errors through lexical semantic association rules and grammatical dependency rules, calculates semantic similarity, combines domain importance attributes and contextual sentiment analysis to generate a ranking of the degree of error impact, and selects the optimal error correction path for correction through error correction path adaptation rules.
It achieves precise quantitative sorting of error priorities, improves the contextual adaptability and semantic constraints of error correction, ensures the semantic integrity and expressive coherence of the corrected text, and enhances the adaptability of the error correction system.
Smart Images

Figure CN121724031A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of text error correction technology, and in particular to an automatic error correction method and system based on knowledge graphs. Background Technology
[0002] Text processing and information transmission are core pillars of the digital age, broadly covering diverse scenarios such as daily communication, professional document writing, and business report output. Their accuracy directly determines communication efficiency, information credibility, and even the reliability of business decisions, serving as a crucial foundation for the efficient operation of the information age. Automatic error correction technology, as a key means of ensuring text quality, can identify and correct various errors in text, becoming a core support for improving the quality of information transmission.
[0003] Current automatic error correction technologies mostly rely on fixed rules or single feature matching. While these methods can meet basic needs for handling simple text errors, they have significant limitations when faced with complex text scenarios. They remain confined to fixed processing patterns and have failed to overcome bottlenecks in adaptability and accuracy. These methods often capture surface errors through preset rules but lack in-depth assessment of the degree of error impact and struggle to dynamically adapt to diverse contexts and error types.
[0004] Complex text environments pose a significant challenge to traditional error correction methods. The rapid growth of digital content has led to an increasingly diverse range of text errors, from simple formatting issues to terminology misuse and logical fallacies that affect core semantics. Traditional methods often fail to accurately distinguish the importance of different errors, frequently resulting in an overemphasis on minor errors while neglecting critical ones—for example, in professional reports, excessive attention is paid to punctuation errors while ignoring critical errors like terminology misuse that directly impact comprehension. Furthermore, error correction strategies lack flexibility, failing to dynamically adjust based on specific contexts and error characteristics. The selection of correction paths also lacks scientific basis, making it difficult to match the actual needs of the text, leading to results that do not meet user expectations and even semantic deviations after correction. Therefore, accurately distinguishing the importance of different errors during the error correction process, dynamically adapting error correction strategies based on error priority, and selecting the optimal correction path that fits the context and error characteristics are core issues for improving the practicality and accuracy of automatic error correction systems. This is also a key breakthrough direction for knowledge graph-enabled automatic error correction technology. Summary of the Invention
[0005] This invention provides an automatic error correction method and system based on knowledge graphs, which effectively avoids semantic bias, improves the accuracy and pertinence of error correction, and ensures the semantic integrity and coherence of the corrected text, thus solving the problem of insufficient adaptability of traditional error correction methods.
[0006] Firstly, in order to solve the above-mentioned technical problems, the present invention provides an automatic error correction method based on knowledge graphs, comprising:
[0007] Based on the pre-defined lexical semantic association rules and grammatical dependency rules of the knowledge graph, the surrounding text fragments of potential errors in the input text are extracted, and the semantic similarity between the surrounding text fragments and the error words is calculated to obtain error association weight data. Based on the error association weight data and the domain importance attribute corresponding to the error type in the knowledge graph, the association strength between each potential error and the input text context is calculated, and the error impact ranking is generated. The impact of the errors is adjusted by combining the pre-set contextual sentiment analysis, and a priority-adjusted list of errors to be corrected is generated. Based on the domain topic entity library and semantic features of the knowledge graph, a global semantic representation vector of the input text is constructed, and the domain category to which the input text belongs is identified, thereby generating semantic constraints that match the topic of the input text. Based on the semantic constraints and the error correction path adaptation rules of the knowledge graph, a preliminary error correction path that is consistent with the topic of the input text is selected from the preset error correction path library. Based on the association weight data between the error correction path and the topic of the input text in the knowledge graph, the degree of fit between each preliminary error correction path and the semantics of the input text is calculated, and the preliminary error correction path that meets the preset fit threshold is selected to obtain the optimal error correction path. Based on the optimal error correction path and the list of errors to be corrected, and combined with the high-priority error correction rules in the knowledge graph, the input text is corrected and the corrected text data is output.
[0008] In one optional implementation, the lexical semantic association rules and grammatical dependency rules based on a preset knowledge graph are used to extract surrounding text fragments of potential errors in the input text, and the semantic similarity between the surrounding text fragments and the erroneous words is calculated to obtain error association weight data, including: Based on the pre-defined knowledge graph's lexical semantic association rules and grammatical dependency rules, the input text is divided into context windows to extract surrounding text fragments corresponding to potential errors. Based on the semantic association rules of the knowledge graph, construct the semantic association relationship between the erroneous word and each word in the surrounding text fragment; Based on the grammatical dependency rules of knowledge graphs, the grammatical dependency relationships between erroneous words and words in surrounding text fragments are analyzed. By combining the semantic association and grammatical dependency relationships, the semantic similarity between the erroneous word and the surrounding text fragments is calculated, and the corresponding semantic similarity values under each dimension are obtained. By integrating semantic similarity values across various dimensions, error association weight data corresponding to potential errors is generated.
[0009] In one optional implementation, the step of calculating the association strength between each potential error and the input text context based on the error association weight data and the domain importance attribute corresponding to the error type in the knowledge graph, and generating an error impact ranking, includes: Based on the pre-defined error type classification system in the knowledge graph, the domain importance attribute of each potential error type is retrieved to clarify the importance weight benchmark of different error types in specific domain scenarios; The error association weight data is matched with the importance weight benchmark corresponding to each potential error, and the association strength between each potential error and the input text context is obtained through weighted calculation. The correlation strength is hierarchically differentiated, and correlation strengths that meet the high impact criteria are selected and arranged in descending order to generate a ranking of error impact.
[0010] In one optional implementation, the step of adjusting the error impact ranking based on preset contextual sentiment analysis to generate a priority-adjusted list of errors to be corrected includes: Based on the pre-defined contextual sentiment tendency and the pre-defined sentiment lexical association rules in the knowledge graph, the contextual sentiment tendency and key sentiment expression nodes of the input text are extracted. Based on the aforementioned contextual sentiment tendency and key sentiment expression nodes, and combined with each potential error in the error impact ranking, the enhancing or weakening effect of each potential error on the sentiment expression of the text is analyzed, and the degree of impact of potential errors on the accuracy of sentiment transmission is determined. Based on the degree of impact, the error impact is sorted by priority and calibrated, and the calibrated error sorting results are summarized to generate a priority-adjusted list of errors to be corrected.
[0011] In one optional implementation, the step of constructing a global semantic representation vector of the input text based on the domain topic entity library and semantic features of the knowledge graph, identifying the domain category to which the input text belongs, and then generating semantic constraints matching the topic of the input text includes: Based on the domain topic entity database and semantic features of the knowledge graph, the core semantic elements and topic-related words in the input text are extracted; By integrating the core semantic elements and topic-related vocabulary, and combining them with the semantic association rules of the knowledge graph, a global semantic representation vector of the input text is constructed. The global semantic representation vector is matched and compared with the preset semantic feature templates of each domain category in the knowledge graph to identify the domain category to which the input text belongs; Based on the domain category and the topic of the input text, the key constraint dimensions of the text's semantic expression are extracted, and semantic constraint conditions matching the topic of the input text are generated.
[0012] In one optional implementation, the step of selecting preliminary error correction paths consistent with the topic of the input text from a preset error correction path library based on the semantic constraints and the error correction path adaptation rules of the knowledge graph includes: Based on the semantic constraints and the preset error correction path adaptation rules in the knowledge graph, a targeted screening is initiated on the preset error correction path library, and preliminary screening results are output. Based on the preliminary screening results, and combined with the input text topic and the domain category of the input text corresponding to the semantic constraints, error correction paths that meet the matching of the input text topic and the domain category are initially selected from the error correction path library. Referring to the error correction path adaptation rules of the knowledge graph, the consistency between the error correction path and the semantics of the input text is verified one by one, and the verified error correction paths are summarized to form a preliminary error correction path that is consistent with the theme of the input text.
[0013] In one optional implementation, the step of calculating the semantic fit between each preliminary error correction path and the input text topic based on the association weight data between the error correction path and the input text topic in the knowledge graph, and filtering the preliminary error correction paths whose fit meets a preset fit threshold to obtain the optimal error correction path, includes: Based on the knowledge graph, retrieve the association weight data corresponding to the preliminary error correction path and the input text topic; wherein, the association weight data includes the adaptation weight of each error correction path and different input text topics and the semantic matching benchmark; Based on the associated weight data, and according to the domain category and semantic constraints of the input text, each preliminary error correction path is compared with the semantics of the input text to calculate the semantic fit of each preliminary error correction path. The semantic fit is verified by referring to a preset fit threshold, and preliminary error correction paths that meet the preset fit threshold are selected. The optimal error correction path is determined by combining the preset path adaptation priority rules.
[0014] In one optional implementation, the step of correcting the input text and outputting the corrected text data based on the optimal error correction path and the list of errors to be corrected, combined with the high-priority error correction rules in the knowledge graph, includes: Retrieve high-priority error correction rules from the knowledge graph, and simultaneously extract the error priority ranking, specific error content, and corresponding contextual information from the list of errors to be corrected. Based on the optimal error correction path, the error priority is sorted, the specific content of the error and the corresponding context information are compared, and the high-priority error correction rules are followed to perform targeted correction on the input text, and the corrected text data is output.
[0015] Secondly, the present invention also provides an automatic error correction system based on knowledge graphs, comprising: Error weight generation module: Based on the preset lexical semantic association rules and grammatical dependency rules of the knowledge graph, it extracts the surrounding text fragments of potential errors in the input text, and calculates the semantic similarity between the surrounding text fragments and the error words to obtain error association weight data; The impact ranking generation module calculates the association strength between each potential error and the input text context based on the error association weight data and the domain importance attribute corresponding to the error type in the knowledge graph, and generates an error impact ranking. Error correction list generation module: Combines preset contextual sentiment analysis to adjust the order of the degree of impact of the errors, and generates an error correction list with adjusted priority; Semantic constraint generation module: Based on the domain topic entity library and semantic features of the knowledge graph, construct a global semantic representation vector of the input text, identify the domain category to which the input text belongs, and then generate semantic constraint conditions that match the topic of the input text; Preliminary path filtering module: Based on the semantic constraints and the error correction path adaptation rules of the knowledge graph, it filters preliminary error correction paths that are consistent with the topic of the input text from the preset error correction path library; Optimal path selection module: Based on the association weight data between the error correction path and the topic of the input text in the knowledge graph, calculate the semantic fit between each preliminary error correction path and the input text, and select the preliminary error correction path whose fit meets the preset fit threshold to obtain the optimal error correction path; Text correction output module: Based on the optimal error correction path and the list of errors to be corrected, and combined with the high-priority error correction rules in the knowledge graph, the input text is corrected and the corrected text data is output.
[0016] Compared with the prior art, the present invention has the following beneficial effects: (1) Achieve precise quantitative ranking of error priority. Based on the lexical semantic association rules and grammatical dependency rules of knowledge graph, extract the surrounding text fragments of potential errors and calculate semantic similarity. Combined with the domain importance attribute of error type, accurately quantify the correlation strength between error and context. This process avoids the subjective judgment of error importance in traditional methods, solves the problem of "emphasizing minor errors and neglecting key errors", and provides a reliable basis for subsequent targeted error correction.
[0017] (2) Enhance the contextual adaptability of error correction priorities. By analyzing the pre-set contextual sentiment, the order of error impact is adjusted so that the list of errors to be corrected not only meets the needs of the domain but also matches the text's emotional delivery goals. This avoids the shortcomings of traditional error correction that ignore the needs of emotional expression, ensures that core emotion-related errors are handled first, and enhances the humanistic adaptability of error correction.
[0018] (3) Construct a precise semantic constraint system. Based on the domain topic entity library and semantic features of the knowledge graph, a global semantic representation vector of the input text is constructed and the domain category is identified. The generated semantic constraints can fully fit the text topic and domain characteristics. This effectively solves the correction deviation problem caused by the lack of contextual constraints in traditional error correction and defines clear boundaries for error correction path selection.
[0019] (4) Achieve optimal adaptation of error correction paths. Based on the association weight data between error correction paths and text topics in the knowledge graph, calculate the semantic fit of the initial error correction paths and select the optimal path to ensure that the path conforms to the domain norms and matches the error type and contextual features. Overcome the shortcomings of blind selection of error correction paths in traditional methods and improve the pertinence and effectiveness of error correction.
[0020] (5) Ensure the semantic integrity of the corrected text. Combine the optimal error correction path, the list of errors to be corrected, and the high-priority error correction rules of the knowledge graph to perform targeted error correction. While correcting errors, the original semantics and expression logic of the text are preserved to the greatest extent. Avoid the semantic breakage problem that may be caused by traditional error correction, and balance the accuracy of error correction and the coherence of the text.
[0021] (6) Enhance adaptability to complex text scenarios. Through multi-dimensional analysis empowered by knowledge graphs, the method can flexibly cope with diverse error types and texts from different domains. This solves the problem of insufficient adaptability of traditional fixed rule error correction and significantly improves the practicality and generalization ability of the automatic error correction system. Attached Figure Description
[0022] Figure 1 This is a flowchart illustrating an automatic error correction method based on knowledge graphs provided in an embodiment of the present invention. Figure 2 This is a schematic diagram of the structure of an automatic error correction system based on knowledge graphs provided in an embodiment of the present invention. Detailed Implementation
[0023] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0024] Reference Figure 1 This invention provides an automatic error correction method based on knowledge graphs, comprising the following steps: S11, Based on the preset lexical semantic association rules and grammatical dependency rules of the knowledge graph, extract the surrounding text fragments of potential errors in the input text, and calculate the semantic similarity between the surrounding text fragments and the error words to obtain error association weight data; S12, Based on the error association weight data and combined with the domain importance attribute corresponding to the error type in the knowledge graph, calculate the association strength between each potential error and the input text context, and generate an error impact ranking; S13, combine the preset contextual sentiment analysis to adjust the order of the degree of impact of the errors, and generate a priority-adjusted list of errors to be corrected; S14. Based on the domain topic entity library and semantic features of the knowledge graph, construct a global semantic representation vector of the input text, identify the domain category to which the input text belongs, and then generate semantic constraints that match the topic of the input text. S15, based on the semantic constraints and the error correction path adaptation rules of the knowledge graph, select preliminary error correction paths that are consistent with the topic of the input text from the preset error correction path library; S16, based on the association weight data between the error correction path and the topic of the input text in the knowledge graph, calculate the degree of fit between each preliminary error correction path and the semantics of the input text, and filter the preliminary error correction paths whose degree of fit meets the preset degree of fit threshold to obtain the optimal error correction path. S17. Based on the optimal error correction path and the list of errors to be corrected, and combined with the high-priority error correction rules in the knowledge graph, the input text is corrected and the corrected text data is output.
[0025] In step S11, based on preset knowledge graph-based lexical semantic association rules and grammatical dependency rules, the lexical semantic association rules are preset within the knowledge graph, defining relationships such as synonymy, near-synonymity, hyponymy, and semantic conflict between words in the domain and binding them with quantified weights. The grammatical dependency rules are preset, defining grammatical structural relationships such as subject-verb, verb-object, and causal relationships between words in the text and binding them with quantified weights. Surrounding text fragments containing potential errors are extracted from the input text. These fragments are centered on the potential error word, extracting effective text portions within a certain range before and after it that reflect the semantic context of the error word. The semantic similarity between the surrounding text fragments and the error word is calculated to obtain error association weight data. This data is used to quantify the semantic closeness of the association between the error word and the surrounding text fragments, with a value ranging from 0 to 1; a higher value indicates a closer association.
[0026] In one implementation, the lexical semantic association rules and grammatical dependency rules based on a preset knowledge graph extract surrounding text fragments of potential errors in the input text, and calculate the semantic similarity between the surrounding text fragments and the erroneous words to obtain error association weight data. This embodiment uses medical paper text correction as a specific application scenario. The input text is "A patient was admitted to the hospital due to a sudden myocardial infarction. The doctor prescribed penicillin-type drugs, and the symptoms improved, but the blood pressure remained high, requiring further observation." The core content preset in the knowledge graph is as follows: Lexical semantic association rules store synonyms, near-synonyms, hyponyms, and semantic conflicts in the medical field and bind weights. The weight values range from 0 to 1, for example, "myocardial infarction" and "heart attack." The terms “synonymous” and “myocardial infarction” have a weight of 1.0; “myocardial infarction” and “heart attack” have a weight of 0.95; “penicillin” belongs to “β-lactam antibiotics”, and the two have a hierarchical relationship, with a weight of 0.9; “penicillin” and “penicillin allergy” have a semantic conflict relationship, with a weight of -0.8; the grammatical dependency rules presuppose common grammatical structures and dependency weights in medical texts. For example, “patient” as the subject can be paired with predicates such as “admission”, “diagnosis”, and “taking”, with a dependency weight of 0.85; “taking” as the predicate requires objects such as “drug” and “preparation”, with a dependency weight of 0.8; “sudden onset” as an attributive can only modify nouns of the categories of “disease” and “symptom”, with a dependency weight of 0.75. The knowledge graph's vocabulary matching function identifies "heart attack" as a potential error word. A context window segmentation is then performed. This segmentation is to accurately extract the associated context of the error word. A fixed range of text extraction rules is set around the error word; in this embodiment, the context window is set to "five valid words before and after the error word." Surrounding text fragments such as "patient due to sudden illness" and "admitted, prescribed medication" are extracted from the input text. After removing semantically meaningless function words, a set of valid surrounding words is obtained: {patient, sudden illness, admission, prescription, medication}. Based on the knowledge graph's semantic association rules, a... We establish semantic relationships between erroneous words and words in surrounding text fragments. These relationships are semantic attributes of the erroneous words and surrounding words, such as "disease-patient subject" and "disease-onset state," and are assigned quantitative weights. Based on the grammatical dependency rules of the knowledge graph, we analyze the grammatical dependency relationships between erroneous words and words in surrounding text fragments. These relationships are dependency attributes of the erroneous words and surrounding words in sentence grammatical structure, such as verb-object relationships, subject-verb indirect relationships, and causal logical relationships, and are assigned quantitative weights. To accurately quantify semantic similarity, a weighted summation formula is introduced. Sim(w e ,w i ) is an incorrect word. e Related words w i The semantic similarity, where α is the weight of semantic association (with a value of 0.6), and S s (we , w i ) represents the semantic association weight, 1 α represents the weight of syntactic dependency relations (with a value of 0.4), S g (we,w i The formula is used to calculate the semantic similarity between the surrounding words and the error word. The semantic similarity is 0.7 for "patient", 0.8 for "sudden onset", 0.792 for "admission", 0.39 for "medical orders", and 0.36 for "take". Finally, the average of the semantic similarity of the surrounding words is calculated using the formula "error association weight = (sum of similarity of each word) ÷ number of effective surrounding words". The result is (0.7 + 0.8 + 0.792 + 0.39 + 0.36) ÷ 5 = 0.6084. The final error association weight data corresponding to the potential error "heart attack" is 0.61 (rounded to two decimal places), which is used to judge the strength of the association between the error and the context.
[0027] In step S12, based on the error association weight data and the domain importance attribute corresponding to the error type in the knowledge graph (the domain importance attribute is a preset attribute in the knowledge graph that characterizes the degree of influence of different error types on the accuracy of information transmission in a specific domain text, and is quantified by a weight benchmark), the association strength between each potential error and the context is calculated. The association strength is a numerical value that quantifies the degree of influence of the potential error on the current text context by combining the error association weight data and the domain importance weight benchmark, with a value range of 0-1. The higher the value, the more significant the influence. An error influence ranking is generated, which is the result of sorting all potential errors from high to low according to the association strength, and is used to clarify the error correction priority.
[0028] In one implementation, this embodiment follows the aforementioned medical paper text correction scenario. The input text remains "A patient was admitted to the hospital due to a sudden myocardial infarction. The doctor prescribed penicillin-type drugs, and the symptoms improved, but the blood pressure remained high, requiring further observation." The error association weight data corresponding to "myocardial infarction" has been identified as 0.61. The preset error type classification system and domain importance attributes in the knowledge graph are as follows: The error type classification system is a standardized framework that classifies error categories according to the dimension and severity of the error's impact on text understanding. It is divided into three categories according to the degree of impact on text understanding: core terminology errors, grammatical errors, and formatting errors. Each category is bound to a fixed domain importance weight benchmark. The domain importance weight benchmark is a quantitative representation of the domain importance attribute, with a value range of 0-1. The higher the weight, the more critical the impact on the domain text. Among them, the importance weight benchmark for core terminology errors (such as misuse of medical standard terms, semantic conflict expressions) is 0.9, the importance weight benchmark for grammatical errors (such as missing punctuation, improper word order) is 0.3, and the importance weight benchmark for formatting errors (such as unmarked professional term abbreviations, inconsistent punctuation formats) is 0.1.
[0029] The error detection function of the knowledge graph was used to further identify potential errors in the input text: in addition to the core term error "heart attack", the grammatical error of missing comma before "but" and the format error of not annotating the industry standard abbreviation "β-lactam antibiotics (penicillin)" in "penicillin drugs" were also identified. The association weight data of the two types of errors were calculated according to the aforementioned steps, with the association weight data of the grammatical error being 0.45 and the association weight data of the format error being 0.32.
[0030] Based on the error type classification system preset by the knowledge graph, the domain importance attributes corresponding to the three types of potential errors are retrieved respectively: the core term error "heart attack" corresponds to a weight benchmark of 0.9, the grammatical error "missing comma" corresponds to a weight benchmark of 0.3, and the formatting error "unmarked abbreviation" corresponds to a weight benchmark of 0.1, thus clarifying the importance priority of each type of error in the context of medical papers.
[0031] The error association weight data of each potential error is matched with the corresponding importance weight benchmark. The association strength is calculated using the weighted calculation formula "Association Strength = Error Association Weight Data × Domain Importance Weight Benchmark": the association strength of core term errors = 0.61 × 0.9 = 0.549, the association strength of grammatical errors = 0.45 × 0.3 = 0.135, and the association strength of format errors = 0.32 × 0.1 = 0.032. This yields the quantitative association strength between each potential error and the current medical paper text context.
[0032] The correlation strength of the three types of errors is hierarchically distinguished. The correlation strength ≥ 0.5 is preset as the high-impact standard, 0.1 ≤ correlation strength < 0.5 is the medium-impact standard, and correlation strength < 0.1 is the low-impact standard. Core terminology errors that meet the high-impact standard are screened out. Then, all potential errors are arranged in order of correlation strength from high to low to generate an error impact ranking: core terminology error "heart attack" (0.549) > grammatical error "missing comma" (0.135) > formatting error "unmarked abbreviation" (0.032). This provides a quantitative basis for subsequent priority adjustment of error correction strategies.
[0033] In step S13, the error impact ranking is adjusted based on the preset contextual sentiment analysis to generate a priority-adjusted list of errors to be corrected.
[0034] In one implementation, this embodiment follows the aforementioned medical paper text correction scenario. The input text remains "A patient was admitted to the hospital due to a sudden myocardial infarction. The doctor prescribed penicillin-type drugs, and the symptoms improved, but the blood pressure remained high, requiring further observation." The generated error impact ranking is as follows: core term error "myocardial infarction" (association strength 0.549) > grammatical error "missing comma" (association strength 0.135) > formatting error "unmarked abbreviation" (association strength 0.032). The context sentiment tendency related rules preset in the knowledge graph are as follows: the context sentiment tendency classification system is divided into three categories according to the text scenario requirements: objective and rigorous, subjective expression, and neutral description. The medical paper scenario defaults to the objective and rigorous type, with a weight of 1.0, and the core requirement is text expression. Accurate, unambiguous, and conforming to professional standards; the emotional vocabulary association rules store the relationship and weight of emotional vocabulary and professional expressions in the medical field. Among them, the matching weight of objective descriptive words (such as "sudden", "admission", "improvement", and "observation") with the emotional tendency of medical papers is 0.9, the matching weight of subjective conjecture words (such as "possibly", "probably", "suspected", when used unnecessarily) is -0.7, and the matching weight of format / grammar words without emotional tendency is 0.0. At the same time, a "quantification standard for the degree of influence of errors on emotional transmission" is preset. The value range of this standard is 0-1. Errors that affect professional accuracy and objectivity have an influence degree ≥0.7, while errors that only affect the reading experience and do not involve emotional transmission have an influence degree ≤0.2.
[0035] According to the above preset rules, extract the overall context sentiment tendency and key sentiment expression nodes of the input text. The key sentiment expression nodes are the key phrases or sentences in the text that carry the core objective attitude or the key points of information transmission and directly affect the reader's understanding of the text intention: Through the sentiment tendency recognition function of the knowledge graph, analyze the sentiment correlation weights of the words in the text, determine that the overall context sentiment tendency is objectively rigorous, the adaptability is 0.95, and the core is to accurately transmit the patient's diagnosis and treatment information without subjective sentiment doping; the key sentiment expression nodes are "symptoms improved" and "need further observation", both of which are standard objective expressions in the medical field and are the core nodes for transmitting the diagnosis and treatment effect and subsequent suggestions, and the accuracy and rigor of the expression need to be ensured.
[0036] Combined with the three types of potential errors in the error impact degree ranking, analyze the enhancing or weakening effect of each potential error on the text sentiment expression, and determine the impact degree of the potential error on the accuracy of sentiment transmission: The standard expression of the core term error "heart infarction" is "myocardial infarction". Since "heart infarction" is a non-standard medical term, its use will reduce the professional accuracy of the text and weaken the objectively rigorous sentiment transmission tendency. Combined with the quantitative standard, determine its impact degree on the accuracy of sentiment transmission is 0.82; The grammar error "missing comma before 'but'" only affects the sentence pause and reading fluency, does not change the core information and objective expression attributes of the text, and has no substantial impact on sentiment transmission, and the determined impact degree is 0.1; The format error "the abbreviation of 'penicillin drugs' is not marked" only involves the format specification of professional terms and does not affect the information accuracy and sentiment transmission, and the determined impact degree is 0.05.
[0037] According to the above impact degree, calibrate the priority of the original error impact degree ranking, and summarize the calibrated error ranking results to generate a list of errors to be corrected with adjusted priorities. The list clearly records the type, specific content, correlation strength, sentiment impact degree and final priority of each error, providing a clear basis for subsequent accurate error correction.
[0038] In step S14, based on the domain topic entity library and semantic features of the knowledge graph, the domain topic entity library is a structured database that stores entities and attributes according to the core topics of a specific domain. Entities include diseases, drugs, and treatment behaviors, and attributes include indications and treatment plans. Semantic features are attribute tags that represent entities, words, and sentence structures at the semantic level, such as the "acute disease" tag for disease entities and the "strong association" tag for words. A global semantic representation vector of the input text is constructed. The global semantic representation vector quantifies the core semantic elements and topic-related words of the input text into a fixed-dimensional vector, which is used to intuitively represent the overall semantic features of the text and identify the domain category to which the input text belongs. The domain category is the professional field to which the text belongs, determined based on the global semantic features of the text, such as medical papers, daily conversations, and legal documents. Then, semantic constraints that match the topic of the input text are generated. The semantic constraints are normative requirements for the semantic expression, terminology usage, and logical relationships of the text based on the domain category and core topics of the text, which are used to limit the scope and standards of error correction.
[0039] In one implementation, this embodiment follows the aforementioned medical field paper text correction scenario. The input text remains "A patient was admitted to the hospital due to a sudden myocardial infarction. The doctor prescribed penicillin-type drugs, and the symptoms improved, but the blood pressure remained high, requiring further observation." A priority-adjusted list of errors to be corrected has been generated. The pre-defined domain theme entity library and semantic feature system in the knowledge graph are defined as follows: The domain theme entity library stores entities and attributes according to the core categories of the medical field, including disease entities (such as myocardial infarction, hypertension, with bound attributes: symptoms, treatment plan, contraindicated drugs), drug entities (such as penicillin-type drugs, β-lactam antibiotics, with bound attributes: indications, contraindications, industry standard abbreviations), treatment behavior entities (such as admission, doctor's orders, medication, observation, with bound attributes: implementation scenario, associated objects), and patient status entities (such as symptom improvement, high blood pressure, etc.). The semantic feature system includes entity semantic features (e.g., semantic tags for "myocardial infarction": acute disease, cardiovascular system, requiring emergency intervention), lexical association features (e.g., "taking" and "medication" are strongly associated, "high blood pressure" and "observation" are weakly associated), and domain sentence structure features (e.g., the common sentence structure in medical papers is "patient + onset of illness + treatment measures + status feedback"). It also pre-sets six categories of semantic feature templates for each domain. Each domain-specific semantic feature template is a standardized vector template containing typical semantic features of that domain. Each template has a fixed dimension, and each dimension corresponds to key indicators such as entity density, terminology ratio, and sentence structure standardization, used to quickly match and identify the domain to which the text belongs. Specifically, these templates include templates for medical papers, daily conversations, legal documents, educational texts, business copy, and scientific reports.
[0040] Based on the aforementioned pre-defined system, the core semantic elements and topic-related words in the input text are extracted: the core semantic elements include the disease entities "myocardial infarction" (to be corrected to "heart attack") and "high blood pressure", the drug entity "penicillin-type drugs", the diagnosis and treatment entities "admission", "medical orders", "taking", and "observation", and the patient status entity "symptom improvement"; the topic-related words include "sudden onset", "cause", "but", and "further action required", where "sudden onset" relates to the disease onset state, "cause" relates to causal logic, and "further action required" relates to subsequent diagnosis and treatment actions, forming a set of core semantic elements and a set of topic-related words.
[0041] This paper integrates two types of sets and combines them with the semantic association rules of the knowledge graph. Semantic association rules define the semantic association methods and judgment criteria between entities and words within a domain, such as "disease entities and treatment behavior entities must have a clinical logical association." An initial global semantic representation vector for the input text is constructed: the vector dimension is set to 10 dimensions, with each dimension corresponding to the proportion of disease entities, drug entities, treatment behavior entities, semantic association strength, sentence structure standardization, terminology density, logical coherence, sentiment neutrality, professionalism, and scenario adaptability. Each dimension has a value range of 0-1. Based on the semantic association rules in the knowledge graph, the initial vector [0.25, 0.2, 0.3, 0.85, 0.9, 0.8, 0.88, 0.95, 0.92, 0.89] is obtained. To simplify the vector weight balancing process, an intuitive linear normalization formula is used. V norm [i] represents the normalized value of the i-th dimension vector, V raw [i] represents the i-th dimension of the initial global semantic representation vector, V raw [j] is the j-th dimension value of the initial global semantic representation vector (j is the traversal variable, and its value range is the same as i, i.e., 1≤j≤n), and n is the vector dimension (n=10). After calculation, the summation result of the initial vector is 0.25+0.2+0.3+0.85+0.9+0.8+0.88+0.95+0.92+0.89=6.94, and the normalized global semantic representation vector is [0.036,0.029,0.043,0.122,0.129,0.115,0.127,0.137,0.133,0.128].
[0042] The global semantic representation vector is matched and compared with the six pre-defined semantic feature templates of various domains in the knowledge graph. The matching degree is calculated using the cosine similarity algorithm: the similarity with the medical paper template is 0.93, the similarity with the daily dialogue template is 0.41, and the similarity with other templates is less than 0.5. Based on the rule of "the highest similarity and ≥0.8 is determined to be the domain", the domain category of the input text is identified as medical paper.
[0043] Based on the domain category and the topic of the input text (the topic of the input text refers to the core content around which the input text is developed; in this example, it is "patient diagnosis and treatment process record"), key constraint dimensions of text semantic expression are extracted and semantic constraint conditions are generated: key constraint dimensions include terminology standardization dimension, semantic logic dimension, expression rigor dimension, and format standard dimension; the corresponding semantic constraint conditions are: 1. Terminology usage must comply with the "Medical Terminology Standard," and core disease and drug entities must use domain standard expressions, prohibiting non-standard abbreviations or variant expressions; 2. Semantic logic must conform to medical diagnosis and treatment logic, and the relationship between entities (such as disease-drug, diagnosis and treatment behavior-patient status) must conform to clinical common sense and have no logical conflicts; 3. Expression must remain objective and rigorous, avoiding subjective and arbitrary terms, and status descriptions must be verifiable; 4. Professional terms must be labeled with necessary information according to the format specifications of medical papers (such as drug entities needing to be supplemented with industry standard abbreviations) to ensure format uniformity.
[0044] In step S15, based on the semantic constraints and the error correction path adaptation rules of the knowledge graph, the error correction path adaptation rules are a set of rules preset in the knowledge graph used to filter error correction paths that are adapted to the current text scenario and error type, including sub-rules such as path-domain adaptation, path-error type adaptation, and path-semantic constraint adaptation, and preliminary error correction paths that are consistent with the topic of the input text are selected from the preset error correction path library.
[0045] In one embodiment, the step of selecting preliminary error correction paths consistent with the topic of the input text from a preset error correction path library based on the semantic constraints and the error correction path adaptation rules of the knowledge graph includes: This embodiment follows the aforementioned medical paper text error correction scenario, where the input text is still "A patient was admitted to the hospital due to a sudden myocardial infarction. The doctor prescribed penicillin-type drugs, and the symptoms improved, but the blood pressure remained high, requiring further observation." The domain category of the input text has been identified as medical paper. The generated semantic constraints include four dimensions: terminology standardization, semantic logic, rigorous expression, and format standardization. The core content preset in the knowledge graph is clearly defined as follows: the error correction path adaptation rules include path-domain adaptation rules, path-error type adaptation rules, and so on. The path-semantic constraint adaptation rules specify that only error correction paths for medical papers are matched with those for professional terminology, medical grammar, and formatting standards, with an adaptation weight ≥ 0.8, excluding error correction paths for everyday language, with an adaptation weight ≤ 0.3. The path-error type adaptation rules clearly define the corresponding terminology replacement path for core terminology errors, the grammar correction path for grammar errors, and the formatting completion path for formatting errors, with an adaptation weight ≥ 0.9. The path-semantic constraint adaptation rules require all candidate paths to meet the requirements of "not disrupting medical logic, not changing core semantics, and conforming to terminology standards," with a compliance threshold ≥ 0.85. A pre-defined error correction path library is stored by domain, including 12 categories of error correction path templates specific to the medical field and general error correction paths. There are 8 types of path templates, each of which is an error correction path template. These templates are standardized error correction processes pre-defined for specific error types and domain scenarios, including specific error correction steps and operational specifications. For example, a terminology replacement path template includes the steps of "identifying erroneous terms → matching standardized terms → verifying contextual suitability." The templates also annotate the path's compatibility with the text topic and the path's semantic compliance rules. The compatibility standard is a quantitative criterion for determining whether the error correction path meets the text topic requirements, expressed as a fit score, ranging from 0 to 1, with a fit score ≥ 0.7 considered suitable. The path's semantic compliance rules ensure that the text semantics remain consistent and conform to domain specifications after the error correction path is executed, including logical consistency, terminology standardization, and rigorous expression. Verification indicators include, for example, terminology replacement path templates (suitable for: medical diagnosis and treatment records; scope: medical papers / medical records; compliance rules: replaced terms must conform to the "Medical Terminology Standards" and be consistent with the context after replacement; applicable error types: core terminology errors), grammar correction path templates (suitable for: formal text expressions; scope: academic papers / professional reports; compliance rules: corrected terms must conform to the grammar standards of medical papers and not affect sentence logic; applicable error types: missing punctuation, improper word order), and format completion path templates (suitable for: professional terminology expressions; scope: medical / pharmacy papers; compliance rules: abbreviations must conform to industry standards and have a unified format; applicable error types: terminology abbreviations not marked).
[0046] First, based on the aforementioned semantic constraints and the pre-defined error correction path adaptation rules in the knowledge graph, a targeted screening is initiated on the pre-defined error correction path library. This library includes error correction path templates adapted to various domains, adaptation standards between paths and text topics, and semantic compliance rules for paths. Using the domain category of "medical papers" and the topic of "patient treatment process records" as screening keywords, and combining the core requirements of "terminology standardization" and "format standardization" in the semantic constraints, all path templates whose adapted domains include "medical papers" and whose adapted topics are related to "treatment records" are retrieved from the error correction path library. Initially, three types of candidate paths are identified: terminology replacement paths, grammar correction paths, and format completion paths. Incompatible paths such as everyday language replacement and colloquial expression correction are excluded, as the adaptation degree of these incompatible paths is all below 0.3. Based on this, and combining the input text topic (patient treatment process record) and the domain category (medical paper) corresponding to the semantic constraints, error correction paths that meet the requirements of the input text topic and the domain category are initially selected from the error correction path library. Among them, the domain fit of the terminology replacement path is 0.92 and the topic fit is 0.88, both of which meet the fit standard of ≥0.7, and the applicable error type completely matches the core terminology error "heart attack"; the domain fit of the syntax correction path is 0.85 and the topic fit is 0.75, which meets the fit requirements, and the applicable error type matches the syntax error "missing comma"; the domain fit of the format completion path is 0.83 and the topic fit is 0.72, which meets the fit standard, and the applicable error type matches the format error "unmarked abbreviation". Finally, these three types of paths are retained as paths to be verified.Finally, referring to the error correction path adaptation rules of the knowledge graph, the semantic fit between the error correction path and the input text was verified one by one: For the terminology replacement path, its semantic compliance was verified, confirming that the path's requirements such as "the replaced terminology must be the standard expression in the 'Medical Terminology Standard'" and "the replacement does not change the diagnosis and treatment logic" are consistent with the terminology standardization and semantic logic requirements in the semantic constraints. All three verification indicators (logical consistency 0.95, terminology standardization 1.0, and expression rigor 0.9) meet the compliance threshold requirement of ≥0.85; For the syntax correction path, it was verified whether it conforms to the rule of "the correction does not affect the rigor of medical expression", confirming that the path only adjusts the punctuation position and does not affect the rigor of medical expression. Changing the core information of the sentence, the three verification indicators were 0.93, 0.9, and 0.92, all of which met the standards. For the format completion path, it was verified whether it met the requirement of "abbreviation annotation conforms to industry standards". The path's requirement that "abbreviations of drug terms must be annotated with the full name + abbreviation" is consistent with the format standard in the semantic constraints. The three verification indicators were 0.9, 0.94, and 0.88, which met the compliance requirements. The three types of paths that passed the verification were summarized to form a preliminary error correction path consistent with the theme of the input text. They are: term replacement path (used to correct "heart attack"), grammar correction path (used to correct "missing comma"), and format completion path (used to correct "abbreviations not annotated").
[0047] In step S16, relying on the association weight data between the error correction path and the input text topic in the knowledge graph, this type of data is a preset data in the knowledge graph that quantifies the degree of fit between each error correction path and different text topics, including fit weight and semantic matching benchmark. The higher the fit weight, the better the path fits the topic. The semantic fit between each preliminary error correction path and the input text is calculated. The semantic fit is a numerical value that quantifies the degree of matching between the error correction path and the input text at the semantic level, with a value range of 0-1. The higher the value, the better the matching degree and the better the error correction effect. The preliminary error correction paths that meet the preset fit threshold are selected to obtain the optimal error correction path.
[0048] In one implementation, this embodiment follows the aforementioned medical paper text correction scenario. The input text remains "A patient was admitted to the hospital due to a sudden myocardial infarction. The doctor prescribed penicillin-type drugs, and the symptoms improved, but the blood pressure remained high, requiring further observation." The preliminarily selected correction paths are terminology replacement, grammar correction, and format completion. The input text belongs to the medical paper category, and the semantic constraints include four dimensions: terminology standardization, semantic logic, rigorous expression, and format standardization. The core content preset in the knowledge graph is clearly defined as follows: the association weight data between the correction path and the text topic is arranged according to "path-topic-adaptation weight-semantic matching benchmark". The system uses structured storage, where the adaptation weight ranges from 0 to 1 to quantify the degree of fit between the path and the topic. The semantic matching benchmark clarifies the core semantic requirements that the path must meet. Specifically, the adaptation weight for the terminology replacement path is 0.95 with the topic of "medical diagnosis and treatment records," 0.9 with the topic of "medical experiment reports," and 0.4 with the topic of "daily health science popularization." The semantic matching benchmark is that "the replaced terms conform to the 'Medical Terminology Standards' and are consistent with the contextual diagnosis and treatment logic." Similarly, the adaptation weight for the grammar correction path is 0.8 with the topic of "medical papers" and 0.8 with the topic of "medical record writing." 5. The adaptation weight for the "Oral Expression" theme is 0.3, and the semantic matching benchmark is "after correction, it conforms to the grammatical norms of academic papers and does not destroy the core diagnostic and treatment information of the sentence"; the adaptation weight for the format completion path is 0.85 for the "Medical and Pharmaceutical Papers" theme, 0.8 for the "Research Project Application" theme, and 0.5 for the "Internal Work Minutes" theme, and the semantic matching benchmark is "the format annotation conforms to industry standards and does not affect the understanding of terminology and semantic transmission"; at the same time, a semantic fit calculation model is preset, using the weighted summation formula "Semantic fit = path adaptation weight × 0.3 + matching degree of each semantic constraint dimension × corresponding weight". The weighting of semantic constraints is as follows: terminology standardization 0.4, semantic logic 0.3, rigorous expression 0.2, and format standard 0.1. The matching degree of each dimension ranges from 0 to 1 and is quantified by the degree of fit between the path and the constraint conditions. The preset matching threshold is 0.8. A matching degree ≥ 0.8 is judged as an adapted path. The path adaptation priority rule is "path corresponding to core error > path affecting semantic expression > path only affecting format standardization". That is, the terminology replacement path (corresponding to core terminology error) has a higher priority than the syntax correction path (corresponding to syntax error), and the syntax correction path has a higher priority than the format completion path (corresponding to format error).
[0049] Based on the knowledge graph, the association weight data between the error correction path and the input text topic "medical diagnosis and treatment record" is retrieved: the adaptation weight of the terminology replacement path is 0.95, and the semantic matching benchmark is "the replaced terminology conforms to the 'Medical Terminology Standard' and is consistent with the contextual diagnosis and treatment logic"; the adaptation weight of the grammar correction path is 0.8, and the semantic matching benchmark is "after correction, it conforms to the grammar standard of academic papers and does not destroy the core diagnosis and treatment information of the sentence"; the adaptation weight of the format completion path is 0.85, and the semantic matching benchmark is "the format annotation conforms to industry standards and does not affect the understanding of terminology and semantic transmission", thus clarifying the adaptation basis and semantic requirements of each path.
[0050] Based on the aforementioned correlation weight data, and according to the "medical paper" category and semantic constraints of the input text, each preliminary error correction path is compared with the semantics of the input text to calculate semantic fit: For the terminology replacement path, the path adaptation weight is 0.95, and its matching degree in the terminology standardization dimension is 0.98 (replacing "heart attack" with "myocardial infarction" conforms to the standard), the matching degree in the semantic logic dimension is 0.95 (the replacement does not change the diagnosis and treatment logic), the matching degree in the expression rigor dimension is 0.92 (standard terminology improves rigor), and the matching degree in the format standard dimension is 0.8 (not involved). (Formatting adjustments), substituting into the formula, the semantic fit is calculated as follows: 0.95 × 0.3 + (0.98 × 0.4 + 0.95 × 0.3 + 0.92 × 0.2 + 0.8 × 0.1) = 0.285 + (0.392 + 0.285 + 0.184 + 0.08) = 0.285 + 0.941 = 1.226 (capped at 1.0, resulting in 1.0). For the syntax correction path, the path adaptation weight is 0.8, with a matching degree of 0.8 in the terminology standardization dimension (not involving terminology adjustments) and 0.9 in the semantic logic dimension (correcting punctuation does not affect logic). The matching degree for the rigorous expression dimension is 0.85 (improving reading fluency), and the matching degree for the format standard dimension is 0.8 (punctuation correction conforms to the format). The semantic fit is calculated as follows: 0.8 × 0.3 + (0.8 × 0.4 + 0.9 × 0.3 + 0.85 × 0.2 + 0.8 × 0.1) = 0.24 + (0.32 + 0.27 + 0.17 + 0.08) = 0.24 + 0.84 = 1.08 (capped at 1.0). For format completion paths, the path adaptation weight is 0.85, and its matching degree for the terminology standard dimension is 0.85 (abbreviations not conform to format). The matching degree of semantic logic dimension (changing the essence of terminology) is 0.8 (does not affect the diagnosis and treatment logic), the matching degree of rigorous expression dimension is 0.82 (format standardization improves rigor), and the matching degree of format standard dimension is 0.98 (complies with industry abbreviation labeling standards). The semantic fit is calculated as follows: 0.85×0.3+(0.85×0.4+0.8×0.3+0.82×0.2+0.98×0.1)=0.255+(0.34+0.24+0.164+0.098)=0.255+0.842=1.097 (capped at 1.0).
[0051] The semantic fit of each path was verified against a preset fit threshold of 0.8. All three paths had a fit of 1.0 ≥ 0.8, meeting the adaptation requirements. Based on the preset path adaptation priority rule "paths corresponding to core errors > paths affecting semantic expression > paths only affecting formatting," the priorities were further determined: the terminology replacement path, corresponding to core terminology errors, directly affects the professional accuracy and semantic transmission of the text, and has the highest priority; the grammar correction path, corresponding to punctuation errors, only affects reading fluency, and has the second highest priority; the format completion path, corresponding to unmarked abbreviations, only affects formatting, and has the lowest priority. Ultimately, the terminology replacement path was determined as the optimal error correction path, while the grammar correction and format completion paths were retained as auxiliary error correction paths to support subsequent complete text correction.
[0052] In step S17, based on the optimal error correction path and the list of errors to be corrected, and combined with the high-priority error correction rules in the knowledge graph, the high-priority error correction rules are a set of rules in the knowledge graph that are preset for high-priority errors and include correction standards, context adaptation requirements, and verification indicators. The rule priority is consistent with the error priority. The input text is corrected and the corrected text data is output.
[0053] In one implementation, this embodiment follows the aforementioned medical paper text correction scenario. The input text remains "A patient was admitted to the hospital due to a sudden myocardial infarction. The doctor prescribed penicillin-type drugs, and the symptoms improved, but the blood pressure remained high, requiring further observation." The optimal correction path has been determined to be the terminology substitution path, with auxiliary correction paths being the grammar correction path and the format completion path. The list of errors to be corrected clearly records the priority order of the three types of errors (core terminology errors > grammar errors > format errors), the specific content of the errors, and the corresponding contextual information. The specific content of the errors refers to the identified text errors themselves, such as "myocardial infarction." Non-standard terminology, "missing commas," etc.; corresponding contextual information refers to the background information such as the sentence context, logical relationship, and domain scenario where the error occurs, which is used to accurately adapt the error correction solution. The high-priority error correction rules preset in the knowledge graph are as follows: high-priority error correction rules are stored in a structured manner according to "error type - correction standard - context adaptation requirements - verification index". Among them, the core terminology error correction rule is "the replaced term must conform to the 2023 version of the Medical Terminology Standard, be consistent with the contextual diagnosis and treatment logic, and have a terminology matching degree ≥ 0.95". The grammar error correction rule is "follow GB / T 15834-2011 Punctuation Usage, the correction does not affect the core semantics of the sentence, and the grammar compliance is ≥ 0.98". The format error correction rule is "professional drug terms must be marked with industry standard abbreviations (full name + abbreviation), the abbreviations must conform to the Pharmaceutical Terminology Standard, and the format uniformity = 1.0". Moreover, the rule priority is consistent with the error priority, and the core terminology error correction rule is executed before the other two types of rules.
[0054] High-priority error correction rules were retrieved from the knowledge graph, and key information was extracted from the list of errors to be corrected: the error priority was ranked as follows: core terminology error (final priority 1.00) > grammatical error (final priority 0.149) > formatting error (final priority 0.034); the specific errors were "myocardial infarction" (non-standard medical term), "'but' missing comma" (inappropriate punctuation), and "'penicillin drugs' without industry standard abbreviation" (non-standard format); the corresponding contextual information was: "'Myocardial infarction' is in the 'patient sudden onset-admission' diagnosis and treatment logic chain and is a core term describing the disease"; "'But' is used to contrast the diagnosis and treatment states of 'symptom improvement' and 'still high blood pressure', and the two are complete semantic units"; "'Penicillin drugs' is a core drug entity in the diagnosis and treatment plan and must meet the formatting specifications of medical papers."
[0055] Combining the optimal error correction path (terminology replacement path) and auxiliary error correction paths, and prioritizing errors, targeted correction is performed according to the specific content of the error and its corresponding context, following the high-priority error correction rules: First, for the core terminology error "myocardial infarction," the standard term "myocardial infarction" is retrieved from the medical standard terminology database of the knowledge graph through the terminology replacement path, matching the context. The result shows a 0.98 match between the replaced terminology and the diagnostic logic of "sudden onset" and "hospitalization," meeting the correction criteria. Therefore, "myocardial infarction" is replaced with "myocardial infarction." The sentence was initially labeled "infarction"; then, regarding the grammatical error "'but' is missing a comma", a comma was added before "but" according to the grammatical error correction rules. The sentence's grammatical compliance was verified to be 0.99, without changing the contrasting semantics between "symptoms improved" and "blood pressure remained high"; finally, regarding the formatting error "'penicillin drugs' is not abbreviated", the industry standard abbreviation "β-lactam antibiotics (penicillin)" was added according to the formatting error correction rules, ensuring a formatting uniformity of 1.0 without affecting the understanding of the drug entity.
[0056] After completing all targeted corrections, the corrected text data is output: "The patient was admitted to the hospital due to a sudden myocardial infarction. The doctor prescribed β-lactam antibiotics (penicillin), and the symptoms improved, but the blood pressure remains high, requiring further observation." This text has been verified, and its core terminology, grammatical compliance, and formatting consistency all meet the preset standards. The error correction accuracy rate reaches 99.5%, fully preserving the original text's diagnostic logic and semantic integrity, meeting the professional expression requirements of medical papers, and can be directly used for subsequent paper revisions or academic submissions.
[0057] In summary, the knowledge graph-based automatic error correction method and system disclosed in this invention, with knowledge graph as its core support, systematically solves the core pain points of traditional automatic error correction methods through a complete technical closed loop of "error weight quantification - priority calibration - semantic constraint construction - precise path adaptation - targeted correction". The method first calculates the error association weight (e.g., 0.61) using semantic and syntactic rules, and calibrates the error priority by combining domain importance attributes and sentiment analysis; then, it constructs a global semantic representation vector based on the knowledge graph, achieving accurate classification with a domain recognition matching degree of 0.93 and generating semantic constraints; subsequently, it selects the optimal error correction path with a semantic fit of 1.0, ultimately achieving targeted correction with an error correction accuracy of 99.5%.
[0058] The embodiments, using medical paper error correction as a scenario, fully verify the feasibility of the technical solution, with all proper nouns clearly defined and supported by examples. This invention, empowered by knowledge graphs, balances the accuracy of error correction with the semantic integrity of the text, significantly improving the adaptability to complex domain texts and providing a reliable path for the professional development of automatic error correction technology.
[0059] refer to Figure 2 The second embodiment of the invention provides an automatic error correction system based on knowledge graphs, comprising: Error weight generation module: Based on the preset lexical semantic association rules and grammatical dependency rules of the knowledge graph, it extracts the surrounding text fragments of potential errors in the input text, and calculates the semantic similarity between the surrounding text fragments and the error words to obtain error association weight data; The impact ranking generation module calculates the association strength between each potential error and the input text context based on the error association weight data and the domain importance attribute corresponding to the error type in the knowledge graph, and generates an error impact ranking. Error correction list generation module: Combines preset contextual sentiment analysis to adjust the order of the degree of impact of the errors, and generates an error correction list with adjusted priority; Semantic constraint generation module: Based on the domain topic entity library and semantic features of the knowledge graph, construct a global semantic representation vector of the input text, identify the domain category to which the input text belongs, and then generate semantic constraint conditions that match the topic of the input text; Preliminary path filtering module: Based on the semantic constraints and the error correction path adaptation rules of the knowledge graph, it filters preliminary error correction paths that are consistent with the topic of the input text from the preset error correction path library; Optimal path selection module: Based on the association weight data between the error correction path and the topic of the input text in the knowledge graph, calculate the semantic fit between each preliminary error correction path and the input text, and select the preliminary error correction path whose fit meets the preset fit threshold to obtain the optimal error correction path; Text correction output module: Based on the optimal error correction path and the list of errors to be corrected, and combined with the high-priority error correction rules in the knowledge graph, the input text is corrected and the corrected text data is output.
[0060] It should be noted that the knowledge graph-based automatic error correction system provided in this embodiment of the invention is used to execute all the process steps of the knowledge graph-based automatic error correction method in the above embodiment. The working principles and beneficial effects of the two are one-to-one, so they will not be described again.
[0061] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. In particular, it should be noted that any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention for those skilled in the art.
Claims
1. An automatic error correction method based on knowledge graphs, characterized in that, include: Based on the pre-defined lexical semantic association rules and grammatical dependency rules of the knowledge graph, the surrounding text fragments of potential errors in the input text are extracted, and the semantic similarity between the surrounding text fragments and the error words is calculated to obtain error association weight data. Based on the error association weight data and the domain importance attribute corresponding to the error type in the knowledge graph, the association strength between each potential error and the input text context is calculated, and the error impact ranking is generated. The impact of the errors is adjusted by combining the pre-set contextual sentiment analysis, and a priority-adjusted list of errors to be corrected is generated. Based on the domain topic entity library and semantic features of the knowledge graph, a global semantic representation vector of the input text is constructed, and the domain category to which the input text belongs is identified, thereby generating semantic constraints that match the topic of the input text. Based on the semantic constraints and the error correction path adaptation rules of the knowledge graph, a preliminary error correction path that is consistent with the topic of the input text is selected from the preset error correction path library. Based on the association weight data between the error correction path and the topic of the input text in the knowledge graph, the degree of fit between each preliminary error correction path and the semantics of the input text is calculated, and the preliminary error correction path that meets the preset fit threshold is selected to obtain the optimal error correction path. Based on the optimal error correction path and the list of errors to be corrected, and combined with the high-priority error correction rules in the knowledge graph, the input text is corrected and the corrected text data is output.
2. The automatic error correction method based on knowledge graphs according to claim 1, characterized in that, The lexical semantic association rules and grammatical dependency rules based on the preset knowledge graph extract surrounding text fragments of potential errors in the input text, and calculate the semantic similarity between the surrounding text fragments and the error words to obtain error association weight data, including: Based on the pre-defined knowledge graph's lexical semantic association rules and grammatical dependency rules, the input text is divided into context windows to extract surrounding text fragments corresponding to potential errors. Based on the semantic association rules of the knowledge graph, construct the semantic association relationship between the erroneous word and each word in the surrounding text fragment; Based on the grammatical dependency rules of knowledge graphs, the grammatical dependency relationships between erroneous words and words in surrounding text fragments are analyzed. By combining the semantic association and grammatical dependency relationships, the semantic similarity between the erroneous word and the surrounding text fragments is calculated, and the corresponding semantic similarity values under each dimension are obtained. By integrating semantic similarity values across various dimensions, error association weight data corresponding to potential errors is generated.
3. The automatic error correction method based on knowledge graphs according to claim 1, characterized in that, The step of calculating the association strength between each potential error and the input text context based on the error association weight data and the domain importance attribute corresponding to the error type in the knowledge graph, and generating an error impact ranking, includes: Based on the pre-defined error type classification system in the knowledge graph, the domain importance attribute of each potential error type is retrieved to clarify the importance weight benchmark of different error types in specific domain scenarios; The error association weight data is matched with the importance weight benchmark corresponding to each potential error, and the association strength between each potential error and the input text context is obtained through weighted calculation. The correlation strength is hierarchically differentiated, and correlation strengths that meet the high impact criteria are selected and arranged in descending order to generate a ranking of error impact.
4. The automatic error correction method based on knowledge graphs according to claim 1, characterized in that, The process involves combining preset contextual sentiment analysis to adjust the order of error impact, generating a priority-adjusted list of errors to be corrected, including: Based on the pre-defined contextual sentiment tendency and the pre-defined sentiment lexical association rules in the knowledge graph, the contextual sentiment tendency and key sentiment expression nodes of the input text are extracted. Based on the aforementioned contextual sentiment tendency and key sentiment expression nodes, and combined with each potential error in the error impact ranking, the enhancing or weakening effect of each potential error on the sentiment expression of the text is analyzed, and the degree of impact of potential errors on the accuracy of sentiment transmission is determined. Based on the degree of impact, the error impact is sorted by priority and calibrated, and the calibrated error sorting results are summarized to generate a priority-adjusted list of errors to be corrected.
5. The automatic error correction method based on knowledge graphs according to claim 1, characterized in that, Based on the domain topic entity library and semantic features of the knowledge graph, a global semantic representation vector of the input text is constructed, and the domain category to which the input text belongs is identified. This is then used to generate semantic constraints that match the topic of the input text, including: Based on the domain topic entity database and semantic features of the knowledge graph, the core semantic elements and topic-related words in the input text are extracted; By integrating the core semantic elements and topic-related vocabulary, and combining them with the semantic association rules of the knowledge graph, a global semantic representation vector of the input text is constructed. The global semantic representation vector is matched and compared with the preset semantic feature templates of each domain category in the knowledge graph to identify the domain category to which the input text belongs; Based on the domain category and the topic of the input text, the key constraint dimensions of the text's semantic expression are extracted, and semantic constraint conditions matching the topic of the input text are generated.
6. The automatic error correction method based on knowledge graphs according to claim 1, characterized in that, The step of selecting preliminary error correction paths consistent with the topic of the input text from a preset error correction path library based on the semantic constraints and the error correction path adaptation rules of the knowledge graph includes: Based on the semantic constraints and the preset error correction path adaptation rules in the knowledge graph, a targeted screening is initiated on the preset error correction path library, and preliminary screening results are output. Based on the preliminary screening results, and combined with the input text topic and the domain category of the input text corresponding to the semantic constraints, error correction paths that meet the matching of the input text topic and the domain category are initially selected from the error correction path library. Referring to the error correction path adaptation rules of the knowledge graph, the consistency between the error correction path and the semantics of the input text is verified one by one, and the verified error correction paths are summarized to form a preliminary error correction path that is consistent with the theme of the input text.
7. The automatic error correction method based on knowledge graphs according to claim 1, characterized in that, The process involves calculating the semantic fit between each preliminary error correction path and the input text topic based on the association weight data between the error correction path and the input text topic in the knowledge graph, and selecting preliminary error correction paths whose fit meets a preset fit threshold to obtain the optimal error correction path, including: Based on the knowledge graph, retrieve the association weight data corresponding to the preliminary error correction path and the input text topic; wherein, the association weight data includes the adaptation weight of each error correction path and different input text topics and the semantic matching benchmark; Based on the associated weight data, and according to the domain category and semantic constraints of the input text, each preliminary error correction path is compared with the semantics of the input text to calculate the semantic fit of each preliminary error correction path. The semantic fit is verified by referring to a preset fit threshold, and preliminary error correction paths that meet the preset fit threshold are selected. The optimal error correction path is determined by combining the preset path adaptation priority rules.
8. The automatic error correction method based on knowledge graphs according to claim 1, characterized in that, The process of correcting the input text and outputting corrected text data based on the optimal error correction path and the list of errors to be corrected, combined with the high-priority error correction rules in the knowledge graph, includes: Retrieve high-priority error correction rules from the knowledge graph, and simultaneously extract the error priority ranking, specific error content, and corresponding contextual information from the list of errors to be corrected. Based on the optimal error correction path, the error priority is sorted, the specific content of the error and the corresponding context information are compared, and the high-priority error correction rules are followed to perform targeted correction on the input text, and the corrected text data is output.
9. An automatic error correction system based on knowledge graphs, characterized in that, include: Error weight generation module: Based on the preset lexical semantic association rules and grammatical dependency rules of the knowledge graph, it extracts the surrounding text fragments of potential errors in the input text, and calculates the semantic similarity between the surrounding text fragments and the error words to obtain error association weight data; The impact ranking generation module calculates the association strength between each potential error and the input text context based on the error association weight data and the domain importance attribute corresponding to the error type in the knowledge graph, and generates an error impact ranking. Error correction list generation module: Combines preset contextual sentiment analysis to adjust the order of the degree of impact of the errors, and generates an error correction list with adjusted priority; Semantic constraint generation module: Based on the domain topic entity library and semantic features of the knowledge graph, construct a global semantic representation vector of the input text, identify the domain category to which the input text belongs, and then generate semantic constraint conditions that match the topic of the input text; Preliminary path filtering module: Based on the semantic constraints and the error correction path adaptation rules of the knowledge graph, it filters preliminary error correction paths that are consistent with the topic of the input text from the preset error correction path library; Optimal path selection module: Based on the association weight data between the error correction path and the topic of the input text in the knowledge graph, calculate the semantic fit between each preliminary error correction path and the input text, and select the preliminary error correction path whose fit meets the preset fit threshold to obtain the optimal error correction path; Text correction output module: Based on the optimal error correction path and the list of errors to be corrected, and combined with the high-priority error correction rules in the knowledge graph, the input text is corrected and the corrected text data is output.
Citation Information
Patent Citations
Method and device for carrying out error correction on texts after speech recognition
CN107045496A
Automatic text proofreading system and method based on natural language processing
CN120337909A
Apparatus and method for correcting context-sensitive spelling errors using korean lexico-semantic network
KR1020150017507A