Decision document BUG type classification and error correction suggestion generation method

By establishing a rule base and dynamic knowledge base in legal judgment documents, the system automatically classifies reasoning defects and generates modification suggestions, thus solving the problem of low error correction efficiency in existing technologies for legal judgment documents and realizing automated error correction and improved logical rigor of legal documents.

CN121636705APending Publication Date: 2026-03-10HAINAN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-22
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

Existing technologies lack automated means to effectively classify reasoning flaws in legal judgments and generate targeted modification suggestions, resulting in low error correction efficiency and oversights.

Method used

By establishing a rule base and a dynamic knowledge base, combined with a legal knowledge base and a case base, reasoning defects are classified and corresponding modification suggestions are generated. These include error correction strategies for bugs such as missing premises, logical jumps, deviations from intent, deviations from similar cases, and incorrect knowledge application. Modification suggestions are generated using natural language.

Benefits of technology

It enables automated error correction of legal documents, improves the logical rigor and consistency of judicial documents, reduces the risk of injustice caused by improper reasoning, and enhances the efficiency and quality of legal document production.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121636705A_ABST
    Figure CN121636705A_ABST
Patent Text Reader

Abstract

The invention relates to a judgment document BUG type classification and error correction suggestion generation method, and belongs to the technical field of law intelligent assistance. The method comprises the following steps: firstly, receiving and analyzing reasoning defect (BUG) information detected from a legal document; then, on the basis of preset defect categories, classifying each BUG into a precondition missing type, a logic jump type, an intention deviation type, a class case deviation type or a knowledge application error type and the like through pattern matching and semantic analysis; next, by calling an error correction rule base corresponding to the BUG type and dynamically integrating information in a law knowledge base and a case base, a targeted natural language modification suggestion is generated; and finally outputting a structured classification result and an error correction scheme. According to the method, automatic diagnosis and repair guidance of deep logic defects in legal instruments are realized, and the efficiency and the intelligent level of instrument quality examination are remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the technical field of legal intelligent assistance, and particularly relates to a technical method for automatically classifying detected reasoning defects (BUGs) in legal judgment documents and generating corresponding modification suggestions. The method can be widely applied to intelligent proofreading of judicial judgment documents, optimization of legal AI output results, compliance review of laws and regulations, etc., to improve the consistency, accuracy and fairness of legal documents. BACKGROUND

[0002] In the process of judicial judgment and legal document drafting, logical rigor and complete reasoning are essential requirements. However, due to the complexity of case facts, the multiplicity of legal provisions, and human subjective factors, various reasoning bugs may occur in judgment documents: for example, missing key premises, logical jumps, biased conclusions, or inconsistent handling of similar cases. If these problems are not discovered and corrected in time, they may weaken the persuasiveness of the document reasoning, or even affect the fairness of justice and lead to doubts about the judgment results. In practice, higher courts often correct errors in lower court judgments through judicial supervision procedures, but this is often a post hoc remedy, which is costly and affects the judicial prestige.

[0003] With the development of artificial intelligence technology, some auxiliary tools have emerged to help check the text errors and format problems of legal documents. For example, an automatic proofreading system for legal documents can find errors in citing legal provisions and non-standard language use. However, for deeper logical flaws and reasoning defects, existing systems lack intelligent identification and processing capabilities. Once a document is detected to have a reasoning bug, how to effectively classify different types of problems and propose targeted modification suggestions, there is currently no mature automated solution. Manual processing often relies on the experience of judges or experts, which is time-consuming and labor-intensive, and there is a possibility of omissions.

[0004] For example, for a conclusion lacking premise basis, experts will suggest supplementing relevant evidence or reasons; for a logically inconsistent jump conclusion, intermediate reasoning steps may need to be added; for a judgment result deviating from precedents, reasons for differentiation or adjustment of the conclusion should be explained; for a judgment that violates the legislative purpose, the discretion should be reconsidered to make it consistent with the legislative purpose. These error correction measures have certain patterns, and the correction paths corresponding to different types of bugs can be summarized. Therefore, it is necessary to standardize and automate the classification of legal reasoning defects and the correction process: when a certain type of bug is detected, the system can automatically provide modification suggestions for reference and adoption by the case handling personnel.

[0005] In view of this, the present application proposes a method for classifying and correcting the BUG type of legal documents based on existing BUG detection technology. By classifying and managing reasoning BUGs and combining legal knowledge base and case base, the method automatically provides corresponding modification schemes to improve the efficiency and quality of legal document production and review. SUMMARY

[0006] The present application aims to provide a method that can automatically classify the type of legal reasoning defects and generate corresponding modification suggestions. When there is a reasoning BUG in a legal judgment document or an AI-generated legal text, the method can distinguish which category of logical problems it belongs to and provide targeted correction paths or modification suggestions for each category of problems to help drafters improve the reasoning chain of the document. Through this mechanism, the logic of judicial adjudication can be standardized, and the risk of unfair or incorrect judgments due to improper reasoning can be reduced.

[0007] Technical solution: The method of the present application can be used in combination with the aforementioned BUG detection system. When the detection system locates the BUG in the document, it enters the classification and suggestion generation stage of the present method. The main process is as follows:

[0008] 1. Bug information acquisition and analysis: Receive the BUG list from the legal document analysis module, which includes the location of each BUG, the involved text content, and the preliminary determined defect characteristics (such as "lack of premise" "logical jump" etc.). Analyze each BUG information and extract relevant semantic fragments (such as previous and subsequent sentences, related law articles, etc.) for classification and judgment.

[0009] 2. BUG type classification: Based on the pre-defined legal reasoning defect categories, each detected BUG is classified into the corresponding type. Typical BUG types include but are not limited to:

[0010] 3. Premise missing type BUG: Necessary premise conditions or factual basis are omitted in the judgment reasoning. For example, the conclusion relies on a certain fact, but the fact is not stated in the document.

[0011] 4. Logical jump type BUG: The reasoning process is too brief and lacks key intermediate derivation steps, resulting in an incoherent transition from cause to result. For example, the argument suddenly leads to a conclusion, but the intermediate argument is insufficient.

[0012] 5. Intention deviation type BUG: The judgment conclusion fails to reflect the legislative intent or justice value of the legal provisions, resulting in a deviation in the value orientation of the judgment result. For example, mechanically applying legal provisions but imposing excessive penalties, which is inconsistent with the legislative intent.

[0013] 6. Case analogy deviation type BUG: The judicial result is quite different from the existing similar case, but no valid reason is given to support the difference. This defect is manifested as different judgments in similar cases, which damages the consistency of legal application.

[0014] 7. Knowledge application error type BUG: The incorrect legal knowledge or regulation clauses are cited or applied, resulting in incorrect reasoning basis, which can be considered as a manifestation of knowledge mismatch.

[0015] In classification, the system first performs pattern matching and semantic analysis on the BUG text according to the definition characteristics of each type of BUG in the rule base. For example, if a BUG exhibits a causal structure with "because... therefore..." but lacks a transitional sentence with "... so...", it tends to be classified as a logical jump type. Combined with the level of the node involved in the DIKWP semantic graph (such as knowledge layer missing, which may be a knowledge application error, and wisdom / intention layer problem, which may be an intention deviation), accurate classification is achieved.

[0016] 1. Error correction suggestion generation rule base: A set of error correction strategy rules for different types of BUGs is established in advance, and each rule describes the general idea of solving the problem of this type. Some strategy rules are shown as follows:

[0017] 2. Premise missing type BUG: Suggest supplementing the facts or legal premises relied upon by the judgment. For example, "Please add proof or explanation of <missing premise> to support the conclusion".

[0018] 3. Logical jump type BUG: Suggest adding reasoning steps or explanatory arguments between the cause and the result. "Suggest adding transitional arguments between <cause> and <conclusion>, such as citing relevant legal principles or examples, to clarify the logical relationship".

[0019] 4. Intention deviation type BUG: Remind the judge to check the consistency of the conclusion with the legislative purpose. For the deviation, suggest adjusting the discretion or citing the legislative intent to correct. "Suggest referring to <legislative purpose> to adjust the judgment so that it is consistent with the value orientation and legal purpose".

[0020] 5. Case analogy deviation type BUG: Suggest referring to the handling principles of similar cases, or fully explaining the reasons for the difference in the document. "The system retrieves similar cases <case number> with different handling results. Suggest explaining the differences between this case and that case, or adjusting the decision appropriately to maintain consistency".

[0021] 6. Knowledge application error type BUG: Suggest replacing the correct legal basis or supplementing relevant law. "The cited regulation <number> may not be applicable to this case, suggest using <correct regulation> or relevant legal interpretation".

[0022] These rules can be continuously expanded according to the jurisdiction, for example, by refining them for criminal, civil, and administrative cases. The rule base essentially contains the thought processes of experienced judges / lawyers during the review process, which the system can automatically access.

[0023] 1. Dynamic Knowledge Base Support: To generate more accurate recommendations, the system integrates a legal knowledge base and a case database. The knowledge base provides explanations of the legislative purpose and normative essence of the legal provisions themselves (e.g., legal commentary, key points of guiding cases, etc.), while the case database is used to compare precedents in similar situations. For intention-deviation type bugs, the system can query the legislative interpretation of the provision in the knowledge base, extract the value objective of the provision, and incorporate it into the recommendation description. For case-deviation type bugs, the system automatically retrieves the results of several most similar cases from the case database, analyzes the differences, and cites these case numbers or guiding opinions in the recommendation to enhance its persuasiveness.

[0024] 2. Suggestion Generation and Natural Language Expression: Based on the bug classification results, the system selects the corresponding error correction rule template and fills in the parsed content to generate specific suggestion statements. To improve readability, the system uses legal terminology. For example, for a logical leap bug, if the detection information shows "The judgment directly infers conclusion C from fact A, lacking transition B," the template will generate the suggestion: "Given the lack of sufficient argumentation in directly inferring conclusion C from fact A, it is recommended to add reasoning step B between A and C, such as explaining how A leads to C." For case-deviation bugs, based on case comparison results, suggestions are generated such as: "The outcome of this case differs significantly from <Reference Case X>. It is recommended to clarify the distinguishing factors in the judgment to ensure consistency in the handling standards for similar cases." All suggestions generated by the system are presented in natural language and strive to adhere to the wording norms and etiquette of legal documents.

[0025] 3. Multiple Suggested Solutions Ranking: In some complex situations, a bug may correspond to multiple alternative modification paths. For example, missing premises can be resolved by either adding facts or weakening the conclusion. In this case, the system can generate multiple suggested solutions and rank them based on empirical rules or priority. Generally, solutions that add information to fill the gap take precedence over those that remove conclusions; suggestions referencing authoritative sources take precedence over general suggestions. The system will place the preferred solution at the top while providing alternative solutions for manual review.

[0026] 4. Output Processing and Interaction: Finally, the system will output a list of categorized results and suggested modifications for each bug. The output can be a structured report containing three parts: "Problem Description - Problem Category - Modification Suggestions". On the user interface, bug types are usually represented by concise terms (such as "Logical Jump" or "Missing Premise"), which can be clicked to view detailed descriptions and corresponding suggestions. Users can adjust, adopt, or ignore the suggestions and use the confirmed modifications to revise judgment documents. The system also supports directly injecting suggestions into the corresponding positions in the document (in the form of annotations), making it convenient for drafters to refer to modification prompts while reading the document.

[0027] In summary, this invention, centered on the main thread of "Bug classification → strategy matching → suggestion generation," achieves a closed-loop process for the discovery and repair of legal reasoning flaws. (Appendix) Figure 1 The modular structure and flow of the method of the present invention are shown in the appendix. Figure 2 The interface demonstrates how multiple bug-fixing suggestions are provided for a single example bug. Attached Figure Description

[0028] Figure 1 A functional module diagram and flowchart illustrating the method for classifying bug types in judgment documents and generating error correction suggestions. Figure 2 A schematic diagram of the interface for generating and displaying suggestions for bug corrections in judgment documents. Detailed Implementation

[0029] Example 1: Classification and Correction of Bugs in Criminal Judgments. A bug detection system found three reasoning flaws in a criminal judgment: (a) the lack of a description of the conspiracy in determining joint crime; (b) the skipping of motive argumentation in the causal reasoning for the defendant's conviction; and (c) a significantly harsher sentence than similar cases. The system classified these three bugs as follows: (a) lacking premise, because the conspiracy is a necessary premise for determining joint crime but was not mentioned in the document; (b) logical leap, because the subjective motive was directly inferred from the criminal act without intermediate argumentation; and (c) deviating from similar cases, because a comparison with the case database showed that similar cases generally resulted in shorter sentences than this case. After classification, the system retrieves the corresponding strategy from the rule base: For (a) missing premise type bugs, the system generates the suggestion: "Supplement the facts of the conspiracy: It is recommended to add a description of the formation process of the joint criminal intent in the judgment to fully support the determination of joint crime." The system also queries the legal knowledge base for the requirements of joint crime, incorporating the key point of "there must be a criminal intent connection" into the suggestion, emphasizing that "the fact that the defendant and his accomplices reached a criminal intent must be clearly stated." For (b) logical jump type bugs, the system generates two suggested solutions: First, "Add motive argument: When determining the defendant's subjective intent, add a discussion of his criminal motive or purpose, such as proving the motive through the defendant's confession or witness testimony, to eliminate the reasoning gap."; Second, "Adjust the wording: If there is a lack of direct motive evidence, the wording of the judgment can be changed to 'Although there is no direct evidence to prove the motive, the subjective intent can be inferred from other circumstances' to prevent logical leaps." Based on experience, the system marks the first solution as the preferred one, because supplementing the argument is better than adjusting the wording. For the (c) type of case deviating from the sentencing standard, the following suggestion is generated: "Refer to sentencing standards: The system retrieved 5 similar cases (such as Case X, etc.), in which the sentences were all lower than in this case. It is recommended to explain the reasons for the heavier sentence in this case (such as the particularly egregious circumstances), or to appropriately reduce the sentence to be roughly equivalent to similar cases, ensuring fair and consistent sentencing." This suggestion explicitly cites the retrieved guiding cases and statistical data, enhancing its persuasiveness.

[0030] After the above suggestions were generated, the system compiled the three bugs and their corresponding suggestions into a report and sent it to the judge for review. The judge adopted suggestion (a), adding content about joint criminal intent to the factual section of the judgment; for (b), the preferred solution was adopted and the motive argument was supplemented; for (c), the judge decided to explain the reasons for the heavy sentence in this case (the defendant was a repeat offender and had a bad attitude) and adjusted the sentencing range slightly lower with reference to the suggestions. The revised judgment was reviewed by the system and no more bugs were detected. The logic was more rigorous, and the connection with similar cases was more consistent.

[0031] Example 2: AI-generated legal opinion correction assistance. A company's compliance AI generated a legal opinion recommending that the company take a certain venture capital investment, on the grounds that "the behavior does not violate current laws and is profitable." Human review found that its argument was too simplistic, so the system of this invention was used for further analysis. Bug detection identified two problems: (1) lack of consideration for relevant regulatory policies (missing premise); (2) the recommended conclusion was too one-sided and ignored potential legal risks (deviation of intent). The system gave the following suggestions after classification: (1) "Supplement regulatory policy basis: It is recommended to add the citation and analysis of the <relevant regulatory provisions> in the opinion as a premise for the legality of the investment."; (2) "Balance risk and return: It is recommended to supplement the conclusion with explanations of the legal responsibilities or compliance requirements that the behavior may involve, so as to reflect the consideration of potential risks and ensure that the recommendation is in line with the company's overall compliance intent." After adopting these modification suggestions, the AI ​​opinion became more comprehensive and reliable.

[0032] Example 3: Bug Classification in Compliance Clause Review. This invention also plays a role in the automated review of corporate compliance clauses. For example, when reviewing a company's internal compliance manual, the system detected a bug in a clause stating, "Employees must not disclose company information under any circumstances; otherwise, they will be dismissed." The clause failed to differentiate between information types and the punitive measures were too harsh, contradicting the legislative intent of labor law to protect employee rights. The system categorized this bug as a deviation from intent and suggested: "Adjust the clause wording: It is recommended to classify and handle leaks according to the sensitivity of the information, and set disciplinary measures commensurate with the severity of the offense, in accordance with the principle of proportionality and legislative intent of labor law." This suggestion helped the company revise the unreasonable clause, making it more legal and humane.

[0033] In summary, this invention intelligently categorizes legal reasoning bugs through a knowledge-driven rule system and outputs actionable modification suggestions, demonstrating broad application prospects in both the judicial and compliance fields. The system-generated error correction schemes effectively assist legal practitioners in improving document quality and reducing the risk of misjudgments and disputes caused by reasoning flaws. This will significantly enhance the intelligence level of legal document drafting and promote the standardization and transparency of judicial discretion. Especially against the backdrop of the rapid development of AI in legal applications, this invention provides a necessary means to ensure the logical reliability and value alignment of AI-generated content, which is of great significance for building a trustworthy regulatory system for AI-generated legal content.

Claims

1. A method for determining the type of a legal instrument (BUG) and generating a correction suggestion, characterized in that, The method comprises the following steps: S1, BUG information acquisition and analysis: receiving a BUG information list from a legal document analysis module, and analyzing the occurrence position, involved text content and defect characteristics of each BUG; S2, BUG type classification: based on the pre-defined legal reasoning defect categories, the type of each BUG analyzed in step S1 is determined, and it is classified into a specific BUG type; S3, error correction suggestion generation: according to the BUG type determined in step S2, the corresponding error correction strategy is called from the pre-set error correction rule library, and a natural language modification suggestion for the BUG is generated; S4, output classification and suggestion result: output a report containing the type determination result and the corresponding modification suggestion of each BUG.

2. The method of claim 1, wherein, The legal reasoning defect categories in step S2 include at least one of the following: a premise missing type BUG: a necessary premise condition or factual basis is omitted in the judgment reasoning; a logic jump type BUG: the reasoning process lacks a key intermediate derivation step, resulting in incoherent cause-effect transition; an intention deviation type BUG: the judicial conclusion fails to reflect the legislative intent or justice value behind the legal provisions; a case deviation type BUG: the judicial result is significantly different from the handling result of similar cases but no reasonable explanation is given; a knowledge application error type BUG: the cited or applied legal knowledge, regulations and clauses are incorrect.

3. The method of claim 2, wherein, When determining the type of the BUG in step S2, at least one of the following methods is used for combined judgment: pattern matching is performed on the BUG text to identify its degree of conformity with the defined characteristics of each type of BUG; the level of the BUG in the DIKWP semantic graph is analyzed, wherein the knowledge layer problem is associated with the knowledge application error, and the wisdom / intention layer problem is associated with the intention deviation.

4. The method of claim 1, wherein, The pre-set error correction rule library in step S3 includes error correction strategy templates for different types of BUGs; the error correction strategy templates are natural language sentences, and variable fields for filling in specific case information are reserved.

5. The method according to claim 1 or 4, characterized in that, When generating the error correction suggestion in step S3, the legal knowledge base and the case base are also dynamically queried, and the query results are integrated into the suggestion content; wherein: for the intention deviation type BUG, the legal knowledge base is queried to obtain the legislative purpose or value orientation explanation of the relevant legal provisions; for the case deviation type BUG, the case base is queried to retrieve the handling result of similar cases as a comparison basis.

6. The method of claim 1, wherein, When multiple alternative modification suggestions are generated for a BUG in step S3, the method further comprises the step of sorting the multiple suggestion schemes; the sorting basis includes the priority rules that supplementary information is preferred to deletion of conclusions, and authoritative basis is preferred to general suggestions.

7. The method of claim 1, wherein, The report output in step S4 is in a structured form, including "problem description-problem category-modification suggestion" fields; the modification suggestion supports being injected into the corresponding position of the legal document in the form of annotations.

8. A system for implementing the method of any one of claims 1 to 7, characterized in that, It comprises: a BUG analysis module for receiving and analyzing input BUG information; a type classification module for determining the type of the BUG according to the pre-defined defect categories; a rule library management module for storing and managing error correction strategy rules for different types of BUGs; a knowledge base integration module for connecting and querying a legal knowledge base and a case base; A suggestion generation module is configured to generate natural language modification suggestions according to the BUG type, the correction rule and the knowledge base query result. An output module is configured to generate and output a final report.

9. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor implements the steps of the method of any one of claims 1 to 7 when executing the program. 10.A non-transitory computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program implements the steps of the method of any one of claims 1 to 7 when executed by the processor.