Few-Shot Nested Named Entity Recognition

Hong Ming, Jiaoyun Yang, Lili Jiang, Yan Pan, Ning An

TL;DR

This paper introduces the first framework specifically designed for few-shot nested Named Entity Recognition (NER), a challenging task due to both limited labeled data and complex entity structures. Their proposed Biaffine-based Contrastive Learning (BCL) model effectively distinguishes nested entities by learning contextual span dependencies, achieving state-of-the-art results on multiple datasets.

What Problem Does This Paper Address?

Named Entity Recognition (NER) is a fundamental task in Natural Language Processing (NLP) that aims to identify and categorize entities (like people, organizations, or locations) within text. Traditional NER often deals with "flat" entities, where entities do not overlap. However, many real-world scenarios involve "nested" entities, where one entity can be contained within another (e.g., "PAX-5" nested within "PAX-5 transcription"). This nesting significantly complicates NER because nested entities often share similar semantic features, making them difficult to distinguish.

Furthermore, obtaining large amounts of labeled data for NER is expensive and time-consuming. This is particularly true for nested NER, where annotators need to be highly skilled. The "few-shot" setting, where models must learn to recognize entities with only a handful of labeled examples, exacerbates this problem. Prior work has touched upon nested structures in few-shot learning, but this paper is the first to specifically tackle the few-shot nested NER task as its primary focus.

Methods

The core of the proposed solution is the Biaffine-based Contrastive Learning (BCL) framework. It comprises three main modules:

  1. Pre-trained Language Model (PLM): The paper uses BERTbase_multilingual to generate initial word embeddings, capturing semantic information.
  2. Biaffine Span Representation Module: This is the novel component. Instead of just relying on semantic representations, BCL learns contextual span dependency representations. It uses a BiLSTM to capture contextual features, followed by a Biaffine layer. This layer models the dependency between words within a span and words outside it, which is crucial for distinguishing nested entities. The dependency representation is then merged with the original semantic representation via a residual connection. Finally, max pooling is applied to extract the span representation, highlighting important features within the span.
  3. Contrastive Optimization Module: To handle the few-shot learning challenge and improve generalization, BCL employs a contrastive learning approach using the circle loss. This loss function aims to increase the similarity between representations of spans belonging to the same entity category and decrease the similarity between spans of different categories. This helps create more distinct clusters for entity representations, making them easier to classify.

The training process involves first training the BCL model on a large source domain dataset (FewNERD) and then fine-tuning it on the limited support set of the target domain. For inference, a nearest neighbor algorithm is used.

Datasets

The paper evaluates its framework on three nested NER datasets and one flat NER dataset:

  • GENIA: English, 36 entity types.
  • GermEval: German, 12 entity types.
  • NEREL: Russian, 29 entity types.
  • FewNERD: English, 66 entity types (used as the source domain for transfer learning).

The former three are nested NER datasets, while FewNERD is a flat NER dataset.

Key Insights and Ideas

  • Dependency Matters for Nested Entities: The paper strongly argues that simply using semantic representations is insufficient for nested NER. Capturing the dependency patterns between words within and outside an entity span is key to distinguishing them.
  • BCL Creates More Distinct Clusters: Visualizations (using t-SNE) show that the BCL model's span representations are more separated and clustered compared to a standard BERT model, especially for nested entities.
  • Contrastive Learning Bridges the Gap: The contrastive learning framework, particularly with circle loss, effectively handles the few-shot setting by learning to group similar entities and separate dissimilar ones, without requiring consistent label sets between source and target domains.
  • Multilingual PLMs are Robust: Using a multilingual BERT model works well across different languages, demonstrating its utility for cross-lingual few-shot NER tasks, even if a monolingual model might offer a slight edge on a single language.

Key Results

The BCL framework achieved state-of-the-art performance on the evaluated nested NER datasets (GENIA, GermEval, and NEREL) for both 1-shot and 5-shot settings. For instance, on GENIA, BCL achieved an F₁ score of 46.06 ± 1.22% in the 5-shot setting, outperforming baselines like NNShot, ProtoNet, and CONTaiNER by significant margins (e.g., 12.12% improvement over NNShot). An ablation study confirmed that the Biaffine layer contributed the most to the performance gains, validating the importance of span dependency learning.

Limitations and Future Work

  • Language Family: The current experiments were conducted on Indo-European languages. The authors suggest that validating BCL's performance on other language families would be valuable.
  • Flat NER Performance: While BCL performs comparably on flat NER tasks, its advantage is less pronounced compared to nested NER. The authors note that the gap between BCL and state-of-the-art models widens in the 1~2 shot setting for flat NER, suggesting that more positive samples might be needed for BCL to fully learn the target domain entity span distribution in such cases.
  • Unlabeled Data: The authors acknowledge the vast amount of unlabeled data available and propose exploring ways to leverage it in future work.

Summary updated

BibTeX
@article{ming2022few,
  author = {Hong Ming and Jiaoyun Yang and Lili Jiang and Yan Pan and Ning An},
  title = {{Few-Shot Nested Named Entity Recognition}},
  journal = {Knowledge-Based Systems},
  year = {2022},
}
Figure