Downloads · 30 days
357
20% of all-time downloads
apriandito/indobert-relevancy-classifier
indobert-relevancy-classifier is a text classification model from apriandito. Use it when you need a label for a piece of text. The card lists the license as apache-2.0.
Context-conditioned relevancy classifier for Indonesian text. Given a context (topic) and a text (news headline or social media post), predicts whether the text is relevant to the context.
Downloads · 30 days
357
20% of all-time downloads
All-time downloads
1.8K
Public
Parameters
335M
1.3 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors1.3 GB · 100%
From the Hugging Face model README
Context-conditioned relevancy classifier for Indonesian text. Given a context (topic) and a text (news headline or social media post), predicts whether the text is relevant to the context.
[CLS] context [SEP] text [SEP]| Metric | Score |
|---|---|
| Accuracy | 96.5% |
| F1 | 0.948 |
| Precision | 94.8% |
| Recall | 94.8% |
31,360 samples from 3 sources:
188 unique contexts covering economics, politics, health, technology, sports, entertainment, and more.
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
model_name = "apriandito/indobert-relevancy-classifier"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)
model.eval()
context = "Kebijakan moneter Bank Indonesia"
text = "BI tahan suku bunga acuan 6 persen"
inputs = tokenizer(context, text, return_tensors="pt", truncation=True, max_length=256)
with torch.no_grad():
outputs = model(**inputs)
probs = torch.nn.functional.softmax(outputs.logits, dim=-1)
score = probs[0][1].item() # relevancy score
print(f"Relevancy score: {score:.3f}")
print(f"Relevant: {score > 0.5}")
| Label | ID |
|---|---|
| NOT_RELEVANT | 0 |
| RELEVANT | 1 |
If you use this model in your research, please cite:
@article{saputra2026indobert,
title={IndoBERT-Relevancy: A Context-Conditioned Relevancy Classifier for Indonesian Text},
author={Saputra, Muhammad Apriandito Arya},
year={2026},
doi={10.5281/zenodo.19237938},
url={https://zenodo.org/records/19237938}
}