w11wo commited on
Commit
5e44b2e
1 Parent(s): 137cebe

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +81 -0
README.md ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language: su
3
+ tags:
4
+ - sundanese-roberta-base-emotion-classifier
5
+ license: mit
6
+ widget:
7
+ - text: "Wah, éta gélo, keren pisan!"
8
+ ---
9
+
10
+ ## Sundanese RoBERTa Base Emotion Classifier
11
+
12
+ Sundanese RoBERTa Base Emotion Classifier is an emotion-text-classification model based on the [RoBERTa](https://arxiv.org/abs/1907.11692) model. The model was originally the pre-trained [Sundanese RoBERTa Base](https://hf.co/w11wo/sundanese-roberta-base) model, which is then fine-tuned on the [Sundanese Twitter dataset](https://github.com/virgantara/sundanese-twitter-dataset), consisting of Sundanese tweets.
13
+
14
+ 10% of the dataset is kept for evaluation purposes. After training, the model achieved an evaluation accuracy of 98.41% and F1-macro of 98.43%.
15
+
16
+ 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.
17
+
18
+ ## Model
19
+
20
+ | Model | #params | Arch. | Training/Validation data (text) |
21
+ | ------------------------------------------- | ------- | ------------ | ------------------------------- |
22
+ | `sundanese-roberta-base-emotion-classifier` | 124M | RoBERTa Base | Sundanese Twitter dataset |
23
+
24
+ ## Evaluation Results
25
+
26
+ The model was trained for 10 epochs and the best model was loaded at the end.
27
+
28
+ | Epoch | Training Loss | Validation Loss | Accuracy | F1 | Precision | Recall |
29
+ | ----- | ------------- | --------------- | -------- | -------- | --------- | -------- |
30
+ | 1 | 0.801800 | 0.293695 | 0.900794 | 0.899048 | 0.903466 | 0.900406 |
31
+ | 2 | 0.208700 | 0.185291 | 0.936508 | 0.935520 | 0.939460 | 0.935540 |
32
+ | 3 | 0.089700 | 0.150287 | 0.956349 | 0.956569 | 0.956500 | 0.958612 |
33
+ | 4 | 0.025600 | 0.130889 | 0.972222 | 0.972865 | 0.973029 | 0.973184 |
34
+ | 5 | 0.002200 | 0.100031 | 0.980159 | 0.980430 | 0.980430 | 0.980430 |
35
+ | 6 | 0.001300 | 0.104971 | 0.980159 | 0.980430 | 0.980430 | 0.980430 |
36
+ | 7 | 0.000600 | 0.107744 | 0.980159 | 0.980174 | 0.980814 | 0.979743 |
37
+ | 8 | 0.000500 | 0.102327 | 0.980159 | 0.980171 | 0.979970 | 0.980430 |
38
+ | 9 | 0.000500 | 0.101935 | 0.984127 | 0.984376 | 0.984073 | 0.984741 |
39
+ | 10 | 0.000400 | 0.105965 | 0.984127 | 0.984142 | 0.983720 | 0.984741 |
40
+
41
+ ## How to Use
42
+
43
+ ### As Text Classifier
44
+
45
+ ```python
46
+ from transformers import pipeline
47
+
48
+ pretrained_name = "sundanese-roberta-base-emotion-classifier"
49
+
50
+ nlp = pipeline(
51
+ "sentiment-analysis",
52
+ model=pretrained_name,
53
+ tokenizer=pretrained_name
54
+ )
55
+
56
+ nlp("Wah, éta gélo, keren pisan!")
57
+ ```
58
+
59
+ ## Disclaimer
60
+
61
+ Do consider the biases which come from both the pre-trained RoBERTa model and the Sundanese Twitter dataset that may be carried over into the results of this model.
62
+
63
+ ## Author
64
+
65
+ Sundanese RoBERTa Base Emotion Classifier 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.
66
+
67
+ ## Credits
68
+
69
+ ```
70
+ @inproceedings{Putr2011:Sundanese,
71
+ title = {Sundanese Twitter Dataset for Emotion Classification},
72
+ author = {Oddy Virgantara Putra and Fathin Muhammad Wasmanson and Triana Harmini and Shoffin Nahwa Utama},
73
+ year = 2020,
74
+ month = nov,
75
+ booktitle = {2020 International Conference on Computer Engineering, Network, and Intelligent Multimedia (CENIM) (CENIM 2020)},
76
+ address = virtual,
77
+ days = 16,
78
+ keywords = {emotion classification; sundanese; machine learning},
79
+ abstract = {Sundanese is the second-largest tribe in Indonesia which possesses many dialects. This condition has gained attention for many researchers to analyze emotion especially on social media. However, with barely available Sundanese dataset, this condition makes understanding sundanese emotion is a challenging task. In this research, we proposed a dataset for emotion classification of Sundanese text. The preprocessing includes case folding, stopwords removal, stemming, tokenizing, and text representation. Prior to classification, for the feature generation, we utilize term frequency-inverse document frequency (TFIDF). We evaluated our dataset using k-Fold Cross Validation. Our experiments with the proposed method exhibit an effective result for machine learning classification. Furthermore, as far as we know, this is the first Sundanese emotion dataset available for public.}
80
+ }
81
+ ```