--- license: apache-2.0 language: - en library_name: openmed pipeline_tag: token-classification base_model: fastino/gliner2.5-base-v1 datasets: - ncbi/ncbi_disease tags: - medical - biomedical - clinical-nlp - named-entity-recognition - disease - gliner2 - gliner - openmed model-index: - name: GLiNER2.5-BioNER-Disease-Base-v1 results: - task: type: token-classification name: Disease mention extraction dataset: name: BC5CDR (test) type: bigbio/bc5cdr split: test metrics: - type: f1 value: 67.04 name: F1 (exact span, threshold 0.5) ---

OpenMed

OpenMed GLiNER2.5 BioNER Disease Base 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](https://huggingface.co/OpenMed). Apache-2.0, runs on CPU. | Developed by | [OpenMed](https://huggingface.co/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](https://huggingface.co/OpenMed)** for clinical NER, de-identification and more. - **[The OpenMed Python SDK](https://github.com/maziyarpanahi/openmed)**, Apache-2.0: `pip install openmed` for de-identification, clinical NER, and FHIR and HL7 tooling, all local. - New models every week: follow [OpenMed on Hugging Face](https://huggingface.co/OpenMed) and [@OpenMed_AI on X](https://x.com/OpenMed_AI). ## Quick start ```bash pip install -U "openmed[gliner2]" # OpenMed 3.2 or later ``` ```python 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}") ``` ```text 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: ```python 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"]) ``` ```text 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 GLiNER2.5 BioNER Disease Base v1** (this model) | 69.90 | 64.40 | **67.04** | | Before OpenMed fine-tuning: [fastino/gliner2.5-base-v1](https://huggingface.co/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](https://huggingface.co/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](https://huggingface.co/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. 1. *Clinical note:* 65-year-old man with **type 2 diabetes mellitus**0.98, **stage 3 chronic kidney disease**0.82 and **atrial fibrillation**0.99, admitted with **community-acquired pneumonia**0.90. 2. *Abbreviations:* PMH: COPD, CHF, T2DM, OSA on CPAP. Admitted for an **acute exacerbation of COPD**0.94. 3. *Oncology genetics:* Germline BRCA1 and BRCA2 variants raise the lifetime risk of **breast cancer**1.00 and **ovarian cancer**1.00. 4. *Rare inherited disease:* **Autosomal dominant polycystic kidney disease**1.00 is the most common inherited cause of **end-stage renal disease**0.99. 5. *Adverse drug events:* Two patients developed **drug-induced liver injury**0.80 and one developed **Stevens-Johnson syndrome**0.99 after the new regimen was started. 6. *Neurology differential:* MRI findings were consistent with **multiple sclerosis**1.00; **neuromyelitis optica**0.99 and **acute disseminated encephalomyelitis**0.99 were considered less likely. 7. *Hematology:* Biopsy confirmed diffuse large **B-cell lymphoma**0.94 in a patient with long-standing **Sjogren's syndrome**0.99 and **autoimmune hemolytic anemia**0.99. 8. *Infection before biologics:* Latent tuberculosis was treated before adalimumab was started for **rheumatoid arthritis**1.00. 9. *Newborn screening:* Newborn screening flagged **cystic fibrosis**1.00, **congenital hypothyroidism**0.99 and **phenylketonuria**1.00 for confirmatory testing. 10. *Cardiology:* Echocardiography showed **hypertrophic cardiomyopathy**1.00 with moderate **mitral regurgitation**0.99; no **pericardial effusion**1.00. 11. *Negation and family history:* No history of **asthma**1.00 or **epilepsy**1.00. Her mother had **Huntington's disease**0.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, 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 syndrome**negated 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 **delirium**historical, which resolved by discharge. > Past history: **hypertension**, **hyperlipidemia**, **osteoarthritis of both knees**, **gastroesophageal reflux disease** and a remote history of **breast cancer**historical treated with lumpectomy and radiotherapy. No history of **stroke**negated, historical. Her father died of **colorectal cancer**family. > Discharge diagnoses: **acute decompensated heart failure**; **acute kidney injury**historical, resolved; **urinary tract infection**; **delirium**historical, 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. - 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](https://huggingface.co/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](https://huggingface.co/fastino/gliner2.5-base-v1) by Fastino (Apache-2.0), built with the open-source [GLiNER2](https://github.com/fastino-ai/GLiNER2) library. Training data: the [NCBI Disease corpus](https://www.ncbi.nlm.nih.gov/CBBresearch/Dogan/DISEASE/) (public domain). Evaluation: the [BC5CDR corpus](https://ftp.ncbi.nlm.nih.gov/pub/lu/BC5CDR/). 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 ```bibtex @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