File size: 1,801 Bytes
085a5c8
 
 
8b1c79e
085a5c8
 
 
1d1a5c1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6c3f574
 
 
 
1d1a5c1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
license: mit
datasets:
- nanelimon/insult-dataset
language:
- tr
pipeline_tag: text-classification
---

## About the model
It is a Turkish bert-based model created to determine the types of bullying that people use against each other in social media.
Included classes;

- Nötr
- Kızdırma/Hakaret
- Cinsiyetçilik
- Irkçılık

3388 tweets were used in the training of the model. Accordingly, the success rates in education are as follows;

|        | INSULT | OTHER | PROFANITY | RACIST | SEXIST |
| ------ | ------  | ------ | ------  | ------ | ------ |
| Precision | 0.901 | 0.924 | 0.978 | 1.000 | 0.980 |
| Recall  | 0.920 | 0.980 | 0.900 | 0.980 | 1.000 |
| F1 Score | 0.910 | 0.9514 | 0.937 | 0.989 | 0.990 |

- F-Score:  0.9559690799177005
- Recall:  0.9559999999999998
- Precision:  0.9570284225256961
- Accuracy:  0.956

## Dependency
pip install torch torchvision torchaudio
pip install tf-keras  
pip install transformers  
pip install tensorflow

## Example
```sh
from transformers import AutoTokenizer, TextClassificationPipeline, TFBertForSequenceClassification

tokenizer = AutoTokenizer.from_pretrained("nanelimon/bert-base-turkish-offensive")
model = TFBertForSequenceClassification.from_pretrained("nanelimon/bert-base-turkish-offensive", from_pt=True)
pipe = TextClassificationPipeline(model=model, tokenizer=tokenizer, return_all_scores=True, top_k=2)

print(pipe('Bu bir denemedir hadi sende dene!'))
```
Result;
```sh
[[{'label': 'OTHER', 'score': 1.000}, {'label': 'INSULT', 'score': 0.000}]]
```
- label= It shows which class the sent Turkish text belongs to according to the model.
- score= It shows the compliance rate of the Turkish text sent to the label found.

## Authors
- Seyma SARIGIL: [email protected]

## License

gpl-3.0

**Free Software, Hell Yeah!**