Downloads · 30 days
12
9% of all-time downloads
vinapatri/intent-classification-jkn-kis
intent-classification-jkn-kis is a text classification model from vinapatri. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as apache-2.0.
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.
Downloads · 30 days
12
9% of all-time downloads
All-time downloads
136
Public
Parameters
125M
997 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors498 MB · 100%
From the Hugging Face model README
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.
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}")