VOOZH about

URL: https://huggingface.co/Ihor/gliner-multi-edu

⇱ Ihor/gliner-multi-edu · Hugging Face


👁 alt text

GLiNER is a Named Entity Recognition (NER) model capable of identifying any entity type using a bidirectional transformer encoders (BERT-like). It provides a practical alternative to traditional NER models, which are limited to predefined entities, and Large Language Models (LLMs) that, despite their flexibility, are costly and large for resource-constrained scenarios.

The initial GLiNER models were trained mainly on English data. Available multilingual models relied on existing multilingual NER datasets, but we prepared synthetical dataset knowledgator/gliner-multilingual-synthetic using LLM to annotate Fineweb-2 multilingual dataset. To enable broader language coverage, we replaced the DeBERTa backbone used in monolingual GLiNER models with MT5 encoders, improving performance and adaptability across diverse languages.

Key Advantages Over Previous GLiNER Models:

  • Enhanced performance and generalization capabilities
  • Supports , Swedish, Norwegian, Czech, Polish, Lithuanian, Estonian, Latvian, Spanish, Finnish, English, German, French, Romanian, Italian, Portuguese, Dutch, Ukrainian, Hindi, Chinese, Arabic languages.
  • 3 model size available.

Installation & Usage

Install or update the gliner package with all tokenizers that might be needed to process different languages:

pip install gliner[tokenizers] -U

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("knowledgator/gliner-x-large")
text = """
Cristiano Ronaldo dos Santos Aveiro (Portuguese pronunciation: [kɾiʃˈtjɐnu ʁɔˈnaldu]; born 5 February 1985) is a Portuguese professional footballer who plays as a forward for and captains both Saudi Pro League club Al Nassr and the Portugal national team. Widely regarded as one of the greatest players of all time, Ronaldo has won five Ballon d'Or awards,[note 3] a record three UEFA Men's Player of the Year Awards, and four European Golden Shoes, the most by a European player. He has won 33 trophies in his career, including seven league titles, five UEFA Champions Leagues, the UEFA European Championship and the UEFA Nations League. Ronaldo holds the records for most appearances (183), goals (140) and assists (42) in the Champions League, goals in the European Championship (14), international goals (128) and international appearances (205). He is one of the few players to have made over 1,200 professional career appearances, the most by an outfield player, and has scored over 850 official senior career goals for club and country, making him the top goalscorer of all time.
"""
labels = ["person", "award", "date", "competitions", "teams"]
entities = model.predict_entities(text, labels, threshold=0.5)
for entity in entities:
 print(entity["text"], "=>", entity["label"])
Cristiano Ronaldo dos Santos Aveiro => persona
5 de febrero de 1985 => fecha
Al Nassr de la Liga Profesional Saudí => equipos
selección nacional de Portugal => equipos
Balón de Oro => premio
Jugador del Año de la UEFA => premio
Botas de Oro europeas => premio
33 trofeos => premio
Ligas de Campeones de la UEFA => competiciones
Eurocopa => competiciones
Liga de Naciones de la UEFA => competiciones
Liga de Campeones => competiciones

Benchmarks

Below you can see the table with benchmarking results (F1 score) on various maltilingual named entity recognition datasets:

Dataset knowledgator/gliner-x-small knowledgator/gliner-x-base knowledgator/gliner-x-large urchade/gliner_multi-v2.1
da_ddt 0.7648 0.7635 0.8660 0.644
de_pud 0.7154 0.7597 0.7862 0.640
en_ewt 0.6597 0.6775 0.7549 0.573
en_pud 0.7399 0.7506 0.7858 0.628
pt_bosque 0.8273 0.8322 0.8782 0.739
pt_pud 0.7857 0.7854 0.8446 0.687
sv_pud 0.8033 0.8196 0.8638 0.682
zh_pud 0.5792 0.6152 0.6794 0.641

👁 alt text

Join Our Discord

Connect with our community on Discord for news, support, and discussion about our models. Join Discord.

Downloads last month
18

Datasets used to train Ihor/gliner-multi-edu