kNN-NER: Named Entity Recognition with Nearest Neighbor Search

Shuhe Wang, Xiaoya Li, Yuxian Meng, Tianwei Zhang, Rongbin Ouyang +2 more
3/31/2022
cs.CL

Official code: ShannonAI/KNN-NER (54 stars, Python, last commit 2022-04-07).

Abstract

Inspired by recent advances in retrieval augmented methods in NLP~\citep{khandelwal2019generalization,khandelwal2020nearest,meng2021gnn}, in this paper, we introduce a $k$ nearest neighbor NER ($k$NN-NER) framework, which augments the distribution of entity labels by assigning $k$ nearest neighbors retrieved from the training set. This strategy makes the model more capable of handling long-tail cases, along with better few-shot learning abilities. $k$NN-NER requires no additional operation during the training phase, and by interpolating $k$ nearest neighbors search into the vanilla NER model, $k$NN-NER consistently outperforms its vanilla counterparts: we achieve a new state-of-the-art F1-score of 72.03 (+1.25) on the Chinese Weibo dataset and improved results on a variety of widely used NER benchmarks. Additionally, we show that $k$NN-NER can achieve comparable results to the vanilla NER model with 40\% less amount of training data. Code available at \url{https://github.com/ShannonAI/KNN-NER}.

View on arXivView PDF

Code Implementations(1)

ShannonAI/KNN-NEROfficial100%
547Python, ShellMar 27, 20224 years ago

Similar Papers

Cite this paper

@article{wang2022knnner,
  title  = {kNN-NER: Named Entity Recognition with Nearest Neighbor Search},
  author = {Shuhe Wang and Xiaoya Li and Yuxian Meng and Tianwei Zhang and Rongbin Ouyang and Jiwei Li and Guoyin Wang},
  year   = {2022},
  eprint = {2203.17103},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2203.17103}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2203.17103.svg)](https://codeofpaper.com/paper/2203.17103)

Discussion