Meddies PII v2 β ONNX
The ONNX build of Meddies PII v2: the same nine-family, 17-language PII extractor, exported and 8-bit quantized to run wherever onnxruntime runs β including fully in-browser over WebGPU, so patient text never leaves the device.
This repository hosts the export of the released step-250 checkpoint β the weights behind the published v2 benchmark numbers (checkpoint digest
b175a02edf0fac399f6713980f2b22aaa95f5ae96371f02e392d152c78840d70). The fp32 graph decodes identically to the released PyTorch model on all 200 parity rows (span-level, fail-closed gate at export time). The 8-bit file is a lossy convenience variant: its span delta vs fp32 is measured and recorded inmanifest.json, never attributed the benchmark numbers. De-identification support, not a compliance guarantee β residual identifiers can remain. For commercial use, contact contact@meddies.ai.
What is in this repository
model.onnxβ encoder + adapter (applied at export) + 37-tag BIOES head in one fp32 graph, opset 17. Exact: 0/200 parity mismatches vs the released PyTorch path.sha256 26aa7d85758f073f218b2e29e0d32fbdcea8dfcd3ac451537787ccc46306f8e0, 1.61 GB.model.int8.onnxβ 8-bit weight-only quantization (MatMulNBits, block 32, symmetric) of the same graph, the browser-sized variant (647 MB). Span delta vs fp32: 12/200 parity rows (recorded, not gated).sha256 10c018efbd336e36fd06540ce2d20bb8d16872727448722df4fb5f59c6306260.meddies_pii_decode/+meddies_pii_postprocess.pyβ the benchmark's own decode (Viterbi over BIOES tags β character spans), vendored byte-for-byte; do not re-implement decoding withargmax.usage_onnxruntime.pyβ the runnable reference: tokenize β run βdecode(...).labels.json,tokenizer.json/tokenizer_config.jsonβ 37-tag vocabulary and a tokenizer with code-point offsets, so spans map back to exact character positions.manifest.jsonβ per-file sha256 manifest, uploaded last; a partial upload can never read as a complete release.- Interface: inputs
input_ids,attention_mask(int64,[batch, seq], dynamic); outputlogits[batch, seq, 37]. The graph accepts sequences up to 8,192 tokens; the browser demo windows at 2,048 with 128 overlap.
Quick start (Python, onnxruntime)
from huggingface_hub import snapshot_download
import sys
path = snapshot_download("Meddies/meddies-pii-v2-onnx")
sys.path.insert(0, path)
from usage_onnxruntime import extract
spans = extract("Bα»nh nhΓ’n Nguyα»
n VΔn A, SΔT 0912 345 678.")
for span in spans:
print(span.label, span.start, span.end, span.text)
usage_onnxruntime.py is nine lines of setup you can inline: onnxruntime session over model.onnx, the shipped tokenizer with offsets, and meddies_pii_postprocess.decode β the same Viterbi BIOES decode the benchmark ran.
For the browser path (WebGPU, zero server), see the live demo Space and its source.
Why in-browser
De-identification tools sit in an awkward place: the text they process is exactly the text you least want to send to a third party. Running the extractor client-side removes that tension β the model downloads once (647 MB, cached), and every subsequent extraction is local.
Relationship to the main model
Everything about labels, languages, evaluation, limits, and training lives on the main card: Meddies/meddies-pii-v2. This repo only changes the runtime: both repos pin the same checkpoint digest (b175a02eβ¦40d70), and the export-time gate records span-level parity between the PyTorch and ONNX outputs β exact for model.onnx, 12/200 rows for the 8-bit file.
Feedback
Send us the failures β especially browser/runtime issues: WebGPU initialization errors, slow-path fallbacks, quantization artifacts on specific languages, or spans that differ from the PyTorch model. Open a discussion here or write to contact@meddies.ai.
You can find MeddiesAI on Hugging Face at Meddies and on the web at meddies.ai.
Citation
@misc{meddies-pii-v2-onnx,
title={Meddies PII v2 (ONNX): browser-deployable multilingual PII extraction},
author={MeddiesAI},
year={2026},
url={https://huggingface.co/Meddies/meddies-pii-v2-onnx}
}
Model tree for Meddies/meddies-pii-v2-onnx
Base model
Meddies/meddies-pii-v2