Intelligent contract review method, system and equipment based on large language model, medium and program product
The intelligent contract review method, which combines large language models and rule engines, solves the problems of low efficiency and poor accuracy in traditional contract review, achieving efficient and professional contract review with self-optimization capabilities.
Patent Information
- Application Number
- CN202511958087.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-23
- Publication Date
- 2026-03-20
AI Technical Summary
Traditional contract review relies on manual reading, which is inefficient and costly. Existing automated tools are inflexible, inaccurate, and unable to handle long texts, and lack knowledge support.
By employing a large language model combined with a pre-defined rule engine, and through preprocessing, block processing, and semantic recognition, the review items are identified and distributed. The large language model generates simple review results, while the rule engine processes complex review items. The model is optimized by combining a knowledge base and user feedback.
It improves the efficiency and accuracy of contract review, can handle long texts, is professional and interpretable, has self-optimization capabilities, and reduces maintenance costs.
Smart Images

Figure CN121707781A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of artificial intelligence, in particular to a contract intelligent review method, system, device, medium and program product based on a large language model. BACKGROUND
[0002] Traditional contract review highly depends on manual reading and judgment by legal professionals, which has problems such as low efficiency, high cost, and easy to miss key risk points due to fatigue or negligence.
[0003] Existing automated review tools are mostly based on pre-defined simple keyword matching or regular expression rules, which have the following obvious defects:
[0004] Poor flexibility: unable to understand the contextual semantics of contract clauses, low recognition accuracy for clauses with diverse expressions and complex logic.
[0005] Poor maintainability: rule library needs to be manually written and maintained, facing the problems of high update and iteration cost and difficulty in expansion in the face of changing laws and regulations and contract types.
[0006] Limited processing capacity: difficult to effectively process long-length contract texts, prone to information loss or context breakage.
[0007] Lack of knowledge support: review and judgment are conducted in isolation, unable to dynamically reference massive laws and regulations and historical case knowledge, and the review depth is insufficient.
[0008] Therefore, it is urgent to invent an intelligent contract review method to solve the problems of low review efficiency, poor accuracy and poor maintainability existing in the prior art contract review technical solutions. SUMMARY
[0009] Therefore, the embodiments of the present application provide a contract intelligent review method, system, device, medium and program product based on a large language model, at least partially solving the problems existing in the prior art.
[0010] Other characteristics and advantages of the present application will become apparent from the following detailed description, or will be learned by practice of the present application.
[0011] In order to achieve the above-mentioned purpose, the embodiments of the present application provide the following technical solutions:
[0012] According to a first aspect of the embodiments of the present application, a contract intelligent review method based on a large language model is provided, the method comprising:
[0013] receiving a contract file to be reviewed, preprocessing the contract file to be reviewed to obtain a text block to be reviewed;
[0014] Based on the large language model, the review items in the text block to be reviewed are identified according to the definition of review items, and the key values corresponding to the review items are extracted.
[0015] The large language model divides the review items into simple review items and complex review items according to their nature and complexity;
[0016] For the simple review item, the first review result is directly generated using the large language model;
[0017] For the complex review item, a preset rule engine is used to perform logical judgment on the complex review item and output a second review result;
[0018] Based on the first review result and the second review result, a contract review result is generated.
[0019] Further, the contract document to be reviewed is preprocessed to obtain a text block to be reviewed, including:
[0020] The contract documents to be reviewed are processed into plain text format standardization to obtain standardized contract documents;
[0021] The standardized contract document is divided into blocks to obtain text blocks to be reviewed.
[0022] Furthermore, the standardized contract document is divided into blocks to obtain text blocks to be reviewed, including:
[0023] The standardized contract document is segmented using a semantically based sliding window or chapter segmentation algorithm to obtain text blocks to be reviewed that maintain contextual relevance.
[0024] Furthermore, based on the definition of review items, the review items in the text block to be reviewed are identified, including:
[0025] In a pre-built knowledge base of contract laws and regulations, the definitions of review items and professional legal knowledge associated with the text block to be reviewed are retrieved, including legal provisions and legal cases;
[0026] The large language model uses the retrieved review item definitions to identify review items in the text block to be reviewed.
[0027] Furthermore, a preset rule engine is used to perform logical judgments on the complex review items, and a second review result is output, including:
[0028] Using the pre-set business judgment rules in the preset rule engine, logical judgments are made on the complex review items and the key values corresponding to the complex review items, and compliance conclusions and risk warning results are output for the complex review items.
[0029] Furthermore, the method also includes:
[0030] Obtain user feedback on the contract review results, including review scores and suggested modifications;
[0031] Based on the user feedback, a standardized review example is generated;
[0032] In the next round of contract review, the review example will be used as contextual information to be input into the large language model for model optimization.
[0033] The contract law and legal knowledge base was optimized using the user feedback and the review examples.
[0034] According to a second aspect of the present invention, a contract intelligent review system based on a large language model is provided, the system comprising:
[0035] The contract document preprocessing module is used to receive the contract document to be reviewed, preprocess the contract document to be reviewed, and obtain the text block to be reviewed.
[0036] The knowledge enhancement module is used to retrieve the review item definitions and professional legal knowledge associated with the text block to be reviewed from a pre-built knowledge base of contract laws and regulations.
[0037] The intelligent review engine module is used to identify review items in the text block to be reviewed based on a large language model and according to the definition of review items, and extract the key values corresponding to the review items; the large language model divides the review items into simple review items and complex review items according to their nature and complexity; for the simple review items, the large language model directly generates a first review result; for the complex review items, a preset rule engine performs logical judgment on the complex review items and outputs a second review result; based on the first review result and the second review result, a contract review result is generated.
[0038] The feedback module is optimized to obtain user feedback on the contract review results, including review scores and modification suggestions; based on the user feedback, standardized review examples are generated; in the next round of contract review, the review examples are used as contextual information to input into the large language model for model optimization; and the contract law and legal knowledge base is optimized using the user feedback and the review examples.
[0039] According to a third aspect of the present invention, an event device supporting multiple architecture modes is provided, the device comprising: a processor and a memory;
[0040] The memory is used to store one or more program instructions;
[0041] The processor is configured to run one or more program instructions to perform the steps of a contract intelligent review method based on a large language model as described in any of the preceding claims.
[0042] According to a fourth aspect of the present invention, a computer-readable storage medium is provided, on which a computer program is stored, wherein when executed by a processor, the computer program implements the steps of a contract intelligent review method based on a large language model as described in any of the preceding claims.
[0043] According to a fifth aspect of the present invention, a computer program product is provided, the computer program product comprising a computing program stored on a non-transitory computer-readable storage medium, the computer program comprising program instructions that, when executed by a computer, cause the computer to implement the steps of a contract intelligent review method based on a large language model as described in any of the preceding claims.
[0044] This invention provides a method, system, device, medium, and program product for intelligent contract review based on a large language model. The method includes: receiving a contract document to be reviewed; preprocessing the contract document to obtain a text block to be reviewed; then, based on a large language model, identifying review items in the text block according to review item definitions, and extracting the key values corresponding to the review items; the large language model categorizing the review items into simple review items and complex review items; for simple review items, directly generating a first review result using the large language model; for complex review items, using a preset rule engine to perform logical judgments on the complex review items and outputting a second review result; and generating a contract review result based on the first and second review results. This invention effectively improves the efficiency and accuracy of contract review, can quickly adapt to new business needs, and significantly reduces maintenance costs. Attached Figure Description
[0045] To more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are merely exemplary, and those skilled in the art can derive other embodiments based on the provided drawings without creative effort.
[0046] Figure 1 A flowchart illustrating a contract intelligent review method based on a large language model, provided for an embodiment of the present invention;
[0047] Figure 2 This is a schematic diagram of the structure of a contract intelligent review system based on a large language model, provided as an embodiment of the present invention. Detailed Implementation
[0048] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0049] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0050] Figure 1 A flowchart of a contract intelligent review method based on a large language model according to an embodiment of the present invention is shown.
[0051] like Figure 1 As shown, the intelligent contract review method based on a large language model according to an embodiment of the present invention may include steps S100, S200, S300, S401, S402 and S500.
[0052] In step S100, the contract document to be reviewed is received, and the contract document to be reviewed is preprocessed to obtain the text block to be reviewed.
[0053] Specifically, the above steps include:
[0054] We accept contract documents in various formats (such as PDF, Word, images, etc.).
[0055] Based on integrated OCR (Optical Character Recognition) and document parsing technologies, the contract documents to be reviewed are processed into plain text format standardization, converting non-text format contracts into standardized plain text format while retaining necessary paragraph and format information, resulting in standardized contract documents.
[0056] A semantically based sliding window or chapter segmentation algorithm is used to segment standardized contract documents into chunks, dividing long contracts into appropriately sized text chunks. This ensures that the length of each chunk is within the processing range, while maintaining contextual relevance through overlapping and other methods, resulting in multiple text chunks to be reviewed for processing by a large language model.
[0057] In step S200, based on the large language model and according to the definition of the review item, the review items in the text block to be reviewed are identified, and the key values corresponding to the review items are extracted.
[0058] Specifically, the above steps include:
[0059] A knowledge base of contract laws and regulations is pre-built, which includes the Contract Law section of the Civil Code, various judicial interpretations, model texts, key points of precedents, etc. This knowledge base is used to maintain and manage all types of contract clauses (review items) that need to be reviewed, including the definition, importance level, and applicable contract type of each review item.
[0060] This invention employs RAG (Retrieval Enhanced Generation) technology. When the large language model analyzes the text block to be reviewed, or when the rule engine requires precise evidence, it retrieves the definitions of review items and professional legal knowledge associated with the text block from the aforementioned contract law and legal knowledge base. This professional legal knowledge includes legal provisions and legal cases. By combining the retrieved professional legal knowledge and review item definitions with the original analysis task of the large language model, the professional accuracy and reliability of the large language model's responses are significantly improved, making the review results more credible and persuasive.
[0061] The large language model uses the retrieved review item definitions to identify review items (such as payment terms, liability for breach of contract, confidentiality period, court of jurisdiction, etc.) in the text block to be reviewed.
[0062] For the identified review items, extract the key values from the review items (e.g., payment amount = 1 million, penalty rate = 0.1% per day, confidentiality period = 5 years, etc.), and convert the unstructured text into structured data.
[0063] In step S300, the large language model divides the review items into simple review items and complex review items according to their nature and complexity.
[0064] In step S401, for simple review items, the first review result is directly generated using the large language model.
[0065] Specifically, the above steps include:
[0066] For simple review items, the large language model autonomously determines and generates a first review result containing the review results and supporting evidence.
[0067] In step S402, for complex review items, a preset rule engine is used to perform logical judgment on the complex review items and output the second review result.
[0068] Specifically, the above steps include:
[0069] For complex review items that require precise calculations or multi-condition logical judgments, the key information (key values) of the complex review items are extracted using a large language model and input into a preset rule engine. The rule engine has pre-set business rules written by legal experts (e.g., "IF penalty ratio > 0.15% THEN risk level = high") or business rules dynamically generated by the large model. The rule engine performs logical judgments on the key values and outputs the compliance conclusions and risk warnings corresponding to the complex review items.
[0070] Preferably, embodiments of the present invention also provide a rule generation function. By learning from a large number of historical contract review results and large language model analysis results, potential risk patterns can be automatically discovered, and new review rules can be suggested. After expert confirmation, these rules can be added to the rule base, thereby enabling the system to self-evolve.
[0071] Preferably, the rule engine also provides a graphical interface for legal experts to easily view, edit, enable, or disable review rules. It also records the hit rate and effect of each rule to assist experts in optimizing the rule system.
[0072] Next, in step S500, a contract review result is generated based on the first review result and the second review result.
[0073] Specifically, the above steps include:
[0074] Based on the results of the first and second reviews, a structured contract review report is generated, highlighting risk points and providing the basis for the review.
[0075] Preferably, the intelligent contract review method based on a large language model provided in this embodiment of the invention further includes:
[0076] Provides an intuitive user interface to obtain user ratings (e.g., 1-5 stars) for contract review results and suggestions for modification based on specific review recommendations.
[0077] Based on user suggestions for revising the contract review results, standardized best practice review examples are generated, including a comparison of before and after revisions, explanations of legal basis, and risk level assessments.
[0078] In the next round of contract review, the review examples are used as contextual information input into the large language model to achieve real-time fine-tuning based on user feedback.
[0079] By leveraging user feedback and review examples, we continuously enrich and optimize the knowledge base of contract laws and regulations and the definition of review items, forming a positive feedback loop.
[0080] In addition, embodiments of the present invention also provide a contract intelligent review system based on a large language model. Figure 2 This invention illustrates the system architecture of a contract intelligent review system based on a large language model, according to an embodiment of the present invention. The system includes:
[0081] The contract document preprocessing module is used to receive contract documents to be reviewed, preprocess the contract documents to be reviewed, and obtain the text blocks to be reviewed.
[0082] The knowledge enhancement module is used to retrieve the definitions of review items and professional legal knowledge associated with the text block to be reviewed from a pre-built knowledge base of contract laws and regulations.
[0083] The intelligent review engine module is used to identify review items in the text block to be reviewed based on a large language model and the definition of review items, and to extract the key values corresponding to the review items. The large language model divides the review items into simple review items and complex review items according to their nature and complexity. For simple review items, the large language model directly generates the first review result. For complex review items, a preset rule engine performs logical judgment on the complex review items and outputs the second review result. Based on the first review result and the second review result, the contract review result is generated.
[0084] The feedback module is optimized to obtain user feedback on the contract review results, including review scores and modification suggestions. Based on user feedback, standardized review examples are generated. In the next round of contract review, the review examples are used as contextual information to input into the large language model for model optimization. The contract law and legal knowledge base is optimized using user feedback and review examples.
[0085] In addition, this invention also provides a contract intelligent review device based on a large language model, the device comprising: a processor and a memory; the memory for storing one or more program instructions; the processor for running one or more program instructions to perform the steps of a contract intelligent review method based on a large language model as described above.
[0086] In addition, embodiments of the present invention also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of a contract intelligent review method based on a large language model as described above.
[0087] In addition, embodiments of the present invention also provide a computer program product, which includes computer program instructions that, when executed by a processor, implement the steps of a contract intelligent review method based on a large language model as described above.
[0088] The present invention provides a method, system, device, medium, and program product for intelligent contract review based on a large language model, which has the following advantages:
[0089] Significantly improved review accuracy and efficiency: This invention combines the semantic understanding of a large language model (solving the flexibility problem) with the precise judgment of a rule engine (solving the controllability problem). Compared with traditional keyword methods, it greatly improves the accuracy and recall of complex clauses and the review efficiency far exceeds that of manual review.
[0090] Superior long text processing capabilities: This embodiment of the invention effectively overcomes the context window limitation of LLM through a large text block batch processing mechanism, and realizes complete and coherent analysis of contracts of arbitrary length.
[0091] Enhanced professionalism and interpretability: This invention, through a knowledge base and RAG technology, bases the review judgment on authoritative laws and regulations, providing not only review results but also review basis, thereby outputting a professional and credible review report that is easy for experts to review.
[0092] The system is highly scalable and self-evolving: This embodiment of the invention provides a rule generation function and a graphical rule management module, which can quickly adapt to new regulations and business requirements, reduce maintenance costs, and have the ability to continuously learn and optimize.
[0093] Real-time personalized optimization: Through the feedback optimization module, this embodiment of the invention can make real-time fine adjustments based on the user's actual usage feedback. The review quality continuously improves over time, forming a personalized intelligent review assistant, which greatly improves the user experience and review accuracy.
[0094] In this embodiment of the invention, the processor can be an integrated circuit chip with signal processing capabilities. The processor can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in this embodiment of the invention. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in this embodiment of the invention can be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software modules can be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The processor reads information from the storage medium and, in conjunction with its hardware, completes the steps of the above methods. The storage medium can be memory, for example, volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. Non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchlink DRAM (SLDRAM), and Direct Rambus RAM (DRRAM).The storage media described in the embodiments of this invention are intended to include, but are not limited to, these and any other suitable types of memory. Those skilled in the art will recognize that the functions described in the above examples can be implemented using a combination of hardware and software. When applied software, the corresponding functions can be stored in a computer-readable medium or transmitted as one or more instructions or code on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein communication media include any medium that facilitates the transmission of computer programs from one place to another. Storage media can be any available medium accessible to general-purpose or special-purpose computers. Although the invention has been described in detail above with general description and specific embodiments, modifications or improvements can be made to it, which will be apparent to those skilled in the art. Therefore, such modifications or improvements made without departing from the spirit of the invention are all within the scope of protection claimed by the invention.
[0095] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any way. Any simple modifications, equivalent changes, or alterations made by those skilled in the art using the disclosed technical content shall fall within the protection scope of the present invention.
Claims
1. A contract intelligent review method based on a large language model, characterized in that, The method includes: Receive the contract document to be reviewed, preprocess the contract document to be reviewed, and obtain the text block to be reviewed; Based on the large language model, the review items in the text block to be reviewed are identified according to the definition of review items, and the key values corresponding to the review items are extracted. The large language model divides the review items into simple review items and complex review items according to their nature and complexity; For the simple review item, the first review result is directly generated using the large language model; For the complex review item, a preset rule engine is used to perform logical judgment on the complex review item and output a second review result; Based on the first review result and the second review result, a contract review result is generated.
2. The intelligent contract review method based on a large language model according to claim 1, characterized in that, The contract document to be reviewed is preprocessed to obtain a text block to be reviewed, including: The contract documents to be reviewed are processed into plain text format standardization to obtain standardized contract documents; The standardized contract document is divided into blocks to obtain text blocks to be reviewed.
3. The intelligent contract review method based on a large language model according to claim 2, characterized in that, The standardized contract document is divided into blocks to obtain text blocks to be reviewed, including: The standardized contract document is segmented using a semantically based sliding window or chapter segmentation algorithm to obtain text blocks to be reviewed that maintain contextual relevance.
4. The intelligent contract review method based on a large language model according to claim 1, characterized in that, Based on the definition of review items, the review items in the text block to be reviewed are identified, including: In a pre-built knowledge base of contract laws and regulations, the definitions of review items and professional legal knowledge associated with the text block to be reviewed are retrieved, including legal provisions and legal cases; The large language model uses the retrieved review item definitions to identify review items in the text block to be reviewed.
5. The intelligent contract review method based on a large language model according to claim 1, characterized in that, The complex review items are logically evaluated using a preset rule engine, and a second review result is output, including: Using the pre-set business judgment rules in the preset rule engine, logical judgments are made on the complex review items and the key values corresponding to the complex review items, and compliance conclusions and risk warning results are output for the complex review items.
6. The intelligent contract review method based on a large language model according to claim 1, characterized in that, The method further includes: Obtain user feedback on the contract review results, including review scores and suggested modifications; Based on the user feedback, a standardized review example is generated; In the next round of contract review, the review example will be used as contextual information to be input into the large language model for model optimization. The contract law and legal knowledge base was optimized using the user feedback and the review examples.
7. A contract intelligent review system based on a large language model, characterized in that, The system includes: The contract document preprocessing module is used to receive the contract document to be reviewed, preprocess the contract document to be reviewed, and obtain the text block to be reviewed. The knowledge enhancement module is used to retrieve the review item definitions and professional legal knowledge associated with the text block to be reviewed from a pre-built knowledge base of contract laws and regulations. The intelligent review engine module is used to identify review items in the text block to be reviewed based on a large language model and according to the definition of review items, and extract the key values corresponding to the review items; the large language model divides the review items into simple review items and complex review items according to their nature and complexity; for the simple review items, the large language model directly generates a first review result; for the complex review items, a preset rule engine performs logical judgment on the complex review items and outputs a second review result; based on the first review result and the second review result, a contract review result is generated. The feedback module is optimized to obtain user feedback on the contract review results, including review scores and modification suggestions; based on the user feedback, standardized review examples are generated; in the next round of contract review, the review examples are used as contextual information to input into the large language model for model optimization; and the contract law and legal knowledge base is optimized using the user feedback and the review examples.
8. A contract intelligent review device based on a large language model, characterized in that, The device includes: a processor and a memory; The memory is used to store one or more program instructions; The processor is configured to run one or more program instructions to perform the steps of a contract intelligent review method based on a large language model as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of a contract intelligent review method based on a large language model as described in any one of claims 1 to 6.
10. A computer program product, characterized in that, The computer program product includes computer program instructions that, when executed by a processor, implement the steps of a contract intelligent review method based on a large language model as described in any one of claims 1 to 6.
Citation Information
Cited By
A business node suggestion generation method based on rule engine and large model double-link fusion
CN122335482A
A legal document risk identification method and system and a storage medium
CN122492402A