text-classification ยท text ยท WASM ยท ~136 MB
A DistilBERT classifier fine-tuned to separate junk from real messages. Paste any message or email and it scores it as SPAM or HAM (not spam) with a confidence โ then look inside to see which exact words tripped the spam signal. Everything runs on your device.
| Model | onnx-community/tanaos-spam-detection-v1-ONNX |
|---|---|
| Task / pipeline | text-classification |
| Labels | spam / not_spam (binary; softmax over 2 logits) |
| Architecture | DistilBERT fine-tuned for spam / content-moderation (tanaos) |
| Quantization | q8 (8-bit) ONNX |
| Backend | WebAssembly (runs anywhere; no WebGPU needed) |
| Download | ~136 MB, cached after first load |
| License | MIT |
| Web APIs | WebAssembly, Web Workers โ all Baseline widely available |
Paste a message. The verdict re-scores automatically (debounced) a moment after you stop typing. The dual meter shows the full probability split between the two classes.
This is occlusion attribution: we re-run the model with each word removed and see how much the SPAM score shifts (measured in log-odds, because the model is so confident that raw percentages barely move). Remove a word that was pushing "spam" and the score drops โ so that word gets a red weight. Remove a word that was keeping it looking legitimate and the score rises โ green. No gradients, no hand-waving: just the model's own predictions, N+1 of them.
Spam filtering is the oldest applied text classifier there is โ and running it in the browser means you can triage messages the instant they arrive, without a round-trip and without their contents ever leaving the device. That unlocks fast, private, always-available filtering.
Type a message, get SPAM/HAM + confidence, updating live as you type.
Paste a whole inbox and watch it auto-triage into Inbox and Junk columns.
Adversarial spam: obfuscate a message and watch how far you can fool the filter.
Spam-gate an inbox, then summarize only the real messages with DistilBART.
Classification is one call; top_k returns both class scores:
import { pipeline } from "@huggingface/transformers";
const classify = await pipeline(
"text-classification",
"onnx-community/tanaos-spam-detection-v1-ONNX",
); // downloads + caches ~136 MB once
const out = await classify("Claim your FREE prize now!", { top_k: 2 });
// โ [{ label: "spam", score: 0.9994 }, { label: "not_spam", score: 0.0006 }]
"See inside" re-uses that same call: it classifies the full message plus one copy per word with that word deleted (batched in a single pass), then subtracts the SPAM log-odds to attribute the shift to each word. All of it runs in a Web Worker so typing never janks.