Downloads · 30 days
29
1% of all-time downloads
davidmasip/racism
racism is a text classification model from davidmasip. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as cc.
Model to predict whether a given text is racist or not: LABEL0 output indicates non-racist text LABEL1 output indicates racist text
Downloads · 30 days
29
1% of all-time downloads
All-time downloads
3K
Public
Repo size
1.9 GB
Likes
0
Public
Click a slice to open those files.
.bin499 MB · 99%
From the Hugging Face model README
Model to predict whether a given text is racist or not:
LABEL_0 output indicates non-racist textLABEL_1 output indicates racist textUsage:
from transformers import pipeline
RACISM_MODEL = "davidmasip/racism"
racism_analysis_pipe = pipeline("text-classification",
model=RACISM_MODEL, tokenizer=RACISM_MODEL)
results = racism_analysis_pipe("Unos menas agreden a una mujer.")
def clean_labels(results):
for result in results:
label = "Non-racist" if results["label"] == "LABEL_0" else "Racist"
result["label"] = label
clean_labels(results)
print(results)