Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Order of labels impacts detection confidence scores #192

Open
saibhamidipati opened this issue Sep 19, 2024 · 2 comments
Open

Order of labels impacts detection confidence scores #192

saibhamidipati opened this issue Sep 19, 2024 · 2 comments

Comments

@saibhamidipati
Copy link

saibhamidipati commented Sep 19, 2024

I'm using the PII model using the following script:

model = GLiNER.from_pretrained("urchade/gliner_multi_pii-v1")
model.eval()
entities = model.predict_entities(text, labels)

for entity in entities:
    print(entity["text"], "=>", entity["label"], "=>", entity["score"] )

If my order of labels changes, I get a different score for the detected entities. Why is this happening?

@urchade
Copy link
Owner

urchade commented Sep 20, 2024

Hi, it is because the model uses positional encoding
Bi-encode version of gliner of @Ingvarstep should not have this effect

@saibhamidipati
Copy link
Author

Thanks for your response, but I don't find bi-encoder version for gliner_multi_pii-v1. Is it available yet?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants