加载中…
加载中…
This model is fine-tuned from indobenchmark/indobert-base-p1 for binary sentiment classification (Positive/Negative) on Indonesian text.
This model is intended for binary sentiment classification tasks in Indonesian language texts. It predicts whether a given text expresses positive or negative sentiment.
The model is not designed to classify neutral sentiments or handle languages other than Indonesian.
Users should validate predictions on a case-by-case basis for high-stakes applications.
from transformers import BertTokenizer, BertForSequenceClassification
# Load the tokenizer and model
tokenizer = BertTokenizer.from_pretrained("agufsamudra/indo-sentiment-analysis")
model = BertForSequenceClassification.from_pretrained("agufsamudra/indo-sentiment-analysis")
# Example usage
text = "Saya sangat puas dengan pelayanan ini!"
inputs = tokenizer(text, return_tensors="pt", padding="max_length", truncation=True, max_length=128)
outputs = model(**inputs)
logits = outputs.logits
prediction = logits.argmax(-1).item()
label = "Positive" if prediction == 1 else "Negative"
print(f"Sentiment: {label}")
The model was trained on a dataset of Indonesian text reviews from Play Store applications. The dataset was labeled for binary sentiment analysis (Positive and Negative). It contains an equal distribution of positive and negative examples to ensure balanced learning.
The model was evaluated on a separate test dataset of 20,000 samples (10,000 Positive, 10,000 Negative).
The model's performance was evaluated using standard metrics, including accuracy, precision, recall, and F1-score.
| Metric | Training Set | Testing Set |
|---|---|---|
| Accuracy | 95.28% | 95.56% |
| Precision | 96% | 96% |
| Recall | 96% | 96% |
| F1-Score | 96% | 96% |
The model is based on IndoBERT, a pre-trained transformer model tailored for Indonesian text. It was fine-tuned for binary classification tasks.