racism / README.md
davidmasip's picture
improve readme
a8ede26
|
raw
history blame
651 Bytes
---
license: cc
language: es
---
Model to predict whether a given text is racist or not. Usage:
```python
from transformers import pipeline
RACISM_MODEL = "davidmasip/racism"
racism_analysis_pipe = pipeline("text-classification",
model=RACISM_MODEL, tokenizer=RACISM_MODEL)
results = racism_analysis_pipe("Nos vienen a robar el trabajo")
def clean_labels(results):
for result in results:
if result["label"] == "LABEL_0":
label = "Non-racist"
else:
label = "Racist"
result["label"] = label
clean_labels(results)
print(results)
```