Token Classification
GLiNER2
ONNX
GLiNER
pii
ner
privacy
redaction
information-extraction
span-extraction
Instructions to use yethdev/gliner2-pii-onnx with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- GLiNER2
How to use yethdev/gliner2-pii-onnx with GLiNER2:
from gliner2 import GLiNER2 model = GLiNER2.from_pretrained("yethdev/gliner2-pii-onnx") # Extract entities text = "Apple CEO Tim Cook announced iPhone 15 in Cupertino yesterday." result = extractor.extract_entities(text, ["company", "person", "product", "location"]) print(result) - GLiNER
How to use yethdev/gliner2-pii-onnx with GLiNER:
from gliner import GLiNER model = GLiNER.from_pretrained("yethdev/gliner2-pii-onnx") - Notebooks
- Google Colab
- Kaggle
| license: apache-2.0 | |
| library_name: gliner2 | |
| base_model: fastino/gliner2-privacy-filter-PII-multi | |
| datasets: | |
| - synthetic | |
| language: | |
| - en | |
| - fr | |
| - es | |
| - de | |
| - it | |
| - pt | |
| - nl | |
| pipeline_tag: token-classification | |
| tags: | |
| - onnx | |
| - pii | |
| - ner | |
| - privacy | |
| - redaction | |
| - gliner | |
| - gliner2 | |
| - information-extraction | |
| - span-extraction | |
| # GLiNER2-PII ONNX | |
| This model is meant for use within the Redacta chrome extension, and this ONNX export was specifically meant for browser use, removing dependencies and preserving behavior. | |
| GLINER2-PII ONNX is 2.75x smaller than the original GLINER2-PII with nearing performance. | |
| ## Benchmark Results (SPY) | |
| Evaluated on the [SPY benchmark](https://aclanthology.org/2025.naacl-srw.23/) (Savkin et al., 2025) with exact-match span-level metrics: | |
| | Model | Legal P | Legal R | Legal F1 | Medical P | Medical R | Medical F1 | **Avg F1** | | |
| |---|:---:|:---:|:---:|:---:|:---:|:---:|:---:| | |
| | **yethdev/gliner2-pii-onnx** | .383 | **.861** | **.530** | .396 | **.846** | **.539** | **.535** | | |
| | fastino/gliner2-pii-v1 | .346 | .750 | .473 | .369 | .686 | .480 | .477 | | |
| | nvidia/gliner-PII | .343 | .452 | .390 | .368 | .465 | .411 | .400 | | |
| | urchade/gliner\_multi\_pii-v1 | **.467** | .317 | .377 | **.518** | .351 | .419 | .398 | | |
| | openai/privacy-filter | .242 | .656 | .354 | .287 | .692 | .406 | .380 | | |
| Setup for the yethdev/gliner2-pii-onnx row: full splits (4,197 legal questions, 4,491 medical consultations), entities materialized with `faker_random_seed=42`, micro-averaged exact character-level span match on the model's raw span output (no text-level deduplication). The model was queried with the labels `email`, `id number`, `name`, `phone number`, `address`, `url`, `username` mapped 1:1 to SPY categories, at confidence threshold 0.3; label phrasing and threshold were selected on a held-out 5% development sample. Inference ran the released `model.quantized.onnx` via onnxruntime (CPU), which matches the PyTorch engine's span sets on text up to 2,900 subwords with max confidence drift under 0.03. | |
| ## License & attribution | |
| Apache-2.0 - All model weights are derived from | |
| [fastino/gliner2-privacy-filter-PII-multi](https://huggingface.co/fastino/gliner2-privacy-filter-PII-multi) | |
| by Fastino Labs. |