A method and system for intelligent contract review and modification based on multiple large models
By using multiple large models combined with semantic analysis and rules engines, and combining the identity and status information of contract parties, the problem that the existing smart contract review system cannot effectively personalize contract review and modification, and achieve more accurate and legal contract review and modification effects.
Patent Information
- Application Number
- CN202411058849.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-02
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2044-08-02
AI Technical Summary
The existing smart contract review system is difficult to effectively combine the identity and status information of the parties to the contract, resulting in the inability to personalize and reasonable contract review and modification.
Using a method based on multiple large models, by obtaining the original contract text and information of both parties input by the user, using pre-trained language models such as RoBERTa for semantic analysis, determine the contract type, user identity and status, and based on this information, from the preset template library Select the appropriate contract template for review and modification.
It has achieved personalized contract review standards and modification plans based on the identity and status of the parties to the contract, which has improved the accuracy and legality of contract review, reduced legal risks, and improved the overall quality and professionalism of the contract.
Smart Images

Figure CN118967042B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of artificial intelligence, and specifically relates to a method and system for intelligent contract review and modification based on multiple large models. Background Art
[0002] Contracts are important legal documents in business activities, which clearly define the rights and obligations of all parties to the contract. The traditional contract review and modification process is usually completed manually by legal professionals, which is not only time-consuming and laborious, but also prone to human omissions, leading to legal risks. With the development of artificial intelligence technology, smart contract review and modification has gradually become a research hotspot, especially through large models (such as BERT, GPT-4, T5, etc.) to automatically process contract texts.
[0003] Big models have demonstrated strong capabilities in natural language processing and can understand and generate complex language structures. By combining multiple big models, accurate analysis and intelligent processing of contract texts can be achieved, improving the efficiency and accuracy of contract review and modification. However, a single big model has limitations in dealing with complex scenarios such as contract review and modification, because contracts involve many aspects, including legal, financial, technical, etc., and require detailed semantic analysis and clause optimization based on the specific context.
[0004] At the same time, most of the current smart contract review systems only focus on the content of the contract itself, while ignoring the identity and status of the parties to the contract. However, in actual applications, the identity of the parties to the contract (such as Party A or Party B) and their position in the negotiation (such as strong, weak or neutral) have an important impact on the review and modification of the contract terms. Preferably, the strong Party A may hope that the contract terms are more favorable to itself, while the weak Party B may pay more attention to the fairness of the contract terms and the protection of its own rights and interests. Therefore, combining the identity and status information of the parties to the contract can provide a more personalized and reasonable contract review and modification plan. Summary of the invention
[0005] In order to solve the problem of intelligent contract review in the prior art, a contract intelligent review and modification method and system based on multiple large models are proposed.
[0006] In one embodiment, the present invention proposes a method for intelligent contract review and modification based on multiple large models, comprising the following steps:
[0007] Obtain the original contract text and information of both parties of the contract input by the user, perform semantic analysis on the original contract text using the first model, determine the contract type, the identity and status of the user, the identity includes: Party A, Party B, and the status includes: strong, weak, neutral; output the contract type, the identity and status information of the user, and confirm it by the user;
[0008] Determining a first contract template from a preset template library according to the contract type, the identity and status information of the user;
[0009] A classification module is used to obtain the original contract text and the information of the two parties of the contract input by the user, perform semantic analysis on the original contract text using the first model, determine the contract type, the identity and status of the user, the identity includes: Party A, Party B, the status includes: strong, weak, neutral; output the contract type, the identity and status information of the user, and confirm it by the user;
[0010] A query module, used to determine a first contract template from a preset template library according to the contract type, the identity and status information of the user;
[0011] The review and modification module is used to input the original contract text and the first contract template into the second model, review and modify the original contract text, and output the modified contract.
[0012] The present invention can produce the following beneficial effects through the above technical solution:
[0013] According to the review requirements and contract types raised by users, different contract review standards and modification plans are given from the perspectives of Party A and Party B, different identities, and three different positions: strong, weak, and neutral. Taking ordinary goods sales contracts as an example, the identities include buyer and seller, and the terms used for the subject identities vary from contract to contract.
[0014] Using pre-trained language models such as RoBERTa, which are trained on a large amount of text data and have strong semantic understanding capabilities, they can accurately capture the complex semantic relationships and long-distance dependencies in the contract text. At the same time, combined with deep learning technology, it can ensure the accuracy and legality of contract terms and reduce human omissions and errors.
[0015] Use preset standard contract templates and rule-based engines to ensure that all contract terms comply with relevant laws and regulations. This reduces the legal risks that the contract may face during execution and ensures the legality and enforceability of the contract content.
[0016] Combining semantic analysis of contract text and rule-based engine, the system can fully review and modify the contract content. The system not only checks the existence of contract clauses, but also reviews their compliance and rationality to ensure the integrity and standardization of the contract.
[0017] Finally, through intelligent review and modification, we ensure the standardization, accuracy and legality of contract terms and improve the overall quality and professionalism of the contract. Through standardized contract templates and automated modification processes, the generated contracts are more in line with business practices and legal requirements. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0019] Figure 1 is a flow chart of the method of the present invention. DETAILED DESCRIPTION
[0020] Below, the invention is preferably described in conjunction with the accompanying drawings and specific implementation methods.
[0021] This embodiment solves the above problem through the following steps:
[0022] In one embodiment, reference Figure 1 The present invention provides a method for intelligent contract review and modification based on multiple large models, comprising the following steps:
[0023] Obtain the original contract text and information of both parties of the contract input by the user, perform semantic analysis on the original contract text using the first model, determine the contract type, the identity and status of the user, the identity includes: Party A, Party B, and the status includes: strong, weak, neutral; output the contract type, the identity and status information of the user, and confirm it by the user;
[0024] The original contract text is the complete contract text entered by the user. The original contract text of the user is the text to be reviewed. The original contract text may be written by non-professionals and may contain problems such as missing clauses, inapplicable laws, and incorrect positions. This is the basic data for the system to perform semantic analysis and matching.
[0025] The user provides detailed information about the parties involved in the contract, such as company name, individual name, role description, company size, market position, etc. This information helps the system accurately identify the parties to the contract and the applicable terms.
[0026] The first model is a pre-trained language model for contract text analysis and classification, which can be BERT, RoBERTa or GPT-4, etc.
[0027] The classification of contracts, such as sales contracts, service contracts, lease contracts, etc. The type of contract determines the basic structure and main terms of the contract.
[0028] The user's role and status in the contract, including Party A or Party B, and strong, weak or neutral position. This information affects the specific content and wording of the contract terms.
[0029] In this step, the user provides the complete contract text. The original contract text may be uploaded in the form of a text file, or it may be the content directly entered or copied and pasted by the user in the system.
[0030] And enter the information of both parties to the contract: such as the names of the parties involved in the contract, the specific role of each party in the contract, such as buyer, seller, service provider, service recipient, etc. The size information of the companies of the parties to the contract, such as large companies, small and medium-sized enterprises, individuals, etc. The position of the parties to the contract in the market, such as market leaders, competitors, new entrants, etc. This information can be entered by the user or automatically obtained by the system.
[0031] The automatic acquisition of the company size and market position information of the parties to the contract can be achieved by integrating external data sources and using advanced data mining techniques. Commercial enterprise information databases such as Crunchbase and Bloomberg can be used. These databases contain rich enterprise information, including company size, market position, financial status, etc. Web crawlers can also be developed to automatically collect enterprise information from public Internet resources. Preferably, information is obtained by crawling the official website of the enterprise, news reports, industry reports, etc.
[0032] Load the pre-trained language model for contract text analysis. The model performs semantic analysis on the original contract text and identifies the type of contract. The contract type determines the basic framework and clause structure of the contract. Preferably, a sales contract usually contains clauses such as product description, price, and payment method, while a service contract contains clauses such as service content, service standards, and service period. The contract type is output based on the contract content and preset classification rules.
[0033] The model analyzes the information of both parties to the contract and determines the specific identity of the user in the contract, including Party A or Party B. Combining the content of the contract and the information of both parties, the model evaluates the position of the user in the contract, whether it is strong, weak or neutral. A strong position may include the party with market dominance, a weak position may be the party that is new to the market or the party with fewer resources, and a neutral position means that the rights and obligations of both parties are relatively balanced.
[0034] Furthermore, in this step, the first model includes: an input layer, a coding layer, a fusion layer, a multi-task learning layer and an output layer.
[0035] Specifically:
[0036] 1. The input layer includes
[0037] Contract text input:
[0038] Enter the full text of the contract.
[0039] Information input of both parties of the contract:
[0040] Enter detailed information for both parties to the contract, including company name, role description, company size, market position, etc.
[0041] 2. Encoding layer
[0042] Contract text code:
[0043] The contract text is encoded using the pre-trained BERT model. The BERT model converts the contract text into a context-dependent embedding representation that captures important semantic information in the contract.
[0044] The BERT model, through its multi-layer Transformer architecture, is able to capture long-distance dependencies and complex semantic relationships in text.
[0045] The generated contextual embedding representation can accurately reflect the semantic structure and important information of the contract text and improve the accuracy of the analysis.
[0046] Information code of both parties to the contract:
[0047] The detailed information of both parties of the contract is encoded through a multi-layer perceptron MLP. The encoded feature vector will be used to combine the encoded representation of the contract text.
[0048] MLP can process numerical information and generate high-dimensional feature vectors. By encoding the information of both parties to the contract, it can be combined with text embedding representation to provide a more comprehensive basis for contract analysis.
[0049] 3. Fusion layer
[0050] The contract text code and the information code of the two parties to the contract are spliced or integrated in other ways to form a comprehensive representation, which includes the semantic information of the contract text and the characteristic information of the two parties to the contract.
[0051] The fusion process can use methods such as vector splicing and weighted averaging to combine the text and the information of both parties.
[0052] The fused comprehensive representation can simultaneously consider the semantics of the contract text and the characteristics of both parties, providing rich input for subsequent tasks.
[0053] 4. Multi-task learning layer
[0054] 4.1 Shared Representation:
[0055] The fused comprehensive representation is input to the multi-task learning layer. The shared representation layer extracts the common features of the contract text and the information of both parties through a deep neural network. Preferably, unprofessional contracts (in reality, ordinary users often search for contracts on the Internet and modify them by themselves) may misjudge the status of the strong and weak parties, or even the status of Party A and Party B. By combining the contract content and the basic information of both parties, the features are shared to improve the accuracy of recognition.
[0056] The shared representation layer extracts the deep features of the contract text and the information of both parties through a series of neural network layers. The shared representation layer can learn the interactive features of text and information, improving the overall performance of multi-task learning.
[0057] Furthermore, the sharing layer can be implemented as follows:
[0058] First, the results of encoding the contract text and the information of the two parties to the contract are used as input to form a comprehensive representation. Preferably, the BERT embedding vector of the contract text and the feature vector of the information of the two parties to the contract are concatenated together.
[0059] Use multi-layer perceptron (MLP) as the deep neural network layer to process the fused comprehensive representation. Debug and optimize hyperparameters such as the number of neurons in each layer, activation function (such as ReLU), regularization method (such as Dropout), etc.
[0060] During the training process, the loss functions of the two tasks of identity recognition and status evaluation (such as cross entropy loss) are combined and optimized through weighted sum. The Adam optimizer is used to update the network parameters and debug the hyperparameters such as learning rate.
[0061] For example:
[0062] Input: A comprehensive representation of the BERT embedding vector of the contract text and the feature vectors of the information of both parties to the contract.
[0063] Neural network layers: 3-layer MLP, 512 neurons in each layer, using ReLU activation function and Dropout (p=0.5) for regularization.
[0064] Training: We used a weighted cross entropy loss function (weights were 0.6 and 0.4 for identity recognition and status assessment tasks, respectively) and optimized with the Adam optimizer (learning rate 0.001).
[0065] 4.2 Contract Type Sub-Network:
[0066] Use shared representation to classify contract types and identify contract types. Output classification results such as sales contracts, service contracts, lease contracts, etc. The contract type subnetwork determines the contract type based on the shared representation through the classification layer, providing a basis for subsequent review and modification.
[0067] In the contract type sub-network, the feature vector output by the fusion layer and the shared representation layer is used as input. The network contains a layer of MLP to map the input feature vector to the output space of the contract type classification. The last layer uses the Softmax activation function to output the probability distribution of the contract type (such as sales contract, service contract, lease contract, etc.). The labeled contract type labels (such as sales contract, service contract, lease contract, etc.) are used as training data. The loss function uses cross entropy loss and updates the network parameters through back propagation.
[0068] For example:
[0069] Input: Feature vector output by the fusion layer and the shared representation layer.
[0070] Structure: 2-layer MLP, 256 neurons in each layer, using ReLU activation function and Dropout (p=0.5) for regularization, and the last layer uses Softmax activation function.
[0071] Output: Classification results of contract types.
[0072] Training: Use the cross entropy loss function and optimize with the Adam optimizer (learning rate 0.001).
[0073] 4.3 Identity Identification Subnetwork:
[0074] The output of the fusion layer, shared representation, and contract type subnetwork is used to classify roles and identify Party A and Party B in the contract. The classification result of Party A or Party B is output. The identity recognition subnetwork determines the roles in the contract based on the shared representation through the classification layer. Accurately identifying the roles in the contract is helpful for subsequent contract review and modification.
[0075] In the identity recognition subnetwork, the feature vector output by the shared representation layer is used as input. The network contains a layer of MLP to map the input feature vector to the output space of identity classification. The last layer uses the Softmax activation function to output the probability distribution of Party A or Party B. The labeled identity labels (Party A, Party B) are used as training data. The loss function uses cross entropy loss and updates the network parameters through back propagation.
[0076] For example:
[0077] Input: fusion layer, feature vector output by shared representation layer, output of contract type sub-network.
[0078] Structure: 2-layer MLP, 256 neurons in each layer, using ReLU activation function and Dropout (p=0.5) for regularization, and the last layer uses Softmax activation function.
[0079] Output: Classification result of Party A or Party B.
[0080] Training: Use the cross entropy loss function and optimize with the Adam optimizer (learning rate 0.001).
[0081] 4.3 Status Evaluation Subnetwork:
[0082] Use the outputs of the fusion layer, shared representation, contract type subnetwork, and identity recognition subnetwork to classify the status and evaluate the strong, weak, or neutral status in the contract. Output the strong, weak, or neutral classification results.
[0083] The status assessment subnetwork determines the status of the two parties to the contract based on the shared representation through the classification layer. Accurately assessing the status of the two parties to the contract helps to formulate more reasonable contract terms.
[0084] In the status evaluation subnetwork, the feature vector output by the shared representation layer is used as input. The network contains a layer of MLP to map the input feature vector to the output space of the status classification. The last layer uses the Softmax activation function to output the probability distribution of strong, weak or neutral. The labeled status labels (strong, weak, neutral) are used as training data. The loss function uses cross entropy loss and updates the network parameters through back propagation.
[0085] For example:
[0086] Input: fusion layer, feature vector output by shared representation layer, output of contract type sub-network, output of identity recognition sub-network.
[0087] Structure: 2-layer MLP, 256 neurons in each layer, using ReLU activation function and Dropout (p=0.5) for regularization, and the last layer uses Softmax activation function.
[0088] Output: strong, weak, or neutral classification result.
[0089] Training: Use the cross entropy loss function and optimize with the Adam optimizer (learning rate 0.001).
[0090] Preferably, the loss function of the first model can be:
[0091]
[0092] Among them, L all is the loss of the first model, β11 , β 12 and β 13 are all preset weights, and β 11 , β 12 and β 13 are greater than 0, β 11 +β 12 +β 13 =1, N is the total number of samples, J is the total number of identity categories, P (i,j) is a binary indicator (0 or 1). If the true identity category of the i-th sample is the j-th identity category, then P (i,j) =1, otherwise P (i,j) =0,P * (i,j) is the probability that the first model predicts that the identity category of the i-th sample belongs to the j-th identity category, K is the total number of contract types, P (i,k) is a binary indicator (0 or 1). If the true contract type of the i-th sample is the k-th contract type, then P (i,k) =1, otherwise P (i,k) =0,P * (i,k) is the probability that the contract type of the i-th sample belongs to the k-th contract type predicted by the first model, F is the total number of status types, P (i,f) is a binary indicator (0 or 1). If the status type of the i-th sample is the f-th status type, then P (i,f) =1, otherwise P (i,f) =0,P * (i,f) The first model predicts the probability that the status type of the i-th sample belongs to the f-th status type.
[0093] 5. Output Layer
[0094] Contract Type Output:
[0095] The contract type subnetwork outputs the classification results of the specific contract types. This result is used to determine the contract type and to determine different contract templates.
[0096] Identification output:
[0097] The identity recognition subnetwork outputs the classification result of Party A or Party B in the contract. This result is used to determine the specific role in the contract.
[0098] Status Assessment Output:
[0099] The status evaluation subnetwork outputs a classification result of strong, weak or neutral in the contract. This result is used to evaluate the relative status of the two parties in the contract.
[0100] In the above steps: Pre-trained language models (BERT) are trained on a large amount of text data and have strong semantic understanding capabilities. They can capture complex semantic relationships and long-distance dependencies in contract texts. These models can process contextual information, understand subtle differences in contract terms, and improve the accuracy of text analysis.
[0101] Through the multi-task learning framework, different tasks (contract type recognition, identity recognition, status assessment) share the same basic representation layer, improving the model's comprehensive understanding of the contract text. Multi-task learning allows different tasks to promote each other.
[0102] The model first identifies the contract type (e.g., "service contract") through the contract text. Based on the information about the contract type, the model identifies the specific roles in the contract (e.g., "service provider" and "service recipient"). Combining the contract type and role information, the model further evaluates the status of both parties (e.g., "service provider" is the dominant party, "service recipient" is the weak party). Preferably, identifying the type of contract helps to more accurately determine the roles and status of both parties in the contract, and vice versa.
[0103] Combining pre-trained language models and multi-task learning, the model can understand and process contract text and related information more comprehensively and accurately, thereby improving the accuracy of contract type, user identity and status identification.
[0104] Determining a first contract template from a preset template library according to the contract type, the identity and status information of the user;
[0105] The preset template library is a variety of contract templates pre-stored in the system. The purpose of the design is to provide appropriate standardized texts in different contract scenarios. The template library contains a variety of legally verified contract templates, which are carefully designed and classified based on different contract types and actual application scenarios.
[0106] Each contract template is optimized and verified according to actual usage and legal requirements to ensure the legality and completeness of its terms. These templates can cover various common contract types, such as sales contracts, service contracts, lease contracts, etc. Each type of contract template is further divided into different specific application scenarios.
[0107] The template library not only includes standard contract templates, but can also be customized according to specific needs. Preferably, for special requirements in certain industries or business scenarios, adjustments and modifications can be made based on the standard templates to meet specific needs.
[0108] When the system is in use, it will automatically match and select the most appropriate first contract template from the template library based on the contract type, identity information and status information in the contract entered by the user. The contract type determines the overall framework and clause structure of the contract. The preferred sales contract may include product description, price, delivery terms, etc., while the service contract includes terms such as service content, service standards and service period.
[0109] User identity information helps the system determine the specific applicable party to the contract, such as Party A or Party B, and their specific roles and responsibilities in the contract. Status information is used to assess the relative power and resources of the parties to the contract.
[0110] Specifically, for any two contract templates, the template similarity of the two contract templates can be calculated based on the contract type, identity and status information of the two contract templates. Based on the template similarity of any two contract templates, multiple contract templates are clustered using the K-means clustering algorithm to determine multiple contract template clustering clusters.
[0111] Preferably, the template similarity of two contract templates can be calculated based on the following formula:
[0112] S (i,j) =β 21 ×V ((i,j),1) +β 22 ×V ((i,j),2) +β 23 ×V ((i,j),3)
[0113] Among them, S (i,j) is the template similarity between the i-th contract template and the j-th contract template, β 21 , β 22 and β 23 are all preset weights, and β 21 , β 22 and β 23 are greater than 0, β 21 +β 22 +β 23 =1, V ((i,j),1) is the contract type matching value between the i-th contract template and the j-th contract template. When the contract types of the i-th contract template and the j-th contract template are the same, V ((i,j),1) =1, otherwise, V ((i,j),1) =0, V ((i,j),2) is the identity matching value of the i-th contract template and the j-th contract template. When the identities of the i-th contract template and the j-th contract template are consistent, V ((i,j),2) =1, otherwise, V ((i,j),2) =0, V ((i,j),3)is the status information matching value of the i-th contract template and the j-th contract template. When the status information of the i-th contract template and the j-th contract template are consistent, V ((i,j),3) =1, otherwise, V ((i,j),3) =0.
[0114] When in use, the cluster matching value of each contract template cluster is calculated based on the contract type, identity information and its position information in the contract input by the user and the contract type, identity information and its position information in the contract corresponding to the cluster center of each contract template cluster, and the contract template cluster whose cluster matching value is greater than the cluster matching value threshold is used as the target contract template cluster. The template matching degree of each contract template included in the target contract template cluster is calculated based on the contract type, identity information and its position information in the contract input by the user and the contract type, identity and position information of each contract template included in the target contract template cluster, and the contract template whose template matching degree is greater than the template matching degree threshold is used as the first contract template. The calculation method of the cluster matching value and template matching degree is similar to the calculation method of the template similarity, which will not be repeated here.
[0115] In this way, the system can quickly and accurately select and generate contract templates that meet user needs and legal requirements, thereby improving the efficiency of contract review and modification while ensuring the legality and enforceability of the contract. This method not only simplifies the process of contract generation, but also enhances the professionalism and reliability of the contract, ensuring that all contracts comply with relevant laws and regulations and can be flexibly adjusted and customized according to specific circumstances.
[0116] The original contract and the first contract template are input into the second model, the original contract is reviewed and modified, and the modified contract is output.
[0117] The architecture of the second model is
[0118] 1. Input layer
[0119] Contract source text input: The complete contract text provided by the user is used as input. The contract source text may contain multiple clauses, details, and specific formats, which need to be accurately parsed and processed.
[0120] First contract template input: The most suitable standard contract template selected from the preset template library is used as input. The template contains standardized contract terms and structures, providing a reference framework for compliance.
[0121] 2. Encoding layer
[0122] Encode the original contract text using the RoBERTa model: Encode the original contract text using the RoBERTa model and convert it into a context-sensitive embedding representation. RoBERTa, through its powerful Transformer architecture, can capture the complex semantic relationships and long-distance dependencies in the contract text, thereby generating accurate semantic representations.
[0123] Encoding the contract template using the RoBERTa model: Similarly, the standard contract template is encoded using the RoBERTa model to convert the template text into a context-sensitive embedding representation. This ensures that the standard clauses in the template can be accurately understood and processed by the model.
[0124] 3. Fusion layer
[0125] Fusion of original contract encoding and template encoding: Fusion of the embedded representation of the original contract and the embedded representation of the template to form a comprehensive representation that contains detailed semantic information of the contract text and reference information of the standard template.
[0126] Fusion method: Fusion can be achieved through vector concatenation, weighted average, etc. This step ensures that the actual content of the original contract and the specification requirements of the standard template can be combined in the same representation, providing a basis for subsequent comparison and review.
[0127] 4. Comparison and review layer
[0128] First, a text similarity algorithm (based on RoBERTa encoding at the encoding layer, similarity calculation, such as cosine similarity) is used to compare each clause of the original contract and the template one by one. By comparing the similarity of each clause, missing clauses, duplicate clauses, redundant clauses, and inconsistent clauses in the contract are identified.
[0129] Specifically, for each clause, the codes of multiple keywords of the clause in the original contract can be extracted, and the word frequency of each keyword of the clause in the original contract can be determined; the codes of multiple keywords of the clause in the contract template can be extracted, and the word frequency of each keyword of the clause in the contract template can be determined, and the similarity between the original contract and the contract template in the clause can be calculated.
[0130] Preferably, the similarity of the terms can be calculated based on the following formula:
[0131]
[0132] Among them, S ((current,template),i) is the similarity between the original contract and the contract template in the i-th clause, β 31 and β 32 are all preset weights, and β 31 and β 32are greater than 0, β 31 +β 32 =1,N (current,template) is the total number of keywords that exist in both the original contract and the contract template, N (current,i) is the total number of keywords extracted from the original contract text, N (template,i) is the total number of keywords extracted from the contract template, max(N (current,i) ,N (template,i) ) is to take N (current,i) and N (template,i) The larger value of TF ((current,i),e) is the frequency of the e-th keyword in the original contract text, TF ((template,i),e) is the frequency of the e-th keyword in the contract template, E is the total number of keywords, E = max(N (current,i) ,N (template,i) ).
[0133] When the similarity between a clause in the original contract and each clause in the contract template is less than a first similarity threshold, the clause is determined to be a redundant clause.
[0134] When the similarity between a clause in the original contract and each clause in the contract template is greater than or equal to a first similarity threshold and less than a second similarity threshold, the clause is determined to be an inconsistent clause.
[0135] When the similarity between a certain clause in the contract and the template and each clause in the original contract is less than a first similarity threshold, the clause is determined to be a missing clause.
[0136] The similarity between any two clauses in the original contract is calculated. When the similarity between any two clauses in the original contract is greater than a third similarity threshold, the two clauses are determined to be duplicate clauses.
[0137] Then, the rule-based engine is used to check. Specifically, a series of contract review rules are pre-defined, such as mandatory clauses, prohibited clauses, clause formats, etc. These rules can be formulated based on laws, regulations and business practices. Combined with the semantic analysis results of RoBERTa, the rule engine is used to review the contract terms to ensure that they comply with legal requirements and business norms. Use a rule engine framework (such as Drools) to check the contract terms according to predefined rules and mark non-compliant clauses. Mark the non-compliant clauses and record the parts that need to be modified.
[0138] 5. Modify and generate layers
[0139] Use deep learning models (such as multi-layer perceptron, MLP) to automatically modify non-compliant clauses. The deep learning model generates compliant modification suggestions by learning the compliant clauses in the standard template and the problematic clauses in the actual contract.
[0140] Automatically add missing clauses to the original contract based on the standard clauses in the template to ensure the completeness of the contract.
[0141] Identify and delete duplicate clauses in the original contract to simplify the contract structure.
[0142] Modify the clauses in the original contract that are inconsistent with the template to make them comply with the provisions in the standard template to ensure the consistency and accuracy of the contract content.
[0143] All the modified clauses are reassembled to generate a complete modified contract text. The output modified contract should comply with legal requirements and business norms, and be confirmed by the user to ensure that it meets actual needs.
[0144] Through the above methods, automated contract review and modification reduces manual intervention time and improves contract processing efficiency. Use the RoBERTa model and deep learning technology to ensure the accuracy and legality of contract terms. Provide personalized contract review and modification solutions based on the user's specific needs and contract type. Ensure that all contract terms comply with relevant laws and regulations to reduce legal risks. Combine semantic analysis and rule engines to achieve comprehensive contract content review and modification.
[0145] Through the above technical solution, according to the review requirements and contract types proposed by users, different contract review standards and modification plans are given from the perspective of different subject positions of Party A and Party B, different identities, and three different positions of strong, weak, and neutral. Taking ordinary goods sales contracts as an example, the identities include buyer and seller, and the terms used for subject identities vary in different contracts.
[0146] Using pre-trained language models such as RoBERTa, which are trained on a large amount of text data and have strong semantic understanding capabilities, they can accurately capture the complex semantic relationships and long-distance dependencies in the contract text. At the same time, combined with deep learning technology, it can ensure the accuracy and legality of contract terms and reduce human omissions and errors.
[0147] Use preset standard contract templates and rule-based engines to ensure that all contract terms comply with relevant laws and regulations. This reduces the legal risks that the contract may face during execution and ensures the legality and enforceability of the contract content.
[0148] Combining semantic analysis of contract text and rule-based engine, the system can fully review and modify the contract content. The system not only checks the existence of contract clauses, but also reviews their compliance and rationality to ensure the integrity and standardization of the contract.
[0149] Finally, through intelligent review and modification, we ensure the standardization, accuracy and legality of contract terms and improve the overall quality and professionalism of the contract. Through standardized contract templates and automated modification processes, the generated contracts are more in line with business practices and legal requirements.
[0150] On the other hand, the present invention also provides a contract intelligent review and modification system based on multiple large models, including the following modules:
[0151] A classification module is used to obtain the original contract text and the information of the two parties of the contract input by the user, perform semantic analysis on the original contract text using the first model, determine the contract type, the identity and status of the user, the identity includes: Party A, Party B, the status includes: strong, weak, neutral; output the contract type, the identity and status information of the user, and confirm it by the user;
[0152] A query module, used to determine a first contract template from a preset template library according to the contract type, the identity and status information of the user;
[0153] The review and modification module is used to input the original contract text and the first contract template into the second model, review and modify the original contract text, and output the modified contract.
[0154] Furthermore, the specific implementation methods of the above-mentioned intelligent contract review and modification system based on multiple large models are the same as a method for intelligent contract review and modification based on multiple large models, and all further technical solutions in a method for intelligent contract review and modification based on multiple large models are fully introduced into a system for intelligent contract review and modification based on multiple large models.
[0155] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.
[0156] The present invention does not particularly specify the structure of some modules, which shall be subject to the contents recorded in the prior art. The prior art mentioned in the above background technology section and the specific embodiment section of the present invention can be used as part of the present invention to understand the meaning of some technical features or parameters. The scope of protection of the present invention shall be subject to the contents actually recorded in the claims.
Claims
1. A method for intelligent contract review and modification based on multiple large models, characterized in that The method comprises the following steps: Obtaining the original contract text and information of both parties of the contract input by the user, using the first model to perform semantic analysis on the original contract text, determining the contract type, the identity and status of the user, the identity including: Party A, Party B; outputting the contract type, the identity and status information of the user, and having the user confirm it; Determining a first contract template from a preset template library according to the contract type, the identity and status information of the user; Inputting the original contract text and the first contract template into the second model, reviewing and modifying the original contract text, and outputting the modified contract; The first model includes: an input layer, an encoding layer, a fusion layer, a multi-task learning layer and an output layer; The input layer inputs the original text of the contract and information of both parties of the contract; The encoding layer uses the pre-trained BERT model to encode the original contract text; and uses a multi-layer perceptron MLP to encode the information of both parties to the contract; The fusion layer concatenates and fuses the contract text code with the information code of the contracting parties to form a comprehensive representation, which includes the semantic information of the contract text and the characteristic information of the contracting parties; The multi-task learning layer includes a shared representation layer, a contract type sub-network, an identity recognition sub-network, and a status evaluation sub-network; the shared representation layer extracts common features of the contract text and the information of both parties through a deep neural network; The input of the contract type sub-network is the feature vector output by the fusion layer and the shared representation layer, and the output is the classification result of the contract type; The input of the identity recognition sub-network is the feature vector output by the fusion layer and the shared representation layer, and the output of the contract type sub-network, and the output is the classification result of Party A or Party B; The input of the status evaluation sub-network is the feature vector output by the fusion layer and the shared representation layer, the output of the contract type sub-network, and the output of the identity recognition sub-network, and the output is the status classification result; The output layer outputs the final contract type, identity type and status classification.
2. According to claim 1, a method for intelligent contract review and modification based on multiple large models is characterized in that The fusion layer first takes the results of contract text encoding and contract party information encoding as input to form a comprehensive representation, and then uses a multi-layer perceptron as a deep neural network layer to process the fused comprehensive representation.
3. According to claim 2, a method for intelligent contract review and modification based on multiple large models is characterized in that The contract type subnetwork, identity recognition subnetwork, and status evaluation subnetwork all contain a layer of MLP, which maps the input feature vector to the output space of the contract type classification. The last layer uses the Softmax activation function to output the probability distribution of the classification.
4. According to claim 1, a method for intelligent contract review and modification based on multiple large models is characterized in that The second model architecture is: The input layer takes the complete contract text provided by the user as input and the most matching standard contract template selected from the preset template library as input; The encoding layer uses the RoBERTa model to encode the original contract text and contract template; The fusion layer fuses the embedded representation of the contract original text and the embedded representation of the template to form a comprehensive representation; The comparison and review layer uses a text similarity algorithm to compare each clause of the original contract and the template one by one, identifying missing clauses, duplicate clauses, and inconsistent clauses in the contract. It then uses a rule-based engine to check and mark non-compliant clauses and record the parts that need to be modified. The modification and generation layer uses a deep learning model to automatically modify non-compliant clauses, automatically add missing clauses to the original contract based on the standard clauses in the template, identify and delete duplicate clauses in the original contract, and modify clauses in the original contract that are inconsistent with the template.
5. A contract intelligent review and modification system based on multiple large models, characterized by The system includes the following modules: A classification module is used to obtain the contract text and the information of the two parties of the contract input by the user, perform semantic analysis on the contract text using the first model, determine the contract type, the identity and status of the user, and the identity includes: Party A, Party B; output the contract type, the identity and status information of the user, and the user confirms it; A query module, used to determine a first contract template from a preset template library according to the contract type, the identity and status information of the user; A review and modification module, used for inputting the original contract text and the first contract template into the second model, reviewing and modifying the original contract text, and outputting a modified contract; The first model includes: an input layer, an encoding layer, a fusion layer, a multi-task learning layer and an output layer; The input layer inputs the original text of the contract and information of both parties of the contract; The encoding layer uses the pre-trained BERT model to encode the original contract text; and uses a multi-layer perceptron MLP to encode the information of both parties to the contract; The fusion layer concatenates and fuses the contract text code with the information code of the contracting parties to form a comprehensive representation, which includes the semantic information of the contract text and the characteristic information of the contracting parties; The multi-task learning layer includes a shared representation layer, a contract type sub-network, an identity recognition sub-network, and a status evaluation sub-network; the shared representation layer extracts common features of the contract text and the information of both parties through a deep neural network; The input of the contract type sub-network is the feature vector output by the fusion layer and the shared representation layer, and the output is the classification result of the contract type; The input of the identity recognition sub-network is the feature vector output by the fusion layer and the shared representation layer, and the output of the contract type sub-network, and the output is the classification result of Party A or Party B; The input of the status evaluation sub-network is the feature vector output by the fusion layer and the shared representation layer, the output of the contract type sub-network, and the output of the identity recognition sub-network, and the output is the status classification result; The output layer outputs the final contract type, identity type and status classification.
6. According to claim 5, a contract intelligent review and modification system based on multiple large models is characterized in that The fusion layer first takes the results of contract text encoding and contract party information encoding as input to form a comprehensive representation, and then uses a multi-layer perceptron as a deep neural network layer to process the fused comprehensive representation.
7. According to claim 6, a contract intelligent review and modification system based on multiple large models is characterized in that The contract type subnetwork, identity recognition subnetwork, and status evaluation subnetwork all contain a layer of MLP, which maps the input feature vector to the output space of the contract type classification. The last layer uses the Softmax activation function to output the probability distribution of the classification.
8. According to claim 5, a contract intelligent review and modification system based on multiple large models is characterized in that The second model architecture is: The input layer takes the complete contract text provided by the user as input and the most matching standard contract template selected from the preset template library as input; The encoding layer uses the RoBERTa model to encode the original contract text and contract template; The fusion layer fuses the embedded representation of the contract original text and the embedded representation of the template to form a comprehensive representation; The comparison and review layer uses a text similarity algorithm to compare each clause of the original contract and the template one by one, identifying missing clauses, duplicate clauses, and inconsistent clauses in the contract. It then uses a rule-based engine to check and mark non-compliant clauses and record the parts that need to be modified. The modification and generation layer uses a deep learning model to automatically modify non-compliant clauses, automatically add missing clauses to the original contract based on the standard clauses in the template, identify and delete duplicate clauses in the original contract, and modify clauses in the original contract that are inconsistent with the template.
Citation Information
Patent Citations
Contract grassing and revising method and device, storage medium and equipment
CN111932412A
Contract text information processing method and device, computer equipment and storage medium
CN114003692A