More than one NER component in the pipeline #8078
-
Hi there ! I have a question about having more than one NER component in the pipeline. Suppose that we have 2 NER models, for the sentence "It's Trump Tower", the first ner will recognize If we add both the two ner components in the pipeline, I see that currently it only keeps If it's spacy who does the job, can I know more details about how it manage different overlapping cases ? Thanks a lot ! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
Hi! Typically, I think the first NER will annotate what it can, and the second NER won't overwrite/change any of those predictions. In that sense, I'm a little puzzled by this sentence:
NER components typically preserve existing annotations - so I would have expected that you get "Trump" from the first NER, and perhaps nothing, or just "Tower", from the second. Are you 100% sure that the first would have correctly recognized "Trump" if you run it in a pipeline by itself? Perhaps in this particular case, "Trump" simply wasn't recognized as an entity by the first NER, leaving all tokens to the second NER to annotate. To verify - can you share some example code & output?
Assuming these are three different tokens, then I'd expect ner1 to recognize AB, but after that ner2 won't be able to recover BC, because tokens can't be in different named entities at the same time. Hope that helps - but happy to discuss further if you can provide more details/code! |
Beta Was this translation helpful? Give feedback.
Hi!
Typically, I think the first NER will annotate what it can, and the second NER won't overwrite/change any of those predictions. In that sense, I'm a little puzzled by this sentence:
NER components typically preserve existing annotations - so I would have expected that you get "Trump" from the first NER, and perhaps nothing, or just "Tower", from the second. Are you 100% sure that the first would have correctly recognized "Trump" if you run it in a pipeline by itself? Perhaps in this particular case, "Trump" simply wasn't recognized as an entity by the first NE…