This repository contains the full pipeline for the paper Classification of Kinetic-Related Injury in Hospital Triage Data Using NLP, published in Advanced Data Mining and Applications: 21st International Conference, ADMA 2025, Kyoto, Japan, October 22–24, 2025, Proceedings, Part III — Lecture Notes in Computer Science (LNCS, vol. 16199), Lecture Notes in Artificial Intelligence subseries, © 2026, Springer Nature. The paper is on Springer Nature ADMA 2025.
This repository includes scripts for pretraining, fine-tuning, prediction, hyperparameter search, and statistical analysis, designed to run across:
- HPC (using either Slurm or PBS schedulers)
- Local machine (Python scripts only)
Full results are at WSU data repository. Note that these results were run on the NCI, therefore are slightly different from the results in the paper due to hardware differences. The full NCI results analysis are in the NCI_results branch.
This folder contains Nextflow pipeline files, it is currently designed for the NCI Gadi system which uses the PBS scheduler but can easily be adopted for Slurm scheduler.
gadi_nfcore_report.sh– collects resource usage fromwork/directory (adapted from nf-core configs)gadi_nf_extract_tasks.sh– extracts job names and.command.runinformation for correlating with parametersmerge_resource_report.py– merges resource usage with hyperparameter configurations and Nextflow tracenextflow.config– defines PBS Pro settings for NCI Gadi queueing systemmain.nf– Nextflow pipeline script managing the workflow stagespbs_nf.sh– PBS submission script to launchmain.nf
- NCI Gadi uses PBS Pro.
- Nextflow handles job orchestration, but each task is launched as a PBS job behind the scenes.
- GPU and CPU usage are explicitly defined in
nextflow.configand.nffiles.
See Nextflow/README.md for more details.
Contains model results, timing benchmarks, and supplementary materials:
fine_tune_results.csv,fine_tune_prediction_results.csv– Fine-tuning metrics (Ingham One → Ingham Two)prediction_results.csv,training_results.csv– Pretraining results (MIMIC dataset)Supplementary.pdf– Summary of results (Adam/SGD comparisons)resultsAnalysis.ipynb– Jupyter notebook for plots and statistical summariesresComparison.R,ttestAllPairs.R– Paired t-tests and statistical tests- Timing CSVs for CPU vs GPU performance
See Results/README.md for more.
Contains all core Python scripts for model training, fine-tuning, and prediction:
Bio_ClinicalBERTClassifier.py– modified wrapper foremilyalsentzer/Bio_ClinicalBERT- Supports layer freezing/unfreezing, mixed precision, per-epoch metrics, robust checkpointing
train.py– Pretraining script (MIMIC)finetune.py– Fine-tuning script (Ingham One)predict.py– Generates predictions and evaluation reportsconfigCreator.py– Generates hyperparameter search CSVsAggregate_Results.py– Aggregates output logs into final CSVsMIMIC3_data_preprocessing.ipynb– Notebook for preparing MIMIC data
See Scripts/README.md for usage.
This folder contains Slurm job scripts for running the model on HPCs that use Slurm job scheduler.
parameter_search.slurm– Pretraining on GPUs (MIMIC dataset). Launches 810 parallel jobs with varying hyperparameters.finetune_models.slurm– Fine-tuning on CPUs (Ingham One dataset). Launches 240 jobs reading fromfinetune_parameters.csv.predict.slurm– Runs predictions on fine-tuned models. Outputs per-sample predictions and metrics.
parameter_search.csv– optimizer, learning rate, dropout, layer unfreeze, seeds (pretraining)finetune_parameters.csv– same parameters for fine-tuning sweep
See Slurm/README.md for job instructions.
-
Data Preparation
Prepare CSVs withTEXT,LABEL, andIDcolumns. -
Training & Fine-tuning
- Use
train.pyfor MIMIC dataset pretraining (typically GPU) - Use
finetune.pyfor Ingham One fine-tuning (typically CPU)
-
Prediction & Evaluation
Runpredict.pyto evaluate models on Ingham Two dataset. -
Hyperparameter Search
UseconfigCreator.py+ Slurm job arrays to sweep parameters. -
Results Aggregation
RunAggregate_Results.pyto compile final CSVs. -
Statistical Analysis
RunresComparison.RorresultsAnalysis.ipynbfor plots and paired t-tests.
- Python 3.8–3.10
transformers,torch,pandas,scikit-learn,numpy- R with
ggplot2
See requirements.txt for Python packages.
Final outputs include:
- Model weights:
Outputs/models/bcbert_runs/andOutputs/models/cpu_finetune/ - Per-run metrics:
Outputs/models/*/results.csv - Aggregated metrics:
Results/*.csv - Statistical plots and comparisons
For questions or collaboration:
- CRMDS / Western Sydney University
- South Western Emergency Research Institute (SWERI) / Ingham Institute for Applied Medical Research
MIT License