Exploring Cross-sentence Contexts for Named Entity Recognition with BERT

Jouni Luoma, Sampo Pyysalo
6/2/2020
cs.CL

Official code: jouniluoma/bert-ner-cmv (13 stars, Python, MIT, last commit 2021-12-17).

Abstract

Named entity recognition (NER) is frequently addressed as a sequence classification task where each input consists of one sentence of text. It is nevertheless clear that useful information for the task can often be found outside of the scope of a single-sentence context.

Show full abstract

Recently proposed self-attention models such as BERT can both efficiently capture long-distance relationships in input as well as represent inputs consisting of several sentences, creating new opportunitites for approaches that incorporate cross-sentence information in natural language processing tasks. In this paper, we present a systematic study exploring the use of cross-sentence information for NER using BERT models in five languages. We find that adding context in the form of additional sentences to BERT input systematically increases NER performance on all of the tested languages and models. Including multiple sentences in each input also allows us to study the predictions of the same sentences in different contexts. We propose a straightforward method, Contextual Majority Voting (CMV), to combine different predictions for sentences and demonstrate this to further increase NER performance with BERT. Our approach does not require any changes to the underlying BERT architecture, rather relying on restructuring examples for training and prediction. Evaluation on established datasets, including the CoNLL'02 and CoNLL'03 NER benchmarks, demonstrates that our proposed approach can improve on the state-of-the-art NER results on English, Dutch, and Finnish, achieves the best reported BERT-based results on German, and is on par with performance reported with other BERT-based approaches in Spanish. We release all methods implemented in this work under open licenses.

View on arXivView PDF

Code Implementations(1)

MIT
130Python, ShellJun 4, 20204 years agoMIT

Similar Papers

Cite this paper

@article{luoma2020exploring,
  title  = {Exploring Cross-sentence Contexts for Named Entity Recognition with BERT},
  author = {Jouni Luoma and Sampo Pyysalo},
  year   = {2020},
  eprint = {2006.01563},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2006.01563}
}

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/2006.01563.svg)](https://codeofpaper.com/paper/2006.01563)

Discussion