Contract classification method combining label association graph clustering and text structure graph attention
By combining the method of tag association graph clustering and text structure graph attention, the problem of insufficient utilization of tag association and structural information in contract classification is solved, and more efficient contract classification and understanding is achieved, which is suitable for complex legal texts.
Patent Information
- Application Number
- CN202411440502.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-16
- Publication Date
- 2024-11-15
AI Technical Summary
The existing technology is difficult to fully utilize the correlation between complex structural information and labels within the contract in contract classification, which limits the classification accuracy and generalization ability. Especially when processing Chinese legal texts, it is difficult to rely solely on the extraction of text semantic features. Mining out tag relevance and structure information.
Combining the contract classification method of label association graph clustering and text structure graph attention, through the hidden space learning of label semantics, contract feature extraction and sorting output prediction process, the graph convolution network and attention mechanism are used to construct label co-occurrence graph and clause relationship. Figure, fuse the semantic features of title, label and contract text, and perform classification prediction through multi-layer network and residual connection.
Effectively capture the complex semantic relationships between labels and the structural rules of contract text, significantly improve the accuracy and understanding ability of contract classification, is suitable for complex legal scenarios, and improves the adaptability and classification performance of the model.
Smart Images

Figure CN118964625A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of intelligent document management systems, and in particular to a contract classification method combining tag association graph clustering and text structure graph attention. Background Art
[0002] Under the current trend, economic activities are becoming more frequent, and the number of cross-industry and cross-field commercial contracts between enterprises has exploded, making efficient and accurate contract classification research a focus of academic and industry attention;
[0003] In the legal field, contract classification mainly relies on subjective reading and understanding by humans. This method is extremely dependent on individual legal knowledge, and is inefficient and error-prone, especially when processing massive amounts of legal documents.
[0004] With the development of natural language processing and machine learning technology, automated contract classification methods have gradually attracted attention. There are two references in the prior art:
[0005] Document 1, "Corpus based classification of text in Australian contracts", Chinese translation: "Corpus based classification of text in Australian contracts", Social Electronics Press, 2010; Aiming at the problem of Australian contract text classification, this paper uses a large-scale corpus combined with machine learning and manual rule coding to achieve the classification of contract components;
[0006] Reference 2, the paper “A Bytecode-based Approach for Smart Contract Classification.” Chinese translation: “A Bytecode-based Smart Contract Classification Method”, IEEE Conference, 2022, pp. 1046-1054, proposed a bytecode-based smart contract classification method;
[0007] The above-mentioned literature usually uses existing automated methods to perform coarse-grained classification of contract texts using keyword matching, rule templates, and shallow machine learning models. This often ignores the complex structural information within the contract and the correlation between labels, limiting the classification accuracy and generalization ability.
[0008] From another research perspective, early research mainly focused on single text features or more intuitive structural features, using traditional machine learning algorithms for text classification. However, with the rise of deep learning technology, researchers have realized the great potential of deep models in mining complex relational structures and deep semantic information in texts.
[0009] For example, the paper "Smart Contract Classification with a Bi-LSTM Based Approach", Chinese translation name "Smart Contract Classification Method Based on Bi-LSTM", IEEE Conference, 2020, 99 pages 1-1, its public content reflects this trend, combining the bidirectional long short-term memory network (English abbreviation: Bi-LSTM) with the Gaussian Laplace Dirichlet distribution model (GaussianLDA) to build a smart contract classification system; the system effectively improves the ability to accurately identify and classify complex contract content;
[0010] For example, Document 4, the paper “Research and Implementation of Chinese Text Classification System for Contract Field”;
[0011] Author: Sun Mingze, Northeast Petroleum University, 2024, DOI: 10.26995 / d.cnki.gdqsc.2023.001090, conducted in-depth exploration in Chinese text classification, and proposed a classification method based on rule matching and contract title, a classification method based on bidirectional long short-term memory network and contract title, and a classification method based on bidirectional long short-term memory network and contract full text, aiming to comprehensively analyze the multiple meanings and structural characteristics of contract texts;
[0012] Reference 5: Research on Chinese Contract Text Classification Based on BERT and Attention Mechanism
[0013] Author: Han Xin, Northeast Petroleum University, 2024, DOI: 10.26995 / d.cnki.gdqsc.2023.001202;
[0014] This study proposed an integrated model combining BERT, bidirectional long short-term memory network, attention mechanism and maximum pooling, which is specifically designed for detailed classification of contract titles, further demonstrating the superiority of deep learning technology in understanding the semantic content of contracts;
[0015] Nevertheless, the current research field of Chinese text classification still faces some challenges, especially in the specific application of legal contract text classification. The method that simply relies on the semantic feature extraction of the text itself is difficult to fully explore the intrinsic correlation between labels.
[0016] Therefore, contract classification solutions that can take into account both tag relevance and text structure information are particularly scarce;
[0017] When dealing with Chinese legal texts, especially contract classification, existing methods have combined pre-trained models to obtain the complex deep semantics of contract texts, such as in the paper "Research on Chinese Contract Text Classification Based on BERT and Attention Mechanism". However, like other research works, most of them simply rely on the semantic information of the contract title or text, and lack in-depth research on the correlation between labels and their impact on classification results;
[0018] At the same time, the unique structural information of the contract text is not fully utilized, such as the potential logical relationship between different clauses, the interactive relationship between the contract title and the main content of the contract, etc. These structural features are often not properly reflected and utilized in existing models;
[0019] Therefore, the improvement of classification performance and the adaptability of the model in complex legal scenarios are greatly limited. Summary of the invention
[0020] The present invention aims to solve the technical problem in the prior art that the complex structural information within the contract and the correlation between labels limit the classification accuracy and generalization ability, and provides a contract classification method that combines label association graph clustering and text structure graph attention.
[0021] In order to solve the above technical problems, the technical solutions of the present invention are as follows:
[0022] The contract classification method combining label association graph clustering and text structure graph attention includes:
[0023] Step 1: Label semantic latent space learning process;
[0024] The label semantic latent space learning process is performed by a label semantic latent space learning module, and the label semantic latent space learning module is performed in the following manner:
[0025] The tag co-occurrence graph is constructed based on the co-occurrence of existing tags, and then clustered after graph embedding to learn the semantics of the tag latent space;
[0026] Step 2: Contract feature extraction process;
[0027] The contract feature extraction process is performed by a contract feature extraction module, and the working process of the contract feature extraction module is: performing a cross-attention operation on the contract title and the tag to obtain the semantic information associated with the title and the tag;
[0028] The body of the contract is embedded with the semantic extraction of the pre-trained model and the rule-based structured clause graph through GAT, and the two features obtained are then fused through the attention mechanism to obtain the semantics of the entire contract; and
[0029] Step 3: sort and output prediction process;
[0030] The sorting output prediction process is performed by a sorting output prediction module, which works as follows: combining the fusion features of the title and label obtained by the label latent space semantics and the contract feature engineering module and the fusion of the structural information and content, and outputting the final contract category prediction sorting through a multi-layer network and residual connection.
[0031] Specifically, the label semantic latent space learning module constructs a label co-occurrence graph G based on the co-occurrence of all labels in the contract dataset, and is expressed as: G=(V,E);
[0032] Among them, V represents the label set, Indicates the co-occurrence relationship of tags;
[0033] After constructing the tag co-occurrence graph G, a TFD graph is constructed for the language model N-gram using the TF-IDF statistical method;
[0034] After the TFD graph is constructed, the graph convolutional network GCN is used in combination with the attention mechanism to perform graph node embedding learning;
[0035] Specifically, the graph convolutional network GCN propagation process can be expressed by formula (1):
[0036] (1),
[0037] in, is the normalized adjacency matrix;
[0038] in, is the attention weight matrix added based on the tag co-occurrence frequency;
[0039] in, is the feature matrix of the l-th layer nodes, is the weight matrix, is the activation function;
[0040] After the graph convolution network GCN is combined with the attention mechanism to perform graph node embedding learning, after GCN embedding, the label co-occurrence graph G is spectrally clustered to form label clusters C. The process of spectrally clustering the label co-occurrence graph G can be expressed as:
[0041] (2),
[0042] in, is the label co-occurrence graph The adjacency matrix of
[0043] in, is the degree matrix, ;
[0044] in, is the identity matrix, represents the eigenvalue, is the corresponding eigenvector, It is a matrix consisting of the eigenvectors corresponding to the first k smallest eigenvalues;
[0045] The label cluster C is expressed as: .
[0046] Specifically, the contract feature extraction module introduces a cross attention mechanism between the co-occurrence graph G of the title and the tag, so that the title vector sequence T and the tag co-occurrence graph G influence each other, so that the tag information can interconnect and guide the semantic understanding of the title;
[0047] The title vector sequence T is expressed as: ;
[0048] Among them, the cross attention mechanism can be expressed by the following formula:
[0049] (3),
[0050] (4),
[0051] Optionally, the feature extraction of the contract text content includes:
[0052] Method 1: Pre-training model to extract text semantics;
[0053] The contract text is embedded using the pre-trained language model RoBERTa to obtain the vector representation D of each document, which contains the context semantic information of the description.
[0054] Optionally, the feature extraction of the contract text content includes:
[0055] Method 2: Extract clauses based on rules and structure them into graphs;
[0056] The contract body is parsed into a series of structured clause nodes V', a content clause relationship graph G'=(V',E') is constructed, and the structural features of the nodes are extracted through the graph attention network GAT, which is expressed as formula (5):
[0057] (5),
[0058] in, ;
[0059] in, ;
[0060] || represents the concatenation operation. is a learnable attention vector.
[0061] Furthermore, the cross-attention mechanism is used to fuse the associated semantics of the title and tags and the structural semantics of the contract body, and is expressed as formula (6):
[0062] (6),
[0063] in, It is the vector after encoding the title-label cross attention result;
[0064] in, It is the text semantic feature vector extracted by the pre-training model;
[0065] in, is the structured feature vector extracted by GAT;
[0066] in, Used to concatenate these feature vectors;
[0067] in, represents a self-attention layer, which uses a weight matrix Automatically learn the importance of each feature subspace and complete weighted fusion.
[0068] Furthermore, the sorting output prediction module combines the fused feature vector Enter the multi-layer fully connected network for further
[0069] One-step feature extraction and classification prediction;
[0070] In order to alleviate the information flow bottleneck and gradient vanishing that may occur in deep networks, a residual connection mechanism is introduced between fully connected layers, which is expressed as formula (7):
[0071] (7),
[0072] in, Representative Output features of the layer;
[0073] in, is the output of the current layer;
[0074] in, Indicates Nonlinear mapping function of the layer;
[0075] in, and are the weight matrix and bias term of this layer respectively;
[0076] Through the residual connection mechanism, the network can directly skip certain layers and pass the feature information of the previous layer directly to the subsequent layers, thereby improving training efficiency and model performance.
[0077] Furthermore, in the stage of the pre-training model, a cross entropy loss function for the label cluster level is formulated, which is expressed as formula (8):
[0078] (8),
[0079] In the cross entropy loss function, C represents the set of all contract samples, K represents the total number of label categories, represents the kth label cluster;
[0080] in, is a label cluster The actual label category A binary indicator variable of ;
[0081] is the model prediction label, Belongs to the tag cluster probability.
[0082] Furthermore, the cross entropy loss function can be continuously optimized and combined with the residual connection mechanism, so that the final model can accurately predict the various labels belonging to the contract at different levels of abstraction, and output them in order according to the label clusters, thereby realizing comprehensive structured analysis and efficient retrieval of complex contract content.
[0083] The present invention has the following beneficial effects:
[0084] First, the proposed contract classification method that combines label association graph clustering and text structure graph attention came into being; this method integrates a variety of cutting-edge natural language processing technologies and graph neural network architectures, which can not only effectively capture the complex semantic associations between labels, but also keenly understand the internal structural laws of contract texts;
[0085] Secondly, the classification method proposed in this plan not only enriches the technical path for the classification of legal contract texts, but also opens up a new path for the intelligent processing of legal big data, and is expected to play a vital role in future legal practice activities.
[0086] Thirdly, the method proposed in this scheme is more suitable for the field of legal contract classification. It makes full use of the label association graph and comprehensively captures the semantic connotation of the label set through the clustering method, effectively avoiding the phenomenon of information fragmentation.
[0087] At the same time, a graph attention network is used to model the relationships between contract terms, enabling the model to fully understand and utilize these structural relationships, thereby significantly improving the ability to understand and classify complex contract content. BRIEF DESCRIPTION OF THE DRAWINGS
[0088] The present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments.
[0089] Figure 1 It is a schematic diagram of the fusion features of the label semantic latent space learning module of the present invention;
[0090] Figure 2 It is a schematic diagram of a contract feature extraction module of the present invention;
[0091] Figure 3 A schematic diagram of a sorting output prediction module of the present invention;
[0092] Figure 4 It is a schematic diagram of the overall framework of the method of the present invention. DETAILED DESCRIPTION
[0093] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention; it should be noted that in this application, for the convenience of description, the "left side" in the current view is the "first end", the "right side" is the "second end", the "upper side" is the "first end", and the "lower side" is the "second end". The purpose of such description is to clearly express the technical solution, and it should not be understood as an improper limitation on the technical solution of this application.
[0094] The contract classification method combining label association graph clustering and text structure graph attention includes:
[0095] Step 1: Label semantic latent space learning process;
[0096] The label semantic latent space learning process is performed by a label semantic latent space learning module, and the label semantic latent space learning module is performed in the following manner:
[0097] The tag co-occurrence graph is constructed based on the co-occurrence of existing tags, and then spectral clustering is performed after graph embedding to learn the semantics of the tag latent space;
[0098] Step 2: Contract feature extraction process;
[0099] The contract feature extraction process is performed by a contract feature extraction module, and the working process of the contract feature extraction module is: performing a cross-attention operation on the contract title and the tag to obtain the semantic information associated with the title and the tag;
[0100] The text of the contract is embedded into a graph using the semantic extraction of the pre-trained model and the rule-based structured clause graph through GAT, and the two features obtained are then fused through the attention mechanism to obtain the joint semantics of the text structure of the entire contract text;
[0101] And obtaining the contract fusion features of the title-tag associated semantic information and the text-structure joint semantics through a self-attention mechanism;
[0102] Step 3: sort and output prediction process;
[0103] The sorting output prediction process is performed by a sorting output prediction module, which works as follows: combining the fusion features of the title and label obtained by the label latent space semantics and the contract feature engineering module and the fusion of the structural information and content, and outputting the final contract category prediction sorting through a multi-layer network and residual connection.
[0104] As attached Figure 4 As shown, the schematic diagram of the overall framework of this method is designed in the framework, which includes data extraction layer, feature extraction layer, semantic fusion layer, model prediction layer, and output layer;
[0105] Among them, the data extraction layer corresponds to the content in step 1;
[0106] Among them, the feature extraction layer and the semantic fusion layer correspond to the content in step 2;
[0107] Among them, Type 1, Type 2, and Type 3 represent the contract category prediction sorting types.
[0108] In an implementable embodiment, the tag semantic latent space learning module constructs a tag co-occurrence graph G based on the co-occurrence of all tags in the contract data set, and is expressed as: G=(V,E);
[0109] Among them, V represents the label set, Indicates the co-occurrence relationship of tags;
[0110] After constructing the tag co-occurrence graph G, a TFD graph is constructed for the language model N-gram using the TF-IDF statistical method;
[0111] After the TFD graph is constructed, the graph convolutional network GCN is used in combination with the attention mechanism to perform graph node embedding learning;
[0112] In an implementable embodiment, the graph convolutional network GCN propagation process can be expressed by formula (1):
[0113] (1),
[0114] in, is the normalized adjacency matrix;
[0115] in, is the attention weight matrix added based on the tag co-occurrence frequency;
[0116] in, is the feature matrix of the l-th layer nodes, is the weight matrix, is the activation function;
[0117] After the graph convolution network GCN is combined with the attention mechanism to perform graph node embedding learning, after GCN embedding, the label co-occurrence graph G is spectrally clustered to form label clusters C. The process of spectrally clustering the label co-occurrence graph G can be expressed as:
[0118] (2) ,
[0119] in, is the label co-occurrence graph The adjacency matrix of
[0120] in, is the degree matrix, ;
[0121] in, is the identity matrix, represents the eigenvalue, is the corresponding eigenvector, It is a matrix consisting of the eigenvectors corresponding to the first k smallest eigenvalues;
[0122] The label cluster C is expressed as: .
[0123] In an implementable embodiment, the contract feature extraction module introduces a cross attention mechanism between the co-occurrence graph G of the title and the tag, so that the title vector sequence T and the tag co-occurrence graph G influence each other, so that the tag information can interconnect to guide the semantic understanding of the title;
[0124] The title vector sequence T is expressed as: ;
[0125] Among them, the cross attention mechanism can be expressed by the following formula:
[0126] (3),
[0127] (4),
[0128] In addition, there are two methods for extracting the features of the contract text content:
[0129] They are:
[0130] Method 1: Pre-training model to extract text semantics;
[0131] The contract text is embedded using the pre-trained language model RoBERTa to obtain the vector representation D of each document, which contains the context semantic information of the description.
[0132] Method 2: Extract clauses based on rules and structure them into graphs;
[0133] The contract body is parsed into a series of structured clause nodes V', a content clause relationship graph G'=(V',E') is constructed, and the structural features of the nodes are extracted through the graph attention network GAT, which is expressed as formula (5):
[0134] (5),
[0135] in, ;
[0136] in, ;
[0137] || represents the concatenation operation. is a learnable attention vector.
[0138] In a specific embodiment, the self-attention mechanism is used to fuse the associated semantics of the title and the tag and the structural semantics of the contract body, and is expressed as formula (6):
[0139] (6),
[0140] in, It is the vector after encoding the title-label cross attention result;
[0141] in, It is the text semantic feature vector extracted by the pre-training model;
[0142] in, is the structured feature vector extracted by GAT;
[0143] in, Used to concatenate these feature vectors;
[0144] in, represents a self-attention layer, which uses a weight matrix Automatically learn the importance of each feature subspace and complete weighted fusion.
[0145] In a specific embodiment, the sorting output prediction module combines the fused feature vector Enter the multi-layer fully connected network for further feature extraction and classification prediction;
[0146] In order to alleviate the information flow bottleneck and gradient vanishing that may occur in deep networks, a residual connection mechanism is introduced between fully connected layers, which is expressed as formula (7):
[0147] (7),
[0148] in, Representative Output features of the layer;
[0149] in, is the output of the current layer;
[0150] in, Indicates Nonlinear mapping function of the layer;
[0151] in, and are the weight matrix and bias term of this layer respectively;
[0152] Through the residual connection mechanism, the network can directly skip certain layers and pass the feature information of the previous layer directly to the subsequent layers, thereby improving training efficiency and model performance.
[0153] In a specific embodiment, in the stage of the pre-training model, a cross entropy loss function for the label cluster level is formulated, which is expressed as formula (8):
[0154] (8),
[0155] In the cross entropy loss function, C represents the set of all contract samples, K represents the total number of label categories, represents the kth label cluster;
[0156] in, is a label cluster The actual label category A binary indicator variable of ;
[0157] If it exists, it is 1, otherwise it is 0;
[0158] is the model prediction label, Belongs to the tag cluster probability.
[0159] In a specific embodiment, the cross entropy loss function can be continuously optimized and combined with the residual connection mechanism, so that the final model can accurately predict the various labels belonging to the contract at different levels of abstraction, and output them in order according to the label clusters, thereby achieving comprehensive structured analysis and efficient retrieval of complex contract content.
[0160] The core innovation of this method lies in:
[0161] A contract classification method combining label association graph clustering and text structure graph attention mechanism is developed. This method solves the problem that the existing technology fails to effectively utilize label association and text structure information, including:
[0162] Label association graph clustering: This method constructs a label semantic association graph based on label co-occurrence, and deeply explores and quantifies the association between label clusters by combining graph convolutional neural network (GCN) with attention mechanism, effectively enhancing the model's semantic understanding ability for contract category judgment;
[0163] Text structure graph attention mechanism: When processing the contract text, a structured processing method is adopted, and each clause of the contract content is used as a graph node, and its semantic features are obtained through a pre-trained model. Then, the graph attention network GATs is used to capture the potential relationship between the clauses, and the attention mechanism is used to fuse the semantic features of the label association graph node and the contract title, effectively reducing information redundancy and retaining the integrity of the text structure information.
[0164] In practical applications, this technical solution is preferably used in the processing of legal contracts. This method helps to improve the intelligence of contract review, management and intelligent retrieval systems, reduce labor costs, speed up work efficiency, and improve the standardization and consistency of legal affairs processing through automated processing, bringing higher efficiency and quality to the legal industry. It is expected to play an important role in the field of intelligent contract processing.
[0165] Obviously, the above embodiments are merely examples for the purpose of clear explanation, and are not intended to limit the implementation methods. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the implementation methods here. The obvious changes or modifications derived therefrom are still within the scope of protection of the invention.
Claims
1. A contract classification method combining label association graph clustering and text structure graph attention, characterized in that: include: Step 1: Label semantic latent space learning process; The label semantic latent space learning process is performed by a label semantic latent space learning module, and the label semantic latent space learning module is performed in the following manner: The tag co-occurrence graph is constructed based on the co-occurrence of existing tags, and then spectral clustering is performed after graph embedding to learn the semantics of the tag latent space; Step 2: Contract feature extraction process; The contract feature extraction process is performed by a contract feature extraction module, and the working process of the contract feature extraction module is: performing a cross-attention operation on the contract title and the tag to obtain the semantic information associated with the title and the tag; The text of the contract is embedded into a graph using the pre-trained model semantic extraction and the rule-based structured clause graph through GAT, and the two features obtained are then fused through the attention mechanism to obtain the semantics of the entire contract; And obtaining the contract fusion features of the title-tag associated semantic information and the text-structure joint semantics through a self-attention mechanism; Step 3: sort and output prediction process; The sorting output prediction process is performed by a sorting output prediction module, which works as follows: combining the fusion features of the title and label obtained by the label latent space semantics and the contract feature engineering module and the fusion of the structural information and content, and outputting the final contract category prediction sorting through a multi-layer network and residual connection.
2. The contract classification method combining label association graph clustering and text structure graph attention as claimed in claim 1 is characterized in that: The label semantic latent space learning module constructs a label co-occurrence graph G based on the co-occurrence of all labels in the contract dataset and is expressed as: G=(V,E); Among them, V represents the label set, Indicates the co-occurrence relationship of tags; After constructing the tag co-occurrence graph G, a TFD graph is constructed for the language model N-gram using the TF-IDF statistical method; Among them, Vi and Vj are different labels of the values selected by the set; After the TFD graph is constructed, the graph convolutional network GCN is used in combination with the attention mechanism to perform graph node embedding learning.
3. The contract classification method combining label association graph clustering and text structure graph attention as claimed in claim 2 is characterized in that: The graph convolutional network GCN propagation process can be expressed by formula (1): (1), in, is the normalized adjacency matrix; in, is the attention weight matrix added based on the tag co-occurrence frequency; in, is the normalized degree matrix; in, is the feature matrix of the l-th layer nodes, is the weight matrix, is the activation function; After the graph convolution network GCN is combined with the attention mechanism to perform graph node embedding learning, after GCN embedding, the label co-occurrence graph G is spectrally clustered to form label clusters C. The process of spectrally clustering the label co-occurrence graph G can be expressed as: (2), in, is the label co-occurrence graph The adjacency matrix of in, is the degree matrix, , and is the node index in the co-occurrence graph; in, is the identity matrix, represents the eigenvalue, is the corresponding eigenvector, It is a matrix consisting of the eigenvectors corresponding to the first k smallest eigenvalues; in, is the normalized graph Laplacian matrix; The label cluster C is expressed as: .
4. The contract classification method combining label association graph clustering and text structure graph attention as claimed in claim 3 is characterized in that: The contract feature extraction module introduces a cross attention mechanism between the co-occurrence graph G of the title and the tag, so that the title vector sequence T and the tag co-occurrence graph G influence each other, so that the tag information can interconnect to guide the semantic understanding of the title; The title vector sequence T is expressed as: ; Among them, the cross attention mechanism can be expressed by the following formula: (3), (4); in, Indicates the first The vector of the word Is the first in the title sequence The vector of the word; in, Is a label node The embedding vector of in, is the hyperbolic tangent activation function used to introduce nonlinearity; in, It is an exponential function used to amplify the calculation results; in, and is the summation process in the attention mechanism, used to calculate The label index and The normalized weight of each title word; in, represents the attention weight from the contract title to the label, reflecting the label Title word The degree of influence represents the attention weight from the label to the contract title, reflecting the title word Tag degree of impact.
5. The contract classification method combining label association graph clustering and text structure graph attention as claimed in claim 4 is characterized in that: The feature extraction of the content of the contract text includes: Method 1: Extract the semantics of the contract text based on the pre-trained model; The contract text is embedded using the pre-trained language model RoBERTa to obtain the vector representation D of each document, which contains the context semantic information of the description.
6. The contract classification method combining label association graph clustering and text structure graph attention as claimed in claim 4, characterized in that: The feature extraction of the content of the contract text includes: Method 2: Extract clauses based on rules and structure them into graphs; The contract body is parsed into a series of structured clause nodes V', a content clause relationship graph G'=(V',E') is constructed, and the structural features of the nodes are extracted through the graph attention network GAT, which is expressed as formula (5): (5), in, ; in, yes After normalization function The obtained attention coefficient represents the node For Node The attention weight of in, ; in, is a rectified linear unit The obtained node and nodes The attention energy score between ; in, Represents a splicing operation, It is a graph convolutional network The weight matrix of the layer, is a learnable attention vector, and The nodes are With Node In the The feature vector of the layer; in, is the bias term, Is a node The set of neighbor nodes of in, After the attention mechanism and activation function The new node representation is obtained.
7. The contract classification method combining label association graph clustering and text structure graph attention as described in claim 5 or 6, characterized in that: The attention mechanism is used to integrate the associated semantics of the title and tags and the structural semantics of the contract body, and is expressed as formula (6): (6), in, It is the vector after encoding the title-label cross attention result; in, It is the text semantic feature vector extracted by the pre-training model; in, is the structured feature vector extracted by GAT; in, Used to concatenate these feature vectors; in, represents a self-attention layer, which uses a weight matrix Automatically learn the importance of each feature subspace and complete weighted fusion; in, It is the feature vector after weighted fusion of the self-attention layer.
8. The contract classification method combining label association graph clustering and text structure graph attention as claimed in claim 7, characterized in that: The sorting output prediction module takes the fused feature vector Enter the multi-layer fully connected network for further feature extraction and classification prediction; In order to alleviate the information flow bottleneck and gradient vanishing that may occur in deep networks, a residual connection mechanism is introduced between fully connected layers, which is expressed as formula (7): (7), in, Representative Output features of the layer; in, is the output of the current layer; in, Indicates Nonlinear mapping function of the layer; in, and are the weight matrix and bias term of this layer respectively; Through the residual connection mechanism, the network can directly skip certain layers and pass the feature information of the previous layer directly to the subsequent layers, thereby improving training efficiency and model performance.
9. The contract classification method combining label association graph clustering and text structure graph attention as claimed in claim 8, characterized in that: In the pre-training model stage, a cross entropy loss function for the label cluster level is formulated, expressed as formula (8): (8), In the cross entropy loss function, C represents the set of all contract samples, K represents the total number of label categories, represents the kth label cluster; in, is a label cluster The actual label category A binary indicator variable of ; is the model prediction label, Belongs to the tag cluster probability.
10. The contract classification method combining label association graph clustering and text structure graph attention as claimed in claim 9, characterized in that: The cross entropy loss function can be continuously optimized, and combined with the residual connection mechanism, the final model can accurately predict the various labels belonging to the contract at different levels of abstraction, and output them in order according to the label clusters, thereby realizing comprehensive structured analysis and efficient retrieval of complex contract content.
Citation Information
Patent Citations
Text classification method based on combination of titles and texts of graph network
CN112347255A
Text classification method based on particle swarm optimization and CNN (Convolutional Neural Network)
CN117891939A
Document management system and method based on artificial intelligence
CN118761736A
Cited By
Legal decision prediction method and device for solving similar label confusion
CN121435955A
A legal judgment prediction method and device for solving similar label confusion
CN121435955B
