Large-model-based contract risk analysis method and system for sales industry
Through the contract risk analysis method based on large-scale models, the contract terms are automatically analyzed, which solves the problems of time-consuming, labor-intensive and misjudgment of traditional manual reviews, and achieves efficient and accurate risk assessment.
Patent Information
- Application Number
- CN202510527669.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-25
- Publication Date
- 2025-08-01
AI Technical Summary
In the traditional sales industry, the analysis of contract risk clauses relies on manual review, which is time-consuming and labor-intensive and easy to misunderstand or misjudgment. Existing automatic analysis tools are difficult to capture multi-dimensional risks comprehensively and accurately.
The contract risk analysis method based on the big model is used to fine-tune the base model by manually marking the risk information, and the contract terms are automatically analyzed using the big model, including contract document preparation, clause extraction, manual marking, model fine-tune and risk analysis.
It realizes automated analysis, shortens the contract risk analysis cycle, comprehensively captures potential risks, reduces misjudgment and omissions, and provides a scientific basis for risk assessment for contract review.
Smart Images

Figure CN120410202A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of contract risk analysis and large model fine-tuning technology, and specifically provides a method and system for contract risk analysis based on large models in the sales industry. Background Art
[0002] In the traditional sales industry, the analysis of risk clauses in contracts mainly relies on manual review. This method is not only time-consuming and laborious, but also prone to omissions or misjudgments due to human factors. With the development of big data and artificial intelligence technologies, especially the maturity of large model technology, it has become possible to automatically analyze risk clauses in contracts by machines. However, existing automatic analysis tools are often limited by the model's capabilities and are difficult to comprehensively and accurately capture various risks in contracts. Summary of the Invention
[0003] The purpose of the present invention is to provide a method and system for contract risk analysis based on large models in the sales industry, which can identify multi-dimensional risk points such as legal, financial, and operational risks existing for the second party in contract clauses, and provide efficient and accurate basis for contract review and decision-making support, so as to solve the problems raised in the above background art.
[0004] To achieve the above purpose, the present invention provides the following technical solution: A method for contract risk analysis based on large models in the sales industry, the method comprising the following steps:
[0005] Step 1, prepare an electronic sales contract file;
[0006] Step 2, extract the clauses in the contract;
[0007] Step 3, manually mark the risk information existing in the clauses;
[0008] Step 4, use the marked clause information to fine-tune the base model and output the fine-tuned model;
[0009] Step 5, start the fine-tuned model and perform risk analysis on the clauses in the subsequent sales contracts to be signed.
[0010] Preferably, step 1 specifically includes:
[0011] Step 1.1, collect signed sales contract files;
[0012] Step 1.2, collect templates of different types of sales contract files through channels such as online professional legal websites, and fill in the blank content in the collected contract templates. By filling in different contents, one contract template is expanded into multiple contract files, for example, modifying different payment ratios and payment terms;
[0013] Step 1.3, place the contract documents prepared in Step 1.1 and Step 1.2 in the same directory, and name this directory "contracts".
[0014] Preferably, Step 2 specifically includes:
[0015] Step 2.1, create a set named "clause_set" for saving all contract clause lists;
[0016] Step 2.2, traverse all contract documents in the "contracts" directory in Step 1.3. For each contract document, judge its format: if it is in doc format, execute Step 2.3; if it is in docx format, execute Step 2.4; if it is in pdf format, execute Step 2.5; if it is in other formats, skip this contract document;
[0017] Step 2.3, if the system is Windows, directly use the pywin32 library to read the text in the doc file by paragraph and return a list of the contract segmented by paragraphs; if the system is not Windows, provide an interface on a server with a Windows system to convert the doc file into a list of text paragraphs. After extracting the paragraphs in the doc file into a list, add all the paragraphs in this list to "clause_set";
[0018] Step 2.4, use the python-docx library to read the text content in the docx by paragraph and add all the paragraphs in the read paragraph list to "clause_set";
[0019] Step 2.5, use the pdfplumber library to extract the text in the pdf by page and save it to a list named "pages". Use an empty string to concatenate the "pages" list into a complete text named "full_text", then split "full_text" into a paragraph list by blank lines, and add all the paragraphs in this paragraph list to "clause_set".
[0020] Preferably, Step 3 specifically includes:
[0021] Step 3.1, output the "clause_set" processed in Step 2 to the first column, column A, of an excel table, where each cell in this column corresponds to a paragraph in the contract, that is, it is considered a clause;
[0022] Step 3.2: For each clause, when manually annotating, add the following columns after it: Whether there is a risk: Column B, Risk category: Column C, Risk description: Column D, Modification suggestion: Column E. The risk category is summarized by the actual sales personnel, and can include, for example: Payment term risk, Payment ratio risk, Contract termination risk, Back-to-back payment risk; If there is no risk for this clause, the column "Whether there is a risk" should be filled with "No", and the columns "Risk category", "Risk description", and "Modification suggestion" do not need to be filled;
[0023] Step 3.3: Traverse the excel table output in Step 3.2. For each row of data, splice the prompt to form a sample, and its format is: {"prompt": "#Task: You are an experienced contract review expert. Please conduct a risk analysis of the contract terms from the perspective of Party B# Background knowledge: Risk categories include:
types
clause
exists
type
description
advice
types
clause
exists
type
description
advice
[0024] Step 3.4: Put all the samples with the spliced prompts in Step 3.3 into a list, and then output to a json file.
[0025] Preferably, Step 4 specifically includes:
[0026] Step 4.1: Randomly divide the samples in the json file output in Step 3 into a training set json and a test set json at a ratio of 8:2. The training set json is used for subsequent model fine-tuning training, and the test set json is used to verify the effect of the model after fine-tuning output;
[0027] In step 4.2, execute the nvidia-smi command in the fine-tuning environment to confirm the available graphics card resources and select an appropriate base model. Taking an A800 graphics card as an example, Baichuan2-13B-Chat is selected as the base model for fine-tuning training;
[0028] In step 4.3, use the open-source Deepspeed-Chat training framework, set the step parameter to 1, set the base model path to the path where the model is located in step 4.2, set the distributed training model parameters to the actual available graphics card resources described in step 4.2, and finally set the training set path to the training set JSON path described in step 4.1. Leave the remaining parameters as default.
[0029] Step 4.4: Execute the training script in the training framework directory described in step 4.3 and wait for the training task to complete.
[0030] In step 4.5, evaluate the convergence of the model training process based on the trainingloss value output after the training in step 4.4. If the trainingloss value has stabilized, there is no need to retrain. If the trainingloss value is still decreasing, increase the epoch value. For example, if the epoch parameter defaults to 3.0, change it to 5.0, and then restart training to observe the convergence effect.
[0031] Step 5 specifically includes:
[0032] Step 5.1: Use vllm to start the fine-tuned model output in step 4. The graphics card parameters specified in the startup parameters are consistent with the graphics card resources available in step 4.2, and the specified model path parameter is the model path output in step 4.
[0033] In step 5.2, test the model launched in step 5.1 using the samples in the test set json from step 4.1. If the model's accuracy in determining whether a risk exists is greater than 90%, and the risk category, risk description, and modification suggestions output by the model are not obviously unreasonable, proceed to step 5.3. Otherwise, based on the existing contract documents, continue to expand the contract documents according to step 1, and then re-execute steps 2 to 5 until the model results meet business requirements.
[0034] In step 5.3, use the model started in step 5.1, assemble the prompts as described in step 3.3, and perform a risk analysis on the terms of the subsequent contract.
[0035] An analysis system for a contract risk analysis method based on a large model in the sales industry, the system comprising:
[0036] A contract document preparation module for preparing electronic sales contract documents;
[0037] A clause extraction module for extracting clauses from contract documents;
[0038] An artificial annotation module for annotating risk information existing in clauses;
[0039] A model fine-tuning module that uses the annotated clause information to fine-tune the base model and outputs the fine-tuned model;
[0040] A risk analysis module that starts the fine-tuned model to perform risk analysis on the clauses in the subsequent sales contracts to be signed.
[0041] Preferably, the contract document preparation module includes:
[0042] A contract collection unit for collecting signed sales contract documents;
[0043] A template expansion unit that collects templates of different types of sales contract documents through channels such as online professional legal websites, and fills in the blank content in the collected contract templates to expand them into multiple contract documents;
[0044] A file storage unit that stores all the collected contract documents in the same directory and names them contracts.
[0045] Preferably, the clause extraction module includes:
[0046] A set creation unit for creating a set named clause_set to save the list of all contract clauses;
[0047] A file traversal unit that traverses all the contract documents in the contracts directory;
[0048] A text extraction unit that extracts text paragraphs using corresponding libraries or interfaces according to the file format, and adds the extracted paragraphs to clause_set.
[0049] Preferably, the clause extraction module includes:
[0050] A set creation unit for creating a set named clause_set to save the list of all contract clauses;
[0051] A file traversal unit that traverses all the contract documents in the contracts directory;
[0052] A text extraction unit that extracts text paragraphs using corresponding libraries or interfaces according to the file format, and adds the extracted paragraphs to clause_set.
[0053] Preferably, the model fine-tuning module includes:
[0054] A sample division unit that divides the labeled clause information into a training set and a test set according to a ratio;
[0055] A graphics card resource confirmation unit that executes commands in the fine-tuning environment to confirm available graphics card resources;
[0056] A model selection unit that selects a suitable base model;
[0057] A training execution unit that uses an open-source training framework to perform model fine-tuning training;
[0058] A model evaluation unit that evaluates the convergence of the model training process according to the output value after training is completed;
[0059] The risk analysis module includes:
[0060] A model startup unit that uses vllm to start the fine-tuned model;
[0061] A model test unit that tests the started model with the samples in the test set and determines whether retraining or contract file expansion is required according to the test results;
[0062] A risk analysis execution unit that uses the started model to perform risk analysis on the contract clauses to be signed subsequently.
[0063] Compared with the prior art, the beneficial effects of the present invention are:
[0064] The contract risk analysis method and system based on a large model in the sales industry proposed by the present invention replaces manual review with automated analysis, greatly shortening the contract risk analysis cycle; utilizes large model technology to comprehensively capture potential risks in contracts, reducing omissions and misjudgments; reduces the dependence on professional legal and financial personnel, lowering enterprise operation costs; provides a scientific and accurate risk assessment basis for decision-making processes such as contract review, negotiation, and signing. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] Figure 1 It is a flowchart of the method of the present invention. DETAILED DESCRIPTION OF THE INVENTION
[0066] In order to clearly and completely describe the objectives, technical solutions of the present invention, and make the advantages more clearly understood, the following further details the embodiments of the present invention with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are part of the embodiments of the present invention, rather than all of the embodiments, and are only used to explain the embodiments of the present invention, not to limit the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the scope of protection of the present invention.
[0067] Example 1, please refer to Figure 1 , the present invention provides a technical solution: a contract risk analysis method for the sales industry based on a large model, the method comprising the following steps:
[0068] Taking the implementation in Python language as an example, it specifically includes the following steps:
[0069] Step 1, prepare an electronic version of the sales contract file.
[0070] Step 2, extract the terms in the contract.
[0071] Step 3, manually label the risk information existing in the terms.
[0072] Step 4, fine-tune the base model using the labeled term information and output the fine-tuned model.
[0073] Step 5, start the fine-tuned model and perform risk analysis on the terms in the subsequent sales contracts to be signed.
[0074] Furthermore, step 1 specifically includes:
[0075] Step 1.1, collect the signed sales contract files.
[0076] Step 1.2, collect the templates of different types of sales contract files through channels such as online professional legal websites. And fill in the blank content in the collected contract templates, and one contract template can be expanded into multiple contract files by filling in different contents, such as modifying different payment ratios, payment terms, etc.
[0077] Step 1.3, place the contract files prepared in step 1.1 and step 1.2 in the same directory and name the directory contracts.
[0078] Furthermore, step 2 specifically includes:
[0079] Step 2.1, create a set named clause_set for saving all contract term lists.
[0080] Step 2.2, traverse all the contract files in the contracts directory described in step 1.3. For each contract file, judge its format: if it is in doc format, execute step 2.3; if it is in docx format, execute step 2.4; if it is in pdf format, execute step 2.5; if it is in other formats, skip this contract file.
[0081] Step 2.3, if the system is Windows, the pywin32 library can be directly used to read the text in the doc file by paragraph and return a list of the contract segmented by paragraph. If the system is not Windows, an interface for converting the doc file into a list of text paragraphs needs to be provided on a server with a Windows system. After extracting the paragraphs in the doc file as a list, all the paragraphs in this list are added to clause_set.
[0082] Step 2.4, use the python-docx library to read the text content in the docx by paragraph, and add all the paragraphs in the read paragraph list to clause_set.
[0083] Step 2.5, use the pdfplumber library to extract the text in the pdf by page and save it to a list named pages. Concatenate the pages list with an empty string into a complete text named full_text, then split full_text into a paragraph list by blank lines, and add all the paragraphs in this paragraph list to clause_set.
[0084] Furthermore, Step 3 specifically includes:
[0085] Step 3.1, output the processed clause_set in Step 2 to the first column (Column A) of an excel table, where each cell in this column corresponds to a paragraph in the contract, that is, it is considered a clause.
[0086] Step 3.2, for each clause, when manually annotating, add the following columns after it: Whether there is a risk (Column B), Risk category (Column C), Risk description (Column D), Modification suggestions (Column E). Among them, the risk category is summarized by actual sales personnel, for example, it can include: Payment term risk, Payment ratio risk, Contract termination risk, Back-to-back payment risk, etc. It should be supplemented that if there is no risk in this clause, the column "Whether there is a risk" should be filled with "No", and the columns "Risk category", "Risk description", and "Modification suggestions" do not need to be filled.
[0087] Step 3.3, traverse the excel table output in Step 3.2. For each row of data, splice the prompt to form a sample, and its format is: {"prompt":"#Task: You are an experienced contract review expert. Please conduct a risk analysis on the contract terms from the perspective of Party B#Background knowledge: Risk categories include:
types
clause
exists
type
description
advice
types
clause
exists
type
description
advice
[0088] Step 3.4, put all the samples with the spliced prompts in Step 3.3 into a list, and then output it to a json file.
[0089] Furthermore, Step 4 specifically includes:
[0090] Step 4.1, randomly divide the samples in the json file output in Step 3 into a training set json and a test set json at a ratio of 8:2. The training set json is used for subsequent model fine-tuning training, and the test set json is used to verify the model effect after fine-tuning output.
[0091] Step 4.2, execute the nvidia-smi command in the fine-tuning environment to confirm the available graphics card resources, and select a suitable base model. Taking an A800 graphics card as an example, Baichuan2-13B-Chat can be selected as the base model for fine-tuning training.
[0092] In step 4.3, use the open-source Deepspeed-Chat training framework, set the step parameter to 1, set the base model path to the path where the model is located in step 4.2, set the parameters of the distributed training model to the actual available graphics card resources described in step 4.2, and finally set the training set path to the training set json path described in step 4.1. Keep the remaining parameters as default.
[0093] Step 4.4: Execute the training script in the training framework directory described in step 4.3 and wait for the training task to complete.
[0094] In step 4.5, evaluate the convergence of the model training process based on the trainingloss value output after training in step 4.4. If the trainingloss value has stabilized, there is no need to retrain. If the trainingloss value continues to decrease, increase the epoch value. For example, if the epoch parameter defaults to 3.0, you can change it to 5.0 and restart training to observe the convergence effect.
[0095] Furthermore, step 5 specifically includes:
[0096] In step 5.1, use vllm to start the fine-tuned model output in step 4. The graphics card parameters specified in the startup parameters are consistent with the available graphics card resources described in step 4.2. The specified model path parameter is the model path output in step 4.
[0097] In step 5.2, test the model launched in step 5.1 using the samples in the test set JSON described in step 4.1. If the model's accuracy in determining whether a risk exists is greater than 90%, and the risk category, risk description, and modification suggestions output by the model are not obviously unreasonable, proceed to step 5.3. Otherwise, based on the existing contract documents, continue to expand the contract documents according to the method in step 1, and then repeat steps 2 through 5 until the model meets the business requirements.
[0098] In step 5.3, use the model started in step 5.1, assemble the prompts as described in step 3.3, and perform a risk analysis on the contract terms that need to be signed later.
[0099] Example 2, based on Example 1, proposes an analysis system for a contract risk analysis method based on a large model in the sales industry, the system comprising:
[0100] The contract document preparation module is used to prepare electronic sales contract documents; it includes:
[0101] Contract collection unit, used to collect signed sales contract documents;
[0102] Template Expansion Unit, which collects templates of different types of sales contract documents through channels such as online professional legal websites, and fills in the blank content in the collected contract templates to expand them into multiple contract documents;
[0103] File Storage Unit, which stores all the collected contract documents in the same directory and names them contracts.
[0104] Clause Extraction Module, which is used to extract clauses from contract documents; including:
[0105] Set Creation Unit, which is used to create a set for saving all contract clause lists, named clause_set;
[0106] File Traversal Unit, which traverses all contract documents in the contracts directory;
[0107] Text Extraction Unit, which extracts text paragraphs using corresponding libraries or interfaces according to the file format, and adds the extracted paragraphs to clause_set.
[0108] Manual Annotation Module, which is used to annotate risk information existing in clauses; including:
[0109] Clause Output Unit, which outputs the extracted clauses to the first column of an excel table;
[0110] Annotation Addition Unit, which adds new columns behind each clause to annotate whether there are risks, risk categories, risk descriptions, and modification suggestions.
[0111] Model Fine-tuning Module, which uses the annotated clause information to fine-tune the base model and outputs the fine-tuned model; including:
[0112] Sample Division Unit, which divides the annotated clause information into a training set and a test set according to a certain proportion;
[0113] Graphics Card Resource Confirmation Unit, which executes commands in the fine-tuning environment to confirm available graphics card resources;
[0114] Model Selection Unit, which selects a suitable base model;
[0115] Training Execution Unit, which uses an open-source training framework to perform model fine-tuning training;
[0116] Model Evaluation Unit, which evaluates the convergence situation during the model training process according to the output value after training is completed.
[0117] Risk Analysis Module, which starts the fine-tuned model to perform risk analysis on the clauses in the subsequent sales contracts to be signed; including:
[0118] Model startup unit, which uses vllm to start the fine-tuned model;
[0119] Model testing unit, which uses the samples in the test set to test the started model and determines whether retraining or contract file expansion is needed according to the test results;
[0120] Risk analysis execution unit, which uses the started model to perform risk analysis on the contract terms to be signed subsequently.
[0121] Although the embodiments of the present invention have been shown and described, those of ordinary skill in the art can understand that various changes, modifications, substitutions, and variations can be made to these embodiments without departing from the principles and spirit of the present invention. The scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A contract risk analysis method for the sales industry based on large models, characterized in that: The method includes the following steps: Step 1, prepare an electronic version of the sales contract document; Step 2, extract the terms in the contract; Step 3, manually mark the risk information existing in the terms; Step 4, use the marked term information to fine-tune the base model and output the fine-tuned model; Step 5, start the fine-tuned model and conduct risk analysis on the terms in the subsequent sales contracts to be signed.
2. The contract risk analysis method based on a large model in the sales industry according to claim 1, wherein: Step 1 specifically includes: Step 1.1, collect the signed sales contract documents; Step 1.2, collect the templates of different types of sales contract documents through channels such as online professional legal websites, and fill in the blank content in the collected contract templates. Expand one contract template into multiple contract documents by filling in different contents, such as modifying different payment ratios and payment terms; Step 1.3, place the contract documents prepared in Step 1.1 and Step 1.2 in the same directory and name this directory contracts.
3. The contract risk analysis method based on a large model in the sales industry according to claim 2, characterized in that: Step 2 specifically includes: Step 2.1, create a set named clause_set for saving all contract clause lists; Step 2.2, traverse all contract documents in the contracts directory in Step 1.
3. For each contract document, judge its format: if it is in doc format, execute Step 2.3; if it is in docx format, execute Step 2.4; if it is in pdf format, execute Step 2.5; if it is in other formats, skip this contract document; Step 2.3, if the system is Windows, directly use the pywin32 library to read the text in the doc file by paragraph and return a list of the contract segmented by paragraphs; if the system is not Windows, provide an interface on the server with Windows system to convert the doc file into a list of text paragraphs. After extracting the paragraphs in the doc file as a list, add all the paragraphs in this list to clause_set; Step 2.4, use the python-docx library to read the text content in the docx by paragraph and add all the paragraphs in the read paragraph list to clause_set; Step 2.5, use the pdfplumber library to extract the text in the pdf by page and save it to a list named pages. Use an empty string to concatenate the pages list into a complete text named full_text, and then split full_text into a paragraph list by blank lines, and add all the paragraphs in this paragraph list to clause_set.
4. The contract risk analysis method for the sales industry based on the large model according to claim 3, characterized in that: Step 3 specifically includes: Step 3.1, output the clause_set processed in Step 2 to the first column of the excel table: column A, where each cell in this column corresponds to a paragraph in the contract, that is, it is considered as a term; Step 3.2, for each clause, when manually annotating, add the following columns after it: Whether there is a risk: Column B, Risk category: Column C, Risk description: Column D, Modification suggestion: Column E. The risk category is summarized by actual sales personnel and can include, for example: Payment term risk, Payment ratio risk, Contract termination risk, Back-to-back payment risk; if there is no risk in this clause, the column "Whether there is a risk" should be filled with "No", and the columns "Risk category", "Risk description", and "Modification suggestion" do not need to be filled; Step 3.3, traverse the excel table output in Step 3.
2. For each row of data, concatenate the prompt to form a sample, and its format is: {"prompt":"#Task You are an experienced contract review expert and need to conduct risk analysis on contract clauses from the perspective of Party B#Background knowledge Risk categories include: 【types】#Requirements must be output in the following format: {\"Whether there is a risk\":\"\",\"Risk category\":\"\",\"Risk description\":\"\",\"Modification suggestion\":\"\"} If there is no risk in the clause, the risk category, risk description, and modification suggestion do not need to be filled#Contract clause content 【clause】","chosen":"{\"Whether there is a risk\":\"【exists】\",\"Risk category\":\"【type】\",\"Risk description\":\"【description】\",\"Modification suggestion\":\"【advice】\"}","rejected":""}, where 【types】 is the list of risk categories summarized in Step 3.2; 【clause】 is the clause in this row of data; 【exists】 is the value corresponding to "Whether there is a risk" in this row of data; 【type】 is the value corresponding to "Risk category" in this row of data; 【description】 is the value corresponding to "Risk description" in this row of data; 【advice】 is the value corresponding to "Modification suggestion" in this row of data; Step 3.4, put all the samples with concatenated prompts in Step 3.3 into a list, and then output them to a json file.
5. A method for contract risk analysis in the sales industry based on a large model according to claim 4, characterized in that: Step 4 specifically includes: Step 4.1, randomly divide the samples in the json file output in Step 3 into a training set json and a test set json at a ratio of 8:
2. The training set json is used for subsequent model fine-tuning training, and the test set json is used to verify the effect of the model after fine-tuning output; Step 4.2, execute the nvidia-smi command in the fine-tuning environment to confirm the available GPU resources and select a suitable base model. Taking an A800 GPU as an example, select Baichuan2-13B-Chat as the base model for fine-tuning training; In step 4.3, use the open-source Deepspeed-Chat training framework, set the step parameter to 1, set the base model path to the path where the model is located in step 4.2, set the distributed training model parameters to the actual available graphics card resources described in step 4.2, and finally set the training set path to the training set JSON path described in step 4.
1. Leave the remaining parameters as default. Step 4.4: Execute the training script in the training framework directory described in step 4.3 and wait for the training task to complete. In step 4.5, evaluate the convergence of the model training process based on the trainingloss value output after the training in step 4.
4. If the trainingloss value has stabilized, there is no need to retrain. If the trainingloss value is still decreasing, increase the epoch value. For example, if the epoch parameter defaults to 3.0, change it to 5.0, and then restart training to observe the convergence effect. Step 5 specifically includes: Step 5.1: Use vllm to start the fine-tuned model output in step 4. The graphics card parameters specified in the startup parameters are consistent with the graphics card resources available in step 4.2, and the specified model path parameter is the model path output in step 4. In step 5.2, test the model launched in step 5.1 using the samples in the test set JSON from step 4.
1. If the model's accuracy in determining whether a risk exists is greater than 90%, and the risk category, risk description, and modification suggestions output by the model are not obviously unreasonable, proceed to step 5.
3. Otherwise, based on the existing contract documents, continue to expand the contract documents as in step 1, and then repeat steps 2 to 5 until the model meets the business requirements. In step 5.3, use the model started in step 5.1, assemble the prompts as described in step 3.3, and perform a risk analysis on the terms of the subsequent contract.
6. An analysis system for the contract risk analysis method based on large models in the sales industry according to claim 5, characterized in that: The system comprises: Contract document preparation module, used to prepare electronic sales contract documents; Clause extraction module, used to extract clauses from contract documents; Manual annotation module, used to annotate risk information in clauses; The model fine-tuning module uses the annotated clause information to fine-tune the base model and outputs the fine-tuned model; The risk analysis module starts the fine-tuned model and conducts risk analysis on the terms in the subsequent sales contracts that need to be signed.
7. An analysis system according to claim 6, wherein: The contract document preparation module includes: Contract collection unit, used to collect signed sales contract documents; The template expansion unit collects templates of different types of sales contract documents through online professional legal websites and other channels, and fills in the blanks in the collected contract templates to expand them into multiple contract documents; The file storage unit stores all collected contract files in the same directory and names it contracts.
8. An analysis system according to claim 6, characterized in that: The terms extraction module includes: The collection creation unit is used to create a collection for saving a list of all contract clauses, named clause_set; A file traversal unit that traverses all contract files in the contracts directory; A text extraction unit that extracts text paragraphs using corresponding libraries or interfaces according to the file format and adds the extracted paragraphs to clause_set.
9. An analysis system according to claim 6, wherein: The manual annotation module includes: A clause output unit that outputs the extracted clauses to the first column of an excel table; An annotation addition unit that adds new columns behind each clause to annotate whether there is a risk, the risk category, the risk description, and the modification suggestions.
10. An analysis system according to claim 6, characterized in that: The model fine-tuning module includes: A sample division unit that divides the annotated clause information into a training set and a test set according to a ratio; A graphics card resource confirmation unit that executes commands in the fine-tuning environment to confirm the available graphics card resources; A model selection unit that selects a suitable base model; A training execution unit that uses an open-source training framework for model fine-tuning training; A model evaluation unit that evaluates the convergence of the model training process according to the output value after training is completed; The risk analysis module includes: A model startup unit that starts the fine-tuned model using vllm; A model testing unit that tests the started model using the samples in the test set and determines whether retraining or contract file expansion is required according to the test results; A risk analysis execution unit that performs risk analysis on the contract clauses to be signed subsequently using the started model.
Citation Information
Cited By
Differentiation technology contract risk hedging clause generation method and system
CN121882936A
