Skip to content

fix logit-to-multi-hot conversion in example#26936

Merged
younesbelkada merged 3 commits intohuggingface:mainfrom
ranchlai:fix-run-classifiction-example
Oct 23, 2023
Merged

fix logit-to-multi-hot conversion in example#26936
younesbelkada merged 3 commits intohuggingface:mainfrom
ranchlai:fix-run-classifiction-example

Conversation

@ranchlai
Copy link
Contributor

What does this PR do?

This PR fixes #26830 . The bug might lead to difference in measuring multi-label acc (Slightly higher precision and lower recall).

@younesbelkada Would you please review.

@ranchlai ranchlai changed the title fix logit to multi-hot converstion fix logit-to-multi-hot conversion in example Oct 19, 2023
Copy link
Contributor

@younesbelkada younesbelkada left a comment

Choose a reason for hiding this comment

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

Thanks!

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint.

Copy link
Collaborator

@ArthurZucker ArthurZucker left a comment

Choose a reason for hiding this comment

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

Should we not apply sigmoid ?
Otherwise fine with me. There is a way to pass a specific function to the trainer: preprocess_logits_for_metrics which can apply the sigmoid otherwise (but not needed here)

@ranchlai
Copy link
Contributor Author

@ArthurZucker I've updated the comment for educational purpose.

Copy link
Collaborator

@ArthurZucker ArthurZucker left a comment

Choose a reason for hiding this comment

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

Cool thanks!

@younesbelkada younesbelkada merged commit f71c9cc into huggingface:main Oct 23, 2023
EduardoPach pushed a commit to EduardoPach/transformers that referenced this pull request Nov 19, 2023
* fix logit to multi-hot converstion

* add comments

* typo
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.

Possible error in text classification example code for multi-label classification

4 participants