π©Ί IndoBERT for Intent Classification on JKN-KIS Data
This model is a fine-tuned version of indobenchmark/indobert-base-p1
, adapted for intent classification on question data related to the Jaminan Kesehatan Nasional β Kartu Indonesia Sehat (JKN-KIS) program.
The model is trained to recognize user intent from common questions asked in the context of BPJS Kesehatan services, such as registration, benefits, payment, eligibility, and more.
π How to Use
Make sure to load your model and tokenizer, and also the label encoder (le
) if you're using LabelEncoder
from sklearn
.
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
import joblib # only needed if you use sklearn LabelEncoder
# Load model and tokenizer
model_name = "vinapatri/intent-classification-jkn-kis"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)
# Load the label encoder used during training
le = joblib.load("label_encoder.pkl")
def predict_intent(text):
inputs = tokenizer(text, return_tensors="pt", padding=True, truncation=True)
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model.to(device)
inputs = {k: v.to(device) for k, v in inputs.items()}
with torch.no_grad():
outputs = model(**inputs)
logits = outputs.logits
predicted_class_id = logits.argmax().item()
tag = le.inverse_transform([predicted_class_id])[0]
return tag
# Example
text = "Apa tata cara memperoleh surat keterangan tidak mampu untuk BPJS?"
predicted_intent = predict_intent(text)
print(f"Intent: {predicted_intent}")
- Downloads last month
- 12
Model tree for vinapatri/intent-classification-jkn-kis
Base model
indobenchmark/indobert-base-p1