Skip to main content

Pretrained Models

This page provides detailed information about pre-trained GLiNER models developed by Knowledgator.

Bi-Encoder Models

NameEncoderLabels EncoderSize (MB)Zero-Shot F1 Score
modern-gliner-bi-large-v1.0ModernBERT-largebge-base-en-v1.521200.598
modern-gliner-bi-base-v1.0ModernBERT-basebge-small-en-v1.58300.594
gliner-bi-llama-v1.0Sheared-LLaMA-encoder-1.3Bbge-small-en-v1.554400.589
gliner-bi-large-v1.0deberta-v3-largebge-base-en-v1.522800.567
gliner-bi-base-v1.0deberta-v3-basebge-small-en-v1.59690.563
gliner-poly-small-v1.0deberta-v3-smallbge-small-en-v1.58320.557
gliner-bi-small-v1.0deberta-v3-smallall-MiniLM-L6-v27570.546

Basic Usage

from gliner import GLiNER

model = GLiNER.from_pretrained("knowledgator/modern-gliner-bi-base-v1.0")

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.3)

for entity in entities:
print(entity["text"], "=>", entity["label"])
Expected Output
Cristiano Ronaldo dos Santos Aveiro => person
5 February 1985 => date
Al Nassr => teams
Portugal national team => teams
Ballon d'Or => award
UEFA Men's Player of the Year Awards => award
European Golden Shoes => award
UEFA Champions Leagues => competitions
UEFA European Championship => competitions
UEFA Nations League => competitions
Champions League => competitions
European Championship => competitions

Pre-compute Labels Embeddings

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"]

entity_embeddings = model.encode_labels(labels, batch_size = 8)

output = model.batch_predict_with_embeds([text], entity_embeddings, labels)
for entities in output:
for entity in entities:
print(entity["text"], "=>", entity["label"])
Expected Output
Encoding labels: 100%|██████████| 1/1 [00:00<00:00,  2.51it/s]
Cristiano Ronaldo dos Santos Aveiro => person
5 February 1985 => date
Ballon d'Or => award
UEFA Men's Player of the Year Awards => award
European Golden Shoes => award
UEFA Champions Leagues => competitions
UEFA European Championship => competitions
UEFA Nations League => competitions

GLiNER-BioMed

GLiNER-biomed developed in collaboration with DS4DH from the University of Geneva, introduces a specialized suite of efficient open biomedical NER models based on the GLiNER framework. GLiNER-biomed leverages synthetic annotations distilled from large generative biomedical language models to achieve state-of-the-art zero-shot and few-shot performance in biomedical entity recognition tasks.

NameEncoderLabels EncoderSize MBZero-Shot F1 Score
gliner-biomed-large-v1.0deberta-v3-large-7810.5977
gliner-biomed-bi-base-v1.0deberta-v3-basebge-small-en-v1.59690.5831
gliner-biomed-bi-small-v1.0deberta-v3-smallall-MiniLM-L6-v27570.5693
gliner-biomed-bi-large-v1.0deberta-v3-largebge-base-en-v1.523340.549
gliner-biomed-base-v1.0deberta-v3-base-7810.5437
gliner-biomed-small-v1.0deberta-v3-small-6110.5253

Basic Usage

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"])

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

Pre-compute Labels Embeddings

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"]

entity_embeddings = model.encode_labels(labels, batch_size = 8)

output = model.batch_predict_with_embeds([text], entity_embeddings, labels)
for entities in output:
for entity in entities:
print(entity["text"], "=>", entity["label"])
Expected Output
Encoding labels: 100%|██████████| 1/1 [00:00<00:00,  2.51it/s]
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

GLiNER-X (Multilingual)

GLiNER-X is a multilingual Named Entity Recognition model that supports 20+ languages including Swedish, Norwegian, Czech, Polish, Lithuanian, Estonian, Latvian, Spanish, Finnish, English, German, French, Romanian, Italian, Portuguese, Dutch, Ukrainian, Hindi, Chinese, and Arabic. Built on the MT5 encoder architecture, GLiNER-X provides flexible zero-shot entity detection across diverse languages, making it ideal for multilingual applications and international deployments.

NameEncoderLanguagesSize (MB)Avg F1 Score
gliner-x-largegoogle/mt5-large2012000.8
gliner-x-basegoogle/mt5-base205800.76
gliner-x-smallgoogle/mt5-small203000.72

Basic Usage

from gliner import GLiNER

model = GLiNER.from_pretrained("knowledgator/gliner-x-large")

text = """
Cristiano Ronaldo dos Santos Aveiro was born on 5 February 1985 in Portugal.
He plays for Al Nassr and has won five Ballon d'Or awards.
"""

labels = ["person", "award", "date", "teams", "location"]

entities = model.predict_entities(text, labels, threshold=0.5)

for entity in entities:
print(entity["text"], "=>", entity["label"])
Expected Output
Cristiano Ronaldo dos Santos Aveiro => person
5 February 1985 => date
Portugal => location
Al Nassr => teams
Ballon d'Or => award

GLiNER-PII (Privacy & Security)

GLiNER-PII is a production-grade model designed specifically for detecting Personally Identifiable Information (PII), Protected Health Information (PHI), and Payment Card Industry (PCI) data. With support for 60+ predefined categories including names, contact information, financial data, healthcare records, and identification numbers, GLiNER-PII enables privacy-first processing with local inference, eliminating the need for external API calls. It's optimized for compliance with HIPAA, PCI-DSS, and GDPR requirements.

NameEncoderSize (MB)Precision (%)Recall (%)F1 Score (%)
gliner-pii-large-v1.0deberta-v3-large134087.4279.483.25
gliner-pii-base-v1.0deberta-v3-base43579.2882.7880.99
gliner-pii-small-v1.0deberta-v3-small18478.9974.876.84
gliner-pii-edge-v1.0deberta-v3-xsmall7178.9672.3475.5

Basic Usage

from gliner import GLiNER

model = GLiNER.from_pretrained("knowledgator/gliner-pii-large-v1.0")

text = """
John Smith called from 415-555-1234 to discuss his account number 12345678.
His email is john.smith@example.com and SSN is 123-45-6789.
"""

labels = ["name", "phone number", "account number", "email address", "ssn"]

entities = model.predict_entities(text, labels, threshold=0.3)

for entity in entities:
print(f"{entity['text']} => {entity['label']} (confidence: {entity['score']:.2f})")
Expected Output
John Smith => name (confidence: 0.95)
415-555-1234 => phone number (confidence: 0.92)
12345678 => account number (confidence: 0.88)
john.smith@example.com => email address (confidence: 0.94)
123-45-6789 => ssn (confidence: 0.91)

60+ Supported PII Categories

  • Personal Identifiers: name, first name, last name, dob, age, gender, marital status
  • Contact Info: email address, phone number, ip address, url, location address, location city, location state, location zip
  • Financial: account number, bank account, routing number, credit card, credit card expiration, cvv, ssn, money
  • Healthcare: condition, medical process, drug, dose, blood type, injury, healthcare number, medical code
  • Identification: passport number, driver license, username, password, vehicle id

GLiNER-bi-V2 (High-Scale Bi-Encoder)

GLiNER-bi-V2 introduces a bi-encoder architecture that dramatically improves scalability for zero-shot NER tasks. Unlike traditional uni-encoder models, the bi-encoder separately processes text and entity types, enabling recognition of 1000+ entity types simultaneously with minimal performance degradation. GLiNER-bi-V2 is 130× faster than uni-encoder approaches at scale and supports pre-computed entity embeddings for instant reuse across millions of documents, making it ideal for enterprise applications with large taxonomies.

NameEncoderLabels EncoderSize (MB)CrossNER Avg F1Speed (ex/s)
gliner-bi-large-v2.0ettin-encoder-400mbge-base-en-v1.55300.6152.68
gliner-bi-base-v2.0ettin-encoder-100mbge-base-en-v1.51940.6035.91
gliner-bi-small-v2.0deberta-v3-smallbge-small-en-v1.51080.5727.99
gliner-bi-edge-v2.0deberta-v3-xsmallbge-small-en-v1.5600.5413.64

Basic Usage

from gliner import GLiNER

model = GLiNER.from_pretrained("knowledgator/gliner-bi-large-v2.0")

text = """
Cristiano Ronaldo dos Santos Aveiro (Portuguese pronunciation: [kɾiʃˈtjɐnu ʁɔˈnaldu];
born 5 February 1985) is a Portuguese professional footballer who plays for Al Nassr
and the Portugal national team.
"""

labels = ["person", "award", "date", "teams"]

entities = model.predict_entities(text, labels, threshold=0.3)

for entity in entities:
print(entity["text"], "=>", entity["label"])
Expected Output
Cristiano Ronaldo dos Santos Aveiro => person
5 February 1985 => date
Al Nassr => teams
Portugal national team => teams

Advanced: Pre-computed Entity Embeddings

For maximum performance when processing large document collections with consistent entity types:

from gliner import GLiNER

model = GLiNER.from_pretrained("knowledgator/gliner-bi-large-v2.0")

# Pre-compute embeddings once for thousands of entity types
labels = ["person", "organization", "location", "date", "award", "teams"]
entity_embeddings = model.encode_labels(labels, batch_size=8)

# Reuse pre-computed embeddings for fast batch inference
texts = [text1, text2, text3, ...] # Your document collection
outputs = model.batch_predict_with_embeds(texts, entity_embeddings, labels)

for entities in outputs:
for entity in entities:
print(entity["text"], "=>", entity["label"])

Key Performance Advantages

  • Massive Scalability: Handle 1000+ entity types with near-constant inference speed
  • 130× Faster: Compared to uni-encoder at 1024 entity types
  • Pre-computed Embeddings: Cache entity embeddings for instant reuse
  • Minimal Degradation: Only 5.2% slowdown from 1→1024 labels (vs. 98.7% for uni-encoders)