Document-level relation extraction method based on axial attention DWConv feedforward network
By using the axial attention DWConv feedforward network to process long texts, the problems of long-distance dependencies and high computational complexity are solved, achieving efficient and accurate entity relationship extraction and improving the construction quality of knowledge graphs.
Patent Information
- Application Number
- CN202511084768.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-04
- Publication Date
- 2025-11-14
AI Technical Summary
Existing document-level relationship extraction methods suffer from long-distance dependency problems in long texts, resulting in high computational complexity and difficulty in accurately extracting multi-step reasoning relationships between entities, which limits the quality of knowledge graph construction.
A document-level relation extraction method based on the axial attention DWConv feedforward network is adopted. The word embedding matrix is processed through the axial attention mechanism, and combined with depthwise separable convolution and named entity recognition tools, the automatic entity location labeling and relation prediction are realized.
It reduces computational complexity, enhances long-distance dependency modeling capabilities, improves the accuracy of relation prediction and reasoning speed, and enables the efficient construction of high-quality knowledge graphs.
Smart Images

Figure CN120951997A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of information technology and relates to the application of natural language processing (NLP) technology in knowledge graph generation. In particular, it relates to a document-level relationship extraction method using an axial attention-based DWConv feedforward network, which is suitable for automatically extracting relationships between named entities from long texts such as documents of science and technology management systems, and realizing end-to-end knowledge graph construction. Background Technology
[0002] Document-level Relation Extraction (DocRE) aims to identify semantic relationships between entities in long texts and is a key technology supporting the construction of knowledge graphs. With the widespread application of knowledge graphs in fields such as technology management, healthcare, and financial risk control, the demand for relationship extraction has shifted from processing short text fragments to parsing long documents across paragraphs. However, existing document-level relationship extraction technologies face several challenges: First, there is the problem of long-distance dependency, where entities and their relationships may be distributed in different locations within a document, requiring the capture of contextual information across sentences or even paragraphs; second, there is the problem of multiple mentions, where the same entity may appear in different forms within a document, requiring the unification of its representation through coreference resolution and entity alignment techniques; and third, there is the problem of relationship complexity, where entity pairs may involve multiple predefined relationships, requiring comprehensive judgment within the global context.
[0003] Traditional methods have significant limitations in addressing the aforementioned problems. Early rule-based methods relied on manually defined templates or syntax trees, making them ill-suited for large-scale, dynamically changing text data. Machine learning-based models (such as SVM and Random Forest) depend on manual feature engineering, limiting their ability to model text semantics. In recent years, while deep learning-based methods (such as Convolutional Neural Networks (CNNs) and Recurrent Neural Networks (RNNs) have made progress in local feature extraction, they remain insufficient in handling global semantic relationships in long texts. For example, while the self-attention mechanism of the Transformer model can capture global dependencies, its computational complexity increases quadratically with sequence length, leading to inefficiency in document-level tasks. Furthermore, existing methods do not model the contextual relationships of entity mentions with sufficient fine-grainedness, making it difficult to distinguish between direct and indirect relationships between entities, thus limiting the quality of knowledge graph construction.
[0004] The construction of knowledge graphs places higher demands on document-level relation extraction techniques. Knowledge graphs organize knowledge in the form of structured triples (entity 1, relation, entity 2), and their core value lies in enabling efficient information retrieval and reasoning. However, the quality of current knowledge graphs is limited by the accuracy and completeness of relation extraction. For example, in the medical field, the relationships between diseases, symptoms, and treatment plans are often implicit in multi-paragraph documents, requiring document-level relation extraction techniques to uncover deep connections; in the financial field, relationships such as investment and cooperation between enterprises may be scattered across news reports at different points in time, requiring dynamic modeling incorporating temporal information.
[0005] In summary, existing document-level relationship extraction methods still need further improvement in terms of computational complexity, information accuracy, and completeness when constructing knowledge graphs. Summary of the Invention
[0006] To overcome the shortcomings of the existing technologies, the present invention aims to provide a document-level relation extraction method utilizing an axial attention-based DWConv feedforward network. This method addresses the low accuracy issues of current knowledge graph construction methods using relation extraction, which are hampered by long-distance dependencies in long texts and the computational complexity of traditional methods. Ultimately, this method can automatically tag entities in the input text using open-source named entity recognition tools, thereby achieving automatic relation extraction from long texts to construct a knowledge graph.
[0007] To achieve the above objectives, the technical solution adopted by the present invention is as follows:
[0008] A document-level relation extraction method utilizing an axial attention-based DWConv feedforward network includes the following steps:
[0009] Step 1: Construct a long text dataset containing multiple entities and multiple sets of relationships;
[0010] Step 2: Add markers before and after the text representing entities in each long text segment to mark the position of all entities and the relationship between all entity pairs as labels. If there is no relationship between entities, mark it as no relationship.
[0011] Step 3: Construct a deep separable convolutional feedforward network based on axial attention as the relation prediction module of the document-level relation extraction model;
[0012] Step 4: Using the tagged long text as input, and the location information of named entities and the relationship information of entity pairs as labels, train the model.
[0013] Step 5: Deploy the model and combine it with a named entity recognition tool to automatically mark the location of entities in any long input text;
[0014] Step 6: Calculate inter-entity information from the long text that has undergone named entity recognition to predict the relationships between entities and generate triples of first entity-relationship-tail entity. The generated triple information is used to construct a knowledge graph model or as a storage record in a graph database.
[0015] In one embodiment, the document-level relation extraction model processes the entire document as raw long text into word embedding vectors that can be used for relation extraction using the following method:
[0016] First, the word embedding vector H is obtained by directly encoding with the BERT encoder, which represents the encoding result of the original long text;
[0017] The word embedding vectors for all occurrences of each entity are calculated and used as entity-level word embedding vectors.
[0018] All entity pairs within the same document are organized to obtain a word embedding matrix A, which is then used as the input to the relation prediction module.
[0019] In one embodiment, the word embedding vector H is represented as:
[0020] H = BERT([x1,x2,...,x...) i ...,x l ])=[h1,h2..,h i ....,h l ]
[0021] Among them, for entity e i Its entity-level word embedding vector Represented as:
[0022]
[0023] Where x l h represents the l-th word of the original long text. l For x l The encoded entity-level word embedding vector, where l is the number of words in the original long text. h represents the entity-level word embedding vector of the i-th entity. j N represents the word embedding vector of the j-th token. i Let i be the number of times the i-th entity appears in the original long text;
[0024] The word embedding matrix A is represented as follows:
[0025]
[0026] in, Represents entity e i and e jThe word embedding vectors of the entity pairs are composed of entity e. i Word embedding vectors With entity e j Word embedding vectors It is pieced together. n is the number of entities in the original long text.
[0027] In one embodiment, the axial attention-based depthwise separable convolutional feedforward network uses an axial attention module instead of global attention to process the word embedding matrix in the depthwise separable convolutional feedforward network.
[0028] In one embodiment, the axial attention-based depthwise separable convolutional feedforward network includes:
[0029] The depthwise separable convolution module performs dimensionality transformation on the input word embedding matrix and adds local information through depthwise separable convolution;
[0030] The batch normalization module restores dimensions and balances local and global information in the matrix;
[0031] The axial attention module takes the word embedding matrix processed by the batch normalization module as input, and models the global relationship through dimensional decomposition and recombination. By alternately calculating row attention and column attention, it indirectly represents the multi-step reasoning relationship between two entities, thereby capturing the global information of the entire entity on the word embedding matrix.
[0032] The feedforward network module takes the output of the axial attention module as input, and the calculated result is used by a linear classifier to predict the relationship between a total of n*n entity pairs, where n is the number of entities in the original long text.
[0033] In one embodiment, the attention output X of the axial attention module AA Represented as:
[0034]
[0035] Among them, Att row With Att col Q and K represent the attention weights calculated along the row and column directions of the word embedding matrix A, respectively. Since self-attention is used, Q and K have the same physical meaning; both are word embedding vectors in the word embedding matrix. row With K row Q represents the word embedding vector along the row direction of the word embedding matrix A. col With K col Let d represent the word embedding vectors along the column direction of the word embedding matrix A, and d is a vector representing the word embeddings in Q. row With Krow The dimension is n, where n is the number of entities in the original long text.
[0036] In one embodiment, the output of the axial attention module serves as the input to the next-stage feedforward network module. Within the feedforward network module, two linear transformation layers are used before and after the activation function to learn more complex features. The former constructs a high-dimensional feature space through an up-dimensional linear transformation, enabling the model to decouple complex entity pair features; the subsequent down-dimensional linear transformation achieves information compression, preserving the most significant correlation signals.
[0037] The output of the feedforward network module is represented as follows:
[0038] X output =X AA +W2·Dropout{GELU[W1·LN(X AA )]}
[0039] W2 and W1 are both learnable parameters of the linear transformation layer, and LN() is the layer normalization used to stabilize X. AA The feature distribution; GELU() is the activation function, and Dropout() is the regularization function.
[0040] In one embodiment, step 5 involves introducing an open-source named entity recognition tool when deploying the trained model to automatically mark the entity positions in the long text and obtain a long text format that the model can recognize through preprocessing.
[0041] Compared to existing technologies, this invention introduces axial attention to reduce computational complexity, enhance long-distance dependency modeling capabilities, and improve the model's inference speed and accuracy. Furthermore, it utilizes open-source named entity recognition tools to uniformly identify entities from the input, automating entity location labeling and enabling the rapid provision of highly reliable data for knowledge graph construction. Attached Figure Description
[0042] Figure 1 This is a schematic diagram of the overall structure of the document-level relationship extraction model of the present invention.
[0043] Figure 2 This is a schematic diagram of a depthwise separable convolutional feedforward network structure based on axial attention.
[0044] Figure 3 The original long text used for the example.
[0045] Figure 4 This is a list of relational triples obtained from the original long text, serving as an example.
[0046] Figure 5 A structured visualization map obtained from the original long text. Detailed Implementation
[0047] The embodiments of the present invention will now be described in detail with reference to the accompanying drawings and examples.
[0048] This invention discloses a document-level relation extraction method utilizing an axial attention-based DWConv feedforward network. By training a document-level relation extraction model, it is possible to extract entity pair relation information from long texts, which can be used to efficiently and accurately construct knowledge graphs. This invention mainly includes the following steps:
[0049] Step 1: Select long texts to construct a long text dataset. The source can be a Word document or a personal profile, etc., which must contain multiple entities and multiple sets of relationships.
[0050] In step 1, the first consideration is the selected text source. Priority is given to using relevant documents in the same field for construction. This reduces the range of relationships between entities, avoids the long-tail problem during training, and ensures that the prediction of each relationship is fully trained, thereby improving the accuracy of the model prediction.
[0051] Step 2: Add markers, such as "*", before and after the text representing entities in each long text segment to mark the location of named entities, mark the location of all entities, and use the relationships between all entity pairs as labels. If there is no relationship between entities, mark it as no relationship.
[0052] In step 2, markers need to be added before and after the entities, and a labeled dataset containing entities and relations needs to be constructed. For example, if the input text is "Apple released a new generation of iPhones in 2023", the labeled text containing entities would be "*Apple* released a new generation of *iPhones* in *2023*", and the labeled relations would be [("Apple", "release", "iPhone")]. Furthermore, to enable batch computation during training, the dataset needs to consider the simultaneous input of multiple articles; therefore, the annotations should also include information such as sentence length, sentence position, and the position of the entity within the sentence.
[0053] Step 3: Considering that the accuracy of document-level relation extraction models is not high at present and the memory consumption is too high when using long text prediction, this invention constructs a deep separable convolutional feedforward network based on axial attention mechanism as the relation prediction module of the document-level relation extraction model, which improves the accuracy of relation prediction while reducing model parameters and increasing inference speed.
[0054] In step 3, the overall structure of the document-level relation extraction model is as follows: Figure 1 As shown, the process of converting the original long text into word embedding vectors that can be used for relation extraction involves the following steps:
[0055] The output directly encoded by the BERT encoder is a word embedding vector H with shape (doc_len, emb_size), representing the encoded result of the original long text. For a single entity e... i N may appear in an article i Next, in order to capture the global information of entities across the entire document, LogSumExp is used to calculate the word embedding vectors of all occurrences of each entity as its entity-level word embedding vectors. The above calculations are expressed as follows:
[0056] H = BERT([x1,x2,...,x...) i ...,x l ])=[h1,h2..,h i ....,h l ]
[0057]
[0058] Where x l h represents the l-th word of the original long text. l For x l The encoded entity-level word embedding vector, where l is the number of words in the original long text. h represents the entity-level word embedding vector of the i-th entity. j N represents the word embedding vector of the j-th token. i Let be the number of times the i-th entity appears in the original long text.
[0059] For two entities e i and e j embed the corresponding word vector By splicing, we can obtain entity pairs (e) i ,e j Word embedding vectors It can be used to predict relationships between two entities, but the word embedding vectors at this point only contain information from a single step of reasoning. Therefore, the model struggles to handle relationships that require multi-step reasoning. For three entities e... a e b and e c If e a With e b There is a relationship between them, e b With e c There is also a relationship between them, so e a With e cThere may also be relationships between them. In order to enable the model to handle this type of multi-step reasoning problem, this invention organizes all entity pairs in the same document into a word embedding matrix A, which serves as the input to the subsequent deep separable convolutional feedforward network based on the axial attention mechanism. n is the number of entities in the original long text, and A has a shape of (n, n, emb_size).
[0060] Axial attention-based depthwise separable convolutional feedforward network architecture, such as Figure 2 As shown, it uses an axial attention module instead of global attention to process the word embedding matrix A in a depthwise separable convolutional feedforward network.
[0061] Axial attention, as an improved attention mechanism, offers a new technical approach for document-level relation extraction. This mechanism processes two-dimensional or high-dimensional data by segmenting it along specific dimensions (such as rows or columns), calculating attention weights for each segment, and then achieving global information fusion through multi-level cascading. Compared to traditional self-attention mechanisms, axial attention reduces computational complexity while more efficiently capturing long-distance dependencies. For example, in document processing, axial attention can segment data along a "paragraph-sentence-word" hierarchy, extracting local and global features layer by layer, thereby more accurately modeling semantic relationships between entities. Furthermore, axial attention can further enhance the model's ability to perceive contextual relationships through cross-axis interaction, such as combining entity type information with location information to improve the extraction accuracy of complex relationships.
[0062] The introduction of axial attention not only improves the performance of document-level relation extraction but also enhances the semantic expressive power of knowledge graphs through finer-grained context modeling. For example, combining axial attention with a multi-granularity feature fusion strategy of convolutional neural networks (CNNs) can simultaneously capture local and global semantic features, thereby more comprehensively representing entity relationships and further improving the credibility of knowledge graphs.
[0063] The main process of the relation prediction module of this invention is as follows: First, the depthwise separable convolution module performs dimensionality transformation on the matrix and adds local information through depthwise separable convolution. Then, the batch normalization module restores the dimension. The purpose is to introduce local information before calculating global information and balance the local and global information in the matrix. The processed matrix is used as the input of the axial attention module.
[0064] The axial attention module takes the word embedding matrix processed by the batch normalization module as input. Through dimensional decomposition and recombination, it can model global relationships while significantly improving computational efficiency. In document-level relation extraction tasks, it effectively solves the problem of high-dimensional modeling of entity pairs word embedding matrix A. By alternately calculating row and column attention, it indirectly represents the multi-step reasoning relationship between two entities, thereby capturing the global information of the entire entity pair word embedding matrix A. This avoids directly calculating the attention of the entire matrix, achieving an efficient solution for long-distance dependency modeling. Its alternating row and column attention mechanism fits the structural characteristics of the entity pair word embedding matrix, enabling the model to simultaneously capture global information between entities, ultimately improving relation extraction accuracy. Its attention output X AA Represented as:
[0065]
[0066] Finally, the feedforward network module takes the output of the axial attention module as input, stabilizes the feature distribution calculated by the axial attention module through layer normalization, and uses the GELU activation function to provide a smoother gradient transition, effectively modeling the probabilistic associations in entity relationships (such as ambiguous semantics like "potential cooperation" and "potential competition"), enhancing the model's ability to express uncertain relationships. A high-dimensional feature space is constructed through a linear transformation of increasing dimensionality, enabling the model to decouple complex entity pair features; the subsequent linear transformation of decreasing dimensionality achieves information compression, retaining the most significant association signals. Dropout regularization is introduced to enhance the model's generalization ability; and residual connections are used to balance the original features containing basic semantic information and the axial attention output features with multi-step reasoning relationship information. The results calculated by the feedforward network are used by a linear classifier to predict the relationships between a total of n*n entity pairs, and its output is expressed as:
[0067] X output =X AA +W2·Dropout{GELU[W1·LN(X AA )]}
[0068] W2 and W1 are both learnable parameters, and LN() is the layer normalization used to stabilize X. AA The feature distribution; GELU() is the activation function, and Dropout() is the regularization.
[0069] In the feedforward network module, two linear transformation layers are used before and after the activation function to learn more complex features. The former constructs a high-dimensional feature space through the linear transformation of increasing dimensionality, enabling the model to decouple complex entity pair features; the subsequent linear transformation of decreasing dimensionality achieves information compression, retaining the most significant correlation signals.
[0070] This step is the core of the invention. It uses an axial attention module to replace the global attention processing word embedding matrix. By decomposing and reorganizing the dimensions, and alternately calculating row attention and column attention, it effectively models the multi-step reasoning relationship between entity pairs and captures global information. It significantly reduces model parameters, improves reasoning speed, and increases the accuracy of relationship prediction, thus solving the problems of high-dimensional modeling and long-distance dependency.
[0071] Step 4: Using the tagged long text as input, and the location information of named entities and the relationship information of entity pairs as labels, train the document-level relationship extraction model;
[0072] During model training, the Adam optimizer is used, and the loss function is the Adaptive Threshold Loss for relation extraction.
[0073]
[0074] Step 5: Deploy the document-level relationship extraction model and combine it with open-source named entity recognition tools such as LTP, PyHanlp, and Lac to automatically mark the entity positions of any input long text.
[0075] This step introduces an open-source named entity recognition tool when deploying the trained model, which automatically marks the entity positions in long texts and obtains a long text format that the model can recognize through preprocessing.
[0076] Step 6: The document-level relationship extraction model calculates inter-entity information from the long text processed by named entity recognition to predict the relationships between entities and generates triples of "first entity-relationship-last entity". The generated triple information is used to construct a knowledge graph model or as a storage record in a graph database.
[0077] The linear classification process used in step 6 is as follows:
[0078] Calculate whether a relationship exists between two entity representations. If it exists, add it to the prediction result.
[0079] Classification methods (embedding matrix, threshold):
[0080] The number of rows (i.e., the number of entities) in the embedding matrix is denoted as len.
[0081] Initialize an empty list `res` to store the results.
[0082] For each entity i (from 0 to len-1):
[0083] For each entity j (from 0 to len-1):
[0084] If i is not equal to j:
[0085] The predicted value preds is calculated as: preds = bilinear function (embedding matrix [i], embedding matrix [j]) + bias term.
[0086] If the predicted value preds is greater than the given threshold:
[0087] Then construct a triple (entity i, predicted value preds, entity j) and add the triple to the results list res.
[0088] Returns the result list res.
[0089] In summary, the document-level relation extraction method based on axial attention has significant advantages in reducing computational complexity and improving the ability to model long-distance dependencies. This technology can achieve breakthroughs in more complex scenarios, promote the automated construction of knowledge graphs, and lay a solid foundation for the widespread application of document-level relation extraction.
[0090] like Figure 3 The example shown is the original long text, which is translated into Chinese as follows:
[0091] Culiacán is a city in northwestern Mexico. It is the capital of the state of Sinaloa and also the location of the city of Culiacán. In 2015, the city had a population of 785,800, while the city-wide population was 905,660. Although Culiacán's total area is 4,758 square kilometers, the city itself is much smaller, only a few square kilometers in size. Culiacán is a railway hub located on the Panama Canal, connecting to Guadalajara and Mexico City to the south. It borders Los Mochis to the north and Mazatlán and Tepica to the south.
[0092] Figure 4 The corresponding list of relational triples describes the geographical relationships between Culiacán, Mexico, Sinaloa, Los Mochis, and Mazatlán in the form of triples. Figure 5 This invention presents a structured, visualized graph, using entities as nodes and relationships as edges to intuitively display relation triples. This demonstrates the invention's ability to accurately identify entities and effectively predict the relationships between them.
Claims
1. A document-level relation extraction method utilizing an axial attention-based DWConv feedforward network, characterized in that, Includes the following steps: Step 1: Construct a long text dataset containing multiple entities and multiple sets of relationships; Step 2: Add markers before and after the text representing entities in each long text segment to mark the position of all entities and the relationship between all entity pairs as labels. If there is no relationship between entities, mark it as no relationship. Step 3: Construct a deep separable convolutional feedforward network based on axial attention as the relation prediction module of the document-level relation extraction model; Step 4: Using the tagged long text as input, and the location information of named entities and the relationship information of entity pairs as labels, train the model. Step 5: Deploy the model and combine it with a named entity recognition tool to automatically mark the location of entities in any long input text; Step 6: Calculate inter-entity information from the long text that has undergone named entity recognition to predict the relationships between entities and generate triples of first entity-relationship-tail entity. The generated triple information is used to construct a knowledge graph model or as a storage record in a graph database.
2. The document-level relation extraction method using an axial attention-based DWConv feedforward network as described in claim 1, characterized in that, The document-level relation extraction model processes the entire document as raw long text into word embedding vectors that can be used for relation extraction using the following method: First, the word embedding vector H is obtained by directly encoding with the BERT encoder, which represents the encoding result of the original long text; The word embedding vectors for all occurrences of each entity are calculated and used as entity-level word embedding vectors. All entity pairs within the same document are organized to obtain a word embedding matrix A, which is then used as the input to the relation prediction module.
3. The document-level relation extraction method using an axial attention-based DWConv feedforward network as described in claim 2, characterized in that, The word embedding vector H is represented as: H=BERT([x1,x2...,x i ...,x l ])=[h1,h2..,h i ....,h l ] Among them, for entity e i Its entity-level word embedding vector Represented as: Where x l h represents the l-th word of the original long text. l For x l The encoded entity-level word embedding vector, where l is the number of words in the original long text. h represents the entity-level word embedding vector of the i-th entity. j N represents the word embedding vector of the j-th token. i Let be the number of times the i-th entity appears in the original long text.
4. The document-level relation extraction method using an axial attention-based DWConv feedforward network as described in claim 3, characterized in that, The word embedding matrix A is represented as follows: in, Represents entity e i and e j The word embedding vectors of the entity pairs are composed of entity e. i Word embedding vectors With entity e j Word embedding vectors It is pieced together. i,j∈{1,2,…,n}, where n is the number of entities in the original long text.
5. The document-level relation extraction method using an axial attention-based DWConv feedforward network according to claim 1, characterized in that, The depthwise separable convolutional feedforward network based on axial attention uses an axial attention module instead of global attention to process the word embedding matrix in the depthwise separable convolutional feedforward network.
6. The document-level relation extraction method using an axial attention-based DWConv feedforward network according to claim 1, characterized in that, The depthwise separable convolutional feedforward network based on axial attention includes: The depthwise separable convolution module performs dimensionality transformation on the input word embedding matrix and adds local information through depthwise separable convolution; The batch normalization module restores dimensions and balances local and global information in the matrix; The axial attention module takes the word embedding matrix processed by the batch normalization module as input, and models the global relationship through dimensional decomposition and recombination. By alternately calculating row attention and column attention, it indirectly represents the multi-step reasoning relationship between two entities, thereby capturing the global information of the entire entity on the word embedding matrix. The feedforward network module takes the output of the axial attention module as input, and the calculated result is used by a linear classifier to predict the relationship between a total of n*n entity pairs, where n is the number of entities in the original long text.
7. The document-level relation extraction method using an axial attention-based DWConv feedforward network according to claim 6, characterized in that, The attention output X of the axial attention module AA Represented as: Among them, Att row With Att col Q and K represent the attention weights calculated along the row and column directions of the word embedding matrix A, respectively. Since self-attention is used, Q and K have the same physical meaning; both are word embedding vectors in the word embedding matrix. row With K row Q represents the word embedding vector along the row direction of the word embedding matrix A. col With K col Let d represent the word embedding vectors along the column direction of the word embedding matrix A, and d is a vector representing the word embeddings in Q. row With K row Dimensions.
8. The document-level relation extraction method using an axial attention-based DWConv feedforward network according to claim 7, characterized in that, The output of the feedforward network module is represented as follows: X output =X AA +W2·Dropout{GELU[W1·LN(X AA )]} W2 and W1 are both learnable parameters of the linear transformation layer, and LN() is the layer normalization used to stabilize X. AA The feature distribution; GELU() is the activation function, and Dropout() is the regularization function.
9. The document-level relation extraction method using an axial attention-based DWConv feedforward network according to claim 1, characterized in that, In step 5, an open-source named entity recognition tool is introduced when deploying the trained model to automatically mark the entity positions in the long text and obtain a long text format that the model can recognize through preprocessing.