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

Add documentation for multi-label classification #14168

Merged

Conversation

gsnidero
Copy link
Contributor

What does this PR do?

Works toward fixing #9772

The problem_type="multi_label_classification" in PretrainedConfig exist for many models; however, I added documentation for DistilBert only for now. If what I've done so far looks good, I'll add the same to the remaining models; otherwise I need some guidance.

Also, I have added a notebook with a full example in huggingface/notebooks#102

Before submitting

Who can review?

Anyone in the community is free to review the PR once the tests have passed.

@LysandreJik and @sgugger may be interested in this review.

@sgugger
Copy link
Collaborator

sgugger commented Oct 27, 2021

I don't think this is the right way to fix it: the docstring you have written is great, but it should be added in the base sequence classification docstring, as all models with a sequence classification head should accept problem_type. I will fix the models that do not deal with it and then you can amend your PR, does that sound right?

@gsnidero
Copy link
Contributor Author

Thanks @sgugger !

Sure - by the "base sequence classification docstring" you mean this?
https://github.com/huggingface/transformers/blob/master/src/transformers/file_utils.py#L828
https://github.com/huggingface/transformers/blob/master/src/transformers/file_utils.py#L1273

Happy to help you fixing the models that do not currently support problem_type if you like. I took the list of models that should support it from https://github.com/huggingface/transformers/blob/master/src/transformers/configuration_utils.py#L181.

@sgugger
Copy link
Collaborator

sgugger commented Oct 27, 2021

Yes, I meant that docstring.
The PR to enable problem_type on all sequence classification models is #14180 , which will hopefully be merged soon :-)

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

@gsnidero gsnidero closed this Nov 30, 2021
@gsnidero gsnidero force-pushed the add-docs-multi-label-classification branch from 4f1dd9b to 8ddbfe9 Compare November 30, 2021 13:03
@gsnidero gsnidero reopened this Nov 30, 2021
@gsnidero gsnidero force-pushed the add-docs-multi-label-classification branch from 4f1dd9b to 5bfdc77 Compare November 30, 2021 14:03
@gsnidero gsnidero changed the title [WIP] Add documentation for multi-label classification Add documentation for multi-label classification Nov 30, 2021
@gsnidero
Copy link
Contributor Author

Hi @sgugger,

Modified as suggested - hope this helps.

Best,
Giacomo

Copy link
Collaborator

@sgugger sgugger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for adapting it, it's much better this way!

@sgugger sgugger merged commit 4176bc1 into huggingface:master Nov 30, 2021
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.

2 participants