Multi-error aggregation type text correction method, device, storage medium and program product
By using a multi-error aggregation-based text correction method, structured text data is generated using a base model and a fine-tuning model. This solves the problems of error dispersion and boundary conflicts in text correction methods, achieves sentence-level error aggregation and efficient data organization, and improves user interaction efficiency and proofreading efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SICHUAN WISESOFT SYST INTEGRATION CO LTD
- Filing Date
- 2025-10-31
- Publication Date
- 2026-07-21
AI Technical Summary
Existing text correction methods suffer from problems such as scattered errors, boundary conflicts, loose data associations, and cumbersome user interactions in long texts and high-concurrency scenarios, resulting in low detection efficiency and low collaborative proofreading efficiency.
A multi-error aggregation text correction method is adopted. The text is preprocessed through a two-level architecture of basic model and fine-tuning model to generate structured text data. Through multi-dimensional matching and conflict handling, an aggregated error set is generated to solve the problems of error boundary conflicts and loose data association, thereby optimizing the user interaction process.
It achieves sentence-level error aggregation, reduces the user's judgment cost, optimizes data organization and output, and improves proofreading efficiency and practicality in long text and high-concurrency scenarios.
Smart Images

Figure CN121435964B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of natural language processing, and in particular to a multi-error aggregation-based text error correction method, device, storage medium and program product. Background Art
[0002] In natural language processing, the current text intelligent error correction systems mainly fall into two core technical paths. One is the traditional method based on rule base and dictionary matching, which realizes the rapid detection of known error types by presetting grammar rules (such as Chinese subject-predicate-object collocation rules, English tense change rules), typo mapping tables (such as the misuse comparison table of "de / di / 地", the differentiation table of similar Chinese characters like "辩 / 辨 / 辫"), punctuation usage norms (such as the differences between Chinese and English commas / periods, quotation mark nesting rules), etc. The advantage of this type of method is fast detection speed and low misjudgment rate, but it cannot cover complex errors outside the rule base (such as semantic logic contradictions, misuse of professional terms). The other is the deep learning method based on pre-trained large language models (such as BERT (Bidirectional Encoder Representations from Transformers), GPT (Generative Pre-trained Transformer) series, ERNIE (Enhanced Representation through knowledge Integration), LLaMA (Large Language Model Meta AI) series, Qwen (Tongyi Qianwen) series), which establishes models through deep neural networks, multi-layer neural networks, convolutional neural networks, recurrent neural networks, etc. to learn the language rules in a large amount of corpus, and can detect logical errors that are difficult to cover by the rule base (such as the causal contradiction of "Because it rained today, so I wore a short-sleeved shirt"), unclear references (such as the ambiguous reference of "he" in "Xiaoming told Xiaohong that he would go to a meeting tomorrow"), semantic redundancy (such as "repetitive and redundant expressions"), professional term errors (such as the confusion between "earnest money" and "deposit" in the legal field, the misuse of "diagnosis" and "confirmation of diagnosis" in the medical field), etc. complex errors. The advantage of this type of method is a wide error coverage range, but there are problems such as scattered output results and boundary conflicts.
[0003] However, in actual industrial applications, both of the above two types of methods have the common problems of "scattered errors" and "low efficiency in processing", which can be specifically refined into the following 4 points.
[0004] 1. Fragmentation of error results: When there are multiple errors in the same sentence or the same semantic unit (such as containing misspelled words like "deafeningly loud", logical loopholes like "wearing short sleeves in winter is very warm", and punctuation errors like "I like apples, bananas and oranges."), the current system usually returns results independently according to the error type (such as first outputting misspelled words and then logical errors) or the detection order. As a result, the errors in the same text segment are scattered in different output entries, and users need to repeatedly locate the context (such as jumping back and forth 5 times in a 1000-word document to view 3 errors in the same sentence), and cannot grasp the全貌 of the errors at one time.
[0005] 2. Overlap and conflict of error boundaries: "Error inclusion" and "error intersection" may occur in the detection of large models: Error inclusion and error intersection. Error inclusion: For example, the original text of a certain error record is a complete sentence ("The reason he gouged out the victim's eyes may be due to the frustration of physical incompetence or perhaps due to some superstition."), and the original text of another error record is the first half of this sentence ("The reason he gouged out the victim's eyes,"). Error intersection: For example, one error record targets "running" in the sentence "Xiaoming is running in the park and Xiaohong is reading in the library" (suggested to be changed to "jogging"), and another error record targets "park running, Xiaohong" (suggested to add "when", changed to "When Xiaoming is running in the park, Xiaohong"). Both situations are likely to lead to conflicts in the correction suggestions (such as the former suggesting to add "concept" and the latter suggesting to change "eyes" to "both eyes"), and repeatedly covering the same text area, increasing the complexity of user judgment and modification;
[0006] 3. Imbalance in the granularity of data organization: Currently, the system mostly organizes data with "error entries" as the smallest unit (such as outputting 10 independent error records without associated identifiers), lacking an aggregation logic centered on "sentences" or "paragraphs". As a result, for subsequent batch corrections (such as modifying all punctuation errors in a certain paragraph at once), error statistics (such as the proportion of "grammar errors" in an academic paper is 30% and the proportion of "professional term errors" is 20%), and visual display (such as a text error heat map, a pie chart of error type distribution), it is necessary to additionally associate data through text matching and position calculation, increasing the system's computing power consumption (such as an additional 20% computing power is consumed for data association when processing a 10,000-word document), and reducing the processing efficiency;
[0007] 4. High user interaction costs: When reviewing long texts (such as contracts of 10,000 words or academic papers of 50,000 words), users need to repeatedly switch between different text positions corresponding to different error entries in the interface (such as jumping from page 10 to page 5 to view another error in the same sentence), and cannot view all errors and correction suggestions for a sentence at once. Especially in multi-person collaborative proofreading scenarios (such as an editorial team jointly proofreading a book manuscript), due to the lack of error association indicators, duplicate modifications are prone to occur (such as user A modifying "eyes" → "both eyes", and user B modifying the same position again) or missed modifications (such as only handling logical errors and not finding punctuation errors in the same sentence), resulting in low collaboration efficiency.
[0008] Therefore, there is an urgent need for a text correction method that balances "error detection accuracy" and "error aggregation efficiency." By optimizing the data processing flow and aggregation logic, it can solve problems such as error boundary conflicts, loose data associations, and cumbersome user interactions, thereby improving its practicality and industrial adaptability in long text and high-concurrency scenarios. Summary of the Invention
[0009] This invention addresses the technical problems of scattered errors and inefficient processing in current text correction methods by providing a multi-error aggregation text correction method, device, storage medium, and program product. It solves problems such as conflicting error boundaries, loose data association, and cumbersome user interaction, and improves the practicality and industrial adaptability in long text and high-concurrency scenarios.
[0010] This invention is achieved through the following technical solution:
[0011] In a first aspect, the present invention provides a multi-error aggregation-based text correction method, the method comprising: preprocessing input text to obtain structured text data of the input text, wherein the structured text data includes: document identifier ID, paragraph ID, sentence ID, character index in the sentence, and cross-sentence semantic association marker; processing the structured text data using a two-level architecture model of a base model + a fine-tuning model to output standardized error entries; performing multi-dimensional matching and conflict handling on the standardized error entries to generate an aggregated error set; and generating a four-level structured data organization of document-paragraph-sentence-error set based on the aggregated error set.
[0012] In some embodiments, multi-dimensional matching and conflict resolution are performed on the standardized error entries to generate an aggregated error set, including: grouping the standardized error entries according to the document ID, the paragraph ID, and the sentence ID in sequence, and sorting the error entries in each sentence in ascending order according to the character index in the sentence; for paragraphs with error entries, using the error position overlap degree based on the character index in the sentence to resolve error boundary overlap and / or conflict, so as to eliminate error boundary overlap and / or conflict; for each sentence with error entries, using a preset error type mapping table and text similarity matching to merge similar errors; and for each sentence with error entries, using the cross-sentence semantic association tag to eliminate cross-sentence logical errors.
[0013] In some embodiments, the method further includes: performing an aggregation quality check on the aggregated error set, wherein the aggregation quality check includes: an integrity check, wherein the aggregated error set includes at least: an error type, an index of the starting position of the error in the original sentence, and a suggested correction text; a consistency check, wherein the sentence ID and paragraph ID of the standardized error entry are consistent with the sentence ID and paragraph ID in the aggregated error set; and a reasonableness check, including text length reasonableness and semantic reasonableness, wherein the text length reasonableness includes the length difference between the corrected text and the original error text being less than or equal to a first preset value, and the semantic reasonableness includes the semantic similarity between the corrected text and the original error text being greater than or equal to a second preset value.
[0014] In some embodiments, for paragraphs with error entries, error boundary overlap and / or conflict resolution is performed based on the character's index in the sentence, using error position overlap to eliminate error boundary overlap and / or conflict. This includes: calculating error position overlap based on the overlap range of the position indices of any two error entries in the same sentence, wherein the position index is determined based on the character's index in the sentence; classifying the standard error entries into a first overlap category, a second overlap category, and a third overlap category based on the value of the error position overlap; wherein, for the first overlap category, the error position overlap value is greater than or equal to a first threshold, and error boundary overlap and / or conflict resolution is performed based on error entry confidence and compatibility; for the second overlap category, the error position overlap value is greater than or equal to a second threshold and less than the first threshold, an associated error ID field is added and the association relationship is indicated in the error reason description, and it is determined whether to eliminate error boundary overlap and / or conflict when resolving error boundary overlap and / or conflict for the associated error ID; and for the third overlap category, the error position overlap value is less than the second threshold, and error boundary overlap and / or conflict resolution is not performed.
[0015] In some embodiments, the value of the overlap of the first overlap classification corresponding to the error location is greater than or equal to a first threshold. Based on the confidence and compatibility of the error entries, error boundary overlap and / or conflict resolution are performed, including: when the confidence of the error entry is greater than or equal to a third threshold, retaining error entries with high confidence and deleting error entries with low confidence; or when the confidence of the error entry is less than the third threshold and the correction suggestions of the error entries are applied to the original text simultaneously without grammatical contradictions, merging them into one error entry, or marking them as conflicting errors and prioritizing the display of suggestions with high confidence.
[0016] In some embodiments, for each sentence with error entries, a preset error type mapping table and text similarity matching are used to merge errors of the same type, including: a preset error type hierarchy mapping table, and clarifying the attribution relationship between sub-types and core types; determining error entries with different error types in the same sentence but with original document similarity greater than or equal to the fourth threshold, and with the same starting position index or ending position index of the error in the original sentence, as multiple types of the same error; and merging error entries that meet the multiple types of the same error into one error entry, and labeling the error type field as the core type containing sub-types.
[0017] In some embodiments, for each sentence with erroneous entries, the cross-sentence semantic association marker is used to eliminate cross-sentence logical errors, including: adding a cross-sentence error field at the paragraph level and recording cross-sentence error association information; and adding a cross-related marker in the error field of the associated sentence to prompt for viewing cross-sentence errors and eliminating cross-sentence logical errors.
[0018] In a second aspect, the present invention provides a multi-error aggregation text correction device, the device comprising: at least one processor; and at least one memory coupled to the at least one processor and storing instructions for execution by the at least one processor, the instructions implementing the method described above when executed by the at least one processor.
[0019] Thirdly, the present invention provides a computer-readable storage medium storing instructions that, when executed by a computer, cause the computer to perform the methods described above.
[0020] Fourthly, the present invention provides a computer program product, the computer program product including instructions, which, when executed by a computer, cause the computer to perform the methods described above.
[0021] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0022] 1. Implemented sentence-level error aggregation: It links multiple errors (of different types and locations) within the same text sentence (or semantic unit) to form a structured "sentence-error set" mapping relationship, avoiding error fragmentation and allowing users to view all errors in the same sentence at once;
[0023] 2. Resolved error boundary overlap and conflict: By calibrating error locations, matching original text, and judging the compatibility of correction suggestions, duplicate or conflicting error entries are filtered and merged to ensure the accuracy and uniqueness of error information and reduce the user's judgment cost;
[0024] 3. Optimized data organization and output: Data is organized in the hierarchy of "paragraph-sentence-error set", supporting multiple structured formats such as JSON, XML, and CSV. It is also compatible with the annotation output of common document formats (.docx, .pdf) (such as using different colors to mark the error location and correction suggestions in the original text), which facilitates subsequent batch processing, error statistics and visualization.
[0025] 4. Reduced user interaction costs: The interface centrally displays all errors and correction suggestions for a sentence (such as "typos + logical errors + correction solutions" displayed on the same line), and supports functions such as "one-click batch adoption (same sentence / same paragraph / full text)", "error type filtering (only view errors in technical terms)" and "error priority sorting (high confidence errors are displayed first)", which improves proofreading efficiency and adapts to multi-person collaboration scenarios (such as marking "processed / pending confirmation" status to avoid repetitive operations). Attached Figure Description
[0026] To more clearly illustrate the technical solutions of the exemplary embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly described below. It should be understood that the following drawings only show some embodiments of the present invention and should not be considered as limiting the scope. For those skilled in the art, other related drawings can be obtained from these drawings without creative effort.
[0027] Figure 1 This is a flowchart of a multi-error aggregation text correction method according to an embodiment of the present invention.
[0028] Figure 2 This is a flowchart illustrating the generation of an aggregated error set according to an embodiment of the present invention.
[0029] Figure 3 This is a structural block diagram of a multi-error aggregation text correction device according to an embodiment of the present invention.
[0030] Figure 4This is a schematic diagram of the structure of a multi-error aggregation text correction device according to an embodiment of the present invention. Detailed Implementation
[0031] To make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the embodiments and accompanying drawings. The illustrative embodiments and descriptions of the present invention are only used to explain the present invention and are not intended to limit the present invention.
[0032] On the one hand, the present invention provides a multi-error aggregation text correction method. Figure 1 This is a flowchart of a multi-error aggregation text correction method according to an embodiment of the present invention. (Reference) Figure 1 The multi-error aggregation text correction method includes: S10 to S40.
[0033] In S10, the input text is preprocessed to obtain structured text data. The structured text data includes: document identifier (ID), paragraph ID, sentence ID, character index in the sentence, and cross-sentence semantic association tags.
[0034] In S20, a two-level architecture model of "base model + fine-tuning model" is used to process structured text data to output standardized error entries.
[0035] In S30, standardized error entries are matched and conflict-handled in multiple dimensions to generate an aggregated error set.
[0036] In S40, data is organized into a four-level structure of document-paragraph-sentence-error set based on the aggregated error set.
[0037] The following describes S10 to S40 in detail with reference to the accompanying drawings.
[0038] In S10, the input text is preprocessed, which transforms the input text into traceable and associative structured data, laying the foundation for subsequent error aggregation. This mainly includes the following three processes: input text parsing and format adaptation, text hierarchy division and unique identifier allocation, and semantic unit association tagging.
[0039] 11. Input text parsing and format adaptation
[0040] Multi-format reception and parsing: Supports plain text (.txt (Text File)), rich text (.docx (Document Office Open Extensible Markup Language), .md (Markdown), .html (HyperText Markup Language), PDF (Portable Document Format) scans (first converted to editable text by OCR (Optical Character Recognition) tools (such as Tesseract, Baidu OCR), preserving paragraph separators), and table-embedded text (.xlsx (ExcelOpen XML Workbook), .csv (Comma-Separated Values), preserving cell coordinates when extracting text within cells, such as "Sheet1_A1"). During parsing, the original formatting information of the text (such as paragraph separators, line breaks, heading levels (H1 / H2), font styles (bold / italic), and table structure) is preserved through "format metadata preservation" technology, avoiding subsequent error detection deviations due to format loss (such as mistakenly treating line breaks within a table as paragraph separators).
[0041] Special characters and encoding processing: Special characters in the text (such as Chinese full-width quotation marks "", English half-width quotation marks '', parentheses (), emoticons, special punctuation marks "-" "...") are escaped (e.g., Chinese full-width quotation marks are converted to JSON (JavaScript Object Notation) compatible "\u201C" "\u201D"). Garbled text (such as UTF-8 (Unicode Transformation Format-8) and GBK (National Standard Extension) encoding confusion) is automatically encoded, identified, and converted (based on the chardet library to determine the encoding format and convert to UTF-8 standard encoding) to avoid text truncation anomalies or model input errors during subsequent error detection.
[0042] Document unique identifier assignment: Assign a unique document ID (using UUID (Universalunique Identifier) v4 format, such as "DOC_1958424865693421568") to the entire input document for differentiation and association during subsequent batch processing of multiple documents.
[0043] 12. Text hierarchy division and unique identifier allocation
[0044] Paragraph segmentation: Accurate paragraph segmentation based on "format tags + semantic judgment" - First, paragraphs are initially segmented using original format tags (such as paragraph tags in .docx and line breaks in .md). Then, a pre-trained language model (such as BERT-Chinese) is used to determine whether adjacent text blocks are the same semantic paragraph (such as "Chapter 1 Introduction" and the subsequent main text are different paragraphs, "In summary" and the preceding text are the same paragraph), avoiding paragraph segmentation errors caused by non-standard format (such as long text without line breaks). Each paragraph is assigned a unique paragraph ID (format is "document ID_P paragraph number", such as "DOC_1958424865693421568_P3", which indicates the 3rd paragraph of the document).
[0045] Sentence segmentation: A sentence segmentation strategy combining "rule-based filtering + large-scale model semantic judgment" is adopted to overcome the limitations of traditional punctuation-based sentence segmentation.
[0046] Rule filtering: First, exclude special punctuation marks (such as the decimal point "3.14", the English abbreviations "Mr. Wang" and "USA", and the file name "report_v1.2.pdf"). Then, identify and mark non-sentence-ending punctuation marks through a preset rule library (containing a list of common abbreviations and number format rules) to avoid missegmentation of sentences.
[0047] Semantic Judgment: Through semantic recognition and grammatical analysis, the pre-trained language model (such as Llama 3 8B-Chinese, Qwen 7B) is used to determine whether the text fragments filtered by the rules are complete semantic sentences. Input text fragments (such as "He is happy. Because it rained today.") are used, and the model outputs the judgment result of "whether it is an independent sentence" (such as outputting "No, it should be the same semantic unit") to ensure the accuracy of sentence segmentation.
[0048] Sentence unique identifier and position recording: Each sentence is assigned a unique sentence ID (formatted as "paragraph ID_sentence number", such as "DOC_1958424865693421568_P3_S2", representing the second sentence of the third paragraph of the document); Simultaneously, dual position information for each sentence is recorded:
[0049] Relative position: The starting and ending character indices of the sentence within its paragraph (counting from 0; for example, if the paragraph length is 100 characters and the sentence is between characters 20 and 50, then the relative starting index = 20 and the relative ending index = 50).
[0050] Absolute position: The starting and ending character indices of the sentence within the entire document (e.g., if the total document length is 1000 characters and the sentence is located between characters 220 and 250, then the absolute starting index = 220 and the absolute ending index = 250), which facilitates quick location of the text position later.
[0051] 13. Semantic unit association marking
[0052] Short sentence merging judgment: For overly short sentences caused by improper punctuation usage (such as "He is very happy. Because it rained today." "I like to eat fruits. Such as apples and bananas."), after the model identifies the semantics as the same semantic unit through semantic segmentation and semantic analysis, it is marked as a "sentence to be merged" and an associated ID is assigned to it (in the format of "sentence ID - association sequence number", such as "DOC_1958424865693421568_P3_S2-1", "DOC_1958424865693421568_P3_S2-2"). When aggregating errors later, one can choose to "aggregate by original clauses" or "aggregate by semantic units" (users can switch the mode in the system settings).
[0053] Cross-sentence semantic association marking: For adjacent sentences with logical associations (such as "Xiaoming bought a book. It tells an adventure story." where "it" refers to "book"), the association relationship is identified through a coreference resolution model (such as a coreference resolution model based on BERT), and the associated sentence ID is marked (such as adding "related_sentence_id": "DOC_1958424865693421568_P3_S2" to the metadata of the second sentence), providing an association basis for subsequent cross-sentence logical error detection (such as unclear reference).
[0054] In S20, errors are detected through a large model and the output results are standardized to provide a unified data format for subsequent aggregation, specifically including: large model selection and configuration, error information calibration, and dynamic update of the error library.
[0055] 21. Large model selection and configuration
[0056] Core detection model: Adopt a two-level architecture of "base model + fine-tuning model". The base model selects open-source large language models (such as Llama 3 70B, Qwen 14B) or closed-source APIs (such as GPT-4, Wenxin Yiyan) and is responsible for initially detecting basic types of errors such as typos, grammar errors, and punctuation errors through character recognition. The fine-tuning model is fine-tuned based on industry-specific corpora (such as legal document corpora, educational composition corpora) to improve the detection accuracy of complex errors such as logical errors, professional term errors (such as "earnest money" and "deposit" in law), and semantic redundancy.
[0057] Definition of model output format: Force the model to output standardized error entries, and each entry must contain the following fields (missing fields need to be marked as "NULL"), as shown in Table 1.
[0058] Table 1
[0059]
[0060] Model parameter optimization: For long text detection scenarios, the "sliding window + context association" parameters are set - the sliding window length is set to 512 / 1024 characters (adjustable according to text length), and the window overlap rate is set to 20% to ensure that long sentences are not truncated. Simultaneously, the sentences before and after the current sentence are input into the model as context to avoid missed detections due to missing context (e.g., in "Xiaoming bought an umbrella. He didn't bring it.", the missing logic "he didn't bring it" needs to be considered in conjunction with the preceding sentence).
[0061] 22. Error message calibration
[0062] Position index calibration: If the model outputs "error_start_idx" and "error_end_idx" which exceed the character length range of the corresponding sentence (e.g., if the sentence length is 30, the model outputs end_idx=35), the index will be automatically corrected to the maximum index (e.g., 30) based on the sentence length. If an abnormal situation occurs where "start_idx > end_idx", it will be directly marked as "position abnormal error" and a re-detection will be triggered.
[0063] Original text matching: The original text is matched with the original sentence corresponding to the sentence ID (the similarity is calculated using the edit distance algorithm, supplemented by N-gram (N=3) semantic matching). If the matching degree is less than 80% (such as the model mistakenly taking the text of other sentences "The weather is very nice today" as the current sentence "He is reading a book"), the error entry is marked as "suspicious error", stored in the "error database to be reviewed", and the manual review process is triggered.
[0064] Confidence filtering: Set dynamic confidence thresholds - the threshold for basic error types (typos, punctuation errors) is set to 0.5, and the threshold for complex error types (logic errors, technical terminology errors) is set to 0.6 (users can customize and adjust according to the scenario); error entries below the threshold will not enter the aggregation process for the time being, but will only be stored in the "errors to be confirmed" library, and will be verified through "batch re-detection" (calling a higher precision model such as GPT-4) after a certain number have been accumulated.
[0065] Error type normalization: For fuzzy error types in the model output (such as "grammar problem" or "sentence structure error"), the error type is normalized to a preset enumeration value (such as uniformly mapping to "grammar error") through an "error type mapping table". The mapping is shown in Table 2 below.
[0066] Table 2
[0067]
[0068] 23. Error database is dynamically updated.
[0069] Add new error types to the database: Detected error types that are not yet included (such as the misuse of new industry terms "blockchain smart contract" → "blockchain smart contract") will be automatically marked as "errors to be classified". After manual confirmation, they will be added to the "error type enumeration library" and the training corpus of the fine-tuning model will be updated.
[0070] Improvement suggestions: Improvement suggestions with a user adoption rate of less than 30% (such as the model suggestion "Xiaoming goes to school → Xiaoming goes to school", which is generally not adopted by users) are marked as "low-fit suggestions". After analyzing the reasons, the model Prompt is adjusted (such as adding the constraint of "maintain the original sentence style") to improve the practicality of the suggestions.
[0071] In S30, multi-dimensional matching and conflict handling are used to achieve accurate aggregation of errors within the same sentence. Figure 2 A flowchart illustrating the generation of an aggregated error set according to an embodiment of the present invention. (See reference...) Figure 2 This generates an aggregated error set, including S31 to S34.
[0072] In S31, standardized error entries are grouped by document ID, paragraph ID, and sentence ID in that order. For each sentence, error entries are sorted in ascending order by the character index in the sentence, i.e., grouped by sentence ID, to achieve basic aggregation.
[0073] Using "sentence_id" as the key, error entries in S20, filtered by confidence level, are grouped to form an initial mapping of "sentence ID - error list," initially addressing the "error dispersion" problem. For example, the error list corresponding to sentence_id="P1958424865693421568_S2" contains two entries (error IDs 1958426829432999940 and 1958426441539571716). The grouped sentences are then preprocessed: the error list for each sentence is first sorted in ascending order by "error_start_idx" to facilitate subsequent judgment of overlapping positions.
[0074] In S32, for paragraphs with erroneous entries, error boundary overlap and / or conflict resolution is performed based on the character's index in the sentence, using error position overlap to eliminate error boundary overlap and / or conflict.
[0075] Error boundary overlap and / or conflict resolution addresses the issue of "the same text fragment being covered by multiple error entries" by using "position overlap judgment + correction suggestion compatibility analysis".
[0076] In some embodiments, for the "error inclusion" case (E1 original text is a complete sentence, E2 original text is the first half of the sentence):
[0077] Step A: Calculate the error position overlap based on the overlap range of the position indices of any two error entries within the same sentence. The position index is determined based on the character's index within the sentence. For any two error entries (E1, E2) within the same sentence, calculate the overlap range of their position indices:
[0078] Overlap range = max(0, min(E1.error_end_idx, E2.error_end_idx) - max(E1.error_start_idx, E2.error_start_idx) + 1);
[0079] Error length: E1_length = E1.error_end_idx - E1.error_start_idx + 1; E2_length = E2.error_end_idx - E2.error_start_idx + 1;
[0080] Overlap = Overlap range / max(E1_length, E2_length) (the result is rounded to 2 decimal places).
[0081] Step B: Based on the value of the overlap of the error locations, classify the error entries into the first overlap category, the second overlap category, and the third overlap category.
[0082] First overlap category: overlap ≥ 70% (first threshold, high overlap), judged as "repetition or conflict error", further judged by "confidence + suggestion compatibility" double judgment.
[0083] If the confidence difference is ≥0.2, retain the erroneous entries with high confidence (e.g., E1 has a confidence of 0.92, E2 has a confidence of 0.68, retain E1), delete the entries with low confidence, and record the "reason for deletion" in the log.
[0084] If the confidence difference is <0.2, analyze the compatibility of the correction suggestions – judged through “text replacement simulation”. If the correction suggestions of E1 and E2 are applied to the original text simultaneously without grammatical contradiction (e.g., E1 suggests “supplement 'concept'”, E2 suggests “'superstition' → 'superstitious thought'”, the sum of which is “a certain superstitious thought concept”, which is redundant and judged as a conflict), then:
[0085] Compatibility suggestions: merge into a single error entry, with the "correction_text" field separating multiple suggestions using "|" (e.g., "supplement 'concept'|'superstition'→'superstitious thought'"), and the "error_type" field marked "multi-type associated error";
[0086] Conflict suggestions: Mark them as "conflict errors", and explain the conflict point in "error_reason" (e.g., "E1 suggests removing the comma, E2 suggests keeping the comma, manual confirmation required"), and prioritize the suggestions with higher confidence.
[0087] The second overlap category: overlap of 30%-70% (second threshold, partial overlap) is judged as "related error". Add a "related_error_ids" field to the error entry (e.g., the value of this field for E1 is [E2.error_id]), and indicate the relationship in "error_reason" (e.g., "E1 and E2 have partial positional overlap. It is recommended to process E1 ('eye' → 'both eyes') first, and then verify whether E2 (supplementing 'concept') still needs to be corrected").
[0088] Third overlap category: overlap <30% (no overlap), directly retained as an independent error entry, sorted only by "error_start_idx".
[0089] E1: error_start_idx=0, error_end_idx=45 (Original text "He gouged out the victim's eyes, possibly out of frustration with his physical incompetence or out of some kind of superstition"), correction_text="Add 'concept'", confidence_score=0.92.
[0090] E2: error_start_idx=0, error_end_idx=15 (original text "He gouged out the victim's eyes,"), correction_text="'eyes' → 'both eyes'", confidence_score=0.88.
[0091] Overlap range = min(45,15) - max(0,0) +1 = 16; max(E1_length=46, E2_length=16) = 46; overlap = 16 / 46 ≈ 34.8% (partial overlap).
[0092] Compatibility analysis: The correction positions for E1 are 20-24 and for E2 are 10-11. There is no overlap. The superimposed text is "He may have gouged out the victim's eyes out of frustration due to his physical incompetence, or he may have done so out of some superstitious belief." There is no grammatical contradiction.
[0093] Processing result: The two error entries E1 and E2 are retained. The related_error_ids of E1 is [1958426441539571716] and the related_error_ids of E2 is [1958426829432999940]. The message "Correct E2 first and then verify E1" is displayed.
[0094] In S33, for each sentence with error entries, a pre-defined error type mapping table and text similarity matching are used to merge errors of the same type. Error type (duplicate matching) merging addresses the problem of "the same error being detected as different types multiple times" (such as "semantic redundancy" and "logical repetition" being essentially the same error), by merging errors of the same type through "error type mapping table + text similarity matching".
[0095] Step A: Pre-set an "Error Type Hierarchy Mapping Table" to clarify the relationship between sub-types and core types, as shown in Table 3 below.
[0096] Table 3
[0097]
[0098] Step B: Text similarity matching - For error entries within the same sentence that have different error types but a "original_text" similarity ≥ 90% (calculated using cosine similarity, based on BERT semantic vectors) and completely identical "error_start_idx / error_end_idx", they are determined to be "multi-type annotation of the same error".
[0099] Step C: Merge Processing - Merge the above entries into one error entry, label the "error_type" field as "core type (including sub-types)" (e.g., "redundant error (semantic redundancy / logical duplication)"), take the average value for "confidence_score", and retain all non-conflicting suggestions for "correction_text".
[0100] In S34, for each sentence with erroneous entries, cross-sentence semantic association markers are used to eliminate cross-sentence logical errors. Cross-sentence association error markers target the "cross-sentence semantic associations" marked in S31 (e.g., in "Xiaoming bought a book. It's very interesting.", "it" refers to "book"). If a cross-sentence logical error is detected (e.g., in "Xiaoming bought a book. He's very interesting.", "he" is incorrectly referred to), then:
[0101] Step A: Add a "cross_sentence_errors" field at the paragraph level to record cross-sentence error association information, as shown below:
[0102] "cross_sentence_errors": [ { "cross_error_id": "C1958426829432999940", "related_sentence_ids": ["P1958424865693421568_S2", "P1958424865693421568_S3"], "error_type": "Pronoun reference error", "error_reason": "In S3, 'he' should refer to 'book', and is mistakenly used as a personal pronoun, and should be changed to 'it'", "correction_suggestion": "S3: 'He is interesting' → 'It is interesting'"}]
[0103] Step B: Add a "cross_related" tag to the "error_collection" of the related sentences to prompt the user to view cross-sentence errors.
[0104] In some embodiments, the multi-error aggregation text correction method further includes: performing aggregation quality verification on the aggregated error set. Aggregation quality verification includes: integrity (Level 1) verification, consistency (Level 2) verification, and (Level 3) reasonableness verification.
[0105] Level 1 Validation (Integrity Validation): Each aggregated error set must contain at least three core fields: “error_type”, “error_start_idx”, and “correction_text”. If any field is missing, it is marked as an “incomplete error set” and returned to S20 for re-examination.
[0106] Second-level verification (consistency verification): The "sentence_id" and "paragraph_id" of the erroneous entries must be completely consistent with the ID of the aggregation level (e.g., the erroneous entry of sentence S2 cannot contain the ID of paragraph P3). If they are inconsistent, they are marked as "ID association error" and the process returns to step 1 to reassign IDs.
[0107] Level 3 validation (reasonableness validation): includes validation of the length of the proposed correction and validation of semantic consistency.
[0108] Correction suggestion length reasonableness check: The length difference between the corrected text and the original error text must be ≤50% (e.g., if the original text is 5 characters, the corrected text should not exceed 7.5 characters and should not be less than 2.5 characters). If it exceeds this, it will be marked as "over-modified / under-modified" and return to S20 to regenerate the suggestion.
[0109] Semantic consistency and rationality verification: The semantic similarity between the original text and the proposed correction is calculated using a pre-trained model (such as BERT-Chinese). If the similarity is less than 0.7, it is marked as "semantic deviation" (e.g., the original text is "Xiaoming eats", and the suggestion is "Xiaoming sleeps"), and the process is returned to S20 for re-detection.
[0110] In S40, the aggregated error data is organized into a four-level structure of document-paragraph-sentence-error set according to user scenario requirements, supporting various formats such as structured data, annotated documents, and visual reports.
[0111] 41. The hierarchical data structure definition uses a four-level structure of "document-paragraph-sentence-error set" to organize the data, ensuring clear data relationships. A complete JSON example is as follows:
[0112] { "document_info": { "document_id": "DOC1958424865693421568", "document_name": "Legal Case Analysis Report.docx", "input_format": "docx", "process_time": "2024-05-20 14:30:25", "total_error_count": 5, "error_type_distribution": { "Logical error": 2, "Word error": 1, "Punctuation error": 1, "Cross-sentence reference error": 1}}, "paragraphs": [ { "paragraph_id": "P1958424865693421568_1", "paragraph_content": "He gouged out the victim's eyes, possibly out of frustration at his physical inability, or perhaps out of some kind of superstition. Subsequent investigations showed that the suspect had mentioned related content "in the legend of XX", but did not specify a specific reference.", "paragraph_start_idx": 0, "paragraph_end_idx": 128, "cross_sentence_errors": [ { "cross_error_id": "C1958426829432999940", "related_sentence_ids": ["P1958424865693421568_1_S1", "P1958424865693421568_1_S2"], "error_type": "Logical connection missing", "error_reason": "S1 'a certain superstition' and S2 'in the legend of XX' are not clearly related and need to be supplemented with connecting statements", "correction_suggestion": "Add 'This superstition is related to the legend of XX' to the end of S1"} ], "sentences": [ { "sentence_id": "P1958424865693421568_1_S1", "sentence_content": "His decision to gouge out the victim's eyes may have stemmed from frustration at his physical inability, or it may have been due to some kind of superstition." "sentence_start_idx": 0, "sentence_end_idx": 46, "error_collection": { "total_error_count": 2,"errors": [ { "error_id": "ERR1958426829432999940", "error_type": "Logical error", "error_subtype": "Semantic missing", "original_text": "Possibly due to frustration from physical incompetence, or possibly due to some kind of superstition", "error_start_idx": 20, "error_end_idx": 34, "correction_text": "Possibly due to frustration from physical incompetence, or possibly due to some kind of superstition (related to the legend of XX)", "confidence_score": 0.92, "error_reason": "'Some kind of superstition' and the following 'the legend of XX' are not clearly connected; the content in parentheses is added to enhance the logical connection", "process_status": "UNTREATED", "related_error_ids": ["ERR1958426441539571716"], "cross_related": true}, { "error_id": "ERR1958426441539571716", "error_type": "Word usage error (original punctuation error correction)", "error_subtype": "Inappropriate noun collocation", "original_text": "The reason he gouged out the victim's eyes,", "error_start_idx": 10, "error_end_idx": 12, "correction_text": "The reason he gouged out the victim's eyes,", "confidence_score": 0.88, "error_reason": "“eyes” is imprecise in legal documents; “both eyes” better meets the requirements of rigorous case description", "process_status": "UNTREATED", "related_error_ids": ["ERR1958426829432999940"], "cross_related": false} ]}}, { "sentence_id": "P1958424865693421568_1_S2", "sentence_content": "Subsequent investigation revealed that the suspect mentioned something related to 'the legend of XX,' but did not specify what it referred to." "sentence_start_idx": 47, "sentence_end_idx": 128,"error_collection": { "total_error_count":1, "errors": [ { "error_id": "ERR1958426441539571718", "error_type": "Punctuation error", "error_subtype": "Incorrect use of quotation marks", "original_text": "References to 'The Legend of XX'", "error_start_idx": 15, "error_end_idx": 23, "correction_text": "References to 'The Legend of XX'", "confidence_score": 0.95, "error_reason": "'The Legend of XX' should be the title of a book / document, and the quotation marks '" should be replaced with book title marks 《》", "process_status": "UNTREATED", "related_error_ids": [], "cross_related": true} ]}} ]} ]},
[0113] 42. Multi-format output adaptation: For different application scenarios, the following three output formats are provided to meet the needs of industrial use.
[0114] (1) Structured data format (for system integration)
[0115] JSON: Suitable for API calls and backend data storage, and supports batch import into other systems (such as OA office systems).
[0116] XML: Suitable for scenarios requiring strict hierarchical validation (such as government document systems). Example snippet:
[0117] <document id="DOC1958424865693421568" name="法律案例分析报告.docx"> <paragraph id="P1958424865693421568_1"> <sentence id="P1958424865693421568_1_S1"> <error id="ERR1958426829432999940" type="逻辑错误"><original_text> It could be due to frustration from physical inadequacy, or it could be due to some kind of superstition.< / original_text><correction_text> It could be due to frustration from physical inadequacy, or it could be due to some kind of superstition (related to XX legend).< / correction_text>< / error> < / sentence> < / paragraph> < / document>
[0118] CSV: Suitable for error statistics analysis (such as Excel import), with fields including "document_id, paragraph_id, sentence_id, error_id, error_type, correction_text";
[0119] (2) Annotated document format (for manual proofreading)
[0120] DOCX / PDF annotation: Mark error locations in the original document with colors (e.g., logical errors in red, punctuation errors in blue), and display "Error Type + Correction Suggestion + Error Reason" when the mouse hovers over them. Example:
[0121] Original text: "He may have gouged out the victim's eyes out of frustration with his physical incompetence, or he may have done so out of some kind of superstition."
[0122] After annotation: "The reason he gouged out the victim's eyes (incorrect wording: suggested to be "both eyes") may have been due to frustration from physical incompetence, or it may have been due to some kind of superstition (logical error: suggested to add "(related to XX legend)")";
[0123] Plain text annotation: Mark errors with special symbols (e.g., "[Error Type] Original Content → Corrected Content"), suitable for scenarios without format requirements. Example: "The reason he gouged out the victim's [Word Error] Eyes → Both Eyes may be due to frustration from physical incompetence, or it may be due to some [Logical Error] Superstition → Superstition (related to XX legend)";
[0124] (3) Visualized report format (for management decision-making)
[0125] Error type distribution pie chart: showing the percentage of each error type (e.g., logical errors 40%, word usage errors 20%).
[0126] Paragraph error heatmap: The density of errors in a paragraph is represented by the color depth (e.g., paragraph 1 with many errors is marked in dark red, while paragraph 5 with no errors is marked in white).
[0127] Error handling progress chart: Displays the number and percentage of errors that have been processed, are pending, or have been ignored, and supports filtering by time period.
[0128] 43. User interaction function adaptation output results support front-end interface interaction, reducing user operation costs. Core adaptation functions include:
[0129] (1) Error filtering and location
[0130] Filter by type: Users can select "View only logical errors" or "View only technical terminology errors", and the system will filter the error list in real time;
[0131] Location by position: Clicking on an error entry will automatically jump to the corresponding paragraph / sentence in the document and highlight the error text;
[0132] (2) Batch operations:
[0133] One-click adoption: Supports batch adoption of correction suggestions for "same sentence / same paragraph / full text", and automatically generates "editing log" (recording "editor, editing time, and editing content");
[0134] Batch Ignore: For misjudgments (such as the model mislabeling "legitimate rights" as an error), it supports batch marking as "IGNORED" and feeding back to the "Error Library Dynamic Update" module of S20;
[0135] (3) Collaborative proofreading and adaptation:
[0136] Access control: Supports multi-user collaboration and assigns permissions based on roles (e.g., "administrators" can modify error types, while "proofreaders" can only accept / ignore errors).
[0137] Status synchronization: User actions (such as incorrect adoption) are synchronized to the cloud in real time, and the latest "process_status" is displayed when other users view it, avoiding duplicate operations;
[0138] Comments and annotations: Users can add comments under erroneous entries (such as "suggest supplementing with legal provisions"). The comments are linked to the erroneous entries for other users to refer to.
[0139] In some embodiments, the multi-error aggregation text correction method further includes S50: continuously optimizing the error correction accuracy and aggregation effect through user feedback and data accumulation, forming a closed-loop iteration.
[0140] 51. User Feedback Collection and Analysis
[0141] Feedback entry point: Set up "Error Misjudgment Feedback" and "Suggestion Optimization Feedback" buttons on the front-end interface. After clicking, users can fill in the feedback content (such as "This error was misjudged" or "Suggestion to make it more concise").
[0142] Feedback analysis: The feedback data is categorized and statistically analyzed by "error type" and "model version". If it is found that "the misjudgment rate of legal terminology is as high as 30%", it is determined that the data of the fine-tuning model is insufficient, triggering the model to be retrained.
[0143] 2. Model and Rule Iteration
[0144] Model fine-tuning: For every 1,000 valid feedback data points accumulated, the professional error detection model is fine-tuned using new corpus (such as misjudged cases and highly adaptable correction suggestion cases) to improve accuracy for specific scenarios.
[0145] Rule updates: The "Error Type Mapping Table" and "Punctuation Usage Rule Base" are updated quarterly to incorporate new industry standards (such as the latest official document punctuation standards) and new language phenomena (such as standardized online terminology).
[0146] 3. Performance optimization
[0147] Detection speed optimization: For long documents (such as a 100,000-word paper), a "segmented parallel detection" strategy is adopted, which splits the document into multiple segments and inputs them into the model at the same time, reducing the detection time by more than 50%.
[0148] Storage optimization: Historical erroneous data is stored using "compressed storage + hot / cold separation" (recent data is stored hot for fast querying, while data older than 3 months is stored cold and compressed) to reduce storage costs.
[0149] This invention is applicable to scenarios with high requirements for error integrity and processing efficiency, such as intelligent proofreading of long texts (e.g., academic papers, news articles, book manuscripts), essay correction in educational settings (primary and secondary school essays, study abroad application documents), contract / document review in the legal and commercial fields (employment contracts, commercial agreements, prospectuses), and government document verification (notices, reports, policy documents). It is compatible with multiple languages including Chinese, English, Japanese, and Korean, and supports various input formats such as plain text (.txt), rich text (.docx, .md, .html), PDF scans (which must first be converted to editable text via OCR), and text embedded in tables (.xlsx, .csv). It is adaptable to multiple terminal usage scenarios, including PC, mobile, and cloud API calls, and can achieve the following technical effects:
[0150] 1. Implement sentence-level error aggregation: Group and associate multiple errors (of different types and locations) within the same text sentence (or semantic unit) to form a structured "sentence-error set" mapping relationship, avoiding error fragmentation and allowing users to view all errors in the same sentence at once;
[0151] 2. Resolve overlapping and conflicting error boundaries: By calibrating error locations, matching original text, and judging the compatibility of correction suggestions, duplicate or conflicting error entries are filtered and merged to ensure the accuracy and uniqueness of error information and reduce the user's judgment cost;
[0152] 3. Optimize data organization and output: Organize data in the hierarchy of "paragraph-sentence-error set", support multiple structured formats such as JSON, XML, and CSV, and be compatible with the annotation output of common document formats (.docx, .pdf) (such as using different colors to mark the error location and correction suggestions in the original text), which facilitates subsequent batch processing, error statistics and visualization.
[0153] 4. Reduce user interaction costs: The interface centrally displays all errors and correction suggestions for a sentence (such as "typos + logical errors + correction solutions" displayed on the same line). It supports functions such as "one-click batch adoption (same sentence / same paragraph / full text)", "error type filtering (only view errors in technical terms)" and "error priority sorting (high confidence errors are displayed first)", which improves proofreading efficiency and adapts to multi-person collaboration scenarios (such as marking "processed / pending confirmation" status to avoid repetitive operations).
[0154] On the other hand, the present invention provides a multi-error aggregation text correction device. Figure 3 This is a structural block diagram of a multi-error aggregation text correction device according to an embodiment of the present invention. (Reference) Figure 3The multi-error aggregation text correction device includes: a text preprocessing module, a multi-model error detection module, an error aggregation processing module, a result output module, and a dynamic optimization module.
[0155] The text preprocessing module is used to preprocess the input text to obtain structured text data, which includes: document ID, paragraph ID, sentence ID, character index in the sentence, and cross-sentence semantic association tags.
[0156] The multi-model error detection module is used to process structured text data using a two-level architecture model of "base model + fine-tuning model" to output standardized error entries.
[0157] The error aggregation processing module is used to perform multi-dimensional matching and conflict resolution on standardized error entries to generate an aggregated error set.
[0158] The results output module is used to generate data organized in a four-level structure of document-paragraph-sentence-error set based on the aggregated error set.
[0159] The dynamic optimization module is used to: collect user feedback, fine-tune the model, update rules, and optimize performance, forming an iterative closed loop.
[0160] In implementing the functions of the integrated modules described above in hardware, this embodiment of the invention provides a structure for the multi-error aggregation text correction device involved in the above embodiments. Figure 4 The diagram below illustrates the structure of a multi-error aggregation text correction device according to an embodiment of the present invention. The multi-error aggregation text correction device includes: at least one processor; and at least one memory, which is coupled to the at least one processor and stores instructions for execution by the at least one processor, which implement the above-described method when executed by the at least one processor.
[0161] The processor employs a multi-core CPU (Graphics Processing Unit) (such as an Intel Xeon Gold 6348) or GPU (such as an NVIDIA A100) to support parallel computing and meet the computational power requirements for large model detection and data aggregation. Memory includes RAM (such as 64GB DDR (Double Data Rate Synchronous dynamic random access memory)4) and ROM (Read-Only Memory) (such as a 2TB SSD (Solid State Drive)). RAM is used for temporary storage of processed data, while ROM stores model files, error libraries, and historical processing logs. Input / output interfaces support USB (Universal Serial Bus), network interfaces (Ethernet / Wi-Fi), and documentation.
[0162] In one implementation, the memory can exist independently of the processor. The memory can be connected to the processor via a bus and used to store instructions or program code. When the processor calls and executes the instructions or program code stored in the memory, it can implement the method provided in the embodiments of the present invention. In another implementation, the memory can also be integrated with the processor.
[0163] Some embodiments of the present invention provide a computer-readable storage medium (e.g., a non-transitory computer-readable storage medium) storing computer program instructions that, when executed on a computer, cause the computer to perform the method as described in any of the above embodiments.
[0164] For example, the aforementioned computer-readable storage media may include, but are not limited to: solid-state drives (SSDs), hard disk drives (HDDs), USB (Universal Serial Bus) disks, optical discs (CDs (Compact Discs) / DVDs (Digital Versatile Discs)), and cloud storage (such as AWS (Amazon Web Services) S3, Alibaba Cloud OSS (Object Storage Service)).
[0165] This invention provides a computer program that, when run on a computer, causes the computer to perform the methods of any of the above embodiments. The computer program supports operating systems such as Windows, Linux, and macOS, and can run on PCs, servers, and mobile devices (subject to lightweight model adaptation).
[0166] This invention provides a computer program product containing instructions that, when run on a computer, cause the computer to perform the method of any of the above embodiments.
[0167] 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 description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. 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.
Claims
1. A multi-error aggregation-based text correction method, characterized in that, The method includes: The input text is preprocessed to obtain structured text data of the input text, wherein the structured text data includes: document identifier ID, paragraph ID, sentence ID, character index in the sentence, and cross-sentence semantic association markers; The structured text data is processed using a two-level architecture model consisting of a base model and a fine-tuning model to output standardized error entries. The standardized error entries are subjected to multi-dimensional matching and conflict resolution to generate an aggregated error set; and Based on the aggregated error set, a four-level structured data organization of document-paragraph-sentence-error set is generated. The standardized error entries are subjected to multi-dimensional matching and conflict resolution to generate an aggregated error set, including: Based on the character position indices of any two error entries in the same sentence, the error position overlap is calculated, where the error position overlap = overlap range / max(first error length, second error length), and the overlap range = max(0, min(first error end index, second error end index) - max(first error start index, second error start index) + 1). When the overlap of the error locations is greater than or equal to the first threshold, the error entries are retained, deleted, or merged based on their confidence level. When the overlap of the error location is greater than or equal to the second threshold and less than the first threshold, an associated error ID field is added; When the overlap of the erroneous locations is less than the second threshold, the location is directly retained. Wherein, when the overlap of the error locations is greater than or equal to a first threshold, the process of retaining, deleting, or merging is performed based on the confidence level of the error entries, including: If the difference in confidence between a high-confidence error entry and a low-confidence error entry is greater than or equal to 0.2, then retain the high-confidence error entry and delete the low-confidence error entry. If the confidence difference is less than 0.2, it is determined whether there is a grammatical contradiction when applying the correction suggestions of multiple error entries to the original text at the same time: if there is no grammatical contradiction, they are merged into one error entry and the multiple correction suggestions are separated by a separator; if there is a grammatical contradiction, they are marked as conflicting errors and the correction suggestions with higher confidence are displayed first.
2. The method according to claim 1, characterized in that, The first threshold is 70%, and the second threshold is 30%.
3. The method according to claim 1, characterized in that, The multi-dimensional matching and conflict handling of the standardized error entries also includes: The standardized error entries are grouped according to the document identifier ID, the paragraph ID, and the sentence ID in that order, and the error entries in each sentence are sorted in ascending order according to the character index in the sentence. For each sentence with error entries, a pre-defined error type mapping table and text similarity matching are used to merge errors of the same type, including: A pre-defined error type hierarchy mapping table clarifies the relationship between sub-types and core types. Error entries within the same sentence that have different error types but a cosine similarity of ≥90% with the original text, and whose start or end position indices in the original sentence are the same, are classified as multiple types of the same error. Error entries that are identified as having the same error type and labeled with multiple types will be merged into one error entry, and the error type field will be labeled as a core type that includes sub-types; For each sentence with erroneous entries, the cross-sentence semantic association markers are used to eliminate cross-sentence logical errors, including: A new cross-sentence error field has been added at the paragraph level to record cross-sentence error association information. The association information includes cross-error ID, a list of associated sentence IDs, error type, error reason, and correction suggestions. Add a cross-related marker to the error set field of the related sentences to prompt you to view cross-sentence errors.
4. The method according to claim 1, characterized in that, The method further includes: performing an aggregation quality check on the aggregation error set, wherein the aggregation quality check includes: Integrity verification, wherein the aggregated error set includes at least: error type, the starting position index of the error in the original sentence, and correction suggestion text; A consistency check is performed, wherein the sentence ID and paragraph ID of the standardized error entry are consistent with the sentence ID and paragraph ID of the aggregated error set, respectively; and Reasonableness verification includes text length reasonableness and semantic reasonableness. The text length reasonableness includes the length difference between the corrected text and the original erroneous text being ≤ a first preset value, and the semantic reasonableness includes the semantic similarity between the corrected text and the original erroneous text being ≥ a second preset value.
5. A multi-error aggregation text correction device, characterized in that, The device includes: At least one processor; and At least one memory coupled to the at least one processor and storing instructions for execution by the at least one processor, the instructions implementing the method of any one of claims 1 to 4 when executed by the at least one processor.
6. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores instructions that, when executed by a computer, cause the computer to perform the method of any one of claims 1 to 4.
7. A computer program product, characterized in that, The computer program product includes instructions that, when executed by a computer, cause the computer to perform the method according to any one of claims 1 to 4.