Legal contract term AI examination method

By constructing a structured representation of contracts and analyzing the evolutionary relationships of historical contract databases, combined with business scenario simulation and deduction, the optimal clause modification strategy is generated, which solves the problem of insufficient depth and accuracy in contract review in existing technologies and realizes dynamic optimization of contract clauses under different scenarios.

CN121658628APending Publication Date: 2026-03-13XIAN JINJU ENTERPRISE MANAGEMENT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-21
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

Existing technologies lack the ability to utilize historical contract data in contract review, making it impossible to dynamically predict the performance of contract terms under different business scenarios, thus limiting the depth and accuracy of review results.

Method used

By constructing a structured representation of contracts, analyzing evolutionary relationships using a historical contract database, and conducting simulations under specific business scenarios, the optimal clause modification strategy is generated.

Benefits of technology

It achieves a precise representation of the inherent legal relationships within contracts, improves the depth and accuracy of contract review, and enables the review results to proactively generate better clause combinations under different conditions, possessing data-driven self-optimization capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121658628A_ABST
    Figure CN121658628A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of legal artificial intelligence, and discloses a legal contract term AI examination method, which comprises the following steps: acquiring a contract to be examined, historical contract data and user game parameters, analyzing a contract text into a structured graph containing legal functional units, generating vectorized representation, and calculating the evolution distance between historical contracts to obtain the legal contract term AI. The method comprises the following steps: constructing a historical contract evolutionary tree structure, combining an evolutionary tree, a commercial risk scene and user game parameters, performing simulation deduction by applying a genetic algorithm, evaluating advantages and disadvantages of various strategy combinations through a payment function, guiding a mutation direction by utilizing evolutionary fitness scores of historical contracts, and searching an optimal strategy combination. And by comparing the difference between the optimal strategy combination and the original contract, an accurate modification suggestion or a complete contract draft is generated. According to the method, evolutionary intelligence of historical contracts is combined with game theory simulation, the limitation of static and template review in the prior art is overcome, and the strategic and personalized level of review is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of legal artificial intelligence technology, specifically to an AI-based method for reviewing legal contract terms. Background Technology

[0002] In business activities, contracts are core legal documents that establish the rights and obligations of all parties and mitigate potential risks. Therefore, reviewing contract terms is a crucial task, as its quality directly impacts a company's business interests and security.

[0003] Currently, contract review primarily relies on manual review by legal professionals. While this method can identify some risks based on professional experience, its inherent limitations are becoming increasingly apparent. Manual review not only consumes significant time and manpower, but the depth and breadth of the review results also heavily depend on the reviewer's individual knowledge and experience, making it difficult to guarantee the uniformity and objectivity of review standards. This is especially true when dealing with massive amounts of complex contract texts, where fatigue or oversight can easily lead to omissions. More importantly, individual experience is often fragmented and subjective, lacking a systematic mechanism to accumulate and utilize the collective wisdom and ultimate business results of an organization's historical contracts accumulated over long-term business practice.

[0004] To overcome the shortcomings of manual review, automated contract review tools have emerged in the market. These tools typically utilize natural language processing technology, employing keyword matching, rule engines, or comparison with standard templates to identify missing clauses, flag risky terms, or discover content that deviates from preset standards. These tools have improved the efficiency of basic review to some extent. However, most existing automated tools remain at a static, superficial level of analysis of contract text. They can identify what is or is not present, but they cannot deeply understand the complex legal logic between clauses, nor can they assess the relevance of contract clauses to specific business scenarios and their dynamic risks. Their suggested modifications are often based on general templates and are standardized, lacking the ability to dynamically adjust to personalized business parameters such as the bargaining power and risk appetite of specific users in specific transactions. In other words, these tools cannot answer a more fundamental question: in the current business game scenario, what combination of contract clauses is the optimal strategy for the user, rather than just a standard strategy? They cannot learn and evolve from the successes and failures of historical contracts, resulting in a disconnect between their review work and the final performance of contracts in real business environments. Summary of the Invention

[0005] To address the shortcomings of existing technologies, this invention provides an AI-based method for reviewing legal contract terms. This method solves the problem that existing contract review methods typically perform isolated and static analyses of individual contracts, lacking the utilization of business outcome information contained in historical contract data and failing to dynamically predict the future performance of contract terms under different business scenarios, thus limiting the depth and accuracy of the review results.

[0006] To address the aforementioned technical issues, this invention provides an AI-based method for reviewing legal contract terms. This method constructs a structured representation of the contract, analyzes its evolutionary relationships using a historical contract database, and simulates specific business scenarios to generate a clause modification strategy with clear data support.

[0007] The method includes the following steps:

[0008] First, obtain a contract text of the contract to be reviewed, the game parameters input by the user, a historical contract database, and multiple preset business risk scenarios;

[0009] Then, the contract text of the contract to be reviewed is parsed, multiple structured legal functional units are extracted, and a structured graph reflecting the legal logical relationship between the multiple legal functional units is constructed.

[0010] Next, based on multiple historical contracts in the historical contract database, a tree structure reflecting the evolutionary relationship between the multiple historical contracts is constructed;

[0011] Subsequently, based on the tree structure, the structured graph is simulated and deduced according to the multiple preset business risk scenarios and the game parameters input by the user, to generate one or more optimal strategy combinations.

[0012] Finally, based on the one or more optimal strategy combinations, suggested modifications to the terms of the contract under review are generated and output.

[0013] In one embodiment, after the step of parsing the contract text of the contract to be examined, the method further includes a step of converting the structured graph and the plurality of structured legal functional units into a vectorized representation of the contract.

[0014] The vectorized representation of the contract is a numerical vector whose dimensions and values ​​reflect the legal functional units and legal logical relationship structure of the contract. This vectorized representation of the contract is used for quantitative characterization and calculation of historical contracts in subsequent steps.

[0015] Preferably, the step of constructing the tree structure includes:

[0016] First, obtain the vectorized representations of multiple historical contracts in the historical contract database;

[0017] Then, the evolution distance between the contract vectorization representations of any two historical contracts is calculated.

[0018] The evolutionary distance is calculated using the following formula:

[0019] D evo (V i V j )=α·D content (V i V j )+β·D struct (V i V j );

[0020] in:

[0021] D evo V represents the final evolutionary distance between two historical contracts; i and V j D represents the vectorized representation of the i-th and j-th historical contracts, respectively; content It is a function used to calculate content distance, the result of which characterizes the differences between two contracts in the composition of legal functional units; D struct It is a function used to calculate structural distance, the result of which characterizes the difference between two contracts in terms of legal logical relationship structure; α and β are preset weight coefficients that satisfy α+β=1.

[0022] Finally, based on the calculated evolution distance between any two historical contracts, the tree structure is generated using a hierarchical clustering algorithm.

[0023] In one specific embodiment, the game parameters input by the user include at least one of review position, relative bargaining power, and risk preference.

[0024] Preferably, the step of simulating and extrapolating the structured map includes:

[0025] First, under the multiple preset business risk scenarios, multiple alternative strategy combinations are generated by modifying or combining the legal functional units in the structured graph.

[0026] Then, a payoff function value is calculated for each alternative strategy combination, and the optimal strategy combination is determined based on the payoff function value.

[0027] The optimal strategy combination is determined by the following formula:

[0028]

[0029] in:

[0030] S * S represents the optimal strategy combination; k C represents the k-th alternative strategy combination; m U represents the m-th business risk scenario; U(·) is a payoff function used to calculate the quantitative return of a strategy portfolio under a specific risk scenario; argmax represents the operation of finding the parameter that maximizes the payoff function value.

[0031] The determined optimal strategy combination is used to generate clause modification suggestions in subsequent steps.

[0032] In one embodiment, the method further includes the step of acquiring business outcome data associated with multiple historical contracts in a historical contract database, and calculating an evolutionary fitness score for each of the multiple historical contracts based on the business outcome data.

[0033] The business results data include at least one of the following: project profit margin, payment cycle, and whether any legal disputes have occurred.

[0034] The evolutionary fitness score is calculated using the following formula:

[0035]

[0036] in:

[0037] F(H i ) represents the i-th historical contract H i Evolutionary fitness score; O j This represents the j-th business outcome data, such as the specific value of the project profit margin; f j (·) is a normalization function used to convert business outcome data with different dimensions into scores on a uniform scale; w j is the preset weight coefficient corresponding to the j-th business outcome data; n is the total number of business outcome data items.

[0038] The calculated evolutionary fitness score is used to adjust the simulation process during the simulation simulation step.

[0039] Preferably, the specific method for simulation and deduction using a tree structure is as follows:

[0040] First, during the review of new contracts, one or more historical contracts associated with the contract to be reviewed are identified based on the tree structure and the evolutionary distance between the contract to be reviewed and historical contracts.

[0041] Then, using the evolutionary fitness scores of the one or more associated historical contracts, the modification or combination of legal functional units of the structured graph is guided in the simulation, specifically by adjusting the probability or weight of different modifications or combinations of legal functional units in the simulation, so as to adjust the generation process of the strategy combination.

[0042] In another embodiment, the step of generating and outputting based on a combination of one or more optimal strategies specifically includes:

[0043] Based on the one or more optimal strategy combinations, an automatic contract draft that conforms to the optimal strategy combination and can be directly used by the user is generated and output.

[0044] This invention provides an AI-based method for reviewing legal contract terms, which has the following beneficial effects:

[0045] 1. This invention parses contract text into structured legal functional units and constructs a structured graph reflecting the legal logical relationships between units, thereby achieving an accurate representation of the inherent legal relationships within the contract. Compared with existing technologies that rely solely on text matching or keyword extraction, this method can identify and locate risk points at the structural level, improving the depth and accuracy of contract review.

[0046] 2. This invention introduces a simulation and deduction step based on preset business risk scenarios and game parameters. By dynamically deducing the structured graph to generate the optimal strategy combination, the contract review is transformed from static risk identification into a future-oriented, quantifiable strategy optimization process. This makes the review results no longer limited to the passive evaluation of existing clauses, but can actively generate clause combination schemes that perform better under different conditions.

[0047] 3. This invention establishes a feedback loop from historical experience to future decisions by constructing an evolutionary tree structure of historical contracts and introducing evolutionary fitness scores that are associated with real business results data. By using evolutionary fitness scores that carry business success and failure information to guide the simulation and deduction process, the generation of optimal strategies no longer depends solely on theoretical models, but is directly linked to verified historical business practices. This gives the review method data-driven self-optimization and adaptability. Attached Figure Description

[0048] Figure 1 This is a structural block diagram of a legal contract terms AI review system 100 according to an embodiment of the present invention;

[0049] Figure 2 This is a schematic diagram of the data acquisition and initialization process according to an embodiment of the present invention;

[0050] Figure 3This is a schematic diagram illustrating the contract structure parsing and vectorization representation process according to an embodiment of the present invention;

[0051] Figure 4 This is a schematic diagram illustrating the process of constructing a historical contract evolution tree structure according to an embodiment of the present invention;

[0052] Figure 5 This is a schematic diagram of the simulation and strategy optimization process combining evolutionary data according to an embodiment of the present invention;

[0053] Figure 6 This is a schematic diagram of the result generation and output process according to an embodiment of the present invention. Detailed Implementation

[0054] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0055] See attached document Figure 1 , Figure 1 This is a structural block diagram of a legal contract terms AI review system 100 according to an embodiment of the present invention.

[0056] The legal contract terms AI review system 100 may include: a data acquisition module 10, a structured parsing module 20, an evolution tree construction module 30, a simulation and deduction module 40, and a result generation module 50.

[0057] The data acquisition module 10 is used to acquire a contract text of a contract to be reviewed, game parameters input by the user, a historical contract database, and multiple preset business risk scenarios.

[0058] The contract text can be a text file, a document file, or text data converted from an image file using optical character recognition technology.

[0059] The structured parsing module 20 is connected to the data acquisition module 10.

[0060] The structured parsing module 20 is used to parse the contract text of the contract to be reviewed, extract multiple structured legal functional units, and construct a structured graph that reflects the legal logical relationship between the multiple legal functional units.

[0061] In one embodiment, the structured parsing module 20 is also used to convert the structured graph and legal functional units into a vectorized representation of the contract.

[0062] The evolution tree construction module 30 is connected to the data acquisition module 10 and the structured parsing module 20.

[0063] The evolution tree construction module 30 is used to construct a tree structure that reflects the evolutionary relationship between multiple historical contracts based on multiple historical contracts in the historical contract database.

[0064] This construction process can be based on calculating the evolutionary distance between the vectorized representations of historical contracts. The evolutionary distance is calculated using the following formula:

[0065] D evo (V i V j )=α·D content (V i V j )+β·D struct (V i V j );

[0066] in:

[0067] D evo V represents the final evolutionary distance between two historical contracts; i and V j D represents the vectorized representation of the i-th and j-th historical contracts, respectively; content It is a function used to calculate content distance, the result of which characterizes the differences between two contracts in the composition of legal functional units; D struct It is a function used to calculate structural distance, the result of which characterizes the difference between two contracts in terms of legal logical relationship structure; α and β are preset weight coefficients, and α+β=1.

[0068] The simulation and deduction module 40 is connected to the data acquisition module 10, the structured analysis module 20, and the evolution tree construction module 30.

[0069] The simulation and deduction module 40 is used to combine a tree structure, based on multiple preset business risk scenarios and user-input game parameters, to simulate and deduce the structured graph and generate one or more optimal strategy combinations.

[0070] This process can incorporate evolutionary fitness scores calculated from business outcome data associated with historical contracts.

[0071] Evolutionary fitness score is calculated using the following formula:

[0072]

[0073] in:

[0074] F(H i ) represents the i-th historical contract Hi Evolutionary fitness score; O j f represents the data of the j-th business outcome; j (·) is a normalization function used to convert business outcome data with different dimensions into scores on a uniform scale; w j is the preset weight coefficient corresponding to the j-th business outcome data; n is the total number of business outcome data items.

[0075] The optimal strategy combination is determined by the following formula:

[0076]

[0077] in:

[0078] S * S represents the optimal strategy combination; k C represents the k-th alternative strategy combination; m Let m represent the m-th business risk scenario; U(·) is a payoff function used to calculate the quantitative return of a strategy portfolio under a specific risk scenario; This indicates the search for the independent variable S that maximizes the value of the payoff function. k The operation.

[0079] The result generation module 50 is connected to the simulation and deduction module 40.

[0080] The results generation module 50 is used to generate and output suggested modifications to the terms of the contract under review based on one or more optimal strategy combinations, or to directly generate a draft contract that conforms to the optimal strategy combination.

[0081] The AI-powered legal contract terms review system 100 can be implemented on a single computing device.

[0082] The computing device includes, but is not limited to, one or more processors, a memory, a communication interface, an input / output interface, and a bus connecting the above components.

[0083] A processor is used to execute computer program instructions stored in memory.

[0084] The storage device can be random access memory, read-only memory, or solid-state drive.

[0085] The functions of the data acquisition module 10, the structured parsing module 20, the evolution tree construction module 30, the simulation and deduction module 40, and the result generation module 50 can all be implemented by the processor executing the corresponding program instructions stored in the memory.

[0086] See attached document Figure 2 , Figure 2 This is a schematic diagram of a data acquisition and initialization process according to an embodiment of the present invention.

[0087] This process is executed by the data acquisition module 10, corresponding to step S1 of the AI ​​review method for legal contract terms. Its purpose is to prepare all the necessary input data for subsequent structured analysis, evolutionary analysis and simulation.

[0088] First, the data acquisition module 10 obtains the contract text of the contract to be reviewed through a data interface.

[0089] The data interface can be a file upload control in a graphical user interface, or an application programming interface that can be called by external systems.

[0090] The obtained contract text can be in various formats, including but not limited to .docx, .pdf, or .txt.

[0091] After acquiring the text, the system performs a preprocessing process: For .pdf format files, an optical character recognition engine is called to convert them into a structured text data object, which contains the content of each text block and its coordinate information on the page; for .docx format files, its internal document object model is parsed to extract the plain text content and retain its basic structural information such as chapters and paragraphs; for all types of text, a text cleaning operation is performed, including removing unnecessary line breaks and replacing multiple consecutive whitespace characters with a single space to form a standardized plain text sequence.

[0092] Meanwhile, the data acquisition module 10 receives the game parameters input by the user through the data interface.

[0093] These game parameters are encapsulated into a data structure, such as a JSON object, for use in calibrating the calculation of the payoff function in subsequent simulation and deduction steps.

[0094] In one specific embodiment, the game parameters include: review position, which is quantified as a discrete integer value, for example, 1 represents maximizing one's own interests, 2 represents balancing the interests of both parties, and 3 represents quickly reaching a deal; relative bargaining power, which is quantified as a floating-point number in the range [-1, 1], where -1 indicates extremely weak bargaining power, 1 indicates extremely strong bargaining power, and 0 indicates that both parties are equal; and risk preference, which is quantified as a floating-point number in the range, where 0 indicates complete risk aversion and 1 indicates complete risk acceptance.

[0095] The data acquisition module 10 also needs to access a historical contract database.

[0096] A historical contract database can be a relational database or a document database, which stores a large number of historical contract records.

[0097] Each historical contract record contains at least the following fields: a unique contract identifier; the original text of the contract; a pre-computed and stored vectorized representation of the contract; and business outcome data associated with the contract.

[0098] The business results data itself is a structured object containing multiple key-value pairs, such as: {Project Profit Margin: 0.18, Payment Cycle: 92, Legal Dispute Status: false}.

[0099] Finally, the data acquisition module 10 loads multiple business risk scenarios from a pre-set configuration library.

[0100] Each business risk scenario is defined as a structured object, used to set specific simulation conditions in the simulation process.

[0101] A structured object contains at least: a scenario identifier; a scenario name, such as delayed delivery by the other party; a list of triggering conditions, which lists the types of legal functional units that the scenario will directly affect, such as [delivery clause, breach of contract clause]; and an impact model, which defines the parameters or functions for calculating expected losses or gains under the scenario.

[0102] See attached document Figure 3 , Figure 3 This is a schematic diagram of the contract structure parsing and vectorization representation process according to an embodiment of the present invention.

[0103] This process is executed by the structured parsing module 20, corresponding to step S2 of the AI ​​review method for legal contract terms. Its purpose is to convert the unstructured contract text obtained in step S1 into a numerical vector that can be processed by a machine and contains rich structural information.

[0104] After obtaining the standardized plain text sequence, the structured parsing module 20 first performs the extraction of legal functional units.

[0105] This process divides the entire contract text into individual clauses or sub-clauses.

[0106] Next, each unit is fed into a pre-trained classification model.

[0107] The classification model is a deep learning-based sequence classifier, such as the BERT model, which was pre-trained on a large-scale legal corpus and fine-tuned for the task of classifying legal clauses.

[0108] The classification model performs semantic analysis on each input clause and outputs a predefined category label.

[0109] This category label refers to legal functional units, such as payment obligation clauses, breach of contract clauses, jurisdiction clauses, confidentiality clauses, or intellectual property clauses.

[0110] The output of this step is a structured list in which each element contains the original text of the clause, the assigned legal functional unit label, and a unique clause identifier.

[0111] Next, the system constructs a structured graph based on the extracted list of legal functional units.

[0112] In the structured graph, each legal functional unit is represented as a node.

[0113] Subsequently, the system uses a relation extraction model to identify and determine the legal logical relationships between nodes, which are represented as directed edges in the graph.

[0114] This relation extraction model analyzes the text content of any two clause units to determine whether there is a pre-defined logical relationship between them, such as constraint (one clause imposes a restriction on the execution of another clause), reference (one clause explicitly references the number of another clause), supplement (one clause provides additional details or definitions for another clause), or precondition (the execution of one clause is a prerequisite for the effectiveness of another clause).

[0115] In one specific implementation, the relation extraction model can adopt a structure based on Siamese networks or dual-tower BERT.

[0116] Specifically, the text of any two clause units is input into two BERT encoders with shared weights to obtain their respective sentence vector representations.

[0117] Then, the two sentence vectors are concatenated or subtracted, and then passed through a fully connected layer and a Softmax activation function to output a probability distribution representing the specific logical relationship category (including: no relationship) between the two clauses.

[0118] By training on annotated legal text corpora, the relation extraction model can learn the ability to determine the logical relationships between clauses at the semantic level.

[0119] Ultimately, the system generates a graph data structure G = (V, E), where V is the set of all legal functional unit nodes and E is the set of directed edges representing the legal logical relationships between them.

[0120] In another embodiment, to facilitate subsequent quantitative calculations and comparisons, the system further converts the structured graph into a contractual vectorized representation.

[0121] This process is implemented using a graph embedding algorithm.

[0122] Specifically, a full graph embedding algorithm, such as Graph2Vec, can be used.

[0123] The full graph embedding algorithm takes the entire structured graph G as input, samples a large number of subgraphs rooted at different nodes in the graph, and treats these subgraphs as words in a document.

[0124] Then, a fixed-dimensional numerical vector is learned using a document embedding model (such as the PV-DM model) that can predict the occurrence of subgraphs in the graph.

[0125] The output vector is the contractual vectorization representation V. contract .

[0126] The position of this vector in its high-dimensional space simultaneously encodes the type and number of legal functional units contained in the original contract (content information) as well as the complex legal logical relationships between these units (structural information), thus providing a unified and quantifiable input for subsequent evolutionary distance calculation.

[0127] See attached document Figure 4 , Figure 4 This is a schematic diagram of the process of constructing a tree structure of historical contract evolution according to an embodiment of the present invention.

[0128] This process corresponds to step S3 of the AI ​​review method for legal contract terms. Its purpose is to construct a hierarchical tree structure based on all contracts in the historical contract database, which can represent the similarity of content and structure among these contracts.

[0129] The input to this process is the vectorized representation of each historical contract in the historical contract database.

[0130] The system first initializes an N×N distance matrix, where N is the total number of historical contracts.

[0131] Next, the system calculates the evolution distance D between any two historical contracts (taking the i-th and j-th contracts as an example). evo (V i V j ), and fill the results into the corresponding positions in the distance matrix.

[0132] This evolutionary distance is a weighted composite value that combines the two dimensions of content distance and structural distance.

[0133] Content Distance D content The calculation aims to quantify the differences between the two contracts in terms of their legal functional unit composition.

[0134] Specifically, for each contract, the system first extracts a set of all legal functional unit types contained therein.

[0135] Subsequently, the content distance can be determined by calculating the Jaccard distance between the two sets.

[0136] The Jaccard distance is calculated as 1 minus the ratio of the size of the intersection of the two sets to the size of the size of the union of the two sets.

[0137] This value is between 0 and 1. A value of 0 indicates that the two contracts contain the same type of legal functional units, while a value of 1 indicates that they are completely different.

[0138] Structural distance D struct The calculation aims to quantify the differences in the legal logical relationship structure between the two contracts.

[0139] In one specific embodiment, this distance is directly calculated by computed the contract vectorized representation V of the two contracts. i and V j The Euclidean distance between them is used to determine this.

[0140] Since the contractual vectorized representation is generated by a graph embedding algorithm, its position in high-dimensional space has encoded the topological information of the original structured graph. Therefore, the Euclidean distance between vectors can be used as an effective measure of the difference between two contractual structures.

[0141] Content Distance D content The specific formula for calculating the Jaccard distance is:

[0142]

[0143] in:

[0144] A and B are sets of legal functional unit types contained in the two contracts, respectively.

[0145] Structural distance D struct The specific formula for calculating the Euclidean distance is:

[0146]

[0147] in:

[0148] V i and V j These are two d-dimensional congruent vectorizations, v ik and v jk These are their components in the k-th dimension.

[0149] After calculating the complete evolution distance matrix, the system uses an agglomerative hierarchical clustering algorithm to generate a tree structure.

[0150] The execution process of the agglomerative hierarchical clustering algorithm is as follows: First, each historical contract is regarded as an independent initial cluster; then, the two closest clusters in the distance matrix are found and merged into a new cluster; next, the distance matrix is ​​updated according to a predefined connection criterion (e.g., Ward's minimum variance, average linkage, or complete linkage), and the distance between the newly generated cluster and all other clusters is calculated; the system repeats the merging and updating steps, reducing one cluster in each iteration, until all contracts are finally merged into a single root cluster.

[0151] The records of this series of merging operations form a tree-like hierarchical structure, namely the evolutionary tree structure (also known as a phylogenetic diagram or dendrogram), which is stored and used for subsequent simulation and deduction steps.

[0152] See attached document Figure 5 , Figure 5 This is a schematic diagram of a simulation and strategy optimization process combining evolution data according to an embodiment of the present invention.

[0153] This process corresponds to step S4 of the AI ​​review method for legal contract terms. Its core is to modify and combine the structured graph of the contract to be reviewed through an iterative optimization process in order to find the optimal strategy combination under specific business risk scenarios and user game parameters.

[0154] The inputs to this process include: a structured graph of the contract to be reviewed, an evolutionary tree structure of historical contracts, evolutionary fitness scores associated with historical contracts, pre-defined business risk scenarios, and game parameters input by the user.

[0155] First, the system uses the contract vectorization representation of the contract to be reviewed to locate one or more of its nearest leaf nodes in the evolutionary tree structure.

[0156] Historical contracts that are in the same subtree or a neighboring subtree as these leaf nodes are identified as associated historical contracts.

[0157] Subsequently, the system initiates an iterative simulation process based on a genetic algorithm.

[0158] Before the iteration begins (generation 0), the system uses the original structured graph of the contract to be examined as the first member of the initial population.

[0159] Then, by performing multiple random mutation operations on the original map, an initial population containing multiple alternative strategy combinations is generated.

[0160] The mutation operation here specifically refers to: randomly selecting a legal functional unit node in the graph and replacing it with a variant that has the same function but different expressions or parameters according to a preset clause library; or randomly selecting two nodes and adding or deleting legal logical relationship edges between them.

[0161] During the iterative process (starting from generation 1), the system executes the following cyclical steps:

[0162] Evaluation and selection: For each alternative strategy combination (i.e. each graph) in the current population, the system traverses all preset business risk scenarios and calculates a payoff function value U for it.

[0163] Payment function U(S) k |C m The calculation integrates the alternative strategy combination S k In business risk scenario C m The expected performance and the game parameters input by the user.

[0164] For example, expected performance is analyzed through S k The relevant legal functional units in C m The expected financial gains and losses generated upon triggering are quantified; while the user's risk preference parameter is used to adjust the penalty weight for expected losses.

[0165] An exemplary formula for calculating the payment function U can be:

[0166] U(S k |C m )=P(C m )·[w pos ·E gain (S k C m )-w neg ·(1+r·p)·E loss (S k C m )];

[0167] in:

[0168] P(C m ) is Business Risk Scenario C m Estimated probability of occurrence; gain and E loss These are the alternative strategy combinations S k In scenario C m Quantified values ​​of expected returns and expected losses; w pos and w neg The weighting coefficients are determined by the review stance parameters input by the user.

[0169] For example, when the position is to maximize one's own interests, w neg The value will be significantly higher than w pos r is a coefficient determined by the user's input risk preference parameter. The value of r ranges from [-1, 1] to [-1]. A larger value indicates a higher penalty for loss. p is a coefficient determined by the user's input relative bargaining power parameter. The value of p ranges from [-1, 1]. A negative value will reduce the penalty for loss, reflecting that a higher risk can be taken when bargaining power is strong.

[0170] The system selects a subset of individuals as parents based on the payoff function values ​​of all alternative strategy combinations using a roulette wheel selection method to generate the next generation population. Individuals with higher payoff function values ​​have a greater probability of being selected.

[0171] Crossover and mutation:

[0172] The selected parent graphs are cross-operated, that is, two parent graphs are randomly selected and their subgraphs (a set of legal functional unit nodes and their internal connections) are swapped to generate a new child graph.

[0173] Next, a mutation operation is performed on the newly generated offspring map.

[0174] In this step, the system is guided by the evolutionary fitness scores of associated historical contracts.

[0175] Specifically, when a legal functional unit undergoes a mutation, the system will retrieve clauses with the same functional type from related historical contracts.

[0176] Historical contracts with higher evolutionary fitness scores have a higher probability of their corresponding clause variants being selected as mutation targets.

[0177] The specific allocation method for this probability is as follows:

[0178] First, obtain the variants of the terms with the same functional type as the node to be mutated from all associated historical contracts, and collect the evolutionary fitness scores of these historical contracts respectively.

[0179] Then, these fitness scores are normalized using a Softmax function to generate a probability distribution.

[0180] When performing a mutation operation, the system performs random sampling based on this probability distribution to determine which historical clause variant to use as the replacement target.

[0181] This approach allows variants of terms with a strong track record of business success to have a greater chance of being integrated into new strategy mixes during the optimization process.

[0182] The system repeats the above cyclic steps until the preset number of iterations is reached or the optimal payoff function value no longer increases significantly over multiple generations, at which point the iteration process terminates.

[0183] Finally, the alternative strategy combination with the highest payoff function value recorded by the system across all generations is determined as the optimal strategy combination S. * .

[0184] This optimal strategy combination represents the best possible terms modification scheme that can be found after comprehensively considering historical experience, current risks, and user preferences, and is output to the next processing step.

[0185] See attached document Figure 6 , Figure 6 This is a schematic diagram of the result generation and output process according to an embodiment of the present invention.

[0186] This process corresponds to step S5 of the AI ​​review method for legal contract terms. Its purpose is to transform the optimal strategy combination determined in step S4 into a user-understandable and actionable suggestion for modifying terms or a complete draft contract.

[0187] The input to this process is the optimal strategy combination, which takes the form of a structured graph, and the original structured graph of the contract to be reviewed.

[0188] The system first performs a differential analysis operation, which identifies all structural and content differences by comparing the nodes and edges of the two graphs.

[0189] Specifically, the system compares the legal functional unit nodes in the two graphs one by one.

[0190] If a node exists in the graph of the optimal strategy combination but not in the original graph, the system generates a clause addition suggestion; conversely, if a node exists in the original graph but not in the graph of the optimal strategy combination, a clause deletion suggestion is generated.

[0191] For nodes that exist in both graphs, the system further compares their internal text or key parameters. If inconsistencies are found, a clause modification suggestion is generated.

[0192] In addition, the system compares the edges in the graph to identify differences in legal logical relationships and generates corresponding suggestions for adding or deleting relationships.

[0193] All identified discrepancies were consolidated and a report recommending amendments to the terms was generated.

[0194] The proposed amendments report is presented in a structured format, such as a list or table, where each item includes: the location of the amended clause in the original contract, the original text of the clause, the proposed amended text, and an objective description of the amendment, such as changing the payment cycle from 60 days to 30 days or adding a method for calculating liquidated damages.

[0195] In another embodiment, the system does not generate modification suggestions, but instead directly generates a complete draft contract.

[0196] In this embodiment, the system is based on a structured graph of the optimal strategy combination.

[0197] The system traverses the nodes of the graph according to a preset contractual order (e.g., definition, rights and obligations of both parties, payment, liability for breach of contract, dispute resolution).

[0198] For each legal functional unit node, the system retrieves standardized text fragments from a standard clause database that match the type and content of that node.

[0199] The Standard Terms Database is a structured data repository.

[0200] Each record represents a standardized clause text, accompanied by multiple indexed fields, including: the clause's function type (such as payment obligation clause), core parameters (such as payment cycle, interest rate), and text style (such as formal, simplified).

[0201] When the system retrieves text for a legal functional unit node in the optimal strategy combination, it uses the node's type and internal parameters as query conditions to match the most suitable standard text record in the database, thereby ensuring the consistency and accuracy of the generated contract draft in terms of content and format.

[0202] The system then assembles the retrieved text fragments according to the order and structure defined in the graph, and automatically inserts chapter numbers, titles, and cross-references. Once the entire process is complete, the system generates and outputs a complete, ready-to-use draft contract document, such as a .docx file.

Claims

1. A method for AI-based review of legal contract terms, characterized in that, Includes the following steps: S1. Obtain a contract text of the contract to be reviewed, game parameters input by the user, a historical contract database, and multiple preset business risk scenarios; S2. Analyze the contract text of the contract to be reviewed, extract multiple structured legal functional units, and construct a structured graph reflecting the legal logical relationship between the multiple legal functional units; S3. Based on multiple historical contracts in the historical contract database, construct a tree structure that reflects the evolutionary relationship between the multiple historical contracts; S4. Combining the tree structure, based on the multiple preset business risk scenarios and the game parameters input by the user, simulate and deduce the structured graph to generate one or more optimal strategy combinations; S5. Based on the one or more optimal strategy combinations, generate and output suggested modifications to the terms of the contract to be reviewed.

2. The AI ​​review method for legal contract terms according to claim 1, characterized in that, Step S2 further includes: The structured graph and the multiple structured legal functional units are converted into a contract vectorization representation, which is used to characterize and calculate the multiple historical contracts in step S3.

3. The AI ​​review method for legal contract terms according to claim 2, characterized in that, Step S3 includes: Obtain the vectorized representation of each of the multiple historical contracts; Calculate the evolution distance between the vectorized representations of any two historical contracts; The tree structure is generated using a hierarchical clustering algorithm based on the calculated evolution distance.

4. The AI ​​review method for legal contract terms according to claim 1, characterized in that, The game parameters input by the user include: The review considers at least one of the following: stance, relative bargaining power, and risk appetite.

5. The AI ​​review method for legal contract terms according to claim 1, characterized in that, Step S4 includes: Under the aforementioned multiple preset business risk scenarios, multiple alternative strategy combinations can be generated by modifying or combining the legal functional units. A payoff function value is calculated for each alternative strategy combination, and the optimal strategy combination is determined based on the payoff function value, which is used to generate the clause modification proposal in step S5.

6. The AI ​​review method for legal contract terms according to claim 1, characterized in that, The AI ​​review method for legal contract terms also includes: Obtain business outcome data associated with multiple historical contracts in the historical contract database; Based on the business outcome data, an evolutionary fitness score is calculated for each of the multiple historical contracts. The evolutionary fitness score is used to adjust the simulation in step S4.

7. The AI ​​review method for legal contract terms according to claim 6, characterized in that, The specific method for simulation and deduction based on the aforementioned tree structure is as follows: During the review of new contracts, one or more related historical contracts are identified based on the tree structure and the contract to be reviewed; The evolutionary fitness scores of one or more associated historical contracts are used to guide the modification or combination of legal functional units of the structured graph in the simulation, so as to adjust the generation process of the strategy combination.

8. The AI ​​review method for legal contract terms according to claim 3, characterized in that, The evolution distance is calculated by combining content distance and structural distance; The content distance is used to characterize the differences in the composition of legal functional units; The structural distance is used to characterize the differences in the structure of legal logical relationships.

9. The AI ​​review method for legal contract terms according to claim 6, characterized in that, The business results data include: At least one of the following: project profit margin, payment cycle, and whether legal disputes have occurred.

10. The AI ​​review method for legal contract terms according to claim 1, characterized in that, Step S5 specifically involves: Based on the one or more optimal strategy combinations, an automatic contract draft that conforms to the optimal strategy combination and can be directly used by the user is generated and output.