Grassland contract intelligent review method, device and equipment based on big and small model collaboration
Through the collaboration of large and small models and thinking chain technology, efficient, accurate and intelligent review of grassland contracting contracts is achieved, the review difficulties of professionalism and complexity of grassland contracting contracts are solved, and the intelligence level and efficiency of the review are improved.
Patent Information
- Application Number
- CN202510844106.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-23
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2045-06-23
AI Technical Summary
Due to the professionalism and complexity of grassland contracting contracts, existing technologies make it difficult to achieve efficient and accurate intelligent review, especially the lack of compatibility between the ecological characteristics of grassland resources and legal requirements.
An intelligent review method based on the collaboration of large and small models is adopted. Preliminary classification is carried out through the grassland contract terms classification model, and a preliminary review is carried out using a small model. When the confidence level is high, the results are output. When the confidence level is low, the large model is called for in-depth review, and an intelligent review report is generated by combining the thinking chain technology.
It has achieved efficient, accurate and intelligent review of grassland contracting contracts, solved the problems of low accuracy of a single small model and low efficiency of a single large model, reduced costs and improved the intelligence level of the review.
Smart Images

Figure CN120672519A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence technology, and in particular to a method, device and equipment for intelligent review of grassland contracting contracts based on collaboration between large and small models. Background Art
[0002] Grassland contracting disputes are extremely frequent in Inner Mongolia. From 2005 to 2025, a total of 3,672 judgments and rulings related to grassland contracting were issued in my country. Of these, 1,711 cases originated in the Inner Mongolia Autonomous Region. Grassland contracting contracts play a decisive role in the grassland contracting process. According to data released by the Damao Banner People's Court in the Inner Mongolia Autonomous Region, contract disputes account for 54.23% of grassland disputes. Due to the vastness and sparse population of Inner Mongolia and the widespread distribution of pastoral areas, herders face high costs and limited access to legal services, making it difficult to hire professional lawyers for contract review. This leads to misunderstandings, omissions, and irregularities in contract signing and execution.
[0003] Compared to general land contracts, grassland contracts possess distinctly specialized and regional characteristics. Their clauses are designed to fully consider the ecological characteristics and management requirements of grassland resources. For example, in the definition of terms, grassland boundaries must be precisely described using geographical elements such as coordinate inflection points, making them far more complex than in typical land contracts. Numerical clauses, such as those concerning stocking capacity and rotational grazing cycles, must strictly comply with the Grassland Law's requirements for grass-livestock balance. Rights and obligations clauses include specific obligations such as ecological restoration and fire and pest control. These are often lengthy and complex, making them easily confused with management rights. In terms of dispute resolution, the contracts rely more heavily on government adjudication and administrative litigation, rather than the arbitration or civil litigation common in typical contracts.
[0004] 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 a generative language model, which mainly conducts reviews by comparing contract terms with standard templates or rules. However, the review methods based on rules and templates have limited ability to handle the complex legal logic and situational situations in grassland contracting contract terms, and are difficult to adapt to rapidly changing legal requirements and contract scenarios. In addition, the contract review technology based on large language models mainly conducts contract review by fine-tuning a general pre-trained large language model. However, the contract review technology based on large language models focuses more on general contract texts, and lacks the design of grassland contracting contract text review methods for highly specialized content. Summary of the Invention
[0005] In order to overcome the problems existing in the relevant technologies, the embodiments of the present disclosure provide a method, device and equipment for intelligent review of grassland contracting contracts based on the collaboration of large and small models to solve the problems of grassland contracting contract review caused by the fact that grassland contracting contracts have more refined values, more specific definitions, and more complex rights, obligations and jurisdiction than general land contracting contracts, so as to realize efficient and accurate intelligent review of grassland contracting contracts.
[0006] According to a first aspect of an embodiment of the present disclosure, a method for intelligently reviewing grassland contracting based on collaboration between large and small models is provided, comprising: In response to a user's upload operation on the grassland contracting contract intelligent review page, the grassland contracting contract uploaded by the user is obtained, and the contract clauses to be reviewed in the grassland contracting contract are classified using the grassland contracting contract clause classification model to obtain the clause category corresponding to each of the contract clauses to be reviewed; For each clause category, review the contract clauses to be reviewed included in the clause category using a first intelligent review model corresponding to the clause category to obtain risk points corresponding to the clause category, wherein different clause categories correspond to different first intelligent review models; When the total confidence level of the risk points corresponding to each of the clause categories is greater than a preset threshold, an intelligent review result of the grassland contract is obtained based on the risk points corresponding to each of the clause categories; When the total confidence level of the risk points corresponding to each of the clause categories is less than or equal to the preset threshold, the second intelligent review model is called to review the grassland contract based on the thinking chain technology to obtain the intelligent review result of the grassland contract, wherein the model parameter amount of the second intelligent review model is greater than the model parameter amount of the first intelligent review model.
[0007] In one embodiment, the first intelligent review model corresponding to the clause category is used to review the contract clauses to be reviewed included in the clause category to obtain the risk points corresponding to the clause category, including: Based on the contract clauses to be reviewed included in the clause category, similarity semantic search is performed 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 of the contract clauses to be reviewed and the corresponding legal and regulatory clauses; For each of the clause categories, based on the contract clauses to be reviewed included in the clause category, the legal and regulatory clauses corresponding to each of the contract clauses to be reviewed, and the similarity, prompt words corresponding to the clause category are constructed, and the prompt words corresponding to the clause category are input into the first intelligent review model corresponding to the clause category to obtain the risk points corresponding to the clause category.
[0008] In one embodiment, the similarity semantic search is performed 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 of the contract clauses to be reviewed and the corresponding legal and regulatory clauses, including: Using the fine-tuned third intelligent model to convert each contract clause to be reviewed included in the clause category into a first semantic vector, and using the fine-tuned third intelligent model 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, respectively calculating the cosine similarity between the first semantic vector and each of the second semantic vectors; The legal and regulatory clauses whose cosine similarity is greater than the preset similarity are determined 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.
[0009] In one embodiment, the number of clause categories is 6, and the first intelligent review model corresponding to the clause category is obtained in the following manner: Using prompt word technology to design a dynamic prompt template for the first intelligent review model corresponding to each of the clause categories; The similarity scores between the clause vector corresponding to the contract clause to be reviewed and the template vector corresponding to each dynamic prompt template are calculated according to the following formula: ; Where τ=0.05, is the term vector, is the i-th prompt template, for The template vector of The routing weight is generated by the following calculation formula: ; in, is the similarity score corresponding to the i-th dynamic prompt template, is the kth dynamic prompt template; According to the following calculation formula, the six categories of first-class intelligent review models are dynamically activated: ; in, For the Low-rank incremental weights for class-first intelligent review models, It is the dynamic incremental weight obtained by integrating the low-rank incremental weights of various first intelligent review models.
[0010] In one embodiment, the grassland contract clause classification model is trained in the following manner: Constructing a contract clause classification dataset in JSON format, wherein each data item in the contract clause classification dataset includes the contract clause content and the clause classification label; Constructing a classification task prompt template and classification knowledge, and using prompt word fine-tuning technology to input the classification task prompt template and classification knowledge into the large model to guide the large model to output the contract text consisting of clause content and classification labels; According to the clause 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 a grassland contract clause classification model, wherein the calculation formula of parameter effective fine-tuning QLORA is as follows: ; in, is the frozen pre-training weight, is the incremental weight.
[0011] In one embodiment, the term classification tag includes at least one of the following: Definition clause tags are used to clarify the core elements of grassland contracting parties, contracting objects, and legal terms; Numerical clause tags are used for clauses involving at least one quantitative indicator among contracted area, term, fee, and interest; Rights and obligations clause label, used to define the boundaries of rights and behavioral constraints of both parties; Jurisdiction clause tag, used to stipulate the means of resolving disputes and the applicable law; The Breach of Contract Liability Clause label is used to clarify the breach of contract circumstances and consequences of each party.
[0012] Other terms label, used for other auxiliary terms and special agreements.
[0013] In one embodiment, the second intelligent review model is called to review the grassland contract based on the thought chain technology to obtain the intelligent review result of the grassland contract, including: Constructing a thought prompt template and a thought chain instruction, wherein the thought prompt template is used to guide the second intelligent review model to review the grassland contract; Inputting the thought prompt template 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 parses the thinking chain output to extract risk clauses, legal basis and revision opinions, and generates an intelligent review report of the grassland contract based on the risk clauses, legal basis and revision opinions.
[0014] According to a second aspect of an embodiment of the present disclosure, there is provided an intelligent review device for grassland contracting based on collaboration between large and small models, comprising: A first processing module is configured to, in response to a 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 using a grassland contract clause classification model to obtain a clause category corresponding to each of the contract clauses to be reviewed; a second processing module, for each clause category, performing an intelligent review on the contract clauses to be reviewed included in the clause category using a first intelligent review model corresponding to the clause category, to obtain risk points corresponding to the clause category, wherein different clause categories correspond to different first intelligent review models; A first review module is configured to output an intelligent review result of the grassland contract according to the risk points corresponding to each of the clause categories when the total confidence level of the risk points corresponding to each of the clause categories is greater than a preset threshold; The second review module is used to call the second intelligent review model to perform an intelligent review of the grassland contracting contract based on the thinking chain technology when the total confidence of the risk points corresponding to each of the clause categories is less than or equal to the preset threshold, so as to obtain the intelligent review result of the grassland contracting contract, wherein the model parameter amount of the second intelligent review model is greater than the model parameter amount of the first intelligent review model.
[0015] According to a third aspect of an embodiment of the present disclosure, an electronic device is provided, comprising a memory and a processor, wherein 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 any one of the methods described in the first aspect when executing the computer instructions.
[0016] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the steps of any one of the methods described in the first aspect are implemented.
[0017] The technical solutions provided by the embodiments of the present disclosure may have the following beneficial effects: After obtaining the grassland contract uploaded by the user, the first intelligent review model can be used to review the contract terms to be reviewed in each clause category to obtain the risk points corresponding to the clause categories. When the total confidence of the risk points corresponding to each clause category is less than or equal to the preset threshold, the second intelligent review model is called to review the grassland contract based on the thinking chain technology to obtain the intelligent review results of the grassland contract. Among them, the model parameter quantity of the second intelligent review model is greater than the model parameter quantity of 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 large and small model collaborative technology through confidence calculation, the intelligent review of grassland contract based on the collaboration of large and small models is realized, making the grassland contract review intelligent, and at the same time solving the problems of low accuracy of review using a single small model and low efficiency and high cost of review using a single large model. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0019] Figure 1 is a flow chart of an intelligent review method for grassland contracting based on large and small model collaboration according to an exemplary embodiment of the present disclosure; Figure 2 is a flow chart of an intelligent review method for grassland contracting contracts based on large and small model collaboration according to another exemplary embodiment of the present disclosure; Figure 3 is a block diagram of an intelligent review device for grassland contracting based on large and small model collaboration according to an exemplary embodiment of the present disclosure; Figure 4 is a block diagram of an intelligent review system for grassland contracting based on large and small model collaboration according to an exemplary embodiment of the present disclosure; Figure 5 is a block diagram of an electronic device according to an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION
[0020] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all possible embodiments consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
[0021] The terms used in this disclosure are for the purpose of describing specific embodiments only and are not intended to limit the disclosure. As used in this disclosure and the appended claims, the singular forms "a," "an," "the," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
[0022] 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 only used to distinguish information of the same type from each other. 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 "at the time of" or "when" or "in response to determining."
[0023] In the first aspect, at least one embodiment of the present disclosure provides an intelligent review method for grassland contracting contracts based on large and small model collaboration, please refer to Figure 1 , which shows the process of the method, including steps S101 to S104.
[0024] In step S101, in response to the user's upload operation on the grassland contracting contract intelligent review page, the grassland contracting contract uploaded by the user is obtained, and the contract clauses to be reviewed in the grassland contracting contract are classified through the grassland contracting contract clause classification model to obtain the clause category corresponding to each of the contract clauses to be reviewed.
[0025] In step S102, for each clause category, the contract clauses to be reviewed included in 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.
[0026] In step S103, when the total confidence of the risk points corresponding to each of the clause categories is greater than a preset threshold, the intelligent review result of the grassland contract is obtained based on the risk points corresponding to each of the clause categories.
[0027] In step S104, when the total confidence of the risk points corresponding to each of the clause categories is less than or equal to the preset threshold, the second intelligent review model is called to review the grassland contract based on the thinking chain technology to obtain the intelligent review result of the grassland contract.
[0028] The second intelligent review model has a larger number of model parameters than the first, meaning the first is a small model and the second is a large model. This approach, guided by confidence calculations and the collaborative technology between large and small models, enables intelligent review of grassland contract contracts, making them 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.
[0029] In order to facilitate understanding of the intelligent review method for grassland contracting based on collaboration of large and small models provided by the present disclosure, the above steps are illustrated below with examples.
[0030] In one embodiment, in step S101, the grassland contract uploaded by the user can be pre-processed. The grassland contract clause classification model is then used to classify the contract clauses to be reviewed within the pre-processed grassland contract. For example, the pre-processing method includes first performing rule-guided structured text extraction on the input contract. Specifically, the method identifies the locations of formatting-specific opening clauses (e.g., "I. Contract Term") and closing clauses (e.g., "VI. Validity and Dispute Resolution," "Party A:"), then automatically extracts the "clause body" of the contract. Finally, blank lines, special symbols, and garbled characters are removed to accurately extract the contract's main content.
[0031] In one embodiment, a grassland contract clause classification model is trained by: constructing a contract clause classification dataset in JSON format, wherein each data in the contract clause classification dataset includes the contract clause content and a preset clause classification label; constructing a classification task prompt template and classification knowledge, and using the prompt word fine-tuning technology to input the classification task prompt template and classification knowledge into the large model to guide the large model to output a contract text consisting of the clause content and classification labels; based on the clause 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 a grassland contract clause classification model, wherein the calculation formula of parameter effective fine-tuning QLORA is as follows: ; in, is the frozen pre-training weight, is the incremental weight.
[0032] In one embodiment, the classification label includes at least one of the following: Definition clause tags are used to clarify the core elements of grassland contracting parties, contracting objects, and legal terms; Numerical clause tags are used for clauses involving at least one quantitative indicator among contracted area, term, fee, and interest; Rights and obligations clause label, used to define the boundaries of rights and behavioral constraints of both parties; Jurisdiction clause tag, used to stipulate the means of resolving disputes and the applicable law; The Breach of Contract Liability Clause label is used to clarify the breach of contract circumstances and consequences of each party.
[0033] Other terms label, used for other auxiliary terms and special agreements.
[0034] First, construct a JSON-formatted contract clause classification dataset. Each data entry consists of "instruction" and "output," where "instruction" represents the content of a specific contract clause and "output" represents the corresponding clause classification label. For example, a JSON dataset with the instruction-output key value constructed 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, the text was truncated at 512 tokens and divided into training, validation, and test sets at a ratio of 7:1.5:1.5.
[0035] Then, the Qwen1.5-4B-Chat model was used to train the model using the parameter-efficient fine-tuning QLoRA and cross-entropy loss function. The parameter-efficient fine-tuning QLoRA method formula is as follows: ; in, is the frozen pre-training weight, is the incremental weight.
[0036] Specifically, the model is first quantized to 4-bit precision, the original parameters are frozen, and then a low-rank adapter with a rank of 64 is injected into each linear layer of the Transformer. , A was initialized with Kaiming's normalization, and B was initialized with zeros, reducing the number of parameters per layer from d² to 2rd. The training configuration used BF16 mixed precision and the AdamW optimizer (lr=3e-4), with a cosine annealing learning rate schedule. The cross-entropy loss function included an L2 regularization with a coefficient of 0.01. Ten epochs of training were performed, with a batch size of 32 and four steps of gradient accumulation.
[0037] Then, the Prompt Tuning technology is used to input the classification task prompt template and classification knowledge into the Qwen1.5-4B-Chat model, guiding the model to output the contract text consisting of terms and classification labels.
[0038] In this process, Prompt Tuning technology explicitly guides the Qwen1.5-4B-Chat model in understanding the contract clause classification task by injecting prompt templates and domain knowledge related to the classification task, thereby improving classification accuracy. For different contract clauses p and six classification labels c = {definition clause, numerical clause, ..., other clause}, the following prompt templates are used: Instruction:XXX Contract Clause:YYY Answer:ZZZ In this way, clear task instructions, contract terms information p and classification labels c can be input into the model, so that the model can quickly focus on the semantic core of the contract in the classification task and efficiently complete the classification based on the prompt content.
[0039] 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 risk points corresponding to the clause category, including: based on the contract clauses to be reviewed included in the clause category, similarity semantic retrieval is performed 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 of the contract clauses to be reviewed and the corresponding legal and regulatory clauses; for each of the clause categories, based on the contract clauses to be reviewed included in the clause category, the legal and regulatory clauses corresponding to each of the contract clauses 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 risk points corresponding to the clause category.
[0040] In one embodiment, a fine-tuned third intelligent model can be used to convert each contract clause to be reviewed included in the clause category into a first semantic vector, and the fine-tuned third intelligent 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 respectively; the legal and regulatory clauses whose cosine similarity is greater than the 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.
[0041] For example, the fine-tuned BGE-M3 model can be used to perform similarity semantic retrieval on the classified grassland contract clause text and local laws and regulations knowledge base entries.
[0042] For example, we first use the fine-tuned BGE-M3 model to convert the classified contract terms text into semantic vectors. , where c = {definition clauses, numerical clauses, ..., other clauses}. Then, the fine-tuned BGE-M3 model is used to convert the local legal knowledge base content into semantic vectors. ,in, is the local legal and regulatory knowledge base entry. Then, the clause vector is calculated Pre-stored vectors with local legal and regulatory knowledge base Among them, cosine similarity can be used, and its calculation formula is as follows: Finally, the terms, legal provisions and similarities are output to the MiniCPM model.
[0043] It should be understood that first, the contract terms and laws and regulations are converted into 1024-dimensional semantic vectors, and then all laws are indexed with Faiss to achieve efficient indexing; finally, based on the similarity score, the top three laws and regulations with the highest similarity are selected from the legal knowledge base. and the corresponding similarity score , together with the original contract terms text and contract terms classification labels, are input into the MiniCPM model as an expert small model.
[0044] In one embodiment, the number of clause categories is 6, and the first intelligent review models corresponding to the clause categories are obtained by designing dynamic prompt templates for the first intelligent review models corresponding to each clause category using prompt word technology; and calculating similarity scores between the clause vector corresponding to the contract clause to be reviewed and the template vector corresponding to each dynamic prompt template according to the following formula: ; Where τ=0.05, is the term vector, is the i-th prompt template, for The template vector of The routing weight is generated by the following calculation formula: ; in, is the similarity score corresponding to the i-th dynamic prompt template, is the kth dynamic prompt template; According to the following calculation formula, the six categories of first-class intelligent review models are dynamically activated: ; in, For the Low-rank incremental weights for class-first intelligent review models, It is the dynamic incremental weight obtained by integrating the low-rank incremental weights of various first intelligent review models.
[0045] For example, parameter-efficient fine-tuning QLoRA and dynamic prompt routing technology can be used to guide the MiniCPM model to decompose into six types of grassland contract clause expert small models. Among them, parameter-efficient fine-tuning QLoRA can be used to learn low-rank incremental weights.
[0046] First, we used Prompt technology to design dynamic prompt templates for the expert model of six types of grassland contract clauses. Then, we calculated the similarity score between the clause vector and the template vector using the following formula: ; Where τ=0.05, is the term vector, is the template vector, template hint As shown in Table 1, the corresponding prompt template is then converted into a 1024-dimensional template vector.
[0047] Table 1 Template prompt table Then, the routing weight is generated through Softmax, and the formula is as follows: ; Therefore, the parallel experts can be dynamically activated according to the weights and the risk determination results can be summarized and output. The determination result formula is: ; in, The resource load factor has a default value of 1 and can be adjusted in the range of [0.8, 1.2] based on the expert call heat. Output for the i-th expert.
[0048] Finally, the expert model of the six categories of grassland contract clauses is dynamically activated and used as a small model (i.e., the first intelligent review model). The formula for the dynamic activation model is as follows: ; in, For the Specifically, for the i-th type of expert model, a pair of trainable low-rank matrices is introduced and , to approximate the incremental weight of the expert in a specific linear transformation layer .
[0049] After obtaining the small model, the task prompt learning framework can be used to guide the small model to further enhance its semantic understanding and risk focus capabilities of different categories of clauses, and identify the risk points of the corresponding clauses.
[0050] Among them, you can use Probabilistic calculation of risk point confidence , the formula is as follows: ; in, for Small model (i.e. the first intelligent review model) corresponds to the clause category Output layer vector, is the classification weight matrix.
[0051] If the confidence level is higher than or equal to the threshold, such as , the MiniCPM model directly outputs risk terms and corresponding laws and regulations; if the low degree is lower than the threshold, that is , triggering the thought chain reasoning of the Qwen1.5-14B large model.
[0052] In one embodiment, in step S104, the second intelligent review model is called to review the grassland contracting contract based on the thinking chain technology to obtain the intelligent review result of the grassland contracting contract, including: constructing a thinking prompt template and a thinking chain instruction, the thinking prompt template is used to guide the second intelligent review model to review the grassland contracting contract; the thinking prompt template is input 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; the thinking chain output is parsed by the second intelligent review model to extract risk clauses, legal basis and revision opinions, and based on the risk clauses, the legal basis and the revision opinions, an intelligent review report of the grassland contracting contract is generated.
[0053] For example, the CoT Prompt and thought chain instructions are constructed to guide the Qwen1.5-14B large model to review grassland contracting contracts. The CoT Prompt template is as follows: {System role description: "You are a senior expert in contract law and grassland contracting regulations. You need to conduct in-depth legal reasoning on the following clauses." Original text of clause and category prompt: "Clause text: '…'; Category: '…'"; The thought chain instructions are as follows: Step 1: Extract key information of clauses; Step 2: Search and cite relevant laws and regulations; Step 3: Compare terms and regulations to identify potential risk points; Step 4: Generate risk judgment and legal basis; Step 5: Provide revision suggestions. Then, the CoT Prompt is input into the Qwen1.5-14B large model to generate a multi-step reasoning thinking chain output, where each step corresponds to the internal reasoning result in the thinking chain step.
[0054] 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.
[0055] In one embodiment, the grassland contracting intelligent review based on large and small model collaboration provided by the present disclosure includes the following: Figure 2 The process shown.
[0056] Therefore, an intelligent review method for grassland contracting contracts based on the collaboration of large and small models can be realized, and the large and small model collaboration technology, thinking chain technology and MoE (Mixture of Experts) structure are introduced to realize efficient, accurate, low-cost and highly interpretable grassland contracting contract review.
[0057] According to the second aspect of the embodiment of the present disclosure, Figure 3 As shown, a grassland contract intelligent review device 300 based on large and small model collaboration is provided, comprising: The first processing module 301 is configured to, in response to a 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 using the grassland contract clause classification model to obtain a clause category corresponding to each contract clause to be reviewed; The second processing module 302 performs an intelligent review of the contract clauses to be reviewed included in each clause category using a first intelligent review model corresponding to the clause category to obtain risk points corresponding to the clause category, wherein different clause categories correspond to different first intelligent review models; The first review module 303 is configured to output an intelligent review result of the grassland contract based on the risk points corresponding to each of the clause categories when the total confidence level of the risk points corresponding to each of the clause categories is greater than a preset threshold; The second review module 304 is used to call the second intelligent review model to perform an intelligent review of the grassland contracting contract based on the thinking chain technology when the total confidence of the risk points corresponding to each of the clause categories is less than or equal to the preset threshold, so as to obtain the intelligent review result of the grassland contracting contract, wherein the model parameter amount of the second intelligent review model is greater than the model parameter amount of the first intelligent review model.
[0058] In one embodiment, the second processing module 302 is configured to: Based on the contract clauses to be reviewed included in the clause category, similarity semantic search is performed 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 of the contract clauses to be reviewed and the corresponding legal and regulatory clauses; For each of the clause categories, based on the contract clauses to be reviewed included in the clause category, the legal and regulatory clauses corresponding to each of the contract clauses to be reviewed, and the similarity, prompt words corresponding to the clause category are constructed, and the prompt words corresponding to the clause category are input into the first intelligent review model corresponding to the clause category to obtain the risk points corresponding to the clause category.
[0059] In one embodiment, the second processing module 302 is configured to: Using the fine-tuned third intelligent model to convert each contract clause to be reviewed included in the clause category into a first semantic vector, and using the fine-tuned third intelligent model 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, respectively calculating the cosine similarity between the first semantic vector and each of the second semantic vectors; The legal and regulatory clauses whose cosine similarity is greater than the preset similarity are determined 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.
[0060] In one embodiment, the number of clause categories is 6, and the first intelligent review model corresponding to the clause category is obtained through the following training module, which is used to: Using prompt word technology to design a dynamic prompt template for the first intelligent review model corresponding to each of the clause categories; The similarity scores between the clause vector corresponding to the contract clause to be reviewed and the template vector corresponding to each dynamic prompt template are calculated according to the following formula: ; Where τ=0.05, is the term vector, is the i-th prompt template, for The template vector of The routing weight is generated by the following calculation formula: ; in, is the similarity score corresponding to the i-th dynamic prompt template, is the kth dynamic prompt template; According to the following calculation formula, the six categories of first-class intelligent review models are dynamically activated: ; in, For the Low-rank incremental weights for class-first intelligent review models, It is the dynamic incremental weight obtained by integrating the low-rank incremental weights of various first intelligent review models.
[0061] In one embodiment, the term classification tag includes at least one of the following: Definition clause tags are used to clarify the core elements of grassland contracting parties, contracting objects, and legal terms; Numerical clause tags are used for clauses involving at least one quantitative indicator among contracted area, term, fee, and interest; Rights and obligations clause label, used to define the boundaries of rights and behavioral constraints of both parties; Jurisdiction clause tag, used to stipulate the means of resolving disputes and the applicable law; The Breach of Contract Liability Clause label is used to clarify the breach of contract circumstances and consequences of each party.
[0062] Other terms label, used for other auxiliary terms and special agreements.
[0063] In one embodiment, the second review module 304 is configured to: Constructing a thought prompt template and a thought chain instruction, wherein the thought prompt template is used to guide the second intelligent review model to review the grassland contract; Inputting the thought prompt template 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 parses the thinking chain output to extract risk clauses, legal basis and revision opinions, and generates an intelligent review report of the grassland contract based on the risk clauses, legal basis and revision opinions.
[0064] In one embodiment, Figure 4 As shown, the present disclosure also provides an intelligent review system for grassland contracting contracts based on collaboration between large and small models, including: a data preprocessing module, a clause classification module, a legal knowledge retrieval module, a risk review module, and a result output module.
[0065] Specifically, the modules of the system can be described as follows: the data preprocessing module is responsible for structural extraction of grassland contract texts uploaded by users, identifying and separating valid contract clauses; the clause classification module serves the MoE multi-expert structure in the subsequent risk review module, and its backbone architecture is the Qwen1.5-4B-Chat model, using Prompt Tuning and QLoRA fine-tuning technologies are used to semantically understand the extracted grassland contract terms and automatically mark them as preset categories; the legal knowledge retrieval module uses the fine-tuned BGE-M3 model to semantically encode the grassland contract terms with the local legal and regulatory knowledge base, and uses the Faiss index for similarity matching, and selects relevant laws and regulations to pass them into the subsequent review model; the risk review module is based on the collaborative technology of large and small models, using the MoE multi-expert structure composed of the MiniCPM model as the small model for preliminary review, and combined with the confidence threshold. If it is lower than the threshold, it triggers the 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. If the confidence 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.
[0066] Regarding the devices and systems in the above embodiments, the specific manner in which each module performs operations has been described in detail in the embodiment of the first aspect related to the method, and will not be elaborated here.
[0067] According to the third aspect of the embodiment of the present disclosure, please refer to the attached Figure 5 , which exemplarily shows a block diagram of an electronic device, the electronic device 700 may include: a processor 701, 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.
[0068] The processor 701 is used to control the overall operation of the electronic device 700 to complete all or part of the steps in any of the above-described methods. The memory 702 is used to store 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, as well as application-related data, such as the intelligent review results of grassland contract contracts. 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 touch screen, 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 signal may be further stored in the memory 702 or sent through the communication component 705. The audio component also includes at least one speaker for outputting audio signals. The I / O interface 704 provides an interface between the processor 701 and other interface modules, and the above-mentioned other interface modules may be a keyboard, a mouse, buttons, etc. These buttons may be virtual buttons or physical buttons. The communication component 705 is used for wired or wireless communication between the electronic device 700 and other devices. Wireless communication, such as Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G or 4G, or a combination of one or more of them, so the corresponding communication component 705 may include: a Wi-Fi module, a Bluetooth module, an NFC module.
[0069] In an exemplary embodiment, the electronic device 700 can 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 execute the above-mentioned intelligent review method for grassland contracting contracts based on large and small model collaboration.
[0070] In another exemplary embodiment, a computer-readable storage medium including program instructions is further provided, wherein the program instructions, when executed by a processor, implement the steps of any of the above methods. For example, the computer-readable storage medium may be the memory 702 including the program instructions, and the program instructions may be executed by the processor 701 of the electronic device 700 to perform any of the above methods.
[0071] In another exemplary embodiment, a computer program product is further provided. The computer program product includes a computer program that can be executed by a processor. When the computer program is executed by the processor, the steps of any of the above methods are implemented.
[0072] The preferred embodiments of the present disclosure are described in detail above in conjunction with the accompanying drawings. However, the present disclosure is not limited to the specific details of the above embodiments. Within the technical concept of the present disclosure, various simple modifications can be made to the technical solutions of the present disclosure, and these simple modifications all fall within the scope of protection of the present disclosure.
[0073] It should also be noted that the various specific technical features described in the above specific embodiments can be combined in any appropriate manner without contradiction. In order to avoid unnecessary repetition, the present disclosure will not further describe various possible combinations.
[0074] In addition, the various embodiments of the present disclosure may be arbitrarily combined, and as long as they do not violate the concept of the present disclosure, they should also be regarded as the contents disclosed by the present disclosure.
Claims
1. An intelligent review method for grassland contracting based on collaboration between large and small models, characterized by: include: In response to a user's upload operation on the grassland contracting contract intelligent review page, the grassland contracting contract uploaded by the user is obtained, and the contract clauses to be reviewed in the grassland contracting contract are classified using the grassland contracting contract clause classification model to obtain the clause category corresponding to each of the contract clauses to be reviewed; For each clause category, review the contract clauses to be reviewed included in the clause category using a first intelligent review model corresponding to the clause category to obtain risk points corresponding to the clause category, wherein different clause categories correspond to different first intelligent review models; When the total confidence level of the risk points corresponding to each of the clause categories is greater than a preset threshold, an intelligent review result of the grassland contract is obtained based on the risk points corresponding to each of the clause categories; When the total confidence level of the risk points corresponding to each of the clause categories is less than or equal to the preset threshold, the second intelligent review model is called to review the grassland contract based on the thinking chain technology to obtain the intelligent review result of the grassland contract, wherein the model parameter amount of the second intelligent review model is greater than the model parameter amount of the first intelligent review model.
2. The intelligent review method for grassland contracting based on large and small model collaboration according to claim 1 is characterized in that: The first intelligent review model corresponding to the clause category is used to review the contract clauses to be reviewed included in the clause category to obtain risk points corresponding to the clause category, including: Based on the contract clauses to be reviewed included in the clause category, similarity semantic search is performed 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 of the contract clauses to be reviewed and the corresponding legal and regulatory clauses; For each of the clause categories, based on the contract clauses to be reviewed included in the clause category, the legal and regulatory clauses corresponding to each of the contract clauses to be reviewed, and the similarity, prompt words corresponding to the clause category are constructed, and the prompt words corresponding to the clause category are input into the first intelligent review model corresponding to the clause category to obtain the risk points corresponding to the clause category.
3. The intelligent review method for grassland contracting based on large and small model collaboration according to claim 2 is characterized in that: The similarity semantic search is performed in the preset grassland contracting laws and regulations knowledge base to obtain the legal and regulatory clauses similar to each of the contract clauses to be reviewed and the similarity between each of the contract clauses to be reviewed and the corresponding legal and regulatory clauses, including: Using the fine-tuned third intelligent model to convert each contract clause to be reviewed included in the clause category into a first semantic vector, and using the fine-tuned third intelligent model 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, respectively calculating the cosine similarity between the first semantic vector and each of the second semantic vectors; The legal and regulatory clauses whose cosine similarity is greater than the preset similarity are determined 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 large and small model collaboration according to any one of claims 1 to 3 is characterized in that: The number of clause categories is 6, and the first intelligent review model corresponding to the clause category is obtained in the following manner: Using prompt word technology to design a dynamic prompt template for the first intelligent review model corresponding to each of the clause categories; The similarity scores between the clause vector corresponding to the contract clause to be reviewed and the template vector corresponding to each dynamic prompt template are calculated according to the following formula: ; Where τ=0.05, is the term vector, is the i-th prompt template, for The template vector of The routing weight is generated by the following calculation formula: ; in, is the similarity score corresponding to the i-th dynamic prompt template, is the kth dynamic prompt template; According to the following calculation formula, the six categories of first-class intelligent review models are dynamically activated: ; in, For the Low-rank incremental weights for class-first intelligent review models, It is the dynamic incremental weight obtained by integrating the low-rank incremental weights of various first intelligent review models.
5. The intelligent review method for grassland contracting based on large and small model collaboration according to any one of claims 1 to 3 is characterized in that: The grassland contract clause classification model is trained in the following way: Constructing a contract clause classification dataset in JSON format, wherein each data item in the contract clause classification dataset includes the contract clause content and the clause classification label; Constructing a classification task prompt template and classification knowledge, and using prompt word fine-tuning technology to input the classification task prompt template and classification knowledge into the large model to guide the large model to output the contract text consisting of clause content and classification labels; According to the clause 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 a grassland contract clause classification model, wherein the calculation formula of parameter effective fine-tuning QLORA is as follows: ; in, is the frozen pre-training weight, is the incremental weight.
6. The intelligent review method for grassland contracting based on large and small model collaboration according to claim 5 is characterized in that: The term classification label includes at least one of the following: Definition clause tags are used to clarify the core elements of grassland contracting parties, contracting objects, and legal terms; Numerical clause tags are used for clauses involving at least one quantitative indicator among contracted area, term, fee, and interest; Rights and obligations clause label, used to define the boundaries of rights and behavioral constraints of both parties; Jurisdiction clause tag, used to stipulate the means of resolving disputes and the applicable law; The Breach of Contract Liability Clause label is used to clarify the breach of contract circumstances and consequences of each party; Other terms label, used for other auxiliary terms and special agreements.
7. The intelligent review method for grassland contracting based on large and small model collaboration according to any one of claims 1 to 3 is characterized in that: The second intelligent review model is called to review the grassland contract based on the thought chain technology to obtain the intelligent review results of the grassland contract, including: Constructing a thought prompt template and a thought chain instruction, wherein the thought prompt template is used to guide the second intelligent review model to review the grassland contract; Inputting the thought prompt template 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 parses the thinking chain output to extract risk clauses, legal basis and revision opinions, and generates an intelligent review report of the grassland contract based on the risk clauses, legal basis and revision opinions.
8. An intelligent review device for grassland contracting based on large and small model collaboration, characterized by: The steps for implementing the method according to any one of claims 1 to 7 include: A first processing module is configured to, in response to a 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 using a grassland contract clause classification model to obtain a clause category corresponding to each of the contract clauses to be reviewed; a second processing module, for each clause category, performing an intelligent review on the contract clauses to be reviewed included in the clause category using a first intelligent review model corresponding to the clause category, to obtain risk points corresponding to the clause category, wherein different clause categories correspond to different first intelligent review models; A first review module is configured to output an intelligent review result of the grassland contract according to the risk points corresponding to each of the clause categories when the total confidence level of the risk points corresponding to each of the clause categories is greater than a preset threshold; The second review module is used to call the second intelligent review model to perform an intelligent review of the grassland contracting contract based on the thinking chain technology when the total confidence of the risk points corresponding to each of the clause categories is less than or equal to the preset threshold, so as to obtain the intelligent review result of the grassland contracting contract, wherein the model parameter amount of the second intelligent review model is greater than the model parameter amount of the first intelligent review model.
9. An electronic device, characterized in that: The electronic device includes a memory and a processor, wherein 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 to 7 when executing the computer instructions.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
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