Nested Named Entity Recognition with Partially-Observed TreeCRFs

Yao Fu, Chuanqi Tan, Mosha Chen, Songfang Huang, Fei Huang

Introduction

Nested Named Entity Recognition (NER) represents a significant leap in complexity over standard "flat" NER. While traditional systems assign a single label to each token, real-world language often features hierarchical entities where one span is contained within another. This paper proposes a novel framework that redefines nested NER as a constituency parsing task, utilizing Partially-Observed TreeCRFs and a high-performance Masked Inside algorithm.

The Nested NER Challenge

In flat NER, a phrase like "New York" is simply a Location. However, consider the phrase "[ [North Korea]’s announcements ]". Here, "North Korea" is a Geopolitical Entity (GPE), but it is also nested within a larger span representing an organization's or person's statement.

Example of nested named entities where spans overlap and contain one another.

Standard sequence labeling (e.g., BIO tagging) is fundamentally incapable of representing these overlaps because it assumes a one-to-one mapping between tokens and labels. While previous research has explored hypergraphs or transition-based parsers, these often require manual feature engineering or fail to model global dependencies effectively.

Methodology: NER as Partial Parsing

The authors treat a sentence with nested entities as a partially-observed constituency tree. In this view, labeled entities are "observed" nodes, while the remaining possible spans in the sentence are "latent" nodes that complete the tree structure.

The TreeCRF Model

The system employs a Tree Conditional Random Field (TreeCRF) to model the global distribution of spans. A Biaffine scoring mechanism is used to generate log potentials for every possible span in a sentence.

Visualization of the partially-observed tree structure with observed, rejected, and latent nodes.

The Masked Inside Algorithm

The primary technical innovation is the Masked Inside algorithm. Standard Inside algorithms sum over all possible tree structures to calculate the partition function. To handle partial observations, the authors introduce a masking matrix. This mask allows the model to marginalize out latent nodes while strictly rejecting any spans that contradict the known entity boundaries. This approach leverages highly-parallelized GPU kernels, reducing training time significantly.

Experimental Results

The model was rigorously tested on three benchmark datasets: ACE2004, ACE2005, and GENIA (biomedical).

  • Performance: The approach achieved state-of-the-art (SOTA) F1 scores on ACE2004 (86.6) and ACE2005 (85.4).
  • Efficiency: The Masked Inside algorithm provided a 4.5x speedup over vanilla implementations. Training an epoch on ACE2004 took just 3 minutes and 20 seconds, making TreeCRFs viable for large-scale applications.
  • Latent Structure: Interestingly, the "latent" nodes realized by the model often aligned with meaningful linguistic units like prepositional phrases, suggesting the model learns an internal grammar to aid its NER predictions.

Conclusion and Future Work

By unifying NER and parsing through Partially-Observed TreeCRFs, this work provides a probabilistically principled and computationally efficient solution for nested entity extraction. Future directions include addressing class imbalance for rare entity types and integrating this approach with unsupervised grammar induction to further refine the model's understanding of sentence structure.

Summary updated

BibTeX
@inproceedings{fu2021nested,
  author = {Yao Fu and Chuanqi Tan and Mosha Chen and Songfang Huang and Fei Huang},
  title = {{Nested Named Entity Recognition with Partially-Observed TreeCRFs}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2021},
  doi = {10.1609/aaai.v35i14.17519},
}
Figure