Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,58 @@
|
|
1 |
-
---
|
2 |
-
license: cc-by-sa-4.0
|
3 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: cc-by-sa-4.0
|
3 |
+
---
|
4 |
+
# IndoBERTweet-IdentityAttack
|
5 |
+
|
6 |
+
## Model Description
|
7 |
+
IndoBERTweet fine-tuned on IndoToxic2024 dataset, with an accuracy of 0.89 and macro-F1 of 0.78. Performances are obtained through stratified 10-fold cross-validation.
|
8 |
+
|
9 |
+
## Supported Tokenizer
|
10 |
+
- **indolem/indobertweet-base-uncased**
|
11 |
+
|
12 |
+
## Example Code
|
13 |
+
```python
|
14 |
+
import torch
|
15 |
+
from transformers import AutoModelForSequenceClassification, AutoTokenizer
|
16 |
+
# Specify the model and tokenizer name
|
17 |
+
model_name = "Exqrch/IndoBERTweet-IdentityAttack"
|
18 |
+
tokenizer_name = "indolem/indobertweet-base-uncased"
|
19 |
+
# Load the pre-trained model
|
20 |
+
model = AutoModelForSequenceClassification.from_pretrained(model_name)
|
21 |
+
# Load the tokenizer
|
22 |
+
tokenizer = AutoTokenizer.from_pretrained(tokenizer_name)
|
23 |
+
text = "selamat pagi semua!"
|
24 |
+
output = model(**tokenizer(text, return_tensors="pt"))
|
25 |
+
logits = output.logits
|
26 |
+
# Get the predicted class label
|
27 |
+
predicted_class = torch.argmax(logits, dim=-1).item()
|
28 |
+
print(predicted_class)
|
29 |
+
--- Output ---
|
30 |
+
> 0
|
31 |
+
--- End of Output ---
|
32 |
+
```
|
33 |
+
|
34 |
+
## Limitations
|
35 |
+
Trained only on Indonesian texts. No information on code-switched text performance.
|
36 |
+
|
37 |
+
## Sample Output
|
38 |
+
```
|
39 |
+
Model name: Exqrch/IndoBERTweet-IdentityAttack
|
40 |
+
Text 1: ayolah, jaga kebersihan bersama
|
41 |
+
Prediction: 0
|
42 |
+
Text 2: dia itu loh, udah hitam, dengkil lagi
|
43 |
+
Prediction: 1
|
44 |
+
```
|
45 |
+
|
46 |
+
## Citation
|
47 |
+
If used, please cite:
|
48 |
+
```
|
49 |
+
@article{susanto2024indotoxic2024,
|
50 |
+
title={IndoToxic2024: A Demographically-Enriched Dataset of Hate Speech and Toxicity Types for Indonesian Language},
|
51 |
+
author={Lucky Susanto and Musa Izzanardi Wijanarko and Prasetia Anugrah Pratama and Traci Hong and Ika Idris and Alham Fikri Aji and Derry Wijaya},
|
52 |
+
year={2024},
|
53 |
+
eprint={2406.19349},
|
54 |
+
archivePrefix={arXiv},
|
55 |
+
primaryClass={cs.CL},
|
56 |
+
url={https://arxiv.org/abs/2406.19349},
|
57 |
+
}
|
58 |
+
```
|