Long document classification method and device based on hierarchical multi-granularity interaction graph convolution network
By constructing a hierarchical, multi-granularity interactive graph convolutional network, long documents are segmented into paragraph, sentence, and word graphs, which solves the problem of insufficient structured information modeling in long document classification and achieves efficient long document classification.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING UNIV OF TECH
- Filing Date
- 2023-03-24
- Publication Date
- 2026-04-24
AI Technical Summary
Existing methods struggle to effectively model the complete hierarchical structure of long documents in long document classification, and their high computational complexity leads to inefficiency when processing long documents.
We employ a method based on hierarchical multi-granularity interactive graph convolutional networks. By segmenting long documents into equal-length paragraphs, we construct paragraph graphs, sentence graphs, and word graphs. By combining inter-graph interactions and feature fusion, we can control computational complexity while characterizing the hierarchical structure information of long documents.
It effectively characterizes the hierarchical structure of long documents, improves the accuracy and efficiency of long document classification, reduces computational complexity, and outperforms existing methods.
Smart Images

Figure CN116522195B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and in particular to a long document classification method based on hierarchical multi-granularity interactive graph convolutional networks, as well as a long document classification device based on hierarchical multi-granularity interactive graph convolutional networks, which is applicable to long document classification tasks in the field of natural language processing. Background Technology
[0002] Driven by both data and task requirements, long document classification has become a research hotspot in the field of natural language processing, with wide applications in document analysis, document management, and personalized document recommendation. Compared to short text data, long document sequences are typically longer and more complex in structure. How to model this complex structured information while maintaining low computational complexity is a key issue in long document sequence processing. To address this, a series of methods have been proposed in recent years, which can be broadly categorized into two types: data segmentation-based methods and model simplification-based methods.
[0003] (1) Long document classification method based on data segmentation
[0004] The core of this type of method lies in segmenting long document sequences into regular short text blocks using a sliding window or equidistant segmentation. Then, hierarchical mechanisms, recurrent mechanisms, or key clause selection mechanisms are used to facilitate information interaction within and between blocks. Specifically, hierarchical mechanisms independently establish information interaction within and between blocks in a layered manner. Recurrent mechanisms attempt to introduce recurrent memory modules into the Transformer module to further promote information interaction between blocks. Unlike the above methods, key clause selection mechanisms attempt to mimic human cognitive behavior, using a discriminative network to select highly discriminative key blocks to complete corresponding reasoning or classification tasks.
[0005] (2) A long document classification method based on model simplification
[0006] The core of this type of method lies in replacing the original Transformer's self-attention mechanism, which has a complexity quadratic with the input length, with a sparse attention mechanism. This allows the model to process text sequences of thousands or longer as a text stream. Currently, there are three main sparsity mechanisms: fixed mode, parametric mode, and low-rank mode. The fixed mode primarily uses methods such as sliding window attention, random attention, and global attention to limit the interaction regions of words. The parametric mode, by introducing a dynamic modeling mechanism, adaptively selects the interaction objects of words, thus better capturing global and local contextual information. Unlike the above methods, the low-rank mode reduces the model's space complexity by projecting the query and key-value matrices from the self-attention mechanism into a low-dimensional space.
[0007] Existing methods mostly focus on text flow modeling, or model the structural information of long document sequences in a simple or crude way by dividing them into blocks. They have not explored the complete hierarchical structure information of long document sequences very well. Summary of the Invention
[0008] To overcome the shortcomings of existing technologies, the technical problem to be solved by this invention is to provide a long document classification method based on hierarchical multi-granularity interactive graph convolutional networks. This method can construct a network to characterize the complete hierarchical structured information of long documents and perform inter-graph information interaction while controlling the computational complexity of the model.
[0009] The technical solution of this invention is: a long document classification method based on hierarchical multi-granularity interactive graph convolutional networks, comprising the following steps:
[0010] (1) In order to obtain a hierarchical multi-granular representation of a long document, the long document t is divided into l segments of equal length {v1, v2, ..., v...}. l}, where v i ={w i0 w i1 w i2 , ..., w ir}, i = 1, 2, ..., l represents the word sequence of the i-th segment, w i0 =[CLS] indicates the added global flag, where l and r represent the number of paragraphs in the long document t and the number of words in each paragraph, respectively. Each paragraph is sequentially fed into the pre-trained encoder f(·, θ) to obtain the corresponding paragraph and word representations.
[0011] [v i x i1 x i2 , ..., x ir ]=f(v i , θ), i=1, 2,..., l (1);
[0012] (2) Perform multi-level superimposed paragraph graph convolution, sentence graph convolution and word graph convolution, as well as the corresponding graph interactions;
[0013] (3) In order to integrate semantic information of different granularities and scales, max pooling is used to aggregate the final output of the paragraph graph, as well as the output of each layer of the sentence graph and word graph.
[0014] This invention constructs paragraph graphs, sentence graphs, and word graphs to characterize the complete hierarchical structure of long documents. The paragraph graph, based on conventional graph convolution, is responsible for modeling the macroscopic structure of long documents, while the sentence graph, based on global-local graph convolution, and the word graph, based on decoupled graph convolution, are responsible for modeling the microscopic structures of different granularities within the long document. To control computational complexity and enhance inter-graph interaction, two paragraph-guided pooling modules and a transfer learning fusion module are further introduced into the network. The overall network follows a feature pooling-feature learning-feature interaction process. This invention solves the problems of how to construct a network to characterize the complete hierarchical structure of long documents while controlling model computational complexity, and how to achieve inter-graph information interaction.
[0015] A long document classification device based on a hierarchical multi-granularity interactive graph convolutional network is also provided, the device comprising:
[0016] The multi-granularity coding network module, in order to obtain a hierarchical multi-granularity representation of a long document, divides the long document t into segments of equal length l {v1, v2, ..., v...}. l}, where v i ={w i0 w i1 w i2 , ..., w ir}, i = 1, 2, ..., l represents the word sequence of the i-th segment, w i0 =[CLS] indicates the added global flag, where l and r represent the number of paragraphs in the long document t and the number of words in each paragraph, respectively. Each paragraph is sequentially fed into the pre-trained encoder f(·, θ) to obtain the corresponding paragraph and word representations.
[0017] [v i x i1 x i2 , ..., x ir ]=f(v i , θ), i=1, 2,..., l (1);
[0018] The hierarchical multi-granularity interactive graph convolutional network module performs multi-layered paragraph graph convolution, sentence graph convolution, and word graph convolution, as well as corresponding inter-graph interactions;
[0019] In order to fuse semantic information of different granularities and scales, the feature fusion network module uses max pooling to aggregate the final layer output of the paragraph graph, as well as the output of each layer of the sentence graph and word graph. Attached Figure Description
[0020] Figure 1 A long document classification network framework based on a hierarchical multi-granularity interactive graph convolutional network is presented.
[0021] Figure 2 This is a diagram illustrating the paragraph-guided sentence pooling method.
[0022] Figure 3 It is a global-local graph convolutional structure graph.
[0023] Figure 4 This is a diagram illustrating the word pooling method used to guide paragraphs.
[0024] Figure 5 A flowchart of a long document classification method based on a hierarchical multi-granularity interactive graph convolutional network according to the present invention is shown. Detailed Implementation
[0025] like Figure 5 As shown, this long document classification method based on hierarchical multi-granularity interactive graph convolutional networks includes the following steps:
[0026] (1) In order to obtain a hierarchical multi-granular representation of a long document, the long document t is divided into l segments of equal length {v1, v2, ..., v...}. l}, where v i ={w i0 w i1 w i2 , ..., w ir}, i = 1, 2, ..., l represents the word sequence of the i-th segment, w i0 =[CLS] indicates the added global flag, where l and r represent the number of paragraphs in the long document t and the number of words in each paragraph, respectively. Each paragraph is sequentially fed into the pre-trained encoder f(·, θ) to obtain the corresponding paragraph and word representations.
[0027] [v i x i1 x i2 , ..., x ir ]=f(vi, θ), i=1, 2,..., l (1);
[0028] (2) Perform multi-level superimposed paragraph graph convolution, sentence graph convolution and word graph convolution, as well as the corresponding graph interactions;
[0029] (3) In order to integrate semantic information of different granularities and scales, max pooling is used to aggregate the final output of the paragraph graph, as well as the output of each layer of the sentence graph and word graph.
[0030] This invention constructs paragraph graphs, sentence graphs, and word graphs to characterize the complete hierarchical structure of long documents. The paragraph graph, based on conventional graph convolution, is responsible for modeling the macroscopic structure of long documents, while the sentence graph, based on global-local graph convolution, and the word graph, based on decoupled graph convolution, are responsible for modeling the microscopic structures of different granularities within the long document. To control computational complexity and enhance inter-graph interaction, two paragraph-guided pooling modules and a transfer learning fusion module are further introduced into the network. The overall network follows a feature pooling-feature learning-feature interaction process. This invention solves the problems of how to construct a network to characterize the complete hierarchical structure of long documents while controlling model computational complexity, and how to achieve inter-graph information interaction.
[0031] Preferably, in step (1), the final paragraph feature representation And the final word feature representation Where d represents the corresponding feature dimension; to avoid secondary input of data, the initial sentence representation is obtained by directly aggregating the word features within the same sentence through max pooling. This process is carried out by the sentence mask S. mask The guidance consists of an increasing sequence of repeating numbers, where words within the same sentence have the same numerical value. The final sentence features are calculated as follows:
[0032]
[0033]
[0034] Where m represents the total number of sentences in the long document T, and the final sentence features are represented as follows:
[0035]
[0036] Preferably, in step (2), the segment graph convolution is:
[0037] Based on paragraph features An initial fully connected paragraph graph is constructed using a self-attention mechanism, and feature learning and updating of the paragraph graph are achieved using a graph convolutional neural network.
[0038]
[0039]
[0040] in This represents the normalized adjacency matrix. Let represent a symmetric node degree matrix, and W n This represents the parameterization matrix of the nth layer.
[0041] Preferably, in step (2), the sentence graph convolution is performed as follows: sentence graph learning is carried out using feature pooling-feature learning-feature interaction as the basic process. The purpose of pooling is to eliminate redundant sentence nodes and reduce the computational complexity of the model. Max pooling is performed on the paragraph features, and its output P is used as the projection vector. Then, the sentence nodes are projected onto the direction P respectively, and the highest score is obtained. The indices of each node are shown below:
[0042]
[0043] Based on the above index, the corresponding sentence nodes and the migration mask T are extracted respectively. s-v The specific process is as follows:
[0044]
[0045]
[0046] in This represents the correspondence between sentence nodes and paragraph nodes; that is, if sentence node i belongs to paragraph node j, then [T] s-v ] ij =1.
[0047] Preferably, in step (2), the global graph convolutional block is responsible for capturing long-distance dependencies between sentence nodes, and for the pooled sentence features... The relevance coefficient is calculated using a multi-head attention mechanism. Assuming there are H heads in total, the similarity matrix of the h-th head... Where d k =d / H, then the overall multi-head attention mechanism is represented as follows:
[0048]
[0049]
[0050] Where concat represents concatenation along the feature dimension, W h,q W h,k W h,v W o The parameterized matrix is represented by a local graph convolutional block responsible for dynamically capturing local dependencies between sentence nodes. To directly model local dependencies, a window attention mask of size w is first generated. A threshold η is added to the multi-head adjacency matrix of the global graph convolutional block to obtain global neighbors with strong semantic associations, as shown below:
[0051]
[0052] Then copy Al The matrix of order H is denoted as A′. l This is then added to the dynamic global neighbor tensor mentioned above to obtain the multi-head attention adjacency matrix of the final local convolutional block, which is used to complete the feature update of the local convolutional block, as shown below:
[0053]
[0054]
[0055] The fusion of global and local signals is achieved through a dynamic gating mechanism:
[0056]
[0057] To enable interaction between high-level paragraph and sentence graphs, a transfer fusion module is used. If sentence node i belongs to paragraph node j, the corresponding paragraph features are concatenated onto the sentence node features, and feature fusion is completed through linear mapping.
[0058]
[0059] Preferably, in step (2), the processes for word graph convolution and sentence graph convolution are consistent: feature pooling - feature learning - feature interaction. For pooling, the max pooling feature of the paragraph feature is still selected as the projection vector, and the highest-scoring feature is selected. The overall calculation process, with each node serving as the final word node, is as follows:
[0060]
[0061]
[0062]
[0063]
[0064] Based on the pooling features described above, word-level feature learning is performed using existing decoupled graph convolutional blocks. Specifically, in pooling word features... The above uses a self-attention mechanism to obtain the word similarity matrix, and then divides it into intra-segment and inter-segment adjacency matrices according to a predetermined paragraph length. The intra-segment adjacency matrix incorporates paragraph and sentence masks to enhance feature interaction within the segment. This is followed by inter-segment graph convolution and residual branching to complete the corresponding feature updates, as shown below:
[0065]
[0066]
[0067]
[0068]
[0069] Finally, the gating unit controls the degree of information update, and the migration fusion module is used to achieve interactive fusion of paragraph graphs and word graphs:
[0070]
[0071]
[0072] Preferably, in step (3), it is represented as follows:
[0073] V m =maxpooling(V N (26)
[0074] S m =[maxpooling(S 1 ), ..., maxpooling(S N (27)
[0075] X m =[maxpooling(X 1 ), ..., maxpooling(X N (28)
[0076] Finally, max pooling is used to complete the multi-granularity feature fusion:
[0077] u = maxpooling([V m S m X m (29)
[0078] The network was trained using cross-entropy classification loss. In addition, to ensure the discriminative nature of the guiding vector, cross-entropy classification constraints were added to the max-pooling features of the initial paragraph.
[0079] A long document classification device based on a hierarchical multi-granularity interactive graph convolutional network is also provided, the device comprising:
[0080] The multi-granularity coding network module, in order to obtain a hierarchical multi-granularity representation of a long document, divides the long document t into segments of equal length l {v1, v2, ..., v...}. l}, where v i ={w i0 w i1 w i2 , ..., w ir}, i = 1, 2, ..., l represents the word sequence of the i-th segment, wi0 =[CLS] indicates the added global flag, l and r represent the number of paragraphs in the long document t and the number of words in each paragraph, respectively. Each paragraph is fed into the pre-trained encoder f(·, θ) in sequence.
[0081] Within this, the corresponding paragraphs and words are obtained.
[0082] [v i x i1 x i2 , ..., x ir ]=f(v i , θ), i=1, 2,..., l (1);
[0083] The hierarchical multi-granularity interactive graph convolutional network module performs multi-layered paragraph graph convolution, sentence graph convolution, and word graph convolution, as well as corresponding inter-graph interactions;
[0084] In order to fuse semantic information of different granularities and scales, the feature fusion network module uses max pooling to aggregate the final layer output of the paragraph graph, as well as the output of each layer of the sentence graph and word graph.
[0085] The present invention will now be described in more detail.
[0086] The long document classification method based on hierarchical multi-granularity interactive graph convolutional networks proposed in this invention can effectively compensate for the shortcomings of existing methods in modeling structured information. By introducing the concept of multi-granularity hierarchical graphs, it simultaneously models textual and structured information within and between granularities to enhance text representation capabilities. The corresponding flowchart is as follows: Figure 1 As shown, it mainly consists of the following three parts:
[0087] Step 1: Multi-granularity coding network
[0088] To obtain a hierarchical, multi-granular representation of long documents, the long document t is segmented into equal-length segments {v1, v2, ..., v...}. l}, where v i ={w i0 w i1 w i2 , ..., w ir}, i = 1, 2, ..., l represents the word sequence of the i-th segment, w i0 =[CLS] indicates the addition of a global flag, where l and r represent the number of paragraphs in the long document t and the number of words in each paragraph, respectively. For example... Figure 1 As shown, each text segment is sequentially fed into the pre-trained encoder f(·, θ) to obtain the corresponding paragraph and word representations, i.e.:
[0089] [v i xi1 x i2 , ..., x ir ]=f(v i , θ), i=1, 2,..., l (1)
[0090] Based on the above expressions, the final paragraph feature representation can be obtained. And the final word feature representation Here, d represents the corresponding feature dimension. To avoid secondary input of data, the initial sentence representation is obtained directly by max pooling the word features within the sentence. This process is achieved using the sentence mask S. mask The guidance consists of an increasing sequence of repeating numbers, where words within the same sentence have the same numerical value. The final sentence feature calculation is as follows:
[0091]
[0092]
[0093] Where m represents the total number of sentences in the long document t, the final sentence features can be represented as:
[0094] Step 2: Hierarchical Multi-Granularity Interactive Graph Convolutional Network
[0095] This section mainly includes multi-layered paragraph graph convolution, sentence graph convolution, and word graph convolution, as well as the corresponding inter-graph interaction module, as shown below:
[0096] A. Paragraph Graph Convolution: Based on paragraph features An initial fully connected paragraph graph is constructed using a self-attention mechanism, and feature learning and updating of the paragraph graph are achieved using a graph convolutional neural network.
[0097]
[0098]
[0099] in This represents the normalized adjacency matrix. Let represent a symmetric node degree matrix, and W n This represents the parameterization matrix of the nth layer.
[0100] B. Sentence Graph Convolution: This method uses feature pooling, feature learning, and feature interaction as its basic process for sentence graph learning. Pooling aims to eliminate redundant sentence nodes while reducing the model's computational complexity. For example... Figure 2As shown, max pooling is performed on the paragraph features, and its output p is used as the projection vector. Then, sentence nodes are projected onto direction p, and the highest-scoring vector is obtained. The indices of each node are shown below:
[0101]
[0102] Based on the above index, the corresponding sentence nodes and the migration mask T are extracted respectively. s-v The specific process is as follows:
[0103]
[0104]
[0105] in This represents the correspondence between sentence nodes and paragraph nodes; that is, if sentence node i belongs to paragraph node j, then [T] s-v ] ij =1. For the pooled sentence nodes While using global modeling enhances feature representation, it introduces unnecessary noise. To address this issue, we propose a global-local graph convolutional block, with the specific structure as follows: Figure 3 As shown, the global graph convolutional block is responsible for capturing long-distance dependencies between sentence nodes. Specifically, for the pooled sentence features... The relevance coefficient is calculated using a multi-head attention mechanism. Assuming there are H heads in total, the similarity matrix of the h-th head... Where d k =d / H, then the overall multi-head attention mechanism can be represented as follows:
[0106]
[0107]
[0108] Where concat represents concatenation along the feature dimension, W h,q W h,k W h,v W o This represents a parameterized matrix. Correspondingly, the local graph convolutional block is responsible for dynamically capturing the local dependencies between sentence nodes. For example... Figure 3 As shown, in order to directly model local dependencies, a window attention mask of size w was first generated. However, a fixed window limits its representational power. To address this, we add a threshold η to the multi-head adjacency matrix of the global graph convolutional block to obtain global neighbors with strong semantic associations, as shown below:
[0109]
[0110] Then copy A l The matrix of order H is denoted as A′. l This is then added to the dynamic global neighbor tensor mentioned above to obtain the multi-head attention adjacency matrix of the final local convolutional block, which is used to complete the feature update of the local convolutional block, as shown below:
[0111]
[0112]
[0113] Finally, the fusion of global and local signals is achieved through a dynamic gating mechanism, namely:
[0114]
[0115] To enable interaction between high-level paragraph and sentence graphs, we further propose a transfer fusion module. If sentence node i belongs to paragraph node j, the corresponding paragraph features are concatenated onto the sentence node features, and feature fusion is achieved through linear mapping.
[0116]
[0117] C. Word Graph Convolution: The process of word graph convolution is consistent with that of sentence graph convolution, namely feature pooling - feature learning - feature interaction. For pooling, such as... Figure 4 As shown, the max-pooling feature of the paragraph feature is still selected as the projection vector, and the highest-scoring feature is selected. The overall calculation process, with each node serving as the final word node, can be represented as follows:
[0118]
[0119]
[0120]
[0121]
[0122] Based on the pooling features described above, word-level feature learning is performed using existing decoupled graph convolutional blocks. Specifically, in pooling word features... The algorithm uses a self-attention mechanism to obtain a word similarity matrix, which is then divided into intra-segment and inter-segment adjacency matrices according to a predetermined paragraph length. The intra-segment adjacency matrix incorporates paragraph and sentence masks to enhance feature interaction within the segment. This is followed by inter-segment graph convolution and residual branching to complete the corresponding feature updates, as detailed below:
[0123]
[0124]
[0125]
[0126]
[0127] Finally, the information update level is controlled by a gating unit, and the paragraph graph and word graph are interactively merged using a migration fusion module.
[0128]
[0129]
[0130] Step 3: Feature Fusion Network
[0131] To fuse semantic information of different granularities and scales, we use max pooling to aggregate the final output of the paragraph graph, as well as the output of each layer of the sentence graph and word graph, as shown below:
[0132] V m =maxpooling(V N (26)
[0133] S m =[maxpooling(S 1 ), ..., maxpooling(S N (27)
[0134] X m =maxpooling(X 1 ), ..., maxpooling(X N (28)
[0135] Finally, max pooling is used to complete the multi-granularity feature fusion:
[0136] u = maxpooling([V m S m X m (29)
[0137] The network was trained using cross-entropy classification loss. In addition, to ensure the discriminative nature of the guiding vector, cross-entropy classification constraints were added to the max-pooling features of the initial paragraph.
[0138] To verify the effectiveness of the above method, experiments were conducted on four structured long document classification datasets. These datasets belong to four different domains and all contain structured information. Specific statistical information is shown in Table 1.
[0139]
[0140]
[0141] Table 1
[0142] Table 2 shows the experimental results of the proposed Hierarchical Multi-Granularity Interactive Graph Convolutional Network (HMIGCN) and other long document classification methods on the four structured long document classification datasets mentioned above. Clearly, in most cases, the proposed method significantly outperforms the best-performing existing methods.
[0143] Specifically, traditional methods have largely demonstrated poor performance in processing structured long documents, exhibiting limited ability to capture long-distance dependencies and structured information. For graph methods, TextGCN and BertGCN both employ corpus-centric graph construction, but their high time and space complexity limits their application in long document processing. TL GNN and HyperGAT, considering only word-level information and failing to effectively model the structured information of long documents, have achieved inferior results compared to our proposed method. For long document classification methods, while RoBERT and ToBERT model the hierarchical structure of long documents, their fixed-length segmentation destroys edge information in the original sentences. Longformer and Bigbird, with their unique sparse attention structure and pre-training on large-scale long document corpora, have achieved better results than other methods. However, these methods treat long documents as text streams, completely ignoring their inherent structured information. Our proposed method models the complete structured information of long documents by constructing hierarchical, multi-granular graphs, and its superior performance validates its effectiveness in processing long documents.
[0144]
[0145]
[0146] Table 2
[0147] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any way. Any simple modifications, equivalent changes, and alterations made to the above embodiments based on the technical essence of the present invention shall still fall within the protection scope of the present invention.
Claims
1. A long document classification method based on hierarchical multi-granularity interactive graph convolutional networks, characterized by: The method includes the following steps: (1) In order to obtain a hierarchical, multi-granular representation of long documents, long documents are segmented. For equal length part ,in Indicates the first The word sequence of the segment, This indicates the addition of a global flag. and Representing long documents The number of paragraphs and the number of words in each paragraph are sequentially fed into the pre-trained encoder. Within this, the corresponding paragraphs and words are obtained. (1); (2) Perform multi-level superimposed paragraph graph convolution, sentence graph convolution and word graph convolution, as well as the corresponding inter-graph interactions; (3) In order to integrate semantic information of different granularities and scales, max pooling is used to aggregate the final output of the paragraph graph, as well as the output of each layer of the sentence graph and word graph. In step (1), the final paragraph feature representation and the final word feature representation. ,in This represents the corresponding feature dimension; to avoid secondary input of data, the initial sentence representation is obtained by directly clustering the word features within the same sentence using max pooling. This process is achieved through sentence masking. The guidance consists of an increasing sequence of repeating numbers, where words within the same sentence have the same numerical value. The final sentence features are calculated as follows: (2) (3) in Representing long documents The total number of sentences included, and the final sentence features are represented as follows: ; In step (2), the segment graph convolution is: Based on paragraph features An initial fully connected paragraph graph is constructed using a self-attention mechanism, and feature learning and updating of the paragraph graph are achieved using a graph convolutional neural network. (4) (5) in This represents the normalized adjacency matrix. Let represent a symmetric node degree matrix, and , Indicates the first The parameterized matrix of the layer; In step (2), the sentence graph convolution is: Sentence graph learning follows a basic process of feature pooling, feature learning, and feature interaction. Pooling aims to eliminate redundant sentence nodes while reducing the model's computational complexity. Max pooling is performed on paragraph features, and the output is then set to... As the projection vector, the sentence nodes are then projected to the directions respectively. Above that, and get the highest score. The indices of each node are shown below: (6) Based on the above index, the corresponding sentence nodes and migration masks are extracted respectively. The specific process is as follows: (7) (8) in This indicates the correspondence between sentence nodes and paragraph nodes, that is, if the sentence node... At paragraph nodes ,but .
2. The long document classification method based on hierarchical multi-granularity interactive graph convolutional networks according to claim 1, characterized in that: In step (2), the global graph convolutional block is responsible for capturing long-distance dependencies between sentence nodes, and for the pooled sentence features... The correlation coefficient is calculated using a multi-head attention mechanism, assuming a total of Height, number Similarity matrix of heads ,in The overall multi-head attention mechanism is represented as follows: (9) (10) in This indicates concatenation along the feature dimension. The parameterized matrix is represented by a local graph convolutional block, which is responsible for dynamically capturing the local dependencies between sentence nodes. To directly model the local dependencies, a block of size is first generated. Window attention mask Add threshold The multi-head adjacency matrix of the global graph convolutional block is then applied to obtain global neighbors with strong semantic relationships, as shown below: (11) Then copy matrix Next, recorded as This is then added to the dynamic global neighbor tensor mentioned above to obtain the multi-head attention adjacency matrix of the final local convolutional block, which is used to complete the feature update of the local convolutional block, as shown below: (12) (13) The fusion of global and local signals is achieved through a dynamic gating mechanism: (14) To enable interaction between high-level paragraph and sentence diagrams, a migration fusion module is used, if sentence nodes... Belongs to paragraph node Then, the corresponding paragraph features are concatenated to the sentence node features, and the corresponding feature fusion is completed through linear mapping: (15)。 3. The long document classification method based on hierarchical multi-granularity interactive graph convolutional networks according to claim 2, characterized in that: In step (2), the process of word graph convolution and sentence graph convolution remains consistent: feature pooling - feature learning - feature interaction. For pooling, the max pooling feature of the paragraph feature is still selected as the projection vector, and the highest-scoring feature is selected. The overall calculation process, with each node serving as the final word node, is as follows: (16) (17) (18) (19) Based on the pooling features described above, word-level feature learning is performed using existing decoupled graph convolutional blocks. Specifically, in pooling word features... The above uses a self-attention mechanism to obtain the word similarity matrix, and then divides it into intra-segment and inter-segment adjacency matrices according to a predetermined paragraph length. The intra-segment adjacency matrix incorporates paragraph and sentence masks to enhance feature interaction within the segment. This is followed by inter-segment graph convolution and residual branching to complete the corresponding feature updates, as shown below: (20) (21) (22) (23) Finally, the gating unit controls the degree of information update, and the migration fusion module is used to achieve interactive fusion of paragraph graphs and word graphs: (24) (25)。 4. The long document classification method based on hierarchical multi-granularity interactive graph convolutional networks according to claim 3, characterized in that: In step (3), the following is represented: (26) (27) (28) Finally, max pooling is used to complete the multi-granularity feature fusion: (29) The network was trained using cross-entropy classification loss. In addition, to ensure the discriminative nature of the guiding vector, cross-entropy classification constraints were added to the max-pooling features of the initial paragraph.
5. A long document classification device based on a hierarchical multi-granularity interactive graph convolutional network, which performs the method according to claim 1, characterized in that: The device includes: The multi-granularity coding network module is used to obtain a hierarchical multi-granularity representation of long documents and to segment long documents. For equal length part ,in Indicates the first The word sequence of the segment, This indicates the added global flag. and Representing long documents The number of paragraphs and the number of words in each paragraph are sequentially fed into the pre-trained encoder. Within this, the corresponding paragraphs and words are obtained. (1); The hierarchical multi-granularity interactive graph convolutional network module performs multi-layered paragraph graph convolution, sentence graph convolution, and word graph convolution, as well as corresponding inter-graph interactions; In order to fuse semantic information of different granularities and scales, the feature fusion network module uses max pooling to aggregate the final layer output of the paragraph graph, as well as the output of each layer of the sentence graph and word graph.
Citation Information
Patent Citations
Model training method and system, text classification method and system, equipment and medium
CN111488455A