NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Document-level Relation Extraction as Semantic Segmentation

Ningyu Zhang, Xiang Chen, Xin Xie, Shumin Deng, Chuanqi Tan, Mosha Chen, Fei Huang, Luo Si, Huajun Chen

Introduction

Relation Extraction (RE) is a fundamental task in information extraction, traditionally focused on identifying connections between entities within a single sentence. However, real-world documents often contain relations that span multiple sentences—over 40% of relations in standard datasets require document-level reasoning. Existing methods, such as those based on graph neural networks or Transformers, often treat entity pairs in isolation, failing to capture the global interdependencies between multiple relations.

The DocuNet Framework

To address these limitations, the authors propose DocuNet (Document U-shaped Network), which reformulates document-level RE as a semantic segmentation task. By treating the grid of potential entity-pair relations as an "image," DocuNet can leverage powerful computer vision techniques to model global context.

The DocuNet architecture, featuring an encoder, entity-level relation matrix construction, and a U-shaped segmentation module.

The framework consists of four primary components:

  1. Encoder Module: Utilizes pre-trained language models (e.g., BERT, RoBERTa) to generate contextual embeddings, followed by logsumexp pooling to create fixed-length entity vectors.
  2. Entity-level Relation Matrix: Constructs an $N \times N$ matrix where each "pixel" represents the feature vector for a specific entity pair.
  3. U-shaped Segmentation Module: Applies a U-Net architecture to the matrix. Through successive down-sampling and up-sampling with skip connections, the model captures both broad global context and precise local details, allowing information to flow between different entity pairs.
  4. Classification & Balanced Softmax: Predicts relation types for each cell using a specialized Balanced Softmax loss function to mitigate the extreme class imbalance typical of document-level RE (where "No Relation" or NA is the dominant class).

Implicit Reasoning and Global Interdependency

A key advantage of the segmentation approach is its ability to perform implicit logical reasoning. As the receptive field of the convolutional layers expands, the model "sees" neighboring relations, enabling it to resolve contradictions or infer missing links based on surrounding context—akin to how a human might use transitivity (e.g., if A is in B and B is in C, then A is in C).

Comparison of relation extraction between a standard BERT baseline and DocuNet, illustrating how the latter captures global interdependencies.

As shown in the comparison above, while standard models like BERT might miss complex dependencies, DocuNet's "logic of the grid" allows it to identify a more complete set of relations by considering the document's global structure.

Experimental Results

DocuNet achieves state-of-the-art performance across several major benchmarks:

  • DocRED: Reached an F1 score of 64.55 with RoBERTa-large, significantly outperforming previous models like ATLOP.
  • Biomedical Datasets: On the CDR dataset, DocuNet improved the F1 score by 6.9% over previous benchmarks. It also showed strong performance on the GDA dataset.
  • Ablation Studies: Removing the U-shaped segmentation module resulted in a drop of over 2 F1 points, confirming that the segmentation-based reasoning is the primary driver of the model's success.

Limitations and Future Work

While effective, the model currently uses a fixed matrix size (maximum entity count $N=42$), which may need adjustment for extremely entity-dense documents. Additionally, processing large matrices with deep convolutions adds computational overhead. Future work may extend this "segmentation as extraction" framework to other complex NLP tasks like nested named entity recognition or aspect-based sentiment analysis.

Summary updated

BibTeX
@inproceedings{zhang2021document,
  author = {Ningyu Zhang and Xiang Chen and Xin Xie and Shumin Deng and Chuanqi Tan and Mosha Chen and Fei Huang and Luo Si and Huajun Chen},
  title = {{Document-level Relation Extraction as Semantic Segmentation}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2021},
  doi = {10.24963/ijcai.2021/551},
}
Figure