Views
No views yet
w11wo/indonesian-roberta-base-sentiment-classifier, specialized for Indonesian financial news sentiment classification since i cant find any financial sentiment models for indonesian market, i decided to make my self.| Field | Value |
|---|---|
| Model Name | ihsan31415/indo-roBERTa-financial-sentiment |
| Base Model | w11wo/indonesian-roberta-base-sentiment-classifier |
| Language | Indonesian (id) |
| Task | Sentiment Analysis (Financial) |
| Labels | 0: Positive, 1: Neutral, 2: Negative (⚠️ flipped label order) |
| Dataset | intanm/indonesian-financial-sentiment-analysis + synthetic and augmented samples |
| Fine-tuned by | ihsan31415 |
| Training Epochs | 5 (Early stopping at epoch 5, best at epoch 3) |
| Eval Accuracy | 97.49% |
0 → Positive1 → Neutral2 → Negative⚠️ Always interpret model output using this mapping:
0: Positive1: Neutral2: Negative
intanm/indonesian-financial-sentiment-analysisgemini-2.0-flash-liteindonesian-nlp/gpt2-medium-indonesian2 (Negative): 22906
1 (Neutral): 23374
0 (Positive): 234232 (Negative): 9817
1 (Neutral): 10018
0 (Positive): 10039The base model uses non-standard labels:
0: Positive1: Neutral2: NegativeTraining data was relabeled accordingly.
1TrainingArguments(
2 output_dir="./results-roberta",
3 eval_strategy="epoch",
4 save_strategy="epoch",
5 logging_strategy="epoch",
6 per_device_train_batch_size=256,
7 per_device_eval_batch_size=256,
8 num_train_epochs=15,
9 learning_rate=2e-5,
10 weight_decay=0.01,
11 load_best_model_at_end=True,
12 metric_for_best_model="accuracy",
13 save_total_limit=4,
14)patience=2)| Epoch | Training Loss | Validation Loss | Accuracy | Precision | Recall | F1 Score |
|---|---|---|---|---|---|---|
| 1 | 0.104500 | 0.085562 | 0.969402 | 0.969715 | 0.969402 | 0.969356 |
| 2 | 0.029100 | 0.088392 | 0.974859 | 0.974914 | 0.974859 | 0.974860 |
| 3 | 0.012700 | 0.102305 | 0.974926 | 0.974949 | 0.974926 | 0.974933 |
| 4 | 0.008900 | 0.125707 | 0.972816 | 0.972959 | 0.972816 | 0.972846 |
| 5 | 0.004400 | 0.157659 | 0.966690 | 0.966902 | 0.966690 | 0.966676 |
1eval_loss = 0.10230540484189987
2eval_accuracy = 0.9749255130394028
3eval_precision = 0.9749490510899772
4eval_recall = 0.9749255130394028
5eval_f1 = 0.9749326327197978
6eval_runtime = 71.9098
7eval_samples_per_second = 415.395
8eval_steps_per_second = 1.627
9epoch = 5.01from transformers import pipeline
2
3pretrained_name = "ihsan31415/indo-roBERTa-financial-sentiment"
4
5nlp = pipeline(
6 "sentiment-analysis",
7 model=pretrained_name,
8 tokenizer=pretrained_name
9)
10
11nlp("IHSG diprediksi melemah karena sentimen global negatif")1from transformers import AutoTokenizer, AutoModelForSequenceClassification
2import torch
3
4# Load model and tokenizer
5model = AutoModelForSequenceClassification.from_pretrained("ihsan31415/indo-roBERTa-financial-sentiment")
6tokenizer = AutoTokenizer.from_pretrained("ihsan31415/indo-roBERTa-financial-sentiment")
7
8# Example input
9text = "IHSG diprediksi melemah karena sentimen global negatif"
10inputs = tokenizer(text, return_tensors="pt", truncation=True, padding=True)
11outputs = model(**inputs)
12
13# Get predicted class
14predicted_label = torch.argmax(outputs.logits, dim=1).item()
15
16# Interpret using flipped label mapping
17label_map = {
18 0: "Positive",
19 1: "Neutral",
20 2: "Negative"
21}
22print(f"Predicted sentiment: {label_map[predicted_label]}")1@misc{khoirul_ihsan_2025,
2 title = {IndoRoBERTa for Indonesian Financial Sentiment Classification},
3 author = {Khoirul Ihsan},
4 howpublished = {\url{https://huggingface.co/ihsan31415/indo-roBERTa-financial-sentiment}},
5 year = {2025},
6 note = {Fine-tuned from w11wo/indonesian-roberta-base-sentiment-classifier using augmented financial news data from intanm/indonesian-financial-sentiment-analysis and various synthetic generation methods (Gemini, GPT-2, Roberta masking).},
7 publisher = {Hugging Face}
8}