CoolFace
Modelpublic

iamjamaal/ghana-adr-detection

sourceHugging Facemitupdated 2mo agoView on Hugging Face
0likes
Model Card

Ghana ADR Detection System

Adverse drug reaction (ADR) detection from free-text clinical narratives, built on Ghanaian pharmacovigilance data. Fine-tuned from PubMedBERT with domain-adaptive pretraining (DAPT) on 128k Ghanaian biomedical sentences.

Model Description

This repository contains two production heads trained on the same DAPT backbone:

ComponentPathTask
DAPT backbonedapt-backbone/PubMedBERT MLM-adapted on Ghanaian biomedical corpus (PPL 6.11 → 4.55)
CLF head (Phase 2b)checkpoints/clf_phase2b_{fold}/clf_best/Binary: contains_adr 0/1
NER head (Phase 7)checkpoints/ner_phase7_{fold}/ner_best/Token labels: DRUG, ADR, SEVERITY, PATIENT_DEMO

Production config (Phase 7 Hybrid): clf_phase2b_cohort_study + ner_phase7_cohort_study, threshold 0.55.

Performance

Evaluated with Leave-One-Source-Out (LOSO) cross-validation — each source domain is held out as the test set while the model trains on the remaining three. This measures real cross-domain generalisation across Ghanaian clinical writing styles.

Classification (CLF)

Held-out sourceNF1
case_report440.787
cohort_study1230.776
fda_newsletter990.667
qualitative_interview780.667
macro-avg—0.724

Named Entity Recognition (NER)

Held-out sourceNF1DRUG F1ADR F1
case_report440.5980.8620.545
cohort_study1230.7850.8230.884
fda_newsletter990.5870.6260.634
qualitative_interview780.6500.5600.842
macro-avg—0.6550.7180.727

Model status: Pilot model — built and actively improved through iterative research phases.

Evaluation methodology: Leave-One-Source-Out (LOSO) — each source domain is held out entirely during training and evaluated as an unseen genre. This is the headline generalization metric above (macro CLF F1 = 0.724, macro NER F1 = 0.655). We also maintain an internal, evolving suite of curated hard cases (Pidgin, dialect, regulatory register, clinical shorthand, minimal pairs) used to diagnose and target specific model weaknesses during development. It's a diagnostic tool, not a benchmark — we don't publish a fixed pass-rate from it here, since the suite and the model are both still changing, and a fixed percentage risks reading as a settled result rather than a snapshot of an active development target.

Training Data

Built from four Ghanaian pharmacovigilance source domains:

SourceType
Ghana FDA DrugLens newsletters (5 issues)PDF — regulatory
Ghana FDA Annual Report 2023 + ADR GuidePDF — regulatory
PMC open-access case reports & cohort studies (9 articles)JATS XML — clinical
Patient ADR interview transcriptsQualitative — community

Gold dataset: 2,870 annotated sentences Silver dataset: 2,105+ records (DailyMed weak supervision, DrugLens NER, OpenFDA ICSR, synthetic curriculum)

How to Use

python
from transformers import AutoTokenizer, AutoModelForSequenceClassification
from transformers import AutoModelForTokenClassification
import torch

# Load DAPT backbone tokenizer
tokenizer = AutoTokenizer.from_pretrained("iamjamaal/ghana-adr-detection", subfolder="dapt-backbone")

# Load CLF head (production fold: cohort_study)
clf_model = AutoModelForSequenceClassification.from_pretrained(
    "iamjamaal/ghana-adr-detection",
    subfolder="checkpoints/clf_phase2b_cohort_study/clf_best"
)

# Load NER head (production fold: cohort_study)
ner_model = AutoModelForTokenClassification.from_pretrained(
    "iamjamaal/ghana-adr-detection",
    subfolder="checkpoints/ner_phase7_cohort_study/ner_best"
)

text = "Patient developed severe oculogyric crisis after starting haloperidol."

# CLF inference
inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=512)
with torch.no_grad():
    logits = clf_model(**inputs).logits
prob_adr = torch.softmax(logits, dim=-1)[0][1].item()
contains_adr = prob_adr >= 0.55
print(f"ADR: {contains_adr} (p={prob_adr:.3f})")

Repo Structure

dapt-backbone/                          # DAPT backbone (config + safetensors)
checkpoints/
  clf_phase2b_case_report/clf_best/     # CLF checkpoint — case_report fold
  clf_phase2b_cohort_study/clf_best/    # CLF checkpoint — cohort_study fold ← production
  clf_phase2b_fda_newsletter/clf_best/
  clf_phase2b_qualitative_interview/clf_best/
  ner_phase7_case_report/ner_best/      # NER checkpoint — case_report fold
  ner_phase7_cohort_study/ner_best/     # NER checkpoint — cohort_study fold ← production
  ner_phase7_fda_newsletter/ner_best/
  ner_phase7_qualitative_interview/ner_best/
  ner_phase7_qualitative_interview_seed/ner_best/

Code & Demo

Limitations

  • —Trained on Ghanaian pharmacovigilance sources; performance may degrade on clinical text from other regions.
  • —NER F1 on SEVERITY and PATIENT_DEMO is lower than DRUG/ADR due to limited annotation density.
  • —Ghanaian Pidgin and dialect constructions improve batch regression scores but may not generalise to other West African Pidgin variants.

Citation

bibtex
@misc{ghana-adr-2026,
  title  = {Ghana ADR Detection System},
  author = {Nabila, Noah Jamal},
  year   = {2026},
  url    = {https://huggingface.co/iamjamaal/ghana-adr-detection}
}

License

Code: MIT | Model weights: MIT | Dataset annotations: CC-BY-4.0