OpenMed

OpenMed GLiFormer BioNER Disease Large v1

OpenMed on Hugging Face OpenMed SDK on GitHub pip install openmed License Apache-2.0

OpenMed's open model for finding diseases in medical text. It returns every disease mention in English biomedical and clinical text with exact character offsets and a confidence score. Trained and evaluated by OpenMed. Apache-2.0, runs on CPU.

Developed by OpenMed
Task Disease mention extraction, one label: disease
Output text, start, end, score; text[start:end] is the exact span
Parameters 576M
Default threshold 0.6
Language English
License Apache-2.0

About OpenMed

OpenMed builds open models and open-source tools for clinical and biomedical text that run on your own hardware.

Quick start

pip install -U "openmed[gliformer]"  # OpenMed 3.2 or later
from openmed import analyze_text

text = (
    "65-year-old man with type 2 diabetes mellitus, stage 3 "
    "chronic kidney disease and atrial fibrillation, "
    "admitted with community-acquired pneumonia."
)
result = analyze_text(
    text,
    model_id="OpenMed/GLiFormer-BioNER-Disease-Large-v1",
    labels=["disease"],
    threshold=0.6,
)
for e in result.entities:
    print(e.start, e.end, e.text, f"{e.confidence:.2f}")
21 45 type 2 diabetes mellitus 1.00
47 77 stage 3 chronic kidney disease 0.86
82 101 atrial fibrillation 1.00
117 145 community-acquired pneumonia 0.95

Negated, family and past mentions

Add assert_context=True and OpenMed labels each mention with its negation, experiencer and timing:

from openmed import analyze_text

text = (
    "Troponin was mildly elevated without dynamic change, "
    "and an acute coronary syndrome was ruled out. No "
    "history of stroke. Her father died of colorectal "
    "cancer."
)
result = analyze_text(
    text,
    model_id="OpenMed/GLiFormer-BioNER-Disease-Large-v1",
    labels=["disease"],
    threshold=0.6,
    assert_context=True,
)
for e in result.entities:
    ctx = e.metadata["clinical_context"]
    print(e.text, ctx["negation"], ctx["experiencer"], ctx["temporality"])
acute coronary syndrome negated patient recent
stroke negated patient historical
colorectal cancer affirmed family recent

Long notes, many notes, GPU

  • Pass a whole note: analyze_text splits it into sentences and returns offsets into the original text.
  • The model loads once and stays cached, so call analyze_text in a loop for many notes.
  • On a GPU, pass config=OpenMedConfig(device="cuda") (from openmed import OpenMedConfig).

Evaluation

BC5CDR test set: 500 PubMed abstracts, 4,424 disease mentions, human annotations. A prediction counts only if its character span matches exactly. The model was trained on NCBI Disease only, so BC5CDR is a different corpus it never saw.

All rows use the same threshold, 0.5.

Model Precision Recall F1
OpenMed GLiFormer BioNER Disease Large v1 (this model) 73.63 64.94 69.01
Before OpenMed fine-tuning: knowledgator/gliformer-large-v1 62.87 48.80 54.95

OpenMed's fine-tuning added +14.1 F1 points (95% CI +12.4 to +15.8, paired bootstrap over test documents). At the default threshold of 0.6, chosen on the development set before testing, this model scores precision 74.81, recall 63.04, F1 68.42.

The OpenMed disease family

Same training data, same task, same test set (BC5CDR, never seen in training), same threshold.

Model Parameters BC5CDR F1 (0.5)
OpenMed GLiFormer BioNER Disease Large v1 (this model) 576M 69.01
OpenMed GLiNER2.5 BioNER Disease Base v1 194M 67.04
OpenMed GLiFormer BioNER Disease Base v1 264M 64.10

Examples

Real outputs of this model through the OpenMed SDK, at its default threshold (0.6), on CPU. The sentences are synthetic, written for this card. Extracted spans are in bold with their scores.

  1. Clinical note: 65-year-old man with type 2 diabetes mellitus1.00, stage 3 chronic kidney disease0.86 and atrial fibrillation1.00, admitted with community-acquired pneumonia0.95.
  2. Abbreviations: PMH0.86: COPD1.00, CHF1.00, T2DM1.00, OSA1.00 on CPAP. Admitted for an acute exacerbation of COPD1.00.
  3. Oncology genetics: Germline BRCA1 and BRCA2 variants raise the lifetime risk of breast cancer1.00 and ovarian cancer1.00.
  4. Rare inherited disease: Autosomal dominant polycystic kidney disease1.00 is the most common inherited cause of end-stage renal disease1.00.
  5. Adverse drug events: Two patients developed drug-induced liver injury and one developed Stevens-Johnson syndrome1.00 after the new regimen was started.
  6. Neurology differential: MRI findings were consistent with multiple sclerosis1.00; neuromyelitis optica1.00 and acute disseminated encephalomyelitis1.00 were considered less likely.
  7. Hematology: Biopsy confirmed diffuse large B-cell lymphoma1.00 in a patient with long-standing Sjogren's syndrome0.97 and autoimmune hemolytic anemia1.00.
  8. Infection before biologics: Latent tuberculosis1.00 was treated before adalimumab was started for rheumatoid arthritis1.00.
  9. Newborn screening: Newborn screening flagged cystic fibrosis1.00, congenital hypothyroidism1.00 and phenylketonuria1.00 for confirmatory testing.
  10. Cardiology: Echocardiography showed hypertrophic cardiomyopathy1.00 with moderate mitral regurgitation1.00; no pericardial effusion.
  11. Negation and family history: No history of asthma1.00 or epilepsy1.00. Her mother had Huntington's disease0.99.
  12. Medications only: Started metformin 500 mg twice daily and lisinopril 10 mg once daily; follow up in four weeks. (nothing extracted)

A longer note (1,257 characters, 24 spans) in one analyze_text call with assert_context=True. Mentions that are negated, about a family member or in the past carry that label:

DISCHARGE SUMMARY
Reason for admission: A 72-year-old woman with heart failure with reduced ejection fraction, chronic obstructive pulmonary disease and type 2 diabetes mellitus presented with three days of worsening dyspnea, orthopnea and bilateral leg swelling.
Hospital course: Chest radiograph showed pulmonary edema and a small right pleural effusion. Troponin was mildly elevated without dynamic change, and an acute coronary syndromenegated was ruled out. She was diuresed with intravenous furosemide. On day two she developed acute kidney injury, which improved after the diuretic dose was reduced. A urinary tract infection was treated with nitrofurantoin. Her course was also complicated by deliriumhistorical, which resolved by discharge.
Past history: hypertension, hyperlipidemia, osteoarthritis of both knees, gastroesophageal reflux disease and a remote history of breast cancerhistorical treated with lumpectomy and radiotherapy. No history of strokenegated, historical. Her father died of colorectal cancerfamily.
Discharge diagnoses: acute decompensated heart failure; acute kidney injuryhistorical, resolved; urinary tract infection; deliriumhistorical, resolved.
Follow-up: cardiology clinic in two weeks with a repeat basic metabolic panel; screen for sleep apnea and iron deficiency anemia as an outpatient.

Good to know

  • It finds mentions, including negated ones: No history of asthma still returns asthma (example 11). assert_context=True catches most negation and family history (see the longer note), but it is rule-based and can miss: in example 11, epilepsy after No history of asthma or comes back affirmed.
  • Abbreviations work (COPD, CHF, T2DM, OSA in example 2), with one false positive: the section header PMH.
  • It can miss a mention: drug-induced liver injury in example 5, and heart failure in the first line of the longer note.
  • Drug names are not diseases: example 12 returns nothing.

Limitations

  • Trained and tested on PubMed abstracts. It has not been validated on hospital notes; the notes above are synthetic.
  • English only, one label (disease). Other labels and the base model's other tasks were not evaluated after fine-tuning.
  • No normalization: spans are not mapped to ICD-10, SNOMED CT or MeSH codes.
  • It finds text spans. It does not diagnose anything and is not a medical device.

Built on

OpenMed fine-tuned this model from knowledgator/gliformer-large-v1 by Knowledgator (Apache-2.0), built with the open-source GLiFormer library. Training data: the NCBI Disease corpus (public domain). Evaluation: the BC5CDR corpus. Thank you to Knowledgator and to the corpus authors for releasing their work openly.

This model is released under Apache-2.0. No corpus text is included in this repository.

Citation

@misc{panahi2025openmedner,
  title={OpenMed NER: Open-Source, Domain-Adapted State-of-the-Art Transformers for Biomedical NER Across 12 Public Datasets},
  author={Maziyar Panahi},
  year={2025},
  eprint={2508.01630},
  archivePrefix={arXiv}
}

@article{dogan2014ncbi,
  title={NCBI disease corpus: a resource for disease name recognition and concept normalization},
  author={Do{\u{g}}an, Rezarta Islamaj and Leaman, Robert and Lu, Zhiyong},
  journal={Journal of Biomedical Informatics},
  volume={47},
  pages={1--10},
  year={2014}
}

@article{li2016biocreative,
  title={BioCreative V CDR task corpus: a resource for chemical disease relation extraction},
  author={Li, Jiao and Sun, Yueping and Johnson, Robin J and Sciaky, Daniela and Wei, Chih-Hsuan and Leaman, Robert and Davis, Allan Peter and Mattingly, Carolyn J and Wiegers, Thomas C and Lu, Zhiyong},
  journal={Database},
  volume={2016},
  pages={baw068},
  year={2016}
}

OpenMed · Hugging Face · GitHub · PyPI · X

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for OpenMed/GLiFormer-BioNER-Disease-Large-v1

Finetuned
(2)
this model

Dataset used to train OpenMed/GLiFormer-BioNER-Disease-Large-v1

Paper for OpenMed/GLiFormer-BioNER-Disease-Large-v1

Evaluation results