hanifnoerr commited on
Commit
71de300
1 Parent(s): 2704cda

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +108 -0
README.md ADDED
@@ -0,0 +1,108 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ tags:
4
+ - generated_from_trainer
5
+ datasets:
6
+ - indonlu
7
+ metrics:
8
+ - accuracy
9
+ - f1
10
+ model-index:
11
+ - name: Fine-tuned-Indonesian-Sentiment-Classifier
12
+ results:
13
+ - task:
14
+ name: Text Classification
15
+ type: text-classification
16
+ dataset:
17
+ name: indonlu
18
+ type: indonlu
19
+ config: smsa
20
+ split: validation
21
+ args: smsa
22
+ metrics:
23
+ - name: Accuracy
24
+ type: accuracy
25
+ value: 0.9317460317460318
26
+ - name: F1
27
+ type: f1
28
+ value: 0.9034223843742829
29
+ language:
30
+ - id
31
+ pipeline_tag: text-classification
32
+
33
+ widget:
34
+ - text: "Kalo kamu WFH emang kerja?"
35
+ - text: "dia tidak cantik"
36
+ ---
37
+
38
+ <!-- This model card has been generated automatically according to the information the Trainer had access to. You
39
+ should probably proofread and complete it, then remove this comment. -->
40
+
41
+ # Fine-tuned-Indonesian-Sentiment-Classifier
42
+
43
+ This model is a fine-tuned version of [indobenchmark/indobert-base-p1](https://huggingface.co/indobenchmark/indobert-base-p1) on the [IndoNLU's SmSA](https://huggingface.co/datasets/indonlp/indonlu) dataset.
44
+ It achieves the following results on the evaluation dataset:
45
+ - Loss: 0.3233
46
+ - Accuracy: 0.9317
47
+ - F1: 0.9034
48
+
49
+ And the results of the test dataset:
50
+ - Accuracy: 0.928
51
+ - F1 macro: 0.9113470780757361
52
+ - F1 micro: 0.928
53
+ - F1 weighted: 0.9261959965604815
54
+
55
+ ## Model description
56
+
57
+ This model can be used to determine the sentiment of a text with three possible outputs [positive, negative, or neutral]
58
+
59
+ ## How to use
60
+
61
+ ```python
62
+ from transformers import AutoTokenizer, AutoModelForSequenceClassification
63
+
64
+ Pre-trained = "hanifnoerr/Fine-tuned-Indonesian-Sentiment-Classifier"
65
+ tokenizer = AutoTokenizer.from_pretrained(Pre-trained)
66
+ model = AutoModelForSequenceClassification.from_pretrained(Pre-trained)
67
+ ```
68
+ ### make classification
69
+ ```python
70
+ pretrained_name = "hanifnoerr/Fine-tuned-Indonesian-Sentiment-Classifier"
71
+ class_model = pipeline(tokenizer=pretrained_name, model=pretrained_name)
72
+
73
+ test_data = "buku ini jelek sekali"
74
+ class_model(test_data)
75
+ ```
76
+ output: [{'label': 'negative', 'score': 0.9996247291564941}]
77
+
78
+ ### Training results
79
+
80
+ | Training Loss | Epoch | Step | Validation Loss | Accuracy | F1 |
81
+ |:-------------:|:-----:|:-----:|:---------------:|:--------:|:------:|
82
+ | 0.08 | 1.0 | 688 | 0.3532 | 0.9310 | 0.9053 |
83
+ | 0.0523 | 2.0 | 1376 | 0.3233 | 0.9317 | 0.9034 |
84
+ | 0.045 | 3.0 | 2064 | 0.3949 | 0.9286 | 0.8995 |
85
+ | 0.0252 | 4.0 | 2752 | 0.4662 | 0.9310 | 0.9049 |
86
+ | 0.0149 | 5.0 | 3440 | 0.6251 | 0.9246 | 0.8899 |
87
+ | 0.0091 | 6.0 | 4128 | 0.6148 | 0.9254 | 0.8928 |
88
+ | 0.0111 | 7.0 | 4816 | 0.6259 | 0.9222 | 0.8902 |
89
+ | 0.0106 | 8.0 | 5504 | 0.6123 | 0.9238 | 0.8882 |
90
+ | 0.0092 | 9.0 | 6192 | 0.6353 | 0.9230 | 0.8928 |
91
+ | 0.0085 | 10.0 | 6880 | 0.6733 | 0.9254 | 0.8989 |
92
+ | 0.0062 | 11.0 | 7568 | 0.6666 | 0.9302 | 0.9027 |
93
+ | 0.0036 | 12.0 | 8256 | 0.7578 | 0.9230 | 0.8962 |
94
+ | 0.0055 | 13.0 | 8944 | 0.7378 | 0.9270 | 0.8947 |
95
+ | 0.0023 | 14.0 | 9632 | 0.7758 | 0.9230 | 0.8978 |
96
+ | 0.0009 | 15.0 | 10320 | 0.7051 | 0.9278 | 0.9006 |
97
+ | 0.0033 | 16.0 | 11008 | 0.7442 | 0.9214 | 0.8902 |
98
+ | 0.0 | 17.0 | 11696 | 0.7513 | 0.9254 | 0.8974 |
99
+ | 0.0 | 18.0 | 12384 | 0.7554 | 0.9270 | 0.8999 |
100
+
101
+ Although trained with 18 epochs, this model uses the best weight (Epoch 2)
102
+
103
+ ### Framework versions
104
+
105
+ - Transformers 4.27.4
106
+ - Pytorch 2.0.0+cu118
107
+ - Datasets 2.11.0
108
+ - Tokenizers 0.13.3