Allowing NER to overwrite existing entities #5262
-
ner = EntityRecognizer(nlp.vocab)
ner.from_disk('/path/model') and ner = EntityRecognizer(nlp.vocab)
ner.from_disk('/path/model/ner') but both fails. Either Which page or section is this issue related to?
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Beta Was this translation helpful? Give feedback.
No, the NER model doesn't have a setting to overwrite entities, but it will preserve any existing entities, so you could reverse your pipeline to run the higher priority models first. The only complication is that the presence of existing entities can change the predictions to some degree (and especially if they're otherwise overlapping), so you want to check that the performance is what you expect. In particular, you can end up with partial entities because it predicts word by word. It can start predicting an entity a few words before it runs into an existing entity, and then it leaves the partial entity when it moves on to the next word. So it can predict something like
B-PER I-PER B-…