Update README.md
Browse filesAdded how to use model with pipelines
README.md
CHANGED
@@ -97,3 +97,28 @@ Epoch Training Loss Validation Loss Accuracy F1 Precision Recall
|
|
97 |
- Transformers 4.17.0
|
98 |
- Pytorch 1.10.0+cu111
|
99 |
- Tokenizers 0.11.6
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
97 |
- Transformers 4.17.0
|
98 |
- Pytorch 1.10.0+cu111
|
99 |
- Tokenizers 0.11.6
|
100 |
+
|
101 |
+
|
102 |
+
## Model in Action
|
103 |
+
Fast usage with pipelines:
|
104 |
+
|
105 |
+
###libraries required
|
106 |
+
!pip install transformers
|
107 |
+
from transformers import pipeline
|
108 |
+
|
109 |
+
### usage pipelines
|
110 |
+
model_checkpoint = "hackathon-pln-es/twitter_sexismo-finetuned-exist2021-metwo"
|
111 |
+
pipeline_nlp = pipeline("text-classification", model=model_checkpoint)
|
112 |
+
pipeline_nlp("mujer al volante peligro!")
|
113 |
+
#pipeline_nlp("¡me encanta el ipad!")
|
114 |
+
#pipeline_nlp (["mujer al volante peligro!", "Los hombre tienen más manias que las mujeres", "me encanta el ipad!"] )
|
115 |
+
|
116 |
+
# OUTPUT MODEL
|
117 |
+
# LABEL_0: "NON SEXISM", LABEL_1: "SEXISM" score: probability of accuracy per model
|
118 |
+
|
119 |
+
# [{'label': 'LABEL_1', 'score': 0.9967633485794067}]
|
120 |
+
# [{'label': 'LABEL_0', 'score': 0.9934417009353638}]
|
121 |
+
|
122 |
+
#[{‘label': 'LABEL_1', 'score': 0.9967633485794067},
|
123 |
+
# {'label': 'LABEL_1', 'score': 0.9755664467811584},
|
124 |
+
# {'label': 'LABEL_0', 'score': 0.9955045580863953}]
|