-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
predict should return label/tag plus confidence value #38
Comments
GH-38: Add label class for sentences to hold label name and confidence value
I'd be interested in confidences for the assigned labels in the sequence labeling tasks (and may implement it, if you are not already working on this). |
Yes, we agree :) We are currently implementing this and will push soon into release-0.3 branch for testing, and then (hopefully soon) we will release the next version that will contain this feature! |
Added to release-03 branch - will be part of next release! |
In the case of two label classification, can we somehow get the probability of given text document for both classes? For example, For a given text document D1, I need output like this: Thanks in advance, |
There is a PR pending right now that will allow you to do this, see #693. Once its merged you will have this functionality in the master branch and eventually in the next release of Flair. |
Hi guys, in which versions and how can I use this feature? Thanks :) |
Hi @haozturk you already can with the current version: from flair.data import Sentence
from flair.models import SequenceTagger
tagger = SequenceTagger.load('ner')
sentence = Sentence('I live in Berlin')
tagger.predict(sentence)
for entity in sentence.get_spans('ner'):
print(entity)
print(entity.tag)
print(entity.score) |
Currently, the
predict()
method of a trained text classification model will just return the label name, but not the confidence. Same holds true for the sequence labeling model.However, depending on the use case you maybe only want to use labels with a confidence value higher than 0.9. Thus, we should add the confidence to the return value of the
predict()
method.The text was updated successfully, but these errors were encountered: