Downloads · 30 days
3
20% of all-time downloads
newreyy/sentiment-analysis-distilbert-IKN
sentiment-analysis-distilbert-IKN is a machine learning model from newreyy. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
Base Model: cahya/distilbert-base-indonesian Fine-tuned on: IKN (Ibu Kota Nusantara) Dataset Task: Sentiment classification (Positive vs Negative) Language: Indonesian Accuracy: 91.78% on test set
Downloads · 30 days
3
20% of all-time downloads
All-time downloads
15
Public
Parameters
68.1M
272 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors272 MB · 100%
From the Hugging Face model README
cahya/distilbert-base-indonesianfrom transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
tokenizer = AutoTokenizer.from_pretrained("newreyy/sentiment-analysis-distilbert-IKN")
model = AutoModelForSequenceClassification.from_pretrained("newreyy/sentiment-analysis-distilbert-IKN")
text = "IKN akan membuka banyak lapangan kerja untuk masyarakat Kalimantan."
inputs = tokenizer(text, return_tensors="pt", truncation=True, padding=True)
with torch.no_grad():
logits = model(**inputs).logits
probs = torch.softmax(logits, dim=1).squeeze()
pred = torch.argmax(probs).item()
label = "Positive" if pred == 1 else "Negative"
confidence = probs[pred].item()
print(f"Sentiment: {label} (Confidence: {confidence:.2%})")
0 → Negative1 → Positive| Metric | Score |
|---|---|
| Accuracy | 91.78% |
| Precision | 92% |
| Recall | 91% |
| F1-Score | 91% |
precision recall f1-score support
Negative 0.91 0.90 0.91 125
Positive 0.92 0.93 0.92 202
Overall accuracy 0.9178
Domain: IKN-related comments from social media
Sources: Twitter, news portals, forums
Positive Sentiment: XX%
Negative Sentiment: XX%
Data Preprocessing:
| Parameter | Value |
|---|---|
| Pretrained Model | DistilBERT Indonesian (by Cahya Wirawan) |
| Epochs | 6 |
| Batch Size | 16 |
| Learning Rate | 2e-5 |
| Optimizer | AdamW |
| Max Length | 512 tokens |
Licensed under MIT — free to use for research and development.
If you use this model, please cite:
@misc{newreyy_ikn_sentiment_distilbert,
title={Indonesian IKN Sentiment DistilBERT},
author={Newreyy},
year={2024},
howpublished={\url{https://huggingface.co/newreyy/sentiment-analysis-distilbert-IKN}}
}
And acknowledge the original DistilBERT model:
@misc{cahya_distilbert_indonesian,
title={DistilBERT Base Indonesian},
author={Cahya Wirawan},
year={2021},
howpublished={\url{https://huggingface.co/cahya/distilbert-base-indonesian}}
}
cahya for the base model.