Is there a way to return the top n most likely entity labels for NER?
I want to increase the coverage of my NER models and to predict the most likely entity label if the model is not >0.99 confident that the token should be tagged as "O" (OUTSIDE).
une un D_ind O O (0.9999514818191528)
course course N_C O O (0.999929666519165)
au 脿 P O O (0.9998410940170288)
Mol茅son Mol茅son N_P B-LABEL O (0.27142760157585144)
Thank you!
Hello @IsabelMeraner this is currently not possible in Flair, but we recently added support for exactly this to the TextClassifier. This is a good feature to have, so I think we will add this to the SequenceTagger as well, hopefully soon.
Hello @IsabelMeraner this is currently not possible in Flair, but we recently added support for exactly this to the
TextClassifier. This is a good feature to have, so I think we will add this to theSequenceTaggeras well, hopefully soon.
Hello @alanakbik
Thank you so much for your quick reply. Perfect, that sounds great.
This would be a nice feature. I have a similar use-case where we want to analyze the probability distribution for all NER tags for each token. Currently, Token.tag only returns the most likely tag (i.e., the one with highest score).
@jantrienes sounds interesting, we'll try to add this feature soon!
Hi,
I created a draft PR regarding this feature: https://github.com/zalandoresearch/flair/pull/782.
The PR builds upon https://github.com/zalandoresearch/flair/pull/642.
I'll be happy if you give it a look @alanakbik @jantrienes.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Most helpful comment
@jantrienes sounds interesting, we'll try to add this feature soon!