2

I want train a spacy custom NER model,which is the best option?

the train data is ready (doccano)

option 1. use an existing pre-trained spacy model and update it with custom NER?.

option 2. create an empty model using spacy.blank() with custom NER?

I just want to identify my custom entity in a text, the other types of entities are not necessary...currently

louis_guitton
  • 5,105
  • 1
  • 31
  • 33
candres
  • 29
  • 4

1 Answers1

1

You want to leverage transfer learning as much as possible: this means you most likely want to use a pre-trained model (e.g. on Wikipedia data) and fine-tune it for your use case. This is because training a spacy.blank model from scratch will require lots of data, whereas fine tuning a pretrained model might require as few as a couple hundreds labels.

However, pay attention to catastrophic forgetting which is the fact that when fine-tuning on some of your new labels, the model might 'forget' some of the old labels because they are no longer present in the training set.

For example, let's say you are trying to label the entity DOCTOR on top of a pre-trained NER model that labels LOC, PERSON and ORG. You label 200 DOCTOR records and fine tune your model with them. You might find that the model now predicts every PERSON as a DOCTOR.

That's all one can say without knowing more about your data. Please check out the spacy docs on training ner for more details.

louis_guitton
  • 5,105
  • 1
  • 31
  • 33