File size: 2,053 Bytes
bf69aa8
 
45d0828
ddefe43
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
45d0828
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
---
license: mit

language: es
tags:
- "spanish"
metrics:
- ROC-AUC
widget:
 - text: "Sos pero bien imbécil!"
 - text: "Tirate de un puente!"
 - text: "sapo, gonorrea de mierda"
 - text: "Esta perrita me las va pagar"
---

# colombian-spanish-cyberbullying-classifier

This model is a fine-tuned version of [PlanTL-GOB-ES/roberta-base-bne](https://huggingface.co/PlanTL-GOB-ES/roberta-base-bne) on a dataset created by manually gathering posts from the social network Twitter to detect cyberbullying in Spanish.


## Training and evaluation data

The dataset used was a small one, consisting of 3570 tweets, which were manually labeled as cyberbullying or not cyberbullying. The distribution of tweets and of cyberbullying and non-cyberbullying was the same.

## Training procedure

<details>

### Training hyperparameters

The following hyperparameters were used during training:
- learning_rate: 2e-05
- train_batch_size: 8
- eval_batch_size: 8
- seed: 42
- weight_decay=0.01
- warmup_steps=500
- num_epochs: 2


### Training results

| Training Loss | Epoch | ROC-AUC | Validation Loss |
|:-------------:|:-----:|:-------:|:---------------:|
| ---           | 1.0   | 0.8756  | 0.4375          |
| 0.4945        | 2.0   | 0.9022  | 0.5060          |

</details>

### Model in action 🚀

Fast usage with **pipelines**:

```python
!pip install -q transformers
from transformers import pipeline

model_path = "FelipeGuerra/colombian-spanish-cyberbullying-classifier"
bullying_analysis = pipeline("text-classification", model=model_path, tokenizer=model_path)

bullying_analysis(
    "Como dice mi mamá: va caer palo de agua"
    )

# Output:
[{'label': 'Not_bullying', 'score': 0.977687656879425}]

bullying_analysis(
    "Esta perrita me las va pagar"
    )
# Output:
[{'label': 'Bullying', 'score': 0.9404164552688599}] 
    
```


### Framework versions

- Transformers 4.34.0
- Pytorch 2.0.1+cu118
- Pandas 1.5.3
- scikit-learn 1.2.2

> Created by Felipe Guerra Sáenz| [LinkedIn](https://www.linkedin.com/in/felipe-guerra-s%C3%A1enz-58207126a/)