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

capability to change threshold during multi label classification #707

Conversation

ashutoshsingh0223
Copy link
Contributor

@ashutoshsingh0223 ashutoshsingh0223 commented May 2, 2019

Ability to set custom threshold level for multi-label classification problems while initialising the TextClassifier class. Default value is 0.5

Eg

text_classifier = TextClassifier(doc_embeddings,label_dictionary=label_dictionary, multi_label=True, multi_label_threshold=0.7 )

Any changes can be made later on just by changing this variable. For Eg.

classifier = TextClassifier.load_from_file("<model_path>")
classifier.multi_label_threshold = 0.65
classifier.predict(Sentence("<sentence>"))

@ashutoshsingh0223
Copy link
Contributor Author

@stefan-it . Can you take a look??

@alanakbik
Copy link
Collaborator

@ashutoshsingh0223 thanks for adding this! And sorry it took so long to review.

@alanakbik
Copy link
Collaborator

👍

@stefan-it
Copy link
Member

👍

@alanakbik alanakbik merged commit db96d22 into flairNLP:master May 8, 2019
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

Successfully merging this pull request may close these issues.

3 participants