CoolFace
Modelpublic

hanifnoerr/Fine-tuned-Indonesian-Sentiment-Classifier

sourceHugging Facemitupdated 3y agoView on Hugging Face
1likes180downloads
Model Card

<!-- This model card has been generated automatically according to the information the Trainer had access to. You should probably proofread and complete it, then remove this comment. -->

Fine-tuned-Indonesian-Sentiment-Classifier

This model is a fine-tuned version of indobenchmark/indobert-base-p1 on the IndoNLU's SmSA dataset. It achieves the following results on the evaluation dataset:

  • Loss: 0.3233
  • Accuracy: 0.9317
  • F1: 0.9034

And the results of the test dataset:

  • Accuracy: 0.928
  • F1 macro: 0.9113470780757361
  • F1 micro: 0.928
  • F1 weighted: 0.9261959965604815

Model description

This model can be used to determine the sentiment of a text with three possible outputs [positive, negative, or neutral]

How to use

python
from transformers import AutoTokenizer, AutoModelForSequenceClassification

Pre-trained = "hanifnoerr/Fine-tuned-Indonesian-Sentiment-Classifier"
tokenizer = AutoTokenizer.from_pretrained(Pre-trained)
model = AutoModelForSequenceClassification.from_pretrained(Pre-trained)

make classification

python
pretrained_name = "hanifnoerr/Fine-tuned-Indonesian-Sentiment-Classifier"
sentimen = pipeline(tokenizer=pretrained_name, model=pretrained_name)

kalimat = "buku ini jelek sekali"
sentimen(kalimat)

output: [{'label': 'negative', 'score': 0.9996247291564941}]

Training results

Training LossEpochStepValidation LossAccuracyF1
0.081.06880.35320.93100.9053
0.05232.013760.32330.93170.9034
0.0453.020640.39490.92860.8995
0.02524.027520.46620.93100.9049
0.01495.034400.62510.92460.8899
0.00916.041280.61480.92540.8928
0.01117.048160.62590.92220.8902
0.01068.055040.61230.92380.8882
0.00929.061920.63530.92300.8928
0.008510.068800.67330.92540.8989
0.006211.075680.66660.93020.9027
0.003612.082560.75780.92300.8962
0.005513.089440.73780.92700.8947
0.002314.096320.77580.92300.8978
0.000915.0103200.70510.92780.9006
0.003316.0110080.74420.92140.8902
0.017.0116960.75130.92540.8974
0.018.0123840.75540.92700.8999

Although trained with 18 epochs, this model uses the best weight (Epoch 2)

Framework versions

  • Transformers 4.27.4
  • Pytorch 2.0.0+cu118
  • Datasets 2.11.0
  • Tokenizers 0.13.3