This repository contains the analysis code accompanying the manuscript "HAZARD-RANK: A Weakly Supervised Pairwise Risk-Prioritization Pipeline for Hospital Occupational Health and Safety Registers." It implements a weakly supervised, pairwise risk-prioritization pipeline for free-text hospital occupational health and safety (OHS) hazard registers, validated against independent expert judgment.
The pipeline combines five rule-based labeling functions (severity lexicon, regulation-article prior, hazard-category prior, affected-population prior, and accident-history prior) through a generative label model to produce weak pairwise preference labels, which train a shared-weight Bradley–Terry scorer (TF-IDF as the primary model; a fine-tuned Turkish BERT variant, BERTurk, as a secondary comparison) with structurally guaranteed antisymmetry.
Included:
pipeline_fulldata.py — main labeling-function and TF-IDF + Bradley-Terry training pipeline
berturk_finetune_modB2.py — pre-registered BERTurk fine-tuning protocol (GPU)
kappa_hesapla.py — inter-rater reliability (kappa) computation from expert judgments
konsensus_altinset_uret.py — consensus-based gold-subset construction
README.md — expected input schema and reproduction instructions
Not included: No hospital records or identifiable data are included, consistent with the data-minimization commitment described in the manuscript. The scripts expect a de-identified CSV following the schema documented in the README.
Keywords
occupational health and safety; weak supervision; pairwise ranking; risk prioritization; natural language processing; hospital safety; Bradley-Terry model; data programming; BERTurk; TF-IDF
License
[Seçmeniz gerekiyor — kod için yaygın seçenekler: MIT, Apache-2.0, veya GPL-3.0. Zenodo formunda bir SPDX lisans kodu seçmeniz istenecek.]
Version
v1.0
Related identifiers (isteğe bağlı, makale kabul edilince eklenebilir)
"Is supplement to" → makalenin DOI'si (yayınlandığında)
Language
English (code/documentation); dataset schema documented bilingually is not included.
Access right
Open Access