| Component | Path | Task |
|---|---|---|
| DAPT backbone | dapt-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 |
clf_phase2b_cohort_study + ner_phase7_cohort_study, threshold 0.55.| Held-out source | N | F1 |
|---|---|---|
| case_report | 44 | 0.787 |
| cohort_study | 123 | 0.776 |
| fda_newsletter | 99 | 0.667 |
| qualitative_interview | 78 | 0.667 |
| macro-avg | — | 0.724 |
| Held-out source | N | F1 | DRUG F1 | ADR F1 |
|---|---|---|---|---|
| case_report | 44 | 0.598 | 0.862 | 0.545 |
| cohort_study | 123 | 0.785 | 0.823 | 0.884 |
| fda_newsletter | 99 | 0.587 | 0.626 | 0.634 |
| qualitative_interview | 78 | 0.650 | 0.560 | 0.842 |
| macro-avg | — | 0.655 | 0.718 | 0.727 |
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.
| Source | Type |
|---|---|
| Ghana FDA DrugLens newsletters (5 issues) | PDF — regulatory |
| Ghana FDA Annual Report 2023 + ADR Guide | PDF — regulatory |
| PMC open-access case reports & cohort studies (9 articles) | JATS XML — clinical |
| Patient ADR interview transcripts | Qualitative — community |
1from transformers import AutoTokenizer, AutoModelForSequenceClassification
2from transformers import AutoModelForTokenClassification
3import torch
4
5# Load DAPT backbone tokenizer
6tokenizer = AutoTokenizer.from_pretrained("iamjamaal/ghana-adr-detection", subfolder="dapt-backbone")
7
8# Load CLF head (production fold: cohort_study)
9clf_model = AutoModelForSequenceClassification.from_pretrained(
10 "iamjamaal/ghana-adr-detection",
11 subfolder="checkpoints/clf_phase2b_cohort_study/clf_best"
12)
13
14# Load NER head (production fold: cohort_study)
15ner_model = AutoModelForTokenClassification.from_pretrained(
16 "iamjamaal/ghana-adr-detection",
17 subfolder="checkpoints/ner_phase7_cohort_study/ner_best"
18)
19
20text = "Patient developed severe oculogyric crisis after starting haloperidol."
21
22# CLF inference
23inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=512)
24with torch.no_grad():
25 logits = clf_model(**inputs).logits
26prob_adr = torch.softmax(logits, dim=-1)[0][1].item()
27contains_adr = prob_adr >= 0.55
28print(f"ADR: {contains_adr} (p={prob_adr:.3f})")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/SEVERITY and PATIENT_DEMO is lower than DRUG/ADR due to limited annotation density.1@misc{ghana-adr-2026,
2 title = {Ghana ADR Detection System},
3 author = {Nabila, Noah Jamal},
4 year = {2026},
5 url = {https://huggingface.co/iamjamaal/ghana-adr-detection}
6}