Contract risk identification method and system based on machine learning
Through a multimodal risk identification method based on machine learning, combined with text semantics, digital logic and legal event perception, the one-sidedness and lag problems of contract risk identification in existing technologies are solved, and more accurate and dynamic contract risk identification is achieved.
Patent Information
- Application Number
- CN202510778298.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-11
- Publication Date
- 2025-09-19
AI Technical Summary
Existing contract risk identification technologies are unable to effectively capture the logical relationship between contract terms and ignore changes in the external environment, resulting in one-sided and delayed risk identification. Traditional methods also lack identification capabilities when faced with complex legal language and clause logic.
A multimodal risk identification method based on machine learning is adopted, combined with multimodal risk information and legal event perception. By integrating text semantics, digital logic and cross-clause risk information, unified modeling and analysis are carried out to achieve dynamic risk assessment and in-depth modeling of risk transfer between clauses.
It achieves more comprehensive and real-time contract risk identification, significantly improves the accuracy of risk identification and dynamic tracking capabilities, and is able to sensitively respond to legal events and promptly revise risk assessments.
Smart Images

Figure CN120672129A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of intelligent contract management technology, and specifically refers to a contract risk identification method and system based on machine learning. Background Art
[0002] Contract risk identification based on machine learning utilizes natural language processing and machine learning technologies to identify and assess potential risks through automated analysis of contract texts, legal terms, and related background information. This aims to improve the efficiency of contract review and enhance the accuracy of contract risk identification, thereby reducing the incidence of contract risks and preventing companies from encountering unnecessary legal issues.
[0003] However, in the existing contract risk identification process, there is a technical problem that manual identification of contract risks is difficult to effectively grasp the potential risks between contract clauses, and traditional contract risk identification methods usually rely on semantic analysis of contract texts, which makes it difficult to effectively capture the logical relationship between clauses and ignores changes in the external environment of the contract, resulting in one-sided and lagging contract risk identification; there is a technical problem that it often relies on a single information source, mainly identifying potential risks through clause keyword matching or rule-based extraction, and such methods are powerless when faced with complex legal language and clause logic, and it is difficult to accurately identify potential conflicts between clauses, and it is difficult to effectively verify the logical consistency between digital clauses; there is a technical problem that traditional contract risk identification is mainly based on static analysis of clauses, and often makes judgments based on the wording of the clauses themselves. It lacks in-depth modeling of the internal correlation between contract clauses and the mutual transmission relationship of risks, and it is difficult to identify the overall risk chain reaction caused by changes in the risk of one clause, and it does not respond to changes in the external legal environment in a timely manner. Summary of the Invention
[0004] In view of the above situation, in order to overcome the defects of the existing technology, the present invention provides a contract risk identification method and system based on machine learning. In view of the technical problem that in the existing contract risk identification process, manual identification of contract risks is difficult to effectively grasp the potential risks between contract clauses, and traditional contract risk identification methods usually rely on semantic analysis of contract texts, which is difficult to effectively capture the logical relationship between clauses, and ignores changes in the external environment of the contract, resulting in one-sided and lagging contract risk identification, this solution combines multimodal risk identification and dynamic risk assessment to identify contract risks, and introduces legal event perception by fusing multimodal risk information to achieve more comprehensive and real-time contract risk identification; in view of the fact that in the existing contract risk identification process, it often relies on a single information source, mainly through clause keyword matching or rule-based extraction to identify potential risks, and such methods seem powerless when faced with complex legal language and clause logic, and it is difficult to accurately identify the potential risks between clauses. In order to solve the technical problems of conflict and difficulty in effectively verifying the logical consistency between digital clauses, this solution creatively adopts a risk identification method that integrates multimodal information to carry out multimodal risk identification, realizes the unified modeling and analysis of contract text, digital logic and cross-clause risks, and significantly improves the comprehensiveness and accuracy of contract risk identification; in order to solve the technical problems of traditional contract risk identification that are mainly based on static analysis of clauses in the existing contract risk identification process, often make judgments based on the wording of the clauses themselves, lack in-depth modeling of the internal correlation between contract clauses and the relationship between mutual risk transmission, make it difficult to identify the overall risk chain reaction caused by the risk change of one clause, and fail to respond to changes in the external legal environment in a timely manner, this solution creatively adopts a dynamic risk evolution model based on weight evolution and legal event perception to carry out dynamic risk assessment, realizes dynamic tracking of contract risk identification, in-depth modeling of risk transmission between clauses, and sensitive response and timely correction to legal events.
[0005] The technical solution adopted by the present invention is as follows: The present invention provides a contract risk identification method based on machine learning, which includes the following steps:
[0006] Step S1: Contract data preparation;
[0007] Step S2: Contract structure analysis;
[0008] Step S3: multimodal risk identification;
[0009] Step S4: dynamic risk assessment;
[0010] Step S5: Generate contract risk identification report.
[0011] Furthermore, in step S1, the contract data preparation is used to prepare the data required for contract risk identification, specifically obtaining electronic contract data from the contract management system, converting it into a text data format, performing text cleaning and text standardization to obtain contract text data; obtaining legal data and legal event data from the legal data platform, and constructing a legal knowledge graph based on the legal data.
[0012] Furthermore, in step S2, the contract structured parsing is used to parse the contract content and construct a hierarchical relationship, including the following steps:
[0013] Step S21: Document hierarchical structure parsing, specifically introducing a hierarchy-aware loss function into the LayoutXML model, constructing an improved LayoutXML model, performing document hierarchical structure parsing on the contract text data, and generating a contract document tree, where each node of the contract document tree represents an element in the contract, and each node contains hierarchical information and its corresponding text content;
[0014] Step S22: Clause boundary detection, specifically, based on the contract document tree, by constructing a long text transformer model based on conditional random fields to detect clause boundaries and perform clause classification to obtain clause text data;
[0015] Step S23: Hierarchical semantic perception, specifically, by semantically encoding the clause text data, converting each clause in the contract into a high-dimensional vector, generating a clause semantic vector, clustering the clause semantic vectors based on the similarity between the clause semantic vectors, generating clause semantic association information, and then constructing a contract clause forest based on the hierarchical information.
[0016] Furthermore, in step S3, the multimodal risk identification is used to identify potential risks in the contract. Specifically, a risk identification method that integrates multimodal information is used to perform multimodal risk identification to obtain multimodal risk identification data, including the following steps:
[0017] Step S31: Text semantic risk modeling is used to identify potential semantic risks. Specifically, legal entities are extracted from the contract clause forest to construct a clause entity relationship graph. Based on the legal knowledge graph, a mask value is assigned to each legal entity in the clause entity relationship graph to obtain an entity position mask. An improved graph neural network model is constructed by introducing an entity-aware attention mechanism into the graph neural network model to identify semantic conflicts in the clause entity relationship graph and obtain text semantic risk information.
[0018] Step S32: Digital logic risk modeling is used to verify the digital logic in the contract. Specifically, digital logic clauses are extracted from the contract clause forest and converted into mathematical expressions using a formula parser to obtain mathematical expressions of the contract clauses. Constraints are solved on the mathematical expressions of the contract clauses using a constraint solver to check whether the logical relationships between the mathematical formulas conflict and generate logic verification results. Risk assessment of the digital logic clauses is performed based on Monte Carlo simulation to calculate logic risk results. The logic verification results and logic risk results are combined to obtain digital logic risk verification information.
[0019] The risk assessment of digital logic clauses based on Monte Carlo simulation is performed, and the calculation formula for the logic risk result is:
[0020]
[0021] Where, P risk is the logical risk result, specifically the probability of a violation of the digital logic clause in the contract, SN is the number of Monte Carlo simulations, s is the Monte Carlo simulation index, and viola(·) is a verification function used to check whether the Monte Carlo simulation result violates the legality constraint of the contract clause. If it violates, the verification function takes the value of 1, otherwise it takes the value of 0. R s is the result of the s-th Monte Carlo simulation, specifically the result of the mathematical expression of the contract terms calculated from the samples generated by the Monte Carlo simulation, ε is the uncertainty penalty coefficient, and entropy(R) is the entropy value of the mathematical expression of the contract terms;
[0022] Step S33: Cross-modal risk fusion, specifically constructing a gated attention network to perform weighted fusion of the contract clause forest, textual semantic risk information, and digital logic risk verification information, and establishing cross-modal semantic associations through the attention mechanism to calculate cross-modal risk information, which includes a cross-modal risk description and a cross-modal risk score.
[0023] Step S34: Comprehensive identification of multimodal risks, specifically, performing comprehensive identification of multimodal risks through the text semantic risk modeling, the digital logic risk modeling and the cross-modal risk fusion to obtain multimodal risk identification data, wherein the multimodal risk identification data includes text semantic risk information, digital logic risk verification information and cross-modal risk information.
[0024] Furthermore, in step S4, the dynamic risk assessment is used to dynamically assess contract risk in combination with legal event data. Specifically, a dynamic risk evolution model based on weight evolution and legal event perception is used to perform dynamic risk assessment to obtain dynamic comprehensive contract risk data, including the following steps:
[0025] Step S41: Initial risk modeling, specifically extracting the cross-modal risk score of each clause from the multimodal risk identification data to obtain the clause risk score, constructing an initial contract risk matrix, and analyzing the dependencies between clauses based on the contract clause forest to construct a clause structure graph. Each node in the clause structure graph represents a clause, the node feature is the clause semantic vector, and the edges represent the dependencies between clauses.
[0026] Step S42: Internal weight evolution modeling is specifically based on the clause structure diagram, by constructing a lightweight graph convolutional neural network, and introducing a time decrement factor and a clause association inference factor to perform risk transfer effect reasoning and update the contract risk matrix. The calculation formula is:
[0027] M t =αM t-1 +(1-α)(M0+βL(M t-1 ));
[0028] Where M t is the contract risk matrix at the tth time step, t is the time step index, α is the time decrement factor, M0 is the initial contract risk matrix, M t-1 is the contract risk matrix at the t-1 time step, β is the clause association inference factor, L(M t-1 ) is the risk transfer matrix;
[0029] Step S43: Legal event perception and correction, specifically, setting the impact vector of each legal event in the legal event data based on the legal event type, constructing a sensitivity matrix, calculating the legal event correction items, and correcting the contract risk matrix to obtain a corrected clause risk score;
[0030] The construction of the sensitivity matrix specifically involves evaluating the sensitivity of each clause to the legal event through an expert scoring method, obtaining the legal event sensitivity of each clause, and constructing the sensitivity matrix;
[0031] Step S44: Dynamic total risk score, specifically, evaluating the importance of each clause through clause frequency analysis to obtain clause weights, and generating a dynamic total risk score for the contract based on the clause weights and the revised clause risk scores;
[0032] Step S45: Dynamic risk comprehensive assessment, specifically, constructing a dynamic risk evolution model based on weight evolution and legal event perception through the initial risk modeling, the internal weight evolution modeling, the legal event perception correction and the dynamic total risk score, and performing model training to obtain a dynamic risk assessment model, and performing dynamic risk comprehensive assessment through the dynamic risk assessment model to obtain dynamic comprehensive risk data of the contract.
[0033] Furthermore, in step S5, the contract risk identification report is generated, specifically by combining the multimodal risk identification data and the contract dynamic comprehensive risk data to generate a contract risk identification report and provide contract optimization suggestions.
[0034] The machine learning-based contract risk identification system provided by the present invention includes: a contract data preparation module, a contract structured analysis module, a multimodal risk identification module, a dynamic risk assessment module, and a contract risk identification report generation module;
[0035] The contract data preparation module is used to prepare contract data, obtain contract text data, legal event data and legal knowledge graph through contract data preparation, and send the contract text data to the contract structured analysis module, send the legal event data to the dynamic risk assessment module, and send the legal knowledge graph to the multimodal risk identification module;
[0036] The contract structured parsing module is used for contract structured parsing, obtains a contract clause forest through contract structured parsing, and sends the contract clause forest to the multimodal risk identification module and the dynamic risk assessment module;
[0037] The multimodal risk identification module is used for multimodal risk identification, obtains multimodal risk identification data through multimodal risk identification, and sends the multimodal risk identification data to the dynamic risk assessment module and the contract risk identification report generation module;
[0038] The dynamic risk assessment module is used for dynamic risk assessment, obtains dynamic comprehensive risk data of the contract through dynamic risk assessment, and sends the dynamic comprehensive risk data of the contract to the contract risk identification report generation module;
[0039] The contract risk identification report generation module is used to generate a contract risk identification report, and obtains a contract risk identification report through the contract risk identification report generation module.
[0040] The beneficial effects achieved by the present invention using the above scheme are as follows:
[0041] (1) In the existing contract risk identification process, manual identification of contract risks is difficult to effectively grasp the potential risks between contract clauses. Traditional contract risk identification methods usually rely on semantic analysis of contract texts, which makes it difficult to effectively capture the logical relationship between clauses and ignores changes in the external environment of the contract, resulting in one-sided and lagging contract risk identification. This solution combines multimodal risk identification and dynamic risk assessment to identify contract risks. By integrating multimodal risk information and introducing legal event perception, it achieves more comprehensive and real-time contract risk identification.
[0042] (2) In view of the technical problem that the existing contract risk identification process often relies on a single source of information and mainly identifies potential risks through clause keyword matching or rule-based extraction, and such methods are powerless when faced with complex legal language and clause logic, making it difficult to accurately identify potential conflicts between clauses and effectively verify the logical consistency between digital clauses, this solution creatively adopts a risk identification method that integrates multimodal information for multimodal risk identification, achieving unified modeling and analysis of contract text, digital logic and cross-clause risks, significantly improving the comprehensiveness and accuracy of contract risk identification;
[0043] (3) In view of the technical problems in the existing contract risk identification process, traditional contract risk identification is mainly based on static analysis of clauses, and is often judged based on the wording of the clauses themselves. It lacks in-depth modeling of the internal correlation between contract clauses and the relationship between mutual risk transmission, making it difficult to identify the overall risk chain reaction caused by the risk change of one clause, and the lack of timely response to changes in the external legal environment. This solution creatively adopts a dynamic risk evolution model based on weight evolution and legal event perception to perform dynamic risk assessment, realizing dynamic tracking of contract risk identification, in-depth modeling of risk transmission between clauses, and sensitive response and timely correction to legal events. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 A flow chart of the contract risk identification method based on machine learning provided by the present invention;
[0045] Figure 2 A schematic diagram of a contract risk identification system based on machine learning provided by the present invention;
[0046] Figure 3 Schematic diagram of the process of step S2;
[0047] Figure 4 Schematic diagram of the process of step S3;
[0048] Figure 5 Schematic diagram of the process of step S4.
[0049] The accompanying drawings are used to provide further understanding of the present invention and constitute a part of the specification. They are used to explain the present invention together with the embodiments of the present invention and do not constitute a limitation of the present invention. DETAILED DESCRIPTION
[0050] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments; based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0051] In the description of the present invention, it should be understood that terms such as "upper", "lower", "front", "back", "left", "right", "top", "bottom", "inside" and "outside" indicating directions or positional relationships are based on the directions or positional relationships shown in the accompanying drawings. They are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific direction, be constructed and operated in a specific direction. Therefore, they should not be understood as limiting the present invention.
[0052] Example 1, see Figure 1 The present invention provides a method for identifying contract risks based on machine learning, which includes the following steps:
[0053] Step S1: Contract data preparation;
[0054] Step S2: Contract structure analysis;
[0055] Step S3: multimodal risk identification;
[0056] Step S4: dynamic risk assessment;
[0057] Step S5: generating a contract risk identification report;
[0058] By performing the above operations, in the existing contract risk identification process, there is a technical problem that manual identification of contract risks is difficult to effectively grasp the potential risks between contract clauses, and traditional contract risk identification methods usually rely on semantic analysis of contract texts, which is difficult to effectively capture the logical relationship between clauses and ignores changes in the external environment of the contract, resulting in one-sided and lagging contract risk identification. This solution combines multimodal risk identification and dynamic risk assessment to identify contract risks. By integrating multimodal risk information and introducing legal event perception, it achieves more comprehensive and real-time contract risk identification.
[0059] Example 2, see Figure 1 This embodiment is based on the above embodiment. In step S1, the contract data preparation is used to prepare the data required for contract risk identification. Specifically, the electronic contract data is obtained from the contract management system, converted into a text data format, and the text is cleaned and standardized to obtain the contract text data; legal data and legal event data are obtained from the legal data platform, and a legal knowledge graph is constructed based on the legal data.
[0060] The electronic contract data includes historical contract data, currently effective contract data, pending contract data and template contract data;
[0061] The enterprise information query platform includes Qichacha and Tianyancha;
[0062] The legal data platforms include Peking University Law Treasure, Hualu.com and the National Laws and Regulations Database;
[0063] The legal events specifically refer to external legal dynamic information that affects the risks of contract terms.
[0064] Example 3, see Figure 1 and Figure 3 This embodiment is based on the above embodiment. In step S2, the contract structured parsing is used to parse the contract content and construct a hierarchical relationship, including the following steps:
[0065] Step S21: Document hierarchical structure parsing, specifically introducing a hierarchy-aware loss function into the LayoutXML model, constructing an improved LayoutXML model, performing document hierarchical structure parsing on the contract text data, and generating a contract document tree, where each node of the contract document tree represents an element in the contract, and each node contains hierarchical information and its corresponding text content;
[0066] The calculation formula of the hierarchical perception loss function is:
[0067]
[0068] Where, L hier is the hierarchical perceptual loss function, u is the first index of the clause, UN is the total number of clauses in the contract, It is the parent node indicator function, which is used to indicate whether the u-th clause has a parent node. When the u-th clause has a parent node, the indicator function takes the value of 1, otherwise it takes the value of 0. is the parent node information of the u-th clause, KL(·) is the KL divergence function, which is used to measure the difference between the hierarchical distribution predicted by the model and the true hierarchical distribution. is the hierarchical distribution of the u-th clause predicted by the model, which is used to indicate the depth of the position of the u-th clause in the contract document. is the true hierarchical distribution of the u-th clause;
[0069] Step S22: Clause boundary detection, specifically, based on the contract document tree, by constructing a long text transformer model based on conditional random fields to detect clause boundaries and perform clause classification to obtain clause text data;
[0070] Step S23: Hierarchical semantic perception, specifically, by semantically encoding the clause text data, converting each clause in the contract into a high-dimensional vector, generating a clause semantic vector, clustering the clause semantic vectors based on the similarity between the clause semantic vectors, generating clause semantic association information, and then constructing a contract clause forest based on the hierarchical information.
[0071] Example 4, see Figure 1 and Figure 4 This embodiment is based on the above embodiment. In step S3, the multimodal risk identification is used to identify potential risks in the contract. Specifically, a risk identification method that integrates multimodal information is used to perform multimodal risk identification to obtain multimodal risk identification data. The method includes the following steps:
[0072] Step S31: Text semantic risk modeling is used to identify potential semantic risks. Specifically, legal entities are extracted from the contract clause forest to construct a clause entity relationship graph. Based on the legal knowledge graph, a mask value is assigned to each legal entity in the clause entity relationship graph to obtain an entity position mask. An improved graph neural network model is constructed by introducing an entity-aware attention mechanism into the graph neural network model to identify semantic conflicts in the clause entity relationship graph and obtain text semantic risk information.
[0073] The entity-aware attention mechanism is used to introduce entity information in the legal knowledge graph and enhance the model's ability to understand legal terminology. The calculation formula is:
[0074]
[0075] Where, Attn entity is the entity-aware attention, softmax(·) is the softmax function, Q is the query vector, K is the key vector, T is the transpose operation, and M entity is the entity position mask, d K is the key vector dimension;
[0076] Step S32: Digital logic risk modeling is used to verify the digital logic in the contract. Specifically, digital logic clauses are extracted from the contract clause forest and converted into mathematical expressions using a formula parser to obtain mathematical expressions of the contract clauses. Constraints are solved on the mathematical expressions of the contract clauses using a constraint solver to check whether the logical relationships between the mathematical formulas conflict and generate logic verification results. Risk assessment of the digital logic clauses is performed based on Monte Carlo simulation to calculate logic risk results. The logic verification results and logic risk results are combined to obtain digital logic risk verification information.
[0077] The risk assessment of digital logic clauses based on Monte Carlo simulation is performed, and the calculation formula for the logic risk result is:
[0078]
[0079] Where, P risk is the logical risk result, specifically the probability of a violation of the digital logic clause in the contract, SN is the number of Monte Carlo simulations, s is the Monte Carlo simulation index, and viola(·) is a verification function used to check whether the Monte Carlo simulation result violates the legality constraint of the contract clause. If it violates, the verification function takes the value of 1, otherwise it takes the value of 0. R s is the result of the s-th Monte Carlo simulation, specifically the result of the mathematical expression of the contract terms calculated from the samples generated by the Monte Carlo simulation, ε is the uncertainty penalty coefficient, and entropy (R) is the entropy value of the mathematical expression of the contract terms, which is used to measure the uncertainty in risk assessment;
[0080] The digital logic clauses include amount clauses, term clauses, ratio clauses, quantity clauses, maximum limit clauses and minimum limit clauses;
[0081] The legality constraints of the contract terms include the amount limit, time limit and liquidated damages limit stipulated by law;
[0082] The constraint solver specifically refers to a Z3 solver;
[0083] Step S33: Cross-modal risk fusion, specifically constructing a gated attention network to perform weighted fusion of the contract clause forest, textual semantic risk information, and digital logic risk verification information, and establishing cross-modal semantic associations through the attention mechanism to calculate cross-modal risk information, which includes a cross-modal risk description and a cross-modal risk score.
[0084] Step S34: Comprehensive multimodal risk identification, specifically performing comprehensive multimodal risk identification through the textual semantic risk modeling, the digital logic risk modeling, and the cross-modal risk fusion to obtain multimodal risk identification data, wherein the multimodal risk identification data includes textual semantic risk information, digital logic risk verification information, and cross-modal risk information;
[0085] By performing the above operations, the existing contract risk identification process often relies on a single source of information, mainly identifying potential risks through clause keyword matching or rule-based extraction. However, such methods are powerless when faced with complex legal language and clause logic, making it difficult to accurately identify potential conflicts between clauses and effectively verify the logical consistency between digital clauses. This solution creatively adopts a risk identification method that integrates multimodal information for multimodal risk identification, realizing unified modeling and analysis of contract text, digital logic and cross-clause risks, significantly improving the comprehensiveness and accuracy of contract risk identification.
[0086] Example 5, see Figure 1 and Figure 5 This embodiment is based on the above embodiment. In step S4, the dynamic risk assessment is used to dynamically assess contract risk in combination with legal event data. Specifically, a dynamic risk evolution model based on weight evolution and legal event perception is used to perform dynamic risk assessment to obtain dynamic comprehensive contract risk data. The steps include:
[0087] Step S41: Initial risk modeling, specifically extracting the cross-modal risk score of each clause from the multimodal risk identification data to obtain the clause risk score, constructing an initial contract risk matrix, and analyzing the dependencies between clauses based on the contract clause forest to construct a clause structure graph. Each node in the clause structure graph represents a clause, the node feature is the clause semantic vector, and the edges represent the dependencies between clauses.
[0088] The calculation formula of the initial contract risk matrix is:
[0089]
[0090] Where M0 is the initial contract risk matrix, m1 is the risk score of the first clause, m2 is the risk score of the second clause, and m UN is the UN-th clause risk score, m u is the risk score of the u-th clause, u is the first index of the clause, and UN is the total number of clauses in the contract;
[0091] Step S42: Internal weight evolution modeling is specifically based on the clause structure diagram, by constructing a lightweight graph convolutional neural network, and introducing a time decrement factor and a clause association inference factor to perform risk transfer effect reasoning and update the contract risk matrix. The calculation formula is:
[0092] M t =αM t-1 +(1-α)(M0+βL(M t-1 ));
[0093] Where M tis the contract risk matrix at time step t, t is the time step index, α is the time decrement factor, M t-1 is the contract risk matrix at the t-1 time step, β is the clause association inference factor, which is used to control the risk transmission intensity between clauses, L(M t-1 ) is the risk transfer matrix;
[0094] The calculation formula of the time reduction factor is:
[0095]
[0096] Where γ is the attenuation coefficient, which is used to control the attenuation speed;
[0097] The calculation formula of the risk transfer matrix is:
[0098]
[0099]
[0100] Where, L1(M t-1 ) is the risk transfer result of the first clause, L2(M t-1 ) is the risk transfer result of the second clause, L UN (M t-1 ) is the risk transfer result of the UN clause, L u (M t-1 ) is the risk transfer result of the u-th clause, which is used to indicate the degree to which the u-th clause is affected by the risks of other clauses. i is the i-th node of the clause structure graph, i is the second index of the clause, the second index of the clause is not equal to the first index of the clause, v u is the u-th node of the clause structure graph, E is the edge set of the clause structure graph, w iu is the risk impact weight of the i-th clause on the u-th clause;
[0101] The calculation formula for the risk impact weight is:
[0102] w iu =min(CosineSim(x i ,x u ),1);
[0103] Where min(·) is the minimum value function used to modify the risk impact weight, CosineSim(·) is the cosine similarity measurement function, and x i is the i-th node feature of the clause structure graph, specifically the i-th clause semantic vector, x u It is the u-th node feature of the clause structure graph, specifically the u-th clause semantic vector;
[0104] The calculation formula of the clause relevance inference factor is:
[0105]
[0106] Where |E| is the number of edges in the clause structure graph;
[0107] Step S43: Legal event perception and correction, specifically, setting the impact vector of each legal event in the legal event data based on the legal event type, constructing a sensitivity matrix, calculating the legal event correction items, and correcting the contract risk matrix to obtain a corrected clause risk score;
[0108] The construction of the sensitivity matrix specifically involves evaluating the sensitivity of each clause to the legal event through an expert scoring method, obtaining the legal event sensitivity of each clause, and constructing the sensitivity matrix;
[0109] The calculation formula for calculating the legal event modifier is:
[0110]
[0111] Where, Δ t is the legal event correction term at time step t, a is the legal event index, A is the number of legal events, and w a is the legal event weight, S is the sensitivity matrix, ⊙ is the element-by-element multiplication symbol, inf a is the impact vector of the a-th legal event;
[0112] The calculation formula for modifying the contract risk matrix is:
[0113] M′ t =M t +Δ t ;
[0114] Where, M' t is the revised contract risk matrix;
[0115] Step S44: Dynamic total risk score, specifically, evaluating the importance of each clause through clause frequency analysis to obtain clause weights, and generating a dynamic total risk score for the contract based on the clause weights and the revised clause risk scores;
[0116] The importance of each clause is evaluated by the clause frequency analysis method, and the calculation formula for the clause weight is obtained as follows:
[0117]
[0118] Where, wig u is the weight of the u-th clause, fre uis the frequency of occurrence of the u-th clause in historical contracts, fre i is the frequency of occurrence of the i-th clause in historical contracts;
[0119] The calculation formula for generating the contract dynamic total risk score based on the clause weight and the revised clause risk score is:
[0120]
[0121] Where, TRisk t is the total contract dynamic risk score at time step t, m' u,t is the revised risk score of the u-th clause at the t-th time step;
[0122] Step S45: Dynamic risk comprehensive assessment, specifically, constructing a dynamic risk evolution model based on weight evolution and legal event perception through the initial risk modeling, the internal weight evolution modeling, the legal event perception correction, and the dynamic total risk score, and performing model training to obtain a dynamic risk assessment model. Dynamic risk comprehensive assessment is performed using the dynamic risk assessment model to obtain dynamic comprehensive risk data for the contract;
[0123] By performing the above operations, in order to address the technical problems in the existing contract risk identification process, such as the traditional contract risk identification mainly relies on static analysis of clauses, often making judgments based on the wording of the clauses themselves, lacking in-depth modeling of the internal correlation between contract clauses and the mutual transmission of risks, making it difficult to identify the overall risk chain reaction caused by changes in the risk of one clause, and not responding promptly to changes in the external legal environment, this solution creatively adopts a dynamic risk evolution model based on weight evolution and legal event perception to perform dynamic risk assessment, realizing dynamic tracking of contract risk identification, in-depth modeling of risk transmission between clauses, and sensitive response and timely correction to legal events.
[0124] Example 6, see Figure 1 This embodiment is based on the above embodiment. In step S5, the contract risk identification report is generated, specifically by combining the multimodal risk identification data and the contract dynamic comprehensive risk data to generate a contract risk identification report and provide contract optimization suggestions.
[0125] Example 7, see Figure 2 This embodiment is based on the above embodiment. The machine learning-based contract risk identification system provided by the present invention includes: a contract data preparation module, a contract structured analysis module, a multimodal risk identification module, a dynamic risk assessment module, and a contract risk identification report generation module;
[0126] The contract data preparation module is used to prepare contract data, obtain contract text data, legal event data and legal knowledge graph through contract data preparation, and send the contract text data to the contract structured analysis module, send the legal event data to the dynamic risk assessment module, and send the legal knowledge graph to the multimodal risk identification module;
[0127] The contract structured parsing module is used for contract structured parsing, obtains a contract clause forest through contract structured parsing, and sends the contract clause forest to the multimodal risk identification module and the dynamic risk assessment module;
[0128] The multimodal risk identification module is used for multimodal risk identification, obtains multimodal risk identification data through multimodal risk identification, and sends the multimodal risk identification data to the dynamic risk assessment module and the contract risk identification report generation module;
[0129] The dynamic risk assessment module is used for dynamic risk assessment, obtains dynamic comprehensive risk data of the contract through dynamic risk assessment, and sends the dynamic comprehensive risk data of the contract to the contract risk identification report generation module;
[0130] The contract risk identification report generation module is used to generate a contract risk identification report, and obtains a contract risk identification report through the contract risk identification report generation module.
[0131] It should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that includes a list of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus.
[0132] While the embodiments of the present invention have been shown and described, it will be apparent to those skilled in the art that various changes, modifications, substitutions, and alterations can be made to the embodiments without departing from the principles and spirit of the invention.
[0133] The present invention and its embodiments are described above. This description is not restrictive. The drawings show only one embodiment of the present invention, and the actual structure is not limited thereto. In short, if a person skilled in the art is inspired by this and, without departing from the purpose of the present invention, designs structures and embodiments similar to this technical solution without inventiveness, they shall fall within the scope of protection of the present invention.
Claims
1. A contract risk identification method based on machine learning, characterized by: The method comprises the following steps: Step S1: Contract data preparation, used to prepare the data required for contract risk identification; Step S2: Contract structured parsing, used to parse the contract content and construct hierarchical relationships, including the following steps: Step S21: Document hierarchical structure parsing; Step S22: Clause boundary detection; Step S23: Hierarchical semantic perception; Step S3: Multimodal risk identification, used to identify potential risks in the contract. Specifically, a risk identification method that integrates multimodal information is used to perform multimodal risk identification to obtain multimodal risk identification data. The steps include: Step S31: Textual semantic risk modeling, used to identify potential semantic risks; Step S32: Digital logic risk modeling, used to verify the digital logic in the contract; Step S33: Cross-modal risk fusion; Step S34: Comprehensive multimodal risk identification; Step S4: Dynamic risk assessment, which is used to dynamically assess contract risks in combination with legal event data. Specifically, a dynamic risk evolution model based on weight evolution and legal event perception is used to perform dynamic risk assessment to obtain dynamic comprehensive contract risk data. The process includes the following steps: Step S41: Initial risk modeling; Step S42: Internal weight evolution modeling; Step S43: Legal event perception correction; Step S44: Dynamic total risk scoring; Step S45: Dynamic comprehensive risk assessment. Step S5: Generate contract risk identification report.
2. The contract risk identification method based on machine learning according to claim 1, characterized in that: In step S31, the text semantic risk modeling is specifically performed by extracting legal entities from the contract clause forest to construct a clause entity relationship graph; assigning a mask value to each legal entity in the clause entity relationship graph based on the legal knowledge graph to obtain an entity position mask; and constructing an improved graph neural network model by introducing an entity-aware attention mechanism into the graph neural network model to identify semantic conflicts in the clause entity relationship graph and obtain text semantic risk information. In step S32, the digital logic risk modeling specifically involves extracting digital logic clauses from the contract clause forest and converting the digital logic clauses into mathematical expressions using a formula parser to obtain mathematical expressions of the contract clauses. The constraint solver then performs constraint solving on the mathematical expressions of the contract clauses to check whether the logical relationships between the mathematical formulas conflict, and generates a logic verification result. Conduct risk assessment on digital logic clauses based on Monte Carlo simulation and calculate the logic risk results; Combining logic verification results and logic risk results to obtain digital logic risk verification information; The risk assessment of digital logic clauses based on Monte Carlo simulation is performed, and the calculation formula for the logic risk result is: Where, P risk is the logical risk result, specifically the probability of a violation of the digital logic clause in the contract, SN is the number of Monte Carlo simulations, s is the Monte Carlo simulation index, and viola(·) is a verification function used to check whether the Monte Carlo simulation result violates the legality constraint of the contract clause. If it violates, the verification function takes the value of 1, otherwise it takes the value of 0. R s is the result of the s-th Monte Carlo simulation, specifically the result of the mathematical expression of the contract terms calculated from the samples generated by the Monte Carlo simulation, ε is the uncertainty penalty coefficient, and entropy(R) is the entropy value of the mathematical expression of the contract terms; In step S33, the cross-modal risk fusion is specifically to construct a gated attention network, perform weighted fusion on the contract clause forest, textual semantic risk information, and digital logic risk verification information, establish cross-modal semantic associations through the attention mechanism, and calculate cross-modal risk information, which includes a cross-modal risk description and a cross-modal risk score; In step S34, the multimodal risk comprehensive identification is specifically performed through the text semantic risk modeling, the digital logic risk modeling and the cross-modal risk fusion to obtain multimodal risk identification data, and the multimodal risk identification data includes text semantic risk information, digital logic risk verification information and cross-modal risk information.
3. The contract risk identification method based on machine learning according to claim 2, characterized in that: In step S41, the initial risk modeling is specifically performed by extracting the cross-modal risk score of each clause from the multimodal risk identification data to obtain the clause risk score, constructing an initial contract risk matrix, and analyzing the dependencies between clauses based on the contract clause forest to construct a clause structure graph. Each node in the clause structure graph represents a clause, the node feature is the clause semantic vector, and the edges represent the dependencies between clauses. In step S42, the internal weight evolution model is specifically based on the clause structure diagram, by constructing a lightweight graph convolutional neural network, and introducing a time decrement factor and a clause association inference factor to perform risk transfer effect reasoning and update the contract risk matrix. The calculation formula is: M t =αM t-1 +(1-α)(M0+βL(M t-1 )); Where M t is the contract risk matrix at the tth time step, t is the time step index, α is the time decrement factor, M0 is the initial contract risk matrix, M t-1 is the contract risk matrix at the t-1 time step, β is the clause association inference factor, L(M t-1 ) is the risk transfer matrix; In step S43, the legal event perception modification is specifically to set the impact vector of each legal event in the legal event data according to the legal event type, construct a sensitivity matrix, calculate the legal event modification items, modify the contract risk matrix, and obtain the modified clause risk score; The construction of the sensitivity matrix specifically involves evaluating the sensitivity of each clause to the legal event through an expert scoring method, obtaining the legal event sensitivity of each clause, and constructing the sensitivity matrix; In step S44, the dynamic total risk score is specifically obtained by evaluating the importance of each clause through clause frequency analysis to obtain clause weights, and generating a dynamic total risk score for the contract based on the clause weights and the revised clause risk scores; In step S45, the dynamic comprehensive risk assessment is specifically to construct a dynamic risk evolution model based on weight evolution and legal event perception through the initial risk modeling, the internal weight evolution modeling, the legal event perception correction and the dynamic total risk score, and perform model training to obtain a dynamic risk assessment model, and perform dynamic comprehensive risk assessment through the dynamic risk assessment model to obtain dynamic comprehensive risk data of the contract.
4. The contract risk identification method based on machine learning according to claim 3, characterized in that: In step S5, the contract risk identification report is generated, specifically by combining the multimodal risk identification data and the contract dynamic comprehensive risk data to generate a contract risk identification report and provide contract optimization suggestions.
5. The contract risk identification method based on machine learning according to claim 4 is characterized in that: In step S21, the document hierarchical structure parsing is specifically to introduce a hierarchy-aware loss function into the LayoutXML model, construct an improved LayoutXML model, perform document hierarchical structure parsing on the contract text data, and generate a contract document tree, wherein each node of the contract document tree represents an element in the contract, and each node contains hierarchical information and its corresponding text content; In step S22, the clause boundary detection is specifically performed based on the contract document tree by constructing a long text transformer model enhanced by conditional random fields to detect clause boundaries and perform clause classification to obtain clause text data; In step S23, the hierarchical semantic perception is specifically performed by semantically encoding the clause text data, converting each clause in the contract into a high-dimensional vector, generating a clause semantic vector, clustering the clause semantic vectors based on the similarity between the clause semantic vectors, generating clause semantic association information, and then constructing a contract clause forest in combination with the hierarchical information.
6. The contract risk identification method based on machine learning according to claim 5, characterized in that: In step S1, the contract data preparation specifically involves obtaining electronic contract data from the contract management system, converting it into a text data format, performing text cleaning and text standardization to obtain contract text data; obtaining legal data and legal event data from the legal data platform, and constructing a legal knowledge graph based on the legal data.
7. A machine learning-based contract risk identification system, configured to implement the machine learning-based contract risk identification method according to any one of claims 1 to 6, characterized in that: include: Contract data preparation module, contract structured analysis module, multimodal risk identification module, dynamic risk assessment module and contract risk identification report generation module.
8. The machine learning-based contract risk identification system according to claim 7, characterized in that: The contract data preparation module is used to prepare contract data, obtain contract text data, legal event data and legal knowledge graph through contract data preparation, and send the contract text data to the contract structured analysis module, send the legal event data to the dynamic risk assessment module, and send the legal knowledge graph to the multimodal risk identification module; The contract structured parsing module is used for contract structured parsing, obtains a contract clause forest through contract structured parsing, and sends the contract clause forest to the multimodal risk identification module and the dynamic risk assessment module; The multimodal risk identification module is used for multimodal risk identification, obtains multimodal risk identification data through multimodal risk identification, and sends the multimodal risk identification data to the dynamic risk assessment module and the contract risk identification report generation module; The dynamic risk assessment module is used for dynamic risk assessment, obtains dynamic comprehensive risk data of the contract through dynamic risk assessment, and sends the dynamic comprehensive risk data of the contract to the contract risk identification report generation module; The contract risk identification report generation module is used to generate a contract risk identification report, and obtains a contract risk identification report through the contract risk identification report generation module.