Contract term risk control value analysis method and device, equipment and medium
By performing text recognition and constructing a clause association graph from contract images, and combining a cross-modal attention mechanism for multi-dimensional risk prediction, the objectivity and accuracy issues of contract clause risk assessment in existing technologies are resolved, and precise analysis of risk control values is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA MERCHANTS FINANCIAL LEASING CO LTD
- Filing Date
- 2025-12-11
- Publication Date
- 2026-05-01
AI Technical Summary
Existing risk assessment methods for contract terms lack objectivity and accuracy, failing to meet the needs of enterprises for refined risk management. Manual review is inefficient, and the judgments of different professionals vary.
By performing text recognition on contract images, extracting key clause sets, constructing clause association graphs, and using cross-modal attention mechanisms to fuse graph features and text features, multi-dimensional dynamic risk prediction is performed, and risk control values are calculated.
It improves the accuracy and efficiency of risk control value analysis for contract terms, provides precise risk quantification indicators, and supports enterprises in refined risk management.
Smart Images

Figure CN121963233A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data analysis technology, and in particular to a method, apparatus, equipment and medium for analyzing risk control values of contract terms. Background Technology
[0002] In today's complex and ever-changing business environment, contracts, as a crucial vehicle for economic activities, are widely used across various sectors, and their number is increasing daily. The completeness and accuracy of contract terms directly affect whether the rights and interests of both parties can be effectively protected. However, due to the numerous contents involved in contract terms, the complexity of legal provisions, and the diversity of transaction scenarios, contract term risks have become an issue that cannot be ignored. Currently, the control of contractual risk primarily relies on legal professionals to assess risks based on their expertise, experience, and the needs of the contracting parties, in conjunction with applicable laws and regulations. This approach has several limitations. Firstly, manual review is inefficient and cannot meet the demand for rapid review of a large volume of contracts. Secondly, due to subjective factors, different professionals may have differing risk assessments, making it difficult to guarantee the accuracy and consistency of risk evaluation. Furthermore, existing contract risk assessment methods are insufficient in quantifying contractual risk control values, failing to provide both parties with precise and scientific risk quantification indicators, and thus failing to meet the requirements of refined risk management for enterprises. Therefore, there is an urgent need for a new method for analyzing contractual risk control values to improve the accuracy, efficiency, and objectivity of such analysis. Summary of the Invention
[0003] This invention provides a method, apparatus, computer equipment, and medium for analyzing the risk control value of contract terms, in order to solve the problems of lack of objectivity and inaccurate analysis in existing contract risk assessment methods in the quantitative analysis of the risk control value of contract terms.
[0004] Firstly, a method for analyzing the risk control value of contract terms is provided, including: Text recognition is performed on the pre-acquired contract image to obtain the contract text. Key clauses in the contract text are identified based on fine-grained semantic role labeling to obtain a set of key clauses. Based on dynamic evolution, a relational graph between clauses in the set of key clauses is constructed to obtain the clause relational graph. Extract the graph embedding vector of the clause association graph, and extract the text semantic embedding vector of the key clause set; The graph features and text features are fused using a cross-modal attention mechanism to obtain a fused feature vector; Multidimensional risk dynamic prediction is performed based on the fused feature vector to obtain multidimensional risk prediction results, and risk control values are calculated based on the multidimensional risk prediction results.
[0005] Secondly, a risk control value analysis device for contract terms is provided, including: The clause recognition module is used to perform text recognition on the pre-acquired contract image to obtain the contract text, and to identify key clauses in the contract text based on fine-grained semantic role labeling to obtain a set of key clauses; The graph construction module is used to construct a relational graph between clauses in the set of key clauses based on dynamic evolution, thereby obtaining a clause relational graph. The vector extraction module is used to extract the graph embedding vector of the clause association graph and the text semantic embedding vector of the key clause set. The feature fusion module is used to fuse the graph features and text features using a cross-modal attention mechanism to obtain a fused feature vector; The risk calculation module is used to perform multidimensional risk dynamic prediction based on the fused feature vector, obtain multidimensional risk prediction results, and calculate risk control values based on the multidimensional risk prediction results.
[0006] Thirdly, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the aforementioned contractual clause risk control value analysis method.
[0007] Fourthly, a computer-readable storage medium is provided, which stores a computer program that, when executed by a processor, implements the steps of the aforementioned contractual clause risk control value analysis method.
[0008] The scheme implemented by the aforementioned contract clause risk control value analysis method, apparatus, computer equipment, and storage medium can obtain contract text by performing text recognition on a pre-acquired contract image; identify key clauses in the contract text based on fine-grained semantic role labeling to obtain a set of key clauses; construct a relational graph between clauses in the set of key clauses based on dynamic evolution to obtain a clause relational graph; extract the graph embedding vector of the clause relational graph; extract the text semantic embedding vector of the set of key clauses; fuse the graph features and text features using a cross-modal attention mechanism to obtain a fused feature vector; perform multi-dimensional risk dynamic prediction based on the fused feature vector to obtain a multi-dimensional risk prediction result; and calculate the risk control value based on the multi-dimensional risk prediction result. This improves the accuracy of risk control value analysis. Attached Figure Description
[0009] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0010] Figure 1 This is a schematic diagram of an application environment for the contract clause risk control value analysis method in one embodiment of the present invention; Figure 2 This is a flowchart illustrating a method for analyzing risk control values of contract terms in one embodiment of the present invention; Figure 3 This is a schematic diagram of a contract clause risk control value analysis device according to an embodiment of the present invention; Figure 4 This is a schematic diagram of the structure of a computer device according to an embodiment of the present invention; Figure 5 This is another structural schematic diagram of a computer device according to one embodiment of the present invention. Detailed Implementation
[0011] The technical solutions of 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, not all, of the embodiments of the present invention. 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.
[0012] The contract clause risk control value analysis method provided in this invention can be applied to, for example... Figure 1In this application environment, the client communicates with the server via a network. The server can use the client to perform text recognition on a pre-acquired contract image to obtain the contract text. Based on fine-grained semantic role labeling, it identifies key clauses in the contract text to obtain a set of key clauses. Based on dynamic evolution, it constructs a relational graph between the clauses in the set of key clauses to obtain a clause relational graph. It extracts the graph embedding vector of the clause relational graph and the text semantic embedding vector of the set of key clauses. It uses a cross-modal attention mechanism to fuse the graph features and text features to obtain a fused feature vector. Based on the fused feature vector, it performs multi-dimensional risk dynamic prediction to obtain a multi-dimensional risk prediction result. Based on the multi-dimensional risk prediction result, it calculates the risk control value. This improves the accuracy of risk control value analysis. The client can be, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices. The server can be implemented using a standalone server or a server cluster consisting of multiple servers. The following detailed description of the invention is provided through specific embodiments.
[0013] Please see Figure 2 As shown, Figure 2 A flowchart illustrating the contract clause risk control value analysis method provided in this embodiment of the invention includes the following steps: S1. Perform text recognition on the pre-acquired contract image to obtain the contract text, and identify key clauses in the contract text based on fine-grained semantic role labeling to obtain a set of key clauses.
[0014] In this embodiment of the invention, the pre-acquired contract image may be a contract image taken and uploaded by the user.
[0015] In this embodiment of the invention, the step of performing text recognition on a pre-acquired contract image to obtain contract text includes: The clarity of the contract image is assessed to obtain a clarity coefficient. Determine whether the sharpness coefficient is greater than a preset sharpness threshold; If the clarity coefficient is less than or equal to the clarity threshold, the user is prompted to re-upload the contract image. After the contract image is re-acquired, the process returns to the step of performing clarity recognition on the contract image to obtain the clarity coefficient. If the sharpness coefficient is greater than the sharpness threshold, then visual semantic extraction is performed on the contract image to obtain visual semantic features; Perform semantic segmentation on the contract image to obtain a panel structure diagram; The contract text is obtained by performing mixed text recognition on the contract image based on the visual semantic features and the board structure diagram.
[0016] In detail, the visual semantic extraction of the contract image to obtain visual semantic features is accomplished using a deep learning model. Taking a CNN-based model as an example, the contract image first needs to be preprocessed, including adjusting the image size and normalizing it to meet the model's input requirements. Then, the preprocessed image is input into the CNN model. The CNN model has multi-layer convolutional and pooling structures, which can automatically extract image features. In this process, the model learns the visual features of the text, such as font style and character shape. Finally, feature vectors are extracted from specific layers of the model; these feature vectors represent the visual semantic features of the image.
[0017] In detail, the process of performing semantic segmentation on the contract image to obtain a structural map is implemented using a semantic segmentation network, with U-Net being a commonly used choice. During the training phase, a large dataset of labeled contract images is required. These labels clearly define the categories of different regions in the images, such as the title area and the body text area. These images are then input into the U-Net network for training, and the network learns how to classify each pixel in the image into different region categories. In practical applications, the contract image to be processed is input into the trained network, and the network outputs the classification result for each pixel.
[0018] In detail, the hybrid text recognition of the contract image based on the visual semantic features and the layout structure diagram involves dividing the contract image into different regions based on the layout structure diagram. For each region, an appropriate OCR engine is selected for processing according to its type and visual semantic features. For example, for table regions, a specialized OCR algorithm for tables can be used to better recognize the row and column structure and cell content. Simultaneously, the OCR recognition results are corrected and optimized using visual semantic features. Finally, the recognition results from each region are integrated and formatted to form the complete contract text.
[0019] In this embodiment of the invention, the step of performing sharpness recognition on the contract image to obtain a sharpness coefficient includes: The contract image is color-converted to obtain a grayscale image of the contract; The contract grayscale image is subjected to noise suppression processing based on an adaptive bilateral filter to obtain a preprocessed contract image. The horizontal and vertical gradient magnitudes of the preprocessed contract image are calculated using the Sobel operator to obtain the gradient magnitude matrix; The Laplacian variance of the preprocessed contract image is calculated based on the Laplacian response; The high-frequency energy ratio of the preprocessed contract image is calculated based on Fourier transform; The gradient magnitude matrix, the Laplacian variance, and the high-frequency energy ratio are fused using a region-weighted fusion method to obtain a preliminary sharpness score. The initial sharpness score is normalized to obtain the sharpness coefficient.
[0020] In detail, the color conversion of the contract image to obtain a grayscale contract image is performed by converting the RGB three-channel contract image into a single-channel grayscale image using a weighted average method, thereby eliminating color interference, preserving text edge features, and reducing subsequent computational complexity.
[0021] In detail, the noise suppression processing of the contract grayscale image based on the adaptive bilateral filter is to process the grayscale image using an adaptive bilateral filter, dynamically adjusting the spatial domain parameters and color domain parameters, so as to completely preserve the text stroke outline while eliminating scanning noise and moiré patterns, and significantly improve the signal-to-noise ratio of the text region.
[0022] In detail, the calculation of the horizontal and vertical gradient magnitudes of the preprocessed contract image using the Sobel operator to obtain the gradient magnitude matrix involves applying a 3×3 convolution kernel to perform differential operations in the horizontal and vertical directions respectively, and quantifying the sharpness of the text edges by calculating the gradient magnitude matrix.
[0023] In detail, the calculation of the Laplacian variance of the preprocessed contract image based on the Laplacian response is performed by convolution operation using a second-order differential operator (3×3 kernel). By calculating the variance of the absolute value of the response matrix, the richness of the high-frequency components of the image is evaluated. The larger the variance value, the clearer the text edges.
[0024] In detail, the high-frequency energy comparison image of the preprocessed contract image is calculated based on Fourier transform, and a two-dimensional Fourier transform is performed on the image and the spectrum is centered. A ring mask is constructed to separate the high-frequency region (outside the center 40% radius). The ratio of high-frequency energy to full-spectrum energy is calculated to effectively detect frequency domain features such as defocus blur and motion blur.
[0025] In detail, the region-weighted fusion of the gradient magnitude matrix, the Laplacian variance, and the high-frequency energy ratio is performed by combining the text region locations detected by the MSER algorithm with weighted calculations of the gradient magnitude matrix (taking the average of the text region), the Laplacian variance, and the high-frequency energy ratio (weight coefficients are 0.5 / 0.3 / 0.2 respectively), focusing on strengthening the contribution of the text region and avoiding interference from non-critical regions.
[0026] In this embodiment of the invention, the identification of key clauses in the contract text based on fine-grained semantic role labeling involves using a domain-pre-trained language model (such as Legal-BERT) to perform deep semantic parsing of the contract text. Sequence labeling technology is used to identify core semantic roles in each clause, including legal subjects (e.g., "Party A / Party B"), legal actions (e.g., "payment / compensation"), triggering conditions (e.g., "delayed delivery > 30 days"), quantitative indicators (e.g., "10% of contract amount"), and time constraints (e.g., "within 15 working days after signing"). Then, based on a predefined key clause type library (e.g., breach of contract liability, confidentiality clauses, etc.), text fragments containing specific semantic role combinations (e.g., simultaneously containing "compensation" action and "penalty") and meeting the minimum element completeness threshold (e.g., must contain subject + action + object) are matched. Finally, a structured set of key clauses is output.
[0027] S2. Construct a relational graph between clauses in the set of key clauses based on dynamic evolution to obtain the clause relational graph.
[0028] In this embodiment of the invention, the step of constructing a relational graph between clauses in the key clause set based on dynamic evolution to obtain the clause relational graph includes: Semantic role labeling is performed on the key clauses in the set of key clauses to obtain the role labeling results; Construct a standardized clause semantic unit data structure based on the annotation results; Based on the standardized clause semantic unit data structure, the key clause set is processed in a structured manner to obtain a structured clause unit set; A dynamic relationship rule base is constructed based on a pre-defined domain knowledge rule base; Based on logical dependency analysis and compliance relationship mapping, an initial set of relationship triples is constructed according to the set of structured clause units and the dynamic relationship rule base; Based on the amount of risk data acquired in real time, the initial set of relation triples is dynamically weighted to obtain a set of dynamically weighted relation triples. By enhancing the spatiotemporal dimension of the dynamic weighted relation triplet set through time path modeling, a clause association graph is obtained.
[0029] In detail, the semantic role labeling of key clauses in the key clause set is performed using a domain-adaptive BERT model (such as Legal-BERT) for fine-grained semantic parsing. The model is fine-tuned on the contract corpus to identify semantic roles such as legal subjects (e.g., "Party A"), legal acts (e.g., "compensation"), quantitative indicators (e.g., "10%)", and time conditions (e.g., "within 30 days") in the clauses. The label sequence is optimized through a CRF layer to output structured labeling results.
[0030] In detail, the construction of a standardized clause semantic unit data structure based on the annotation results is achieved by designing a Schema-Guided mapper to convert unstructured tags into a unified data model. For example, "delayed delivery > 15 days" is parsed as {"operator":">", "value":15, "unit":"days"}.
[0031] In detail, the structured processing of the key clause set based on the standardized clause semantic unit data structure involves storing each semantic unit as a node in a graph database, creating an inverted index to accelerate clause type retrieval (such as all "liability for breach of contract" clauses), and attaching a text embedding vector.
[0032] In detail, the construction of a dynamic relationship rule base based on a preset domain knowledge rule base refers to parsing the rule syntax in the domain knowledge rule base (e.g., establishing a "trigger" relationship A→B when clause A contains "compensation" and clause B contains "quality assurance"). The Drools rule engine is then used to implement dynamic management and build the rule base.
[0033] In detail, the initial set of relation triples constructed based on the logical dependency analysis and compliance relationship mapping according to the set of structured clause units and the dynamic relationship rule base is achieved by identifying conditional clauses (such as "if...then..." to establish triggering relationships) through dependency syntax trees, matching the chain of obligations in legal provisions (such as "confidentiality obligation" must be associated with "liability for breach of contract"), and checking contradictory statements (such as "force majeure exemption" and "unconditional compensation") based on description logic (DL).
[0034] In detail, the dynamic weight allocation of the initial relation triple set based on the amount of risk data acquired in real time is achieved by responding to external events in real time (such as automatically increasing the weight of relevant clauses when receiving a message that "the dispute rate of similar contracts has increased by 20%").
[0035] In detail, the spatiotemporal dimension enhancement of the dynamic weighted relation triplet set through time path modeling is achieved by parsing the time expression in the terms (such as "within 15 days after signing") and constructing a time constraint network (TimelineGraph) to connect the term nodes to virtual time nodes.
[0036] In this embodiment of the invention, the step of performing semantic role labeling on the key clauses in the key clause set to obtain the role labeling results includes: The key clauses are processed to remove redundant symbols, resulting in the de-redundant clauses. The redundant removal clauses are segmented based on a preset neighborhood segmenter to obtain the segmentation results; Each word in the word segmentation results is tagged with its part of speech to obtain the part-of-speech tagging results; Based on the part-of-speech tagging results, the key clauses are subjected to syntactic analysis to obtain the analysis results; Based on the part-of-speech tagging results and the analysis results, the semantic roles in the redundancy removal clauses are identified to obtain the identification results; Based on the identification results, semantic role labeling is performed on the redundancy removal clauses to obtain role labeling results.
[0037] In detail, the process of removing redundant symbols from the key clauses involves removing redundant information such as headers and footers, watermarks, numbering (e.g., "Article X"), and HTML tags from the clauses.
[0038] In detail, the word segmentation of the de-redundancy clause based on the preset neighborhood word segmenter is based on a legal domain dictionary (containing terms such as "force majeure" and "liability for breach of contract"), combined with contextual neighborhood information.
[0039] In detail, the part-of-speech tagging of each word in the word segmentation result refers to tagging the words in the word segmentation result with nouns, verbs, time words, etc.
[0040] In detail, the syntactic analysis of the key clauses based on the part-of-speech tagging results refers to parsing the grammatical structure of the sentence and identifying the dependency relationships between words, such as "Party A" (subject) → "payment" (core predicate) and "payment for goods" (object) → "payment".
[0041] In detail, identifying the semantic roles in the deredundancy clauses based on the part-of-speech tagging results and the analysis results means identifying the role of each word in a semantic event based on part-of-speech and syntactic information.
[0042] S3. Extract the graph embedding vector of the clause association graph and extract the text semantic embedding vector of the key clause set.
[0043] In this embodiment of the invention, extracting the graph embedding vector of the clause association graph includes: The aforementioned clause association graph is abstracted into a graph structure with spatiotemporal attributes, resulting in a spatiotemporally enhanced graph structure; A node feature matrix is constructed based on the spatiotemporal augmented graph structure using a pre-trained dynamic graph convolutional network; The node feature matrix is enhanced based on a multi-head attention mechanism to obtain a context-aware node embedding. Based on hierarchical graph pooling, a full graph embedding is generated according to the context-aware node embedding; Attention pooling is performed on the full graph embedding to obtain the graph embedding vector.
[0044] In detail, the abstraction of the clause association graph into a graph structure with spatiotemporal attributes involves abstracting the dynamic clause association graph into a mathematical graph structure. Nodes represent key clauses (such as "penalty clauses"), and edges store relationship types and strengths (such as a "trigger" relationship with a weight of 0.8). Dynamic attributes are injected through a spatiotemporal encoder. The time dimension uses Transformer sine position encoding to record the clause revision timestamps; the spatial dimension generates an 8-dimensional Geohash geocode based on the contract signing location. The final output is a spatiotemporally enhanced graph with 192 initial features.
[0045] In detail, the node feature matrix is constructed using a pre-trained dynamic graph convolutional network based on the spatiotemporal augmented graph structure. This is achieved by dynamically updating the node representation through a gating mechanism. The node features include word vectors and spatiotemporal attribute vectors of the clause text, while the edge features include association types (such as citations and revisions) and spatiotemporal weights. The information of adjacent nodes is aggregated through multi-layer graph convolution, and finally, the output features of all nodes are arranged in order to form a node feature matrix.
[0046] In detail, the generation of full graph embedding based on hierarchical graph pooling and context-aware node embedding involves learning node importance scores through a self-attention mechanism, selecting the node with the highest score as a "super node," merging the features of its neighboring nodes, and aggregating the node embeddings of the last layer into a full graph embedding through global pooling (such as summation or averaging).
[0047] In detail, attention pooling refers to calculating the importance weight of each dimension to the full graph representation through an attention mechanism and then weighting and aggregating them.
[0048] S4. The graph features and text features are fused using a cross-modal attention mechanism to obtain a fused feature vector.
[0049] In this embodiment of the invention, the step of fusing the graph features and text features using a cross-modal attention mechanism to obtain a fused feature vector includes: The graph features and the text features are dimensionally aligned to obtain aligned text features and aligned graph features. Calculate the cross-modal attention between the aligned text features and the aligned graph features to obtain the attention output; Based on residual connections, the aligned text features and the aligned graph features are fused according to the attention output to obtain preliminary fused features; The preliminary fused features are subjected to layer normalization and pre-feedback enhancement processing to obtain the fused feature vector.
[0050] In detail, the dimensional alignment of the graph features and the text features is achieved by processing the graph embedding vector (such as the 256-dimensional vector output by GNN) and the text embedding vector (such as the 768-dimensional vector output by BERT) separately through two independent fully connected layers. The projection matrix is then used to force the different modal features to be mapped to a unified dimensional space (512 dimensions), thereby eliminating dimensional differences.
[0051] In detail, the calculation of cross-modal attention of the aligned text features and the aligned graph features to obtain attention output involves calculating the text attention of the aligned text features with respect to the aligned graph features, and calculating the graph attention of the aligned graph features with respect to the aligned text features.
[0052] In detail, the fusion of the aligned text features and the aligned graph features based on the residual connection according to the attention output involves back-superimposing the text attention in the attention output into the graph features, and unidirectionally superimposing the graph attention into the text features to obtain bimodal enhanced features, and then concatenating the bimodal enhanced features into a 1024-dimensional vector.
[0053] In this embodiment of the invention, the layer normalization and forward feedback enhancement processing of the preliminary fused features refers to calculating the mean and variance of the preliminary fused features along the feature dimension, performing standardization processing based on the calculated mean and variance, using two fully connected layers activated by GeLU to expand the dimension of the standardization processing result to 2048 and then compress it back to 512 dimensions to form an information bottleneck to extract core features, and finally outputting a 512-dimensional fused vector.
[0054] S5. Perform multidimensional risk dynamic prediction based on the fused feature vector to obtain multidimensional risk prediction results, and calculate the risk control value based on the multidimensional risk prediction results.
[0055] In this embodiment of the invention, the multidimensional risk dynamic prediction based on the fused feature vector to obtain the multidimensional risk prediction result is achieved by inputting the fused feature vector into five parallel risk prediction channels (corresponding to legal, financial, performance, reputational, and operational risk dimensions, respectively). Each channel analyzes the dynamic evolution of the feature vector through a temporal LSTM network (Long Short-Term Memory network). Then, external risk factors (such as regulatory policy change signals weighted by attention gating) are injected in real time to calculate the risk value of each dimension. Next, the chain effect between dimensions is quantified through a risk coupling matrix (such as the correlation coefficient between financial risk and performance risk). Finally, a risk probability distribution curve for the next 90 days is generated based on Monte Carlo simulation, and a five-dimensional risk radar chart with confidence intervals and a sensitivity ranking of key terms are output.
[0056] In this embodiment of the invention, the calculation of the risk control value based on the multidimensional risk prediction results can be achieved by weighting and summing the risk prediction results of the five dimensions with the same weight (e.g., 0.2).
[0057] As can be seen, the above scheme first preprocesses and recognizes the text of the contract image. First, it calculates the sharpness coefficient through color conversion and adaptive bilateral filtering. Only qualified images undergo CNN-based visual semantic extraction and U-Net panel semantic segmentation. An OCR engine is then selected based on regional characteristics to complete mixed text recognition. Next, the Legal-BERT model is used to perform fine-grained semantic role labeling on the contract text, matching it against a predefined clause type library to obtain a set of key clauses. Second, a key clause association graph is constructed. Semantic roles are parsed using a domain-adaptive BERT model, a standardized data structure is constructed, and clauses are processed in a structured manner. Initial relation triples are generated based on a domain knowledge rule base, and weights are dynamically allocated using real-time risk data. Temporal path modeling enhances the spatiotemporal dimension, forming a clause association graph. Next, the graph and text semantic embedding vectors are extracted. The graph is abstracted into a spatiotemporally enhanced graph structure, and dynamic graph convolutional networks and multi-head attention mechanisms are used to generate graph embedding vectors, while simultaneously extracting the text semantic embedding vectors of the key clauses. Finally, cross-modal features are fused. By aligning the fully connected layer with the geographic graph and textual feature dimensions, a cross-modal attention mechanism is used to calculate bidirectional attention. This is combined with residual connections to fuse features, which are then normalized and enhanced with forward feedback to obtain a fused feature vector. Finally, multi-dimensional dynamic risk prediction is performed. The fused features are input into a parallel LSTM risk prediction channel, external risk factors are injected, and cascading effects are analyzed using a risk coupling matrix. A risk probability distribution is generated based on Monte Carlo simulation, and a weighted risk control value is calculated. The output includes a five-dimensional risk radar chart and a ranking of clause sensitivity.
[0058] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0059] In one embodiment, a contract terms risk control value analysis device is provided, which corresponds one-to-one with the contract terms risk control value analysis method in the above embodiments. For example... Figure 3 As shown, the contract clause risk control value analysis device includes a clause identification module 101, a graph construction module 102, a vector extraction module 103, a feature fusion module 104, and a risk calculation module 105. Detailed descriptions of each functional module are as follows: The clause recognition module 101 is used to perform text recognition on the pre-acquired contract image to obtain the contract text, and to identify key clauses in the contract text based on fine-grained semantic role labeling to obtain a set of key clauses. The graph construction module 102 is used to construct a relational graph between clauses in the set of key clauses based on dynamic evolution, thereby obtaining a clause relational graph. The vector extraction module 103 is used to extract the graph embedding vector of the clause association graph and the text semantic embedding vector of the key clause set. Feature fusion module 104 is used to fuse the graph features and text features using a cross-modal attention mechanism to obtain a fused feature vector; The risk calculation module 105 is used to perform multi-dimensional risk dynamic prediction based on the fused feature vector, obtain multi-dimensional risk prediction results, and calculate risk control values based on the multi-dimensional risk prediction results.
[0060] In one embodiment, the clause recognition module 101, when performing text recognition on the pre-acquired contract image to obtain the contract text, is specifically used for: The clarity of the contract image is assessed to obtain a clarity coefficient. Determine whether the sharpness coefficient is greater than a preset sharpness threshold; If the clarity coefficient is less than or equal to the clarity threshold, the user is prompted to re-upload the contract image. After the contract image is re-acquired, the process returns to the step of performing clarity recognition on the contract image to obtain the clarity coefficient. If the sharpness coefficient is greater than the sharpness threshold, then visual semantic extraction is performed on the contract image to obtain visual semantic features; Perform semantic segmentation on the contract image to obtain a panel structure diagram; The contract text is obtained by performing mixed text recognition on the contract image based on the visual semantic features and the board structure diagram.
[0061] In one embodiment, the clause recognition module 101, when performing the clarity recognition of the contract image to obtain a clarity coefficient, is specifically used for: The contract image is color-converted to obtain a grayscale image of the contract; The contract grayscale image is subjected to noise suppression processing based on an adaptive bilateral filter to obtain a preprocessed contract image. The horizontal and vertical gradient magnitudes of the preprocessed contract image are calculated using the Sobel operator to obtain the gradient magnitude matrix; The Laplacian variance of the preprocessed contract image is calculated based on the Laplacian response; The high-frequency energy ratio of the preprocessed contract image is calculated based on Fourier transform; The gradient magnitude matrix, the Laplacian variance, and the high-frequency energy ratio are fused using a region-weighted fusion method to obtain a preliminary sharpness score. The initial sharpness score is normalized to obtain the sharpness coefficient.
[0062] In one embodiment, the graph construction module 102, when performing the dynamic evolution-based construction of the association graph between clauses in the key clause set to obtain the clause association graph, is specifically used for: Semantic role labeling is performed on the key clauses in the set of key clauses to obtain the role labeling results; Construct a standardized clause semantic unit data structure based on the annotation results; Based on the standardized clause semantic unit data structure, the key clause set is processed in a structured manner to obtain a structured clause unit set; A dynamic relationship rule base is constructed based on a pre-defined domain knowledge rule base; Based on logical dependency analysis and compliance relationship mapping, an initial set of relationship triples is constructed according to the set of structured clause units and the dynamic relationship rule base; Based on the amount of risk data acquired in real time, the initial set of relation triples is dynamically weighted to obtain a set of dynamically weighted relation triples. By enhancing the spatiotemporal dimension of the dynamic weighted relation triplet set through time path modeling, a clause association graph is obtained.
[0063] In one embodiment, when the graph construction module 102 performs semantic role labeling on the key terms in the key term set to obtain the role labeling results, it is specifically used for: The key clauses are processed to remove redundant symbols, resulting in the de-redundant clauses. The redundant removal clauses are segmented based on a preset neighborhood segmenter to obtain the segmentation results; Each word in the word segmentation results is tagged with its part of speech to obtain the part-of-speech tagging results; Based on the part-of-speech tagging results, the key clauses are subjected to syntactic analysis to obtain the analysis results; Based on the part-of-speech tagging results and the analysis results, the semantic roles in the redundancy removal clauses are identified to obtain the identification results; Based on the identification results, semantic role labeling is performed on the redundancy removal clauses to obtain role labeling results.
[0064] In one embodiment, the vector extraction module 103, when performing the extraction of the graph embedding vector of the clause association graph, is specifically used for: The aforementioned clause association graph is abstracted into a graph structure with spatiotemporal attributes, resulting in a spatiotemporally enhanced graph structure; A node feature matrix is constructed based on the spatiotemporal augmented graph structure using a pre-trained dynamic graph convolutional network; The node feature matrix is enhanced based on a multi-head attention mechanism to obtain a context-aware node embedding. Based on hierarchical graph pooling, a full graph embedding is generated according to the context-aware node embedding; Attention pooling is performed on the full graph embedding to obtain the graph embedding vector.
[0065] In one embodiment, the feature fusion module 104, when performing the fusion of the graph features and text features using a cross-modal attention mechanism to obtain a fused feature vector, is specifically used for: The graph features and the text features are dimensionally aligned to obtain aligned text features and aligned graph features. Calculate the cross-modal attention between the aligned text features and the aligned graph features to obtain the attention output; Based on residual connections, the aligned text features and the aligned graph features are fused according to the attention output to obtain preliminary fused features; The preliminary fused features are subjected to layer normalization and pre-feedback enhancement processing to obtain the fused feature vector.
[0066] This invention provides a risk control value analysis device for contract terms. First, it preprocesses and recognizes text in the contract image. First, it calculates the sharpness coefficient through color conversion and adaptive bilateral filtering. Only qualified images undergo CNN-based visual semantic extraction and U-Net panel semantic segmentation. An OCR engine is selected based on regional characteristics to complete mixed text recognition. Then, the Legal-BERT model is used to perform fine-grained semantic role labeling on the contract text, matching it against a predefined clause type library to obtain a set of key clauses. Next, a key clause association graph is constructed. Semantic roles are parsed using a domain-adaptive BERT model, a standardized data structure is constructed, and clauses are processed in a structured manner. Initial relation triples are generated based on a domain knowledge rule base, and weights are dynamically allocated based on real-time risk data. Temporal path modeling enhances the spatiotemporal dimension, forming a clause association graph. Next, the graph and text semantic embedding vectors are extracted. The graph is abstracted into a spatiotemporally enhanced graph structure, and dynamic graph convolutional networks and multi-head attention mechanisms are used to generate graph embedding vectors, while simultaneously extracting text semantic embedding vectors for key clauses. Finally, cross-modal features are fused. By aligning the fully connected layer with the geographic graph and textual feature dimensions, a cross-modal attention mechanism is used to calculate bidirectional attention. This is combined with residual connections to fuse features, which are then normalized and enhanced with forward feedback to obtain a fused feature vector. Finally, multi-dimensional dynamic risk prediction is performed. The fused features are input into a parallel LSTM risk prediction channel, external risk factors are injected, and cascading effects are analyzed using a risk coupling matrix. A risk probability distribution is generated based on Monte Carlo simulation, and a weighted risk control value is calculated. The output includes a five-dimensional risk radar chart and a ranking of clause sensitivity.
[0067] Specific limitations regarding the contract clause risk control value analysis device can be found in the limitations of the contract clause risk control value analysis method described above, and will not be repeated here. Each module in the aforementioned contract clause risk control value analysis device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the corresponding operations of each module.
[0068] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 4As shown, the computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computational and control capabilities. The memory includes non-volatile and / or volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The network interface is used to communicate with external clients via a network connection. When the computer program is executed by the processor, it implements the functions or steps of a contractual terms risk control value analysis method on the server side.
[0069] In one embodiment, a computer device is provided, which may be a client, and its internal structure diagram may be as follows: Figure 5 As shown, the computer device includes a processor, memory, network interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The network interface is used to communicate with an external server via a network connection. When the computer program is executed by the processor, it implements the client-side functions or steps of a contractual risk control value analysis method. In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to perform the following steps: Text recognition is performed on the pre-acquired contract image to obtain the contract text. Key clauses in the contract text are identified based on fine-grained semantic role labeling to obtain a set of key clauses. Based on dynamic evolution, a relational graph between clauses in the set of key clauses is constructed to obtain the clause relational graph. Extract the graph embedding vector of the clause association graph, and extract the text semantic embedding vector of the key clause set; The graph features and text features are fused using a cross-modal attention mechanism to obtain a fused feature vector; Multidimensional risk dynamic prediction is performed based on the fused feature vector to obtain multidimensional risk prediction results, and risk control values are calculated based on the multidimensional risk prediction results.
[0070] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor: Text recognition is performed on the pre-acquired contract image to obtain the contract text. Key clauses in the contract text are identified based on fine-grained semantic role labeling to obtain a set of key clauses. Based on dynamic evolution, a relational graph between clauses in the set of key clauses is constructed to obtain the clause relational graph. Extract the graph embedding vector of the clause association graph, and extract the text semantic embedding vector of the key clause set; The graph features and text features are fused using a cross-modal attention mechanism to obtain a fused feature vector; Multidimensional risk dynamic prediction is performed based on the fused feature vector to obtain multidimensional risk prediction results, and risk control values are calculated based on the multidimensional risk prediction results.
[0071] It should be noted that the functions or steps that can be implemented by the computer-readable storage medium or computer device described above can be referred to the relevant descriptions on the server side and client side in the foregoing method embodiments. To avoid repetition, they will not be described one by one here.
[0072] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0073] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0074] Finally, it should be noted that if any software tools or components not belonging to this company appear in the embodiments of the application, they are merely illustrative examples and do not represent actual use. The embodiments described above are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.
Claims
1. A method for analyzing the risk control value of contract terms, characterized in that, include: Text recognition is performed on the pre-acquired contract image to obtain the contract text. Key clauses in the contract text are identified based on fine-grained semantic role labeling to obtain a set of key clauses. Based on dynamic evolution, a relational graph between clauses in the set of key clauses is constructed to obtain the clause relational graph. Extract the graph embedding vector of the clause association graph, and extract the text semantic embedding vector of the key clause set; The graph features and text features are fused using a cross-modal attention mechanism to obtain a fused feature vector; Multidimensional risk dynamic prediction is performed based on the fused feature vector to obtain multidimensional risk prediction results, and risk control values are calculated based on the multidimensional risk prediction results.
2. The contract clause risk control value analysis method as described in claim 1, characterized in that, The step of performing text recognition on a pre-acquired contract image to obtain the contract text includes: The clarity of the contract image is assessed to obtain a clarity coefficient. Determine whether the sharpness coefficient is greater than a preset sharpness threshold; If the clarity coefficient is less than or equal to the clarity threshold, the user is prompted to re-upload the contract image. After the contract image is re-acquired, the process returns to the step of performing clarity recognition on the contract image to obtain the clarity coefficient. If the sharpness coefficient is greater than the sharpness threshold, then visual semantic extraction is performed on the contract image to obtain visual semantic features; The contract image is subjected to panel semantic segmentation to obtain a panel structure diagram; The contract text is obtained by performing mixed text recognition on the contract image based on the visual semantic features and the board structure diagram.
3. The contract clause risk control value analysis method as described in claim 2, characterized in that, The process of performing clarity recognition on the contract image to obtain a clarity coefficient includes: The contract image is color-converted to obtain a grayscale image of the contract; The contract grayscale image is subjected to noise suppression processing based on an adaptive bilateral filter to obtain a preprocessed contract image. The horizontal and vertical gradient magnitudes of the preprocessed contract image are calculated using the Sobel operator to obtain the gradient magnitude matrix; The Laplacian variance of the preprocessed contract image is calculated based on the Laplacian response; The high-frequency energy ratio of the preprocessed contract image is calculated based on Fourier transform; The gradient magnitude matrix, the Laplacian variance, and the high-frequency energy ratio are fused using a region-weighted fusion method to obtain a preliminary sharpness score. The initial sharpness score is normalized to obtain the sharpness coefficient.
4. The contract clause risk control value analysis method as described in claim 1, characterized in that, The process of constructing a relational graph between clauses in the key clause set based on dynamic evolution yields a clause relational graph, including: Semantic role labeling is performed on the key clauses in the set of key clauses to obtain the role labeling results; Construct a standardized clause semantic unit data structure based on the annotation results; Based on the standardized clause semantic unit data structure, the key clause set is processed in a structured manner to obtain a structured clause unit set; A dynamic relationship rule base is constructed based on a pre-defined domain knowledge rule base; Based on logical dependency analysis and compliance relationship mapping, an initial set of relationship triples is constructed according to the set of structured clause units and the dynamic relationship rule base; Based on the amount of risk data acquired in real time, the initial set of relation triples is dynamically weighted to obtain a set of dynamically weighted relation triples. By enhancing the spatiotemporal dimension of the dynamic weighted relation triplet set through time path modeling, a clause association graph is obtained.
5. The contract clause risk control value analysis method as described in claim 4, characterized in that, The semantic role labeling of key clauses in the key clause set, to obtain the role labeling results, includes: The key clauses are processed to remove redundant symbols, resulting in the de-redundant clauses. The redundant removal clauses are segmented based on a preset neighborhood segmenter to obtain the segmentation results; Each word in the word segmentation results is tagged with its part of speech to obtain the part-of-speech tagging results; Based on the part-of-speech tagging results, the key clauses are subjected to syntactic analysis to obtain the analysis results; Based on the part-of-speech tagging results and the analysis results, the semantic roles in the redundancy removal clauses are identified to obtain the identification results; Based on the identification results, semantic role labeling is performed on the redundancy removal clauses to obtain role labeling results.
6. The contract clause risk control value analysis method as described in claim 1, characterized in that, The extraction of the graph embedding vector of the clause association graph includes: The aforementioned clause association graph is abstracted into a graph structure with spatiotemporal attributes, resulting in a spatiotemporally enhanced graph structure; A node feature matrix is constructed based on the spatiotemporal augmented graph structure using a pre-trained dynamic graph convolutional network; The node feature matrix is enhanced based on a multi-head attention mechanism to obtain a context-aware node embedding. Based on hierarchical graph pooling, a full graph embedding is generated according to the context-aware node embedding; Attention pooling is performed on the full graph embedding to obtain the graph embedding vector.
7. The contract clause risk control value analysis method as described in claim 1, characterized in that, The method of fusing the graph features and text features using a cross-modal attention mechanism to obtain a fused feature vector includes: The graph features and the text features are dimensionally aligned to obtain aligned text features and aligned graph features. Calculate the cross-modal attention between the aligned text features and the aligned graph features to obtain the attention output; Based on the residual connection, the aligned text features and the aligned graph features are fused according to the attention output to obtain preliminary fused features; The preliminary fused features are subjected to layer normalization and pre-feedback enhancement processing to obtain the fused feature vector.
8. A contract clause risk control value analysis device, characterized in that, include: The clause recognition module is used to perform text recognition on the pre-acquired contract image to obtain the contract text, and to identify key clauses in the contract text based on fine-grained semantic role labeling to obtain a set of key clauses; The graph construction module is used to construct a relational graph between clauses in the set of key clauses based on dynamic evolution, thereby obtaining a clause relational graph. The vector extraction module is used to extract the graph embedding vector of the clause association graph and the text semantic embedding vector of the key clause set. The feature fusion module is used to fuse the graph features and text features using a cross-modal attention mechanism to obtain a fused feature vector; The risk calculation module is used to perform multidimensional risk dynamic prediction based on the fused feature vector, obtain multidimensional risk prediction results, and calculate risk control values based on the multidimensional risk prediction results.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the contract terms risk control value analysis method as described in any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the contractual terms risk control value analysis method as described in any one of claims 1 to 7.