Contract auditing method, device and equipment based on large model and storage medium

Through a large-model-based contract review method, optical character recognition and natural language processing technologies are used to parse contract documents, build a knowledge graph of contractual relationships, and combine dynamic rule engines and domain knowledge bases to perform clause verification and risk assessment. This solves the shortcomings of the existing system in adaptability and accuracy, and achieves efficient and intelligent contract review and revision.

CN120725615APending Publication Date: 2025-09-30INSPUR ENTERPRISE CLOUD TECHNOLOGY (SHANDONG) CO LTD
View PDF 0 Cites 5 Cited by

Patent Information

Application Number
CN202510916581.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-03
Publication Date
2025-09-30

AI Technical Summary

Technical Problem

Existing contract review systems are difficult to adapt to different contract types and complex semantic scenarios, have a high false alarm rate, are unable to effectively identify the correlation between contract elements, lack the ability to dynamically reason with large models, and are unable to deal with new legal issues.

Method used

A large-model-based contract review method is adopted to parse contract documents through optical character recognition and natural language processing technology, generate structured parsing fragments, and build a contract relationship knowledge graph. The dynamic rule engine and domain knowledge base are combined to perform clause verification and risk assessment, and generate revision suggestions.

Benefits of technology

It significantly improves the automation level and accuracy of contract review, improves review efficiency and risk coverage, and provides enterprises with efficient and reliable contract revision solutions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120725615A_ABST
    Figure CN120725615A_ABST
Patent Text Reader

Abstract

The invention discloses a contract auditing method and device based on a large model, equipment and a storage medium, and relates to the technical field of artificial intelligence, and the method comprises the steps: analyzing a target contract file based on an optical character recognition technology and a natural language processing technology, and generating a target structured analysis fragment corresponding to the target contract file; constructing a contract relation knowledge graph based on the target structured analysis fragment by using the target large model, and generating a target structured data table; verifying each contract term in the target structured data table based on a dynamic rule engine, and generating an early warning report based on a verification result; performing risk assessment on contract terms in the target structured data table based on the target domain knowledge base, the target large model and the contract relation knowledge graph to generate risk data; and generating a revision suggestion based on the early warning report and the risk data by using the target large model, and revising the target contract file based on the revision suggestion. According to the invention, the automation level and accuracy of contract auditing can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a contract review method, device, equipment and storage medium based on a large model. Background Art

[0002] In business activities, contracts are the core legal documents that govern the rights and obligations of both parties to a transaction. The compliance, completeness, and logical rigor of their clauses directly impact a company's legal risks. Traditional contract review relies primarily on manual review by legal personnel, which is plagued by low efficiency, risk of omissions, inconsistent standards, and lagging knowledge updates.

[0003] Currently, some contract review tools use rule engines or simple NLP (Natural Language Processing) technology for keyword matching, but these tools still have the following limitations: First, fixed-rule review systems struggle to adapt to diverse contract types and complex semantic scenarios, resulting in high false positive rates and weak rule generalization. Second, traditional methods are unable to effectively identify the correlations between contract elements, such as the logical dependency between "payment terms" and "performance deadlines," leading to insufficient extraction of structured information. Third, existing systems often rely on simple matching based on pre-built regulatory libraries, lacking the dynamic reasoning capabilities of large models and making it difficult to address emerging legal issues.

[0004] To sum up, how to improve the automation level and accuracy of contract review is a technical problem that needs to be solved urgently. Summary of the Invention

[0005] In view of this, the purpose of the present invention is to provide a contract review method, device, equipment and storage medium based on a large model, which can improve the automation level and accuracy of contract review. The specific scheme is as follows:

[0006] In a first aspect, this application provides a contract review method based on a large model, including:

[0007] Obtaining a target contract document, and parsing the target contract document based on optical character recognition technology and natural language processing technology to generate a target structured parsed segment corresponding to the target contract document;

[0008] Using the target big model to construct a contractual relationship knowledge graph corresponding to the target contract document based on the target structured parsed fragments, and generating a corresponding target structured data table;

[0009] Verify each contract clause in the target structured data table based on a pre-configured dynamic rule engine, and generate a corresponding early warning report based on the verification results;

[0010] Performing a risk assessment on the contract terms in the target structured data table based on the target domain knowledge base, the target large model, and the contract relationship knowledge graph to generate corresponding risk data;

[0011] The target big model is used to generate corresponding revision suggestions based on the early warning report and the risk data, and the target contract document is revised based on the revision suggestions.

[0012] Optionally, the parsing of the target contract document based on optical character recognition technology and natural language processing technology to generate a target structured parsed segment corresponding to the target contract document includes:

[0013] Determining a target format of the target contract document, and determining a text extraction method corresponding to the target contract document based on the target format, the optical character recognition technology, and the natural language processing technology;

[0014] Extracting target text content from the target contract file based on the text extraction method;

[0015] Divide the target text content into various content areas based on a preset layout analysis algorithm and the target contract document; the content areas include a text area, a table area, and a signature area;

[0016] The target structured parsed segment corresponding to the target contract document is generated based on the content areas corresponding to the target text content.

[0017] Optionally, generating the target structured parsed segment corresponding to the target contract document based on each content area corresponding to the target text content includes:

[0018] Acquire several contract templates, divide each contract template into content area templates corresponding to each contract template, and train an initial model using each content area template to obtain a corresponding contract structure recognition model; the initial model is a model constructed based on an attention mechanism;

[0019] Using the contract structure recognition model, identifying chapter boundaries in each content area corresponding to the target text content, dividing each content area based on the chapter boundaries, and semantically annotating each segment in each divided content area to obtain corresponding semantic annotation results;

[0020] Adding each of the segments to a target segment list, determining the first segment in the target segment list as a current segment, determining a target semantic similarity between the current segment and a next segment based on a preset similarity algorithm, and determining a target similarity threshold corresponding to the current segment and the next segment based on a preset threshold adaptive algorithm;

[0021] If the target semantic similarity exceeds the target similarity threshold, merging the current segment with the next segment and determining the merged segment as the current segment; or, if the target semantic similarity does not exceed the target similarity threshold, determining the next segment as the current segment;

[0022] Jumping to the step of determining the target semantic similarity between the current segment and the next segment based on a preset similarity algorithm until the segments in the target segment list are processed to obtain the target segments;

[0023] The target structured parsed segment corresponding to the target contract document is generated based on the target segments and the semantic annotation results corresponding to the target segments.

[0024] Optionally, the target macro model is used to construct a contractual relationship knowledge graph corresponding to the target contract document based on the target structured parsed fragments, and a corresponding target structured data table is generated, including:

[0025] Using the target large model to identify each target entity in the target structured parsed segment, and performing relationship extraction on each target entity to obtain corresponding relationship extraction results;

[0026] Determining a target construction order based on a top-down order and a bottom-up order, taking the target entity as a node, and establishing connections between nodes corresponding to different target entities having associated relationships according to the target construction order and the relationship extraction result, so as to obtain the contract relationship knowledge graph corresponding to the target contract document;

[0027] The target structured data table corresponding to the target contract document is generated based on the contract relationship knowledge graph and the target entities.

[0028] Optionally, the pre-configured dynamic rule engine verifies each contract clause in the target structured data table and generates a corresponding early warning report based on the verification result, including:

[0029] Obtaining a number of verification instructions, and converting the natural language corresponding to each of the verification instructions into a target verification rule;

[0030] Setting a priority corresponding to each of the target verification rules, and configuring the dynamic rule engine and the preset visual rule editor based on each of the target verification rules and the priority corresponding to each of the target verification rules;

[0031] Using the preset visual rule editor, based on the dynamic rule engine, the contract clauses in the target structured data table are verified to identify and highlight target contract clauses in the target structured data table that are formatted incorrectly, and output corresponding error type codes;

[0032] The early warning report is generated based on the target contract clause and the error type code corresponding to the target contract clause.

[0033] Optionally, the risk assessment of the contract terms in the target structured data table based on the target domain knowledge base, the target large model, and the contract relationship knowledge graph to generate corresponding risk data includes:

[0034] Build the target domain knowledge base based on legal and regulatory data, industry standard data, and historical risk data;

[0035] Determining key nodes in the contractual relationship knowledge graph, and determining a number of contract clauses to be evaluated from the contract clauses in the target structured data table based on target entities corresponding to the key nodes;

[0036] Using the target macro model, determining the semantic similarity between each of the contract clauses to be evaluated and each clause data in the target domain knowledge base, and determining the contract clauses to be evaluated corresponding to the semantic similarity that meets a preset high similarity interval condition as high-risk clauses, and determining reference clause data corresponding to the high-risk clauses in the target domain knowledge base;

[0037] The target macro model is used to determine the risk probability score corresponding to the high-risk clause, and the risk data is generated based on the high-risk clause, the risk level label corresponding to the high-risk clause, the risk probability score and the reference clause data.

[0038] Optionally, after revising the target contract document based on the revision suggestion, the method further includes:

[0039] Comparing the revised target contract document with the target contract document before the revision, generating a corresponding difference comparison report based on the comparison results, and displaying the difference comparison report;

[0040] Obtain the audit opinion corresponding to the revised target contract document, update the parameters of the target large model based on the audit opinion, and generate a corresponding audit log based on the audit opinion.

[0041] In a second aspect, the present application provides a contract review device based on a large model, comprising:

[0042] a structured parsed segment generation module, configured to obtain a target contract document and parse the target contract document based on optical character recognition technology and natural language processing technology to generate a target structured parsed segment corresponding to the target contract document;

[0043] a structured data table generation module, configured to construct a contractual relationship knowledge graph corresponding to the target contract document based on the target structured parsed fragments using a target macro model, and generate a corresponding target structured data table;

[0044] An early warning report generation module, configured to verify each contract clause in the target structured data table based on a pre-configured dynamic rule engine, and generate a corresponding early warning report based on the verification result;

[0045] a risk data generation module, configured to perform a risk assessment on the contract terms in the target structured data table based on the target domain knowledge base, the target macro model, and the contract relationship knowledge graph to generate corresponding risk data;

[0046] The target contract document revision module is used to generate corresponding revision suggestions based on the early warning report and the risk data using the target macro model, and to revise the target contract document based on the revision suggestions.

[0047] In a third aspect, the present application provides an electronic device, comprising:

[0048] Memory, used to store computer programs;

[0049] A processor is used to execute the computer program to implement the aforementioned large model-based contract review method.

[0050] In a fourth aspect, the present application provides a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the aforementioned large-model-based contract review method is implemented.

[0051] In this application, the target contract document is first obtained, and the target contract document is parsed based on optical character recognition technology and natural language processing technology to generate a target structured parsed fragment corresponding to the target contract document; then, the target big model is used to construct a contract relationship knowledge graph corresponding to the target contract document based on the target structured parsed fragment, and a corresponding target structured data table is generated; then, based on a pre-configured dynamic rule engine, each contract clause in the target structured data table is verified, and a corresponding early warning report is generated based on the verification result; then, based on the target domain knowledge base, the target big model and the contract relationship knowledge graph, a risk assessment is performed on the contract clauses in the target structured data table to generate corresponding risk data; finally, the target big model is used to generate corresponding revision suggestions based on the early warning report and the risk data, and the target contract document is revised based on the revision suggestions. As can be seen from the above, in this application, the target contract document is first parsed based on optical character recognition technology and natural language processing technology to generate a target structured parsed fragment of the target contract document; then the target structured parsed fragment is input into the target big model, and the target big model is used to construct a contract relationship knowledge graph and generate a target structured data table; then the dynamic rule engine is used to verify each contract clause in the target structured data table and generate an early warning report; then the target domain knowledge base, the target big model and the contract relationship knowledge graph are used to conduct a risk assessment of the contract clauses in the target structured data table and generate risk data; finally, the target big model can be used to generate revision suggestions based on the early warning report and risk data, and the target contract document can be revised based on the revision suggestions. In this way, this application can introduce big model technology, and combine the dynamic rule engine with the domain knowledge base to realize the intelligent upgrade of contract review, significantly improve the efficiency, accuracy and risk coverage of the review, and provide enterprises with efficient and reliable contract revision solutions. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0053] Figure 1 A flow chart of a contract review method based on a large model provided for this application;

[0054] Figure 2 A schematic diagram of a specific contractual relationship knowledge graph provided for this application;

[0055] Figure 3A specific four-layer hybrid index architecture design diagram provided for this application;

[0056] Figure 4 A specific constraint text architecture design diagram provided for this application;

[0057] Figure 5 A schematic diagram of the structure of a contract review device based on a large model provided for this application;

[0058] Figure 6 This is a structural diagram of an electronic device provided in this application. DETAILED DESCRIPTION

[0059] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0060] At present, some contract review tools use rule engines or simple NLP technology for keyword matching, but there are still the following limitations: First, the review system based on fixed rules is difficult to adapt to different contract types and complex semantic scenarios, and the false alarm rate is high, resulting in weak rule generalization ability. Second, traditional methods cannot effectively identify the correlation between contract elements, such as the logical dependency between "payment terms" and "performance period", resulting in insufficient extraction of structured information. Third, most existing systems are based on simple matching based on preset legal libraries, lack the use of dynamic reasoning capabilities of large models, and are difficult to deal with new legal issues. To this end, this application provides a contract review solution based on a large model, which can improve the automation level and accuracy of contract review.

[0061] In a specific embodiment, the large-model-based contract review solution of the present application may specifically include a content recognition module, an element extraction module, an error warning module, a risk identification module, and a suggestion generation module. The content recognition module parses the contract text through OCR (Optical Character Recognition) and natural language processing technology, and splits the contract into structured parsed segments based on the parsing results; the element extraction module uses a pre-trained large model to identify the entities and relationships between entities in the contract and generates structured data; the error warning module detects format errors, logical contradictions, or missing clauses through a dynamic rule engine; the risk identification module combines the domain knowledge base with large-model reasoning to evaluate the compliance of clauses and risk levels; the suggestion generation module matches the legal clause vector library based on the error warning results and risk identification results, and automatically generates modification suggestions and alternative texts.

[0062] See also Figure 1 As shown, the embodiment of the present invention discloses a contract review method based on a large model, which may include:

[0063] Step S11: Acquire a target contract document, and parse the target contract document based on optical character recognition technology and natural language processing technology to generate a target structured parsed segment corresponding to the target contract document.

[0064] In this embodiment, the above-mentioned parsing of the target contract document based on optical character recognition technology and natural language processing technology to generate a target structured parsed segment corresponding to the target contract document may include: first determining the target format of the target contract document, and determining the text extraction method corresponding to the target contract document based on the target format, the optical character recognition technology and the natural language processing technology; then extracting the target text content in the target contract document based on the text extraction method; then dividing the target text content into various content areas based on a preset layout analysis algorithm and the target contract document; the content area includes a text area, a table area and a signature area; finally, generating the target structured parsed segment corresponding to the target contract document based on the various content areas corresponding to the target text content. Specifically, if the target contract file is a Word document, the POI (Poor Obfuscation Implementation) open source Java library can be used to extract text segments from the target contract file to obtain the target text content; if the target contract file is a PDF file, MinerU can be used to parse the text stream, extract typesetting information such as fonts and positions from the target contract file, reconstruct the logical structure of the document, and obtain the target text content; if the target contract file is a scanned copy, image preprocessing methods such as binarization and denoising can be applied, and PaddleOCR (Paddle Optical Character Recognition) can be used for text recognition to restore the document structure through layout analysis. Afterwards, the layout analysis algorithm can be used to distinguish between text areas, table areas, and signature areas in the target text content. In a specific embodiment, the connected domain analysis method can be used to identify the table area and signature area in the contract.

[0065] It should be noted that the above-mentioned generation of the target structured parsing segments corresponding to the target contract document based on the content areas corresponding to the target text content may include: first obtaining a number of contract templates, dividing the content area templates corresponding to each of the contract templates, and using the content area templates to train an initial model to obtain a corresponding contract structure recognition model; the initial model is a model constructed based on the attention mechanism; then using the contract structure recognition model to identify the chapter boundaries in the content areas corresponding to the target text content, and dividing the content areas based on the chapter boundaries, and semantically annotating the segments in the divided content areas to obtain corresponding semantic annotation results; then adding the segments to the target segment list, and determining the first segment in the target segment list as the current segment, based on the preset similarity The algorithm determines the target semantic similarity between the current segment and the next segment, and determines the target similarity threshold corresponding to the current segment and the next segment based on a preset threshold adaptive algorithm; if the target semantic similarity exceeds the target similarity threshold, the current segment and the next segment are merged, and the merged segment is determined as the current segment, or, if the target semantic similarity does not exceed the target similarity threshold, the next segment is determined as the current segment; then jumps to the step of determining the target semantic similarity between the current segment and the next segment based on the preset similarity algorithm until the processing of each segment in the target segment list is completed to obtain each target segment; finally, based on each target segment and the semantic annotation results corresponding to each target segment, the target structured parsed segment corresponding to the target contract document is generated. Specifically, in this embodiment, based on the contract template provided by the enterprise, a sequence annotation model based on BERT (Bidirectional Encoder Representations from Transformers, i.e., a bidirectional transformer model) can be trained, the chunking algorithm for processing long texts can be optimized, and a contract structure recognition model can be constructed. The contract structure recognition model can then be used to identify chapter boundaries and divide content regions based on these boundaries. Each segment within each content region can then be annotated according to categories such as "Definition Clauses," "Rights and Obligations," and "Dispute Resolution," generating corresponding semantic annotation results. A similarity algorithm, such as m3e (Moka Massive Mixed Embedding), can then be used to calculate the semantic similarity between adjacent segments. A threshold adaptive algorithm can then be designed to merge segments when the semantic similarity between adjacent segments exceeds a similarity threshold. This allows adjacent, semantically similar segments to be merged and, combined with the corresponding semantic annotation results, to generate the target structured parsed segment corresponding to the target contract document.

[0066] Step S12: Utilize the target macro model to construct a contractual relationship knowledge graph corresponding to the target contract document based on the target structured parsing fragment, and generate a corresponding target structured data table.

[0067] It should be noted that this embodiment can label over 20 categories of contract entities (such as contract subject, amount, performance period, and liability for breach of contract). Several contract samples are selected and a Bidirectional Long Short-Term Memory - Conditional Random Field (BLSTM-CRF) architecture (Bidirectional Long Short-Term Memory - Conditional Random Field) is used to label the entities in the contract samples, incorporating lexicon features from the target domain, such as legal terminology and industry keywords, to generate the corresponding training data. A corresponding sample weighting strategy is designed, and the initial large model is trained based on the training data to obtain the target large model. The target large model implements multi-head hierarchical attention: the first layer: entity-level attention, focusing on key entities; the second layer: relationship-level attention, capturing interaction patterns.

[0068] In this embodiment, the above-mentioned use of the target big model to construct the contract relationship knowledge graph corresponding to the target contract document based on the target structured parsing fragment and generate the corresponding target structured data table may include: first using the target big model to identify each target entity in the target structured parsing fragment, and performing relationship extraction on each target entity to obtain the corresponding relationship extraction result; then determining the target construction order based on the top-down order and the bottom-up order, taking the target entity as a node, and establishing connections for the nodes corresponding to different target entities with associated relationships according to the target construction order and the relationship extraction result to obtain the contract relationship knowledge graph corresponding to the target contract document; then generating the target structured data table corresponding to the target contract document according to the contract relationship knowledge graph and each target entity. That is, in this embodiment, the target big model can be used to perform entity recognition on the target structured parsing fragment, such as Party A / Party B, amount, performance period, etc., and relationship extraction, such as the correlation between "payment terms" and "delivery time". Afterwards, see Figure 2 As shown in the figure, a combined top-down and bottom-up approach is used to construct the contractual relationship knowledge graph schema. Discrete clause information is then converted into a structured data table, which supports dynamic updates and queries, facilitating subsequent risk analysis and rule matching.

[0069] Step S13: Verify each contract clause in the target structured data table based on a pre-configured dynamic rule engine, and generate a corresponding early warning report based on the verification result.

[0070] In this embodiment, in order to review format errors in contract terms, the above-mentioned pre-configured dynamic rule engine verifies each contract term in the target structured data table and generates a corresponding early warning report based on the verification results. The process may include: first obtaining a number of verification instructions and converting the natural language corresponding to each verification instruction into a target verification rule; then setting the priority corresponding to each target verification rule, and configuring the dynamic rule engine and a preset visual rule editor based on each target verification rule and the priority corresponding to each target verification rule; then using the preset visual rule editor, based on the dynamic rule engine, verifying each contract term in the target structured data table to identify and highlight the target contract terms with format errors in the target structured data table and outputting the corresponding error type code; finally, generating the early warning report based on the target contract terms and the error type code corresponding to the target contract terms. It should be noted that this embodiment supports user-defined review rules, such as industry-specific terms, internal corporate compliance requirements, etc., to improve the adaptability and flexibility of the system. Specifically, the natural language corresponding to the user's verification instructions can be converted into target verification rules, and a rule priority mechanism can be designed to determine the priority corresponding to each target verification rule. Next, a dynamic rule engine is configured based on the target validation rules and their corresponding priorities, and a pre-defined visual rule editor is developed. Finally, the pre-defined visual rule editor can be used to validate the contract terms in the target structured data table using the dynamic rule engine. Error locations and error type codes are visually highlighted in a real-time feedback interface. This allows for logical validation of contract terms, including mandatory field checks, amount / date consistency verification, and clause conflict detection, while generating real-time visual warning reports.

[0071] Step S14: Perform risk assessment on the contract terms in the target structured data table based on the target domain knowledge base, the target big model and the contract relationship knowledge graph to generate corresponding risk data.

[0072] In this embodiment, in order to evaluate semantic risks, multiple rounds of reasoning of a large model can be initiated, and judgment basis can be generated in combination with the knowledge base search results. Accordingly, the above-mentioned risk assessment of the contract terms in the target structured data table based on the target domain knowledge base, the target big model and the contract relationship knowledge graph to generate corresponding risk data can include: first, constructing the target domain knowledge base based on legal and regulatory data, industry standard data and historical risk data; then determining the key nodes in the contract relationship knowledge graph, and determining a number of contract terms to be evaluated from the various contract terms in the target structured data table based on the target entities corresponding to the key nodes; then using the target big model to determine the semantic similarity between each of the contract terms to be evaluated and each clause data in the target domain knowledge base, and determining the contract terms to be evaluated corresponding to the semantic similarity that meets the preset high similarity interval condition as high-risk clauses, and determining the reference clause data corresponding to the high-risk clauses in the target domain knowledge base; finally, using the target big model to determine the risk probability score corresponding to the high-risk clause, and generating the risk data based on the high-risk clause, the risk level label corresponding to the high-risk clause, the risk probability score and the reference clause data. Specifically, in this embodiment, a knowledge base in the legal field can be constructed, and the contract terms to be evaluated can be determined based on the contract relationship knowledge graph and the target structured data table. The target large model then calculates the semantic similarity between the contract terms to be evaluated and the clause data in the knowledge base, and screens out high-risk clauses. The corresponding risk probability scores for these high-risk clauses are output, along with reference clause data from the knowledge base, to assist legal personnel in their decision-making. This allows for a multi-dimensional risk assessment of contract terms, including compliance risk assessment, such as whether the terms violate relevant legal provisions; commercial risk assessment, such as whether payment terms are detrimental to the company's cash flow; and logical risk assessment, such as whether rights and obligations are unequal.

[0073] Step S15: Utilize the target macro model to generate corresponding revision suggestions based on the early warning report and the risk data, and revise the target contract document based on the revision suggestions.

[0074] In this embodiment, the Sentence-Transformer framework (i.e., sentence transformer framework) can be used to construct a corresponding legal clause vector library using the target large model to implement a hierarchical index structure. Figure 3As shown, the legal terms vector library can implement a four-layer hybrid index architecture. At the same time, a hybrid retrieval strategy can be developed, combining semantic retrieval and keyword retrieval, and a relevance ranking algorithm can be designed. Based on RAG (Retrieval-Augmented Generation) technology, similar cases or standard terms can be matched from the legal terms vector library. Afterwards, the target large model can be used to generate compliant modification suggestions based on matching cases or matching terms, and corporate contract standard templates, and the target contract document can be revised based on the modification suggestions. It should be noted that when revising the target contract document, a multi-level constraint processing mechanism can be used to ensure the accuracy of legal text generation while maintaining the flexibility of the generation process. The specific constraint text architecture design is as follows. Figure 4 shown.

[0075] It should be noted that after revising the target contract document based on the revision suggestion, the above process may also include: comparing the revised target contract document with the target contract document before revision, and generating a corresponding difference comparison report based on the comparison results, and displaying the difference comparison report; obtaining the audit opinion corresponding to the revised target contract document, and updating the parameters of the target large model based on the audit opinion, and generating a corresponding audit log based on the audit opinion. Specifically, this embodiment provides a version difference comparison function, which can intuitively display the changes in the target contract document before and after modification, generate a difference comparison report, and mark the corresponding legal basis, so that users can quickly understand the adjustment content. For the revised target contract document, corresponding audit opinions can be obtained, supporting multi-role labeling and annotations, recording the manual correction records of legal personnel and feeding back to the data set of the target large model to fine-tune the target large model. At the same time, corresponding audit logs can be generated based on the audit opinions, recording the first confidence level and first generation time corresponding to the target structured parsing fragment, the second confidence level and second generation time corresponding to the contractual relationship knowledge graph, the third confidence level and third generation time corresponding to the target structured data table, the fourth confidence level and fourth generation time corresponding to the early warning report, the fifth confidence level and fifth generation time corresponding to the risk data, and the sixth confidence level and sixth generation time corresponding to the revision suggestion, to facilitate traceability and auditing.

[0076] As can be seen from the above, in this embodiment, the target contract document is first obtained, and the target contract document is parsed based on optical character recognition technology and natural language processing technology to generate a target structured parsed fragment corresponding to the target contract document; then, the target big model is used to construct the contract relationship knowledge graph corresponding to the target contract document based on the target structured parsed fragment, and a corresponding target structured data table is generated; then, based on the pre-configured dynamic rule engine, each contract clause in the target structured data table is verified, and a corresponding early warning report is generated based on the verification result; then, based on the target domain knowledge base, the target big model and the contract relationship knowledge graph, a risk assessment is performed on the contract clauses in the target structured data table to generate corresponding risk data; finally, the target big model is used to generate corresponding revision suggestions based on the early warning report and the risk data, and the target contract document is revised based on the revision suggestions. As can be seen from the above, in this embodiment, the target contract document is first parsed based on optical character recognition technology and natural language processing technology to generate a target structured parsed fragment of the target contract document; then the target structured parsed fragment is input into the target big model, the target big model is used to construct a contract relationship knowledge graph, and a target structured data table is generated; then the dynamic rule engine is used to verify each contract clause in the target structured data table and generate an early warning report; then the target domain knowledge base, the target big model and the contract relationship knowledge graph are used to perform a risk assessment on the contract clauses in the target structured data table and generate risk data; finally, the target big model can be used to generate revision suggestions based on the early warning report and risk data, and the target contract document is revised based on the revision suggestions. In this way, this embodiment can introduce big model technology and combine the dynamic rule engine with the domain knowledge base to realize the intelligent upgrade of contract review, significantly improve the efficiency, accuracy and risk coverage of the review, and provide enterprises with an efficient and reliable contract revision solution.

[0077] Accordingly, see Figure 5 As shown, the embodiment of the present application further provides a contract review device based on a large model, which may include:

[0078] The structured parsed segment generating module 11 is configured to obtain a target contract document and parse the target contract document based on optical character recognition technology and natural language processing technology to generate a target structured parsed segment corresponding to the target contract document;

[0079] A structured data table generating module 12 is configured to construct a contractual relationship knowledge graph corresponding to the target contract document based on the target structured parsed fragments using a target macro model, and generate a corresponding target structured data table;

[0080] An early warning report generating module 13 is configured to verify each contract clause in the target structured data table based on a pre-configured dynamic rule engine, and generate a corresponding early warning report based on the verification result;

[0081] A risk data generation module 14 is configured to perform a risk assessment on the contract terms in the target structured data table based on the target domain knowledge base, the target macro model, and the contract relationship knowledge graph to generate corresponding risk data;

[0082] The target contract document revision module 15 is configured to utilize the target macro model to generate corresponding revision suggestions based on the early warning report and the risk data, and to revise the target contract document based on the revision suggestions.

[0083] As can be seen from the above, in this application, the target contract document is first obtained, and the target contract document is parsed based on optical character recognition technology and natural language processing technology to generate a target structured parsed fragment corresponding to the target contract document; then, the target big model is used to construct the contract relationship knowledge graph corresponding to the target contract document based on the target structured parsed fragment, and a corresponding target structured data table is generated; then, based on the pre-configured dynamic rule engine, each contract clause in the target structured data table is verified, and a corresponding early warning report is generated based on the verification result; then, based on the target domain knowledge base, the target big model and the contract relationship knowledge graph, a risk assessment is performed on the contract clauses in the target structured data table to generate corresponding risk data; finally, the target big model is used to generate corresponding revision suggestions based on the early warning report and the risk data, and the target contract document is revised based on the revision suggestions. As can be seen from the above, in this application, the target contract document is first parsed based on optical character recognition technology and natural language processing technology to generate a target structured parsed fragment of the target contract document; then the target structured parsed fragment is input into the target big model, and the target big model is used to construct a contract relationship knowledge graph and generate a target structured data table; then the dynamic rule engine is used to verify each contract clause in the target structured data table and generate an early warning report; then the target domain knowledge base, the target big model and the contract relationship knowledge graph are used to conduct a risk assessment of the contract clauses in the target structured data table and generate risk data; finally, the target big model can be used to generate revision suggestions based on the early warning report and risk data, and the target contract document can be revised based on the revision suggestions. In this way, this application can introduce big model technology, and combine the dynamic rule engine with the domain knowledge base to realize the intelligent upgrade of contract review, significantly improve the efficiency, accuracy and risk coverage of the review, and provide enterprises with efficient and reliable contract revision solutions.

[0084] In some specific implementations, the structured parsing fragment generation module 11 may include:

[0085] A target text content extraction submodule, configured to extract the target text content in the target contract document based on the text extraction method;

[0086] A content area division submodule is configured to divide the target text content into various content areas based on a preset layout analysis algorithm and the target contract document; the content areas include a text area, a table area, and a signature area;

[0087] The structured parsing segment generating submodule is used to generate the target structured parsing segment corresponding to the target contract document based on the content areas corresponding to the target text content.

[0088] In some specific implementations, the structured parsing fragment generation submodule may include:

[0089] A contract structure recognition model determination unit is configured to obtain a plurality of contract templates, divide the contract templates into content region templates corresponding to the contract templates, and train an initial model using the content region templates to obtain a corresponding contract structure recognition model; the initial model is a model constructed based on an attention mechanism;

[0090] a semantic annotation unit, configured to use the contract structure recognition model to identify chapter boundaries in each content region corresponding to the target text content, divide the content regions based on the chapter boundaries, and semantically annotate each segment in each divided content region to obtain corresponding semantic annotation results;

[0091] a target similarity threshold determination unit, configured to add each of the segments to a target segment list, determine the first segment in the target segment list as a current segment, determine a target semantic similarity between the current segment and a next segment based on a preset similarity algorithm, and determine a target similarity threshold corresponding to the current segment and the next segment based on a preset threshold adaptive algorithm;

[0092] a segment merging unit, configured to merge the current segment with the next segment when the target semantic similarity exceeds the target similarity threshold, and determine the merged segment as the current segment, or, if the target semantic similarity does not exceed the target similarity threshold, determine the next segment as the current segment;

[0093] a target segment determining unit, configured to jump to the step of determining the target semantic similarity between the current segment and the next segment based on a preset similarity algorithm until the segments in the target segment list are processed to obtain the target segments;

[0094] A structured parsed segment generating unit is configured to generate the target structured parsed segment corresponding to the target contract document based on the target segments and the semantic annotation results corresponding to the target segments.

[0095] In some specific implementations, the structured data table generating module 12 may include:

[0096] a relationship extraction result determination unit, configured to use the target macro model to identify each target entity in the target structured parsed segment, and perform relationship extraction on each target entity to obtain a corresponding relationship extraction result;

[0097] a contractual relationship knowledge graph construction unit, configured to determine a target construction order based on a top-down order and a bottom-up order, take the target entity as a node, and establish connections between nodes corresponding to different target entities having associated relationships according to the target construction order and the relationship extraction result, so as to obtain the contractual relationship knowledge graph corresponding to the target contract document;

[0098] A structured data table generating unit is used to generate the target structured data table corresponding to the target contract document based on the contract relationship knowledge graph and the target entities.

[0099] In some specific implementations, the early warning report generating module 13 may include:

[0100] A target verification rule determination unit is used to obtain a plurality of verification instructions and convert the natural language corresponding to each of the verification instructions into a target verification rule;

[0101] A dynamic rule engine configuration unit, configured to set the priority corresponding to each of the target verification rules, and configure the dynamic rule engine and the preset visual rule editor based on each of the target verification rules and the priority corresponding to each of the target verification rules;

[0102] an error type code output unit, configured to verify each of the contract terms in the target structured data table based on the dynamic rule engine using the preset visual rule editor, so as to identify and highlight target contract terms with format errors in the target structured data table, and output corresponding error type codes;

[0103] An early warning report generating unit is used to generate the early warning report based on the target contract clause and the error type code corresponding to the target contract clause.

[0104] In some specific implementations, the risk data generation module 14 may include:

[0105] A target domain knowledge base construction unit, configured to construct the target domain knowledge base based on legal and regulatory data, industry standard data, and historical risk data;

[0106] a contract clause determination unit to be evaluated, configured to determine key nodes in the contract relationship knowledge graph, and determine a number of contract clauses to be evaluated from the contract clauses in the target structured data table based on target entities corresponding to the key nodes;

[0107] a high-risk clause determination unit, configured to determine, using the target macromodel, the semantic similarity between each of the contract clauses to be evaluated and each clause data in the target domain knowledge base, and to determine the contract clauses to be evaluated corresponding to the semantic similarity that satisfies a preset high similarity interval condition as high-risk clauses, and to determine reference clause data corresponding to the high-risk clauses in the target domain knowledge base;

[0108] A risk data generating unit is used to determine the risk probability score corresponding to the high-risk clause using the target large model, and generate the risk data based on the high-risk clause, the risk level label corresponding to the high-risk clause, the risk probability score and the reference clause data.

[0109] In some specific implementations, the large model-based contract review device may further include:

[0110] a difference comparison report display unit, configured to compare the revised target contract document with the target contract document before the revision, generate a corresponding difference comparison report based on the comparison result, and display the difference comparison report;

[0111] An audit log generating unit is used to obtain the audit opinion corresponding to the revised target contract document, update the parameters of the target large model based on the audit opinion, and generate a corresponding audit log based on the audit opinion.

[0112] Furthermore, the embodiment of the present application also discloses an electronic device, Figure 6 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content in the diagram should not be considered as any limitation on the scope of use of this application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps of the large model-based contract review method disclosed in any of the aforementioned embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.

[0113] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device. The communication protocol it follows is any communication protocol that can be applied to the technical solution of this application and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world. Its specific interface type can be selected according to specific application needs and is not specifically limited here.

[0114] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or CD, etc. The resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage method can be temporary storage or permanent storage.

[0115] The operating system 221 is used to manage and control the hardware devices on the electronic device 20 and the computer program 222. The operating system 221 can be Windows Server, NetWare, Unix, Linux, etc. In addition to including computer programs capable of implementing the large model-based contract review method performed by the electronic device 20 as disclosed in any of the aforementioned embodiments, the computer program 222 can further include computer programs capable of completing other specific tasks.

[0116] Furthermore, this application discloses a computer-readable storage medium for storing a computer program. When executed by a processor, the computer program implements the aforementioned large-scale model-based contract review method. The specific steps of this method can be found in the corresponding content disclosed in the aforementioned embodiments and will not be further elaborated here.

[0117] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from the other embodiments. Reference can be made to the descriptions of the identical or similar parts between the various embodiments. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple, and the relevant parts can be referred to the descriptions of the methods.

[0118] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0119] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0120] Finally, it should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or device comprising the element.

[0121] The above is a detailed introduction to the technical solution provided by the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for those skilled in the art, according to the ideas of the present application, there may be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A contract review method based on a large model, characterized in that: include: Obtaining a target contract document, and parsing the target contract document based on optical character recognition technology and natural language processing technology to generate a target structured parsed segment corresponding to the target contract document; Using the target big model to construct a contractual relationship knowledge graph corresponding to the target contract document based on the target structured parsed fragments, and generating a corresponding target structured data table; Verify each contract clause in the target structured data table based on a pre-configured dynamic rule engine, and generate a corresponding early warning report based on the verification results; Performing a risk assessment on the contract terms in the target structured data table based on the target domain knowledge base, the target large model, and the contract relationship knowledge graph to generate corresponding risk data; The target big model is used to generate corresponding revision suggestions based on the early warning report and the risk data, and the target contract document is revised based on the revision suggestions.

2. The contract review method based on a large model according to claim 1 is characterized in that: The step of parsing the target contract document based on optical character recognition technology and natural language processing technology to generate a target structured parsed segment corresponding to the target contract document includes: Determining a target format of the target contract document, and determining a text extraction method corresponding to the target contract document based on the target format, the optical character recognition technology, and the natural language processing technology; Extracting target text content from the target contract file based on the text extraction method; Divide the target text content into various content areas based on a preset layout analysis algorithm and the target contract document; the content areas include a text area, a table area, and a signature area; The target structured parsed segment corresponding to the target contract document is generated based on the content areas corresponding to the target text content.

3. The contract review method based on a large model according to claim 2 is characterized in that: Generating the target structured parsed segments corresponding to the target contract document based on the respective content regions corresponding to the target text content includes: Acquire several contract templates, divide each contract template into content area templates corresponding to each contract template, and train an initial model using each content area template to obtain a corresponding contract structure recognition model; the initial model is a model constructed based on an attention mechanism; Using the contract structure recognition model, identifying chapter boundaries in each content area corresponding to the target text content, dividing each content area based on the chapter boundaries, and semantically annotating each segment in each divided content area to obtain corresponding semantic annotation results; Adding each of the segments to a target segment list, determining the first segment in the target segment list as a current segment, determining a target semantic similarity between the current segment and a next segment based on a preset similarity algorithm, and determining a target similarity threshold corresponding to the current segment and the next segment based on a preset threshold adaptive algorithm; If the target semantic similarity exceeds the target similarity threshold, merging the current segment with the next segment and determining the merged segment as the current segment; or, if the target semantic similarity does not exceed the target similarity threshold, determining the next segment as the current segment; Jumping to the step of determining the target semantic similarity between the current segment and the next segment based on a preset similarity algorithm until the segments in the target segment list are processed to obtain the target segments; The target structured parsed segment corresponding to the target contract document is generated based on the target segments and the semantic annotation results corresponding to the target segments.

4. The contract review method based on a large model according to claim 1 is characterized in that: The target macro model is used to construct a contractual relationship knowledge graph corresponding to the target contract document based on the target structured parsed fragments, and a corresponding target structured data table is generated, including: Using the target large model to identify each target entity in the target structured parsed segment, and performing relationship extraction on each target entity to obtain corresponding relationship extraction results; Determining a target construction order based on a top-down order and a bottom-up order, taking the target entity as a node, and establishing connections between nodes corresponding to different target entities having associated relationships according to the target construction order and the relationship extraction result, so as to obtain the contract relationship knowledge graph corresponding to the target contract document; The target structured data table corresponding to the target contract document is generated based on the contract relationship knowledge graph and the target entities.

5. The contract review method based on a large model according to claim 1 is characterized in that: The pre-configured dynamic rule engine verifies each contract clause in the target structured data table and generates a corresponding early warning report based on the verification result, including: Obtaining a number of verification instructions, and converting the natural language corresponding to each of the verification instructions into a target verification rule; Setting a priority corresponding to each of the target verification rules, and configuring the dynamic rule engine and the preset visual rule editor based on each of the target verification rules and the priority corresponding to each of the target verification rules; Using the preset visual rule editor, based on the dynamic rule engine, the contract clauses in the target structured data table are verified to identify and highlight target contract clauses in the target structured data table that are formatted incorrectly, and output corresponding error type codes; The early warning report is generated based on the target contract clause and the error type code corresponding to the target contract clause.

6. The contract review method based on a large model according to claim 1 is characterized in that: The risk assessment of the contract terms in the target structured data table based on the target domain knowledge base, the target large model and the contract relationship knowledge graph to generate corresponding risk data includes: Build the target domain knowledge base based on legal and regulatory data, industry standard data, and historical risk data; Determining key nodes in the contractual relationship knowledge graph, and determining a number of contract clauses to be evaluated from the contract clauses in the target structured data table based on target entities corresponding to the key nodes; Using the target macro model, determining the semantic similarity between each of the contract clauses to be evaluated and each clause data in the target domain knowledge base, and determining the contract clauses to be evaluated corresponding to the semantic similarity that meets a preset high similarity interval condition as high-risk clauses, and determining reference clause data corresponding to the high-risk clauses in the target domain knowledge base; The target macro model is used to determine the risk probability score corresponding to the high-risk clause, and the risk data is generated based on the high-risk clause, the risk level label corresponding to the high-risk clause, the risk probability score and the reference clause data.

7. The contract review method based on a large model according to any one of claims 1 to 6, characterized in that: After revising the target contract document based on the revision proposal, the method further includes: Comparing the revised target contract document with the target contract document before the revision, generating a corresponding difference comparison report based on the comparison results, and displaying the difference comparison report; Obtain the audit opinion corresponding to the revised target contract document, update the parameters of the target large model based on the audit opinion, and generate a corresponding audit log based on the audit opinion.

8. A contract review device based on a large model, characterized in that: include: a structured parsed segment generation module, configured to obtain a target contract document and parse the target contract document based on optical character recognition technology and natural language processing technology to generate a target structured parsed segment corresponding to the target contract document; a structured data table generation module, configured to construct a contractual relationship knowledge graph corresponding to the target contract document based on the target structured parsed fragments using a target macro model, and generate a corresponding target structured data table; An early warning report generation module, configured to verify each contract clause in the target structured data table based on a pre-configured dynamic rule engine, and generate a corresponding early warning report based on the verification result; a risk data generation module, configured to perform a risk assessment on the contract terms in the target structured data table based on the target domain knowledge base, the target macro model, and the contract relationship knowledge graph to generate corresponding risk data; The target contract document revision module is used to generate corresponding revision suggestions based on the early warning report and the risk data using the target macro model, and to revise the target contract document based on the revision suggestions.

9. An electronic device, characterized in that: The electronic device includes a processor and a memory; wherein the memory is used to store a computer program, and the computer program is loaded and executed by the processor to implement the large model-based contract review method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that Used to store a computer program, which, when executed by a processor, implements the large model-based contract review method as described in any one of claims 1 to 7.

Citation Information

Cited By

  • Data verification method, data verification device and storage medium

    CN120930610A

  • Seal watermark rule analysis method and system based on natural language processing

    CN120931642A

  • Seal watermark rule analysis method and system based on natural language processing

    CN120931642B

  • Contract identification and intelligent management system and method based on MCP

    CN121304202A

  • AI large model-based life insurance intelligent operation service system

    CN121437168A