Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language: id
|
3 |
+
tags:
|
4 |
+
- indonesian-roberta-base-posp-tagger
|
5 |
+
license: mit
|
6 |
+
datasets:
|
7 |
+
- indonlu
|
8 |
+
widget:
|
9 |
+
- text: "Budi sedang pergi ke pasar."
|
10 |
+
---
|
11 |
+
|
12 |
+
## Indonesian RoBERTa Base POSP Tagger
|
13 |
+
|
14 |
+
Indonesian RoBERTa Base POSP Tagger is a part-of-speech token-classification model based on the [RoBERTa](https://arxiv.org/abs/1907.11692) model. The model was originally the pre-trained [Indonesian RoBERTa Base](https://hf.co/flax-community/indonesian-roberta-base) model, which is then fine-tuned on [`indonlu`](https://hf.co/datasets/indonlu)'s `POSP` dataset consisting of tag-labelled news.
|
15 |
+
|
16 |
+
After training, the model achieved an evaluation F1-macro of 95.34%. On the benchmark test set, the model achieved an accuracy of 93.99% and F1-macro of 88.93%.
|
17 |
+
|
18 |
+
Hugging Face's `Trainer` class from the [Transformers](https://huggingface.co/transformers) library was used to train the model. PyTorch was used as the backend framework during training, but the model remains compatible with other frameworks nonetheless.
|
19 |
+
|
20 |
+
## Model
|
21 |
+
|
22 |
+
| Model | #params | Arch. | Training/Validation data (text) |
|
23 |
+
| ------------------------------------- | ------- | ------------ | ------------------------------- |
|
24 |
+
| `indonesian-roberta-base-posp-tagger` | 124M | RoBERTa Base | `POSP` |
|
25 |
+
|
26 |
+
## Evaluation Results
|
27 |
+
|
28 |
+
The model was trained for 10 epochs and the best model was loaded at the end.
|
29 |
+
|
30 |
+
| Epoch | Training Loss | Validation Loss | Precision | Recall | F1 | Accuracy |
|
31 |
+
| ----- | ------------- | --------------- | --------- | -------- | -------- | -------- |
|
32 |
+
| 1 | 0.898400 | 0.343731 | 0.894324 | 0.894324 | 0.894324 | 0.894324 |
|
33 |
+
| 2 | 0.294700 | 0.236619 | 0.929620 | 0.929620 | 0.929620 | 0.929620 |
|
34 |
+
| 3 | 0.214100 | 0.202723 | 0.938349 | 0.938349 | 0.938349 | 0.938349 |
|
35 |
+
| 4 | 0.171100 | 0.183630 | 0.945264 | 0.945264 | 0.945264 | 0.945264 |
|
36 |
+
| 5 | 0.143300 | 0.169744 | 0.948469 | 0.948469 | 0.948469 | 0.948469 |
|
37 |
+
| 6 | 0.124700 | 0.174946 | 0.947963 | 0.947963 | 0.947963 | 0.947963 |
|
38 |
+
| 7 | 0.109800 | 0.167450 | 0.951590 | 0.951590 | 0.951590 | 0.951590 |
|
39 |
+
| 8 | 0.101300 | 0.163191 | 0.952475 | 0.952475 | 0.952475 | 0.952475 |
|
40 |
+
| 9 | 0.093500 | 0.163255 | 0.953361 | 0.953361 | 0.953361 | 0.953361 |
|
41 |
+
| 10 | 0.089000 | 0.164673 | 0.953445 | 0.953445 | 0.953445 | 0.953445 |
|
42 |
+
|
43 |
+
## How to Use
|
44 |
+
|
45 |
+
### As Token Classifier
|
46 |
+
|
47 |
+
```python
|
48 |
+
from transformers import pipeline
|
49 |
+
|
50 |
+
pretrained_name = "w11wo/indonesian-roberta-base-posp-tagger"
|
51 |
+
|
52 |
+
nlp = pipeline(
|
53 |
+
"token-classification",
|
54 |
+
model=pretrained_name,
|
55 |
+
tokenizer=pretrained_name
|
56 |
+
)
|
57 |
+
|
58 |
+
nlp("Budi sedang pergi ke pasar.")
|
59 |
+
```
|
60 |
+
|
61 |
+
## Disclaimer
|
62 |
+
|
63 |
+
Do consider the biases which come from both the pre-trained RoBERTa model and the `POSP` dataset that may be carried over into the results of this model.
|
64 |
+
|
65 |
+
## Author
|
66 |
+
|
67 |
+
Indonesian RoBERTa Base POSP Tagger was trained and evaluated by [Wilson Wongso](https://w11wo.github.io/). All computation and development are done on Google Colaboratory using their free GPU access.
|