How to force/guide NER detection to produce at least one guess ? #9628
-
I'm using Named Entities Dection (a home trained version). I use it on short text lines (titles) where I know that there is as least one NER to find (but I don't know where). I works quite ok, but sometimes it does not detect any NER in a title. I suppose that the detection confidence was too low... I'm nearly sure that, on my application, this best guess strategy will improve my process. Any help will be appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
This isn't possible with the |
Beta Was this translation helpful? Give feedback.
This isn't possible with the
ner
component. With thespancat
component, you can set a very low threshold for prediction and then select the top N predictions from the stored scores (see https://spacy.io/api/spancategorizer#assigned-attributes), although it's still not guaranteed that the model will make at least one prediction for any given text. This is just brainstorming, but I think you could have some kind of backoff for the case without any predictions, like selecting the first proper noun in the text.