/ Модель

Характеристики

Лицензия
Apache 2.0
Библиотека
gliner
Опубликована
29 сен 2026

gliner-gbai

Разметка токеновТекст → label

Дообученная GLiNER для извлечения медицинских сущностей и персональных данных из испанских и английских текстов, таблиц, писем и форм.

35скачиваний за 30 дней0лайковвеса обновлены2 окт 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

GLiNER — специализированная модель извлечения сущностей, дообученная для работы с медицинскими данными и персональной информацией на испанском и английском языках. Она находит 15 типов сущностей, включая заболевания и симптомы, имена, возраст, контакты, идентификаторы, даты, адреса и сведения о профессии, финансах и демографии.

Модель предназначена для извлечения сущностей в связном тексте, переписке, таблицах с разделителями, заголовках электронной почты и административных формах электронных медицинских карт. README сообщает о поддержке zero-shot и few-shot сценариев и приводит результаты оценки на собственном тестовом наборе и медицинских бенчмарках; эти показатели относятся к заявленным в карточке испытаниям и не гарантируют аналогичное качество на других данных. Репозиторий содержит версии PyTorch и ONNX, а также описание выборочной динамической INT8-квантизации. Лицензия — Apache-2.0.

Сценарии применения

  • поиск диагнозов и симптомов в клинических записях
  • извлечение персональных данных из писем и документов
  • обнаружение идентификаторов, телефонов и адресов в медицинских формах
  • извлечение сущностей из табличных и полуформатированных данных

Ограничения

Заявленные метрики получены на конкретных тестовых наборах и могут не переноситься на другие документы и домены. Модель предназначена для извлечения перечисленных в карточке типов сущностей; полнота распознавания вне этой таксономии не подтверждена.

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

Multimodal Bilingual GLiNER (ES/EN): Healthcare & Privacy (PII) Entity Extraction

Fine-tuned GLiNER (Generalist and Lightweight Model for Named Entity Recognition) specialized in simultaneous zero-shot / few-shot extraction of Personally Identifiable Information (14 PII categories) and medical conditions / diagnoses (health condition) across both Spanish and English.

This model is structurally invariant: it operates with high accuracy across continuous conversational prose, pipe-delimited tables (|), MIME email headers (From/To/Subject/Date), and clinical EHR administrative admission forms.


🌟 Key Highlights

  • Structural Invariance: Fine-tuned on diverse multimodal layouts (tables, emails, administrative files, clinical EHR headers, and conversational prose), reaching 99.1% $F_1$ on semi-structured & tabular data.
  • Zero Catastrophic Forgetting: Maintains 89.4% Micro $F_1$ on continuous conversational prose (CAPID-ES test set).
  • Native Healthcare & Medical Detection: Outperforms general privacy models (e.g., OpenMed v2), achieving 97.7% $F_1$ on health conditions and clinical symptoms, and 76.5% containment $F_1$ on complex biomedical pathologies in the official DisTEMIST benchmark.
  • Hospital EHR Generalization (MEDDOCAN): Achieves 93.4% Recall on administrative headers and 83.3% Recall overall on real hospital discharge summaries from the PlanTL / BSC benchmark.
  • Selective Mixed-Precision INT8 Support: Supports selective dynamic quantization of Attention and FFN MatMuls (72 linear layers) with 100.0% prediction parity and 0.0000 average score error compared to FP32, eliminating the logit collapse of full INT8.
  • Canonical 1:1 Label Taxonomy: Uses 15 clean, mutually disjoint entity labels that prevent cross-encoder attention dilution and lexical competition between near-synonyms.

🏷️ Canonical 15-Entity Taxonomy

  1. health condition — Diagnoses, diseases, symptoms, medical pathologies, disabilities.
  2. person name — Full names, first names, and surnames of individuals.
  3. age — Numerical ages and age groups.
  4. family relation — Kinship and family relationships (spouse, child, parent, sibling).
  5. organization — Hospitals, clinics, companies, institutions, universities.
  6. location — Addresses, cities, provinces, countries, geographic entities.
  7. date or time — Calendar dates, admission timestamps, schedules.
  8. identification code — National IDs (DNI, NIE, SSN), medical record numbers (NHC/MRN), emails, phone numbers.
  9. job title — Medical specialties, professions, job positions.
  10. financial amount — Monetary amounts, salaries, compensations, fees, pensions.
  11. academic qualification — University degrees, certificates, academic titles.
  12. demographic group — Nationality, ethnic origin, citizenship.
  13. physical appearance — Physical characteristics (eye color, height, weight).
  14. religious or political belief — Religious faiths, political affiliations.
  15. sexual orientation — Sexual orientation and gender identity.

📊 Comprehensive Test Set Evaluation (4,227 Ground Truth Entities)

Evaluated on the 400-document held-out multimodal test suite:

Evaluation SubsetDocsGT EntitiesPrecisionRecallMicro $F_1$Macro $F_1$
Semi-Structured & Tabular Held-Out2003,07399.12%99.22%99.17%99.24%
Conversational Continuous Prose (CAPID-ES)2001,15488.19%90.55%89.35%89.06%
TOTAL UNIFIED TEST BENCHMARK4004,22796.08%96.85%96.47%95.74%

Breakdown by Data Layout Family

Layout FamilyTest DocsGT EntitiesPrecisionRecall$F_1$-Score
Administrative & Identity Dossiers4064099.84%99.69%99.77%
Referral & Consultation Orders4052099.62%99.81%99.71%
Clinical EHR Hospital Headers4058599.66%99.32%99.49%
MIME Email Headers (De/Para/Fecha)4056098.93%99.29%99.11%
Pipe-Delimited Tables (|)4076897.92%98.31%98.12%

⚡ Selective Mixed-Precision INT8 / FP32 Quantization

Standard post-training quantization (PTQ) to INT8 collapses GLiNER's cross-encoder probabilities because quantizing the span boundary projectors (span_rep_layer) and prompt label embeddings (prompt_rep_layer) distorts the dot-product similarity matrix.

To solve this, this repository provides Selective Mixed-Precision Quantization:

  • INT8 Dynamic Quantization: Applied strictly to the 72 Attention MatMul and FFN MatMul layers of the Transformer encoder (>85% of FLOPs).
  • Pure FP32: Preserved for Span Extraction MLPs, Prompt Label Embeddings, Token Embeddings, and LayerNorms.

Empirical Validation on Multimodal Test Data

Quantization MethodQuantized LayersEntity RetentionPrediction ParityMean Score ErrorF1 Impact
FP32 (Original)024 / 24 (100%)100.0%0.0000Baseline
Full INT8 (Naive PTQ)All Linear Layers0 / 24 (0%)0.0%ExtremeLogits Collapsed
Selective INT8 (Ours)72 Attention + FFN24 / 24 (100%)100.0%0.00000.0% Loss

🚀 Quickstart Usage

Install gliner:

pip install gliner

Option A: Standard PyTorch Inference

from gliner import GLiNER

# 1. Load the model from Hugging Face
model = GLiNER.from_pretrained("angel-gitt/gliner-gbai")

# 2. Define the 15 canonical categories
labels = [
    "health condition", "person name", "age", "family relation",
    "organization", "location", "date or time", "identification code",
    "job title", "financial amount", "academic qualification",
    "demographic group", "physical appearance", "religious or political belief",
    "sexual orientation"
]

# 3. Example: Pipe-delimited tabular record
tabular_text = (
    "| ID Registro: 28-28-95185 | Paciente: Itziar Palacios Zabalza (44 años) "
    "| Diagnóstico: dilatación de la vía urinaria | Médico: Dra. Carvajal Marín "
    "| Hospital: Hospital Reina Sofía | Salario de Baja: 2.850 €/mes | Fecha: 14/05/2023 |"
)

entities = model.predict_entities(tabular_text, labels, threshold=0.25)
for ent in entities:
    print(f"[{ent['label'].upper()}] {ent['text']} (confianza: {ent['score']:.1%})")

Option B: Fast CPU Inference with Selective INT8 Quantization

from gliner import GLiNER
from quantize_selective import apply_selective_quantization

# 1. Load model onto CPU
model = GLiNER.from_pretrained("angel-gitt/gliner-gbai", map_location="cpu")

# 2. Apply selective INT8 quantization (Attention + FFN MatMuls only)
model = apply_selective_quantization(model)

# 3. Predict with 100% mathematical fidelity and zero threshold degradation
entities = model.predict_entities(tabular_text, labels, threshold=0.25)
for ent in entities:
    print(f"[{ent['label'].upper()}] {ent['text']} (confianza: {ent['score']:.1%})")

Option C: Blazing-Fast CPU Inference with ONNX Runtime (2.5x Speedup, 100% F1)

from gliner import GLiNER

# 1. Load the compiled ONNX model directly from Hugging Face
model = GLiNER.from_pretrained(
    "angel-gitt/gliner-gbai",
    load_onnx_model=True,
    onnx_model_file="model.onnx"
)

# 2. Ultra-fast CPU inference (~54ms/doc, 100% parity with PyTorch FP32)
entities = model.predict_entities(tabular_text, labels, threshold=0.25)
for ent in entities:
    print(f"[{ent['label'].upper()}] {ent['text']} (confianza: {ent['score']:.1%})")

📜 Citation & License

  • License: Apache-2.0
  • Architecture: GLiNER (mDeBERTa-v3-base backbone)
  • Developed by: Hiili AI Research / Universidad Carlos III de Madrid

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · gliner

Нельзя запустить

Модели GLiNER требуют отдельного рантайма.

Ревизия весов
a0ee0cf

0 моделей