🚀 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-base-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"])
期待される出力:
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
高度な使用法
大量のエンティティがあり、事前に埋め込みを行いたい場合は、以下のコードスニペットを参照してください。
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)
📚 ドキュメント
ベンチマーク
我々は、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.'}
}