GapDNER: A Gap-Aware Grid Tagging Model for Discontinuous Named Entity Recognition

Yawen Yang, Fukun Ma, Shiao Meng, Aiwei Liu, Li-jie Wen

Abstract

Discontinuous Named Entity Recognition (NER) presents a significant challenge in specialized domains like biomedicine, where entities are often separated by intervening text. Traditional sequence labeling and span-based models struggle to capture the structural dependencies of these non-contiguous fragments. This paper introduces GapDNER, a novel grid-tagging framework that explicitly models the "context gaps" between entity fragments. By leveraging intra-span regularity extraction and inter-span relation enhancement via criss-cross attention, GapDNER achieves state-of-the-art performance on the CADEC, ShARe13, and ShARe14 benchmarks, demonstrating superior capability in resolving complex entity structures.

Introduction

In standard NER, entities are typically assumed to be contiguous blocks of text. However, clinical narratives frequently contain discontinuous entities, such as "severe joint pain" appearing within the phrase "severe joint, shoulder and upper body pain." Extracting these requires identifying multiple overlapping fragments. Previous research has often treated the gaps between these fragments as noise. GapDNER challenges this by treating gaps as meaningful spans with predictable patterns, using them to reduce ambiguity during entity decoding.

The Gap-Aware Grid Tagging Approach

GapDNER formulates the NER task as token-pair grid tagging. Instead of labeling individual tokens, the model predicts the relationship between every pair of tokens $(i, j)$ in a sentence. This creates a 2D representation where fragments, gaps, and entity types are explicitly labeled.

Grid tagging representation for discontinuous entities.

Model Architecture

The GapDNER architecture consists of three primary modules:

  1. Sequence Encoding: A combination of BioBERT and BiLSTM generates contextual vector representations for each token.
  2. Intra-Span Regularity Extraction: This module captures features within a span using a Biaffine mechanism for boundary detection and Linear Attention to summarize internal semantic regularity. This is applied to both entity fragments and the gaps between them.
  3. Inter-Span Relation Enhancement: To model dependencies between spans that share head or tail words—a common occurrence in overlapping entities—the model utilizes Criss-Cross Attention. This technique allows for efficient horizontal and vertical information flow across the grid.
The GapDNER architecture overview.

Decoding and Inference

At inference time, the model treats the predicted fragments and gaps as directed edges in a graph. A Breadth-First Search (BFS) algorithm is employed to identify valid paths (e.g., Fragment → Gap → Fragment) that constitute complete discontinuous entities.

Experimental Results

The model was evaluated on the CADEC, ShARe13, and ShARe14 datasets, where approximately 10% of entities are discontinuous. GapDNER achieved state-of-the-art F1 scores across all benchmarks:

  • CADEC: 73.65% F1
  • ShARe13: 82.87% F1
  • ShARe14: 82.72% F1

Notably, GapDNER outperformed large language models like LLaMA-13B, highlighting the value of task-specific structural modeling in niche domains. Ablation studies confirmed that modeling internal span features and inter-span relations were the most critical components, contributing to a ~2% jump in F1 score.

Conclusion

GapDNER demonstrates that explicitly modeling context gaps and inter-span relations significantly improves the recognition of discontinuous entities. By treating the NER task as a spatial grid problem and applying efficient attention mechanisms, the model provides a robust and precise solution for complex information extraction in the biomedical field.

Summary updated

BibTeX
@inproceedings{yang2025gapdner,
  author = {Yawen Yang and Fukun Ma and Shiao Meng and Aiwei Liu and Li-jie Wen},
  title = {{GapDNER: A Gap-Aware Grid Tagging Model for Discontinuous Named Entity Recognition}},
  booktitle = {IJCNN},
  year = {2025},
}
Figure