bgonzalezbustamante commited on
Commit
ace4661
·
verified ·
1 Parent(s): e576a6c

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +22 -1
README.md CHANGED
@@ -25,7 +25,28 @@ The dataset comprises ~5M data points from three Latin American protest events:
25
 
26
  ## Example of Classification
27
 
28
- WIP
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
 
30
  ## Validation Metrics
31
 
 
25
 
26
  ## Example of Classification
27
 
28
+ ```python
29
+ ## Pipeline as a high-level helper
30
+ from transformers import pipeline
31
+ toxic_classifier = pipeline("text-classification", model="bgonzalezbustamante/ft-xlm-roberta-toxicity")
32
+
33
+ ## Non-toxic example
34
+ non_toxic = toxic_classifier("Que tengas un excelente día :)")
35
+
36
+ ## Toxic example
37
+ toxic = toxic_classifier("Eres un maldito infeliz")
38
+
39
+ ## Print examples
40
+ print(non_toxic)
41
+ print(toxic)
42
+ ```
43
+
44
+ Output:
45
+
46
+ ```
47
+ [{'label': 'NONTOXIC', 'score': 0.5529471635818481}]
48
+ [{'label': 'TOXIC', 'score': 0.6219274401664734}]
49
+ ```
50
 
51
  ## Validation Metrics
52