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

Local Hypergraph-based Nested Named Entity Recognition as Query-based Sequence Labeling

Yukun Yan, Sen SongarXiv 2022

Abstract

Recognizing nested named entities—where one entity resides within another—poses a significant challenge for traditional sequence labeling models. We present a novel approach that treats nested NER as a query-based sequence labeling task. By generating local hypergraphs for candidate start tokens, our method avoids the computational explosion of span-based models while capturing complex structural dependencies. Our approach achieves state-of-the-art results on ACE 2004 and competitive performance on ACE 2005, GENIA, and KBP 2017.

The Challenge of Nested Entities

Standard Named Entity Recognition (NER) typically assumes that entity spans do not overlap. However, real-world language is frequently nested. For instance, in the phrase "British officials," "British" is a Geopolitical Entity (GPE), while the entire phrase "British officials" refers to a Person (PER). Traditional "flat" NER methods fail here because a single word would require multiple simultaneous labels.

Example of nested named entities within a sentence showing overlapping PER, GPE, and ORG tags.

Existing solutions often fall into three categories, each with drawbacks:

  • Span-based models: Evaluate all possible word combinations, leading to high $O(n^2)$ complexity.
  • Layered models: Attempt to find inner and outer entities sequentially but often struggle with arbitrary nesting orders.
  • Global hypergraphs: Attempt to model the entire sentence's complexity at once, which is often too difficult to train effectively.

Methodology: Query-based Sequence Labeling

Our proposed framework decomposes the problem into a three-stage pipeline that mimics how humans scan text—finding a "headword" and then determining its boundaries.

  1. Start Token Estimation: The model identifies tokens likely to begin an entity. This narrows the focus from all possible spans to a linear number of candidates, reducing complexity to $O(n)$.
  2. Local Hypergraph Generation: For each candidate start token, the model generates a context-aware "query." This query guides a sequence labeling module (using an LSTM) to identify the boundaries and type of the entity starting at that specific token. This allows the model to produce different labels for the same word depending on which entity it is currently "looking" for.
  3. End Token Estimation: A final verification step ensures that predicted end boundaries are valid, pruning erroneous hypergraphs.
The local hypergraph generation process starting from candidate tokens like 'Saddam', 'his', and 'air'.

The system utilizes a robust encoding layer combining BERT, GloVe, character-level embeddings, and Part-of-Speech (POS) tags to ensure the model understands both global context and internal word structure.

Experimental Results

We evaluated our model on four standard nested NER benchmarks: ACE 2004, ACE 2005, KBP 2017, and GENIA. The "Local Hypergraph" model proved highly effective across the board:

  • State-of-the-Art (SOTA): It achieved a new record F1-score of 88.23 on the ACE 2004 dataset.
  • Superiority over Baselines: It outperformed all previous hypergraph-based and sequence labeling methods by large margins.
  • Efficiency: On GENIA and ACE 2005, it performed on par with the best span-based models while being significantly more computationally efficient.

Ablation studies confirmed that the query-based mechanism is vital for resolving complex nested structures, as it allows the model to focus on specific entity structures one at a time.

Conclusion

By shifting from global sentence modeling to local, query-based hypergraphs, we provide an efficient and accurate solution for nested NER. This approach maintains the speed of sequence labeling while providing the structural flexibility needed for complex linguistic patterns. Future work may explore bidirectional graph construction to further improve accuracy in specialized domains.

Summary updated

BibTeX
@misc{yan2022local,
  author = {Yukun Yan and Sen Song},
  title = {{Local Hypergraph-based Nested Named Entity Recognition as Query-based Sequence Labeling}},
  year = {2022},
  eprint = {2204.11467},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2204.11467},
}
Figure