Entity Relation Extraction as Dependency Parsing in Visually Rich Documents

Yue Zhang, Bo Zhang, Rui Wang, Junjie Cao, Chen Li, Zuyi Bao

Abstract

Understanding Visually Rich Documents (VRDs) such as invoices and forms requires more than just text recognition; it necessitates identifying the relationships between entities based on their spatial layout. This paper introduces SERA (Semantic Entity Relation extraction As dependency parsing), which reframes entity relation extraction as a dependency parsing task. By integrating layout-aware encoders and a biaffine relation scorer, SERA achieves a state-of-the-art F1 score of 65.96% on the FUNSD benchmark.

Introduction

In the domain of document intelligence, identifying "Entity Labels" (e.g., distinguishing a "Total Price" label from a numerical value) has seen significant progress. However, Entity Relation Extraction—the task of linking specific labels to their corresponding values—remains a complex challenge. Unlike traditional NLP, where relations are often sequential, document relations are inherently two-dimensional and depend heavily on visual cues.

The core innovation of this work is the "Dependency Analogy": document relations are structurally similar to sentence syntax. Just as a verb governs its subject in a sentence, a "Key" (e.g., "Date:") governs its "Value" (e.g., "March 18, 1968") in a form. By treating entities as nodes in a dependency tree, the model can leverage established parsing techniques to resolve these links.

Reframing document entity relations as a dependency tree structure.

Methodology: The SERA Framework

The authors propose the SERA architecture, which adapts the biaffine parser—a standard tool in linguistic dependency parsing—to the document domain. The framework consists of four primary components:

  1. Entity Representation: The model utilizes LayoutLM to encode text alongside 2D bounding box coordinates. It also incorporates entity labels (e.g., "Question", "Answer") as embeddings, analogous to part-of-speech (POS) tags in linguistic parsing.
  2. Document Encoder: While Transformers and BiLSTMs were tested, Graph Convolutional Networks (GCNs) proved most effective. GCNs allow for the explicit modeling of spatial relationships, such as horizontal and vertical distances, as edge features between entities.
  3. Biaffine Relation Scorer: A biaffine attention mechanism calculates the probability of a "head-modifier" relationship between any two entities. To ensure structural consistency, a "pseudo-root" node is introduced, enforcing a single-head constraint where every entity has exactly one parent.
  4. Layout Feature Scorer: A secondary MLP calculates scores based on relative positions (e.g., "above" or "to the left of"), which are added to the biaffine scores to refine predictions.
Architecture of the SERA model compared to a standard dependency parser.

Experimental Setup and Results

The model was evaluated on two primary datasets: the FUNSD benchmark (199 annotated forms) and a larger Customs Data set (approx. 1,600 documents) provided by Alibaba Group.

Key Results

On the FUNSD benchmark, SERA achieved an F1 score of 65.96%, significantly outperforming standard BERT-based baselines. On the larger Customs dataset, the model reached an F1 of 85.33%, demonstrating its scalability for real-world industrial applications.

Ablation Studies

  • Encoder Impact: Replacing BERT with LayoutLM resulted in a significant F1 improvement, highlighting the importance of 2D spatial features.
  • Layout Features: The inclusion of the Layout Feature Scorer provided a significant performance boost, confirming that simple spatial heuristics (top-to-bottom, left-to-right) remain vital for document understanding.
  • Multi-task Learning (MTL): Simultaneously training for entity labeling and relation extraction improved results, as entity types provide strong priors for potential relations.

Conclusion

By reframing document relation extraction as dependency parsing, SERA provides a robust and structured approach to understanding complex layouts. Future work will focus on incorporating "pure" visual features—such as font styles and table borders—and extending the model to handle multi-head relations in more diverse document types.

Summary updated

BibTeX
@inproceedings{zhang2021entity,
  author = {Yue Zhang and Bo Zhang and Rui Wang and Junjie Cao and Chen Li and Zuyi Bao},
  title = {{Entity Relation Extraction as Dependency Parsing in Visually Rich Documents}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2021},
  doi = {10.18653/v1/2021.emnlp-main.218},
}
Figure