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 all-candidate-models comparison table + plot
Browse files69 unmodified lines70717273747569 unmodified lines> **Decode upgrade (same weights):** the hybrid decode now adds Latin word-boundary snapping (fixes leading sub-token drops like `Ibuprofen`→`profen`) and precision guards (SWIFT/BIC requires a digit or cue; drops <3-char fragments). Net vs the prior decode: internal exact-F1 0.361→**0.429**, ShieldFlow proxy 0.812→**0.829**, all public sets flat-to-up, zero regressions.## 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 public69 unmodified lines70717273747576777879808182838485868788899091929394959697989910010110210310469 unmodified lines> **Decode upgrade (same weights):** the hybrid decode now adds Latin word-boundary snapping (fixes leading sub-token drops like `Ibuprofen`→`profen`) and precision guards (SWIFT/BIC requires a digit or cue; drops <3-char fragments). Net vs the prior decode: internal exact-F1 0.361→**0.429**, ShieldFlow proxy 0.812→**0.829**, all public sets flat-to-up, zero regressions.## Candidate model comparison — all benchmarksEvery candidate checkpoint from development, across all benchmarks, **best decode permodel** (token classifier or +hybrid regex layer). v8 (published) uses the upgraded decode(boundary-snap + precision guards). *Nemotron/AI4Privacy are contaminated — public leaderstrained in-distribution on those corpora (specialist ceilings ≈0.918/0.946). Internal =held-out 40-type/33-language eval (partial-F1, realistic subset). ShieldFlow = product proxygate (base split). Internal exact-F1 = strict-boundary match.*| Benchmark | v4 | v6 | v7 | **v8 (current)** ||---|---|---|---|---|| SPY | **0.426** | 0.373 | 0.378 | 0.355 || TAB | **0.819** | 0.679 | 0.786 | 0.751 || Gretel | 0.816 | **0.839** | 0.822 | 0.833 || 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** |No single checkpoint dominates every benchmark — this is a genuine multi-objective frontier:**v8** leads the product-critical signals (Internal, ShieldFlow) and exact-boundary F1;**v4** still leads several clean academic sets (SPY, TAB, MAPA); **v6** leads Gretel/AI4Privacy.v8 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 public
README.md+29