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

predict(sentence, multi_class_prob=True) in TextClassification no longer works #1709

Closed
Amyylam opened this issue Jun 22, 2020 · 2 comments · Fixed by #1717
Closed

predict(sentence, multi_class_prob=True) in TextClassification no longer works #1709

Amyylam opened this issue Jun 22, 2020 · 2 comments · Fixed by #1717
Labels
bug Something isn't working

Comments

@Amyylam
Copy link

Amyylam commented Jun 22, 2020

Describe the bug
predict(sentence, multi_class_prob=True) used to give probabilities for all labels, but now only give out one label and associated probability. I have to revert to earlier commit to produce multiple class probabilities (pip install --upgrade git+https://github.com/flairNLP/flair.git@63aeabf9a18bdf53af3bcba5bd80f43ac717656e).

To Reproduce
Steps to reproduce the behavior (e.g. which model did you train? what parameters did you use? etc.).

sentence = Sentence("Growth weakens as investment drops, consumers fade")

finetuned_classifier.predict(sentence,multi_class_prob=True)

print(sentence.labels)

Expected behavior
it should return: [1 (0.0), -1 (1.0), 0 (0.0)]
given the training data has 3 classes.

Screenshots
now above steps returns only: [0 (0.0)]

Environment (please complete the following information):

@Amyylam Amyylam added the bug Something isn't working label Jun 22, 2020
alanakbik added a commit that referenced this issue Jun 24, 2020
@alanakbik
Copy link
Collaborator

@Amyylam should be fixed now! Can you check?

@Amyylam
Copy link
Author

Amyylam commented Jun 24, 2020

Thanks for the bug fix! It's working now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants