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
Refresh v8 numbers w/ context tier (internal .691) + development-notes log
Browse files97 unmodified lines989910010110210310410510612 unmodified lines1191201211221231241251269 unmodified lines13613713813914014197 unmodified lines| MAPA | 0.488 | **0.492** | 0.421 | 0.408 || Nemotron* | 0.696 | **0.802** | 0.790 | **0.802** || AI4Privacy* | 0.429 | **0.677** | 0.624 | 0.673 || Internal | 0.590 | 0.584 | 0.596 | **0.641** || ShieldFlow | 0.798 | 0.803 | 0.810 | **0.829** || Internal exact-F1 | 0.367 | 0.330 | 0.353 | **0.429** |12 unmodified lines| 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 | β |9 unmodified lines## 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 public97 unmodified lines989910010110210310410510612 unmodified lines1191201211221231241251269 unmodified lines13613713813914014114214314414514614714814915015115215315415515697 unmodified lines| MAPA | 0.488 | **0.492** | 0.421 | 0.408 || Nemotron* | 0.696 | **0.802** | 0.790 | **0.802** || AI4Privacy* | 0.429 | **0.677** | 0.624 | 0.673 || Internal | 0.590 | 0.584 | 0.596 | **0.691** || ShieldFlow | 0.798 | 0.803 | 0.810 | **0.829** || Internal exact-F1 | 0.367 | 0.330 | 0.353 | **0.461** |12 unmodified lines| Model | Internal | SPY | TAB | Gretel | MAPA | Nemotron* | AI4Privacy* | ShieldFlow ||---|---|---|---|---|---|---|---|---|| **v8 (ours, published)** | 0.691 | 0.355 | 0.751 | 0.833 | 0.408 | 0.802 | 0.673 | 0.829 || **Ours β best candidate (v4βv8)** | 0.691 | 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 | β |9 unmodified lines## Development notes β recall-lever explorationSeveral retrains probed the remaining recall gaps. None beat the published model, but theymap the tradeoff precisely (kept here for transparency):- **v9** (brute-force ID-frequency data): IDs stayed ~0 recall β structure-less alphanumeric IDsaren't learnable from more data β and person_name regressed.- **v10** (mild class-weighting + Group-B data diversity): lifted under-detected-type recall a lot(MAPA 0.53, TAB 0.83, date_of_birth/phone/address recall up sharply) **but crashed person_name to 0.26**.- **v11** (same data, class-weighting OFF): person_name partly recovered, but the recall gains vanished.**Conclusion:** a global class-weight trades rare-type recall directly against the dominantperson_name β not a net win. The shipped improvement is instead the **inference-side context-cuedID layer**, which fixes the zero-recall IDs without that tradeoff. Closing the remaining Group-Brecall gap needs per-type calibration, not another retrain.## 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+19-4