A sample can receive one or more labels simultaneously (multilabel).
1from huggingface_hub import hf_hub_download
2from ncas_indication.model import ClinicalBERTClassifier
3from transformers import AutoTokenizer
4
5# Download checkpoint
6model_path = hf_hub_download(
7 repo_id="jibmaird/NCAS-hospital-indication-classifier",
8 filename="indication_classifier_model.pt",
9)
10
11# Load model (label names and thresholds are embedded in the checkpoint)
12model, label_columns, thresholds = ClinicalBERTClassifier.from_checkpoint(model_path)
13tokenizer = AutoTokenizer.from_pretrained("emilyalsentzer/Bio_ClinicalBERT")
Or using the inference script from the
GitHub repository:
1# Single text
2python inference/predict.py --text "UTI prophylaxis post-renal transplant"
3
4# CSV file
5python inference/predict.py --input your_file.csv --output predictions.csv
A cross-platform desktop GUI is available in the
app/ folder of the repository.
See
app/README.md.
1{
2 "model_state_dict": ..., # nn.Module weights
3 "label_columns": [...], # ordered label names
4 "optimal_thresholds": [...], # per-label decision thresholds
5 "n_labels": 8,
6 "base_model": "emilyalsentzer/Bio_ClinicalBERT",
7}
1@article{ncas_indication_classifier_2025,
2 title = {Automated Classification of Antimicrobial Prescription Indications
3 Using BioClinicalBERT},
4 author = {...},
5 journal = {...},
6 year = {2025},
7 note = {Under review}
8}
Source code, training scripts, and the desktop application are available at:
https://github.com/jibmaird/NCAS-hospital-indication-classifier