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

Unbiased model not returning identity labels #61

Open
SallyBean opened this issue Aug 23, 2022 · 6 comments
Open

Unbiased model not returning identity labels #61

SallyBean opened this issue Aug 23, 2022 · 6 comments

Comments

@SallyBean
Copy link

Thanks for the great repo!

I'm running the 'Quick prediction' code using the unbiased model, but there are no identity labels being returned - even with severe toxicity. I only get the toxicity labels.

Am I missing something?

Thanks again!

@m13uz
Copy link
Collaborator

m13uz commented Aug 24, 2022

@SallyBean could you please provide a minimal reproducible example of the issue, e.g. a code snippet?

@SallyBean
Copy link
Author

SallyBean commented Aug 24, 2022

@m13uz Sure, sorry about that! Thanks for your help in advance. :)

!pip install detoxify
from detoxify import Detoxify

input_text=["I hate women", "Men are idiots"]

results = Detoxify('unbiased').predict(input_text)

model = Detoxify('unbiased', device='cuda')

import pandas as pd

pd.DataFrame(results, index=input_text).round(5))

output (without the expected identity labels):
image

@jamt9000
Copy link
Collaborator

jamt9000 commented Sep 2, 2022

This is by design - the detoxify wrapper only returns the toxicity-related classes, since identity outputs are more intended for de-biasing during training. If you want them you could load the model checkpoint directly.

@Mario-RC
Copy link

Mario-RC commented Jan 3, 2023

This is by design - the detoxify wrapper only returns the toxicity-related classes, since identity outputs are more intended for de-biasing during training. If you want them you could load the model checkpoint directly.

Hello, how can I download and load the model checkpoint that returns identity labels? They would be very useful for my projects, thank you!

@tongarii
Copy link

tongarii commented Jan 4, 2023

Hello, is there any update over here? I couldn't find the checkpoints either
Thank you!!

@laurahanu
Copy link
Collaborator

Hello, that would be the unbiased model checkpoint, one way to get it to return the identity labels is to:

  • overwrite the class_names in the config that's saved inside the checkpoint with all the class names from here (combined as one list in the same order) and save the checkpoint with the updated class names
  • initialise the detoxify model from the newly saved checkpoint

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

6 participants