Token Classification
Transformers
Safetensors
lfm2
liquid
lfm2.5
bidirectional
masked-lm
encoder
pii
ner
privacy
multilingual
custom_code
Run this model with HF Jobs
Run LiquidAI/LFM2.5-Encoder-350M-PII-Detector on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/LiquidAI/LFM2.5-Encoder-350M-PII-Detector. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/LiquidAI/LFM2.5-Encoder-350M-PII-Detector on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use LiquidAI/LFM2.5-Encoder-350M-PII-Detector with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use LiquidAI/LFM2.5-Encoder-350M-PII-Detector with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="LiquidAI/LFM2.5-Encoder-350M-PII-Detector", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForTokenClassification tokenizer = AutoTokenizer.from_pretrained("LiquidAI/LFM2.5-Encoder-350M-PII-Detector", trust_remote_code=True) model = AutoModelForTokenClassification.from_pretrained("LiquidAI/LFM2.5-Encoder-350M-PII-Detector", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Add external-model comparison (GLiNER, Piiranha, OpenMed, OpenAI-PF, LFM demo) + plot
Browse files98 unmodified lines9910010110210310498 unmodified linesv8 is published as the best balance for real-world deployment (it also covers 40 PII types vsv4's 32). A recall-focused retrain (v9) is in progress and this section will be updated when it lands.## Schema & training40 canonical `domain.type` labels, BIOES (161 classes). Trained on multilingual syntheticdata (gemma-generated, exact char-span labels, PII-vs-NER decoy regime) + the public98 unmodified lines9910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913098 unmodified linesv8 is published as the best balance for real-world deployment (it also covers 40 PII types vsv4's 32). A recall-focused retrain (v9) is in progress and this section will be updated when it lands.### vs. external models (same current eval sets)All scored in our harness on the **current** eval sets (best decode per model). *Nemotron &AI4Privacy are contaminated for the vendors that lead them (Piiranha trained on AI4Privacy;OpenMed on Nemotron). LFM demo (q4) uses ShieldFlow's native taxonomy, so it is compared onlyon the ShieldFlow gate (its home turf), not on our 40-type schema.*| Model | Internal | SPY | TAB | Gretel | MAPA | Nemotron* | AI4Privacy* | ShieldFlow ||---|---|---|---|---|---|---|---|---|| **v8 (ours, published)** | 0.641 | 0.355 | 0.751 | 0.833 | 0.408 | 0.802 | 0.673 | 0.829 || **Ours β best candidate (v4βv8)** | 0.641 | 0.426 | 0.819 | 0.839 | 0.492 | 0.802 | 0.677 | 0.829 || GLiNER multi-pii | 0.736 | 0.213 | 0.447 | 0.728 | 0.489 | 0.713 | 0.492 | β || Piiranha | 0.490 | 0.248 | 0.262 | 0.552 | 0.262 | 0.672 | 0.949 | β || OpenMed-Nemotron | 0.508 | 0.244 | 0.672 | 0.774 | 0.113 | 0.923 | 0.419 | β || OpenAI privacy-filter | 0.473 | 0.275 | 0.543 | 0.458 | 0.249 | 0.583 | 0.380 | β || regex baseline | 0.342 | 0.370 | 0.000 | 0.340 | 0.000 | 0.347 | 0.214 | β || LFM demo (q4) | β | β | β | β | β | β | β | 0.878 |**Reading it:** our best candidate **leads all four clean public benchmarks** (SPY, TAB, Gretel,MAPA); the published **v8 leads TAB & Gretel** outright vs every external model and is the clear**#2 generalist on the held-out internal eval** (0.641) behind **GLiNER (0.736)** β ahead of everyother production model (OpenMed 0.508, Piiranha 0.490, OpenAI-PF 0.473). On the two *contaminated*sets and the **ShieldFlow** gate, v8 is #2 behind the in-distribution specialist / incumbent.## Schema & training40 canonical `domain.type` labels, BIOES (161 classes). Trained on multilingual syntheticdata (gemma-generated, exact char-span labels, PII-vs-NER decoy regime) + the public
README.md+26