gravitee-io/bert-small-pii-detection
onnx-community/bert-small-pii-detection-ONNX
token-classification
1. Live Keystroke-Speed API Payload Scrubber
onnx/model_quantized.onnx (28,748,527 B,
Apache-2.0) via shared Transformers.js into a dedicated Web Worker. Zero payloads leave your device.
Pick a synthetic gateway/log preset, drag & drop or paste (Ctrl/Cmd+V) a payload, or type live:
.txt/.json/.csv/.log/.md file here,
press Ctrl/Cmd+V anywhere on the page, or type with Live Keystroke Scrubbing enabled.
Detected PII Highlights
Redacted Payload ([TYPE_N] Tag)
2. WordPiece BIO Span Inspector Table
Every span below is collapsed from raw WordPiece B-/I-/O predictions
with Unicode-normalized character offsets and structured punctuation bridging.
| # | Entity Type | Risk Tier | Detected Text | Replacement | Confidence | Char Span |
|---|---|---|---|---|---|---|
| Run a scan above to inspect detected PII spans. | ||||||
3. Why 4-Layer BERT-Small PII Matters & How the API Works
Fine-tuned by Gravitee.io from prajjwal1/bert-small (4 layers, 512 hidden dim) on
gravitee-io/pii-detection-dataset, this model trades heavyweight 12-layer footprints for
keystroke-speed CPU WASM execution (~15 ms warm) across 49 BIO tags including network/API secrets
(IP_ADDRESS, MAC_ADDRESS, IMEI, PASSWORD).
import { pipeline } from "https://cdn.jsdelivr.net/npm/@huggingface/transformers@3.7.5";
const classifier = await pipeline(
"token-classification",
"onnx-community/bert-small-pii-detection-ONNX",
{ device: "wasm", dtype: "q8" }
);
const rawTokens = await classifier(payload, { ignore_labels: [] });