Relation extraction (RE) has achieved remarkable progress with the help of pre-trained language models. However, existing RE models are usually incapable of handling two situations: implicit expressions and long-tail relation types, caused by language complexity and data sparsity. In this paper, we introduce a simple enhancement of RE using $k$ nearest neighbors ($k$NN-RE). $k$NN-RE allows the model to consult training relations at test time through a nearest-neighbor search and provides a simple yet effective means to tackle the two issues above. Additionally, we observe that $k$NN-RE serves as an effective way to leverage distant supervision (DS) data for RE. Experimental results show that the proposed $k$NN-RE achieves state-of-the-art performances on a variety of supervised RE datasets, i.e., ACE05, SciERC, and Wiki80, along with outperforming the best model to date on the i2b2 and Wiki80 datasets in the setting of allowing using DS. Our code and models are available at: https://github.com/YukinoWan/kNN-RE.
翻译:关系抽取(RE)在预训练语言模型的帮助下取得了显著进展。然而,由于语言复杂性和数据稀疏性,现有RE模型通常无法处理两种场景:隐式表达和长尾关系类型。本文提出一种基于k近邻的简单增强方法(kNN-RE)。kNN-RE使模型在测试时能够通过最近邻搜索参考训练关系,并提供了一种简单有效的手段来解决上述两个问题。此外,我们观察到kNN-RE是利用远程监督数据增强RE的有效途径。实验结果表明,在监督RE数据集(ACE05、SciERC和Wiki80)上,所提出的kNN-RE取得了最优性能;在允许使用远程监督的设置下,kNN-RE在i2b2和Wiki80数据集上超越了当前最佳模型。我们的代码和模型可在 https://github.com/YukinoWan/kNN-RE 获取。