Grassland contract intelligent examination method, device and equipment based on size model cooperation

By combining large and small model collaboration and mind chain technology with grassland contract clause classification and MoE structure, we have achieved efficient, accurate and intelligent review of grassland contracting contracts, solving the accuracy and efficiency problems of grassland contracting contract review in existing technologies and reducing costs.

CN120672519BActive Publication Date: 2026-02-10INNER MONGOLIA UNIV OF TECH
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202510844106.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-23
Publication Date
2026-02-10
Estimated Expiration
2045-06-23

AI Technical Summary

Technical Problem

Existing rule-based and template-based grassland contract review methods are ill-suited to rapidly changing legal requirements and contract scenarios, while review techniques based on large language models lack efficient and accurate review methods for grassland contracts.

Method used

A collaborative approach using large and small models is adopted. Contract terms are initially classified using a grassland contract terms classification model. The small model is used for preliminary review. When the confidence level is higher than the threshold, the results are output. When the confidence level is lower than the threshold, the large model is invoked to conduct in-depth review based on the thinking chain technology. The combination of thinking chain technology and MoE structure enables efficient and accurate intelligent review.

Benefits of technology

It has enabled efficient, accurate and intelligent review of grassland contracting contracts, solving the problems of low accuracy of review using a single small model and low efficiency of review using a single large model, reducing costs and improving the level of intelligence in the review process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120672519B_ABST
    Figure CN120672519B_ABST
Patent Text Reader

Abstract

The present application relates to a grassland contract intelligent review method, device and equipment based on size model cooperation, which can solve the problems of low accuracy of single small model review and low efficiency and high cost of single large model review. The method comprises: classifying the to-be-reviewed contract terms in the grassland contract by a grassland contract term classification model to obtain the term category corresponding to each to-be-reviewed contract term; reviewing the to-be-reviewed contract terms included in the term category by a first intelligent review model corresponding to the term category to obtain the risk points corresponding to the term category; when the total confidence of the risk points corresponding to each term category is greater than a preset threshold, obtaining the intelligent review result of the grassland contract according to the risk points corresponding to each term category; when the total confidence of the risk points corresponding to each term category is less than or equal to the preset threshold, calling a second intelligent review model to review the grassland contract based on the thinking chain technology.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of artificial intelligence technology, specifically to a method, apparatus, and equipment for intelligent review of grassland contracting contracts based on the collaboration of large and small models. Background Technology

[0002] Compared to general land contracts, grassland contracting agreements exhibit distinctly professional and regional characteristics. Their clause design fully considers the ecological characteristics and management requirements of grassland resources. For example, the grassland boundaries must be precisely described using geographical elements such as coordinate inflection points in the clause definitions, making them far more complex than in general land contracts. Numerical clauses, involving livestock carrying capacity assessments and rotational grazing cycles, must strictly comply with the grassland law's requirements for grassland-livestock balance. In the rights and obligations clauses, the contract must stipulate special obligations such as ecological restoration, fire prevention, and pest control; these provisions are often lengthy and complex, easily confused with management rights. Furthermore, regarding dispute resolution mechanisms, the contract relies more on government adjudication and administrative litigation than on arbitration or civil litigation, which are more common in general contracts.

[0003] Therefore, with the development of artificial intelligence technology, automated contract review technology and large language model-based review technology have emerged, such as CN120031511A - Contract Review Processing Method and Electronic Equipment; CN117291515A - A Contract Compliance Review Method and System Based on Generative Language Model, which mainly reviews contracts by comparing contract terms with standard templates or rules. However, rule- and template-based review methods have limited ability to handle the complex legal logic and contextual issues in grassland contracting clauses, making it difficult to adapt to rapidly changing legal requirements and contract scenarios. Furthermore, large language model-based contract review technology mainly reviews contracts by fine-tuning a general pre-trained large language model. However, large language model-based contract review technology often focuses on general contract texts, lacking design for reviewing highly specialized grassland contracting contract texts. Summary of the Invention

[0004] To overcome the problems existing in related technologies, this disclosure provides a method, apparatus, and equipment for intelligent review of grassland contracting contracts based on big-small model collaboration. This addresses the review issues arising from the fact that grassland contracting contracts are more detailed in terms of numerical values, more specific in terms of definition, and more complex in terms of rights, obligations, and jurisdiction than general land contracting contracts. The goal is to achieve efficient and accurate intelligent review of grassland contracting contracts.

[0005] According to a first aspect of the present disclosure, a method for intelligent review of grassland contracting contracts based on size model collaboration is provided, comprising:

[0006] In response to the user's upload operation on the grassland contract intelligent review page, the grassland contract uploaded by the user is obtained, and the contract clauses to be reviewed in the grassland contract are classified by the grassland contract clause classification model to obtain the clause category corresponding to each contract clause to be reviewed.

[0007] For each of the aforementioned clause categories, the contract clauses to be reviewed within the clause category are reviewed using the first intelligent review model corresponding to the clause category to obtain the risk points corresponding to the clause category. Different clause categories correspond to different first intelligent review models.

[0008] When the total confidence level of the risk points corresponding to each of the aforementioned clause categories is greater than a preset threshold, the intelligent review result of the grassland contracting contract is obtained based on the risk points corresponding to each of the aforementioned clause categories.

[0009] When the total confidence level of the risk points corresponding to each of the aforementioned clause categories is less than or equal to the preset threshold, the second intelligent review model is invoked to review the grassland contracting contract based on the thinking chain technology, and the intelligent review result of the grassland contracting contract is obtained. The number of model parameters of the second intelligent review model is greater than the number of model parameters of the first intelligent review model.

[0010] In one embodiment, the step of reviewing the contract clauses to be reviewed within the clause category using a first intelligent review model corresponding to the clause category, and obtaining the risk points corresponding to the clause category, includes:

[0011] Based on the contract clauses to be reviewed included in the clause categories, a similarity semantic search is performed in a preset grassland contracting laws and regulations knowledge base to obtain the legal and regulatory clauses similar to each contract clause to be reviewed and the similarity between each contract clause to be reviewed and the corresponding legal and regulatory clauses.

[0012] For each of the aforementioned clause categories, based on the contract clauses to be reviewed included in the clause category, the legal and regulatory provisions corresponding to each contract clause to be reviewed, and the similarity, a prompt word corresponding to the clause category is constructed, and the prompt word corresponding to the clause category is input into the first intelligent review model corresponding to the clause category to obtain the risk point corresponding to the clause category.

[0013] In one embodiment, the step of performing a similarity semantic search in a preset grassland contracting laws and regulations knowledge base to obtain legal and regulatory clauses similar to each of the contract clauses to be reviewed, and the similarity between each contract clause to be reviewed and the corresponding legal and regulatory clauses, includes:

[0014] The first intelligent review model is used to convert each contract clause under review in the clause category into a first semantic vector, and the first intelligent review model is used to convert each legal and regulatory clause in the preset grassland contracting legal and regulatory knowledge base into a second semantic vector;

[0015] For each of the first semantic vectors, calculate the cosine similarity between the first semantic vector and each of the second semantic vectors;

[0016] Legal and regulatory clauses with a cosine similarity greater than a preset similarity are identified as legal and regulatory clauses similar to the corresponding contract clauses to be reviewed, and the cosine similarity is determined as the similarity between the corresponding contract clauses to be reviewed and the corresponding legal and regulatory clauses.

[0017] In one embodiment, the number of clause categories is 6, and the first intelligent review model corresponding to the clause categories is obtained in the following way:

[0018] Dynamic prompt templates are designed for the first intelligent review model corresponding to each of the aforementioned clause categories using prompt word technology;

[0019] The similarity score between the clause vector corresponding to the contract clause to be reviewed and the template vector corresponding to each of the dynamic prompt templates is calculated according to the following formula:

[0020] ;

[0021] Where τ=0.05, For the clause vector, For the i-th prompt template, for template vector;

[0022] The route weights are generated using the following formula:

[0023] ;

[0024] in, The similarity score is the score corresponding to the i-th dynamic prompt template. This is the kth dynamic prompt template;

[0025] The six types of first-level intelligent review models are dynamically activated according to the following calculation formula:

[0026] ;

[0027] in, For the first The low-rank incremental weights of the first-class intelligent review model The dynamic incremental weights are obtained by integrating the low-rank incremental weights of various first-level intelligent review models.

[0028] In one embodiment, the grassland contracting clause classification model is trained in the following manner:

[0029] Construct a contract terms classification dataset in JSON format, wherein each piece of data in the contract terms classification dataset includes the contract terms content and the terms classification label;

[0030] A classification task prompt template and classification knowledge are constructed, and the prompt word fine-tuning technology is used to input the classification task prompt template and classification knowledge into the large model to guide the large model to output contract text composed of clause content and classification labels;

[0031] Based on the clause content and classification labels output by the large model, the large model is trained using the parameter effective fine-tuning QLoRA and cross-entropy loss function to obtain a grassland contracting clause classification model. The calculation formula for parameter effective fine-tuning QLORA is as follows:

[0032] ;

[0033] in, For pre-trained weights, Incremental weights.

[0034] In one embodiment, the terms category label includes at least one of the following:

[0035] Define clause labels to clarify the core elements of the grassland contracting agreement, including the contracting parties, the contracted objects, and legal terms.

[0036] Numerical clauses are used for clauses involving at least one quantifiable indicator among contracted area, term, fees, and interest.

[0037] The rights and obligations clause is used to define the boundaries of the rights of both parties and the constraints on their behavior;

[0038] The jurisdiction clause is a clause that specifies the means of dispute resolution and the applicable law.

[0039] The breach of contract clause label is used to clearly define the circumstances and consequences of any breach of contract by any party.

[0040] Other terms and conditions tags are used for other supplementary terms and special agreements.

[0041] In one embodiment, the invocation of the second intelligent review model to review the grassland contracting contract based on the thinking chain technology, and the obtaining of the intelligent review result of the grassland contracting contract, includes:

[0042] A thought prompt template and thought chain instructions are constructed, wherein the thought prompt template is used to guide the second intelligent review model to review the grassland contract;

[0043] The thought prompt template is input into the second intelligent review model to generate a multi-step reasoning thought chain for output, wherein each step of reasoning corresponds to an internal reasoning result in the thought chain step;

[0044] The second intelligent review model analyzes the thought chain output to extract risk clauses, legal basis, and revision opinions, and generates an intelligent review report of the grassland contracting contract based on the risk clauses, legal basis, and revision opinions.

[0045] According to a second aspect of the present disclosure, a smart review device for grassland contracting contracts based on size model collaboration is provided, comprising:

[0046] The first processing module is used to respond to the user's upload operation on the grassland contract intelligent review page, obtain the grassland contract uploaded by the user, and classify the contract clauses to be reviewed in the grassland contract through the grassland contract clause classification model to obtain the clause category corresponding to each contract clause to be reviewed.

[0047] The second processing module, for each of the aforementioned clause categories, performs intelligent review on the contract clauses to be reviewed included in the clause category using the first intelligent review model corresponding to the clause category, and obtains the risk points corresponding to the clause category. Different clause categories correspond to different first intelligent review models.

[0048] The first review module is used to output the intelligent review result of the grassland contracting contract based on the risk points corresponding to each of the aforementioned clause categories when the total confidence level of the risk points corresponding to each of the aforementioned clause categories is greater than a preset threshold.

[0049] The second review module is used to call the second intelligent review model to conduct an intelligent review of the grassland contracting contract based on the thinking chain technology when the total confidence level of the risk points corresponding to each of the aforementioned clause categories is less than or equal to the preset threshold, thereby obtaining the intelligent review result of the grassland contracting contract. The number of model parameters of the second intelligent review model is greater than the number of model parameters of the first intelligent review model.

[0050] According to a third aspect of the present disclosure, an electronic device is provided, the electronic device including a memory and a processor, the memory being configured to store computer instructions executable on the processor, and the processor being configured to implement the steps of any of the methods in the first aspect when executing the computer instructions.

[0051] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described in any of the first aspects.

[0052] The technical solutions provided by the embodiments of this disclosure may include the following beneficial effects:

[0053] After obtaining the grassland contracting agreement uploaded by the user, the first intelligent review model can be used to review the contract clauses under review for each clause category, identifying the risk points corresponding to each clause category. When the total confidence level of the risk points corresponding to all clause categories is less than or equal to a preset threshold, the second intelligent review model is invoked to review the grassland contracting agreement based on the thinking chain technology, resulting in an intelligent review result. The second intelligent review model has a larger number of model parameters than the first intelligent review model; that is, the first intelligent review model is a smaller model, and the second intelligent review model is a larger model. Thus, by using confidence level calculation to guide the collaboration between the large and small models, intelligent review of grassland contracting agreements based on the collaboration between the large and small models is achieved, making the review of grassland contracting agreements more intelligent. This solves the problems of low accuracy when using a single small model and low efficiency and high cost when using a single large model. Attached Figure Description

[0054] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0055] Figure 1 This is a flowchart illustrating an intelligent review method for grassland contracting contracts based on size model collaboration, according to an exemplary embodiment of this disclosure;

[0056] Figure 2 This is a flowchart illustrating a smart review method for grassland contracting contracts based on size model collaboration, according to another exemplary embodiment of this disclosure;

[0057] Figure 3 This is a block diagram illustrating an intelligent review device for grassland contracting contracts based on size model collaboration, according to an exemplary embodiment of this disclosure;

[0058] Figure 4 This is a block diagram illustrating an intelligent review system for grassland contracting contracts based on size model collaboration, according to an exemplary embodiment of this disclosure;

[0059] Figure 5 This is a block diagram of an electronic device illustrated according to an exemplary embodiment of the present disclosure. Detailed Implementation

[0060] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.

[0061] The terminology used in this disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The singular forms “a,” “the,” and “the” as used in this disclosure and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any and all possible combinations of one or more of the associated listed items.

[0062] It should be understood that although the terms first, second, third, etc., may be used in this disclosure to describe various information, such information should not be limited to these terms. These terms are used only to distinguish information of the same type from one another. For example, without departing from the scope of this disclosure, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."

[0063] Firstly, at least one embodiment of this disclosure provides a method for intelligent review of grassland contracting contracts based on a size-model collaboration approach. Please refer to... Figure 1 The diagram illustrates the process of the method, including steps S101 to S104.

[0064] In step S101, in response to the user's upload operation on the grassland contract intelligent review page, the grassland contract uploaded by the user is obtained, and the contract clauses to be reviewed in the grassland contract are classified by the grassland contract clause classification model to obtain the clause category corresponding to each contract clause to be reviewed.

[0065] In step S102, for each clause category, the contract clauses to be reviewed within that clause category are examined using the first intelligent review model corresponding to that clause category to obtain the risk points corresponding to that clause category. Different clause categories correspond to different first intelligent review models.

[0066] In step S103, when the total confidence level of the risk points corresponding to each of the clause categories is greater than a preset threshold, the intelligent review result of the grassland contracting contract is obtained based on the risk points corresponding to each of the clause categories.

[0067] In step S104, when the total confidence level of the risk points corresponding to each of the aforementioned clause categories is less than or equal to the preset threshold, the second intelligent review model is invoked to review the grassland contracting contract based on the thinking chain technology, thereby obtaining the intelligent review result of the grassland contracting contract.

[0068] The second intelligent review model has a larger number of model parameters than the first intelligent review model; that is, the first intelligent review model is a small model, and the second intelligent review model is a large model. Therefore, by guiding the collaboration between large and small models through confidence calculation, intelligent review of grassland contracting contracts based on this collaboration is achieved, making grassland contracting contract review more intelligent. This also solves the problems of low accuracy when using a single small model and low efficiency and high cost when using a single large model.

[0069] To facilitate understanding of the intelligent review method for grassland contracting based on size model collaboration provided in this disclosure, the above steps are illustrated below with examples.

[0070] In one embodiment, in step S101, the grassland contract uploaded by the user can be preprocessed first, and then the contract clauses to be reviewed in the preprocessed grassland contract can be classified using a grassland contract clause classification model. For example, the preprocessing method includes: firstly, performing rule-guided structured text extraction on the input contract, i.e., identifying the positions of format-characteristic starting clauses (such as "I. Contract Period") and ending paragraphs (such as "VI. Validity and Dispute Resolution", "Party A:", etc.), then automatically extracting the "clause body" portion of the contract, and finally removing blank lines, special symbols, and garbled characters to accurately extract the main content of the contract.

[0071] In one embodiment, the grassland contracting contract terms classification model is trained as follows: A JSON-formatted contract terms classification dataset is constructed, wherein each data entry in the dataset includes contract terms content and preset terms classification labels; a classification task prompt template and classification knowledge are constructed, and the prompt word fine-tuning technique is used to input the prompt template and classification knowledge into a large model to guide the large model to output contract text composed of terms content and classification labels; based on the terms content and classification labels output by the large model, the large model is trained using parameter effective fine-tuning QLoRA and cross-entropy loss function to obtain the grassland contracting contract terms classification model, wherein the calculation formula for parameter effective fine-tuning QLORA is as follows:

[0072] ;

[0073] in, For pre-trained weights, Incremental weights.

[0074] In one embodiment, the classification label includes at least one of the following:

[0075] Define clause labels to clarify the core elements of the grassland contracting agreement, including the contracting parties, the contracted objects, and legal terms.

[0076] Numerical clauses are used for clauses involving at least one quantifiable indicator among contracted area, term, fees, and interest.

[0077] The rights and obligations clause is used to define the boundaries of the rights of both parties and the constraints on their behavior;

[0078] The jurisdiction clause is a clause that specifies the means of dispute resolution and the applicable law.

[0079] The breach of contract clause label is used to clearly define the circumstances and consequences of any breach of contract by any party.

[0080] Other terms and conditions tags are used for other supplementary terms and special agreements.

[0081] First, construct a JSON-formatted contract clause classification dataset. Each data entry includes an instruction and an output, where the instruction is the specific content of a contract clause, and the output is the corresponding clause classification label. For example, the constructed instruction-output key-value JSON dataset would look like this: {"instruction": "If Party B breaches the contract, it shall pay Party A a penalty equivalent to 50% of the annual contract fee"; "output": "Breach of Contract Liability Clause"}. Then, truncate the text using 512 tokens and divide it into training, validation, and test sets in a 7:1.5:1.5 ratio.

[0082] Then, the Qwen1.5-4B-Chat model was used, and the model was trained using the parameter-efficient fine-tuning QLoRA and cross-entropy loss function. The formula for the parameter-efficient fine-tuning QLoRA method is as follows:

[0083] ;

[0084] in, For pre-trained weights, Incremental weights.

[0085] Specifically, the model is first quantized to 4-bit precision, the original parameters are frozen, and then low-rank adapters with a rank of 64 are injected into each linear layer of the Transformer. Weights , A uses Kaiming normal initialization, while B uses zero initialization, reducing the number of parameters per layer from d² to 2rd. The training configuration uses BF16 mixed precision with the AdamW optimizer (lr=3e-4), combined with cosine annealing learning rate scheduling, and cross-entropy loss function with L2 regularization of 0.01 coefficient. Ten training rounds are performed, with batch_size=32 and gradient accumulation in 4 steps.

[0086] Next, using Prompt Tuning technology, the classification task prompt template and classification knowledge are input into the Qwen1.5-4B-Chat model, guiding the model to output contract text composed of terms and classification labels.

[0087] In this process, the role of Prompt Tuning technology is to explicitly guide the Qwen1.5-4B-Chat model to understand the contract clause classification task by injecting prompt templates and domain knowledge relevant to the classification task, thereby improving the accuracy of the classification task. Different contract clauses p and six classification labels c = {definition clauses, numerical clauses, ..., other clauses} use the following prompt template:

[0088] Instruction: XXX

[0089] Contract Clause: YYY

[0090] Answer: ZZZ

[0091] In this way, clear task instructions, contract terms information p, and classification labels c can be input into the model, enabling the model to quickly focus on the core semantics of the contract in classification tasks and efficiently complete the classification based on the prompts.

[0092] In one embodiment, in step S103, the contract clauses to be reviewed included in the clause category are reviewed by the first intelligent review model corresponding to the clause category to obtain the risk points corresponding to the clause category. This includes: based on the contract clauses to be reviewed included in the clause category, performing a similarity semantic search in a preset grassland contracting laws and regulations knowledge base to obtain the laws and regulations similar to each contract clause to be reviewed and the similarity between each contract clause to be reviewed and the corresponding laws and regulations; for each clause category, based on the contract clauses to be reviewed included in the clause category, the laws and regulations corresponding to each contract clause to be reviewed, and the similarity, constructing prompt words corresponding to the clause category, and inputting the prompt words corresponding to the clause category into the first intelligent review model corresponding to the clause category to obtain the risk points corresponding to the clause category.

[0093] In one embodiment, a first intelligent review model can be used to convert each contract clause to be reviewed in the clause category into a first semantic vector, and the first intelligent review model can be used to convert each legal and regulatory clause in the preset grassland contracting legal and regulatory knowledge base into a second semantic vector; for each first semantic vector, the cosine similarity between the first semantic vector and each second semantic vector is calculated; legal and regulatory clauses with a cosine similarity greater than a preset similarity are determined as legal and regulatory clauses similar to the corresponding contract clause to be reviewed, and the cosine similarity is determined as the similarity between the corresponding contract clause to be reviewed and the corresponding legal and regulatory clause.

[0094] For example, a fine-tuned BGE-M3 model can be used to perform semantic similarity retrieval between classified grassland contract terms and entries in the local legal and regulatory knowledge base.

[0095] For example, the fine-tuned BGE-M3 model is first used to convert the classified contract terms text into semantic vectors. Where c = {definition clauses, numerical clauses, ..., other clauses}. Then, a fine-tuned BGE-M3 model is used to convert the local legal and regulatory knowledge base content into semantic vectors. ,in, This is for entries in the local legal and regulatory knowledge base. Next, the clause vector is calculated. Vectors pre-stored in the local legal and regulatory knowledge base The semantic similarity is calculated using cosine similarity, which is calculated as follows: Finally, the terms, legal provisions, and similarity scores are output to the MiniCPM model.

[0096] It should be understood that, firstly, contract terms and laws and regulations are converted into 1024-dimensional semantic vectors; secondly, a Faiss index is constructed for all legal provisions to achieve efficient indexing; finally, based on similarity scores, the top 3 laws and regulations with the highest similarity are selected from the legal knowledge base. and corresponding similarity score The original contract terms text and contract terms category labels are input into the MiniCPM model, which serves as the expert mini-model.

[0097] In one embodiment, the number of clause categories is 6, and the first intelligent review model corresponding to each clause category is obtained as follows: Dynamic prompt templates are designed for the first intelligent review model corresponding to each clause category using prompt word technology; the similarity score between the clause vector corresponding to the contract clause to be reviewed and the template vector corresponding to each dynamic prompt template is calculated according to the following formula:

[0098] ;

[0099] Where τ=0.05, For the clause vector, For the i-th prompt template, for template vector;

[0100] The route weights are generated using the following formula:

[0101] ;

[0102] in, The similarity score is the score corresponding to the i-th dynamic prompt template. This is the kth dynamic prompt template;

[0103] The six types of first-level intelligent review models are dynamically activated according to the following calculation formula:

[0104] ;

[0105] in, For the first The low-rank incremental weights of the first-class intelligent review model The dynamic incremental weights are obtained by integrating the low-rank incremental weights of various first-level intelligent review models.

[0106] For example, the MiniCPM model can be decomposed into six types of expert mini-models for grassland contract terms using parameter-efficient fine-tuning QLoRA and dynamic hint routing techniques. Specifically, parameter-efficient fine-tuning QLoRA can be used to learn low-rank incremental weights.

[0107] First, dynamic prompt templates were designed using Prompt technology for expert models of six types of grassland contracting contract clauses. Then, the similarity score between the clause vector and the template vector was calculated using the following formula:

[0108] ;

[0109] Where τ=0.05, For the clause vector, Template vector, template hints As shown in Table 1, the corresponding prompt template is then converted into a 1024-dimensional template vector.

[0110] Table 1 Template Tips

[0111]

[0112] Then, route weights are generated using Softmax, as shown in the following formula:

[0113] ;

[0114] Therefore, parallel experts can be dynamically activated according to their weights, and the risk assessment results can be aggregated and output. The formula for the assessment results is as follows:

[0115] ;

[0116] in, This is the resource load factor, with a default value of 1. The adjustable range is [0.8, 1.2], depending on the expert call volume. Output for the i-th expert.

[0117] Finally, the expert models for six types of grassland contracting clauses are dynamically activated and used as a mini-model (i.e., the first intelligent review model). The formula for dynamically activating the model is as follows:

[0118] ;

[0119] in, For the first Low-rank incremental weights for small expert models. Specifically, for the i-th type of expert model, a pair of trainable low-rank matrices is introduced. and To approximate the incremental weights of the expert at a specific linear transformation layer. .

[0120] After obtaining the small model, a task-hint learning framework can be used to guide the small model to further enhance its semantic understanding and risk-focusing capabilities for different types of clauses, and to identify the risk points of the corresponding clauses.

[0121] Among them, can be utilized Calculate the confidence level of risk points based on probability. The formula is as follows:

[0122] ;

[0123] in, for Each small model (i.e., the first intelligent review model) corresponds to a specific clause category. Output layer vectors This is the classification weight matrix.

[0124] If the confidence level is higher than or equal to the threshold, for example The MiniCPM model directly outputs risk clauses and corresponding laws and regulations; if the risk level is below the threshold, i.e. This triggers the thought chain reasoning of the Qwen1.5-14B large model.

[0125] In one embodiment, in step S104, the second intelligent review model is invoked to review the grassland contracting contract based on the thinking chain technology to obtain the intelligent review result of the grassland contracting contract. This includes: constructing a thinking prompt template and a thinking chain instruction, wherein the thinking prompt template is used to guide the second intelligent review model to review the grassland contracting contract; inputting the thinking prompt template into the second intelligent review model to generate a multi-step reasoning thinking chain for output, wherein each step of reasoning corresponds to an internal reasoning result in the thinking chain step; parsing the thinking chain output through the second intelligent review model to extract risk clauses, legal basis, and revision opinions, and generating an intelligent review report of the grassland contracting contract based on the risk clauses, legal basis, and revision opinions.

[0126] For example, a CoT Prompt and thought chain instructions are constructed to guide the Qwen1.5-14B large model for grassland contracting contract review. The CoT Prompt template is as follows:

[0127] System Role Description: "You are a senior expert in contract law and grassland contracting regulations, and you are required to conduct in-depth legal reasoning on the following clauses."

[0128] Original terms and category hints: "Terms text: '...'; Category: '...'";

[0129] The instructions for the thought chain are as follows:

[0130] Step 1: Extract key information from the terms and conditions;

[0131] Step 2: Search for and cite relevant legal and regulatory provisions;

[0132] Step 3: Compare the terms and conditions with regulations to identify potential risks;

[0133] Step 4: Generate risk assessment and legal basis;

[0134] Step 5: Provide revision suggestions.

[0135] Then, input CoT Prompt into the Qwen1.5-14B large model to generate a multi-step reasoning thought chain output, where each step corresponds to the internal reasoning result in the thought chain steps.

[0136] Finally, the Qwen1.5-14B large model analyzes the thought chain output, extracts risk clauses, legal basis, and revision opinions, and generates a review report.

[0137] In one embodiment, the intelligent review of grassland contracting contracts based on size model collaboration provided in this disclosure includes, for example: Figure 2 The process is shown below.

[0138] Therefore, an intelligent review method for grassland contracting contracts based on big-small model collaboration can be realized. By introducing big-small model collaboration technology, thinking chain technology and MoE (Mixture of Experts) structure, a grassland contracting contract review can be achieved with high efficiency, accuracy, low cost and high interpretability.

[0139] According to a second aspect of the embodiments of this disclosure, such as Figure 3 As shown, a smart review device 300 for grassland contracting contracts based on size model collaboration is provided, comprising:

[0140] The first processing module 301 is used to respond to the user's upload operation on the grassland contract intelligent review page, obtain the grassland contract uploaded by the user, and classify the contract clauses to be reviewed in the grassland contract through the grassland contract clause classification model to obtain the clause category corresponding to each contract clause to be reviewed.

[0141] The second processing module 302, for each of the clause categories, performs intelligent review on the contract clauses to be reviewed included in the clause category through the first intelligent review model corresponding to the clause category, and obtains the risk points corresponding to the clause category, wherein different clause categories correspond to different first intelligent review models;

[0142] The first review module 303 is used to output the intelligent review result of the grassland contracting contract based on the risk points corresponding to each of the aforementioned clause categories when the total confidence level of the risk points corresponding to each of the aforementioned clause categories is greater than a preset threshold.

[0143] The second review module 304 is used to call the second intelligent review model to conduct intelligent review of the grassland contracting contract based on the thinking chain technology when the total confidence level of the risk points corresponding to each of the aforementioned clause categories is less than or equal to the preset threshold, thereby obtaining the intelligent review result of the grassland contracting contract. The model parameter count of the second intelligent review model is greater than that of the first intelligent review model.

[0144] In one embodiment, the second processing module 302 is used for:

[0145] Based on the contract clauses to be reviewed included in the clause categories, a similarity semantic search is performed in a preset grassland contracting laws and regulations knowledge base to obtain the legal and regulatory clauses similar to each contract clause to be reviewed and the similarity between each contract clause to be reviewed and the corresponding legal and regulatory clauses.

[0146] For each of the aforementioned clause categories, based on the contract clauses to be reviewed included in the clause category, the legal and regulatory provisions corresponding to each contract clause to be reviewed, and the similarity, a prompt word corresponding to the clause category is constructed, and the prompt word corresponding to the clause category is input into the first intelligent review model corresponding to the clause category to obtain the risk point corresponding to the clause category.

[0147] In one embodiment, the second processing module 302 is used for:

[0148] The first intelligent review model is used to convert each contract clause under review in the clause category into a first semantic vector, and the first intelligent review model is used to convert each legal and regulatory clause in the preset grassland contracting legal and regulatory knowledge base into a second semantic vector;

[0149] For each of the first semantic vectors, calculate the cosine similarity between the first semantic vector and each of the second semantic vectors;

[0150] Legal and regulatory clauses with a cosine similarity greater than a preset similarity are identified as legal and regulatory clauses similar to the corresponding contract clauses to be reviewed, and the cosine similarity is determined as the similarity between the corresponding contract clauses to be reviewed and the corresponding legal and regulatory clauses.

[0151] In one embodiment, the number of clause categories is 6, and the first intelligent review model corresponding to the clause categories is obtained through a training module, the training module being used for:

[0152] Dynamic prompt templates are designed for the first intelligent review model corresponding to each of the aforementioned clause categories using prompt word technology;

[0153] The similarity score between the clause vector corresponding to the contract clause to be reviewed and the template vector corresponding to each of the dynamic prompt templates is calculated according to the following formula:

[0154] ;

[0155] Where τ=0.05, For the clause vector, For the i-th prompt template, for template vector;

[0156] The route weights are generated using the following formula:

[0157] ;

[0158] in, The similarity score is the score corresponding to the i-th dynamic prompt template. This is the kth dynamic prompt template;

[0159] The six types of first-level intelligent review models are dynamically activated according to the following calculation formula:

[0160] ;

[0161] in, For the first The low-rank incremental weights of the first-class intelligent review model The dynamic incremental weights are obtained by integrating the low-rank incremental weights of various first-level intelligent review models.

[0162] In one embodiment, the terms category label includes at least one of the following:

[0163] Define clause labels to clarify the core elements of the grassland contracting agreement, including the contracting parties, the contracted objects, and legal terms.

[0164] Numerical clauses are used for clauses involving at least one quantifiable indicator among contracted area, term, fees, and interest.

[0165] The rights and obligations clause is used to define the boundaries of the rights of both parties and the constraints on their behavior;

[0166] The jurisdiction clause is a clause that specifies the means of dispute resolution and the applicable law.

[0167] The breach of contract clause label is used to clearly define the circumstances and consequences of any breach of contract by any party.

[0168] Other terms and conditions tags are used for other supplementary terms and special agreements.

[0169] In one embodiment, the second review module 304 is used for:

[0170] A thought prompt template and thought chain instructions are constructed, wherein the thought prompt template is used to guide the second intelligent review model to review the grassland contract;

[0171] The thought prompt template is input into the second intelligent review model to generate a multi-step reasoning thought chain for output, wherein each step of reasoning corresponds to an internal reasoning result in the thought chain step;

[0172] The second intelligent review model analyzes the thought chain output to extract risk clauses, legal basis, and revision opinions, and generates an intelligent review report of the grassland contracting contract based on the risk clauses, legal basis, and revision opinions.

[0173] In one embodiment, such as Figure 4As shown, this disclosure also provides an intelligent review system for grassland contracting contracts based on a big-small model collaboration, including: a data preprocessing module, a clause classification module, a legal knowledge retrieval module, a risk review module, and a result output module.

[0174] Specifically, the system's modules can be described as follows: the data preprocessing module is responsible for extracting the structured content of the grassland contracting text uploaded by users, identifying and separating the valid contract clauses; the clause classification module serves the MoE multi-expert structure in the subsequent risk review module, with the main architecture being the Qwen1.5-4B-Chat model, utilizing Prompt... Tuning and QLoRA fine-tuning technologies are used to semantically understand the extracted grassland contracting clauses and automatically label them into preset categories. The legal knowledge retrieval module uses a fine-tuned BGE-M3 model to semantically vectorize the grassland contracting clauses with the local legal knowledge base, and uses Faiss index for similarity matching to select relevant legal provisions for subsequent review models. The risk review module is based on the small and large model collaboration technology. It uses a MoE multi-expert structure composed of MiniCPM models as the small model for preliminary review, and with a confidence threshold, if it is lower than the threshold, it triggers Qwen1.5-14B guided by CoT technology as the large model for review. The result output module selects different models for output based on the confidence level. If the confidence level is higher than or equal to the threshold, the small model outputs the review result; if it is lower than the threshold, the large model outputs the review report.

[0175] Regarding the apparatus and system in the above embodiments, the specific manner in which each module performs its operations has been described in detail in the embodiments of the method in the first aspect, and will not be elaborated upon here.

[0176] According to a third aspect of the embodiments of this disclosure, please refer to the appendix. Figure 5 The diagram illustrates an exemplary block diagram of an electronic device 700, which may include a processor 701 and a memory 702. The electronic device 700 may also include one or more of a multimedia component 703, an input / output (I / O) interface 704, and a communication component 705.

[0177] The processor 701 controls the overall operation of the electronic device 700 to complete all or part of the steps in any of the methods described above. The memory 702 stores various types of data to support the operation of the electronic device 700. This data may include, for example, instructions for any application or method operating on the electronic device 700, and application-related data, such as the intelligent review results of a grassland contract. The memory 702 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The multimedia component 703 may include a screen and audio components. The screen may be, for example, a touchscreen, and the audio component is used to output and / or input audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signals may be further stored in memory 702 or transmitted via communication component 705. The audio component also includes at least one speaker for outputting audio signals. I / O interface 704 provides an interface between processor 701 and other interface modules, such as a keyboard, mouse, buttons, etc. These buttons may be virtual or physical buttons. Communication component 705 is used for wired or wireless communication between the electronic device 700 and other devices. Wireless communication may include Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G, or 4G, or one or more combinations thereof; therefore, the corresponding communication component 705 may include a Wi-Fi module, a Bluetooth module, or an NFC module.

[0178] In an exemplary embodiment, the electronic device 700 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above-described intelligent review method for grassland contracting contracts based on size-model collaboration.

[0179] In another exemplary embodiment, a computer-readable storage medium including program instructions is also provided, which, when executed by a processor, implement the steps of any of the methods described above. For example, the computer-readable storage medium may be the memory 702 including the program instructions described above, which may be executed by the processor 701 of the electronic device 700 to perform any of the methods described above.

[0180] In another exemplary embodiment, a computer program product is also provided, which includes a computer program executable by a processor, wherein the computer program, when executed by the processor, implements the steps of any of the methods described above.

[0181] The preferred embodiments of this disclosure have been described in detail above with reference to the accompanying drawings. However, this disclosure is not limited to the specific details of the above embodiments. Within the scope of the technical concept of this disclosure, various simple modifications can be made to the technical solutions of this disclosure, and these simple modifications all fall within the protection scope of this disclosure.

[0182] It should also be noted that the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. In order to avoid unnecessary repetition, this disclosure will not describe the various possible combinations separately.

[0183] Furthermore, various different embodiments of this disclosure can be combined in any way, as long as they do not violate the spirit of this disclosure, they should also be regarded as the content disclosed in this disclosure.

Claims

1. A method for intelligent review of grassland contracting agreements based on size-model collaboration, characterized in that, include: In response to the user's upload operation on the grassland contract intelligent review page, the grassland contract uploaded by the user is obtained, and the contract clauses to be reviewed in the grassland contract are classified by the grassland contract clause classification model to obtain the clause category corresponding to each contract clause to be reviewed. For each of the aforementioned clause categories, the contract clauses to be reviewed within the clause category are reviewed using the first intelligent review model corresponding to the clause category to obtain the risk points corresponding to the clause category. Different clause categories correspond to different first intelligent review models. When the total confidence level of the risk points corresponding to each of the aforementioned clause categories is greater than a preset threshold, the intelligent review result of the grassland contracting contract is obtained based on the risk points corresponding to each of the aforementioned clause categories. When the total confidence level of the risk points corresponding to each of the aforementioned clause categories is less than or equal to the preset threshold, the second intelligent review model is invoked to review the grassland contracting contract based on the thinking chain technology, and the intelligent review result of the grassland contracting contract is obtained. The number of model parameters of the second intelligent review model is greater than the number of model parameters of the first intelligent review model. The grassland contract clause classification model was trained in the following way: Construct a contract terms classification dataset in JSON format, wherein each piece of data in the contract terms classification dataset includes the contract terms content and the terms classification label; A classification task prompt template and classification knowledge are constructed, and the prompt word fine-tuning technology is used to input the classification task prompt template and classification knowledge into the large model to guide the large model to output contract text composed of clause content and classification labels; Based on the clause content and classification labels output by the large model, the large model is trained using the parameter effective fine-tuning QLoRA and cross-entropy loss function to obtain a grassland contracting clause classification model. The calculation formula for parameter effective fine-tuning QLORA is as follows: ; in, For pre-trained weights, Incremental weights; The category labels for the terms include at least one of the following: Define clause labels to clarify the core elements of the grassland contracting agreement, including the contracting parties, the contracted objects, and legal terms. Numerical clauses are used for clauses involving at least one quantifiable indicator among contracted area, term, fees, and interest. The rights and obligations clause is used to define the boundaries of the rights of both parties and the constraints on their behavior; The jurisdiction clause is a clause that specifies the means of dispute resolution and the applicable law. The breach of contract clause label is used to clearly define the circumstances and consequences of any breach of contract by any party. Other terms and conditions tags are used for other supplementary terms and special agreements.

2. The intelligent review method for grassland contracting based on size model collaboration according to claim 1, characterized in that, The process of reviewing the contract clauses under review within the clause category using the first intelligent review model corresponding to the clause category, and obtaining the risk points corresponding to the clause category, includes: Based on the contract clauses to be reviewed included in the clause categories, a similarity semantic search is performed in a preset grassland contracting laws and regulations knowledge base to obtain the legal and regulatory clauses similar to each contract clause to be reviewed and the similarity between each contract clause to be reviewed and the corresponding legal and regulatory clauses. For each of the aforementioned clause categories, based on the contract clauses to be reviewed included in the clause category, the legal and regulatory provisions corresponding to each contract clause to be reviewed, and the similarity, a prompt word corresponding to the clause category is constructed, and the prompt word corresponding to the clause category is input into the first intelligent review model corresponding to the clause category to obtain the risk point corresponding to the clause category.

3. The intelligent review method for grassland contracting based on size model collaboration according to claim 2, characterized in that, The step of performing a similarity semantic search in a pre-defined grassland contracting laws and regulations knowledge base to obtain legal and regulatory clauses similar to each of the contract clauses to be reviewed, as well as the similarity between each contract clause to be reviewed and its corresponding legal and regulatory clause, includes: The first intelligent review model is used to convert each contract clause under review in the clause category into a first semantic vector, and the first intelligent review model is used to convert each legal and regulatory clause in the preset grassland contracting legal and regulatory knowledge base into a second semantic vector; For each of the first semantic vectors, calculate the cosine similarity between the first semantic vector and each of the second semantic vectors; Legal and regulatory clauses with a cosine similarity greater than a preset similarity are identified as legal and regulatory clauses similar to the corresponding contract clauses to be reviewed, and the cosine similarity is determined as the similarity between the corresponding contract clauses to be reviewed and the corresponding legal and regulatory clauses.

4. The intelligent review method for grassland contracting based on size model collaboration according to any one of claims 1-3, characterized in that, The number of clause categories is 6, and the first intelligent review model corresponding to each clause category is obtained in the following way: Dynamic prompt templates are designed for the first intelligent review model corresponding to each of the aforementioned clause categories using prompt word technology; The similarity score between the clause vector corresponding to the contract clause to be reviewed and the template vector corresponding to each of the dynamic prompt templates is calculated according to the following formula: ; Where τ=0.05, For the clause vector, For the i-th prompt template, for template vector; The route weights are generated using the following formula: ; in, The similarity score is the score corresponding to the i-th dynamic prompt template. This is the kth dynamic prompt template; The six types of first-level intelligent review models are dynamically activated according to the following calculation formula: ; in, For the first The low-rank incremental weights of the first-class intelligent review model The dynamic incremental weights are obtained by integrating the low-rank incremental weights of various first-level intelligent review models.

5. The intelligent review method for grassland contracting contracts based on size model collaboration according to any one of claims 1-3, characterized in that, The invocation of the second intelligent review model, based on the thinking chain technology, to review the grassland contracting contract and obtain the intelligent review result of the grassland contracting contract includes: A thought prompt template and thought chain instructions are constructed, wherein the thought prompt template is used to guide the second intelligent review model to review the grassland contract; The thought prompt template is input into the second intelligent review model to generate a multi-step reasoning thought chain for output, wherein each step of reasoning corresponds to an internal reasoning result in the thought chain step; The second intelligent review model analyzes the thought chain output to extract risk clauses, legal basis, and revision opinions, and generates an intelligent review report of the grassland contracting contract based on the risk clauses, legal basis, and revision opinions.

6. A smart review device for grassland contracting agreements based on a large-scale model collaboration, characterized in that, The steps for implementing the method according to any one of claims 1-5 include: The first processing module is used to respond to the user's upload operation on the grassland contract intelligent review page, obtain the grassland contract uploaded by the user, and classify the contract clauses to be reviewed in the grassland contract through the grassland contract clause classification model to obtain the clause category corresponding to each contract clause to be reviewed. The second processing module, for each of the aforementioned clause categories, performs intelligent review on the contract clauses to be reviewed included in the clause category using the first intelligent review model corresponding to the clause category, and obtains the risk points corresponding to the clause category. Different clause categories correspond to different first intelligent review models. The first review module is used to output the intelligent review result of the grassland contracting contract based on the risk points corresponding to each of the aforementioned clause categories when the total confidence level of the risk points corresponding to each of the aforementioned clause categories is greater than a preset threshold. The second review module is used to call the second intelligent review model to conduct an intelligent review of the grassland contracting contract based on the thinking chain technology when the total confidence level of the risk points corresponding to each of the aforementioned clause categories is less than or equal to the preset threshold, thereby obtaining the intelligent review result of the grassland contracting contract. The number of model parameters of the second intelligent review model is greater than the number of model parameters of the first intelligent review model.

7. An electronic device, characterized in that, The electronic device includes a memory and a processor. The memory is used to store computer instructions that can be executed on the processor, and the processor is used to implement the steps of the method according to any one of claims 1-5 when executing the computer instructions.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by a processor, it implements the steps of the method according to any one of claims 1-5.

Citation Information

Patent Citations

  • Contract compliance auditing method and system based on generative language model

    CN117291515A

  • Contract review processing method and electronic equipment

    CN120031511A

  • Electronic contract management method and system based on deep learning model

    CN118761735A

  • Automated document review system combining deterministic and machine learning algorithms for legal document review

    US20220004713A1