A method of fusing search enhancement with compliance semantic contract review hallucination suppression

CN123012131APending Publication Date: 2026-10-30HUALIAN DIGITAL TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202611503709.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-24
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

[0007]本发明的目的在于提供一种融合检索增强与合规语义比对合同审查幻觉抑制方法,解决了合同审查中生成文本缺乏合同原文事实证据支持、无依据字段迁移以及评价与实际证据支持状态不一致的技术问题

Benefits of technology

本发明通过解析待审查合同形成带有原文位置的条款要素记录,并对历史合规样本与法规知识片段进行来源登记及分层向量化,构建分层合规知识库。检索分层合规知识库获取适用知识片段,构造增强上下文并输入大语言模型,生成初始审查结论及断言标识。将初始审查结论与历史合规样本对齐形成差异记录,仅依据合同原文证据校准合同事实字段,对缺证字段受限补检,在固定断言集合上计算多维综合置信度,以证据状态控制可信输出,从而降低无依据字段迁移,提升审查结论的可靠性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123012131A_ABST
    Figure CN123012131A_ABST
Patent Text Reader

Abstract

The application discloses a kind of fusion search enhancement and compliance semantic comparison contract examination hallucination suppression method, belong to intelligent contract examination technical field.The existing contract examination generates text lack factual evidence support, easy to produce no basis field migration.The present application analyzes the contract to be examined to form clause element record, constructs hierarchical compliance knowledge base, searches applicable knowledge fragment and generates initial examination conclusion, through field alignment and contract original text evidence calibration assertion, limited re-examination is carried out to the field of lack of evidence, multidimensional comprehensive confidence is calculated on fixed assertion set, with evidence state control credible output, improve examination reliability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of intelligent contract review technology, specifically involving a method for suppressing illusions in contract review by integrating enhanced retrieval and compliance semantic comparison. Background Technology

[0002] Smart contract review can parse electronic contracts into clauses, utilize vector retrieval to obtain relevant historical clauses or legal knowledge fragments, and then input the contract text and retrieved materials into a large language model to generate review opinions. Patent document CN120297997A discloses a text review method, apparatus, computer-readable storage medium, and electronic device. It uses the content to be reviewed and the initial review results to retrieve historical review materials and combines the search results to output a processing route for the review results. Search enhancement provides citationable materials for the generation process, but recalling materials and ensuring that the materials support specific statements in the current contract are different processing stages.

[0003] Contract terms include information on parties, actions, objects, conditions, values, negations, and exceptions. Historical samples with similar semantics may have different payment terms, liability limits, or applicable parties; therefore, overall similarity cannot guarantee that sample values ​​can be applied to the contract under review. Even if the generated conclusions cite existing knowledge fragments, they may omit parallel conditions or present sample stipulations as current contractual facts. Using high search relevance to compensate for a lack of factual basis can lead to inconsistencies between the overall score and the actual state of evidence support.

[0004] Conditions, exceptions, and negations in complex clauses also have scope of application. Simply matching the appearance of words is insufficient to distinguish between omitted conditions, replacement of initiating events, and changes in the scope of exceptions. Patent document CN120688485A discloses a risk review method and system for contract clauses, extracting features such as syntactic tree depth, referential distance, and logical nesting from contract clauses, and combining them with topic weight deviation to identify risk handling methods. Structural analysis provides a representation of textual relationships, but the specific fields in the generated conclusion still need to establish a verifiable correspondence with the original contract text. Consistency between historical samples and generated conclusions cannot replace factual verification of the contract.

[0005] Subsequent verification also requires recording assertions of both successful and unsuccessful corrections. Deleting failure records would obscure incomplete parts; repeatedly generating the entire contract could lead to repeatedly obtaining the same evidence, increasing computational overhead without filling in missing information. The evaluation emphasis of different clauses can be expressed through weights, but changes in weights cannot replace evidence verification. When contextual capacity is limited, directly truncating materials by length may sever the relationships between negations, conditions, and exceptions, allowing the impact of incomplete input to extend into the generation and evaluation process.

[0006] Therefore, the technical problem to be solved is: to establish the processing relationship between clause fields, calibration assertions and source evidence in the process of enhancing the retrieval of contract review, to restrict the migration of unfounded fields, to prevent the lack of factual basis from being offset by the comprehensive score, and to retain necessary conditions under the context capacity constraint so that unclosed assertions and cut materials remain traceable. Summary of the Invention

[0007] The purpose of this invention is to provide a method for suppressing illusions in contract review by integrating enhanced retrieval and compliant semantic comparison, which solves the technical problems in contract review such as the lack of factual evidence supporting the original contract text, unfounded field migration, and inconsistency between the evaluation and the actual evidence support.

[0008] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows: A method for suppressing contract review illusions by integrating enhanced retrieval with compliance semantic comparison, executed by a computer, includes: The contract to be reviewed is analyzed and a record of the clause elements with their original text locations is generated; historical compliance samples and regulatory knowledge fragments are registered and vectorized in layers to build a layered compliance knowledge base; Based on the clause element records, retrieve the hierarchical compliance knowledge base, obtain applicable knowledge fragments, construct an enhanced context and input it into a large language model, generate initial review conclusions and structured field candidates, and break down the initial review conclusions into verifiable assertions and assign assertion identifiers. When comparable historical compliance samples exist, the initial review conclusions are aligned with the historical compliance samples to form a discrepancy record; when no comparable historical compliance samples exist, the state of no comparable samples is registered; based on the discrepancy record or the state of no comparable samples, the original contract evidence is located, the contract fact fields are calibrated only based on the original contract evidence, the missing evidence state and assertion identifier are retained, the missing evidence fields are supplemented and recalibrated, and the process stops when any of the following conditions are met: all discrepancy records to be supplemented for the current assertion are closed, no new evidence is added, or the supplementation budget is reached; On a fixed set of assertions that retains all assertion identifiers, a comprehensive confidence score is calculated based on retrieval relevance, semantic consistency, compliance, factual anchoring, and logical self-consistency. Only assertions with complete factual evidence and resolved conflicts are allowed to enter the trusted output. Based on the overall confidence level and the state of evidence, a credibility level is determined, and a structured review report is output, which includes the calibration conclusion, the original text location, the knowledge source, and the records to be reviewed.

[0009] As a preferred technical solution of the present invention, constructing a hierarchical compliance knowledge base includes: storing historical compliance samples and regulatory knowledge fragments in the sample layer and the regulatory layer respectively, and registering the knowledge source, applicable subject, applicable matters, validity period, review status, version identifier and access scope; filtering knowledge fragments according to applicable conditions and access scope before vector retrieval, and verifying the version consistency between knowledge fragments and original knowledge texts before constructing enhanced context.

[0010] As a preferred technical solution of the present invention, constructing an enhanced context includes: setting up a contract original text area, a historical compliance sample area, and a regulatory knowledge fragment area respectively; registering the source type and fragment identifier for the knowledge fragments entering the enhanced context; splitting the initial review conclusion generated by the large language model into assertions corresponding to verifiable propositions, and assigning and registering assertion identifiers, related clauses, fact fields, basis identifiers, and conclusion types by post-processing; and rejecting the registration of non-existent basis identifiers as valid references.

[0011] As a preferred technical solution of the present invention, the formation of difference records includes: comparing the conditional connection relationship, numerical value, negative state and exception condition between clauses that match the subject role, behavior and object, and recording the missing field, conflict field and missing evidence field; when the original contract evidence can uniquely determine the content of the conflict field or the missing field, the original contract evidence is used to perform field calibration; when the original contract evidence cannot uniquely determine the field content, the missing evidence state is retained, and the fact values ​​in the historical compliant samples are restricted to semantic comparison only. The calibration value of the contract fact field is based on the original contract evidence.

[0012] As a preferred technical solution of the present invention, a dependency parsing model is used to parse the initial review conclusion, historical compliance samples, and related contract texts respectively. Taking the corresponding behavior field as the root node, the subject, object, condition, value, negation state, and exception condition are mapped to nodes with source location and dependency relationship. Using the field structure of the historical compliance samples as a comparison reference, an evidence-limited comparison tree is formed using the factual values, conditional relationships, and exception relationships that can be determined from the contract text. Tree edit distance calculation is performed on the syntactic dependency tree corresponding to the initial review conclusion and the evidence-limited comparison tree. The minimum cost path is determined among the edit paths that satisfy the field type and ancestor relationship constraints. The field corresponding to the inserted node is registered as the missing field, the field corresponding to the replaced node is registered as the conflict field, and the statement corresponding to the deleted node is registered as the redundant statement. A difference record is generated by combining the position of the contract text.

[0013] As a preferred technical solution of the present invention, the supplementary inspection of missing evidence fields includes: forming a supplementary inspection subject based on the associated clauses, missing evidence fields and reference relationships in the difference records, and supplementing the inspection in the contract to be reviewed and the knowledge fragments that meet the access scope and validity period; recalibrating after associating the new evidence with the original assertion identifier; terminating the supplementary inspection when any of the following conditions are met: all the difference records to be supplemented for the current assertion are closed, no new valid evidence is obtained from the supplementary inspection, or the number of supplementary inspections reaches the configuration budget, and the unclosed difference records are retained as records to be reviewed.

[0014] As a preferred technical solution of the present invention, the overall confidence level is obtained by multiplying the retrieval relevance, semantic consistency, compliance, fact anchoring, and logical self-consistency by their respective non-negative weights and then adding them together, with the sum of the corresponding non-negative weights being 1; for evaluation components that lack the necessary inputs required for the calculation of the associated evaluation components, the reason for the absence is recorded and they are included in the calculation as 0, while the missing components are kept in the calculation and the weights of the remaining components remain unchanged; when the fact anchoring does not reach the state where all necessary fact fields that must be supported by the contract to be reviewed are supported, the overall confidence level cannot make the assertion enter the credible output on its own.

[0015] As a preferred technical solution of the present invention, a clause risk feature database is established, storing clause types, historical dispute frequencies, basic target amount coefficients, and penalty multipliers; the natural logarithm of the sum of the historical dispute frequencies of related clauses and 1 is taken, and then multiplied by the penalty multiplier and the basic target amount coefficient to obtain the clause risk entropy; before calculating the comprehensive confidence level, the semantic consistency weight and fact anchoring weight are updated according to the following formulas respectively:

[0016]

[0017] in, This represents the semantic consistency weight that has not yet been normalized after the update. Indicates the initial semantic consistency weight; This indicates the risk entropy of related clauses; Indicates the related clause number; This represents the weight decay control constant; Represents the natural constant; subscript This indicates that the risk update has not yet reached the normalization stage, and the subscript... This indicates the stage prior to risk updates;

[0018]

[0019] in, This indicates the fact anchoring weights that have not yet been normalized after the update; Indicates the initial fact anchoring weight; This indicates the risk entropy of related clauses; Indicates the related clause number; This represents the weight decay control constant; Represents the natural constant; subscript This indicates that the risk update has not yet reached the normalization stage, and the subscript... This indicates the stage before risk updates; the initial weights of search relevance, compliance, and logical consistency are not included in the risk update. The three initial weights and the two updated but not yet normalized weights are divided by the sum of the five values ​​to obtain the non-negative weights used to calculate the overall confidence level. The weight decay control constant is positive, the clause risk entropy is non-negative, the sum of the five normalized weights is 1, and the factual evidence gate continues to be implemented after the weight update.

[0020] As a preferred technical solution of the present invention, the original knowledge text, vector index and citation record are associated through version identifiers; when the knowledge changes, a new version identifier is generated, the old version is set to invalid status, and after submitting a consistent version of the original knowledge text and the corresponding vector index, retrieval is opened for new review tasks; before outputting the structured review report, the version status of the citation record is reviewed, and invalid or inconsistent citations are re-retrieved or output as records to be reviewed.

[0021] As a preferred technical solution of the present invention, an enhanced context budget is set according to the context capacity of the large language model. While retaining the contract fact field and the associated source identifier, the knowledge fragments entering the enhanced context are selected according to the relevance and applicability of the knowledge fragments. After obtaining new evidence through supplementary inspection, the affected assertions are determined according to the relationship between the assertions and the evidence. Only the affected assertions are calibrated and their components are updated, and the logical conflict relationships involving the affected assertions are reviewed.

[0022] Compared with the prior art, the present invention has the following beneficial effects: This invention generates a record of clause elements with their original text locations by parsing the contract under review. It then registers and hierarchically vectorizes historical compliance samples and regulatory knowledge fragments to construct a hierarchical compliance knowledge base. Applicable knowledge fragments are retrieved from the hierarchical compliance knowledge base, an enhanced context is constructed, and input into a large language model to generate initial review conclusions and assertion identifiers. The initial review conclusions are aligned with historical compliance samples to form a discrepancy record. Contract fact fields are calibrated only based on the original contract evidence, with limited supplementary checks for missing evidence fields. A multidimensional comprehensive confidence level is calculated on a fixed assertion set, controlling credible output based on evidence status. This reduces the migration of unfounded fields and improves the reliability of review conclusions.

[0023] This invention further employs evidence-limited syntactic tree comparison to locate omissions and conflicts in conditions, adjusts evaluation weights based on clause risks, and allocates retrieval knowledge budgets according to the complexity of clause structures. This reduces the truncation of necessary conditions, keeps unclosed assertions and cut materials traceable, and improves the overall accuracy and verifiability of contract review. Attached Figure Description

[0024] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained from these drawings without creative effort.

[0025] Figure 1 This is a flowchart illustrating the overall process of the method of the present invention.

[0026] Figure 2 This is a flowchart of the field calibration sub-process when the content of a field is uniquely determined by the original contract text evidence in the semantic calibration of this invention.

[0027] Figure 3 This is a flowchart of the targeted supplementary inspection sub-process in the semantic calibration of this invention when the original contract evidence is insufficient.

[0028] Figure 4 This is a flowchart of the retrieval enhancement generation and context budget control sub-process of the present invention. Detailed Implementation

[0029] In the following description, only certain exemplary embodiments are briefly described. As those skilled in the art will recognize, the described embodiments can be modified in various ways without departing from the spirit or scope of the embodiments of the invention. Therefore, the drawings and description are considered to be exemplary in nature and not restrictive.

[0030] The following is in conjunction with the appendix Figures 1-4 The embodiments of the present invention will be described in detail below.

[0031] This invention addresses the processing of evidence supported by text generated during contract review. The original contract text describes the agreement between the contracting parties; historical compliance samples describe reviewed templates or historical clauses; and legal knowledge fragments describe clearly sourced normative texts. These three types of materials serve different functions. If a review assertion is similar to a historical compliance sample, it only indicates the existence of a structure that can be further compared; it does not directly prove that the contract under review contains facts from the sample. This method performs retrieval, calibration, and scoring while maintaining the source type, avoiding confusion of the roles of different materials after model generation.

[0032] The assertions in this method are minimal statements that can be verified against evidence.

[0033] For example, payment terms and payment deadlines are propositions that can be verified separately; the correctness of the deadline does not necessarily mean that the terms are also correct. Assertion records retain assertion identifiers, associated clauses, statement text, field sets, reference identifiers, calibration status, and evaluation status. Assertion identifiers are generated before calibration and are not reassigned during calibration; when a complex sentence is split into multiple assertions, the split is completed before the first evaluation, preserving the complex sentence's associations, and subsequent changes in the number of splits cannot mask incomplete verification.

[0034] In this implementation, the retrieval algorithm completes candidate matching between clauses and knowledge fragments, the semantic comparison algorithm completes field alignment between candidate assertions and sample structure, the evidence verification process determines whether fields can be corrected, and the confidence assessment reads the calibrated records and controls the output. Retrieval candidates are not calibrated conclusions, and the overall confidence score is not an alias for the retrieval score. Missing evidence fields discovered by semantic comparison are used to form supplementary inspection topics, and the supplementary inspection results are returned to the original assertion, thus enabling bidirectional data interaction between retrieval and semantic comparison. The output gating continues to use the interactive results.

[0035] This method can utilize existing large language models capable of receiving text context and outputting structured text, without requiring the addition of a new neural network architecture. The model's role is to generate initial review conclusions and field candidates; factual support judgments are made by the source location and field validation process. During implementation, the model name, version, parameter file identifier, word segmentation configuration, and inference configuration are retained for review of the generation process under the same input. If the model fails to return fields as required, the registration format fails, and the confidence score declared by the model itself is not used as the overall confidence score of this method.

[0036] This implementation provides a reproducible processing path based on records and rules. When dealing with open-ended legal interpretations or complex semantics not covered by field rules, the processing results are entered into a pending review record, without forcing a definitive conclusion. Historical compliance samples and regulatory knowledge fragments are reviewed and stored by personnel with appropriate permissions, and the review results serve as source-based input records. This method does not automatically assume that knowledge has been reviewed based on the generated text, nor does it write unverified model interpretations back to the reviewed knowledge layer. Content after manual review can be stored according to a new knowledge review process, but the original evidence in this report cannot be retroactively altered.

[0037] The specific steps are as follows: Step S1: Preprocessing of the contract to be reviewed; Input consists of the contract document to be reviewed and task records. Task records must include at least the contract identifier, access scope, and review time information; the original content and document verification identifier are preserved before parsing. Electronic text can have characters directly extracted; scanned documents obtain characters and page positions through character recognition. The parsed output retains both text order and original position, without overwriting the original document with cleaned text. If misidentified characters are subsequently discovered, the system can return to the original page from the original text position for review and distinguish the corrected parsed version from the previous version.

[0038] Clause segmentation is based on headings, clause numbers, paragraph boundaries, and table cell relationships. When encountering consecutive sentences spanning multiple pages, a continuous identifier is established by combining sentence-ending punctuation, consecutive numbering, and page adjacency. When there are non-uniquely identifiable splicing relationships, candidate segments are retained and ambiguous states are set for resolution. Payment terms and corresponding deadlines should not be segmented into unrelated segments simply to meet the model input length. The segmented segments retain the parent clause identifier; retrieval and calibration obtain the necessary context through the parent clause identifier, enabling semantic processing to recover the conditional relationships within the clauses.

[0039] In the clause element record, the subjects are represented by names or roles that can be located in the contract; actions are represented by actions such as payment, delivery, notification, and assumption of liability; objects record the objects to which the actions are applied; conditions record the prerequisites for the actions; numerical values ​​record the amount, time limit, and unit; and negative states record polarity information such as prohibited, forbidden, and inapplicable. Field values ​​are based on the original text fragments, with standardized values ​​and original text values ​​coexisting. Subject names can be unified within the scope of clearly defined abbreviations in the same contract, but similar names without definitions cannot be automatically merged; the correspondence between roles and company names needs to retain the source location.

[0040] Condition fields retain the connection structure. For example, "acceptance passed" and "invoice received" require two conditions to be met simultaneously. "Acceptance passed" or "invoice received" represent different connection relationships, and "payment after invoice receipt" includes time sequence information. During parsing, condition words, conjunctions, and scope are saved as structured records, and the complete original sentences are preserved. Field comparison uses both the condition set and connection relationships for joint judgment; it cannot be determined that two texts are identical simply because they contain "acceptance," "invoice," and "payment." When encountering exceptions, provisos, or additional restrictions, the exception condition is associated with the main condition and cannot be deleted along with stop words.

[0041] Numerical standardization prioritizes preserving meaning. Amounts are recorded with the numerical value and currency; periods are recorded with the quantity, time unit, starting event, and whether working days are included; percentages record the source of the calculation base. When the original text contains multiple selectable values, the selection criteria are recorded separately, and multiple values ​​are not averaged into a single result. Numerical conversions use established unit conversion relationships, and the conversion result retains the original unit and conversion record; if the period of the starting event cannot be determined, even if the numerical value is clear, a condition missing status should be set for subsequent factual anchoring and reporting explanations.

[0042] Reference relationships are established based on the clause number, attachment name, and supplementary agreement name in the contract. When the reference target can be located, the target identifier and location are recorded; if the target does not exist, the attachment is not uploaded, or the name cannot be uniquely matched, a missing reference is recorded, and attachment content is not created based on historical compliance samples. For expressions in the contract text such as "the notification period is as per the attachment," a reference relationship for the notification period can be established, but the specific duration cannot be determined. Clause element records should retain the identified notification subject and method, while leaving the notification period value as missing to avoid misjudging the entire field as complete due to partial information readability.

[0043] After step S1 is completed, the clause element record enters three downstream stages: retrieval topic generation, contract fact verification, and report location. The ambiguity status is used to limit the deterministic output of relevant fields; the original text location is used for calibration basis and report review; and the citation relationship is used for selecting supplementary inspection targets. Temporary character caches used only for parsing can be released, and parsing statistics without downstream use are not written to the core record. The task record saves the parsing completion status and failure reasons. If the file cannot form a readable clause, the content review is terminated and a parsing failure record is output; the model is not invoked to guess the contract content.

[0044] Step S2: Construct a hierarchical compliance knowledge base; receive reviewed historical compliance samples and original regulatory texts. Historical compliance samples can be standard template clauses, confirmed historical review clauses, and corresponding explanations, but it is necessary to clearly define which fields are factual examples and which fields are configurable inspection requirements. Regulatory knowledge fragments are obtained by segmenting original regulatory texts with traceable sources, retaining the regulatory name, publication source, effective period, and applicable conditions. If the original regulatory text is not available, regulatory knowledge fragments cannot be created solely based on the regulatory name generated by the model, nor can internal regulations or historical templates be registered as regulations.

[0045] The tiered compliance knowledge base logically comprises at least a sample layer and a regulatory layer. Both layers can use the same storage device but store different source types and applicable metadata. The review status of the sample layer indicates that the materials have undergone a specified process, but does not indicate that the sample is applicable to all contracts. The validity period and scope of application of the regulatory layer are used to limit search results; a new version release cannot be simply equated with its effectiveness on all historical contracts. The selection of review time, signing time, and performance stage is determined by task input; if necessary time information is lacking, the applicability is left in an uncertain state.

[0046] Each knowledge fragment registers a fragment identifier, original text identifier, source type, applicable subject, applicable matter, validity period, review status, version identifier, and access scope. The fragment identifier points to the complete stored record, and the original text identifier points to the original material that has not been rewritten by the model. The knowledge fragment content participates in subsequent processing along with metadata; it is prohibited to save only the vector while losing the source. The access scope determines which tasks can read the text, and the applicable conditions determine which review topics the text can be used for; both are determined separately; knowledge that can be read with permission is not necessarily applicable to the current contract.

[0047] Vectorization can utilize a pre-configured text encoding model, applying consistent word segmentation and encoding configurations to both knowledge fragments and retrieval topics. The encoded vectors are saved in association with the fragment identifier and encoding version. Search similarity is calculated by dividing the vector dot product by the product of the lengths of the two vectors. A vector with a length of 0 is registered as an encoding failure and does not participate in candidate ranking. Negative similarity can be recorded as 0 in the non-negative relevance statistics of this implementation method, while retaining the original similarity. After the encoding model is replaced, old vectors cannot be directly mixed with new query vectors.

[0048] Knowledge vectors and original knowledge texts are maintained using a version binding method. When the original text is changed, a new version identifier is generated, the corresponding fragment is reconstructed and encoded, and then the new version becomes visible to new tasks. Older versions can be retained for historical report review, but they must be marked as invalid or historical. When constructing the enhanced context, the fragment version is checked for consistency with the original text version, and the referenced version status is checked again before report output. If inconsistencies are found, a consistent version is obtained again, or the affected assertions are changed to a pending review status; it is unacceptable to simply modify the version text in the report and continue using the basis generated from the old text.

[0049] Historical compliance samples can be accompanied by an audited field dictionary and executable checks. The field dictionary records synonyms, role names, conditional connectors, and numerical units, with mappings preserved in previous versions. Executable checks record the object of inspection, necessary inputs, applicable conditions, judgment operations, and pass status; for example, confirming a positive payment deadline or confirming a liability limit with a specific currency. Checks involving specific legal conclusions must also be linked to authentic regulatory sources. The knowledge layer only stores confirmed configurations; new rules proposed by the model enter the review area and do not directly participate in the current compliance calculation.

[0050] Step S3: Enhanced Search Generation; A search topic is generated from the clause element records. The search topic includes the clause object, subject role, action, necessary conditions, and applicable information in the task. Review opinions not yet generated by the large language model are not required as initial search input. For payment clauses, the search topic can simultaneously express payment actions, acceptance conditions, invoice conditions, and deadlines, avoiding the retrieval of broad content using only payment keywords. Whether the real name of the subject is included in the query depends on the access scope and processing environment; field normalization must not alter the factual subject relationships within the contract.

[0051] Before retrieval, filtering is performed based on access scope, review status, and applicable conditions. The filtered results are then sorted by vector similarity. Candidate fragments can be obtained from both the sample layer and the regulatory layer. Similarity and selection reasons are retained within each layer, and the source type is not interchanged between layers due to similar scores. If no suitable regulatory knowledge fragment is found, the regulatory layer returns a status of "no applicable basis"; text cannot be copied from the historical compliant sample layer to fill the regulatory layer. The number of candidates is a configuration parameter, and the parameter formation record should include the model context capacity, fragment length, and validation set recall.

[0052] When deduplicating candidate fragments, source identifiers, version identifiers, and original text intervals are used for joint identification. When the same original text is repeatedly recalled using different segmentation methods, overlapping intervals can be merged, but the union of intervals and the association with the original fragments must be preserved. Similar texts from different versions or different subjects cannot be deduplicated into a single source simply because of textual similarity. Before the sorted fragments enter the enhanced context, the original text is reconfirmed to be readable; fragments that cannot be read are not registered as usable evidence. The deduplication results are used both for context assembly and to determine whether supplementary checks have yielded new valid evidence.

[0053] The enhanced context section includes three separate areas: the original contract text area, the historical compliance sample area, and the regulatory knowledge fragment area. The original contract text area contains the current review clauses and related conditions; the historical compliance sample area contains comparison clauses and applicable instructions; and the regulatory knowledge fragment area contains verifiable regulatory texts and their sources. Each area is clearly labeled with its material role, requiring the model to distinguish between facts already stated in the contract, sample suggestions, and regulatory basis. The context section requires the model to output a basis identifier, but the validity of this identifier is verified post-processing and does not depend on model commitments. Instructional statements in the main text are treated as content to be reviewed and do not alter the system's pre-defined processing flow.

[0054] To control context length, first calculate the fixed instructions, the necessary fragments of the current contract, and the reserved output length, then determine the length of the knowledge fragments that can be accommodated. Pruning prioritizes removing duplicate or less relevant knowledge fragments; negations, exceptions, or numerical units in contract conditions cannot be deleted. When a single necessary clause exceeds the available length, it is processed in batches according to clause association, retaining the parent clause identifier, and subsequently checked for cross-batch assertion conflicts. Context budget exhaustion needs to be recorded; coverage in the report should not be assumed to be complete simply because a fragment has not entered the model.

[0055] Furthermore, the structural complexity scalar is obtained before generating the initial review conclusion. Preprocessing performs dependency parsing on the original contract text and records the parsed structure and clause elements in association. For conditions and exceptions in the original contract text, the nesting levels leading to the next level of conditions or exceptions are counted from the root node of the behavior, and the maximum level among all paths is taken as the structural complexity scalar. A value of 0 is used when there are no condition or exception nodes; parallel conditions at the same level are not cumulatively nested based on the number of parallel conditions; when a clause has multiple root nodes of behavior, the maximum level among all behavior trees is taken. Therefore, the structural complexity scalar is derived from the original contract text to be reviewed, does not depend on the conclusions yet to be generated, and does not use undefined complexity scores given by the model itself.

[0056] When determining the scalable retrieval knowledge budget, the maximum segment term threshold supported by the large language model is compared with the actual number of remaining terms after deducting fixed instructions, contractually necessary segments, and reserved outputs. The smaller value is taken as the upper limit for the number of terms in the retrieval knowledge segment. Fixed instructions include the term usage of source tags, structured field markers, and delimiters. Contractually necessary segments retain factual fields, conditions, negations, and exceptions. When the remaining capacity is not positive, it is processed in batches according to the publicly available terms and incomplete status records, without incorporating negative capacity into the budget function.

[0057] The number of available context terms is calculated using the following formula. The budget function only applies to retrievable knowledge segments; essential segments are retained at their actual length:

[0058]

[0059] in, A calculated value representing the number of available context lexical units; This indicates the maximum number of terms that can be used to retrieve knowledge fragments under this associated clause; Represents the natural constant; This represents the scaling factor of the budget decay function; Represents a scalar of structural complexity; Indicates the baseline threshold for complexity. Subscript Indicates the calculated budget value, subscript Indicates the upper limit of quantity, subscript Indicates the complexity of the clause structure, subscript This represents the baseline threshold for complexity. A positive dimensionless number. and All are non-negative dimensionless numbers, and the exponent term is dimensionless; and The same word counting caliber is used.

[0060] The calculated budget value is rounded down before being used for segment selection. When the structural complexity equals the complexity baseline threshold, the calculated budget value is half of the upper limit for the number of terms. As the structural complexity increases, the amount of scalable retrieval knowledge allowed to enter the context decreases, reducing the number of candidate materials input simultaneously. This quantity limit does not constitute a judgment that complex clauses have been fully understood; the processing results are still calibrated against the original text and subject to evidence gating. The scaling factor and complexity baseline threshold are configured through a verification process using a fixed model, a fixed set of contracts, and fixed retrieval candidates, recording term usage, the number of segments not entered, field verification status, and output coverage.

[0061] Knowledge fragments selected based on applicability are sorted according to predetermined relevance. When the cumulative terminology count at the boundary of a complete fragment exceeds the integer budget, fragments ranked lower are pruned, and pruned fragments are prevented from entering the current enhancement context. Fragments containing interdependent conditions, negations, or exceptions are treated as complete units and cannot be truncated in the middle to reach the budget. If no complete fragment can accommodate the fragment or the integer budget is 0, the state of "no usable search basis" is retained; subsequently, pruned fragments cannot be included in the average search relevance. Fragment identifiers, pruning reasons, and subsequent supplementary checks are stored in the task record, making it easy to distinguish between insufficient capacity and non-existent sources.

[0062] The large language model receives enhanced context and returns initial review conclusions and structured field candidates. Each candidate must include related clauses, propositional text, contractual fact fields, cited fragment identifiers, and conclusion type. Conclusion types are distinguished as contractual fact statements, sample deviation explanations, normative application explanations, and modification suggestions. Contractual fact statements require support from the original contract text; sample deviation explanations require bidirectional positioning of the sample and the contract; normative application explanations require legal fragments and applicable conditions; and modification suggestions cannot be presented in the report as facts already stipulated in the contract.

[0063] After parsing the structured fields, an assertion identifier is assigned to each verifiable proposition. A missing field is recorded as missing, and an invalid reference is recorded if the reference identifier does not exist. When the model returns multiple fact values, conflicts are not resolved by selecting the most common value. The text of an assertion can be changed after calibration, but the assertion identifier and the object of review remain unchanged. For review items without corresponding assertions, an ungenerated record is retained to avoid a fixed assertion set only reflecting content already mentioned by the model. Assertion set coverage and total review item completion rate are calculated separately and cannot be substituted for each other.

[0064] Step S4: Semantic calibration; find corresponding historical compliant samples based on related clauses. If no comparable historical compliant samples are found, register the state of no comparable samples and semantic consistency deficiency, directly perform fact verification and evidence gating of the original contract text, and do not forcibly form a comparison reference by applying inapplicable samples; if found, first compare the subject roles, behaviors, and objects to confirm comparability, and then compare the conditions, values, negations, and exception fields. Different subject names but the same role can form a sample comparison relationship, but this cannot be used to determine that two subjects are the same entity. Semantic vectors are used to provide candidates, and the final field matching is determined based on the original text values, dictionary mapping, and condition structure. If the corresponding expression cannot be established through defined rules, register the semantics as undetermined, and do not judge consistency solely by the similarity threshold.

[0065] A discrepancy record must include at least the assertion identifier, related clauses, discrepancy fields, discrepancy type, candidate sample identifier, and the original text location to be verified. Discrepancy types include field omission, value conflict, conditional connection conflict, negation conflict, exception scope conflict, and source missing. An assertion can have multiple discrepancy records, each tracking its processing status separately. For cases where the values ​​in the sample differ from the contract values, the discrepancy record indicates a value difference but does not directly classify the difference as a contract error; whether a regulatory issue exists requires further reading of applicable inspection items and regulatory knowledge fragments.

[0066] The semantic comparison reference is structured by historical compliant samples and limited by facts already verified in the current contract. Samples are used to indicate fields such as payment terms, terms, liability limits, or notification arrangements that should be checked; when actually comparing current contract facts, the field values ​​already determined in the original contract text are used. The liability limit in the sample is a different amount and cannot be used as a basis for modifying the liability limit in the current contract. The reference record retains both the original sample value and the contract value, enabling subsequent differentiation between sample deviations and model errors. Fields that cannot be determined from the contract can retain sample reference values, but must be marked as being for sample semantic comparison only and cannot be registered as contract facts or contract evidence; these sample reference values ​​do not enter the field set of fact anchoring, nor are they used as calibration values ​​for contract fact fields.

[0067] When calibrating for missing or conflicting fields, the original contract text and related clauses pointed to by the difference record are read. Replacement or supplementation is only performed if the original contract text uniquely identifies the target field and the subject, scope of conditions, and applicable location are consistent. The calibration record saves the text before modification, the text after modification, the modified field, and the location of the original text. If there are two conflicting versions of the original text, the cited attachment is missing, or the scanned content is unrecognizable, the missing document status is maintained. The calibration operation corrects the model's representation of the contract; it does not directly modify the contract document, nor does it replace contractual provisions simply because the sample is more complete. When the original contract text and the sample values ​​differ but can support the assertion, the difference is registered as a verified deviation and closed, without modifying the assertion.

[0068] Furthermore, the dependency parsing model takes as input the initial review conclusions (preserving character ranges), candidate historical compliance samples, and the original text of related contracts. The output includes word segmentation results, part-of-speech tags, headword index, dependency relation type, and the original text character range. The model is used as a pre-configured syntactic parsing component; the model file version, word segmentation configuration, and relation tag set are bound to the task configuration. This method utilizes the parsing results for field mapping and does not replace evidence verification with unpublished model judgments. When the headword cannot be obtained, circular dependencies are formed, or the scope of conditional action cannot be determined, parsing ambiguities are recorded and used for further review.

[0069] For complex clauses containing multiple actions, separate root nodes are created according to the review object, corresponding to actions such as attribution, use, payment, or notification; different predicates are not forcibly merged into the same action. Subjects, objects, conditions, values, negation states, and exception conditions are mapped to field nodes, with connectors and modifying relationships preserved in the substructures or relational attributes of the field nodes. Nodes store field type, normalized value, polarity, scope, source type, and character range. Node normalization only uses registered dictionaries and original texts to determine relationships; different subjects or conditions cannot be merged due to textual similarity.

[0070] The initial review conclusion analysis yields the first syntactic dependency tree, the historical compliance sample analysis yields the second syntactic dependency tree, and the analysis of the associated contract text yields the contract text syntactic dependency tree. The second syntactic dependency tree provides a comparable field structure. For contractual factual statements, the sample values ​​in the comparison reference are replaced with the factual values ​​already verified in the contract text, and conditions, negations, and exceptions explicitly stated in the contract text are added to form an evidence-limited comparison tree. The second syntactic dependency tree retains the sample source, and the contractual factual nodes in the evidence-limited comparison tree retain the contract source; the original trees are not covered. Fields that cannot be determined in the contract text are retained as missing evidence, and the evidence-limited comparison tree is registered as complete without using sample values.

[0071] The tree edit distance is determined based on the minimum cost of legal insertion, deletion, and replacement operations required to transform from the first syntactic dependency tree to the evidence-bound alignment tree.

[0072] This implementation uses the Zhang-Shasha ordered root tree edit distance algorithm to solve for the minimum cost path. The tree is represented by a labeled ordered root tree, and field categories are organized according to a uniform field order, while retaining dependency hierarchy and original text order within each category. Valid mappings maintain the one-to-one relationship, ancestor relationship, and normalized sibling order of nodes; different field types are not directly replaced as the same field. When deleting a non-root node, the retained child nodes are appended to the parent node of the deleted node in their original order; when deleting a root node, the retained child nodes form a forest in their original order. Insertion operations are the corresponding inverse operations, and replacement only changes the allowed comparison node labels or field attributes.

[0073] For example, both insertion and deletion costs are set to 1. The replacement cost is 0 when field types, values, and scopes are identical; and 1 when field types are identical but values, negations, or join relationships differ and modifications are needed. Different field types are not replaced via shortcuts but are represented by valid insertions and deletions. The cost configuration is fixed during a single alignment process and cannot be changed during traversal to achieve the desired difference. Non-negative costs ensure that repeated insertions and deletions do not cause the editing cost to continuously decrease; the same input, normalization configuration, and cost configuration result in a verifiable distance and editing path.

[0074] During calculation, nodes are sequentially numbered, and the leftmost leaf node of the corresponding subtree and the subforest intervals involved in the calculation are recorded. The cost between empty forests is 0. The cost of transforming a non-empty forest into an empty forest is the sum of the costs of the nodes to be deleted, and the cost of transforming an empty forest into a non-empty forest is the sum of the costs of the nodes to be inserted. The state table is filled in ascending order of subforest size, and the cumulative costs after deleting the current node, inserting the target node, and matching the corresponding subtree or replacing the corresponding root label are compared. When matching a subtree, the already calculated subtree distance is read and the distance of the remaining subforest is added together. All states are constrained by the valid node mapping, and the complete tree distance is obtained from the subforest state covering all nodes.

[0075] The status table stores the predecessor relationships that achieve the minimum cost. It backtracks from the state corresponding to the complete tree to the empty forest state to obtain the minimum edit path and the original node correspondences. Inserted target nodes are recorded as omitted fields in the initial review conclusion, replaced corresponding nodes are recorded as conflict fields, and deleted source nodes are recorded as redundant statements. Redundant statements continue to be verified against the original contract text; they do not directly modify contract facts due to deletion operations. When different minimum paths exist and the attribution of differing fields is inconsistent, alignment ambiguity is recorded; when the attribution is consistent, the display order in the report is determined according to the original text's position order. When the number of nodes or the size of the status table exceeds the configured resource boundary, the alignment is terminated and an incomplete status is output; partial paths are not used as the basis for complete calibration.

[0076] The tree editing path provides field location, while source evidence determines whether a field can be corrected; these two processes are not interchangeable. For nodes where differences only exist between historical samples and conclusions, sample deviations are first recorded. For contractual fact nodes where differences exist between the evidence-limited comparison tree and conclusions, omission or conflict records are generated according to the original text's support status. These difference records continue to use the original assertion identifier, field name, content before and after modification, and the original contract text location; subsequent confidence assessments read the calibrated records.

[0077] When verifying the application of regulations, the source, validity period, and applicable conditions of the legal knowledge fragments must be retrieved. The legal article numbers cited in the model must be locatable in the corresponding original text; if the source does not exist, the citation remains invalid. Internal regulations or sample check items can support prompts within the scope of internal rules, but the report must retain the source type and must not be described as a regulatory requirement. When the applicable subject, time, or matter is uncertain, the regulatory conclusion enters a pending review state. Even if the original legal text exists, the similarity between the article and the contract subject matter cannot be used to determine that specific legal consequences have been established.

[0078] The difference field supplementation check takes unclosed records as input, reads related clauses, reference relationships, and difference fields to generate a supplementation check topic. For missing attachments, it checks the actual list of attachments received in this task and the contract reference targets; for missing conditions, it retrieves consecutive fragments of the same clause or the referenced clauses; for missing regulatory sources, it retrieves the regulatory layer with applicable metadata. Supplementation checks do not expand the access scope and do not use unverified facts generated by the model as filtering conditions. Fragments returned by supplementation checks are first checked for version and source, then associated with the original assertion; adding a different identifier to replace a failed assertion is prohibited.

[0079] Newly added valid evidence refers to evidence that has not been used in this assertion, whose source is readable, whose version is consistent, and which has a clear association with the missing field. Repeatedly recalling the same original text interval does not increase the number of evidences, and duplicate segments formed by different partitions are not considered incremental. After each round of supplementary checks, the newly added evidence and the difference closure status are recorded; if no new valid evidence is added, the supplementary check for the corresponding assertion is immediately stopped; it stops when all differences are closed; and it stops when the budgeted number of checks is reached. The supplementary check budget is an upper limit, not a mandatory number of executions. It terminates immediately when no new valid evidence is added, without consuming the budgeted number of executions. Upon stopping, the current status is output, without assuming that continued execution will produce correct results; completed assertions can proceed to subsequent evaluation.

[0080] After calibration, the contract fact fields in the assertions are reread to verify that the field values, condition ranges, and their positions in the original text are consistent. New explanatory text appearing during calibration must also be broken down and incorporated into the related records of the original review object; this cannot be circumvented under the pretext of "polishing." The review objects and original identifiers of the fixed assertion set remain traceable. Newly added explanatory propositions are registered as supplementary records and validated separately; they are not used to replace failed assertions or improve the coverage of the original set. For assertions involving the same subject and the same condition range, the numerical values ​​and negation relationships are re-examined to avoid internal conflicts arising from partial modifications.

[0081] Step S5: Confidence Assessment; Calculate the overall confidence score for each assertion in the assertion set. Multiply the retrieval relevance by its weight, the semantic consistency by its weight, the compliance by its weight, the factual anchoring by its weight, and the logical consistency by its weight. Then add these five products together to obtain the overall assertion confidence score.

[0082] The overall confidence level is determined by the following formula:

[0083]

[0084] in, Indicates the overall confidence level of the assertion; This indicates the sequence number corresponding to the assertion identifier; Indicates search relevance; Indicates semantic consistency; Indicates compliance level; Indicates the degree of fact anchoring; Indicates logical consistency; Indicates the relevance weight of the search; Indicates semantic consistency weight; Indicates the weight of compliance; Indicates the weight of fact anchoring; This represents the weights for logical consistency. All five weights are non-negative, and their sum is 1. All five evaluation components and the overall confidence level are dimensionless, ranging from 0 to 1. (Subscript) Used to associate evaluation components with the same assertion, not to represent new evaluation dimensions.

[0085] The retrieval relevance is calculated by reading the similarity between the search topic associated with the current assertion and the knowledge fragments that are actually used. In this implementation, the arithmetic mean of the non-negative similarities of knowledge fragments that have passed applicability screening, entered the enhanced context, and participated in the corresponding assertion comparison is taken as the retrieval relevance. If no usable knowledge fragment is found, it is recorded as 0, and no usable retrieval basis is noted. Retrieval relevance describes the closeness between the topic and the knowledge fragment, but does not describe whether the contractual facts are true; high-scoring candidates that did not participate in the generation or calibration are not included in the average value to avoid irrelevant candidates inflating the results.

[0086] Semantic consistency is calculated based on the necessary comparison fields between the assertion and the comparison reference. When determining the field set, the sample structure and the conditional, numerical, negative, or exceptional fields that need to be verified for the current review object are read; each field uses the same matching rule. The number of necessary fields that have been confirmed to be consistent is divided by the total number of necessary fields to obtain semantic consistency; omitted, conflicting, and uncertain fields are not included in the consistency count. The field set is fixed before this calibration and difficult fields cannot be deleted after calibration failure. If there is insufficient information to establish the field set, it is recorded as 0 and the reason is retained.

[0087] Compliance score indicates the degree to which a current assertion passes within the scope of configured and confirmed applicable executable checks. The necessary inputs, applicable conditions, and judgment operations for each check are read, and the checks are executed sequentially. The compliance score is obtained by dividing the number of passes by the number of checks to be executed. Checks lacking necessary inputs are retained in the number of checks to be executed and cannot be ignored due to their absence. Checks can target verifiable conditions such as specific currencies, positive time limits, completeness of entity roles, or validity of source versions. A score of 0 is recorded when no applicable check is available. Compliance score does not indicate coverage of all regulations and cannot replace incomplete fact-checking.

[0088] The fact anchoring degree is calculated based on the fact fields in the subject of review that must be supported by the contract under review. The position of the field in the original contract text is read, and the corresponding subject, action, condition, value, and negation relation are checked to see if they support the assertion. The number of necessary fact fields that are supported is divided by the total number of necessary fact fields, and this is used as the fact anchoring degree. If a reference identifier exists but the text does not support the field, it is not counted as supported. Fact values ​​appearing alone in a sample are not counted as supported facts in the current contract, and values ​​not provided in contract appendices are also not counted as supported. When contractual factual evidence is required but there is no verifiable set of fields, the fact anchoring degree is recorded as 0.

[0089] Logical consistency is determined based on comparable relationships within the assertion set. Assertions with the same subject, the same action, and the same condition range are linked, and it is checked whether they simultaneously provide mutually exclusive values, opposite negation states, or incompatible conditions. An unresolved internal conflict is recorded as 0; if no conflict exists in the checked relationships, it is recorded as 1, and the number of checked relationships is retained. For example, if two assertions in the same assertion set give the same payment period of 30 days and 45 days respectively, and the conflict is not resolved, the logical consistency is recorded as 0. If there are no comparable assertion pairs, it can be recorded as 1 to indicate that no internal conflict was found in the current set, but this cannot be interpreted as proof of the external fact. A logical relationship that cannot be resolved is recorded as 0, and an undetermined state is registered.

[0090] The five components retrieve retrieval records, comparison records, inspection item execution records, contract evidence records, and assertion association records, respectively. Components can be related, but they cannot be repeatedly registered as multiple independent pieces of evidence from the same source. Weights represent the evaluation emphasis of this configuration, not statistical independence, and the weighted result is not referred to as the probability-calibrated accuracy. If a component fails to be calculated, the reason for the failure is retained and the component is included in the calculation as 0; the remaining weights cannot be normalized to 1 to hide the missing values. The configuration version, field set, and inspection item set are saved together with the evaluation results.

[0091] Weights and grading thresholds are selected independently of the labeled verification set of the contract under review. The verification set must simultaneously include supporting assertions, missing evidence assertions, condition omission assertions, and internal conflict assertions; it is divided by contract source to avoid similar clauses from the same contract from simultaneously entering the parameter selection set and the verification set. For candidate configurations, the proportion of unfounded assertions in credible outputs and the coverage of valid outputs are statistically analyzed, and the configuration with the higher coverage is selected after satisfying the pre-determined error release constraints.

[0092] Furthermore, the clause risk feature database, stored as an independent data table in the memory, stores clause types, historical dispute frequencies, basic target amount coefficients, penalty multipliers, statistical periods, statistical cutoff times, source record identifiers, and configuration versions. Historical dispute frequencies are obtained from the enterprise legal dispute ledger with access permissions, filtered according to pre-defined clause types and statistical periods. Different trial stages of the same dispute and duplicate imported records are deduplicated according to dispute identifiers. When the same dispute involves different clause types, type associations are registered separately. Historical dispute frequencies represent the event count after filtering and deduplication; dimensionless count values ​​are used when inputting natural logarithms. Records for no ledger records and records for those without ledger access are recorded separately; the latter are not treated as having a historical dispute frequency of 0.

[0093] The base target amount coefficient is obtained based on the target amount and amount tier configuration that can be located by the associated clauses. The source of the amount is stored in the contract location or the associated amount record provided by authorization, and the currency and conversion benchmark are stored together. The associated amount and the amount tier threshold are compared with the same currency and amount unit. When currency conversion is involved, the conversion benchmark saved in the task is used. When the amount is unknown, a lower amount tier is not selected because the clause itself does not have a number. The penalty multiplier is read from the configuration of the approved sensitive clause type. Types such as intellectual property ownership and confidentiality obligations can have different configurations, but the multiplier indicates the evaluation focus, and the clause type itself does not directly determine the legal consequences. When parameters are missing, the statistical period is inconsistent, or the configuration is invalid, the reason is retained and the verified fixed weight configuration is used. When parameters are missing, the fixed weight processing status is recorded.

[0094] In this implementation, the clause risk entropy is a risk intensity scalar composed of dispute counts and configuration coefficients. First, the sum of historical dispute frequencies and 1 is calculated, then the natural logarithm is taken, and subsequently multiplied by the penalty multiplier and the base amount coefficient to obtain the clause risk entropy.

[0095] Mathematical expression:

[0096] ; use This indicates the risk entropy of related clauses. Indicates the related clause number, This indicates the frequency of historical disputes related to the matching of relevant clauses. Indicates the penalty multiplier. This represents the coefficient of the basic target amount. , , and All are dimensionless numbers. It is a non-negative integer. and A positive number; multiple assertions corresponding to the same related clause read the same version of the risk record, and the risk record is associated with a fixed set of assertions according to the clause identifier.

[0097] Semantic consistency weights are updated for risk according to the following formula, resulting in unnormalized weight values. Each update starts from the initial weights saved in the task, and recalculation will not recursively decay the previous update value as the initial value:

[0098]

[0099] in, This represents the semantic consistency weight that has not yet been normalized after the update. Indicates the initial semantic consistency weight; This indicates the risk entropy of related clauses; Indicates the related clause number; This represents the weight decay control constant; Represents the natural constant; subscript This indicates that the risk update has not yet reached the normalization stage, and the subscript... This indicates the stage prior to risk updates. A positive dimensionless number. Located between 0 and 1, the exponent of the exponent term is a dimensionless number, and the update result remains non-negative.

[0100] The fact anchoring weight is updated for risk according to the following formula to obtain an unnormalized weight value. The fact anchoring weight and semantic consistency weight use the same risk record and the same weight decay control constant from the same related clause:

[0101]

[0102] in, This indicates the fact anchoring weights that have not yet been normalized after the update; Indicates the initial fact anchoring weight; This indicates the risk entropy of related clauses; Indicates the related clause number; This represents the weight decay control constant; Represents the natural constant; subscript This indicates that the risk update has not yet reached the normalization stage, and the subscript... This indicates the stage prior to risk updates. A positive dimensionless number. The fact anchor weights, which are between 0 and 1 and have not yet been normalized after the update, are between 0 and 1.

[0103] The initial weights for search relevance, compliance compliance, and logical consistency do not participate in index updates, but they do participate in subsequent common normalization. The normalization base is obtained by adding these three initial weights to the two updated values. Each value is then divided by the normalization base to obtain the final five weights used for calculating the overall confidence score. The initial five weights are non-negative and sum to 1, and the normalization base is positive under finite non-negative clause risk entropy. The normalized weights for search relevance, compliance compliance, and logical consistency may differ from the initial values, but the proportions among them remain unchanged. The scoring uses values ​​without explicit rounding; the number of decimal places in the report does not change the actual calculation.

[0104] Initial weights, weight decay control constants, and grading thresholds are selected and saved in the same annotation and verification process. Dynamic weights change the contribution of evaluation components to the numerical score, and whether the fact anchoring degree reaches a state of complete support is still determined independently by the evidence record. Even if risk updates reduce the overall confidence of the lack of evidence assertion, the original evidence gating continues to be implemented; when the fact support is complete but the compliance check score is low, the low-scoring components are also saved truthfully, and failed checks cannot be changed to passed simply because the fact anchoring degree weight is high.

[0105] The credibility level determination first reads the evidence status, then the overall confidence level. Assertions cannot be included in the credible output if not all contract fact fields are supported, references are invalid, unresolved conflicts exist, or necessary resolution status is uncertain. A credible record is output when the evidence conditions are met and the overall confidence level reaches the credibility threshold; a conditional record is output with an explanation of insufficient evaluation when the evidence conditions are met and the overall confidence level is not lower than the lower bound of the conditional interval but lower than the credibility threshold; a record awaiting review is output when neither of these two grading conditions is met. Gating only restricts the presentation of deterministic assertions; the identifier, original text, and reasons for failed assertions are still stored in the structured review report.

[0106] Step S6: Output the review results; assemble the structured review report using assertion identifiers as connectors. For each record, read the original assertion, calibration conclusion, related clauses, original text location, source and version of the knowledge fragment, five evaluation components, overall confidence level, credibility level, and reason for incomplete closure. Credible records and records to be reviewed use different status fields; the report text cannot present the original assumptions in records to be reviewed as established facts. Conditional records describe the scope of existing evidence and the insufficient evaluation conditions, enabling reviewers to identify whether supplementary factual material, applicable legal basis, or analytical results are needed.

[0107] The report summarizes the total number of fixed assertion sets, credible records, conditional records, records awaiting review, and the number of items not generated for review. Effective output coverage uses the fixed assertion set as the denominator, counting the number of assertions with complete factual support that have entered into credible output; the completion rate of all review items uses the pre-registered set of review items as the denominator. These two metrics cannot be mixed. When there is no credible output, the percentage of outputs without supporting evidence is recorded as "no denominator to calculate," not written as 0%. The report can simultaneously provide the processing status of each clause, but lengthy explanatory text cannot be used to offset clauses lacking supporting evidence.

[0108] Citation tracing is accomplished through the original text location and version identifier in the report record. Contract evidence points to the contract version received this time, knowledge evidence points to the knowledge version used this time, and historical reports maintain the ability to reference historical versions. When read permissions are insufficient, a restricted permission status is returned, and the text that the current visitor cannot read is not displayed. An integrity check is performed once before report output to ensure that each assertion identifier has a unique final state, all necessary fields have values ​​or clear reasons for missing fields, and the number of assertions matches the number of categories, preventing record omissions due to processing interruptions.

[0109] The system retains the stage status of parsing, retrieval, generation, calibration, evaluation, and output during task execution. Each stage submits its output record before writing its completion status to the task record; subsequent stages only read previously submitted inputs. In case of task failure recovery, processing continues based on stage status and version identifier; different contract versions cannot be mixed to form a single report. Supplementary inspection budgets are part of the task configuration; recovery operations cannot reset the budget without documentation. The runtime log retains the time, task identifier, input / output record identifiers, and failure reason; the log content is not considered a source of contractual facts.

[0110] To facilitate a better understanding of the present invention by those skilled in the art, the present invention will be further illustrated below with reference to specific implementation examples.

[0111] Example 1: In this example, a set of contract fragments, historical compliance samples, inspection items, and initial model output are set up. The corresponding records are formed according to the processing order of contract preprocessing, hierarchical compliance knowledge base construction, retrieval enhancement generation, semantic calibration, confidence assessment, and review result output. The initial output of the large language model is set as a fixed input, and the inspection items are executed according to the configuration in this example. Subsequent calibration results, overall confidence, and credibility level are calculated.

[0112] The contract under review is registered as Contract 1. Clause 1 states that the payer assumes the payment obligation after acceptance and receipt of a compliant invoice; Clause 2 states that the payment period is 30 days after the conditions are met; Clause 3 states that the liability limit is RMB 100,000; Clause 4 states the notification subject and written notification method, and the notification period is in accordance with Annex 1, but Annex 1 is not present in the input file. Clauses 1 to 4 are saved in their original locations. The task registers four review objects: payment trigger conditions, payment period, liability limit, and notification period. The missing reference status for the notification period was generated during preprocessing.

[0113] The sample layer contains sample procurement terms confirmed through a set review status. Payment terms in the sample include acceptance and invoice, with a liability cap of 200,000 yuan and a notification period of 5 days. Sample values ​​are only used to illustrate structure and compare differences and cannot be applied to Contract 1. Assertion 1 is configured with a non-empty payment subject role check; Assertion 2 is configured with a positive payment period check; Assertion 3 is configured with a liability cap amount unit of yuan check; and Assertion 4 is configured with two checks: a non-empty notification subject and a written notification method. The requirement that the notification period must be 5 days is not set. The legal layer in this example does not contain applicable legal knowledge fragments, and the report does not output legal conclusions.

[0114] For example, let the average similarity of the effective knowledge fragments corresponding to payment terms, payment period, liability limit, and notification period in the search records be 0.90, 0.80, 0.80, and 0.90, respectively. These four values ​​are used as the search component records input in this example. The search components are obtained according to the vector similarity processing in step S2 and the value selection rules in step S5. The enhanced context includes the original contract text and sample layer fragments, clearly distinguishing the source. The fixed initial review conclusions are: Assertion 1 "Payment is due upon acceptance"; Assertion 2 "Payment period is 30 days after the conditions are met"; Assertion 3 "Liability limit is 100,000 yuan"; Assertion 4 "Notification period is 5 days".

[0115] Assertion 1 underwent sample field alignment. The necessary condition fields are acceptance condition and invoice condition. The initial review conclusion only covers the acceptance condition, resulting in a semantic consistency of 0.50. The contract factual necessary conditions also have two items; the initial assertion fully retains one, resulting in a factual anchoring degree of 0.50. Contract clause 1 establishes a simultaneous fulfillment relationship between the two conditions, therefore it is calibrated to "Upon acceptance and receipt of a compliant invoice, the obligation to make payment is assumed," with both components becoming 1. The calibration record retains the assertion 1 identifier, missing fields, the text before and after modification, and the location of clause 1; the original contract document remains unchanged.

[0116] Assertion 2 is consistent with Clause 2, with both the payment commencement event and the 30-day period supported by the original text. Assertion 3 is consistent with Clause 3, with 100,000 yuan being a contractual fact. Although the sample liability limit is 200,000 yuan, semantic calibration still uses contractual fact-based comparison and does not change Assertion 3 to 200,000 yuan. The consistency of necessary fields, contractual fact support, and internal logic checks for Assertions 2 and 3 are all 1. All configured checks passed under this input group, resulting in a compliance score of 1. This only indicates that the configured checks passed, not that the legal compliance review of the entire contract has been completed.

[0117] Assertion 4 has the same notification period value as the sample, with a semantic consistency of 1; the two checks of "notification subject not empty" and "notification method is written" have been met and passed, resulting in a compliance degree of 1; there are no opposing notification periods within the assertion set, resulting in a logical self-consistency degree of 1. However, Contract 1 does not provide Annex 1, and the 5 days in the sample cannot be used as factual evidence for Contract 1, resulting in a fact anchoring degree of 0. A supplementary check of the annex list and its reference targets was conducted, but no new valid evidence was obtained, so the supplementary check of Assertion 4 was stopped. Assertion 4 retains its original identifier and missing evidence status, and the 5 days are not written as a calibrated contractual fact.

[0118] For example, let the weights of retrieval relevance, semantic consistency, compliance, factual anchoring, and logical consistency be 0.10, 0.25, 0.25, 0.20, and 0.20 respectively, for a total weight of 1. The confidence threshold is set to 0.75, the lower bound of the conditional interval to 0.60, and the estimated number of re-checks to be 2. The product of the five terms after calibration for assertion 1 is 0.09, 0.25, 0.25, 0.20, and 0.20, which sums to 0.99; the sum of the terms for assertions 2 and 3 is 0.98; and the product of the terms for assertion 4 is 0.09, 0.25, 0.25, 0, and 0.20, which sums to 0.79.

[0119] Evidence gating reads the factual support status of four assertions. Assertions 1, 2, and 3 have complete factual support, no unresolved conflicts, and a combined confidence level exceeding 0.75, forming three credible records. Assertion 4, although having a combined confidence level of 0.79, has a factual anchorage of 0, forming a record pending review. The content is that the attachment supporting the notification period is missing, requiring supplementary attachment verification; the 5-day period cannot be confirmed. The fixed assertion set remains four, with an effective output coverage of 3 divided by 4, or 75%. Among the three credible records, there are no unfounded assertions, and one record awaits review.

[0120] The results in this group demonstrate that calibration and gating play different roles. Source constraint calibration can correct missing conditions that are already supported by the original contract text; evidence gating can restrict sample values ​​without contract text support from entering the trusted output. Both processes share assertions and evidence records, but gating cannot create missing evidence, and calibration cannot guarantee that all assertions are corrected. When evaluating different contracts, page missing, negation, exceptions, and cross-references, the processing results for the corresponding samples are recorded separately, and failed cases are retained.

[0121] Example 2: This example further optimizes the data recording and calibration rules of Example 1 by adding a controlled computing environment within the enterprise, knowledge version binding, and context budgeting. The input interface receives contracts and reviewed knowledge. The storage is divided into a contract original text area, a knowledge original text area, and a processing record area. The processor runs the local model and retrieval and calibration programs. Access scope is passed in the retrieval request, and permissions are verified before knowledge fragments are returned. Model input / output, clause element records, and reference records are all processed in a controlled environment; external query services cannot accept requests containing sensitive contract content.

[0122] For knowledge updates, the new knowledge text and corresponding fragments are first written in, then vector encoding and indexing are completed, and finally a consistent version is submitted for new tasks to read. The executing task retains a snapshot of the version it reads, and before outputting the report, it verifies whether the references in the snapshot are invalid. If a reference is invalid but a consistent new version exists, the affected assertions are reprocessed; if recalculation cannot be completed, a record awaiting review is output. Old reports are not automatically replaced with new conclusions; historical references still point to the evidence version at that time, so as to review the formation process and prevent knowledge updates from causing past reports to lose their interpretable basis.

[0123] For example, if the context capacity is set to 8192 units, fixed instructions occupy 512 units, reserved outputs occupy 1024 units, and contractually necessary fragments occupy 2560 units, then the remaining length for knowledge fragments is 4096 units. The number of units is calculated based on the actual model's word segmentation configuration; the number of Chinese characters cannot be directly used as the number of units. When the total length of a knowledge fragment exceeds the remaining length, it is selected based on applicability and relevance, and fragments not included in the context are recorded; contractually necessary conditions are not deleted.

[0124] After the supplementary inspection returns new evidence, the association records between the evidence and assertions are read to determine the affected assertions. If the new evidence only corresponds to the notification period, assertion 4 is recalibrated and the relevant components are updated; the internal logical relationships involving the notification period are re-examined, and the payment terms and liability limits records remain unchanged. If the new evidence simultaneously changes the subject definition or global applicable conditions, the scope of impact extends to all assertions that reference this information. The boundary of partial recalculation is determined by the actual dependencies; it cannot be based solely on page location when selecting adjacent assertions, otherwise cross-clause effects may be missed.

[0125] The resource record in this embodiment includes the number of input lexical units, the number of rounds of supplementary checks, the number of recalculated assertions, and the stage time for each iteration. The resource record is used to determine the budget and verify the effect of partial recalculation, but it is not used as input for fact anchoring. When resources are insufficient, incomplete assertions can be stopped and the status output, but the evidence gating requirements cannot be lowered to increase the number of credible records. When comparing full recalculation and partial recalculation for the same fixed input, the model, retrieval set, and calibration rules are kept consistent, and the number of input lexical units, the number of recalculated assertions, and the stage time are compared using the running records.

[0126] Example 3: This example is basically the same as Example 1, except that the clause fields, applicable knowledge, and reference objects are configured according to the contract scenario. The engineering procurement contract focuses on storing delivery items, acceptance conditions, invoice conditions, payment terms, and liability limitations. The relationship between acceptance results, invoice acquisition, and payment commencement is recorded separately. Even if the payment terms in the sample are the same as in the contract, they cannot replace the verification of triggering conditions; technical acceptance requirements in the contract appendices need to be returned to the clause records through reference relationships, and a missing certificate status is retained if the appendices are not provided.

[0127] Financial credit contracts should focus on preserving the credit granting entity, guarantor, scope of guarantee, credit limit conditions, and notification conditions. When the roles of the parties change in different clauses, the corresponding sources of the roles and names should be preserved separately; the borrower's commitment should not be automatically attributed to the guarantor's commitment. The scope of the guarantee is determined through references in the main text and appendices of the contract, with separate assertions established for different debt scopes. Fields where the scope cannot be confirmed are not padded with values, nor are specific guarantee liabilities presumed based on historical samples. The report should include the location and type of missing supporting documentation in the pending review records.

[0128] Scenario configuration only changes the set of fields to be extracted and verified, applicable inspection items, and knowledge retrieval scope; it does not change source constraints or evidence gating. Experience records in personal knowledge spaces can highlight review areas of interest, but only materials that have completed review and meet the access scope can be used as historical compliance samples for formal comparison. Verification sets for different scenarios are recorded separately; the effectiveness of a credit contract cannot be directly proven by the field matching performance of a procurement contract. Reports retain completion status at the field level, enabling reviewers from different professional backgrounds to read consistent contract evidence and processing records for the same assertion.

[0129] In this embodiment, based on the processing in Embodiments 1 and 2, syntactic tree-based differential positioning and clause risk weight updates can be applied to software development outsourcing contracts. Different clauses can have different dispute records, associated amounts, and sensitive types. For example, notice period clauses and penalty percentage clauses can have their respective risk records read, without pre-assuming that a certain type has a lower risk across all contracts. Dynamic weight adjustments evaluate the contribution of the evaluation components, syntactic tree alignment locates conditions, exceptions, and negations in long sentences, and the original contract text evidence continues to determine the revised content.

[0130] For example, the amount tier configuration is set as follows: when the associated amount is greater than or equal to RMB 1,000,000, the base target amount coefficient is 1.5; when the associated amount is less than RMB 1,000,000, it is 1.0. Sensitive type configuration includes intellectual property ownership and confidentiality obligations; the penalty multiplier for sensitive clauses is 2.0, and for non-sensitive clauses, it is 1.0. The amount tier, sensitivity type, and multiplier are all input as task configuration and saved in a version. The following calculations assume that the associated amount has been determined by an independent amount record and falls within the tier below RMB 1,000,000, with a base target amount coefficient of 1.0; empty numerical fields in the clause text are not used as the basis for determining the amount tier.

[0131] For example, suppose the contract under review is registered as Contract 2, which is a software development outsourcing contract. Clause 5 states: "All source code and related technical documents generated by Party B in the course of performing this contract shall belong to Party A in their entirety from the date of acceptance; without Party A's written consent, Party B shall not use the source code for any third-party project, except for general-purpose underlying libraries publicly available in the open-source community." The preprocessing and knowledge building module saves the original text of Clause 5, recording ownership and use as separate actions. The subject roles are associated with Party A and Party B respectively, and the objects are associated with the source code and related technical documents respectively. The condition for ownership is the date of acceptance, while the use action retains the conditions of Party A's written consent, the prohibition of use for third-party projects, and the exception of general-purpose underlying libraries publicly available in the open-source community. The numerical fields in the main text of Clause 5 are empty, and the referenced monetary level records are saved separately.

[0132] For example, a historical compliance sample might be: "All results generated by Party B during the development process shall be owned by Party A from the date of delivery; Party B shall not provide the results to any third party." The retrieval enhancement generation module organizes the historical compliance sample and Clause 5 of Contract 2 into the corresponding source areas of the enhancement context. The initial review conclusion is set as a fixed input, split into Assertion 5 "The intellectual property rights of the source code and documentation shall belong to Party A from the date of delivery" and Assertion 6 "Party B is unconditionally prohibited from using the source code for third-party projects." Assertions 5 and 6 are assigned fixed identifiers before the first evaluation and are not subsequently replaced by renumbering of failure records.

[0133] For assertion 5, the root node of the first syntactic dependency tree is "Attribution," the subject field is "Party A," the object field is "Source Code and Documentation," and the condition field is "Delivery Date." The second syntactic dependency tree is formed from historical compliant samples, and the delivery date also appears in the sample condition node. Direct comparison between the two cannot detect deviations in the starting event. Therefore, the semantic calibration module reads the original contract's syntactic dependency tree, uses the acceptance date as the limiting evidence to define the starting event in the comparison tree, and saves the correspondence between the source code and documentation and the source code and related technical documents in the original contract as the field normalization record for this example. If the normalized correspondence cannot be confirmed, the object field is left in a pending review state.

[0134] Perform a legal tree editing path calculation on the first syntactic dependency tree and the evidence constraint comparison tree, identifying the difference between the delivery date and the acceptance date at the condition field position. Using the replacement cost of 1 (different values ​​for the same field type in this example), a condition field replacement record is formed; the replacement cost for the remaining verified fields is 0, and the editing path of the complete tree retains the node source and parent-child relationships. The difference record includes the assertion 5 identifier, condition field, conclusion, and the sample reference value delivery date, the contract evidence value acceptance date, and the original text position of Clause 5. This difference belongs to the starting event conflict and is not registered as having no condition field at all.

[0135] For assertion 6, the first syntactic dependency tree contains neither a written consent condition from Party A nor an exception node for a publicly available general underlying library. The two restrictions in the original contract syntactic dependency tree are attached to source code usage behavior and cannot be transferred to intellectual property attribution behavior. The evidence constraint comparison tree retains both restrictions, with each edit path generating a corresponding insertion operation. Each insertion has a cost of 1, and the inconsistency between "unconditional" and the existence of a restriction condition is recorded in the corresponding difference record. Insertion operations locate missing fields, and conflicting qualifiers are retained as conflict fields. Multiple records are associated with assertion 6, and only one is retained simply because they belong to the same assertion.

[0136] When the original contract text uniquely identifies the starting event, assertion 5 will be calibrated to "The intellectual property rights of the source code and documentation belong to Party A from the date of acceptance." For assertion 6, it will be calibrated to "Without Party A's written consent, Party B shall not use the source code for third-party projects, except for publicly available general-purpose underlying libraries in the open-source community." The calibration record will save the text before modification, the text after modification, the modified fields, the path to the edited node, and the original location of clause 5. Party A, as the party providing written consent, will be retained in the calibration text; written consent from an unspecified party cannot replace the original contractual relationship.

[0137] For example, in risk records with a fixed statistical period and deduplicated criteria, let the historical dispute frequency of intellectual property ownership clauses be 12, the base amount coefficient be 1.0, and the penalty multiplier be 2.0. Adding the historical dispute frequency to 1 gives 13. The natural logarithm of 13 is 2.5649493574615367. Multiplying this by 2.0 and 1.0 yields the clause risk entropy of 5.1298987149230735. Assertions 5 and 6 both read the current risk record related to clause 5. The calculated value can be displayed as 5.13 in the report, and subsequent scoring uses the calculated value without explicit rounding.

[0138] For example, the initial retrieval relevance weight is set to 0.20, the initial semantic consistency weight to 0.30, the initial compliance weight to 0.15, the initial factual anchoring weight to 0.20, the initial logical consistency weight to 0.15, and the weight decay control constant to 0.5. The product of the weight decay control constant and the clause risk entropy is multiplied by the negative of the result, which is used as the exponent. The exponent calculation yields 0.07692307692307693, displayed as 0.077. The initial semantic consistency weight multiplied by the exponent calculation result is 0.023076923076923078, displayed as 0.023; subtracting the product of 0.80 and the exponent calculation result from 1 yields the updated, unnormalized factual anchoring weight of 0.9384615384615385, displayed as 0.938.

[0139] The initial weights for retrieval relevance (0.20), semantic consistency (0.023076923076923078), compliance (0.15), factual anchoring (0.9384615384615385), and logical consistency (0.15) are added together to form a normalized base of 1.4615384615384615. If the report displays the rounded median values, the sum of the median values ​​would be 1.461, but the actual normalization continues to use the unarounded base. The final weights are 0.1368421052631579, 0.015789473684210527, 0.10263157894736842, 0.6421052631578947 and 0.10263157894736842 respectively; the sum of the internally calculated weights is 1.

[0140] Table 1 lists the weight calculation results under fixed input in this example. The relative rate of change is calculated by dividing the difference between the final weight and the initial weight by the initial weight and then multiplying by 100%. Only the displayed values ​​are retained in the table; the displayed values ​​are not read for the scoring.

[0141] Table 1 is a comparison table for weight allocation calculation;

[0142]

[0143] When the final weights are displayed to only three decimal places, they are 0.137, 0.016, 0.103, 0.642, and 0.103 respectively, with a sum of 1.001. Therefore, the displayed values ​​cannot be directly used as scoring weights. Risk updates increase the numerical contribution of fact anchoring and decrease the numerical contribution of semantic consistency. When the fact anchoring is 0 and the other four evaluation components are all 1, the upper bound of the overall confidence level in this example is 0.35789473684210527; the overall confidence level for the same input under the initial fixed weights is 0.80. Both configurations are still subject to fact evidence gating; assertions lacking evidence cannot enter the credible output, and the numerical difference is used to express changes in evaluation contribution.

[0144] For calibrated assertions 5 and 6, the fact anchoring degree is registered as 1 only when all necessary fact fields have been verified in the original text. For example, assuming the relevance of this search is 0.90, and semantic consistency, compliance, and logical consistency are all 1, the latter three components correspond to all necessary fields matching, all applicable checks passing, and no internal conflicts in the checked relationships, respectively. After adding the weighted products of the five components, the overall confidence of each assertion is 0.9863157894736843. A score higher than 0.90 is the calculation result of this set of complete component inputs. When the evidence status meets the requirements of complete support, valid citation, and no unresolved conflicts, assertions 5 and 6 are entered into the trusted record according to the configured threshold; if any condition is not met, the original hierarchical rules are executed.

[0145] The report output module assembles calibration conclusions, evidence status, and overall confidence levels, listing conflicting initiating events for assertion 5 and omissions in written consent conditions and exceptions for assertion 6, and saving the tree editing path and dynamic weight components. The report retains insertion, replacement, and verification records, using the original assertion identifier to trace statements before and after correction. Weight records save the source of risk parameters, statistical period, and configuration version, and do not use historical dispute ledgers as evidence of specific factual values ​​in contracts.

[0146] For example, using the same 8192 lexical units, 512 fixed lexical units, 1024 reserved output lexical units, and 2560 contractually necessary fragments as in Example 2, the upper limit of the number of lexical units for retrieving knowledge fragments is 4096. Assuming a complexity baseline threshold of 3 and a scaling factor of 1, when the structural complexity is 3, the budgeted value is 2048, rounded down to 2048 lexical units; when the structural complexity is 4, the budgeted value is 1101.5840619315, yielding 1101 lexical units; when the structural complexity is 5, the budgeted value is 488.25516860259347, yielding 488 lexical units. All three calculations retain the original contractually necessary fragments, only changing the number of retrieved knowledge fragments that can enter the enhanced context.

[0147] For example, if the budget is 1101 terms, and the lengths of the complete knowledge fragments after applicability screening and sorting are 600, 400, and 300 terms respectively, the first two fragments total 1000 terms and can be included in the enhancement context. Adding a third fragment would bring the total to 1300 terms, therefore the third fragment will not be included in this enhancement context and the reason for the reduction will be recorded. The fragment length includes the source identifier and corresponding separator usage; the remaining portion cannot be registered as a complete fragment after removing negative or exceptional text from the third fragment. If subsequent missing certificate fields are related to the third fragment, the supplementary inspection process will read the reduction record and process it under the original budget and termination conditions.

[0148] Field location evaluation uses both regular expression matching and syntactic tree edit distance alignment methods, comparing results under the same contracts, initial review assertions, field definitions, and manual annotations. Missing field recall is calculated by dividing the number of correctly located missing fields by the total number of annotated missing fields; conflicting field recall is calculated by dividing the number of correctly located conflicting fields by the total number of annotated conflicting fields. Alignment out-of-bounds false positive rate is calculated by dividing the number of report records that located incorrect clauses, incorrect behaviors, or incorrect condition ranges by the total number of all field location report records. Records without a corresponding denominator are not included in the calculation and are not replaced with 0.

[0149] For example, suppose the evaluation set contains 500 assertions with nested clauses and exception conditions, using the percentages listed in Table 2 as the given input in the comparison description. Each assertion can correspond to multiple missing or conflicting fields, and the 500 assertions are not the total number of fields for the two recall rates; the evaluation record simultaneously saves the numerator, denominator, annotation version, model version, and runtime configuration for each ratio, with field counts saved according to the annotation set, and percentages not used to reverse-determine the number of fields. In the table, the two layers of the regular expression method represent the processing depth corresponding to the rule configuration, while the processing depth of the syntax tree method is determined by the parsing results and resource boundaries.

[0150] Table 2 shows the records of field location conditional comparisons;

[0151]

[0152] Arithmetic comparisons of the given values ​​in Table 2 show a 25.8 percentage point difference in recall for missed fields, a 23.6 percentage point difference in recall for conflicting fields, and a 16.3 percentage point difference in false positive rates for alignment out-of-bounds errors. Syntactic tree alignment utilizes the dependency relationships of field nodes and contractual evidence to limit the comparison scope, enabling the location of conditional fields separated by long modification structures; however, the specific location results still depend on parsing and annotation. Normalizing the field order reduces the impact of surface arrangement differences, while ancestor relationships and the scope of conditional action are preserved. Structural alignment cannot be described as being unaffected by word order, parsing errors, or arbitrary nesting depths. Actual evaluation uses the same criteria to register field counts, which form various indicators and failure records.

[0153] Comparative Example 1: This comparative example uses the same contract 1, sample layer content, 4 initial assertions, retrieval relevance, applicable inspection items, 5 weights, confidence threshold, supplementary inspection budget, and evidence gating as Example 1, only disabling the action of correcting missing located fields based on the original contract text. Semantic comparison and difference records of the samples are retained, and the initial review conclusions directly enter the evaluation after inspection. Retrieval matching and result evaluation remain unchanged, forming a univariate comparison with only field calibration actions disabled.

[0154] Assertion 1 maintains the "payment upon acceptance" standard, with a semantic consistency of 0.50, a factual anchoring degree of 0.50, a retrieval relevance of 0.90, and compliance and logical consistency of 1. The products of these five factors are 0.09, 0.125, 0.25, 0.10, and 0.20, respectively, resulting in a comprehensive confidence level of 0.765. Evidence gating remains effective, and Assertion 1 is placed in the pending review record because not all necessary factual conditions are supported. Assertions 2 and 3 maintain a confidence level of 0.98 and are considered credible records. Assertion 4 maintains a confidence level of 0.79 but has a factual anchoring degree of 0, and remains a pending review record.

[0155] This comparative example has 2 trusted records and 2 records pending review, with an effective output coverage of 2 divided by 4, or 50%. Example 1 has 3 trusted records, with a coverage of 75%, a difference of 25 percentage points. Neither configuration included the missing assertion in the trusted output. Under the same gating, source constraint calibration recovered one valid assertion that could be corrected by the original text, corresponding to the change in effective output coverage. The notification period not provided in the original text still could not be recovered, indicating that the repair capability depends on the evidence, not the degree of semantic similarity.

[0156] Comparative Example 2: This comparative example uses all the inputs, retrieval processes, field calibration, supplementary checks, fixed assertion sets, five evaluation components, weights, and confidence thresholds of Example 1, except that the restriction prohibiting access to confident outputs when factual evidence is missing is disabled. The confidence level is determined solely based on the overall confidence level, and internal conflict checks are still performed according to the original rules. The initial model output remains unchanged, and the effectiveness of the factual evidence gating is compared using the grading results under the same inputs.

[0157] The overall confidence levels of assertions 1, 2, 3, and 4 remain at 0.99, 0.98, 0.98, and 0.79, respectively, all above 0.75. After disabling the factual evidence gating, assertion 4 enters the credible output, but the factual values ​​for the 5th day still only come from the sample, and Annex 1 of Contract 1 is still missing. One of the four credible records lacks factual basis in the contract, and the proportion of assertions without basis is 1 divided by 4, i.e., 25%. In Example 1, assertion 4 is retained as a record pending review, and there are no assertions without basis in the three credible records; the difference is only caused by the factual evidence gating, not by changes in weights.

[0158] The two comparative examples illustrate that using only gating will preserve recoverable failed assertions while reducing effective output coverage; using only calibration and outputting by weighted score may allow assertions without factual basis but with high remaining components to pass. The output evidence state of source constraint calibration continues to be read by evidence gating, allowing recoverable content to be restored and restricting unrecoverable content.

[0159] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the invention.

[0160] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. It should be noted that any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for suppressing illusions in contract review by integrating enhanced retrieval with compliance semantic comparison, executed by a computer, characterized in that: include: Analyze the contract to be reviewed and generate a record of the clause elements with their original text locations; Historical compliance samples and regulatory knowledge fragments are registered by source and vectorized in a hierarchical manner to construct a hierarchical compliance knowledge base; Based on the clause element records, retrieve the hierarchical compliance knowledge base, obtain applicable knowledge fragments, construct an enhanced context and input it into a large language model, generate initial review conclusions and structured field candidates, and break down the initial review conclusions into verifiable assertions and assign assertion identifiers. When comparable historical compliance samples exist, the initial review conclusions are aligned with the historical compliance samples to form a discrepancy record; when no comparable historical compliance samples exist, the state of no comparable samples is registered; based on the discrepancy record or the state of no comparable samples, the original contract evidence is located, the contract fact fields are calibrated only based on the original contract evidence, the missing evidence state and assertion identifier are retained, the missing evidence fields are supplemented and recalibrated, and the process stops when any of the following conditions are met: all discrepancy records to be supplemented for the current assertion are closed, no new evidence is added, or the supplementation budget is reached; On a fixed set of assertions that retains all assertion identifiers, a comprehensive confidence score is calculated based on retrieval relevance, semantic consistency, compliance, factual anchoring, and logical self-consistency. Only assertions with complete factual evidence and resolved conflicts are allowed to enter the trusted output. Based on the overall confidence level and the state of evidence, a credibility level is determined, and a structured review report is output, which includes the calibration conclusion, the original text location, the knowledge source, and the records to be reviewed.

2. The method for suppressing illusions in contract review by integrating enhanced retrieval and compliance semantic comparison as described in claim 1, characterized in that: The construction of a hierarchical compliance knowledge base includes: storing historical compliance samples and regulatory knowledge fragments in the sample layer and the regulatory layer respectively, and registering the knowledge source, applicable subject, applicable matters, validity period, review status, version identifier and access scope; filtering knowledge fragments according to applicable conditions and access scope before vector retrieval, and verifying the version consistency between knowledge fragments and original knowledge texts before constructing enhanced context.

3. The method for suppressing illusions in contract review by integrating enhanced retrieval and compliance semantic comparison as described in claim 1, characterized in that: Constructing the enhanced context includes: setting up a contract original text area, a historical compliance sample area, and a regulatory knowledge fragment area respectively; registering the source type and fragment identifier for the knowledge fragments entering the enhanced context; splitting the initial review conclusions generated by the large language model into assertions corresponding to verifiable propositions, and assigning and registering assertion identifiers, related clauses, fact fields, basis identifiers, and conclusion types by post-processing; and rejecting the registration of non-existent basis identifiers as valid references.

4. The method for suppressing illusions in contract review by integrating enhanced retrieval and compliance semantic comparison as described in claim 1, characterized in that: The process of creating discrepancy records includes: comparing conditional connections, numerical values, negative states, and exceptional conditions between clauses that match the subject roles, behaviors, and objects, and recording omitted fields, conflicting fields, and fields lacking evidence; when the original contract evidence can uniquely determine the content of a conflicting or omitted field, field calibration is performed using the original contract evidence; when the original contract evidence cannot uniquely determine the field content, the state of lacking evidence is retained, and the factual values ​​in historical compliance samples are restricted to semantic comparison only, with the calibration values ​​of contract factual fields based on the original contract evidence.

5. The method for suppressing illusions in contract review by integrating enhanced retrieval and compliance semantic comparison as described in claim 4, characterized in that: The dependency parsing model is used to analyze the initial review conclusion, historical compliance samples and related contract texts respectively. With the corresponding behavior field as the root node, the subject, object, condition, value, negative state and exception condition are mapped to the node with source position and dependency relationship. The field structure of the historical compliance sample is used as the comparison reference, and the factual values, conditional relationships and exception relationships that can be determined in the contract text are used to form the evidence limitation comparison tree. Tree edit distance calculation is performed on the syntactic dependency tree and evidence constraint comparison tree corresponding to the initial review conclusion. The minimum cost path is determined among the edit paths that satisfy the field type and ancestor relationship constraints. The field corresponding to the inserted node is registered as the missing field, the field corresponding to the replaced node is registered as the conflict field, and the statement corresponding to the deleted node is registered as the redundant statement. Difference records are generated by combining the original position of the contract.

6. The method for suppressing illusions in contract review by integrating enhanced retrieval and compliance semantic comparison as described in claim 1, characterized in that: The supplementary inspection of missing evidence fields includes: forming a supplementary inspection topic based on the related clauses, missing evidence fields, and reference relationships in the discrepancy records; supplementing the inspection in the contract to be reviewed and the knowledge fragments that meet the access scope and validity period; recalibrating after associating the new evidence with the original assertion identifier; terminating the supplementary inspection when any of the following conditions are met: all discrepancy records to be supplemented for the current assertion are closed, no new valid evidence is obtained from the supplementary inspection, or the number of supplementary inspections reaches the configuration budget, and unclosed discrepancy records are retained as records to be reviewed.

7. The method for suppressing illusions in contract review by integrating enhanced retrieval and compliance semantic comparison as described in claim 1, characterized in that: The overall confidence score is obtained by multiplying the search relevance, semantic consistency, compliance, fact anchoring, and logical consistency by their respective non-negative weights and then adding them together. The sum of the corresponding non-negative weights is 1. For evaluation components that lack the necessary inputs required for calculating related evaluation components, the reason for the missing component is recorded and the component is included in the calculation as 0. The missing component is included in the calculation and the weights of the remaining components remain unchanged. When the fact anchoring degree does not reach the point where all the necessary fact fields that must be supported by the contract under review are supported, the overall confidence degree alone cannot make the assertion enter the credible output.

8. The method for suppressing illusions in contract review by integrating enhanced retrieval and compliance semantic comparison as described in claim 7, characterized in that: Establish a clause risk feature database, storing clause types, historical dispute frequencies, basic target amount coefficients, and penalty multipliers; take the natural logarithm of the sum of the historical dispute frequencies of matched related clauses and 1, then multiply it by the penalty multiplier and the basic target amount coefficient to obtain the clause risk entropy; before calculating the overall confidence level, update the semantic consistency weight and fact anchoring weight according to the following formulas respectively: in, This represents the semantic consistency weight that has not yet been normalized after the update. Indicates the initial semantic consistency weight; This indicates the risk entropy of related clauses; Indicates the related clause number; This represents the weight decay control constant; Represents the natural constant; subscript This indicates that the risk update has not yet reached the normalization stage, and the subscript... This indicates the stage prior to risk updates; in, This indicates the fact anchoring weights that have not yet been normalized after the update; Indicates the initial fact anchoring weight; This indicates the risk entropy of related clauses; Indicates the related clause number; This represents the weight decay control constant; Represents the natural constant; subscript This indicates that the risk update has not yet reached the normalization stage, and the subscript... This indicates the stage before risk updates; the initial weights of search relevance, compliance, and logical consistency are not included in the risk update. The three initial weights and the two updated but not yet normalized weights are divided by the sum of the five values ​​to obtain the non-negative weights used to calculate the overall confidence level. The weight decay control constant is positive, the clause risk entropy is non-negative, the sum of the five normalized weights is 1, and the factual evidence gate continues to be implemented after the weight update.

9. The method for suppressing illusions in contract review by integrating enhanced retrieval and compliance semantic comparison as described in claim 2, characterized in that: The original knowledge text, vector index, and citation records are linked by version identifiers; when knowledge changes, a new version identifier is generated, the old version is set to invalid, and retrieval is enabled for new review tasks after submitting a consistent version of the original knowledge text and the corresponding vector index. Before outputting the structured review report, review the version status of the cited records, and re-retrieve or output records to be reviewed for expired or inconsistent citations.

10. The method for suppressing illusions in contract review by integrating enhanced retrieval and compliance semantic comparison as described in claim 6, characterized in that: Based on the context capacity of the large language model, the enhanced context budget is set. While retaining the contract fact field and the associated source identifier, the knowledge fragments are selected to enter the enhanced context according to their relevance and applicability. After obtaining new evidence through supplementary inspection, the affected assertions are determined according to the relationship between the assertions and the evidence. Only the affected assertions are calibrated and their components are updated, and the logical conflict relationships involving the affected assertions are reviewed.

Citation Information

Patent Citations

  • Text review method and device, computer readable storage medium and electronic equipment

    CN120297997A

  • Risk review method and system for contract terms

    CN120688485A