Skip to page content
SAVRN
Search Plan a project

Open-weight model · Text classification

medsync-indobert-inacbg

by MUHAMMAD DHIAUDDIN Dragneva/medsync-indobert-inacbg

medsync-indobert-inacbg is an open-weight model for text classification from MUHAMMAD DHIAUDDIN, released under Apache License 2.0. It has 512-token context. Its published files total 500.8 MB.

Model klasifikasi teks klinis multi-task berbasis Medical-IndoBERT (Domain-Adaptive Pretrained) yang disempurnakan melalui Supervised Fine-Tuning (SFT) dengan arsitektur Dual-Head: 1. Head 1 (ICD-10): Klasifikasi Diagnosis Klinis Primer (WHO ICD-10). 2.

Parameters—
Context512
Weights498.1 MB
Licenseapache-2.0
AccessOpen weights
Monthly Downloads—

Model Card

By MUHAMMAD DHIAUDDIN, published under apache-2.0, revision 783045fbf9bb.

Model klasifikasi teks klinis multi-task berbasis Medical-IndoBERT (Domain-Adaptive Pretrained) yang disempurnakan melalui Supervised Fine-Tuning (SFT) dengan arsitektur Dual-Head: 1. Head 1 (ICD-10): Klasifikasi Diagnosis Klinis Primer (WHO ICD-10). 2. Head 2 (INA-CBGs): Prediksi Kelompok Tarif Casemix Klaim (Kemenkes RI / UNU-IIGH Casemix). Senior atau peneliti dapat langsung menguji model ini menggunakan kode berikut: Dataset dan bobot dikembangkan sesuai regulasi perlindungan data medis UU PDP No. 27/2022. Rekam Medis (Nomor Rekam Medis, No. SEP, Nama Pasien) telah dideidentifikasi dan disimpan di repositori privat terpisah.

Read MUHAMMAD DHIAUDDIN's full model card

MedSync AI Studio: Medical-IndoBERT Dual-Head INA-CBGs Sync

Model klasifikasi teks klinis multi-task berbasis Medical-IndoBERT (Domain-Adaptive Pretrained) yang disempurnakan melalui Supervised Fine-Tuning (SFT) dengan arsitektur Dual-Head: 1. Head 1 (ICD-10): Klasifikasi Diagnosis Klinis Primer (WHO ICD-10). 2. Head 2 (INA-CBGs): Prediksi Kelompok Tarif Casemix Klaim (Kemenkes RI / UNU-IIGH Casemix).


Detail Arsitektur & Pelatihan

  • Backbone: indobenchmark/indobert-base-p2 + Domain-Adaptive Pretraining (DAPT) pada korpus medis klinis.
  • Arsitektur: DualHeadModel (Encoder BERT + Dropout 0.2 + 2 Linear Classification Heads).
  • Jumlah Kelas ICD-10: 45 kelas diagnosis.
  • Jumlah Kelas INA-CBGs: 46 kelompok tarif casemix.
  • Studi Kasus: RSUD Datu Sanggul (Kelas C, Regional 4).
  • Kepatuhan Privasi: UU Perlindungan Data Pribadi (UU PDP) No. 27 Tahun 2022.

Cara Penggunaan Singkat (Python / Google Colab / Notebook)

Senior atau peneliti dapat langsung menguji model ini menggunakan kode berikut:

import torch
import torch.nn as nn
from transformers import AutoConfig, AutoTokenizer
from huggingface_hub import hf_hub_download
import json

REPO_ID = "Dragneva/medsync-indobert-inacbg"

# 1. Download Model Weights & Metadata dari Hugging Face Hub
model_path = hf_hub_download(repo_id=REPO_ID, filename="model.pt")
mapping_path = hf_hub_download(repo_id=REPO_ID, filename="label_mappings.json")

with open(mapping_path, "r", encoding="utf-8") as f:
    meta = json.load(f)
id_to_icd10 = {int(k): v for k, v in meta["id_to_icd10"].items()}
id_to_group = {int(k): v for k, v in meta["id_to_group"].items()}
icd10_to_name = meta.get("icd10_to_name", {})
group_to_name = meta.get("group_to_name_id", {})

# 2. Inisialisasi Arsitektur DualHeadModel
class DualHeadModel(nn.Module):
    def __init__(self, config, n_icd, n_grp):
        super().__init__()
        from transformers import AutoModel
        self.encoder = AutoModel.from_config(config)
        self.dropout = nn.Dropout(0.2)
        self.icd10_head = nn.Linear(config.hidden_size, n_icd)
        self.group_head = nn.Linear(config.hidden_size, n_grp)

    def forward(self, input_ids, attention_mask):
        outputs = self.encoder(input_ids=input_ids, attention_mask=attention_mask)
        mask = attention_mask.unsqueeze(-1).float()
        pooled = (outputs.last_hidden_state * mask).sum(dim=1) / mask.sum(dim=1).clamp(min=1e-9)
        return self.icd10_head(self.dropout(pooled)), self.group_head(self.dropout(pooled))

# 3. Load Model & Tokenizer
config = AutoConfig.from_pretrained(REPO_ID)
tokenizer = AutoTokenizer.from_pretrained(REPO_ID)
model = DualHeadModel(config, n_icd=len(id_to_icd10), n_grp=len(id_to_group))
model.load_state_dict(torch.load(model_path, map_location="cpu"))
model.eval()

# 4. Inferensi Teks Klinis
teks_klinis = "Pasien datang kontrol rutin poli penyakit dalam dengan riwayat hipertensi 5 tahun. Tensi 150/90 mmHg."
inputs = tokenizer(teks_klinis, return_tensors="pt", max_length=128, truncation=True, padding=True)

with torch.no_grad():
    icd_logits, grp_logits = model(inputs["input_ids"], inputs["attention_mask"])
    icd_probs = torch.softmax(icd_logits, dim=-1)[0]
    grp_probs = torch.softmax(grp_logits, dim=-1)[0]

top_icd = torch.argmax(icd_probs).item()
top_grp = torch.argmax(grp_probs).item()

icd_code = id_to_icd10[top_icd]
grp_code = id_to_group[top_grp]

print("=== HASIL INFERENSI MEDSYNC AI STUDIO ===")
print(f"Prediksi ICD-10 : {icd_code} - {icd10_to_name.get(icd_code, '')} ({icd_probs[top_icd]*100:.1f}%)")
print(f"Prediksi INA-CBGs: {grp_code} - {group_to_name.get(grp_code, '')} ({grp_probs[top_grp]*100:.1f}%)")

Etika & Kepatuhan Data

Dataset dan bobot dikembangkan sesuai regulasi perlindungan data medis UU PDP No. 27/2022. Rekam Medis (Nomor Rekam Medis, No. SEP, Nama Pasien) telah dideidentifikasi dan disimpan di repositori privat terpisah.

Configuration

Architecture
BertForMaskedLM
Context length (tokens)
512
Layers
12
Hidden size
768
Feed-forward size
3,072
Attention heads
12
Vocabulary size
50,000
Model type
bert

Identity and Version

Repository
Dragneva/medsync-indobert-inacbg
Publisher
MUHAMMAD DHIAUDDIN
Task
Text classification
Modality
Text
Library
Not stated by the source
Parameters
Not stated by the source
Languages
id
Revision
783045fbf9bbb42f52907913234af0a1b20f9587
First published
2026-10-08
Last updated
2026-10-08

Files and Weights

20 files, 500.8 MB in total. The weights are 1 file totalling 498.1 MB in pt.

Weights1 file · 498.1 MB
Configuration3 files · 13.0 KB
Tokenizer2 files · 709.6 KB
Documentation1 file · 4.3 KB
Other11 files · 2.0 MB
Repository2 files · 2.3 KB
Every file
FileTypeSizeSHA-256
model.ptWeights498.1 MB 358c68e12a46
best_hyperparameters.jsonConfiguration126 B —
config.jsonConfiguration1.4 KB —
label_mappings.jsonConfiguration11.5 KB —
README.mdDocumentation4.3 KB —
images/distribusi_icd10_longtail.pngOther249.3 KB ebadc4d2dc0e
images/distribusi_inacbg_group.pngOther156.3 KB f59979042b7c
images/distribusi_panjang_teks.pngOther207.9 KB 33ae055c2f84
images/distribusi_similarity_baseline3_retrieval.pngOther192.4 KB ff93138ceff4
images/distribusi_status_pelayanan.pngOther75.0 KB —
images/evaluasi_terstratifikasi_klinis_vs_administratif.pngOther134.4 KB b90d587465c5
images/komparasi_evaluasi_model.pngOther148.3 KB fe25774f041e
images/kurva_logloss_baseline2_xgboost.pngOther231.2 KB 085c52db42e6
images/kurva_loss_model_utama_baseline1.pngOther246.7 KB cf18960f3884
images/mismatch_icd10_analisis.pngOther195.3 KB 154b050c346f
images/term_frequency_medis.pngOther144.2 KB 90cfed91017f
.gitattributesRepository2.3 KB —
images/.gitkeepRepository —
tokenizer.jsonTokenizer709.1 KB —
tokenizer_config.jsonTokenizer505 B —

License and Download

License
apache-2.0
Access
Open weights, no gate
Download size
498.1 MB
Download from MUHAMMAD DHIAUDDIN

Released by MUHAMMAD DHIAUDDIN through its official repository on Hugging Face. Read the license.

Built From

  • Trained on (disclosed) Dragneva/medsync-clinical-dataset

Memory Requirements

PrecisionWeights in memory
As published498.1 MB

Weights only, from the published parameter count; the key-value cache and runtime add to this.

Questions About medsync-indobert-inacbg

Can I use medsync-indobert-inacbg commercially?

Yes. medsync-indobert-inacbg is released under Apache License 2.0. The Apache License 2.0 is a permissive open-source license. It permits commercial use, modification and redistribution. It requires keeping the license and copyright notices and any NOTICE file, stating significant changes, and it includes an express patent grant from contributors.

What is medsync-indobert-inacbg's context length?

512 tokens, from the maximum position embeddings in its published configuration.

Similar Models

Model · Text classification

twitter-roberta-base-sentiment-latest

Cardiff NLP

This is a RoBERTa-base model trained on ~124M tweets from January 2018 to December 2021, and finetuned for sentiment analysis with the TweetEval benchmark. The original Twitter-based RoBERTa model can be found here and the original reference paper is TweetEval. This model is suitable for English. 0 -> Negative; 1 -> Neutral; 2 -> Positive This sentiment analysis model has been integrated into TweetNLP. You can access the demo here.

Open weights cc-by-4.0 514 tokens transformers

Model · Text classification

finbert-tone

Yi

FinBERT is a BERT model pre-trained on financial communication text. The purpose is to enhance financial NLP research and practice. It is trained on the following three financial communication corpus. The total corpora size is 4.9B tokens. More technical details on FinBERT: Click Link This released finbert-tone model is the FinBERT model fine-tuned on 10,000 manually annotated (positive, negative, neutral) sentences from analyst reports. This model achieves superior performance on financial tone analysis task. If you are simply interested in using FinBERT for financial tone analysis, give it a try. If you use the model in your academic work, please cite the following paper: Huang, Allen H.…

Open weights 512 tokens transformers

Model · Text classification

ms-marco-MiniLM-L-6-v2

Joshua

https://huggingface.co/cross-encoder/ms-marco-MiniLM-L-6-v2 with ONNX weights to be compatible with Transformers.js. If you haven't already, you can install the Transformers.js JavaScript library from NPM using: Note: Having a separate repo for ONNX weights is intended to be a temporary solution until WebML gains more traction. If you would like to make your models web-ready, we recommend converting to ONNX using Optimum and structuring your repo like this one (with ONNX weights located in a subfolder named onnx).

Open weights 512 tokens transformers.js

Model · Text classification

twitter-xlm-roberta-base-sentiment

Cardiff NLP

This is a multilingual XLM-roBERTa-base model trained on ~198M tweets and finetuned for sentiment analysis. The sentiment fine-tuning was done on 8 languages (Ar, En, Fr, De, Hi, It, Sp, Pt) but it can be used for more languages (see paper for details). This model has been integrated into the TweetNLP library.

Open weights 514 tokens transformers

Model · Text classification

unbiased-toxic-roberta

Unitary

The huggingface models currently give different results to the detoxify library (see issue here). For the most up to date models we recommend using the models from https://github.com/unitaryai/detoxify Trained models & code to predict toxic comments on 3 Jigsaw challenges: Toxic comment classification, Unintended Bias in Toxic comments, Multilingual toxic comment classification. Built by Laura Hanu at Unitary, where we are working to stop harmful content online by interpreting visual content in context. Score not directly comparable since it is obtained on the validation set provided and not on the test set. To update when the test labels are made available. It is also noteworthy to mention…

Open weights apache-2.0 514 tokens transformers

Model · Text classification

emotion-english-distilroberta-base

Hartmann

With this model, you can classify emotions in English text data. The model was trained on 6 diverse datasets (see Appendix below) and predicts Ekman's 6 basic emotions, plus a neutral class: 1) anger 2) disgust 3) fear 4) joy 5) neutral 6) sadness 7) surprise The model is a fine-tuned checkpoint of DistilRoBERTa-base. For a 'non-distilled' emotion model, please refer to the model card of the RoBERTa-large version. a) Run emotion model with 3 lines of code on single text example using Hugging Face's pipeline command on Google Colab: b) Run emotion model on multiple examples and full datasets (e.g.,.csv files) on Google Colab: Please reach out to [email protected] if you have any…

Open weights 514 tokens transformers