Loading…
Loading…
OpenMed's open model for finding anatomy in biomedical text. It returns every anatomical mention (organs, body regions, tissues, cells and body substances) in English biomedical text with exact character offsets and a confidence score. Trained and evaluated by OpenMed. Apache-2.0, 73.9M parameters, runs on CPU.
| Developed by | OpenMed |
|---|---|
| Task | Anatomy mention extraction, one label: anatomy (the prompt it was trained with) |
| Output | text, start, end, score; text[start:end] is the exact span |
| Parameters | 73.9M |
| Default threshold | 0.3 |
| Language | English |
| License | Apache-2.0 |
OpenMed builds open models and open-source tools for clinical and biomedical text that run on your own hardware.
pip install openmed for de-identification, clinical NER, and FHIR and HL7 tooling, all local.pip install -U "openmed[gliner2]" # OpenMed 3.2 or later
from openmed import OpenMedConfig, analyze_text
text = (
"Contrast-enhanced CT of the chest showed a mass in the "
"right upper lobe of the lung with enlarged mediastinal "
"lymph nodes."
)
result = analyze_text(
text,
model_id="OpenMed/GLiNER2.5-Anatomy-Small-v1",
labels=["anatomy"],
threshold=0.05,
confidence_threshold=0.3,
max_length=150,
config=OpenMedConfig(use_medical_tokenizer=False),
)
for e in result.entities:
print(e.start, e.end, e.text, f"{e.confidence:.2f}")
28 33 chest 0.92
55 71 right upper lobe 0.41
79 83 lung 0.82
98 121 mediastinal lymph nodes 0.85
labels=["anatomy"] is the prompt the model was trained with. Keep it as written.threshold=0.05 lets the model propose spans down to 0.05, and confidence_threshold=0.3 keeps those scoring 0.3 or more. This is the decoding behind the evaluation below. Raise confidence_threshold for fewer, surer spans.max_length=150 makes analyze_text group sentences into pieces of at most 600 characters, the window size used in training and evaluation. It only matters for long texts.use_medical_tokenizer=False keeps the model's own span boundaries. The SDK default merges touching spans of one label: in the longer abstract it would return Proximal tubule epithelial cells as one span instead of Proximal tubule and epithelial cells.analyze_text splits it into sentences and returns offsets into the original text.analyze_text in a loop for many texts.config=OpenMedConfig(device="cuda", use_medical_tokenizer=False).MedMentions, 200 held-out abstracts: PubMed abstracts with 987 human-annotated anatomy mentions (the 11 semantic types of the UMLS Anatomy semantic group, mapped to one label). The model was trained on 1,000 other MedMentions abstracts, both thresholds were chosen on 200 more, and these 200 were scored once at the end, with the model, thresholds and scoring code frozen first. A prediction counts only if its character span matches exactly. All abstracts come from the official MedMentions training partition; the official test set was not used, so these numbers are not comparable to published MedMentions results.
| Model | Precision | Recall | F1 |
|---|---|---|---|
| OpenMed GLiNER2.5 Anatomy Small v1 (this model), threshold 0.3 | 57.91 | 66.36 | 61.85 |
| Before OpenMed fine-tuning: fastino/gliner2.5-small-v1, threshold 0.6 | 20.77 | 33.74 | 25.71 |
OpenMed's fine-tuning added +36.14 F1 points (95% CI +31.45 to +40.95, paired bootstrap over the 200 abstracts, 2,000 resamples). Each model runs at its own best threshold, chosen on the calibration abstracts before testing. At the same threshold, 0.5, the scores are 61.74 for this model and 26.20 before fine-tuning.
Same base model, same MedMentions source, one label each, each scored on its own held-out abstracts.
| Model | Finds | Prompt | Default threshold | F1 before fine-tuning | F1 |
|---|---|---|---|---|---|
| OpenMed GLiNER2.5 DrugChemical Small v1 | drugs and chemicals | chemical or drug |
0.4 | 45.09 | 67.43 |
| OpenMed GLiNER2.5 Anatomy Small v1 (this model) | anatomy | anatomy |
0.3 | 25.71 | 61.85 |
Real outputs of this model through the OpenMed SDK, with the quick-start settings (default threshold 0.3), on CPU. The sentences are synthetic, written in the style of PubMed abstracts for this card. Extracted spans are in bold with their scores.
A longer abstract (938 characters, 23 spans) in one analyze_text call:
BACKGROUND: Diabetic kidney disease affects both the glomeruli and the tubulointerstitium, but early structural changes are poorly characterized.
METHODS: We analyzed kidney biopsies from 86 adults with type 2 diabetes. Sections were stained to assess the glomerular basement membrane, mesangial matrix and podocytes, and peritubular capillaries were counted in the renal cortex. Urine and plasma samples were collected on the day of biopsy.
RESULTS: Thickening of the glomerular basement membrane was present in 71 biopsies and correlated with podocyte loss. Proximal tubule epithelial cells showed lipid accumulation, and macrophages infiltrated the interstitium in advanced cases. Retinal photographs showed microaneurysms in 40 patients, and their presence was associated with mesangial expansion.
CONCLUSIONS: Structural injury to the glomerulus, tubules and peritubular capillaries begins before a marked decline in kidney function.
OpenMed fine-tuned this model from fastino/gliner2.5-small-v1 by Fastino (Apache-2.0), built with the open-source GLiNER2 library. Training and evaluation data: the MedMentions corpus of PubMed abstracts annotated with UMLS concepts by Mohan and Li (2019, CC0); mentions of the UMLS Anatomy semantic group were mapped to one label. Thank you to Fastino and to the MedMentions authors for releasing their work openly.
This model is released under Apache-2.0. No corpus text, UMLS concept IDs or terminology files are included in this repository.
@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}
}
@inproceedings{mohan2019medmentions,
title={MedMentions: A Large Biomedical Corpus Annotated with {UMLS} Concepts},
author={Mohan, Sunil and Li, Donghui},
booktitle={Proceedings of the 2019 Conference on Automated Knowledge Base Construction (AKBC)},
year={2019}
}
@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
fastino/gliner2.5-small-v1