Doc2GraphFormer: Bridging Structured Graph Learning with Transformer Attention for Efficient Document Understanding
摘要
Structured document understanding requires capturing both semantic relationships and spatial structures within visually rich documents. While Graph Neural Networks (GNNs) effectively model structured dependencies, they struggle with long-range dependencies and global context awareness, which are strengths of transformers. In this work, we propose Doc2GraphFormer, a hybrid framework that integrates graph-based structured parsing with multi-head attention mechanisms, evolving from GraphSAGE-style message passing to a more expressive graph-enhanced transformer architecture. Additionally, we introduce a novel modality fusion strategy, inspired by LayoutLMv3, to enhance the integration of textual, visual, and structural embeddings. We evaluate Doc2GraphFormer on FUNSD, XFUND, demonstrating its superior performance in semantic entity recognition and relation extraction. Our findings highlight the potential of combining graph reasoning with self-attention for efficient document understanding. Our code will be made available on: https://github.com/biswassanket/doc2graphformer