Instructions to use mfaruqi/indonesian-medical-ner with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mfaruqi/indonesian-medical-ner with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="mfaruqi/indonesian-medical-ner")# Load model directly from transformers import AutoTokenizer, AutoModelForTokenClassification tokenizer = AutoTokenizer.from_pretrained("mfaruqi/indonesian-medical-ner") model = AutoModelForTokenClassification.from_pretrained("mfaruqi/indonesian-medical-ner", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Indonesian Medical NER
Indonesian Medical NER is a fine-tuned IndoBERT model for Named Entity Recognition (NER) on Indonesian medical complaint text. The model is designed to identify medical-related entities from patient complaints written in Indonesian.
Detected entity categories include:
- GEJALA (Symptoms)
- PENYAKIT (Diseases)
- OBAT (Medications)
- LOKASI (Body locations)
- TINDAKAN (Medical actions)
Model Details
Model Description
This model was fine-tuned using indobenchmark/indobert-base-p1 on a custom Indonesian medical NER dataset collected from online health consultation text. The dataset was built through web scraping and semi-automatic annotation using Large Language Models (LLM), followed by manual correction and validation.
The model uses BIO tagging format and is trained for token classification tasks.
- Developed by: Muhammad Faruqi
- Model type: IndoBERT Token Classification
- Language: Indonesian
- License: Apache-2.0
- Finetuned from model: indobenchmark/indobert-base-p1
Intended Use
This model can be used for:
- Medical entity extraction
- Indonesian healthcare NLP research
- Clinical text preprocessing
- Medical chatbot systems
- Healthcare information extraction
Out-of-Scope Use
This model is not intended for:
- Medical diagnosis
- Clinical decision making
- Emergency healthcare systems
- Replacing professional medical consultation
Predictions generated by this model may contain errors and should not be considered medical advice.
Training Details
Training Data
The training dataset consists of Indonesian patient complaint text collected from online healthcare consultation platforms. The data was annotated using BIO tagging format with the following labels:
| Entity | Description |
|---|---|
| GEJALA | Symptom entities |
| PENYAKIT | Disease entities |
| OBAT | Medication entities |
| LOKASI | Anatomical/body location entities |
| TINDAKAN | Medical action/treatment entities |
Training Procedure
The model was fine-tuned using weighted cross entropy loss to improve recognition performance on minority entity classes such as LOKASI and TINDAKAN.
Training Hyperparameters
| Parameter | Value |
|---|---|
| Learning Rate | 3e-5 |
| Batch Size | 8 |
| Epochs | 10 |
| Weight Decay | 0.01 |
| Warmup Ratio | 0.1 |
| LR Scheduler | Cosine |
| Dropout | 0.2 |
| Evaluation Strategy | Steps |
| Save Steps | 100 |
| Loss Function | Weighted CrossEntropyLoss |
Evaluation
Metrics
Evaluation was performed using:
- Precision
- Recall
- F1-score
Results
| Metric | Score |
|---|---|
| Precision | 0.6278 |
| Recall | 0.7240 |
| F1-score | 0.6725 |
Classification Report
| Entity | Precision | Recall | F1-score |
|---|---|---|---|
| GEJALA | 0.6464 | 0.7492 | 0.6941 |
| LOKASI | 0.3636 | 0.5143 | 0.4260 |
| OBAT | 0.6761 | 0.7273 | 0.7007 |
| PENYAKIT | 0.7473 | 0.7640 | 0.7556 |
| TINDAKAN | 0.5373 | 0.7059 | 0.6102 |
Usage
from transformers import pipeline
pipe = pipeline(
"token-classification",
model="mfaruqi/indonesian-medical-ner",
aggregation_strategy="simple"
)
text = "Saya mengalami nyeri perut dan sudah minum paracetamol."
result = pipe(text)
print(result)
Example Output
[
{
'entity_group': 'GEJALA',
'word': 'nyeri perut'
},
{
'entity_group': 'OBAT',
'word': 'paracetamol'
}
]
Limitations
- Performance on rare entities is still limited.
- Informal or highly ambiguous sentences may reduce prediction quality.
- Multi-token location entities are harder to detect consistently.
- The model was trained on Indonesian healthcare complaint text and may not generalize well outside the medical domain.
Citation
@misc{faruqi2026indonesianmedicalner,
author = {Muhammad Faruqi},
title = {Indonesian Medical NER},
year = {2026},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/mfaruqi/indonesian-medical-ner}}
}
Contact
For research or collaboration purposes:
- Hugging Face: https://huggingface.co/mfaruqi
- GitHub: https://github.com/mfaruqi35
- Downloads last month
- 67
Model tree for mfaruqi/indonesian-medical-ner
Base model
indobenchmark/indobert-base-p1