File size: 1,621 Bytes
bc8a93a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
553b9a1
 
 
 
 
 
357f08b
553b9a1
353419c
553b9a1
 
 
3dbd202
553b9a1
3dbd202
 
 
 
553b9a1
3dbd202
 
 
553b9a1
 
 
 
 
 
 
 
 
d3113f7
 
 
 
 
 
 
357f08b
 
d3113f7
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
---
license: cc-by-nc-sa-4.0
datasets:
- franciellevargas/HateBR
language:
- pt
metrics:
- accuracy
- f1
- recall
- roc_auc
base_model:
- neuralmind/bert-base-portuguese-cased
tags:
- hate_speech
- algorithmic_bias
---


<!-- This model card has been generated automatically according to the information the Trainer had access to. You
should probably proofread and complete it, then remove this comment. -->

# bertimbau-hate-detector

This model is a fine-tuned version of [neuralmind/bert-base-portuguese-cased](https://huggingface.co/neuralmind/bert-base-portuguese-cased).

## Model description

This model is able to detect hate speech in Brazilian Portugues. The following metrics were achieved in validation set:

- accuracy 90%
- f1 91%
- auc 96%
- recall 92%

## Intended uses & limitations
  
The experiments conduced for assessment of racial bias shows that this model can perpetuate racial bias based on brazilian portuguese dialect called "pretuguês".

### Training hyperparameters

The following hyperparameters were used during training:
- learning_rate: 2e-4
- train_batch_size: 16
- eval_batch_size: 16
- optimizer: Adam
- num_epochs: 20

## Usage

```python
from transformers import AutoTokenizer  # Or BertTokenizer
from transformers import AutoModelForPreTraining  # Or BertForPreTraining for loading pretraining heads
from transformers import AutoModel  # or BertModel, for BERT without pretraining heads
model = AutoModelForPreTraining.from_pretrained('cassiasilvaR/bertimbau-hate-detector')
tokenizer = AutoTokenizer.from_pretrained('cassiasilvaR/bertimbau-hate-detector', do_lower_case=False)
```