[ASK] Adding custom entity labels to BERT NER

Author: atakanokanCreated Oct 4, 2019Updated Apr 26, 2021

Description

Is it possible to finetune BERT NER on custom entity labels other than what is shown in https://github.com/microsoft/nlp/blob/master/examples/named_entity_recognition/ner_wikigold_bert.ipynb (Cell 4) :

Unique entity labels: 
['O', 'I-LOC', 'I-MISC', 'I-PER', 'I-ORG']

Other Comments

It seems possible but wanted to make sure. Procedure:

  1. Write custom dataset file like the one for Wikigold dataset: https://github.com/microsoft/nlp/blob/master/utils_nlp/dataset/wikigold.py
  2. Use this module to load entity labels, and train using the same code afterwards.