🚀 GLiNER-BioMed
GLiNERは、双方向トランスフォーマーエンコーダ(BERTのような)を使用して、任意のエンティティタイプを識別できる固有表現抽出(NER)モデルです。これは、事前定義されたエンティティに限定される従来のNERモデルや、柔軟性はあるもののリソース制約のあるシナリオではコストが高く大規模な大規模言語モデル(LLM)に代わる実用的な選択肢を提供します。
GLiNER-biomedは、ジュネーブ大学のDS4DHと共同開発され、GLiNERフレームワークに基づく効率的なオープンな生物医学NERモデルの専用セットを導入しています。GLiNER-biomedは、大規模な生成型生物医学言語モデルから抽出された合成アノテーションを活用し、生物医学エンティティ認識タスクにおいて最先端のゼロショットおよびフューショット性能を達成します。
🚀 クイックスタート
このセクションでは、GLiNER-BioMedモデルの基本的な使い方を説明します。
✨ 主な機能
- 双方向トランスフォーマーエンコーダを使用して、任意のエンティティタイプを識別できます。
- 大規模な生成型生物医学言語モデルから抽出された合成アノテーションを活用し、ゼロショットおよびフューショット性能を向上させます。
📦 インストール
公式のGLiNERライブラリをpipでインストールします。
pip install gliner -U
💻 使用例
基本的な使用法
GLiNERライブラリをインストールした後、GLiNER-biomedモデルを簡単にロードして固有表現抽出を行うことができます。
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"])
高度な使用法
大量のエンティティがあり、事前に埋め込みを行いたい場合は、以下のコードスニペットを参照してください。
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)
📚 ドキュメント
このモデルは論文GLiNER-biomed: A Suite of Efficient Models for Open Biomedical Named Entity Recognitionで発表されました。コードはhttps://github.com/ds4dh/GLiNER-biomedで入手できます。
ベンチマーク
私たちは、8つの複雑な実世界のデータセットでモデルを検証し、他のGLiNERモデルと比較しました。
Discordへの参加
モデルに関するニュース、サポート、および議論のために、Discordで私たちのコミュニティに参加してください。Discordに参加しましょう。
📄 ライセンス
このプロジェクトはApache-2.0ライセンスの下で提供されています。
引用
この研究
もしあなたの研究でGLiNER-biomedモデルを使用した場合は、以下を引用してください。
@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},
}
過去の研究
@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.'}
}