--- language: - en - es - sv - de - it - fr - nl - multilingual license: apache-2.0 base_model: jhu-clsp/mmBERT-base pipeline_tag: token-classification library_name: transformers tags: - pii - privacy - redaction - ner - secrets-detection - long-context - modernbert - onnx - commercial-safe - flintglass --- # Flintglass PrismRedact-Multilingual **Flintglass PrismRedact-Multilingual** is a **307M** 8K-context multilingual PII, PHI & developer-secret redaction model covering 1,800+ languages (`0.9584` Avg 4-Bench Redact F1, `0.8805` Strict 12-Entity Span F1, **`0.00%` zero-PII FPR** on `Nemotron-PII`, `DevSecrets`, AND `LongDoc-8K`!). Most popular open-source PII models on Hugging Face (`iiiorg/piiranha-v1`, `ai4privacy` fine-tunes) are **non-commercial (`CC-BY-NC` / `CC-BY-NC-ND`)**, **truncated at 512 tokens**, and suffer **47%–100% false-positive rates** on benign engineering logs. **`Flintglass PrismRedact`** solves all three: - **100% Commercial-Safe Apache 2.0** — trained exclusively on [`nvidia/Nemotron-PII`](https://huggingface.co/datasets/nvidia/Nemotron-PII) (`CC-BY-4.0`), [`gretelai/synthetic_pii_finance_multilingual`](https://huggingface.co/datasets/gretelai/synthetic_pii_finance_multilingual) (`Apache-2.0`), and Flintglass programmatic `DevSecrets` & `LongDoc-8K` ([`flintglass/PrismRedact-Corpus`](https://huggingface.co/datasets/flintglass/PrismRedact-Corpus)). **Zero `ai4privacy` non-commercial data.** - **Native 8,192-Token Context Window** — detects PII, PHI & leaked credentials buried at 95% depth inside 6,500-token contracts, emails, and MCP/JSON payloads with **~95.5%–96.0% recall** (where 512-token models collapse to **3.8%–8.1%**). - **12 Unified Production PII, PHI & Secret Entity Classes:** `PERSON`, `EMAIL`, `PHONE`, `ADDRESS`, `DATE_DOB`, `GOV_ID`, `FINANCIAL`, `CREDENTIAL`, `IP_NETWORK`, `MEDICAL_ID`, `ORG`, `VEHICLE_ID`. - **Try it live on CPU:** [`flintglass/PrismRedact-Demo`](https://huggingface.co/spaces/flintglass/PrismRedact-Demo) --- ## Apples-to-Apples 4-Benchmark Evaluation (7,600 Held-Out Documents) To ensure fair cross-taxonomy comparison against public baselines with different label schemas, **Redact Char F1** evaluates binary PII/secret redaction across all non-whitespace characters of the **full untruncated document** (honestly measuring 512-token truncation loss on `LongDoc-8K-PII`). **Zero-PII FPR** measures the fraction of 500 benign zero-PII engineering/CI/UUID logs wrongly flagged. **Strict Span F1** requires exact character start/end AND exact 12-class entity match. | Model | License | Context | **Avg 4-Bench Redact F1** | **Nemotron-PII** (3K) | **Gretel 7-Lang** (2.1K) | **DevSecrets** (1.5K, Zero-PII FPR) | **LongDoc-8K** (1K, Depth 95% Rec) | **Strict 12-Class Span F1** | |---|---|---:|---:|---:|---:|---:|---:|---:| | `iiiorg/piiranha-v1` (236K dl/mo) | **CC-BY-NC-ND** (Non-Comm) | 512 | 0.4350 | 0.6385 | 0.4811 | 0.4211 (47.4% FPR) | 0.1991 (3.8%) | — | | `Isotonic/distilbert_ai4privacy_v2` | **CC-BY-NC** (Non-Comm) | 512 | 0.4899 | 0.7415 | 0.3517 | 0.6761 (100.0% FPR) | 0.1904 (5.2%) | — | | `lakshyakh93/deberta_finetuned_pii` | MIT | 512 | 0.5047 | 0.7098 | 0.2525 | 0.7969 (100.0% FPR) | 0.2596 (8.1%) | — | | [`flintglass/PrismRedact-Large`](https://huggingface.co/flintglass/PrismRedact-Large) (395M) | **Apache 2.0** | **8,192** | 0.9540 | 0.9893 | 0.8650 | 0.9994 (0.0% FPR) | 0.9625 (95.5%) | 0.8679 | | **[`flintglass/PrismRedact-Multilingual`](https://huggingface.co/flintglass/PrismRedact-Multilingual) (307M)** | **Apache 2.0** | **8,192** | **0.9584** | **0.9907** | **0.8773** | **0.9994** (0.0% FPR) | **0.9661** (95.6%) | **0.8805** | | [`flintglass/PrismRedact-Small`](https://huggingface.co/flintglass/PrismRedact-Small) (140M) | **Apache 2.0** | **8,192** | 0.9598 | 0.9914 | 0.8814 | 0.9994 (0.0% FPR) | 0.9672 (96.0%) | 0.8898 | ### Long-Context Needle-in-a-Haystack Recall (`LongDoc-8K-PII`, 600 -> 6,500 tokens) | Model | Depth 0% | Depth 25% | Depth 50% | Depth 75% | **Depth 95%** | |---|---:|---:|---:|---:|---:| | `iiiorg/piiranha-v1` (512-tok, NC-ND) | 30.9% | 9.7% | 7.2% | 5.5% | 3.8% | | `lakshyakh93/deberta_finetuned_pii` (512-tok) | 67.1% | 24.0% | 14.8% | 12.2% | 8.1% | | **`flintglass/PrismRedact-Multilingual` (8,192-tok)** | **95.7%** | **95.9%** | **96.5%** | **95.5%** | **95.6%** | ### Per-Entity & Per-Language Strict Span F1 (`PrismRedact-Multilingual`) | Entity Class | Nemotron-PII Span F1 | DevSecrets Span F1 | |---|---:|---:| | `ADDRESS` | 0.9614 | — | | `CREDENTIAL` | 0.9314 | 1.0 | | `DATE_DOB` | 0.9613 | — | | `EMAIL` | 0.996 | 1.0 | | `FINANCIAL` | 0.9819 | — | | `GOV_ID` | 0.9336 | — | | `IP_NETWORK` | 0.9897 | 1.0 | | `MEDICAL_ID` | 0.993 | — | | `ORG` | 0.9526 | 1.0 | | `PERSON` | 0.9919 | 1.0 | | `PHONE` | 0.9888 | 0.4876 | | `VEHICLE_ID` | 0.9865 | — | | Language | Gretel-PII Span F1 | LongDoc-8K Span F1 | |---|---:|---:| | Dutch | 0.6529 | 0.6909 | | English | 0.7835 | 0.9179 | | France | 0.6991 | 0.8169 | | German | 0.6749 | 0.7654 | | Italian | 0.5964 | 0.7636 | | Spanish | 0.6626 | 0.8949 | | Swedish | 0.7022 | 0.8359 | --- ## Verified ONNX Exports - **ONNX FP32 (`onnx/model.onnx`, 1.2 GB):** **`1.0000` exact token agreement** (`0.000114` max logit diff vs. PyTorch) - **ONNX Per-Channel QUInt8 (`onnx/model_quantized.onnx`, 860 MB):** `0.9465` token agreement (for maximum accuracy use `onnx/model.onnx`) --- ## Quickstart (`transformers` Pipeline) ```python from transformers import pipeline redactor = pipeline( "token-classification", model="flintglass/PrismRedact-Multilingual", aggregation_strategy="simple", ) text = ( "Contact Elena Vance (elena.vance@northstar.io, +1-415-555-0192) " "regarding leaked key AKIAIOSFODNN7EXAMPLE on host 198.51.100.42." ) entities = redactor(text) for e in entities: print(f"{e['entity_group']:12s} | {e['word']!r} ({e['start']}-{e['end']}, score={e['score']:.3f})") # 1-line redaction redacted = text for e in sorted(entities, key=lambda x: x["start"], reverse=True): redacted = redacted[:e["start"]] + f"[{e['entity_group']}]" + redacted[e["end"]:] print("\nRedacted:", redacted) ``` --- ## The Complete Flintglass Prism Open-Source Agent & RAG Stack (Apache 2.0) - **Ingest (`PrismParse`):** [`PrismParse-9B`](https://huggingface.co/flintglass/PrismParse-9B) · [`PrismParse-4B`](https://huggingface.co/flintglass/PrismParse-4B) · [`PrismParse-2B`](https://huggingface.co/flintglass/PrismParse-2B) - **Embed (`PrismEmbed`, Zero MS MARCO):** [`PrismEmbed-Multilingual`](https://huggingface.co/flintglass/PrismEmbed-Multilingual) · [`PrismEmbed-Large`](https://huggingface.co/flintglass/PrismEmbed-Large) · [`PrismEmbed-Small`](https://huggingface.co/flintglass/PrismEmbed-Small) · [Demo](https://huggingface.co/spaces/flintglass/PrismEmbed-Demo) - **Rerank (`PrismRerank`, Zero MS MARCO):** [`PrismRerank-Large`](https://huggingface.co/flintglass/PrismRerank-Large) · [`PrismRerank-Multilingual`](https://huggingface.co/flintglass/PrismRerank-Multilingual) · [`PrismRerank-Small`](https://huggingface.co/flintglass/PrismRerank-Small) · [Demo](https://huggingface.co/spaces/flintglass/PrismRerank-Demo) - **Protect — Prompt Injection (`PrismGuard`):** [`PrismGuard-9B`](https://huggingface.co/flintglass/PrismGuard-9B) · [`PrismGuard-Multilingual`](https://huggingface.co/flintglass/PrismGuard-Multilingual) · [`PrismGuard-Large`](https://huggingface.co/flintglass/PrismGuard-Large) · [`PrismGuard-Small`](https://huggingface.co/flintglass/PrismGuard-Small) · [Demo](https://huggingface.co/spaces/flintglass/PrismGuard-Demo) - **Protect — PII & Secrets (`PrismRedact`):** [`PrismRedact-Small`](https://huggingface.co/flintglass/PrismRedact-Small) · [`PrismRedact-Multilingual`](https://huggingface.co/flintglass/PrismRedact-Multilingual) · [`PrismRedact-Large`](https://huggingface.co/flintglass/PrismRedact-Large) · [`PrismRedact-Corpus`](https://huggingface.co/datasets/flintglass/PrismRedact-Corpus) · [Demo](https://huggingface.co/spaces/flintglass/PrismRedact-Demo) - **Execute (`PrismAgent`, Pure RLVR):** [`Inkling-2-Mini-PrismAgent`](https://huggingface.co/flintglass/Inkling-2-Mini-PrismAgent) · [`PrismAgent-27B`](https://huggingface.co/flintglass/PrismAgent-27B) · [`PrismAgent-35B-A3B`](https://huggingface.co/flintglass/PrismAgent-35B-A3B) · [`PrismAgent-9B`](https://huggingface.co/flintglass/PrismAgent-9B) · [`PrismAgent-8B`](https://huggingface.co/flintglass/PrismAgent-8B) · [`PrismAgent-4B`](https://huggingface.co/flintglass/PrismAgent-4B) - **Verify (`PrismVerify`, 8K RAG Groundedness):** [`PrismVerify-27B`](https://huggingface.co/flintglass/PrismVerify-27B) · [`PrismVerify-9B`](https://huggingface.co/flintglass/PrismVerify-9B) · [`PrismVerify-4B`](https://huggingface.co/flintglass/PrismVerify-4B) · [`PrismVerify-Large`](https://huggingface.co/flintglass/PrismVerify-Large) · [Demo](https://huggingface.co/spaces/flintglass/PrismVerify-Demo) ## License Apache 2.0. Built by **Flintglass Labs**.