A large language model text correction method, system, electronic device and storage medium based on double-role prompt word reverse verification
Patent Information
- Application Number
- CN202611178490.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-05
- Publication Date
- 2026-09-29
AI Technical Summary
本发明无需依托领域标注数据集、无需微调底层大语言模型基座,仅通过轻量化提示词架构改造,构建双向对立的双阶段校验机制,有效解决传统文本纠错漏报、误报无法兼顾的痛点,在小幅牺牲召回率的前提下大幅降低专业文本纠错误报率,实现高精度、可复现、低成本、通用化的专业文本智能纠错,满足医疗、法律、政务等高合规要求场景的自动化审核需求
本发明采用分阶段、可中断的推理调度机制:首先将待审专业文本输入加载有P1模板的大语言模型,执行第一阶段全量错误识别;若第一阶段输出无问题判定,则直接输出文本合规结果并终止推理流程,节约算力资源。若第一阶段输出包含预设问题前缀的疑似错误结果,则将原始待审文本与第一阶段推理结果共同输入加载有P2模板的大语言模型,执行第二阶段反向质疑与合规复核,得到二值化判定结果。本发明采用与逻辑完成最终纠错决策:仅当第一阶段检出疑似错误、且第二阶段复核判定错误真实成立时,输出文本错误告警;若第一阶段检出疑似错误但第二阶段判定为合规表达,则判定为大模型过度敏感导致的虚假误报并自动过滤该报错,实现精准纠错与误报过滤的双重效果。
Smart Images

Figure CN122838567A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of natural language processing and artificial intelligence technology, and specifically relates to a method, apparatus, electronic device and computer-readable storage medium for professional text error correction and false alarm filtering of large language models based on dual opposing role prompt words. Background Technology
[0002] With the rapid popularization of Large Language Model (LLM) technology, intelligent text correction in specialized fields, based on prompt word engineering, has become the mainstream technical solution for automated review of highly specialized texts such as medical reports, legal documents, and financial documents. Currently, several mature text correction technology systems have emerged in the industry; however, all existing solutions have inherent technical defects and cannot adapt to professional text review scenarios requiring high accuracy and low false positives. Specific existing technologies and their limitations are as follows: 1. Rule / dictionary-based error correction system These solutions primarily rely on regular expressions and fixed-domain dictionaries to match typos and grammatical errors in text, and can only identify preset error formats. Their core shortcomings are: extremely high maintenance costs for rules and dictionaries, inability to autonomously identify semantic errors, extremely poor generalization ability to new industry-specific abbreviations and unconventional writing errors, and complete inability to adapt to dynamically updated professional domain text correction scenarios.
[0003] 2. Training-based error correction schemes based on small models such as BERT / BioBERT This type of approach achieves text error correction by training dedicated classification and sequence labeling models on labeled corpora, relying on large-scale, high-quality domain-specific labeled datasets to support model performance. Its core drawbacks are: obtaining high-quality labeled corpora in vertical fields such as medicine and law is difficult and costly; the model's generalization ability is weak; it cannot handle novel error types not present in the training samples; and its implementation threshold is extremely high.
[0004] 3. Single-round large language model prompt word error correction scheme This type of solution is currently the mainstream in the industry. It constructs a single-round prompt word template and calls an LLM to complete text error identification and judgment in one go. However, it has irreconcilable core flaws: First, the LLM has a serious "oversensitivity" problem in professional fields, and is very prone to misjudging industry-legal abbreviations, proprietary professional terms, and fixed writing habits as writing errors, resulting in a high false positive rate. Second, the prompt word rules cannot simultaneously achieve dual optimization goals. Tightening the prompt word constraints will improve the accuracy of error correction but significantly increase the false negative rate, while relaxing the constraints will reduce false negatives but drastically increase the false positive rate, making it impossible to achieve high recall and low false positives at the same time. Third, the single-round, single-inference architecture lacks a review and verification mechanism, and the reliability of the error correction results cannot be guaranteed.
[0005] LLM self-consistency and self-refinement general verification scheme Self-Consistency optimizes results through multiple sampling and voting using the same prompt words, while Self-Refine rewrites the output results through model self-iteration. Both general optimization schemes have fundamental flaws: multiple sampling and iterative inference use the same set of prompt words and model role settings, failing to overcome the model's inherent cognitive biases and showing extremely poor improvement in the false positive problem caused by LLM's oversensitivity; at the same time, the model's self-correction continues the initial error judgment, continuously generating false errors, lacking the logic of questioning and verifying from opposing perspectives, and failing to solve the core pain point of error reporting in professional text correction.
[0006] Manual secondary review scheme To address the false positive issue in LLM (Limited Language Management) error correction, current implementations generally employ an "LLM initial screening + manual review" model. While this approach can filter out some false positives, it completely contradicts the core principle of AI automation. In large-scale text review scenarios, manual costs are extremely high, review efficiency is low, and it cannot achieve 24 / 7 uninterrupted review, severely limiting its practical application.
[0007] In summary, all existing text correction technologies have significant shortcomings, and the industry has always faced a core technical challenge: the inability to simultaneously address the high false positive rate of LLM professional text correction without adding new domain-annotated data, changing the underlying large language model, or relying on manual secondary review, while also balancing the two core metrics of high recall and low false positive rate. This severely restricts the practical application of large language models in scenarios with high professionalism and high review accuracy requirements. Summary of the Invention
[0008] To address the problems existing in the prior art, this invention provides a method, system, electronic device, and storage medium for text correction based on a large language model using dual-role prompt words and reverse verification. This invention does not rely on domain-annotated datasets or require fine-tuning of the underlying large language model. It only modifies the prompt word architecture to construct a bidirectional, two-stage verification mechanism, effectively solving the pain point of traditional text correction methods that cannot simultaneously address false positives and false negatives. It significantly reduces the false positive rate of professional text correction with a slight sacrifice in recall, achieving high-precision, reproducible, low-cost, and universal intelligent text correction, meeting the automated review needs of high-compliance scenarios such as medical, legal, and government affairs.
[0009] To achieve the above-mentioned objectives, this invention provides a text correction method for large language models based on dual-role cue word reverse verification: Construction of Double-Reverse Value Prompt Templates and Differentiated Rule Sets This invention first constructs a first prompt word template P1. P1 is configured with a domain review expert role, prioritizing error recall and avoiding false positives. It includes a first domain rule set R1 for defining error types such as typos, repetitive sentences, and semantic contradictions, and sets a fixed formatted output specification, ensuring the output is either an error description with a preset problem prefix or a no-problem judgment. Simultaneously, this invention constructs a second prompt word template P2. P2 is configured with a review expert role familiar with domain writing conventions, prioritizing review accuracy and avoiding false positives. It has a judgment logic completely opposite to P1. P2 receives the original text to be reviewed and the first-order error correction result from P1 as joint input. It includes a second domain rule set R2 that partially overlaps with and differs from R1, used to define compliant expressions such as industry standard abbreviations, professional terminology, and domain-fixed writing habits, and is configured with a binary output specification, outputting only a judgment flag indicating whether an error is true or false. Through a value-opposing and rule-complementary architectural design, the two sets of prompt words counterbalance the inherent biases of the large model at the instruction level, fundamentally suppressing false positives in professional text correction.
[0010] On-demand two-stage reasoning and joint logic decision-making process This invention employs a phased, interruptible inference scheduling mechanism: First, the text to be reviewed is input into a large language model loaded with template P1, performing a first-stage full-scale error identification. If the first-stage output has no problem judgment, the text compliance result is directly output and the inference process is terminated, saving computational resources. If the first-stage output contains a suspected error result with a preset problem prefix, the original text to be reviewed and the first-stage inference result are input together into a large language model loaded with template P2, performing a second-stage reverse questioning and compliance review to obtain a binary judgment result. This invention uses AND logic to complete the final error correction decision: a text error alarm is output only when a suspected error is detected in the first stage and the error is confirmed in the second stage review; if a suspected error is detected in the first stage but the second stage determines it to be a compliant expression, it is determined to be a false alarm caused by the oversensitivity of the large model and the error is automatically filtered out, achieving the dual effect of accurate error correction and false alarm filtering.
[0011] Deterministic reasoning parameter fixed settings This invention provides a fixed parameter configuration for the two-stage large language model inference process, uniformly setting fixed hyperparameters such as temperature=0, top_p≤0.01, and top_k=1. By locking the model sampling parameters, random creative outputs of the large language model are eliminated, ensuring that the same input corresponds to a unique and stable inference result. This guarantees the reproducibility and auditability of the two-stage verification process, meeting the compliance and traceability requirements of heavily regulated scenarios.
[0012] Dual-model deployment architecture and cross-domain universal adaptation This invention supports two deployment architectures, which can be flexibly selected according to business scenarios: The first is a same-model deployment mode, where the same large language model instance is reused in both stages of inference, which is simple to deploy and low in cost; the second is a cross-model deployment mode, where a lightweight model is used in the first stage for rapid coarse screening, and a high-precision large model is used in the second stage for fine verification, which is suitable for high-throughput and high-precision commercial scenarios. At the same time, this invention has a strong ability to be universally migrated to various scenarios, and can be adapted to various highly professional texts such as legal documents, financial reports, government documents, academic papers, and customer service compliance scripts. Only the prompt word role settings, R1 error rule set, and R2 compliance rule set need to be replaced to complete the scenario adaptation, without modifying the core inference architecture.
[0013] Multi-related field validation and refined adaptation for medical scenarios This invention supports consistency verification of professional texts containing two or more related fields. Through the multi-field linkage verification logic built into the P1 template, it identifies hidden errors where a single field is error-free but multiple fields exhibit semantic contradictions, thus overcoming the shortcomings of traditional single-text error correction. In the preferred application scenario of medical imaging reports, the text to be reviewed specifically includes the "observed" field and the "inspection conclusion" field. At least 15 medical text error correction rules are configured to form a first domain rule set R1, and at least 39 medical domain compliance expression judgment rules are configured to form a second domain rule set R2, achieving accurate error correction and false alarm filtering for medical professional texts.
[0014] Furthermore, the present invention also provides a large language model text correction system based on dual-role cue word reverse verification, which is used to execute the aforementioned large language model text correction method based on dual-role cue word reverse verification, including: The prompt word template management module is used to store and manage the first prompt word template P1, the second prompt word template P2, and the corresponding first domain rule set R1 and second domain rule set R2; The LLM fixed parameter calling module is used to call the large language model with preset fixed parameters to generate deterministic inference results; The two-stage scheduling module is used to perform full error screening in the first stage and trigger the second stage reverse verification only when a problem is detected in the first stage, thereby saving computing power. The decision output module is used to selectively output compliance judgments or error alarms based on the AND logic judgment results of the two-stage outputs, and to filter false alarm results.
[0015] Furthermore, the present invention also provides an electronic device, which includes a processor and a memory communicatively connected to the processor; the memory stores a computer program executable by the processor, and when the computer program is executed by the processor, it implements the large language model text correction method based on dual-role prompt word reverse verification.
[0016] Furthermore, the present invention also provides a computer-readable storage medium storing a computer program thereon, wherein when the computer program is executed by a processor, it implements the large language model text correction method based on dual-role prompt word reverse verification.
[0017] Compared with existing technologies, this invention, through its unique dual-opposing-role reverse verification architecture, overcomes the technical bottleneck of traditional LLM text correction, which cannot simultaneously achieve high recall and low false positives. It possesses the following outstanding beneficial effects, all of which are directly generated by the aforementioned technical mechanisms: (1) Addressing the problem of overly sensitive false positives in LLM from the perspective of algorithm mechanism. This invention utilizes a two-way opposing role check and balance and differentiated dual-rule layered verification to proactively distinguish between genuine typos and domain-compliant expressions, solving the industry pain points of unchecked single-round LLM and the inability to eliminate self-bias. The false positive rate in the medical scenario was reduced from 23.4% to 8.7%, significantly reducing the cost of manual review.
[0018] (2) Achieving the optimal balance between recall and precision. Traditional keyword engineering has an irreconcilable contradiction: tightening the rules leads to an increase in false negatives, while relaxing the rules leads to an explosion of false positives. This invention, through a two-stage mechanism of "relaxing the initial screening and tightening the final review," sacrifices only a small amount of recall while significantly improving precision and the F1 composite score. Its overall error correction performance is significantly better than existing single-round LLM and self-verification schemes with the same role.
[0019] (3) Lightweight, zero training, and low-barrier deployment. This invention is based entirely on the innovative prompt word architecture, requiring no domain-labeled data, no model fine-tuning, and no network structure reconstruction. It is suitable for medical institutions, law firms, and government and enterprise units without AI training computing power, and the deployment cost is far lower than that of small model training solutions.
[0020] (4) Controllable computing power consumption and compliant, auditable results. This invention adopts an on-demand two-stage triggering mechanism, requiring only about 30% to 35% of the text to undergo two rounds of reasoning, thus avoiding the waste of resources in full-scale secondary reasoning and ensuring controllable computing power increases. Combined with fixed deterministic reasoning parameters, the output results are stable and unique, meeting the compliance and traceability requirements of medical, financial, and government sectors.
[0021] (5) It has a high creative barrier and is completely different from existing self-verification technologies. Existing solutions such as Self-Consistency and Self-Refine are all "same role, same perspective, self-iteration", which cannot break the inherent bias of the model; this invention adopts a brand-new architecture of opposing perspective questioning + reverse value hedging + dual rule differentiation constraints, with a completely different technical mechanism and outstanding creativity.
[0022] This invention was tested and verified based on 500 anonymized real medical image reports and 132 manually annotated real errors. The data fully proves the effectiveness of the solution and can be widely promoted to various highly professional text automated review scenarios.
[0023] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it according to the contents of the specification, the preferred embodiments of the present invention are described in detail below with reference to the accompanying drawings. Specific embodiments of the present invention are given in detail below with reference to the accompanying drawings. Attached Figure Description
[0024] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings: Figure 1 This is the overall flowchart of the two-stage reverse verification method of the present invention; it shows the complete path of P1→LLM→judgment→P2→LLM→AND decision→output. The role names ("fault finder", "questioner") and value orientations ("better to overreport", "better to let go") of the two stages are marked.
[0025] Figure 2 This is a comparative diagram of the dual prompt word template structure of the present invention; P1 on the left (role, task, rule set R1, output format), P2 on the right (role, task, rule set R2, input including original text + first-order output, output format), and arrows in the middle marking "role opposition", "reverse value orientation", and "partial overlap and difference in rule set".
[0026] Figure 3 This is the intended representation of the decision truth value in this invention; four-quadrant matrix: first order = problem ∧ second order = yes → push alarm; first order = problem ∧ second order = no → discard (filter false alarms); first order = no problem → allow directly (second order does not trigger).
[0027] Figure 4 This is a bar chart comparing the false alarm rates of the present invention; a comparison of the false alarm rates of the present invention's method in a single round of LLMVS on 500 real reports. Detailed Implementation
[0028] The preferred embodiments of the present invention will be described in detail below with reference to the accompanying drawings to provide a clearer understanding of the invention's purpose, features, and advantages. It should be understood that the embodiments shown in the drawings are not intended to limit the scope of the invention, but are merely illustrative of the essential spirit of the invention's technical solution.
[0029] In the following description, certain specific details are set forth for the purpose of illustrating various disclosed embodiments in order to provide a thorough understanding of the various disclosed embodiments. However, those skilled in the art will recognize that embodiments may be practiced without one or more of these specific details. In other instances, well-known apparatuses, structures, and techniques associated with this application may not have been shown or described in detail to avoid unnecessarily obscuring the description of the embodiments.
[0030] Unless the context requires otherwise, throughout the specification and claims, the word “comprising” and its variations, such as “including” and “having”, shall be understood to have an open, inclusive meaning, that is, to be interpreted as “including, but not limited to”.
[0031] Throughout this specification, references to "an embodiment" or "an embodiment" indicate that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment. Therefore, the appearance of "in an embodiment" or "an embodiment" in various places throughout the specification does not necessarily refer to the same embodiment. Furthermore, a particular feature, structure, or characteristic may be combined in any manner in one or more embodiments.
[0032] The singular forms “a” and “the” used in this specification and the appended claims include plural references unless otherwise expressly stated herein. It should be noted that the term “or” is generally used to mean “and / or” unless otherwise expressly stated herein.
[0033] Furthermore, the technical features involved in the different embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other. Example 1:
[0034] This embodiment demonstrates the complete execution flow for a medical image report error correction scenario. For the overall logic, please refer to [link to documentation]. Figure 1 As shown. For a comparison of the role opposition, value reversal, and rule differentiation architecture of the dual-prompt word template in this embodiment, please refer to [link / reference]. Figure 2 As shown.
[0035] S1. Construct a first-order prompt word template P1 You are an expert in reviewing hospital examination reports. Could you help me analyze the examination descriptions and conclusions to identify any obvious problems, including: 1. Misspelled words or phrases due to typos; 2. Spelling errors of repeated words (limited to 3 characters), such as "right side right side".
[0036] If there is a problem, please say "There is a problem" first, and then briefly describe the problem (≤60 words). If there is no problem, simply reply "No problem".
[0037]
Medical Domain Rule Set R1
[0038] [Inspection Findings]: {report_describe} [Inspection Conclusion]: {report_diagnose} S2, Constructing a second-order prompt word template P2 You are a medical language review expert, familiar with clinical documentation standards and practical work habits. Please review the AI-generated error correction results to determine their reasonableness. The key is to judge whether the correction is truly an error, or an overcorrection / acceptable expression.
[0039] Please note that many AI error correction methods have issues, so you must ensure the accuracy of the review results in this round. Users cannot accept correct check results being judged as incorrect.
[0040]
enter
Task
[0041]
Secondary Review Rule Set R2
[0042] [Original Inspection Findings]: {report_describe} [Original Inspection Conclusion]: {report_diagnose} [First Stage Error Correction Result]: {stage1_conclusion} S3. Execute a two-phase call (Java pseudocode)
[0043] For the complete two-stage reasoning logic, truth branching, and decision rules of this embodiment, please refer to [link / reference needed]. Figure 3 As shown.
[0044] S4. Typical Case: For complete performance comparison data on the false alarm rate optimization effect and performance of this embodiment compared to the traditional single-round LLM scheme, please refer to [link / reference]. Figure 4 As shown.
[0045] Example 2:
[0046] This embodiment is a cross-model hybrid implementation method, which does not limit the two stages to using the same model and can form a variety of variations:
[0047] All variations fall within the protection scope of this embodiment. Example 3:
[0048] This embodiment is a cross-domain implementation method (this method is not limited to medical scenarios) and can be extended to:
[0049] This method is applicable to any text scenario that is "highly professional, contains many legal but non-common domain terms, and users cannot tolerate too many false alarms". Example 4:
[0050] This embodiment discloses a text correction device for a large language model based on dual-role prompt word reverse verification, which includes four main functional modules: 1. Prompt word template management module: Stores and edits P1 and P2 templates, as well as two sets of differentiated domain rule sets; 2. LLM Standardized Call Module: Encapsulates fixed inference parameters and provides unified API interfaces for various large models; 3. Stage Scheduling Module: Executes the complete two-stage inference process and controls the on-demand triggering of the second stage; 4. Joint Decision Module: Built-in truth value judgment rules, outputting three types of structured results: alarms, compliance, and false alarms. Example 5:
[0051] This embodiment is a dual-role prompt word reverse verification text error correction system, fully equipped with all the aforementioned two-stage verification logic. The system's four major functional modules correspond one-to-one with the execution steps of the method, and the overall system operation flow is adapted. Figures 1 to 4 The complete logic shown in the attached diagrams, and the implementation methods of each module, are as follows: 1. Prompt Template Management Module: Persistently stores the first prompt template P1 and the second prompt template P2, with a built-in visual configuration interface that allows adding, editing, and switching between two sets of domain rule sets, R1 and R2; it also has a built-in multi-domain template library, enabling one-click loading of complete Prompt texts for scenarios such as medicine, law, and finance, and supports batch import and export of rules.
[0052] 2. LLM Fixed Parameter Call Module: Globally fixed inference hyperparameters temperature=0, top_p≤0.01, top_k=1, encapsulated with a unified calling interface to connect with various large models such as qwen3-32b and GPT-4; each call automatically brings in fixed parameters, eliminating random model output and ensuring that the error correction results in each round are unique and reproducible.
[0053] 3. Two-stage scheduling module: Built-in branch judgment logic, reads the output result of P1, and only initiates the second-order LLM call when the text has the prefix "problematic"; supports free switching between two deployment modes: same model reuse and cross-light and heavy models; text without problems directly skips the second-order inference, saving computing power.
[0054] 4. Decision Output Module: Built-in logic judgment program, synchronously receives first-order and second-order output content; if there is a problem in the first-order judgment and the second-order returns "yes", a standardized error alarm is generated; if there is a problem in the first-order judgment and the second-order returns "no", false alarms are automatically marked and filtered; if there is no problem in the first-order judgment, a compliance mark is directly output.
[0055] The system in this embodiment can be independently deployed on the back-end servers of hospitals and enterprises to read various professional texts in real time and complete quality control in batches. Example 6:
[0056] This embodiment provides a dedicated business electronic device capable of running this error correction method, including a processor, a memory storage device, and a network communication interface; the memory storage device persistently stores the entire set of program code, prompt word templates for each scenario, and rule sets.
[0057] When the processor runs the program in the memory, it executes the following steps in sequence: loading the P1 template to complete the first-order high-recall screening, loading the P2 reverse review as needed, calling the large model with fixed parameters, and generating the final error correction result based on the truth value rule. The device supports multi-process concurrent processing and can be horizontally expanded to form a cluster of multiple servers. It can process tens of thousands of professional texts per day, which is suitable for the large-volume text review needs of institutions such as top-tier hospitals and law firms. Example 7:
[0058] This embodiment provides a computer-readable storage medium, including conventional storage media such as solid-state drives, USB flash drives, server disks, and read-only optical discs; the medium internally stores a complete executable program package, which includes: a template loader, an LLM parameter fixed calling program, a two-stage branch scheduling program, a hash and semantic verification program, and a joint decision output program.
[0059] By mounting this storage medium onto any electronic device with computing capabilities, and after reading and running the program, the entire dual-role reverse error correction process of this invention can be fully implemented without additional secondary development, and it can be directly adapted to various professional text review scenarios in medicine, law, and government affairs.
[0060] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. 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 text correction method for a large language model based on dual-role cue word reverse verification, characterized in that, include: S1. Construct a first prompt word template P1. P1 is configured with the first role of domain review expert, the first task of identifying writing and semantic errors in the text to be reviewed, and the first value orientation of prioritizing error recall and preferring to overreport rather than underreport. P1 has a built-in first domain rule set R1 and is configured with a fixed first formatted output specification. The first stage output is only a problem description with a preset problem prefix or a no-problem judgment. S2. Construct a second prompt word template P2. P2 is configured with a second role as a domain language review expert familiar with domain writing norms, and a second task as reviewing whether the first stage error correction results are true. It is also configured with a second value orientation that is completely opposite to the first value orientation, prioritizing the accuracy of the review and preferring to let a mistake go rather than report a false positive. The input of P2 includes the original text to be reviewed and the first stage error correction results. P2 has a built-in second domain rule set R2 that partially overlaps with and differs from R1, and is configured with a binary judgment output specification, outputting only the judgment flags of whether the statement is true or false. S3. Input the professional text to be reviewed into the large language model loaded with P1, perform the first stage error identification, and obtain the first stage result; if the first stage result is no problem, directly output the text compliance result and terminate the process. S4. If the first-stage result contains a problem prefix, then input the original text to be reviewed and the first-stage result together into the large language model loaded with P2, perform the second-stage reverse questioning verification, and obtain the binarized judgment result. S5. Final decision based on AND logic: Output a text error alarm only when a problem is identified in the first stage and an error is determined in the second stage. If the first stage identifies a problem but the second stage determines it to be invalid, then it is determined to be a false alarm caused by LLM oversensitivity and the error is filtered out.
2. The text correction method for a large language model based on dual-role cue word reverse verification according to claim 1, characterized in that, The calling parameters of the large language model are fixed with temperature=0, top_p≤0.01, and top_k=1, so that the same input corresponds to a unique deterministic output, ensuring that the two-stage verification logic is reproducible and auditable.
3. The text correction method for a large language model based on dual-role cue word reverse verification according to claim 1, characterized in that, Two-stage validation can be deployed using the same model or across models; The same model deployment involves reusing the same large language model instance in both the first and second phases. The cross-model deployment involves a first stage using a lightweight model for rapid coarse screening, followed by a second stage using a high-precision model for fine verification.
4. The text correction method for a large language model based on dual-role cue word reverse verification according to claim 1, characterized in that, The first domain rule set R1 focuses on defining text error judgment rules to identify typos, repetitions, and semantic contradictions that need to be reported. The second domain rule set R2 focuses on defining domain legal expression rules to define industry standard abbreviations, professional terms, and customary writing styles, and to filter out false error reports generated in the first stage.
5. The text correction method for a large language model based on dual-role cue word reverse verification according to claim 1, characterized in that, The text to be reviewed contains at least two sets of interrelated text fields. The first prompt word template P1 supports content consistency verification of multiple related fields and identifies semantic contradictions between fields.
6. The text correction method for a large language model based on dual-role cue word reverse verification according to claim 1, characterized in that, When the method is applied to the medical image report error correction scenario, the text to be reviewed includes the inspection findings field and the inspection conclusion field, R1 contains no less than 15 medical text error correction rules, and R2 contains no less than 39 medical field compliance expression judgment rules.
7. The text correction method for a large language model based on dual-role cue word reverse verification according to claim 1, characterized in that, The method can be universally applied to various highly specialized text review scenarios, including legal documents, financial reports, government documents, academic papers, and customer service compliance scripts. Adaptation can be achieved simply by replacing the role settings, R1 rule set, and R2 rule set for the corresponding scenario.
8. A text correction system for a large language model based on dual-role cue word reverse verification, characterized in that, For performing the method according to any one of claims 1 to 7, comprising: The prompt word template management module is used to store and manage the first prompt word template P1, the second prompt word template P2, and the corresponding first domain rule set R1 and second domain rule set R2; The LLM fixed parameter calling module is used to call the large language model with preset fixed parameters to generate deterministic inference results; The two-stage scheduling module is used to perform full error screening in the first stage and trigger the second stage reverse verification only when a problem is detected in the first stage, thereby saving computing power. The decision output module is used to selectively output compliance judgments or error alarms based on the AND logic judgment results of the two-stage outputs, and to filter false alarm results.
9. An electronic device, characterized in that, It includes a processor and a memory communicatively connected to the processor; the memory stores a computer program executable by the processor, which, when executed by the processor, implements the large language model text correction method based on dual-role prompt word reverse verification as described in any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the large language model text correction method based on dual-role prompt word reverse verification as described in any one of claims 1 to 7.