OpenMed's open model for finding procedures and tests in biomedical text. It returns diagnostic, laboratory and therapeutic procedure mentions in English biomedical text, labeled by type, 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 | Procedure mention extraction, three labels: diagnostic procedure, laboratory procedure, therapeutic or preventive procedure (the prompts it was trained with) |
| Output | text, start, end, label, score; text[start:end] is the exact span |
| Parameters | 73.9M |
| Default threshold | 0.4 |
| 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 = (
"Patients underwent screening colonoscopy, and polyps "
"larger than 10 mm were removed by endoscopic mucosal "
"resection."
)
result = analyze_text(
text,
model_id="OpenMed/GLiNER2.5-ProceduresTests-Small-v1",
labels=[
"diagnostic procedure",
"laboratory procedure",
"therapeutic or preventive procedure",
],
threshold=0.05,
confidence_threshold=0.4,
max_length=150,
config=OpenMedConfig(use_medical_tokenizer=False),
)
for e in result.entities:
print(e.start, e.end, e.text, f"[{e.label}]", f"{e.confidence:.2f}")
19 40 screening colonoscopy [PROCEDURE] 0.88
87 115 endoscopic mucosal resection [therapeutic or preventive procedure] 0.95
labels holds the three prompts the model was trained with, one per label. Keep them as written and pass all of them: the evaluation below ran with all three together.label, except diagnostic procedure, which the SDK reports under its standard label PROCEDURE. laboratory procedure and therapeutic or preventive procedure come back as written.threshold=0.05 lets the model propose spans down to 0.05, and confidence_threshold=0.4 keeps those scoring 0.4 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.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 1,017 human-annotated procedure mentions (216 diagnostic, 189 laboratory and 612 therapeutic or preventive; three of the seven semantic types of the UMLS Procedures semantic group, each kept as its own 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 and its label both match exactly. Scores pool all labels (micro-average). 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 ProceduresTests Small v1 (this model), threshold 0.4 | 50.21 | 46.02 | 48.02 |
| Before OpenMed fine-tuning: fastino/gliner2.5-small-v1, threshold 0.3 | 9.31 | 19.37 | 12.57 |
OpenMed's fine-tuning added +35.45 F1 points over all labels (95% CI +31.33 to +39.62, 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 47.56 for this model and 11.45 before fine-tuning.
| Label | Prompt | Mentions | Precision | Recall | F1 before fine-tuning | F1 | F1 change (95% CI) |
|---|---|---|---|---|---|---|---|
| Diagnostic_Procedure | diagnostic procedure |
216 | 46.63 | 44.91 | 8.26 | 45.75 | +37.49 (+29.24 to +46.33) |
| Laboratory_Procedure | laboratory procedure |
189 | 32.67 | 25.93 | 11.00 | 28.91 | +17.90 (+12.41 to +23.92) |
| Therapeutic_Procedure | therapeutic or preventive procedure |
612 | 56.10 | 52.61 | 18.73 | 54.30 | +35.57 (+29.61 to +41.84) |
Laboratory procedures are the weak label: 28.91 F1, with recall 25.93. On these abstracts the model finds about one laboratory procedure mention in four, and 67% of the spans it labels laboratory do not match an annotated laboratory procedure exactly. Review its laboratory spans before relying on them. All three labels improved with fine-tuning: each label's 95% interval is above zero.
Same base model, same MedMentions source, each scored on its own held-out abstracts. ProceduresTests has three labels and its F1 pools them; the others have one label each.
| 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 | anatomy | anatomy |
0.3 | 25.71 | 61.85 |
| OpenMed GLiNER2.5 ProceduresTests Small v1 (this model) | diagnostic, laboratory and therapeutic procedures | diagnostic procedure, laboratory procedure, therapeutic or preventive procedure |
0.4 | 12.57 | 48.02 |
Real outputs of this model through the OpenMed SDK, with the quick-start settings (default threshold 0.4), on CPU. The sentences are synthetic, written in the style of PubMed abstracts for this card. Extracted spans are in bold with their label (diagnostic, laboratory, therapeutic) and score.
A longer abstract (829 characters, 11 spans) in one analyze_text call:
BACKGROUND: Early detection of colorectal cancer relies on screening, but adherence to colonoscopydiagnostic remains low.
METHODS: We enrolled 1,200 adults aged 50 to 75 years. Participants completed a fecal immunochemical testlaboratory, and those with a positive result were referred for colonoscopydiagnostic. Biopsy specimens were examined by histopathology, and KRAS mutation status was determined by polymerase chain reactionlaboratory. Hemoglobinlaboratory and serum ferritinlaboratory were measured in all participants.
RESULTS: Colonoscopydiagnostic detected advanced adenomas in 84 participants, all of whom underwent polypectomytherapeutic. Eleven patients with invasive cancer were treated with laparoscopic colectomytherapeutic, and six received adjuvant chemotherapytherapeutic.
CONCLUSIONS: A stepwise screening program combining stool testing and colonoscopy increased detection and allowed early surgical treatmenttherapeutic.
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 three types of the UMLS Procedures semantic group (Diagnostic Procedure, Laboratory Procedure and Therapeutic or Preventive Procedure) were kept as three labels. 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