Instructions to use OpenMed/GLiNER2.5-BioNER-Disease-Base-v1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- GLiNER2
How to use OpenMed/GLiNER2.5-BioNER-Disease-Base-v1 with GLiNER2:
from gliner2 import AutoExtractor extractor = AutoExtractor.from_pretrained("OpenMed/GLiNER2.5-BioNER-Disease-Base-v1") # Extract entities text = "Apple CEO Tim Cook announced iPhone 15 in Cupertino yesterday." result = extractor.extract_entities(text, ["company", "person", "product", "location"]) print(result) - GLiNER
How to use OpenMed/GLiNER2.5-BioNER-Disease-Base-v1 with GLiNER:
from gliner import GLiNER model = GLiNER.from_pretrained("OpenMed/GLiNER2.5-BioNER-Disease-Base-v1") text = "Cristiano Ronaldo dos Santos Aveiro was born on 5 February 1985 in Funchal, Madeira, Portugal." labels = ["person", "date", "location"] entities = model.predict_entities(text, labels) for entity in entities: print(entity["text"], "=>", entity["label"]) - Notebooks
- Google Colab
- Kaggle
OpenMed GLiNER2.5 BioNER Disease Base v1
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 | 194M |
| Default threshold | 0.7 |
| 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.
- 2,300+ open models on Hugging Face for clinical NER, de-identification and more.
- The OpenMed Python SDK, Apache-2.0:
pip install openmedfor de-identification, clinical NER, and FHIR and HL7 tooling, all local. - New models every week: follow OpenMed on Hugging Face and @OpenMed_AI on X.
Quick start
pip install -U "openmed[gliner2]" # 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/GLiNER2.5-BioNER-Disease-Base-v1",
labels=["disease"],
threshold=0.7,
)
for e in result.entities:
print(e.start, e.end, e.text, f"{e.confidence:.2f}")
21 45 type 2 diabetes mellitus 0.98
47 77 stage 3 chronic kidney disease 0.82
82 101 atrial fibrillation 0.99
117 145 community-acquired pneumonia 0.90
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/GLiNER2.5-BioNER-Disease-Base-v1",
labels=["disease"],
threshold=0.7,
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_textsplits it into sentences and returns offsets into the original text. - The model loads once and stays cached, so call
analyze_textin 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 GLiNER2.5 BioNER Disease Base v1 (this model) | 69.90 | 64.40 | 67.04 |
| Before OpenMed fine-tuning: fastino/gliner2.5-base-v1 | 51.51 | 53.91 | 52.68 |
OpenMed's fine-tuning added +14.4 F1 points (95% CI +12.6 to +16.1, paired bootstrap over test documents). At the default threshold of 0.7, chosen on the development set before testing, this model scores precision 70.93, recall 61.44, F1 65.84.
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 | 576M | 69.01 |
| OpenMed GLiNER2.5 BioNER Disease Base v1 (this model) | 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.7), on CPU. The sentences are synthetic, written for this card. Extracted spans are in bold with their scores.
- Clinical note: 65-year-old man with type 2 diabetes mellitus0.98, stage 3 chronic kidney disease0.82 and atrial fibrillation0.99, admitted with community-acquired pneumonia0.90.
- Abbreviations: PMH: COPD, CHF, T2DM, OSA on CPAP. Admitted for an acute exacerbation of COPD0.94.
- Oncology genetics: Germline BRCA1 and BRCA2 variants raise the lifetime risk of breast cancer1.00 and ovarian cancer1.00.
- Rare inherited disease: Autosomal dominant polycystic kidney disease1.00 is the most common inherited cause of end-stage renal disease0.99.
- Adverse drug events: Two patients developed drug-induced liver injury0.80 and one developed Stevens-Johnson syndrome0.99 after the new regimen was started.
- Neurology differential: MRI findings were consistent with multiple sclerosis1.00; neuromyelitis optica0.99 and acute disseminated encephalomyelitis0.99 were considered less likely.
- Hematology: Biopsy confirmed diffuse large B-cell lymphoma0.94 in a patient with long-standing Sjogren's syndrome0.99 and autoimmune hemolytic anemia0.99.
- Infection before biologics: Latent tuberculosis was treated before adalimumab was started for rheumatoid arthritis1.00.
- Newborn screening: Newborn screening flagged cystic fibrosis1.00, congenital hypothyroidism0.99 and phenylketonuria1.00 for confirmatory testing.
- Cardiology: Echocardiography showed hypertrophic cardiomyopathy1.00 with moderate mitral regurgitation0.99; no pericardial effusion1.00.
- Negation and family history: No history of asthma1.00 or epilepsy1.00. Her mother had Huntington's disease0.99.
- 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, 26 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=Truecatches 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. - Bare abbreviation lists are its weak spot: example 2 returns acute exacerbation of COPD but not the standalone COPD, CHF, T2DM or OSA. For abbreviation-heavy notes, use OpenMed GLiFormer BioNER Disease Base v1.
- Long names can be cut short: B-cell lymphoma instead of diffuse large B-cell lymphoma (example 7), and Latent tuberculosis is missed at the default threshold (example 8).
- 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 fastino/gliner2.5-base-v1 by Fastino (Apache-2.0), built with the open-source GLiNER2 library. Training data: the NCBI Disease corpus (public domain). Evaluation: the BC5CDR corpus. Thank you to Fastino 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}
}
@misc{zaratiana2025gliner2,
title={GLiNER2: An Efficient Multi-Task Information Extraction System with Schema-Driven Interface},
author={Urchade Zaratiana and Gil Pasternak and Oliver Boyd and George Hurn-Maloney and Ash Lewis},
year={2025},
eprint={2507.18546},
archivePrefix={arXiv}
}
OpenMed · Hugging Face · GitHub · PyPI · X
- Downloads last month
- 20
Model tree for OpenMed/GLiNER2.5-BioNER-Disease-Base-v1
Base model
fastino/gliner2.5-base-v1Dataset used to train OpenMed/GLiNER2.5-BioNER-Disease-Base-v1
Space using OpenMed/GLiNER2.5-BioNER-Disease-Base-v1 1
Papers for OpenMed/GLiNER2.5-BioNER-Disease-Base-v1
OpenMed NER: Open-Source, Domain-Adapted State-of-the-Art Transformers for Biomedical NER Across 12 Public Datasets
GLiNER2: An Efficient Multi-Task Information Extraction System with Schema-Driven Interface
Evaluation results
- F1 (exact span, threshold 0.5) on BC5CDR (test)test set self-reported67.040