Update README.md
Browse files
README.md
CHANGED
@@ -25,8 +25,20 @@ A value between 0 and 1 is predicted for each signal.
|
|
25 |
The model can be used directly with a text-classification pipeline:
|
26 |
|
27 |
```python
|
28 |
-
|
|
|
|
|
|
|
29 |
|
30 |
-
|
31 |
-
|
32 |
-
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
The model can be used directly with a text-classification pipeline:
|
26 |
|
27 |
```python
|
28 |
+
>>> from transformers import pipeline
|
29 |
+
>>> text = "Es usted un auténtico impresentable, su señoría."
|
30 |
+
>>> pipe = pipeline("text-classification", model="Newtral/xlm-r-finetuned-toxic-political-tweets-es")
|
31 |
+
>>> pipe(text, return_all_scores=True)
|
32 |
|
33 |
+
[[{'label': 'toxic', 'score': 0.92560875415802},
|
34 |
+
{'label': 'very toxic', 'score': 0.8310967683792114}]]
|
35 |
+
```
|
36 |
+
|
37 |
+
### Training procedure
|
38 |
+
The pre-trained model was fine-tuned for sequence classification using the following hyperparameters, which were selected from a validation set:
|
39 |
+
|
40 |
+
* Batch size = 32
|
41 |
+
* Learning rate = 2e-5
|
42 |
+
* Epochs = 5
|
43 |
+
|
44 |
+
The optimizer used was AdamW and the loss optimized was binary cross-entropy with class weights proportional to the class imbalance.
|