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
Add method to find probability for each class in case of multi-class classification #693
Add method to find probability for each class in case of multi-class classification #693
Conversation
@alanakbik @tabergma @kashif @pranjalsrajput @khituras @stefan-it |
@alanakbik Please have a look. |
@amansrivastava17 thanks for adding this - lots of people will find this useful. Just to clarify: this only modifies the private function |
…se of multiclass0
@alanakbik I have added code usage in the description above. You were right, the user who uses just predict function will not be able to use this feature, for this, I have added one |
@stefan-it Please have a look |
Looks good so far, I'll add a review now :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be awesome if you could also add a relevant integration test for that new method.
For example you could build such an integration test on-top of the imdb
test:
https://github.com/zalandoresearch/flair/blob/master/tests/test_model_integration.py#L378
@stefan-it Hi, I have added integration test for new method Please check here |
@amansrivastava17 it looks like the new integration test is throwing an error. Could you check? In particular, it looks like you are using the method |
@alanakbik Have fixed integration issue. |
Looks good, thanks! |
👍 |
1 similar comment
👍 |
@stefan-it have made changes, Please approve. |
Thanks for adding this feature :) |
hi @stefan-it, @amansrivastava17, Is this feature already available to be used in flair? I tried but failed, it says: "TypeError: predict() got an unexpected keyword argument 'multi_class_prob'". I am using flair version 0.4.1. Thanks |
It's merged into the master branch and so will be part of upcoming v0.4.2, but currently the only way to use the feature is to use the master branch. |
Hi @alanakbik, When is v0.4.2 scheduled for release? |
I am hoping to get v0.4.2 out before NAACL, i.e. end of next week. |
Added feature to get the confidence score of each class in case of Multi-class text classification
Added new param
multi_class_prob
to functionpredict
to return the confidence score of all classes instead of just returning class with the highest confidence.Example to use this method