Contract risk checking method, system and equipment based on multi-agent collaboration and medium

By employing a multi-agent collaborative contract risk assessment method, semantic, element, and table-based risk review agents are used to automate the analysis of contract texts. This solves the efficiency and accuracy problems of traditional manual review, enabling efficient and accurate risk assessment and continuous optimization.

CN120851579APending Publication Date: 2025-10-28SHANDONG LANGCHAO YUNTOU INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510702230.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-28
Publication Date
2025-10-28

AI Technical Summary

Technical Problem

Traditional manual contract risk review methods are inadequate in terms of efficiency, accuracy, and consistency, easily leading to risk omissions and misjudgments, and the interpretations of different reviewers vary greatly.

Method used

A multi-agent collaborative approach is adopted, in which a semantic risk review agent, an element risk review agent, and a table risk review agent are used to conduct risk screening of the contract text, and the performance and accuracy of the agents are improved through iterative optimization.

Benefits of technology

It has achieved comprehensiveness and accuracy in contract risk assessment, improved the efficiency of risk review, reduced human oversights and misjudgments, and adapted to the ever-changing needs of contract review.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120851579A_ABST
    Figure CN120851579A_ABST
Patent Text Reader

Abstract

The invention relates to the field of contract review, in particular to a contract risk investigation method, system and device based on multi-agent collaboration and a medium, and the method comprises the steps: receiving and processing a contract file, converting the contract file into an analyzable format, and extracting contract text content; according to the features of the contract text content, automatically judging the contract risk type, and distributing the extracted text content to the intelligent agent of the corresponding risk type; wherein the intelligent agents comprise a semantic risk review intelligent agent, an element risk review intelligent agent and a table risk review intelligent agent; each agent carries out risk investigation on the distributed text content to generate a risk examination result; summarizing risk review results of the intelligent agents and displaying the risk review results to the user; and recording feedback of the user to the review result, and performing iterative optimization on each agent based on the feedback. And each agent carries out risk investigation on the distributed text content to generate a risk investigation result, so that comprehensive and accurate risk investigation on the contract text is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of contract review technology, specifically to a method, system, device, and medium for contract risk assessment based on multi-agent collaboration. Background Technology

[0002] Contracts serve as the vehicle for a company's business operations. Their signing marks the official commencement of a project and serves as a crucial basis for project coordination. Conducting a comprehensive and meticulous risk review of the contract text, and addressing and effectively controlling any risks identified before signing, is of paramount importance for the company to successfully complete projects and smoothly conduct its business.

[0003] However, the contract risk review process is cumbersome and time-consuming, typically requiring multiple reviewers to repeatedly read and verify the contract text. During the review, reviewers need to perform detailed calculations and verifications on elements such as contract subject information (e.g., names of Party A and Party B), monetary information (including tax, excluding tax, tax rate, tax amount, warranty deposit, and penalty for breach of contract), installment payment information (payment time, proportion, and amount), and product list forms. Furthermore, reviewers must examine potential implicit semantic risks in the contract terms, such as unclear payment schedules, unclear liability for breach of contract, back-to-back payments, unilateral termination of the contract, unclear acceptance information, and prohibitions on subcontracting.

[0004] Manual review requires significant human resources from companies. If reviewers are not focused, lack experience, or lack professional competence, risks can easily be overlooked or misjudged. Furthermore, since semantic risk review relies heavily on the subjective judgment of reviewers, different reviewers can interpret the same clause risks in vastly different ways, further increasing the uncertainty and complexity of contract risk review. Therefore, traditional manual contract risk review methods have many shortcomings in terms of efficiency, accuracy, and consistency, necessitating the introduction of more intelligent and automated review tools to improve review quality and efficiency. Summary of the Invention

[0005] In view of the many shortcomings of traditional contract risk review methods that rely on human labor in terms of efficiency, accuracy and consistency, this invention provides a contract risk screening method, system, device and medium based on multi-agent collaboration.

[0006] In a first aspect, the technical solution of the present invention provides a method for contract risk assessment based on multi-agent collaboration, comprising the following steps: Receive and process contract documents, convert them into a parsable format, and extract the contract text content; Based on the characteristics of the contract text content, the system automatically determines the type of contract risk and assigns the extracted text content to the corresponding intelligent agent; among which, the intelligent agents include semantic risk review intelligent agents, element risk review intelligent agents, and table risk review intelligent agents; Each intelligent agent performs risk screening on the assigned text content and generates risk review results; specifically, this includes: using the semantic risk review intelligent agent to perform semantic risk analysis on the contract text and generate risk status, risk clauses, risk descriptions, and modification suggestions; using the element risk review intelligent agent to extract, summarize, and analyze the numerical elements in the contract; and using the table risk review intelligent agent to match, extract content, and verify numerical relationships in the contract table data. Summarize the risk assessment results of each intelligent agent and display them to the user; Record user feedback on the review results and iteratively optimize each agent based on the feedback.

[0007] By assigning contract text content to semantic risk review agents, element risk review agents, and table risk review agents, various risk types within the contract text can be comprehensively covered, ensuring the comprehensiveness and accuracy of risk assessment. Utilizing multi-agent collaborative work, with each agent focusing on specific types of risk assessment, improves the efficiency and accuracy of risk review, reducing oversights and misjudgments inherent in manual review. By recording user feedback and iteratively optimizing each agent, the performance and accuracy of the agents can be continuously improved, enabling them to better adapt to evolving contract review needs.

[0008] As a further limitation of the technical solution of the present invention, the steps of receiving and processing the contract document, converting it into a parsable format, and extracting the contract text content include: It can receive contract documents in different formats and automatically accept unsaved revisions in the contract documents, converting the contract documents into a unified format; Extract the main text of the contract using a text parsing tool, and eliminate redundant formatting information; The contract text is divided into multiple independent sections, separated by chapter headings; Convert the table content in the text into structured data.

[0009] By converting contract documents of different formats into a unified docx format and automatically accepting unsaved revisions, the uniformity of contract document format and the integrity of content are ensured, providing a foundation for subsequent text parsing and risk assessment. Extracting the main text of the contract using text parsing tools, eliminating redundant formatting information, and splitting the contract text into independent sections improves the efficiency and accuracy of text parsing, facilitating structured analysis of the contract text by the intelligent agent. Converting table content in the text into structured data facilitates matching, content extraction, and numerical relationship verification of table data by the table-based risk assessment intelligent agent, improving the efficiency and accuracy of table data processing.

[0010] As a further limitation of the technical solution of the present invention, the risk screening steps of the semantic risk review agent include: Pre-screen contract terms relevant to current risks through pattern matching; Relevant paragraphs are retrieved using text vectorization models and cosine similarity; Based on dynamically constructed prompts, a large language model is invoked to generate semantic risk analysis results.

[0011] By pre-screening contract clauses related to the current risk through pattern matching, potentially problematic clauses can be quickly identified, improving the efficiency of semantic risk screening. Utilizing text vectorization models and cosine similarity to retrieve relevant paragraphs allows for precise identification of text content highly relevant to the current risk, providing accurate input for subsequent semantic risk analysis. Based on dynamically constructed prompts that invoke large-scale language models, corresponding semantic risk analysis results can be generated according to different risk types, including risk status, risk clauses, risk descriptions, and modification suggestions, providing users with detailed semantic risk information.

[0012] As a further limitation of the technical solution of the present invention, the dynamically constructed prompt words include: Character description, known information, judgment criteria, task description, content restrictions, and format restrictions; The prompt words are used to invoke a large language model to generate risk analysis results.

[0013] By constructing multi-dimensional cue words that include role descriptions, known information, judgment criteria, task descriptions, content restrictions, and format restrictions, more accurate contextual information can be provided to large language models, thereby generating more accurate semantic risk analysis results that better meet user needs. Dynamically constructed cue words can be adjusted according to different contract texts and risk types, enabling large language models to better adapt to various complex semantic risk analysis scenarios and improving the model's adaptability and generalization ability.

[0014] As a further limitation of the technical solution of this invention, the risk screening steps of the element risk review intelligent agent include: Use a syntax tree structure to match contract terms that contain numerical elements; Numerical features are extracted by calling a large language model using dynamic prompts; The extracted values ​​are summarized and the rules are verified to complete the risk analysis.

[0015] By employing a syntax tree structure to match contract clauses containing numerical elements, the system can accurately identify clauses related to numerical elements, improving the accuracy of numerical element extraction. Dynamic prompts are used to invoke a large language model to extract numerical elements, and the extracted values ​​are then summarized and validated according to rules. This enables efficient element risk analysis, providing users with accurate element risk information. The automated numerical extraction and risk analysis process reduces the workload of manual review, lowers labor costs, and simultaneously improves the efficiency and accuracy of risk assessment.

[0016] As a further limitation of the technical solution of the present invention, the risk screening steps of the table risk review agent include: Identify table types using fuzzy syntax matching; Extract table content row by row and convert it into structured data; Verify the correctness of the numerical relationships in the table and the accuracy of the total value.

[0017] By identifying table types through fuzzy syntax matching, different table formats can be accurately identified, providing precise table structure information for the table risk review agent. Extracting table content row by row and converting it into structured data efficiently transforms unstructured data into easily processed formatted data, providing a foundation for subsequent table risk analysis. Verifying the correctness of numerical relationships and the accuracy of totals in the table can promptly identify errors and problems in the table data, ensuring accuracy and consistency and reducing business risks caused by table data errors.

[0018] As a further limitation of the technical solution of the present invention, the iterative optimization step includes: Adjust the matching mode, retrieval threshold, and prompt word structure of the semantic risk review agent based on human feedback data; Optimize the syntax tree, numerical extraction rules, and risk judgment logic of the risk assessment agent for factor risk review; Improve the matching mode, content extraction rules, and numerical calculation method of the form risk review agent.

[0019] By adjusting the matching mode, retrieval threshold, and prompt word structure of the semantic risk review agent based on human feedback data, optimizing the syntax tree, numerical extraction rules, and risk judgment logic of the element risk review agent, and improving the matching mode, content extraction rules, and numerical calculation methods of the table risk review agent, the system can continuously optimize the performance of each agent and improve the accuracy and efficiency of risk screening. Through an iterative optimization mechanism based on human feedback, the system can continuously learn and adapt to new contract texts and risk types, improving its adaptability and stability, and enabling it to better cope with ever-changing contract review needs. Continuous optimization and iteration can reduce misjudgments and omissions in the risk screening process, improve the reliability of risk screening, and provide users with more accurate risk information.

[0020] Secondly, the technical solution of the present invention also provides a contract risk assessment system based on multi-agent collaboration, comprising: The file processing module is used to receive and process contract files, convert them into a parsable format, and extract the contract text content. The agent allocation module is used to allocate the extracted text content to the risk review module according to the type of contract risk. The risk review module includes a semantic risk review agent, an element risk review agent, and a table risk review agent, which respectively conduct risk screening on the assigned text content and generate risk review results; The results summary and display module is used to summarize the risk review results of each intelligent agent and display them to the user; The feedback and optimization module is used to record user feedback on the review results and to iteratively optimize each agent based on the feedback.

[0021] As a further limitation of the technical solution of the present invention, the file processing module includes: The format conversion unit is used to convert contract documents into a parsable docx format; The content parsing unit is used to extract text, split into sections, and transform tabular data.

[0022] As a further limitation of the technical solution of the present invention, the iterative optimization module includes: The data recording unit is used to store the results of the intelligent agent's review and human feedback data; The model adjustment unit is used to adjust the matching mode, retrieval threshold, and prompt word structure of the semantic risk review agent based on human feedback data; optimize the syntax tree, numerical extraction rules, and risk judgment logic of the element risk review agent; and improve the matching mode, content extraction rules, and numerical calculation method of the table risk review agent.

[0023] Thirdly, the present invention also provides an electronic device, the electronic device comprising: at least one processor; and a memory communicatively connected to the at least one processor; the memory storing computer program instructions executable by the at least one processor, the computer program instructions being executed by the at least one processor to enable the at least one processor to execute the contract risk screening method based on multi-agent collaboration as described in the first aspect.

[0024] Fourthly, the present invention also provides a non-transitory computer-readable storage medium that stores computer instructions that cause the computer to execute the contract risk screening method based on multi-agent collaboration as described in the first aspect.

[0025] As can be seen from the above technical solution, this application has the following advantages: By receiving and processing contract documents, converting them into a parsable format, and extracting the contract text content, automated parsing of contract text is achieved. Based on the characteristics of the contract text content, the type of contract risk is automatically determined, and the extracted text content is assigned to the corresponding intelligent agent, achieving automatic risk type judgment and preliminary screening of risk points. Each intelligent agent performs risk screening on the assigned text content, generating risk review results, achieving comprehensive and accurate risk screening of the contract text. Recording user feedback on the review results and iteratively optimizing each intelligent agent based on the feedback continuously improves the risk screening capabilities and accuracy of the intelligent agents, adapting to constantly changing contract texts and risk types. Attached Figure Description

[0026] To more clearly illustrate the technical solution of this application, the accompanying drawings used in the description will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0027] Figure 1 This is a flowchart illustrating the method provided in an embodiment of the present invention.

[0028] Figure 2 A block diagram of a system provided in an embodiment of the present invention. Detailed Implementation

[0029] This method proposes a multi-agent collaborative approach to assist in reviewing risks in contract texts and can learn from tagged review conclusions. Compared to traditional contract risk review methods that rely primarily on manual review, this method significantly improves contract review efficiency, reduces risk omissions due to human error, and greatly reduces labor costs. Compared to other AI-assisted contract review solutions, this method employs a multi-agent collaborative strategy, which not only allows for more precise adaptation to different types of contract risks but also matches the optimal solution path based on the specific risk type. Through this multi-agent collaborative approach, this invention can more comprehensively cover various contract risks and provide more personalized solutions.

[0030] Furthermore, this method, while utilizing prompt word technology to access and employ a large language model, also incorporates other techniques such as Retrieval Augmented Generation (RAG), dynamic prompt word construction, and grammatical pattern matching. This fusion of techniques further enhances the efficiency and accuracy of using the large language model. Finally, this method records a large amount of learnable corpus data through a data closed-loop mechanism. This data not only enriches the model's training set but also enables the model to continuously learn itself through reinforcement learning based on human feedback. By adjusting rules and fine-tuning model weights, this method can continuously optimize and iterate the agent's performance, thereby continuously improving the model's accuracy and performance. This ability to continuously learn and optimize ensures that this invention remains highly efficient and accurate when facing ever-changing contract review requirements.

[0031] To make the purpose, features, and advantages of this application more apparent and understandable, specific embodiments and accompanying drawings will be used to clearly and completely describe the technical solution protected by this application. Obviously, the embodiments described below are only some embodiments of this application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0032] like Figure 1 As shown in the figure, this embodiment provides a contract risk assessment method based on multi-agent collaboration, including the following steps: S1. Receive and process the contract file, convert it into a parsable format, and extract the contract text content; S2. Based on the characteristics of the contract text content, automatically determine the type of contract risk and assign the extracted text content to the corresponding risk type of intelligent agent; among which, intelligent agents include semantic risk review intelligent agent, element risk review intelligent agent, and table risk review intelligent agent; For the semantic risk review agent, the relevant paragraphs in the contract for various risks such as payment, acceptance, and dispute resolution are first retrieved based on the risk configuration list. Then, a large language model is used to determine the risk status and generate reference risk handling methods.

[0033] For the intelligent agent for risk assessment of key elements, pattern matching technology is first used to screen out contract clauses containing key elements such as the names of Party A and Party B, the amount and proportion, installment payment information, service period information, and invoicing information; then, a large language model is retrieved to extract the specific values ​​of each element; finally, the content of the elements is analyzed and verified.

[0034] For the table risk review agent, the first step is to filter out tables containing information such as unit price, quantity, and total through pattern matching; then, based on the calculation logic corresponding to the matched table type, the agent checks whether the numerical calculation of individual row data and total price in the table is correct.

[0035] S3. Each intelligent agent performs risk screening on the assigned text content and generates risk review results; specifically, this includes: using the semantic risk review intelligent agent to perform semantic risk analysis on the contract text and generate risk status, risk clauses, risk descriptions, and modification suggestions; using the element risk review intelligent agent to extract, summarize, and analyze the numerical elements in the contract; and using the table risk review intelligent agent to match, extract content, and verify numerical relationships in the contract table data. S4. Summarize the risk assessment results of each intelligent agent and display them to the user; S5. Record user feedback on the review results and iteratively optimize each agent based on the feedback.

[0036] By assigning contract text content to semantic risk review agents, element risk review agents, and table risk review agents, various risk types within the contract text can be comprehensively covered, ensuring the comprehensiveness and accuracy of risk assessment. Utilizing multi-agent collaborative work, with each agent focusing on specific types of risk assessment, improves the efficiency and accuracy of risk review, reducing oversights and misjudgments inherent in manual review. By recording user feedback and iteratively optimizing each agent, the performance and accuracy of the agents can be continuously improved, enabling them to better adapt to evolving contract review needs.

[0037] This embodiment provides a contract risk assessment method based on multi-agent collaboration, which mainly consists of front-end and back-end file reception and transmission, file conversion, file parsing, agent collaboration strategy, semantic risk review agent, element risk review agent, table risk review agent, review result summary and display, model review result recording, agent iterative optimization, etc., as detailed below: Step 1 (Front-end and Back-end Receiving and Transferring Files): Receive and process contract files; Step 2 (File Conversion): This mainly includes two sub-steps: format conversion and automatic acceptance of revisions, as follows: Step 2-1 (File Parsing): To ensure the contract content can be fully parsed, the contract file format is converted using a Windows-based file format conversion service. This process not only involves file format conversion but also automatically processes revisions within the file to ensure the accuracy and consistency of the contract content. Specifically, the file conversion service will convert contract files in different formats, such as doc and pdf, into docx format, which can be parsed by Linux architecture machines. This ensures that regardless of the original format of the contract file, it can be opened and parsed smoothly on a Linux system, guaranteeing the integrity and readability of the contract content.

[0038] Step 2-2 (Automatic Acceptance of Revisions): In addition, the document conversion service will automatically accept all edited but unaccepted revisions in the Word file. This means that if a contract document undergoes multiple modifications and revisions during the editing process, but these revisions have not yet been formally accepted, the document conversion service will automatically process these revisions, ensuring that the final generated docx file contains all the latest changes. This feature not only simplifies the contract document processing workflow but also avoids inconsistencies in contract content caused by unaccepted revisions, thereby improving the efficiency and accuracy of contract management.

[0039] Step 3 (Document Parsing): The document parsing step mainly includes three sub-steps: extracting contract terms, splitting into sections, and converting table content, as follows: Step 3-1 (Text Content Extraction): First, using advanced docx text parsing tools, the text content of the contract document is comprehensively and accurately extracted. This process not only includes the identification and extraction of the main text but also pays special attention to removing redundant formatting information that may interfere with the analysis, such as the table of contents, headers, and footers. The purpose of this is to ensure that the extracted text content is cleaner and more accurate for subsequent processing and analysis. In this way, this step can effectively process and understand the key information in the contract document, improving work efficiency and accuracy.

[0040] Step 3-2 (Text Segmentation): Next, pattern matching techniques are used to meticulously segment the contract text, using chapter headings as clear dividing units to divide the contract content into multiple independent sections. This processing step is crucial for the agent, as it not only helps the agent to understand the contract text in a more structured way but also significantly improves the model's efficiency during the review process. In this way, the agent can more quickly locate key information in the contract, thereby improving the accuracy and speed of the review.

[0041] Step 3-3 (Table Content Transformation): Finally, the table content in the Word document is transformed into structured data that is easier to calculate and analyze. Specifically, for product lists containing information such as unit price, quantity, and total price, pattern matching technology is used to adapt the matched table structure to rules, and the table content is parsed row by row and column by column, transforming the text content in the table cells into structured data containing both row and column dimensions. This transformation not only helps improve the efficiency of data processing but also ensures the accuracy and consistency of the data, thus facilitating the verification of the correctness of the amount calculation. In addition, this step also transforms the table cell content containing basic element information (such as subject, amount, payment, etc.) into clauses and adds them to the splitting results so that the agent can perform unified analysis and understanding.

[0042] Step 4 (Agent Collaboration Strategy): Based on the differences in risk types, the parsed contract text content will be transmitted separately to the semantic risk review agent, the element risk review agent, and the table risk review agent. These three agents are optimized for the three types of risks: semantic, element, and table. The semantic risk review agent focuses on identifying and analyzing the risks that may arise from the language expressions in the contract text; the element risk review agent focuses on checking whether the key elements in the contract are complete and accurate; and the table risk review agent is responsible for reviewing the accuracy and consistency of the table data involved in the contract.

[0043] Step 5 (Semantic Risk Review Agent): The semantic risk review agent mainly includes three steps: clause pre-screening, relevant paragraph retrieval, and semantic risk review. The semantic risk review part includes four sub-processes: risk status assessment, risk type analysis, risk information description, and modification suggestion generation.

[0044] Step 5-1 (Clause Pre-screening): Before performing paragraph retrieval, to improve the accuracy and precision of the search, pattern matching is used to pre-filter out text content that is less relevant to the current risk but easily causes confusion. For example, for risks such as "unclear audit information," clauses containing words like "inspection," "testing," and "verification," which have similar semantic meanings to "audit" but significantly different practical significance for the company's business, are filtered out. Although these words are similar to "audit" in literal sense, they may involve different business processes and standards in actual application, thus easily leading to biased search results. This pre-screening step effectively reduces interference from irrelevant information, improves the effectiveness of relevant paragraph retrieval, and thus ensures the rationality of the review content generated by the large language model.

[0045] Step 5-2 (Relevant Paragraph Retrieval): Based on the similarity of the vectorized text, paragraphs highly relevant to the current risk are retrieved. First, a text vectorization model is used to convert the contract text and risk-related elements into vector form. These vectors contain semantic information from the text and risk elements. Then, the cosine similarity metric is used to assess the similarity between the key elements of the current risk item and other texts. Cosine similarity is a commonly used text similarity metric that measures similarity by calculating the cosine of the angle between two vectors. When the similarity exceeds a preset threshold, the contract text content is considered highly relevant to the key elements of the current risk item, and thus included as retrieved risk-related paragraphs. Specifically, for contract clause text... and risk element text retrieval similarity ,in The selected text vectorization model.

[0046] Step 5-3 (Semantic Risk Analysis): For the retrieved risk-related paragraphs, prompt words are dynamically constructed, and a large language model is invoked to generate "risk status," "risk clause," "risk description," and "modification suggestions" for each semantic risk type. This step employs a retrieval-enhanced generative model framework to perform a comprehensive semantic risk analysis based on the retrieved contract paragraphs. Among them, "Risk Status" is the judgment result of whether there is semantic risk in the text, that is, to determine whether there are any expressions in the text that may cause disputes or misunderstandings; "Risk Clauses" are the contract text content corresponding to the current risk, such as the risk clause corresponding to the "back-to-back payment" risk, which is "Party A agrees to make payment to Party B only after receiving payment from the end user," and other contract texts involving back-to-back payments. These clauses may have an adverse impact on the execution of the contract; "Risk Description" is a detailed description of the current risk, including the obstacles that the current risk will cause to the smooth execution of the contract, as well as the potential risks to Party B, such as possible cash flow problems, impact on project progress, etc.; "Modification Suggestions" are suggestions for modifying the current risk clauses to eliminate or reduce the risk, which can provide some reference for contract reviewers to help them better understand and handle potential risks in the contract.

[0047] The semantic risk analysis prompts are divided into six parts: "Role Description," "Known Information," "Judgment Basis," "Task Description," "Content Restrictions," and "Format Restrictions." The "Role Description" section defines the role background of the large language model, such as "You are a rigorous and experienced contract risk analyst, skilled at analyzing the risks to Party B in contract texts." This helps the model better understand user needs and expectations, thereby generating more accurate and targeted text content. The "Known Information" section contains relevant paragraphs retrieved in the previous step, serving as the information basis for the model's risk judgment and analysis. The "Judgment Basis" section provides a complete description of the current semantic risk. For example, the judgment basis for the risk of "unilateral change of requirements" is "Party A's requirements should be clear and specific; the contract should not contain clauses allowing Party A to unilaterally change requirements or propose requirements beyond those stipulated in the contract; the prerequisite for changing requirements is that both parties reach a written agreement." This is a crucial basis for the model's risk judgment. Furthermore, the "Task Description" section clarifies the content the model needs to perform, including the types and items of information to be generated. Simultaneously, the "Content Restrictions" section imposes detailed restrictions on the information generated by the model, including limitations on the meaning of the content and the number of words. Finally, the "Format Restrictions" section sets requirements for the format of the model's responses to ensure that the model only outputs the content required by the format, facilitating the subsequent extraction and processing of valid content from the responses.

[0048] Step 6 (Element Risk Review Agent): The element risk review agent mainly includes four sub-steps: clause selection, numerical extraction, numerical summarization, and risk analysis, as detailed below: Step 6-1 (Clause Selection): Pattern matching technology is used to select clauses containing numerical information about elements. To facilitate clause selection and filtering, a "syntax tree" structure is designed and implemented in this step. The syntax tree mainly contains four structural elements: "Y", "YE", "N", and "NE". The "Y" structure contains the regular expression that the selected clause must fully contain; the "YE" structure contains the syntax expressions to be excluded from the "Y" structure; the "N" structure contains the regular expression that the selected clause must not contain; and the "NE" structure contains the syntax expressions to be excluded from the "N" structure. Therefore, the clauses selected in this step must match all "Y" branch expressions except "YE"; and must not match all "N" branch expressions except "NE". This method allows for more precise filtering of clauses that meet the conditions, improving processing efficiency and accuracy.

[0049] Step 6-2 (Numerical Extraction): For the selected clauses, prompt words are dynamically constructed based on the appearance of the elements, and a large language model is used to extract the specific numerical values ​​corresponding to the element names. For example, for clauses containing "subject" information, the names "Party A" and "Party B" are extracted; for clauses containing "amount" information, "amount including tax in lowercase," "amount including tax in uppercase," "amount excluding tax in lowercase," "tax amount in lowercase," and "tax rate" are extracted. To ensure the validity of the extracted numerical values, this step verifies the authenticity of the extracted information, including checking whether floating-point numbers can be successfully converted and whether the tax rate is reasonable.

[0050] Step 6-3 (Value Summarization): Summarize the values ​​extracted from each clause in the previous step to obtain the values ​​of all elements in the contract. Step 6-4 (Element Risk Analysis): For the summarized elements, analyze the risk of each element type through numerical calculations and rule-based judgments. For example, for monetary data, calculate whether the "amount including tax in lowercase" and "amount including tax in uppercase" are consistent, and whether the calculation relationship between "amount including tax in lowercase," "amount excluding tax in lowercase," and "tax rate" is correct; for entity data, examine whether the names of "Party A" and "Party B" are consistent before and after the contract text; for date data, determine whether the "service period start date" and "service period end date" are consistent, etc.

[0051] Step 7 (Table Risk Review Agent): The table risk review agent mainly includes three sub-steps: table matching, cell extraction, and risk analysis, as follows: Step 7-1 (Table Matching): When processing the product list table in the contract document, a fuzzy syntax matching method was used to identify the type of the table header. To ensure adaptability to various product list table formats, this step designed multiple adaptation rules. These rules include, but are not limited to, "Price-Number-Length-Discount-Sum (PNLDS)," "Price-Number-Discount-Sum (PNDS)," and "Price-Number-Sum (PNS)," etc. Through these rules, the system can more accurately parse and understand the data structure in the table, thereby improving the efficiency and accuracy of data processing.

[0052] Step 7-2 (Table Content Extraction): For product list tables of different types, each row is traversed, and key information columns (such as "unit price," "quantity," and "total price") are extracted from each row. Simultaneously, the total values ​​in the table are matched and extracted. This step transforms the unformatted data in the product list table into formatted data that is easy for the model to read and analyze, preparing for table risk analysis. This process ensures data consistency and accuracy, thereby improving the reliability and efficiency of subsequent analysis. Furthermore, this step performs preliminary cleaning and processing for any outliers or missing data in the table, further improving data quality.

[0053] Step 7-3 (Table Risk Analysis): Perform in-depth risk calculation and analysis on the extracted product list table content. Specifically, for tables of the type "Price-Number-Length-Discount-Sum (PNLDS)," check each row to ensure that the value satisfies the numerical relationship of "Unit Price × Quantity × Duration × Discount = Total Price," thereby ensuring data accuracy and reducing business risks caused by data errors. For example, assuming a row has a unit price of 100 yuan, a quantity of 2, a duration of 3 hours, and a discount of 0.9, then the total price should be 100 × 2 × 3 × 0.9 = 540 yuan. If the actual total price in the table does not match the calculated result, the system will immediately issue a risk alert, prompting the user to check and correct the data in that row.

[0054] In addition, this step involves checking the sum of the "Total Price" across all rows of the table to ensure it matches the "Table Total" value. This check is equally crucial as it verifies the accuracy of the overall table summary. If the displayed total does not match the row-by-row summation, the system will issue a warning, prompting the user to check and correct the summary data.

[0055] Step 8 (Summary and Presentation of Review Results): Summarize and organize the risk analysis results of the semantic risk review agent, the element risk review agent, and the table risk review agent. By integrating the analysis results of these agents, this method provides a comprehensive and integrated risk assessment report. This report not only covers the risk points in various aspects but is also presented in an easy-to-understand format so that contract reviewers can use and provide feedback quickly and accurately.

[0056] Step 9 (Model Review Result Recording): Detailed records of the contract reviewers' assessment of the agent's review results are stored in the corresponding database. Each record includes not only basic contract information and documents, but also detailed descriptions of the agent's review results, their accuracy, error types, and causes. These records represent valuable feedback from experienced contract reviewers, providing crucial reference for the agent's continuous iteration and optimization. Based on this accumulated data, this invention employs reinforcement learning based on human feedback to iterate and optimize the agent, improving its accuracy and efficiency to better meet user needs.

[0057] Step 10 (Agent Iterative Optimization): Agent iterative optimization mainly includes three sub-steps: semantic risk review agent iterative optimization, element risk review agent iterative optimization, and table risk agent iterative optimization, as follows: Step 10-1 (Iterative Optimization of the Semantic Risk Review Agent): Based on the feedback results of the semantic risk review records recorded in Step 8, steps 4-1, 4-2, and 4-3 of the semantic risk review agent are iteratively optimized. Specifically, for step 4-1 (clause pre-screening), the matching mode of pre-screening is adjusted according to the review errors caused by redundant clause data mentioned in the feedback results to reduce misjudgments and omissions. For step 4-2 (related paragraph retrieval), the set of search keywords and similarity thresholds are adjusted according to the review errors caused by incorrect search content mentioned in the feedback results, and the weights of the text vectorization model are fine-tuned to improve the accuracy and efficiency of the retrieval. For step 4-3 (semantic risk analysis), the construction form and expression of prompt words are adjusted according to the review errors caused by the large language model's insufficient understanding of contract risks and the poor effect of the generated risk descriptions and modification suggestions mentioned in the feedback results, and the weights of the large language model are fine-tuned according to the historical contract review records.

[0058] Step 10-2 (Iterative Optimization of the Element Risk Review Agent): Based on the feedback results of the risk review records, iterative optimization is performed on steps 5-1, 5-2, and 5-4 of the element risk review agent. Specifically, for step 5-1 (clause selection), the syntax tree for clause selection is adjusted based on review errors caused by incorrect clause selection in the feedback results to improve the accuracy and efficiency of selection; for step 5-2 (element value extraction), the prompt word construction format, prompt word expression method, and value filtering rules are adjusted based on review errors caused by incorrect element value extraction in the feedback results to ensure that the extracted values ​​are more accurate and reliable; for step 5-4 (risk analysis), the value calculation method and risk judgment rules are adjusted based on review errors caused by element value conversion and value calculation in the feedback results to improve the accuracy and reliability of risk analysis. Step 10-3 (Iterative Optimization of the Form Risk Review Agent): Based on the feedback results of the risk review records, iteratively optimize steps 6-1, 6-2, and 6-3 of the form risk review agent. Specifically, for step 6-1 (form matching), adjust the form matching pattern to improve accuracy based on review errors caused by form pattern matching issues in the feedback results; for step 6-2 (form content extraction), optimize the cell content extraction rules to ensure accuracy and completeness based on review errors caused by incorrect form content extraction in the feedback results; for step 6-3 (form risk analysis), adjust the calculation method and risk judgment rules to improve the accuracy and reliability of the review based on review errors caused by form numerical calculations and risk judgments in the feedback results.

[0059] like Figure 2 As shown, this embodiment of the invention also provides a contract risk assessment system based on multi-agent collaboration, including: The file processing module is used to receive and process contract files, convert them into a parsable format, and extract the contract text content. The agent allocation module is used to allocate the extracted text content to the risk review module according to the type of contract risk. The risk review module includes a semantic risk review agent, an element risk review agent, and a table risk review agent, which respectively conduct risk screening on the assigned text content and generate risk review results; The results summary and display module is used to summarize the risk review results of each intelligent agent and display them to the user; The feedback and optimization module is used to record user feedback on the review results and to iteratively optimize each agent based on the feedback.

[0060] The file processing module includes: The format conversion unit is used to convert contract documents into a parsable docx format; The content parsing unit is used to extract text, split into sections, and transform tabular data.

[0061] The iterative optimization module includes: The data recording unit is used to store the results of the intelligent agent's review and human feedback data; The model adjustment unit is used to adjust the matching mode, retrieval threshold, and prompt word structure of the semantic risk review agent based on human feedback data; optimize the syntax tree, numerical extraction rules, and risk judgment logic of the element risk review agent; and improve the matching mode, content extraction rules, and numerical calculation method of the table risk review agent.

[0062] This invention also provides an electronic device, comprising: a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus. The communication bus can be used for information transmission between the electronic device and sensors. The processor can call logical instructions in memory to execute the following methods: S1. Receive and process the contract document, convert it into a parsable format, and extract the contract text content; S2. Based on the characteristics of the contract text content, automatically determine the contract risk type and assign the extracted text content to the corresponding risk type agent; wherein, the agent includes a semantic risk review agent, an element risk review agent, and a table risk review agent; S3. Each agent performs risk screening on the assigned text content and generates risk review results; specifically, this includes: through the semantic risk review agent, performing semantic risk analysis on the contract text to generate risk status, risk clauses, risk descriptions, and modification suggestions; through the element risk review agent, extracting, summarizing, and analyzing the numerical elements in the contract; through the table risk review agent, matching, extracting content, and verifying numerical relationships in the contract table data; S4. Summarize the risk review results of each agent and display them to the user; S5. Record user feedback on the review results and iteratively optimize each agent based on the feedback.

[0063] Furthermore, the logical instructions in the aforementioned memory can be implemented as software functional units and sold or used as independent products, and can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0064] This invention provides a non-transitory computer-readable storage medium storing computer instructions that cause a computer to execute the method provided in the above-described method embodiments. For example, the instructions include: S1, receiving and processing a contract document, converting it into a parsable format, and extracting the contract text content; S2, automatically determining the contract risk type based on the characteristics of the contract text content, and assigning the extracted text content to an intelligent agent corresponding to the risk type; wherein the intelligent agents include a semantic risk review intelligent agent, an element risk review intelligent agent, and a table risk review intelligent agent; S3, each intelligent agent respectively... The process involves: S4, summarizing the risk assessment results of the contract text using the semantic risk assessment agent to generate risk status, risk clauses, risk descriptions, and modification suggestions; S5, extracting, summarizing, and analyzing the numerical elements in the contract using the element risk assessment agent; and S6, matching, extracting content, and verifying numerical relationships in the contract table data using the table risk assessment agent. The process continues with: S4, summarizing the risk assessment results of each agent and displaying them to the user; and S7, recording user feedback on the assessment results and iteratively optimizing each agent based on the feedback.

[0065] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for contract risk assessment based on multi-agent collaboration, characterized in that, Includes the following steps: Receive and process contract documents, convert them into a parsable format, and extract the contract text content; Based on the characteristics of the contract text content, the system automatically determines the type of contract risk and assigns the extracted text content to the corresponding intelligent agent; among which, the intelligent agents include semantic risk review intelligent agents, element risk review intelligent agents, and table risk review intelligent agents; Each intelligent agent performs risk screening on the assigned text content and generates risk review results; specifically, this includes: using the semantic risk review intelligent agent to perform semantic risk analysis on the contract text and generate risk status, risk clauses, risk descriptions, and modification suggestions; using the element risk review intelligent agent to extract, summarize, and analyze the numerical elements in the contract; and using the table risk review intelligent agent to match, extract content, and verify numerical relationships in the contract table data. Summarize the risk assessment results of each intelligent agent and display them to the user; Record user feedback on the review results and iteratively optimize each agent based on the feedback.

2. The contract risk assessment method based on multi-agent collaboration according to claim 1, characterized in that, The steps for receiving and processing contract documents, converting them into a parsable format, and extracting the contract text content include: It can receive contract documents in different formats and automatically accept unsaved revisions in the contract documents, converting the contract documents into a unified format; Extract the main text of the contract using a text parsing tool, and eliminate redundant formatting information; The contract text is divided into multiple independent sections, separated by chapter headings; Convert the table content in the text into structured data.

3. The contract risk assessment method based on multi-agent collaboration according to claim 1, characterized in that, The risk assessment steps for semantic risk review agents include: Pre-screen contract terms relevant to current risks through pattern matching; Relevant paragraphs are retrieved using text vectorization models and cosine similarity; Based on dynamically constructed prompts, a large language model is invoked to generate semantic risk analysis results.

4. The contract risk assessment method based on multi-agent collaboration according to claim 3, characterized in that, The dynamically constructed prompt words include: Character description, known information, judgment criteria, task description, content restrictions, and format restrictions; The prompt words are used to invoke a large language model to generate risk analysis results.

5. The contract risk assessment method based on multi-agent collaboration according to claim 1, characterized in that, The risk assessment steps of the risk review agent include: Use a syntax tree structure to match contract terms that contain numerical elements; Numerical features are extracted by calling a large language model using dynamic prompts; The extracted values ​​are summarized and the rules are verified to complete the risk analysis.

6. The contract risk assessment method based on multi-agent collaboration according to claim 1, characterized in that, The risk assessment steps for the form-based risk review agent include: Identify table types using fuzzy syntax matching; Extract table content row by row and convert it into structured data; Verify the correctness of the numerical relationships in the table and the accuracy of the total value.

7. The contract risk assessment method based on multi-agent collaboration according to any one of claims 1-6, characterized in that, The iterative optimization steps include: Adjust the matching mode, retrieval threshold, and prompt word structure of the semantic risk review agent based on human feedback data; Optimize the syntax tree, numerical extraction rules, and risk judgment logic of the risk review agent; Improve the matching mode, content extraction rules, and numerical calculation method of the form risk review agent.

8. A contract risk assessment system based on multi-agent collaboration, characterized in that, include: The file processing module is used to receive and process contract files, convert them into a parsable format, and extract the contract text content. The agent allocation module is used to allocate the extracted text content to the risk review module according to the type of contract risk. The risk review module includes a semantic risk review agent, an element risk review agent, and a table risk review agent, which respectively conduct risk screening on the assigned text content and generate risk review results; The results summary and display module is used to summarize the risk review results of each intelligent agent and display them to the user; The feedback and optimization module is used to record user feedback on the review results and to iteratively optimize each agent based on the feedback.

9. An electronic device, characterized in that, The electronic device includes: at least one processor; and a memory communicatively connected to the at least one processor; the memory stores computer program instructions executable by the at least one processor, the computer program instructions being executed by the at least one processor to enable the at least one processor to perform the contract risk screening method based on multi-agent collaboration as described in any one of claims 1 to 7.

10. A non-transitory computer-readable storage medium, characterized in that, The non-transitory computer-readable storage medium stores computer instructions that cause the computer to execute the contract risk assessment method based on multi-agent collaboration as described in any one of claims 1 to 7.