This model takes an Indonesian news article and predicts which of eight newsroom categories it belongs to:
| Label | Meaning |
|---|---|
nasional |
Domestic news: politics, government, law, crime, disasters, public affairs |
ekonomi |
Economy, business, finance, markets, companies, prices |
olahraga |
Sport |
teknologi |
Technology, gadgets, the internet, apps |
hiburan |
Entertainment: celebrities, film, music, TV |
internasional |
World news outside Indonesia |
gaya-hidup |
Lifestyle: health, food, travel, fashion, relationships |
otomotif |
Cars, motorcycles, the automotive industry |
It is indobenchmark/indobert-base-p1 (124M parameters),
fine-tuned for sequence classification.
The model was trained on the headline followed by the opening of the article, up to 2,000 characters and truncated to 256 tokens. Give it the same kind of input. A headline on its own is noticeably less accurate (see Limitations).
from transformers import pipeline
clf = pipeline("text-classification", model="tvalentius/indobert-news-category", truncation=True, max_length=256)
title = "Rupiah melemah terhadap dolar AS, IHSG ditutup turun"
body = "Nilai tukar rupiah terhadap dolar Amerika Serikat melemah pada perdagangan Selasa sore ..."
print(clf(f"{title}\n\n{body[:2000]}"))
# [{'label': 'ekonomi', 'score': 0.8...}]
| Hyperparameter | Value |
|---|---|
| Learning rate | 3e-5 |
| Effective batch size | 16 (8 × 2 gradient accumulation) |
| Epochs | Up to 5, with early stopping (patience 2) on validation macro F1. The best checkpoint was kept; training stopped after 4 epochs. |
| Warmup | 10% |
| Weight decay | 0.01 |
| Max sequence length | 256 |
| Hardware | Apple Silicon (MPS) |
| Training time | ~5 minutes |
| Test set | n | Accuracy | Macro F1 |
|---|---|---|---|
| Held-out split, same period as training | 312 | 0.862 | 0.859 |
| Later articles, published after the training data was collected | 1,373 | 0.825 | 0.826 |
The second set gives the more realistic figure, because news topics move on and accuracy drops on articles published after training.
Per-category F1:
| Category | Held-out split | Later articles |
|---|---|---|
| nasional | 0.863 | 0.826 |
| ekonomi | 0.833 | 0.800 |
| olahraga | 0.932 | 0.948 |
| teknologi | 0.918 | 0.816 |
| hiburan | 0.853 | 0.850 |
| internasional | 0.778 | 0.667 |
| gaya-hidup | 0.854 | 0.778 |
| otomotif | 0.837 | 0.926 |
Comparisons on the later articles:
Speed. About 16 ms per article on an Apple M-series GPU, against about 900 ms for the LLM.
Headlines alone are weaker. When only a short summary was available instead of the article text, held-out accuracy fell from 0.87 to 0.75.
Label noise. Publisher categories overlap:
ekonomi or otomotif;gaya-hidup or nasional;nasional or internasional.The model learns each publisher's habits, not a clean taxonomy. internasional and gaya-hidup are the weakest
classes.
Coverage. The training data is national, Jakarta-based portals from a single month. Regional outlets, other writing styles, other eras and non-news text (social media posts, opinion blogs) were not tested.
No "other" class. Every input is forced into one of the eight categories. Use the score to flag low-confidence predictions.
Topic drift. Retrain periodically on fresh labelled articles if you depend on it.
The model is released under MIT, the same license as the base model.