Text Classification
Transformers
Safetensors
Indonesian
bert
indobert
intent-classification
jkn-kis
bpjs
bahasa-indonesia
healthcare
nlp
text-embeddings-inference
Instructions to use vinapatri/intent-classification-jkn-kis with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use vinapatri/intent-classification-jkn-kis with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="vinapatri/intent-classification-jkn-kis")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("vinapatri/intent-classification-jkn-kis") model = AutoModelForSequenceClassification.from_pretrained("vinapatri/intent-classification-jkn-kis") - Notebooks
- Google Colab
- Kaggle
metadata
license: apache-2.0
base_model:
- indobenchmark/indobert-base-p1
pipeline_tag: text-classification
tags:
- indobert
- intent-classification
- jkn-kis
- bpjs
- bahasa-indonesia
- healthcare
- nlp
language:
- id
library_name: transformers
model_type: bert
🩺 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}")