urchade / GLiNER

Generalist and Lightweight Model for Named Entity Recognition (Extract any entity types from texts) @ NAACL 2024
https://arxiv.org/abs/2311.08526
Apache License 2.0
1.47k stars 126 forks source link

Adding score in the model output #44

Closed SJ-Ray closed 8 months ago

SJ-Ray commented 8 months ago

Modified the package to return the scores as well along with the labels.

Previous output sample: [{'start': 1, 'end': 36, 'text': 'Cristiano Ronaldo dos Santos Aveiro', 'label': 'person'}]
New output sample: [{'start': 1, 'end': 36, 'text': 'Cristiano Ronaldo dos Santos Aveiro', 'label': 'person', 'score': 0.8832555413246155}]
urchade commented 8 months ago

Cool, thanks

urchade commented 8 months ago

I think it would better to run sigmoid on the local score in predict so we do it only once @SJ-Ray As applying sigmoid do not change the result of the greedy span selection

SJ-Ray commented 8 months ago

Agree, let me update it.