Training data set generation method and system based on multi-modal data fusion
By generating a training dataset through multimodal data fusion, the problem of insufficient integration of multimodal datasets in existing technologies is solved, enabling efficient and accurate training of text legality, compliance and standardization risk review models, and improving dataset quality and model recognition accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HANGZHOU YIXIN DIGITAL DEVELOPMENT CO LTD
- Filing Date
- 2026-02-06
- Publication Date
- 2026-05-05
AI Technical Summary
Existing training dataset generation methods cannot effectively integrate multimodal data, resulting in insufficient dataset diversity. This fails to meet the needs of intelligent legal affairs legal compliance and risk assessment. Furthermore, existing technologies cannot balance the correlation and risk orientation of multimodal data, making it difficult to support the training of accurate risk assessment models.
By acquiring multimodal raw data, performing modal preprocessing, generating cross-modal standardized datasets and multi-dimensional basic feature sets, combining legal-standard knowledge graphs and pre-set text risk review rule bases, identifying actual risk points in contracts, and binding risk labels through unique data identifiers to construct optimized training datasets.
The generated training dataset can comprehensively characterize the multi-dimensional influencing factors of text legality, compliance and standardization risks, improve the recognition accuracy and generalization ability of subsequent risk review models, reduce the construction cost of high-quality training datasets, and improve the efficiency and flexibility of engineering implementation.
Smart Images

Figure CN121980271A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and more specifically, to a method and system for generating training datasets based on multimodal data fusion. Background Technology
[0002] With the deepening application of artificial intelligence technology in various industries, the demand for high-quality, professional training datasets in specific vertical scenarios (such as intelligent legal affairs, legal compliance and standardization review, and knowledge question answering) is becoming increasingly urgent. The construction of traditional training datasets mainly relies on manual collection and annotation, which suffers from high costs, low efficiency, limited scale, and difficulty in ensuring consistency. While existing technologies offer methods for automatic data augmentation using a single data source (such as plain text or a pure database), they often cannot handle the complex relationships between multi-source heterogeneous data in the real world, resulting in datasets with insufficient diversity and poor fit with downstream business scenarios.
[0003] Especially for scenarios involving risk assessment of text legality, compliance, and standardization, existing methods for generating training datasets cannot simultaneously consider the correlation between multimodal data and risk orientation, making it difficult to support the training of accurate risk assessment models. Therefore, there is an urgent need for a method and system for generating training datasets that can integrate multi-source, multimodal data, strengthen the correlation between business scenarios and risk orientation, and improve the structuring and adaptability of data. Summary of the Invention
[0004] To overcome the aforementioned deficiencies of the prior art and achieve the above objectives, the present invention provides the following technical solution: A training dataset generation method based on multimodal data fusion, the method comprising: S1. Obtain multimodal raw data, perform modal preprocessing on the multimodal raw data to obtain a cross-modal standardized dataset and a multi-dimensional basic feature set. The multimodal raw data includes contract text modal data, legal provision modal data, standard and normative modal data, and contract-related behavior modal data. The multi-dimensional basic feature set includes text semantic features, law-standard association features, and behavioral patterns and quantitative features. S2. Generate cross-modal fusion feature vectors based on multi-dimensional basic feature sets, and combine them with a pre-set text risk review rule base to determine the actual risk points and related data of the contract; S3. Based on the associated data corresponding to the actual risk points, determine the risk labels of each actual risk point according to the preset classification standards, and bind the risk labels with the associated data through the data unique identifier ID to form a preliminary training dataset; S4. Optimize the initial training dataset to obtain the final training dataset for text risk review.
[0005] Furthermore, the process of performing modal preprocessing on the original multimodal data to obtain a cross-modal standardized dataset and a multi-dimensional basic feature set includes: The contract text modal data is subjected to structure transformation and useless information removal to obtain structured tagged text and text semantic features. The structured tagged text includes the clause ID, text content and associated entity corresponding to the text clause unit. The legal provisions modal data and standard norm modal data are respectively structured and parsed to construct association relationships, resulting in a law-standard knowledge graph, legal association features, and standard association features. The legal association features and standard association features constitute the law-standard association features. The contract-related behavioral modal data is subjected to structured transformation and quantification to obtain quantified structured data and behavioral patterns and quantitative characteristics; the contract-related behavioral modal data includes at least one of the following: historical contract performance data, credit and litigation data of contracting parties, and user interaction behavior log data on the contract review platform; Each contract is assigned a unique data identifier in advance. The structured labeled text of contract text modal data, the legal clause modal data and the standard specification modal data of legal-standard knowledge graph and contract-related behavior modal data are organized to obtain a cross-modal standardized dataset.
[0006] Furthermore, the steps for obtaining the structured tagged text and text semantic features include: The contract text in the contract text modal data is cleaned and standardized. The processed contract text is then used to identify and label entities in the contract text using a pre-defined entity recognition model. Based on the inherent chapter titles or natural paragraphs of the contract text, and combined with a deep learning paragraph segmentation model, the continuous text is segmented into independent text clause units and assigned clause IDs. Each text clause unit is associated with the identified entities to form structured tagged text, which includes the clause ID, text content, and associated entity corresponding to the text clause unit. For the text content of each text clause unit, sentence vectors are extracted using pre-trained BERT models in the legal and standard domains as basic semantic features. For each text clause unit, TF-IDF similarity vectors with legal provision modal data and standard norm modal data are calculated, and the two vectors are concatenated as legal-standard correlation features. The basic semantic features and legal-standard correlation features are combined to form the text semantic features of the clause.
[0007] Furthermore, the steps for acquiring the legal-standard knowledge graph include: By leveraging the inherent hierarchical structure of legal provisions and standards, and through rule templates and sequence labeling models, legal provisions and standards are parsed into structured forms of names, codes, hierarchical paths, and core content. Legal and standard elements are extracted from the core content to form legal / standard association data. Structured provisions / standards are then constructed based on the structured forms and the legal / standard association data. Each structured clause / standard is used as a node to establish relational edges, including reference relationships. Nodes and relational edges are stored using a graph database to obtain legal knowledge graph subgraphs and standard knowledge graph subgraphs. The legal knowledge graph subgraphs and standard knowledge graph subgraphs are then integrated to form a legal-standard knowledge graph.
[0008] Furthermore, the steps for obtaining the quantified structured data and behavioral patterns and quantified features include: Interaction logs are parsed into standard event streams; credit and litigation data of contracting entities include credit reports and historical litigation records. The ratings in the credit reports are mapped to numerical scores to obtain credit scores; historical litigation records are quantified into litigation indicators; historical contract performance data includes payment progress, default records, and acceptance results; payment progress is quantified as a percentage, default records are quantified as the number of historical defaults and the average default amount, and acceptance results are quantified as binary values or scores. The quantified historical contract performance data constitutes performance indicators; the quantified structured data includes the obtained standard event streams, litigation indicators, and performance indicators. For a given contract, the total number of times it was flagged as risk, the number of modified clauses, and the number of questions users asked the AI were counted to form behavioral statistical features. A recurrent neural network was used to encode the standard event stream, resulting in a behavioral sequence vector representing user review habits and concerns, i.e., behavioral sequence features. The credit score, litigation indicators, and performance indicators were normalized and concatenated to form a vector of entity credit and performance characteristics, i.e., external data features. Finally, the behavioral statistical features, behavioral sequence features, and external data features were combined to form the behavioral patterns and quantitative characteristics corresponding to the contract.
[0009] Furthermore, the content of generating cross-modal fusion feature vectors based on multi-dimensional basic feature sets includes: The text semantic features, legal-standard association features, and behavioral patterns and quantitative features are standardized and dimensionally aligned. Based on the aforementioned legal-standard knowledge graph, the initial weights of text semantic features, legal-standard association features, and behavioral patterns and quantitative features are calculated respectively. A multi-head attention layer is constructed, with each head corresponding to a type of risk subtask. The analysis results of the attention heads are integrated through the SoftMax function to generate a dynamic weight matrix. The initial weights of text semantic features, legal-standard correlation features, and behavioral patterns and quantitative features are dynamically calibrated in real time to obtain the final weights. Based on the final weights, the text semantic features, legal-standard association features, and behavioral patterns and quantitative features are weighted and summed to obtain the initial fusion features; The initial fused features are integrated by two fully connected layers to remove redundant information; then, the integrated features are mapped to a cross-modal fused feature vector by a projection layer.
[0010] Furthermore, the initial weights for calculating text semantic features, legal-standard association features, and behavioral patterns and quantitative features based on the legal-standard knowledge graph include: For the initial weights of the text semantic features, the maximum value in the TF-IDF similarity vector is extracted, and the initial weights of the text semantic features are determined based on the maximum value. The initial weights for the legal-standard association features are assigned based on the network centrality index. The initial weights for behavioral patterns and quantitative characteristics are assigned based on the subject's credit and performance characteristic vector.
[0011] Furthermore, the process of determining the actual risk points of the contract and related data by combining a pre-defined text risk review rule base includes: By analyzing each clause individually, using cross-modal fusion feature vectors and a text risk review rule base, potential risk points can be identified. For each potential risk point in the potential risk point list, the root cause is found from legal, standard, characteristic, and behavioral dimensions, and integrated to form an attribution report; Through multi-layered verification, false risk points caused by model misjudgment and rule adaptation errors are eliminated from potential risk points to obtain the actual risk points; The associated data corresponding to the actual risk points are recorded and stored.
[0012] Furthermore, the process of analyzing each clause individually, combining cross-modal fusion feature vectors and a text risk review rule base, to pinpoint potential risk points includes: Each clause's corresponding cross-modal fusion feature vector is input into a preset risk prediction model. The model outputs the risk probability and predicted risk type for that clause, forming the model prediction result for each clause, and potential risk points are marked. The text risk review rule base is called, and the text content and related features of each clause are verified rule by rule in the order of clause compliance, standard compliance, subject eligibility, and performance feasibility, and potential risk points are marked, resulting in rule verification results. The model prediction results and rule verification results are merged, and duplicate markings are removed. A unique risk identifier is assigned to each potential risk point, and the results are integrated to form a potential risk point list.
[0013] Another object of the present invention is to provide a training dataset generation system based on multimodal data fusion, the system comprising: The data acquisition module is used to acquire multimodal raw data, perform modal preprocessing on the multimodal raw data to obtain a cross-modal standardized dataset and a multi-dimensional basic feature set. The multimodal raw data includes contract text modal data, legal provision modal data, standard and normative modal data, and contract-related behavior modal data. The multi-dimensional basic feature set includes textual semantic features, law-standard association features, and behavioral patterns and quantitative features. The risk point identification module is used to generate cross-modal fusion feature vectors based on a multi-dimensional set of basic features, and combined with a pre-set text risk review rule base, to identify the actual risk points and related data of the contract. The training set generation module is used to determine the risk label of each actual risk point according to a preset classification standard based on the associated data corresponding to the actual risk points, and bind the risk label with the associated data through the data unique identifier ID to form a preliminary training dataset. The training set optimization module is used to optimize the initial training dataset to obtain the final training dataset for text risk review.
[0014] The technical effects and advantages of the training dataset generation method and system based on multimodal data fusion in this invention are as follows: This invention preprocesses four types of heterogeneous multimodal data—contract text, legal provisions, standard and normative provisions, and contract-related behaviors—in a modular and structured manner. It establishes a full-link association index across modal data using unique data identifiers and embeds hierarchical and relational logic into a legal-standard knowledge graph. This breaks through the limitations of traditional datasets where single-modal data is isolated and features are loosely associated. Simultaneously, 0-1 standardization and dimensional alignment achieve the fusion and adaptation of the three types of features, ensuring effective interaction of multimodal features within the same feature space. This allows the generated training dataset to comprehensively represent the multidimensional influencing factors of text legality, compliance, and standardization risks, providing a complete and interconnected feature foundation for subsequent risk review model training.
[0015] This invention assigns task-specific initial weights based on a legal-standards knowledge graph and constructs eight multi-head attention layers for sub-tasks related to text legality, compliance, and compliance risks. A dynamic weight matrix is generated by integrating the attention head analysis results through the SoftMax function, and real-time calibration of feature weights is achieved by combining upper and lower weight constraints. This allows the feature fusion effect to adapt to the differences in feature contribution across different risk scenarios. The resulting 1024-dimensional cross-modal fusion feature vector enables the features of the training dataset to accurately represent the core features of different types of text legality, compliance, and compliance risks, significantly improving the risk identification accuracy and generalization ability of subsequent risk review models.
[0016] This invention combines a pre-defined risk prediction model with a text-based risk review rule base. It uses text clause units as the smallest unit of analysis to locate potential risk points and generates standardized attribution reports from legal, standard, characteristic, and behavioral dimensions, clearly identifying the core causes and feature contributions of the risk. Simultaneously, a two-layer verification mechanism—data consistency verification and expert-assisted verification—eliminates false risk points caused by model misjudgments and rule adaptation errors, ensuring the authenticity and accuracy of the final actual risk points. The dataset samples constructed based on these actual risk points avoid interference from invalid and false samples in model training, significantly improving the sample quality of the training dataset.
[0017] This invention constructs an end-to-end automated process, from multimodal raw data acquisition, submodal preprocessing, cross-modal feature fusion, risk point location verification, to labeled sample construction and dataset optimization. Each step is closely linked and logically closed-loop, enabling the generation of high-quality training datasets without extensive manual intervention. Furthermore, the processing rules, judgment criteria, and optimization indicators for each stage of the process are quantifiable and configurable, allowing for flexible adjustments based on the text legality, compliance, and risk review needs of different enterprises. This significantly reduces the cost of constructing high-quality text risk review training datasets and improves the efficiency and flexibility of project implementation. Attached Figure Description
[0018] Figure 1 The flowchart illustrates the training dataset generation method based on multimodal data fusion provided by this invention.
[0019] Figure 2 The structural block diagram of the training dataset generation system based on multimodal data fusion provided by the present invention is shown. Detailed Implementation
[0020] 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 embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0021] Please see Figure 1 As shown, this embodiment of the invention provides a method for generating training datasets based on multimodal data fusion, the method comprising: S1. Obtain multimodal raw data and perform modal preprocessing on the multimodal raw data. The multimodal raw data includes contract text modal data, legal provision modal data, standard and specification modal data, and contract-related behavior modal data. S1.1. Obtain multimodal raw data through multi-channel interface integration and incremental updates. The multimodal raw data includes contract text modal data, legal provision modal data, standard and normative modal data, and contract-related behavior modal data. Specifically, the contract text modal data includes historical contract templates and user-uploaded contract texts awaiting review; the legal provision modal data includes structured databases of laws, regulations, judicial interpretations, and judgment documents; the standard and normative modal data includes structured databases of national / industry standards, enterprise internal control standards, and transaction practice standards; and the contract-related behavior modal data includes at least one of the following: historical contract performance data, credit and litigation data of contracting parties, and user interaction logs on the contract review platform. The contract text modal data is collected in batches through the document upload interface and historical contract template database interface of intelligent contract processing platforms (such as Qidian Contract Network). This includes historical contract templates (covering 200 mainstream contract types such as sales, leasing, services, and loans) and user-uploaded contract texts awaiting review. For scanned copies of paper contracts, optical character recognition technology is used to convert the text in the images into editable electronic text. For encrypted electronic contracts, a compliant decryption algorithm based on the platform's authorized key is used to decrypt them, ensuring that the data acquisition is legal and compliant and does not infringe on data security. The legal provisions modal data is extracted using structured web crawling technology by connecting to the national legal database, the Supreme People's Court's judicial interpretation database, and the China Judgments Online compliance data interface. At the same time, it is updated daily by comparing the hash values of the data every day to ensure that the legal provisions on which the subsequent risk review is based are timely. The acquisition channels for standard and specification modal data include: using the public API interfaces of the National Standards Information Public Service Platform and industry association compliance databases, and employing Python web scraping frameworks (such as Scrapy) for structured data crawling; synchronizing internal enterprise standards through the database interfaces of ERP systems and contract management platforms; and extracting transaction practice specifications from cases in industry journals and judicial judgment documents websites. The data update mechanism is a daily incremental update, using data hash values to determine whether a standard is newly added or revised, ensuring timeliness. The contract-related behavioral modal data is collected through the background log collection module of the intelligent contract processing platform. It records all user interaction logs when using the platform, including risk points marked by users, modified text terms, AI-related questions, operation time and operation path, etc. It connects with compliant credit reporting agencies such as Tianyancha and Qichacha and court litigation databases to obtain credit reports, historical litigation records, and whether they are dishonest persons subject to enforcement for contract signing entities. It also extracts historical contract performance data from the enterprise's ERP system (Enterprise Resource Planning system, used to manage the enterprise's daily operation data) and contract performance management platform, including payment progress, existence of default records, acceptance results, etc., and finally integrates them to form complete contract-related behavioral modal data.
[0022] S1.2. Perform modal preprocessing on the original multimodal data to obtain a cross-modal standardized dataset and a multi-dimensional basic feature set. The cross-modal standardized dataset includes structured labeled text of contract text modal data, hierarchical structured data of legal provisions modal data and standard specification modal data, and quantitative structured data of contract-related behavior modal data. Preliminary cross-modal association is achieved through unique data identifiers, and data format unification, noise removal, and integrity completion are completed. The multi-dimensional basic feature set includes text semantic features, legal association features, standard association features, and behavioral patterns and quantitative features.
[0023] S1.2.1 Perform structured transformation and remove useless information from the contract text modal data to obtain structured tagged text and text semantic features; The contract text in the contract text modal data undergoes cleaning and standardization (specifically: converting all contract text to UTF-8 encoded plain text format; using regular expressions to remove garbled characters, headers, footers, page numbers, watermarks, and other non-contractual content generated by OCR (Optical Character Recognition) of scanned documents; merging sentence breaks caused by line breaks; and correcting obvious typos). The processed contract text is then used to identify and label entities within the contract text using a pre-defined entity recognition model. This entity recognition model refers to a legal domain-specific entity recognition model optimized based on a pre-trained language model (such as BERT), capable of accurately identifying specific entities in the contract (contracting parties, contract subject matter, amount, performance period, etc.) and outputting the entity type and corresponding text. This section describes the structured extraction of contract text. The entities include the contracting parties (names of Party A and Party B), contract subject matter, amount, payment method, performance period, breach of contract clauses, dispute resolution clauses, etc. Based on the inherent chapter titles or natural paragraphs of the contract text, and combined with a deep learning paragraph segmentation model, continuous text is segmented into independent text clause units, and a clause ID is assigned. In this embodiment, the continuous text refers to the cleaned and standardized contract text; in practical applications, it is not limited to contract text and can also be other types of text. Each text clause unit is associated with the identified entities to form structured tagged text, which includes the clause ID, text content, and associated entity corresponding to the text clause unit. For the text content of each text clause unit, a pre-trained BERT model in the legal and standards domain (such as the Law-BERT model, which is a dedicated model pre-trained on a large-scale legal text corpus (laws and regulations, judgments, contract templates, standards and norms) is used to extract its sentence vector as the basic semantic feature. For each text clause unit, its TF-IDF (term frequency-inverse document frequency) similarity vector with the legal provision modal data and the standard and norm modal data is calculated. The two vectors are concatenated to form the law-standard relevance feature. The basic semantic feature and the law-standard relevance feature together constitute the text semantic feature of the clause.
[0024] S1.2.2 Perform structured parsing on the aforementioned legal provision modal data and construct association relationships; Utilizing the inherent hierarchical structure of legal provisions ("section-chapter-section-article-clause-item"), this method uses rule templates and sequence labeling models to parse legal provisions into a structured form comprising legal name, provision code, hierarchical path, and core content. From this core content, legal elements such as legal subjects, behavioral patterns, and legal consequences are extracted, forming legal association data between the provision code and legal elements. Based on this structured form and legal association data, a structured provision is constructed. The rule template refers to a structured parsing template designed for the inherent hierarchical structure of legal provisions ("section-chapter-section-article-clause-item"), used to accurately extract fixed fields and hierarchical relationships from legal provisions. The sequence labeling model refers to a legal domain-specific sequence labeling model fine-tuned based on pre-trained language models (such as BERT and RoBERTa), used to accurately identify continuous semantic units and semantic roles in legal provision texts, compensating for the limitations of rule templates in parsing non-fixed-format provisions. This model is fine-tuned for legal text corpora (laws, regulations, judicial interpretations), and adopts the IOB annotation system (Inside-Outside-Beginning). It can identify the boundaries and types of legal elements such as legal subjects, behavioral patterns, and legal consequences in the core content of the law. It works in conjunction with rule templates to achieve complete structured parsing of legal texts. The rule templates are responsible for the hierarchy and fixed fields, while the sequence annotation model is responsible for the extraction of semantic elements. Each structured provision is used as a node to establish relational edges, including citation relationships, same-topic relationships, and conflict / supplementary relationships. A graph database is used to store the nodes and relational edges, forming a legal knowledge graph subgraph, also known as the hierarchical structured data of the legal provision modal data. Specifically, the citation relationship is when provision A explicitly cites provision B; the same-topic relationship is when provision A and provision B belong to the same legal topic such as "breach of contract liability" or "contract validity"; and the conflict / supplementary relationship is based on judicial interpretations or legal principles to mark potential conflicts or supplementary explanations between provisions. Calculate the legal association features of the nodes corresponding to each structured provision. These features include a topic distribution vector, a network centrality index, and a timeliness feature. The topic distribution vector is calculated using an LDA topic model, which calculates the probability distribution of the structured provision belonging to various preset legal topics. The LDA topic model refers to Latent Dirichlet Allocation. The Allocation topic model is an unsupervised probabilistic generation model used to automatically mine potential topics from a large amount of text (here, the core structured content), outputting the probability distribution of each clause belonging to each legal topic, and realizing the quantitative representation of the clause topic. This is existing technology and will not be elaborated on here. The preset legal topics specifically include eight core topics: contract validity, liability for breach of contract, deposit clause, subject eligibility, performance period, dispute resolution, performance guarantee, and payment method, covering the main legal scenarios of contract review. The network centrality index is to calculate the degree centrality, betweenness centrality, etc. of the corresponding node of the structured clause in the hierarchical structured data. The timeliness feature is to encode its timeliness based on the promulgation / revision time (e.g., taking the logarithm of the number of days from the current time).
[0025] S1.2.3. Perform structured parsing on the standard specification modal data and construct association relationships; By leveraging the inherent hierarchical structure of standards and specifications ("general-specific-article-clause"), and through rule templates (such as regular expressions matching standard numbers and hierarchical headings) and legal domain sequence annotation models (such as BERT-CRF), unstructured standard text is parsed into a structured form containing the standard name, standard code, hierarchical path (such as "GB / T 20000.1-2014 → Chapter 3 → Article 3.1"), and core content. Standard elements are extracted from the core content, including mandatory contractual clauses, performance thresholds, and consequences of violations, forming standard-related data. Based on this structured form and the standard-related data, structured standards are constructed. Each structured standard is used as a node, with node attributes including standard number, publication date, and enforcement level, where enforcement level includes mandatory, recommended, and reference. Relationship edges are established, including reference, substitution, and supplementary relationships. The Neo4j graph database is used to store nodes and relationship edges, forming a standard knowledge graph subgraph, also known as the hierarchical structured data of the standard specification modal data. The standard association features include standard topic distribution vectors, standard timeliness features, etc.; the standard topic distribution vectors are calculated using the LDA topic model to determine the probability distribution of structured standards belonging to preset topics such as contract validity and breach of contract liability, with a dimension of 128; the standard timeliness features are obtained by converting the standard release / revision time into the number of days from the current time, taking the logarithm, and normalizing it to [0,1]. The legal knowledge graph subgraph and the standard knowledge graph subgraph are integrated to form a legal-standard knowledge graph. The integrated legal-standard knowledge graph contains both structured provision nodes / legal provision nodes and structured standard nodes / standard normative nodes. The internal relationships between nodes within their respective subgraphs are preserved. The integration process includes: unifying legal provision nodes and standard normative nodes into a single provision node type, retaining their original attribute fields, and adding a node type attribute to each node to identify it as a legal provision or a standard normative node; mapping and aligning key attributes of the two types of nodes, for example, unifying the provision code of legal provision nodes and the standard code of standard normative nodes into a single provision code; retaining the original internal relationship edges between the legal knowledge graph subgraph and the standard knowledge graph subgraph; and adding cross-system relationship edge types, including legal citation standard relationships. The system establishes legal-standard knowledge graphs, including those related to legal relationships and standards. When a legal provision explicitly cites a standard, a legal-standard citation relationship is established. When a standard provides supplementary explanations to the technical or operational aspects of a legal provision, a standard-supplementary legal relationship is established. The integrated legal-standard knowledge graph is stored using the Neo4j graph database. Each node contains attributes such as node ID, node type, provision code, hierarchical path, topic vector, timeliness score, and network centrality index. The legal-standard association features and the standard association features constitute the legal-standard association features. Specifically, the legal-standard association features and the standard association features are subjected to layer-level normalization to ensure consistency in dimensions and units. Then, the normalized legal-standard association features and the standard association features are concatenated end-to-end to obtain the legal-standard association features.
[0026] S1.2.4. Perform structured transformation and quantification on the contract-related behavioral modal data to obtain quantified structured data and behavioral patterns and quantitative characteristics; The steps for acquiring structured data include: Interaction logs are parsed into a standard event stream (user ID, contract ID, timestamp, operation type, operation object, and operation content). Operation types include risk labeling, clause modification, AI consultation, and viewing explanations. Subject credit and litigation data include credit reports and historical litigation records. Credit ratings (e.g., AAA, BB) are mapped to numerical scores to obtain credit scores. Historical litigation records are quantified into litigation indicators such as the number of cases, loss rate, and average amount involved. Contract historical performance data includes payment progress, default records, and acceptance results. Payment progress is quantified as a percentage, default records are quantified as the number of historical defaults and the average default amount, and acceptance results are quantified as a binary value (pass / fail) or a score. The quantified contract historical performance data constitutes performance indicators. The aforementioned standard event stream, numerical scores, number of cases, loss rate, average amount involved, number of historical defaults, and average default amount constitute quantified structured data. The behavioral patterns and quantitative characteristics include behavioral statistical characteristics, behavioral sequence characteristics, and external data characteristics. For a single contract, the total number of times it is marked with risk, the number of modified clauses, and the number of questions users ask the AI constitute behavioral statistical characteristics. A recurrent neural network (RNN) is used to encode the standard event stream to obtain a behavioral sequence vector representing the user's review habits and concerns, i.e., behavioral sequence characteristics. The credit score, litigation indicators, and performance indicators are normalized and concatenated to form a vector of the entity's credit and performance characteristics, i.e., external data characteristics. The behavioral statistical characteristics, behavioral sequence characteristics, and external data characteristics are concatenated to form the behavioral patterns and quantitative characteristics corresponding to the contract.
[0027] S1.2.5. A unique data identifier is pre-assigned to each contract, serving as the core index for linking different types of data. This identifier is used to align and link the contract text modal data, legal provision modal data, standard specification modal data, and contract-related behavior modal data corresponding to the same contract, achieving the effect of linking all relevant data for a single contract and avoiding the isolation of different data types. A hash deduplication algorithm is used to remove redundant data such as duplicate contract templates, obsolete and invalid legal provisions, and duplicate user operation logs. The data obtained in steps S1.2.1-S1.2.4 is then processed to form a cross-modal standardized dataset and a multi-dimensional basic feature set.
[0028] S2. Generate a cross-modal fusion feature vector based on a multi-dimensional basic feature set, and combine it with a pre-set text risk review rule base to determine the actual risk points of the contract; here, the contract refers to a specific contract in the contract text modality data, including historical contract templates and user-uploaded contract texts to be reviewed; wherein, the multi-modal feature fusion algorithm adopts a feature layer fusion method, concatenating the vector features of the text modality with the numerical / category features of the contract-related behavior modality to form a fusion feature vector, and assigning risk weights to different modality features through an attention mechanism; the text risk review rule base is constructed based on the current code, relevant judicial interpretations of the Contract Law, and industry transaction practices, and includes rules on clause compliance and subject eligibility. The rules cover performance feasibility and standard compliance. Specifically, the clause compliance rules include: For example, "the deposit amount shall not exceed 20% of the principal contract amount," corresponding to a specific article in the legal code, with a threshold of "deposit ratio > 20% triggers risk"; the subject eligibility rules include: "signing a contract by an entity with a credit score below 60 points triggers a risk warning," corresponding to relevant credit management regulations, with a threshold of "credit score < 60 points"; the performance feasibility rules include: "no guarantee clause and payment period exceeding one year triggers risk," corresponding to industry transaction practices, with a threshold of "no guarantee + payment period > 365 days"; and the standard compliance rules include: "the construction quality acceptance clause in the construction contract does not cite GB / T..." 50500-2013 "Construction Engineering Quantity List Pricing Specification" → Triggers risk, the judgment threshold is "not referencing mandatory standards"; the text risk review rule base is updated daily, synchronizing with legal revisions and new industry risk rules, and all new rules must be reviewed by legal experts to ensure the rules are legal and accurate; the cross-modal fusion feature vector and the text risk review rule base have a mapping relationship, for example, binding the credit score feature (derived from behavioral patterns and quantitative features) in the vector to the subject eligibility rule, and binding the clause and legal provision association features (derived from text semantic features and legal association features) to the clause compliance rule.
[0029] S2.1. Dynamically assign weights to the text semantic features, legal-standard association features, and behavioral patterns and quantitative features to generate a cross-modal fusion feature vector; S2.1.1 Standardize and align the text semantic features, legal-standard association features, and behavioral pattern and quantitative features to ensure fusion adaptability. Specifically, this includes: mapping text semantic features to 768-dimensional vectors through a fully connected layer, preserving the semantic and legal association attributes of clauses, i.e., retaining the sentence vectors extracted by the Law-BERT model and the TF-IDF similarity vector representation; concatenating the legal-standard association features (legal association features + standard association features) and then performing layer normalization to transform them into 768-dimensional vectors, highlighting the hierarchical relationship and importance of legal provisions and standard norms; concatenating the behavioral pattern and quantitative features with the RNN encoding output to unify them into 768-dimensional vectors, preserving user behavior habits and subject performance capability information, including historical default counts, average default amounts, etc. All text semantic features, legal association features, and behavioral pattern and quantitative features are standardized using 0-1 to eliminate dimensional differences, avoiding a single feature dominating the fusion result.
[0030] S2.1.2. Based on the aforementioned legal knowledge graph, calculate the initial weights of text semantic features, legal-standard association features, and behavioral patterns and quantitative features for the text risk identification task, achieving targeted weight allocation. The sum of the initial weights of text semantic features, legal association features, and behavioral patterns and quantitative features is 1; specifically including: For the initial weight of text semantic features, the maximum value in the TF-IDF similarity vector (i.e., the similarity between the clause and the most relevant core legal provisions / standards) is extracted, and the initial weight of the text semantic features is determined based on the maximum value. The higher the maximum value, the higher the proportion of the initial weight of the text semantic features, with the initial range set at 35%-45%. For example, a clause with a similarity of 0.8 (out of 1) can have an initial weight of 42%; a clause with a similarity of 0.5 can have an initial weight of 38%.
[0031] The initial weights for the legal-standard association features are allocated based on the network centrality index. Specifically, this includes the following steps: extracting the network centrality index (degree centrality, betweenness centrality) of nodes in the legal-standard knowledge graph; calculating the comprehensive centrality score, score = degree centrality × 0.4 + betweenness centrality × 0.6; classifying the comprehensive centrality score into three levels: high (score ≥ 0.7), medium (0.3 ≤ score < 0.7), and low (score < 0.3), corresponding to the weight levels of the legal-standard association features; allocating initial weights: for high comprehensive centrality scores, the initial weights for the corresponding legal-standard association features are set to 35%-40%; for medium scores, 30%-35%; and for low scores, 25%-30%; weight calibration: ensuring that the sum of the initial weights of the legal-standard association features and the weights of the text semantic features, behavioral patterns, and quantitative features is 1. If this exceeds a preset range, the weights of each feature are adjusted proportionally.
[0032] The initial weights for behavioral patterns and quantitative characteristics are assigned based on the entity's credit and performance characteristic vector. Specifically, when a contracting entity exhibits high-risk behavior (such as a history of dishonesty or default), the initial weight of behavioral patterns and quantitative characteristics is increased, with an initial range set at 20%-30%. For example, an entity with a history of dishonesty has a weight of 28%, while an entity without such a record has a weight of 22%.
[0033] S2.1.3. Construct a multi-head attention layer, building 8 independent attention heads (which can be understood as 8 dedicated risk analysis modules), each corresponding to a type of risk sub-task. The analysis results of the 8 attention heads are integrated using the SoftMax function (weight calculation tool) to generate a dynamic weight matrix. The initial weights of text semantic features, legal-standard correlation features, and behavioral patterns and quantitative features are dynamically adjusted in real time to obtain the final weights. For example, when a user repeatedly marks a clause as risky and the entity has a history of dishonesty, the weight of behavioral patterns and quantitative features is automatically increased from 28% to 35%. Simultaneously, upper and lower limits for the weights are set (text semantic features 30%-50%, legal correlation features 25%-40%, behavioral patterns and quantitative features 15%-35%) to avoid excessive dominance by a single feature. For example, the weight of patterns and quantitative features should not exceed 35%, preventing the compliance of the clause itself from being overlooked due to minor flaws in the entity.
[0034] The risk sub-tasks correspond to the core scenarios of text legality, compliance and standardization risk review. Based on the rules of the text risk review rule base and the actual review needs, they are divided into 8 independent attention points, which correspond to 8 types of risk sub-tasks: subject credit verification, identification of dishonest subjects, clause compliance review, deposit ratio verification, performance capability assessment, payment progress monitoring, jurisdiction court determination, and dispute resolution method verification.
[0035] The process involves generating a dynamic weight matrix, dynamically calibrating the initial weights of text semantic features, legal relevance features, and behavioral patterns and quantitative features in real time, and obtaining the final weights, which include: For each attention head targeting the corresponding risk subtask, calculate the local weight vectors (3 dimensions, corresponding to three types of features) for text semantic features, legal-standard association features, and behavioral patterns and quantitative features; collect the local weight vectors of 8 attention heads to construct an 8×3 local weight matrix; input the local weight matrix into the SoftMax function to normalize the 8 local weights of each feature type (making the sum of the weights of each feature type equal to 1) to obtain the global weight values of the three feature types; construct a 3×3 dynamic weight matrix based on the global weight values (rows and columns correspond to the three feature types), with matrix elements representing the interaction weights between two feature types; Retrieve the initial weights of the calculated text semantic features, law-standard association features, behavioral patterns, and quantitative features, and construct a 3×1 initial weight vector W0=[w 10 ,w 20 ,w 30 ], w 10 w is the initial weight for the text semantic features. 20 As the initial weight for the legal-standard association feature, w 30 Initial weights are assigned to behavioral patterns and quantified features; interaction weight extraction: interaction weights between features are extracted from the 3×3 dynamic weight matrix M. Matrix elements Mᵢⱼ (i, j∈{1,2,3}, corresponding to the three types of features respectively) represent the influence weight of the i-th type of feature on the j-th type of feature. For example, M... 12 The weights representing the interactive influence of textual semantic features on law-standard association features; weighted fusion calibration: calculate the calibration weight for each type of feature, using the formula Wᵢ'=w i0 ×(1+ΣMᵢⱼ / 2), i=1,2,3; j=1,2,3 and j≠i, where Wᵢ' refers to the calibration weight after the interaction weight fusion of the i-th type of feature, w i0The initial weight of the i-th feature is given by ΣMᵢⱼ, where ΣMᵢⱼ is the sum of the interaction weights of the i-th feature with the other two features. Dividing by 2 is to avoid excessive amplification of the initial weight differences by the interaction weights. Weight normalization: The calibration weights W1', W2', and W3' of the three features are normalized so that the sum of the calibrated weights is 1, resulting in the temporary weight Wᵢ'' = Wᵢ' / (W1' + W2' + W3'). Weight upper and lower bound constraints: These are compared to preset weight upper and lower bounds (text semantic features). The temporary weights Wᵢ'' are adjusted (30%-50%, legal-standard correlation features 25%-40%, behavioral patterns and quantitative features 15%-35%). If the weight exceeds the upper limit, it is reduced to the upper limit; if it is below the lower limit, it is increased to the lower limit. After adjustment, it is normalized again to ensure that the sum is 1. The final weights are output: the weights after constraint adjustment and normalization are the final weights. A 3×1 final weight vector W=[w1,w2,w3] is constructed for the subsequent generation of cross-modal fusion feature vectors.
[0036] S2.1.4. Based on the dynamically calibrated initial / final weights, the text semantic features, legal association features, and behavioral pattern and quantitative features are weighted and summed to obtain the initial fusion features, such as 40% text semantic features + 35% legal-standard association features + 25% behavioral pattern and quantitative features. The initial fusion features are integrated through two fully connected layers (hidden layer dimension 2048) to remove redundant information (such as repeated legal clause association information). Then, through a projection layer (dimensional transformation tool), the integrated features are mapped into a 1024-dimensional cross-modal fusion feature vector. This vector simultaneously contains clause semantics, legal-standard association, and behavioral pattern information, and embeds the association logic of the legal knowledge graph, which can be directly used for subsequent risk prediction and rule comparison.
[0037] The core of this step is to introduce the constructed legal-standard knowledge graph as a linking bridge, optimize the weight allocation logic of the cross-attention mechanism, and generate cross-modal fusion feature vectors that combine data features and legal logic to achieve accurate preliminary risk assessment.
[0038] S2.2 Input the cross-modal fusion feature vector into the preset risk prediction model, and at the same time combine it with the text risk review rule base to compare and analyze each item of the text clause unit to locate potential risk points; perform risk attribution and verification on the potential risk points to determine the actual risk points; The pre-defined risk prediction model is a specialized classification model for contract risk scenarios, comprising an input layer, multiple hidden layers, and an output layer. It receives multi-dimensional basic features (textual semantic features, legal-standard association features, behavioral patterns, and quantitative features) as input feature vectors, which are then standardized and dimensionally aligned before being input into the model for training. A hybrid architecture of "fully connected layer + multi-head attention layer + classification layer" is adopted: the multi-head attention layer (reusing the 8 risk sub-task attention heads from S2.1.3) is used to capture the interaction relationships between the three types of features and the risk sub-task features, strengthening the targeted representation of risk features; the fully connected layer is used to integrate the features output by the attention layer, removing redundant information and enhancing the feature fusion effect; each hidden layer contains 2048 neurons, which use the ReLU non-linear activation function; in the model, the input layer and the first hidden layer, and the multi-head attention layer... The fully connected layers are connected to each other, and each fully connected layer is connected in a fully connected manner. Each connection corresponds to an adjustable weight parameter, which determines the degree and importance of the influence of the output value of the previous layer neuron on the input value of the next layer neuron. In the weight calculation of the multi-head attention layer and the feature integration process of the fully connected layer, the ReLU activation function is introduced. The introduction of the activation function enables the model to learn and express the complex nonlinear mapping relationship between the input features and the legality, compliance and risk type of the text. The last fully connected layer is connected to the output layer. The output layer contains two types of neurons (risk / no risk) and multiple risk type neurons (such as deposit ratio exceeding the standard, credit failure). The SoftMax activation function is used. The output value of the output layer neurons represents the probability of the text clause unit having risk and the probability of its risk type, respectively. The risk type with the highest probability is the model prediction result.
[0039] The risk prediction model is constructed using multi-dimensional basic features (textual semantic features, legal-standard correlation features, behavioral patterns and quantitative features) generated by S1.2 as training samples. Risk points in the samples are labeled, such as illegal clauses or unqualified entities. The model is trained to learn which feature combinations correspond to which risks. After training, the validation set accuracy is ≥93% and recall is ≥92%, ensuring accurate model identification with minimal missed or false positives. The model continuously iterates through incremental learning, regularly incorporating the latest judicial cases and risk samples to ensure it adapts to the latest legal regulations and new risk scenarios.
[0040] S2.2.1. Taking text clauses as units, and combining cross-modal fusion feature vectors and text risk review rule bases, analyze each clause one by one to locate potential risk points and avoid omissions or duplicate markings. The specific steps are as follows: Input the 1024-dimensional cross-modal fusion feature vector corresponding to each clause into the preset risk prediction model one by one. The model outputs the risk probability (0-1) and predicted risk type of the clause, such as illegal deposit clauses and unqualified credit of the subject, forming the model prediction result for each clause. Set a risk probability threshold (e.g., ≥0.5). When the risk probability is ≥ the threshold, it is marked as a potential risk point. Call the text risk review rule base to perform rule-by-rule verification on the text content and related features (text semantic features, legal-standard correlation features, behavioral patterns and quantitative features) of each clause, and mark potential risk points to obtain the rule verification results. For example, when verifying deposit clauses, first compare the clause compliance rules. If the deposit amount accounts for 30% of the principal contract value (exceeding the 20% threshold), the rule is triggered and marked as a potential risk point, resulting in a rule verification result. The model prediction result and the rule verification result are merged, and duplicate markings are eliminated (e.g., a clause is predicted as a risk by the model and triggers rule verification). A unique risk identifier (e.g., "RISK-2026-001") is assigned to each potential risk point, and the corresponding clause ID, clause text fragment (e.g., "deposit amount of 500,000 yuan, accounting for 30% of the principal contract value"), associated cross-modal fusion feature vector, violated rule code (e.g., "R1-001", corresponding to deposit compliance rule), predicted risk type, etc., are integrated to form a potential risk point list for subsequent traceability analysis.
[0041] S2.2.2 For each potential risk point in the potential risk point list, identify the root cause from dimensions such as law, standards, characteristics, and behavior, and integrate them to form an attribution report; specifically including the following steps: Legal attribution: By using a unique risk identifier for a potential risk point, the legal knowledge graph is linked to locate the corresponding legal basis for the risk. The legal basis includes legal provisions, such as "risk of deposit clause" corresponding to a certain article of a certain code, recording the article code, hierarchical path (a certain code, contract section, typical contract, sales contract), and legal elements (behavioral pattern: agreed deposit; legal consequence: part exceeding 20% is invalid). Standard attribution: Associate with legal and standard knowledge graphs to locate corresponding standard specifications (e.g., "GB / T 50500-2013 not cited"), and record standard codes, enforcement levels, etc.; Feature Attribution: The core feature dimensions that dominate potential risk points are determined by the final weights of the text semantic features, legal-standard correlation features, and behavioral patterns and quantitative features. For example, if the final weights of a potential risk point are 40% for text semantic features, 35% for legal-standard correlation features, and 25% for behavioral patterns and quantitative features, and the "deposit clause correlation" contributes the most among the legal-standard correlation features, then the attribution conclusion is "this risk is mainly caused by the clause content violating the relevant legal provisions of deposits, which is further confirmed by the subject's behavioral patterns and quantitative features." Behavioral attribution: Corresponding to the aforementioned quantitative structured data, supplementing the risk basis at the behavioral level: For example, if a user repeatedly modifies the deposit terms or marks an excessively high amount, it indicates that the user is also concerned about the risks of the terms, confirming the authenticity of the risks; if similar entities have had disputes due to excessively high deposit ratios, supplementing the actual impact cases of the risks, strengthening the persuasiveness of the attribution; Integrate the aforementioned legal attribution, standard attribution, characteristic attribution, and behavioral attribution to form an attribution report that clearly explains the core reasons for the risk.
[0042] S2.2.3. Through multi-layered verification, false risk points caused by model misjudgment and rule adaptation errors are eliminated from potential risk points to obtain actual risk points. The multi-layered verification includes data consistency verification and expert-assisted verification. Data consistency verification includes comparing the legal provisions and behavioral data (quantitative structured data related to behavioral attribution, such as credit scores and performance records) in the attribution report with the cross-modal standardized dataset one by one to confirm that the data association is correct. False risk points are eliminated; for example, if a credit score is incorrectly recorded as 50 points due to missing data, but the actual score is 70 points, then that potential risk point is eliminated. Expert-assisted verification includes calling the legal expert review interface for ambiguous potential risk points (risk probability 0.6-0.8, inconsistent between model and rule base conclusions). Professional legal personnel use their knowledge to determine the risk. For example, if a clause has a risk probability of 0.7, the model predicts it as risk, the text risk review rule base is not triggered, and the expert review concludes that the clause is ambiguous and has potential dispute risk, then that risk point is retained.
[0043] S2.3 Record and store the associated data corresponding to the actual risk points. The associated data includes multimodal source data, feature layer data, risk analysis process data, and attribution and verification data. The multimodal source data includes structured tagged text, hierarchical structured data, and quantitative structured data. The feature layer data includes textual semantic features of the actual risk points, legal-standard association features, behavioral patterns and quantitative features, and cross-modal fusion feature vectors. The risk analysis process data includes unique identifiers of potential risk points, output results of risk prediction models, and dynamic weight calibration records (initial weights and final weights). The attribution and verification data includes attribution reports, data consistency verification record comparison results, redundant / erroneous data removal instructions, and expert-assisted verification opinions (conclusions on fuzzy risk point determination, and legal professional review opinions).
[0044] S3. Based on the associated data corresponding to the actual risk points, determine the risk labels for each actual risk point according to a preset classification standard. Bind the risk labels to the associated data using a unique data identifier ID. Encapsulate the associated data and risk label for each actual risk point into a single sample. Integrate all encapsulated samples to form a preliminary training dataset. The preset classification standard is a three-level classification standard of risk dimension, risk type, and risk level. The risk dimensions include entity qualification, textual clauses, performance capability, and dispute resolution, etc., and the risk types are specific risk categories under each risk dimension. In addition, risk types are categorized under the following dimensions: creditworthiness (e.g., poor credit record, defaulter, abnormal litigation records); contract terms (e.g., excessive deposit ratio, illegal performance period agreement, lack of liability for breach of contract); performance capability (e.g., frequent historical defaults, delayed payment progress); and dispute resolution (e.g., unclear jurisdictional court agreement, conflicting dispute resolution methods). Risk levels are categorized into three levels based on their impact: general, significant, and major. The unique data identifier ID assigns a unique code to each contract source data, linking and storing risk labels, corresponding risk characteristics, and source data through this code to ensure data traceability. S3.1. Determine the core risk sources and characteristic contribution based on the attribution report, and determine the risk dimensions based on the core risk sources and characteristic contribution. The core risk sources mentioned above originate from the attribution report, specifically referring to the legal basis for legal attribution and the risk basis for clear behavioral attribution (such as entity dishonesty or clause violations), which are the core triggers for risk generation. The feature contribution rate originates from the final weighting of the three types of features. Combining the two allows for precise determination of the risk dimension: for example, if the attribution report clearly states that the core risk source is an entity's credit score below the threshold or a history of dishonesty, and the behavioral patterns and quantitative features contribute the most (e.g., a weighting of 35%), then it is determined to be the entity's qualification dimension; if the core risk source is a clause content that violates legal provisions, and the legal-standard correlation feature contributes the most (e.g., a weighting of 38%), then it is determined to be the textual clause dimension; if the core risk source is a historical record of performance default, and the performance indicators among the behavioral patterns and quantitative features contribute significantly, then it is determined to be the performance capability dimension.
[0045] S3.2. Under the risk dimension, the risk type is further refined by combining the rule verification results and the legal attribution link. The legal attribution link is the complete logical chain formed by legal attribution. Specifically, it refers to the complete link of locking the corresponding legal article code → hierarchical path → legal elements (behavioral patterns, legal consequences) → related articles by uniquely identifying potential risk points and associating them with the legal standard knowledge graph. This is the core basis for refining the risk type. The specific steps for determining the type of risk include: Extract rule verification results (violated rule codes, threshold triggering situations) and legal attribution link information from the data associated with actual risk points; classify by risk dimension, and accurately match the rule verification results with the legal requirements in the legal attribution link: for example, under the subject qualification dimension, if the rule verification triggers "credit score < 60 points" and the legal attribution link points to relevant provisions of credit management, it is refined into the "credit score not meeting the standard" type; for actual risk points without clear rule triggers but verified by experts (such as ambiguous wording of clauses), combine the legal themes in the legal attribution link (such as "dispute resolution"), and refine them into the catch-all type under the corresponding dimension (such as "dispute resolution dimension - ambiguous wording"); unify the naming and coding of risk types to ensure that there is no duplication or overlap of risk types under the same dimension, forming a standardized risk type list.
[0046] S3.3. Determine the risk score based on the preset evaluation indicators, and determine the risk level based on the risk score; specifically including the following steps: Evaluation indicators and scores (total 10 points): Legal consequences (4 points), behavioral risk coefficient (3 points), scope of impact (3 points); Evaluation indicator scoring: Legal consequences (violation of mandatory provisions 4 points, violation of arbitrary rules 2 points, no illegality 1 point); Behavioral risk coefficient (repeated breaches of trust / default 3 points, minor adverse records 1 point, no adverse records 0 points); Scope of impact (core clauses 3 points, general clauses 1 point, no substantial impact 0 points; Among them, core clauses specifically include contract subject matter, amount and payment method clauses, performance period and core performance method clauses, breach of contract liability clauses, deposit / Clauses that directly determine the formation of the contract, the allocation of core rights and obligations, and the basis for performance, such as guarantee clauses, dispute resolution clauses, clauses concerning the qualifications of the contracting parties and the conditions for effectiveness; general clauses that have a relatively small impact on the core rights and obligations of the contract, such as notice and service clauses, clauses concerning the validity of contract attachments, and clauses concerning the number of copies of the contract; clauses with no substantial impact that include contract numbers in headers and footers, formatting instructions, and polite expressions without substantive content; risk level determination: a risk score ≥ 7 points is defined as major risk, 4-6 points as significant risk, and ≤ 3 points as general risk; the risk score is the sum of the corresponding scores of each assessment indicator.
[0047] S4. Optimize the initial training dataset to obtain the final training dataset for text risk review.
[0048] S4.1 Perform full statistical analysis on the preliminary training dataset, calculate the sample proportion of each risk type, risk level, contract type, and industry category, and identify low-sample high-risk categories, high-sample low-risk categories, and sample coverage gaps; low-sample high-risk categories include "dispute resolution dimension - unclear jurisdictional court agreement"; high-sample low-risk categories include "textual clause dimension - typo correction risk"; sample coverage gaps include missing samples of construction industry and loan contracts, etc. S4.2. Sample optimization processing is performed on the low-risk category with few samples, the low-risk category with many samples, and the sample coverage gap to obtain an optimized training dataset. Specifically, this includes: generating new high-risk category samples for the low-risk category with few samples to expand the sample quantity, which can be achieved by executing SMOTE oversampling + synthetic minority class sample generation technology; employing a random undersampling strategy for the low-risk category with many samples to proportionally eliminate redundant samples; and incrementally supplementing the sample coverage gap with samples, adding compliance risk samples from different industries and contract types. The specific methods for expanding / increasing and eliminating samples are existing technologies and will not be elaborated upon here. S4.3. Perform indicator validation on the optimized training dataset. Indicator validation includes balance validation and diversity validation. Balance validation: Calculate the sample proportion of each risk type and the proportion deviation to ensure that the deviation is ≤ ±10%. Diversity validation: Verify whether the coverage of industries, contract types, and risk dimensions meets the standards, and whether the sample proportion of a single category is ≤ 30%. S4.4 If the verification indicators do not meet the standards, return to the sample optimization step and repeat the optimization process until the verification indicators meet the standards. If the verification indicators meet the standards, perform final cleaning of the dataset (remove duplicate samples and abnormal feature samples generated during the optimization process), generate a training dataset for text risk review, and output an optimization report to record the number of sample expansions, the feature removal list, and the indicator compliance status, ensuring that the dataset is traceable and reusable.
[0049] Please see Figure 2 Another objective of this invention is to provide a training dataset generation system based on multimodal data fusion, the system comprising: The data acquisition module is used to acquire multimodal raw data, perform modal preprocessing on the multimodal raw data to obtain a cross-modal standardized dataset and a multi-dimensional basic feature set. The multimodal raw data includes contract text modal data, legal provision modal data, standard specification modal data, and contract-related behavior modal data. The multi-dimensional basic feature set includes textual semantic features, legal association features, and behavioral patterns and quantitative features. The risk point identification module is used to generate cross-modal fusion feature vectors based on a multi-dimensional set of basic features, and combined with a pre-set text risk review rule base, to identify the actual risk points and related data of the contract. The training set generation module is used to determine the risk label of each actual risk point according to a preset classification standard based on the associated data corresponding to the actual risk points, and bind the risk label with the associated data through the data unique identifier ID to form a preliminary training dataset. The training set optimization module is used to optimize the initial training dataset to obtain the final training dataset for text risk review.
[0050] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
[0051] All formulas in this manual are dimensionless and calculated numerically. The formulas are derived from software simulations based on a large amount of collected data to obtain the most recent real-world results. The preset parameters and thresholds in the formulas are set by those skilled in the art according to the actual situation.
[0052] Although embodiments of the invention have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.
Claims
1. A method for generating training datasets based on multimodal data fusion, characterized in that, The method includes: S1. Obtain multimodal raw data, perform modal preprocessing on the multimodal raw data to obtain a cross-modal standardized dataset and a multi-dimensional basic feature set. The multimodal raw data includes contract text modal data, legal provision modal data, standard and normative modal data, and contract-related behavior modal data. The multi-dimensional basic feature set includes text semantic features, law-standard association features, and behavioral patterns and quantitative features. S2. Generate cross-modal fusion feature vectors based on multi-dimensional basic feature sets, and combine them with a pre-set text risk review rule base to determine the actual risk points and related data of the contract; S3. Based on the associated data corresponding to the actual risk points, determine the risk labels of each actual risk point according to the preset classification standards, and bind the risk labels with the associated data through the data unique identifier ID to form a preliminary training dataset; S4. Optimize the initial training dataset to obtain the final training dataset for text risk review.
2. The training dataset generation method based on multimodal data fusion according to claim 1, characterized in that, The process of performing modal preprocessing on the original multimodal data to obtain a cross-modal standardized dataset and a multi-dimensional basic feature set includes: The contract text modal data is subjected to structure transformation and useless information removal to obtain structured tagged text and text semantic features. The structured tagged text includes the clause ID, text content and associated entity corresponding to the text clause unit. The legal provisions modal data and standard norm modal data are respectively structured and parsed to construct association relationships, resulting in a law-standard knowledge graph, legal association features, and standard association features. The legal association features and standard association features constitute the law-standard association features. The contract-related behavioral modal data is subjected to structured transformation and quantification to obtain quantified structured data and behavioral patterns and quantitative characteristics; the contract-related behavioral modal data includes at least one of the following: historical contract performance data, credit and litigation data of contracting parties, and user interaction behavior log data on the contract review platform; Each contract is assigned a unique data identifier in advance. The structured labeled text of contract text modal data, the legal clause modal data and the standard specification modal data of legal-standard knowledge graph and contract-related behavior modal data are organized to obtain a cross-modal standardized dataset.
3. The training dataset generation method based on multimodal data fusion according to claim 2, characterized in that, The steps for obtaining the structured tagged text and text semantic features include: The contract text in the contract text modal data is cleaned and standardized. The processed contract text is then used to identify and label entities in the contract text using a pre-defined entity recognition model. Based on the inherent chapter titles or natural paragraphs of the contract text, and combined with a deep learning paragraph segmentation model, the continuous text is segmented into independent text clause units and assigned clause IDs. Each text clause unit is associated with the identified entities to form structured tagged text, which includes the clause ID, text content, and associated entity corresponding to the text clause unit. For the text content of each text clause unit, sentence vectors are extracted using pre-trained BERT models in the legal and standard domains as basic semantic features. For each text clause unit, TF-IDF similarity vectors with legal provision modal data and standard norm modal data are calculated, and the two vectors are concatenated as legal-standard correlation features. The basic semantic features and legal-standard correlation features are combined to form the text semantic features of the clause.
4. The training dataset generation method based on multimodal data fusion according to claim 3, characterized in that, The steps for obtaining the legal-standard knowledge graph include: By leveraging the inherent hierarchical structure of legal provisions and standards, and through rule templates and sequence labeling models, legal provisions and standards are parsed into structured forms of names, codes, hierarchical paths, and core content. Legal and standard elements are extracted from the core content to form legal / standard association data. Structured provisions / standards are then constructed based on the structured forms and the legal / standard association data. Each structured clause / standard is used as a node to establish relational edges, including reference relationships. Nodes and relational edges are stored using a graph database to obtain legal knowledge graph subgraphs and standard knowledge graph subgraphs. The legal knowledge graph subgraphs and standard knowledge graph subgraphs are then integrated to form a legal-standard knowledge graph.
5. The training dataset generation method based on multimodal data fusion according to claim 4, characterized in that, The steps for obtaining the quantified structured data, behavioral patterns, and quantified features include: Interaction logs are parsed into standard event streams; credit and litigation data of contracting entities include credit reports and historical litigation records. The ratings in the credit reports are mapped to numerical scores to obtain credit scores; historical litigation records are quantified into litigation indicators; historical contract performance data includes payment progress, default records, and acceptance results; payment progress is quantified as a percentage, default records are quantified as the number of historical defaults and the average default amount, and acceptance results are quantified as binary values or scores. The quantified historical contract performance data constitutes performance indicators; the quantified structured data includes the obtained standard event streams, litigation indicators, and performance indicators. For a given contract, the total number of times it was flagged as risk, the number of modified clauses, and the number of questions users asked the AI were counted to form behavioral statistical features. A recurrent neural network was used to encode the standard event stream, resulting in a behavioral sequence vector representing user review habits and concerns, i.e., behavioral sequence features. The credit score, litigation indicators, and performance indicators were normalized and concatenated to form a vector of entity credit and performance characteristics, i.e., external data features. Finally, the behavioral statistical features, behavioral sequence features, and external data features were combined to form the behavioral patterns and quantitative characteristics corresponding to the contract.
6. The training dataset generation method based on multimodal data fusion according to claim 5, characterized in that, The content of generating cross-modal fusion feature vectors based on multi-dimensional basic feature sets includes: The text semantic features, legal-standard association features, and behavioral patterns and quantitative features are standardized and dimensionally aligned. Based on the aforementioned legal-standard knowledge graph, the initial weights of text semantic features, legal-standard association features, and behavioral patterns and quantitative features are calculated respectively. A multi-head attention layer is constructed, with each head corresponding to a type of risk subtask. The analysis results of the attention heads are integrated through the SoftMax function to generate a dynamic weight matrix. The initial weights of text semantic features, legal-standard correlation features, and behavioral patterns and quantitative features are dynamically calibrated in real time to obtain the final weights. Based on the final weights, the text semantic features, legal-standard association features, and behavioral patterns and quantitative features are weighted and summed to obtain the initial fusion features; The initial fused features are integrated by two fully connected layers to remove redundant information; then, the integrated features are mapped to a cross-modal fused feature vector by a projection layer.
7. The training dataset generation method based on multimodal data fusion according to claim 6, characterized in that, The initial weights for calculating text semantic features, legal-standard association features, and behavioral patterns and quantitative features based on the legal-standard knowledge graph include: For the initial weights of the text semantic features, the maximum value in the TF-IDF similarity vector is extracted, and the initial weights of the text semantic features are determined based on the maximum value. The initial weights for the legal-standard association features are assigned based on the network centrality index. The initial weights for behavioral patterns and quantitative characteristics are assigned based on the subject's credit and performance characteristic vector.
8. The training dataset generation method based on multimodal data fusion according to claim 3, characterized in that, The process of determining the actual risk points and related data of a contract by combining a pre-set text risk review rule base includes: By analyzing each clause individually, using cross-modal fusion feature vectors and a text risk review rule base, potential risk points can be identified. For each potential risk point in the potential risk point list, the root cause is found from legal, standard, characteristic, and behavioral dimensions, and integrated to form an attribution report; Through multi-layered verification, false risk points caused by model misjudgment and rule adaptation errors are eliminated from potential risk points to obtain the actual risk points; The associated data corresponding to the actual risk points are recorded and stored.
9. The training dataset generation method based on multimodal data fusion according to claim 8, characterized in that, The process of analyzing each clause individually, using textual clauses as units and combining cross-modal fusion feature vectors and a text risk review rule base to pinpoint potential risk points, includes: Each clause's corresponding cross-modal fusion feature vector is input into a preset risk prediction model. The model outputs the risk probability and predicted risk type for that clause, forming the model prediction result for each clause, and potential risk points are marked. The text risk review rule base is called to verify the text content and related features of each clause rule by rule, and potential risk points are marked, resulting in rule verification results. The model prediction results and rule verification results are merged, and duplicate markings are removed. A unique risk identifier is assigned to each potential risk point, and the results are integrated to form a list of potential risk points.
10. A training dataset generation system based on multimodal data fusion, characterized in that, The system includes: The data acquisition module is used to acquire multimodal raw data, perform modal preprocessing on the multimodal raw data to obtain a cross-modal standardized dataset and a multi-dimensional basic feature set. The multimodal raw data includes contract text modal data, legal provision modal data, standard and normative modal data, and contract-related behavior modal data. The multi-dimensional basic feature set includes textual semantic features, law-standard association features, and behavioral patterns and quantitative features. The risk point identification module is used to generate cross-modal fusion feature vectors based on a multi-dimensional set of basic features, and combined with a pre-set text risk review rule base, to identify the actual risk points and related data of the contract. The training set generation module is used to determine the risk label of each actual risk point according to a preset classification standard based on the associated data corresponding to the actual risk points, and bind the risk label with the associated data through the data unique identifier ID to form a preliminary training dataset. The training set optimization module is used to optimize the initial training dataset to obtain the final training dataset for text risk review.