davidmasip commited on
Commit
a8ede26
1 Parent(s): c7894d3

improve readme

Browse files
Files changed (1) hide show
  1. README.md +27 -0
README.md CHANGED
@@ -1,3 +1,30 @@
1
  ---
2
  license: cc
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: cc
3
+ language: es
4
  ---
5
+
6
+
7
+ Model to predict whether a given text is racist or not. Usage:
8
+
9
+ ```python
10
+ from transformers import pipeline
11
+
12
+ RACISM_MODEL = "davidmasip/racism"
13
+ racism_analysis_pipe = pipeline("text-classification",
14
+ model=RACISM_MODEL, tokenizer=RACISM_MODEL)
15
+
16
+ results = racism_analysis_pipe("Nos vienen a robar el trabajo")
17
+
18
+
19
+ def clean_labels(results):
20
+ for result in results:
21
+ if result["label"] == "LABEL_0":
22
+ label = "Non-racist"
23
+ else:
24
+ label = "Racist"
25
+ result["label"] = label
26
+
27
+
28
+ clean_labels(results)
29
+ print(results)
30
+ ```