๐ GLiNER-ko Model Card
GLiNER is a Named Entity Recognition (NER) model. It uses a bidirectional transformer encoder (similar to BERT) to identify any entity type. This offers a practical alternative to traditional NER models, which are restricted to predefined entities, and Large Language Models (LLMs). LLMs are flexible but costly and large, making them unsuitable for resource - constrained scenarios.
This version is trained on the various Korean NER dataset (for research purposes). Commercially - permitted versions are available, including urchade/gliner_smallv2, urchade/gliner_mediumv2, and urchade/gliner_largev2.
๐ Quick Start
GLiNER is a powerful tool for Named Entity Recognition. It can identify various entity types, providing a great solution for NER tasks.
โจ Features
- Capable of identifying any entity type using a bidirectional transformer encoder.
- A practical alternative to traditional NER models and LLMs in resource - constrained scenarios.
- Different versions are available for both research and commercial use.
๐ฆ Installation
To use this model, you must install the Korean fork of GLiNER Python library and mecab - ko:
!pip install gliner
!pip install python-mecab-ko
๐ป Usage Examples
Basic Usage
Once you've downloaded the GLiNER library, you can import the GLiNER class. You can then load this model using GLiNER.from_pretrained
and predict entities with predict_entities
.
from gliner import GLiNER
model = GLiNER.from_pretrained("taeminlee/gliner_ko")
text = """
ํผํฐ ์ญ์จ ๊ฒฝ(, 1961๋
10์ 31์ผ ~ )์ ๋ด์ง๋๋์ ์ํ ๊ฐ๋
, ๊ฐ๋ณธ๊ฐ, ์ํ ํ๋ก๋์์ด๋ค. J. R. R. ํจํจ์ ์์ค์ ์์์ผ๋ก ํ ใ๋ฐ์ง์ ์ ์ ์ํ 3๋ถ์ใ(2001๋
~2003๋
)์ ๊ฐ๋
์ผ๋ก ๊ฐ์ฅ ์ ๋ช
ํ๋ค. 2005๋
์๋ 1933๋
์ ํน์ฝฉ์ ๋ฆฌ๋ฉ์ดํฌ์ ใํน์ฝฉ(2005)ใ์ ๊ฐ๋
์ ๋งก์๋ค.
"""
tta_labels = ["ARTIFACTS", "ANIMAL", "CIVILIZATION", "DATE", "EVENT", "STUDY_FIELD", "LOCATION", "MATERIAL", "ORGANIZATION", "PERSON", "PLANT", "QUANTITY", "TIME", "TERM", "THEORY"]
entities = model.predict_entities(text, labels)
for entity in entities:
print(entity["text"], "=>", entity["label"])
ํผํฐ ์ญ์จ ๊ฒฝ => PERSON
1961๋
10์ 31์ผ ~ => DATE
๋ด์ง๋๋ => LOCATION
์ํ ๊ฐ๋
=> CIVILIZATION
๊ฐ๋ณธ๊ฐ => CIVILIZATION
์ํ => CIVILIZATION
ํ๋ก๋์ => CIVILIZATION
J. R. R. ํจํจ => PERSON
3๋ถ์ => QUANTITY
2001๋
~2003๋
=> DATE
๊ฐ๋
=> CIVILIZATION
2005๋
=> DATE
1933๋
์ => DATE
ํน์ฝฉ => ARTIFACTS
ํน์ฝฉ => ARTIFACTS
2005 => DATE
๊ฐ๋
=> CIVILIZATION
๐ Documentation
Links
- Paper: https://arxiv.org/abs/2311.08526
- Repository: https://github.com/urchade/GLiNER
Named Entity Recognition benchmark result
Evaluate with the konne dev set
Property |
Details |
Model Type |
GLiNER-ko is a Named Entity Recognition model using a bidirectional transformer encoder. |
Training Data |
Trained on the various Korean NER dataset (Research purpose). Commercially permission versions are available. |
Model |
Precision (P) |
Recall (R) |
F1 |
Gliner-ko (t = 0.5) |
72.51% |
79.82% |
75.99% |
Gliner Large - v2 (t = 0.5) |
34.33% |
19.50% |
24.87% |
Gliner Multi (t = 0.5) |
40.94% |
34.18% |
37.26% |
Pororo |
70.25% |
57.94% |
63.50% |
๐ง Technical Details
GLiNER uses a bidirectional transformer encoder (BERT - like) to identify any entity type. It provides a practical alternative to traditional NER models and LLMs, especially in resource - constrained scenarios.
๐ License
The model is licensed under cc - by - nc - 4.0.
Model Authors
The model authors are:
Citation
@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}
}