Technology · Agentic → Guardrails · Open Source · wiki:deep
GLiNER (Generalist and Lightweight Model for Named Entity Recognition) is a zero-shot / open-type NER framework: a bidirectional transformer matches natural-language entity type labels to text spans in latent space, instead of generating entities with a large LLM. Install with pip install gliner; models live on Hugging Face (Apache-2.0 from v2 onward; early v0/v1 weights were CC-BY-NC). The library now covers uni-encoder, bi-encoder (many labels), RelEx (entities + relations), decoder/open NER, streaming NER, and dedicated PII model lines. It is a detector, not a full anonymization product — pair with Presidio, MaskPipe, NeMo Anonymizer, or your own operators.
Presidio’s default spaCy NER is fixed-schema and language-model heavy. GLiNER lets an install declare PII and domain labels in plain English (person, iban, project address, estimator name) and run CPU-friendly inference competitive with much larger LLMs on zero-shot NER benchmarks. That is the right shape for observe → redact before RAG/LLM/logs when entity types drift per tenant. Use it as the NER backend under Presidio-style pipelines or Databricks dbxredact-style unions — not as policy authority.
Labels and text are encoded (uni-encoder jointly, or bi-encoder with cached label embeddings). A span representation layer scores each candidate span against each label (dot product + sigmoid). Parallel span matching avoids autoregressive decoding. For PII, load a PII-tuned checkpoint (e.g. community multi-PII or nvidia/gliner-PII) and pass the entity vocabulary you care about; thresholds filter scores. Downstream tools map spans into Presidio RecognizerResults or spaCy docs for masking.
pip install gliner and load GLiNER.from_pretrained(…). predict_entities(text, labels, threshold=…). Related: presidio · llm-guard · guardrails-ai · nemo-guardrails
Claims below are backed by science sources on disk.
Architecture / zero-shot claims
GLiNER founding paper (arXiv / NAACL) · STRONG
“In this paper, we introduce a compact NER model trained to identify any type of entity. Leveraging a bidirectional transformer encoder, our model, GLiNER, facilitates parallel entity extraction, an advantage over the slow sequential token generation of LLMs.”
Framework / PII product framing
urchade/GLiNER README · STRONG
“GLiNER is a framework for training and deploying small Named Entity Recognition (NER) models with zero-shot capabilities. In addition to traditional NER, it supports incremental streaming NER, joint entity and relation extraction, and multi-task token classification.”
Pairing with Presidio stacks
Presidio as anonymizer peer (contrast) · MODERATE
“It provides fast identification and anonymization modules for private entities in text and images.”
9 tags · 40 out · 41 in · 3 artifacts · 0 gaps · 0 corpus docs