đ GLiNER-BioMed
GLiNER-BioMed is a specialized suite of efficient open biomedical Named Entity Recognition (NER) models. It can identify any entity type using bidirectional transformer encoders, offering a practical alternative to traditional NER models and Large Language Models (LLMs). It leverages synthetic annotations from large generative biomedical language models to achieve excellent performance in biomedical entity recognition tasks.
đ Quick Start
Installation
Install the official GLiNER library with pip:
pip install gliner -U
Usage
After installing the GLiNER library, you can easily load a GLiNER-biomed model and perform named entity recognition:
from gliner import GLiNER
model = GLiNER.from_pretrained("Ihor/gliner-biomed-bi-large-v1.0")
text = """
The patient, a 45-year-old male, was diagnosed with type 2 diabetes mellitus and hypertension.
He was prescribed Metformin 500mg twice daily and Lisinopril 10mg once daily.
A recent lab test showed elevated HbA1c levels at 8.2%.
"""
labels = ["Disease", "Drug", "Drug dosage", "Drug frequency", "Lab test", "Lab test value", "Demographic information"]
entities = model.predict_entities(text, labels, threshold=0.5)
for entity in entities:
print(entity["text"], "=>", entity["label"])
Expected output:
45-year-old male => Demographic information
type 2 diabetes mellitus => Disease
hypertension => Disease
Metformin => Drug
500mg => Drug dosage
twice daily => Drug frequency
Lisinopril => Drug
10mg => Drug dosage
once daily => Drug frequency
HbA1c levels => Lab test
8.2% => Lab test value
If you have a large amount of entities and want to pre-embed them, please refer to the following code snippet:
labels = ["your entities"]
texts = ["your texts"]
entity_embeddings = model.encode_labels(labels, batch_size = 8)
outputs = model.batch_predict_with_embeds(texts, entity_embeddings, labels)
⨠Features
- Flexible Entity Recognition: GLiNER can identify any entity type, breaking the limitations of traditional NER models that are restricted to predefined entities.
- Efficiency: Compared with Large Language Models (LLMs), GLiNER is more suitable for resource-constrained scenarios.
- State-of-the-art Performance: GLiNER-biomed achieves state-of-the-art zero-shot and few-shot performance in biomedical entity recognition tasks by leveraging synthetic annotations.
đ Documentation
The model was presented in the paper GLiNER-biomed: A Suite of Efficient Models for Open Biomedical Named Entity Recognition.
The code is available at https://github.com/ds4dh/GLiNER-biomed.
Benchmarking
We examined our models on 8 complex real-world datasets and compared them with other GLiNER models.
Property |
Details |
Model Type |
Named Entity Recognition (NER) |
Base Model |
microsoft/deberta-v3-base, BAAI/bge-base-en-v1.5 |
Datasets |
knowledgator/GLINER-multi-task-synthetic-data, knowledgator/biomed_NER |
Metrics |
f1 |
đ License
This project is licensed under the Apache-2.0 license.
Join Our Discord
Connect with our community on Discord for news, support, and discussion about our models. Join Discord.
Citation
This work
If you use GLiNER-biomed models in your work, please cite:
@misc{yazdani2025glinerbiomedsuiteefficientmodels,
title={GLiNER-biomed: A Suite of Efficient Models for Open Biomedical Named Entity Recognition},
author={Anthony Yazdani and Ihor Stepanov and Douglas Teodoro},
year={2025},
eprint={2504.00676},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2504.00676},
}
Previous work
@misc{zaratiana2023gliner,
title={GLiNER: Generalist Model for Named Entity Recognition using Bidirectional Transformer},
author={Urchade Zaratiana and Nadi Tomeh and Pierre Holat and Thierry Charnois},
year={2023},
eprint={2311.08526},
archivePrefix={arXiv},
primaryClass={cs.CL}
}
@misc{stepanov2024gliner,
title={GLiNER multi-task: Generalist Lightweight Model for Various Information Extraction Tasks},
author={Ihor Stepanov and Mykhailo Shtopko},
year={2024},
eprint={2406.12925},
archivePrefix={arXiv},
primaryClass={id='cs.LG' full_name='Machine Learning' is_active=True alt_name=None in_archive='cs' is_general=False description='Papers on all aspects of machine learning research (supervised, unsupervised, reinforcement learning, bandit problems, and so on) including also robustness, explanation, fairness, and methodology. cs.LG is also an appropriate primary category for applications of machine learning methods.'}
}