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

Multi-Label Classification Problem #83

Open
satish860 opened this issue Jul 27, 2022 · 1 comment
Open

Multi-Label Classification Problem #83

satish860 opened this issue Jul 27, 2022 · 1 comment

Comments

@satish860
Copy link

Hello, I'm new to DL and have just begun the Fastai course for 2022.

I'm working on a Multi-label classification problem and downloaded the Emotions Dataset from Hugging. As shown below, this Dataset used an Array to show the Multi-label.
image

I've looked at the example in the repository. You have changed the data to this One-hot encoding value.
image

and then used the Colreader to get the Y variable.

So, my question is: Do I have to use the same structure for my problem as well, or is there a different one I can use?

@ohmeow
Copy link
Owner

ohmeow commented Jul 28, 2022

Yah, if its multi-label, you need to:

  1. OHE the targets as 1 or 0
  2. When you create the HF tokenizer, tell it the number of classes that need to be predicted
  3. Use BinaryCrossEntropyLoss as your loss function

I have an example here: https://ohmeow.github.io/blurr/text-examples-multilabel.html

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

No branches or pull requests

2 participants