Label Semantics for Few Shot Named Entity Recognition

Jie Ma, Miguel Ballesteros, Srikanth Doss, Rishita Anubhai, Sunil Mallya, Yaser Al-Onaizan, Dan Roth

Introduction

Named Entity Recognition (NER) is a fundamental task in Natural Language Processing, yet developing high-performing systems typically necessitates thousands of manually annotated sentences. In "few-shot" scenarios—where only 1 to 5 examples per category are available—standard models often falter because they treat entity labels as discrete, meaningless integers.

This research addresses this limitation by positing that labels like PER (person), LOC (location), or ORG (organization) are not merely indices but represent concepts already understood by pre-trained language models. By leveraging the linguistic knowledge embedded in models like BERT, the authors propose an architecture that matches document tokens to semantic label descriptions, enabling effective recognition even with minimal training data.

Methods

The researchers introduce a two-tower BERT architecture designed to align document text and label names within the same semantic space.

The two-tower BERT architecture for semantic label matching.

The Workflow

  1. Label Encoding: Shorthand labels are converted into natural language (e.g., PER becomes "person"). To accommodate multi-word entities, these are expanded using a BIO scheme (e.g., "begin person," "inside person"). A dedicated Label Encoder (BERT) processes these descriptions.
  2. Document Encoding: A standard Document Encoder (BERT) processes the input sentence to produce token-level embeddings.
  3. Semantic Matching: Rather than using a traditional classification layer, the model calculates the dot product (similarity) between a token's embedding and all possible label embeddings. The label with the highest similarity score is predicted.
  4. Two-Stage Training: The model undergoes "pre-finetuning" on the large-scale OntoNotes 5.0 dataset to align the token and label spaces before being fine-tuned on specific, low-resource target datasets.

This approach eliminates the need for randomly initialized output layers for new datasets, as the "classifier" is effectively a lookup table of embeddings generated by the Label Encoder.

Datasets and Evaluation

The model was evaluated across a diverse array of benchmarks to test its cross-domain robustness:

  • General News: CoNLL-2003
  • Social Media: WNUT-2017
  • Biomedical/Scientific: JNLPBA and NCBI-disease
  • Medical Records: I2B2-2014

Key Insights

  • Semantic Priors: Label names act as an "enriched prior." BERT’s pre-training allows it to recognize what a "location" or "organization" looks like in context before seeing any task-specific examples.
  • The Importance of Meaning: Ablation studies revealed that using "meaningless" labels (e.g., "Label 1") significantly degraded performance in 1-shot settings. Using "misleading" labels (e.g., swapping "person" with "location") actively confused the model, proving that the semantic content of the label is critical.
  • Zero-Shot Capability: Because the model relies on label semantics, it can identify entities it has never encountered during training simply by being provided the name of the new category.
  • Inference Efficiency: Label embeddings can be cached after calculation, meaning the second "tower" does not need to run during production, maintaining the speed of a standard BERT classifier.

Key Results

The model demonstrates its greatest strength in extreme low-resource regimes. On average, it outperformed previous state-of-the-art methods—including prototypical networks and sequence-to-sequence models—by 4.8 to 6.6 F1 points in 1-shot and 5-shot settings.

Performance comparison across five benchmarks in few-shot and full-data settings.

In the CoNLL-2003 1-shot setting, the model achieved an F1 of 68.4, a substantial improvement over the 44.8 F1 achieved by standard TransferBERT. While the advantage of semantic priors diminishes as the volume of training data increases (e.g., 50-shot or full dataset), the model remains competitive with standard supervised state-of-the-art methods, serving as a robust "safety net" for data-scarce environments.

Limitations and Future Work

Performance varies by domain; results were lower on highly specialized biomedical datasets (like JNLPBA) compared to general news. This suggests that general-purpose BERT priors for terms like "protein" are less distinct than for common concepts like "person." Additionally, the model is sensitive to label naming; ambiguous or poorly chosen names can negatively impact performance. Future research may explore more sophisticated ways to provide context for label meanings beyond simple name encoding.

Summary updated

BibTeX
@inproceedings{ma2022label,
  author = {Jie Ma and Miguel Ballesteros and Srikanth Doss and Rishita Anubhai and Sunil Mallya and Yaser Al-Onaizan and Dan Roth},
  title = {{Label Semantics for Few Shot Named Entity Recognition}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2022},
  doi = {10.18653/v1/2022.findings-acl.155},
}
Figure