unitary/unbiased-toxic-roberta
onnx-community/unbiased-toxic-roberta-ONNX
text-classification (multi_label)
1. Live 16-Head Toxicity & Identity-Bias Inspector
Pick a constructive, benign-identity, hostile, or policy-warning preset, upload/drop a text file, paste (Ctrl/Cmd+V), or type any comment below:
.txt, .md, .csv, or .json file here, or press
Ctrl/Cmd+V anywhere outside editable fields. Inference runs locally in a Web Worker.
7 Toxicity Sigmoid Heads (Independent 0–100%)
Top raw logits & sigmoid vs softmax check: –
9 Demographic Identity Subgroup Heads
Auxiliary subgroup detectors trained to separate neutral demographic mentions from actual toxicity.
See Inside · Cased RoBERTa Byte-Level BPE Breakdown (50,265 vocab)
RoBERTa preserves case (Ġ marks word-leading space, <s>=0, </s>=2).
2. Why Unbiased-Toxic-RoBERTa Matters
Standard toxicity classifiers trained on Wikipedia or uncurated social feeds frequently over-flag benign sentences that merely mention marginalized identities ("I am a proud Muslim engineer" or "LGBTQ+ theater night"). unitary/unbiased-toxic-roberta was trained on Jigsaw's Unintended Bias in Toxicity Classification (Civil Comments) with explicit subgroup identity heads so toxicity scores stay decoupled from neutral identity terms.
import { pipeline } from "https://cdn.jsdelivr.net/npm/@huggingface/transformers@3.7.5";
const classifier = await pipeline(
"text-classification",
"onnx-community/unbiased-toxic-roberta-ONNX",
{ device: "wasm", dtype: "q8" }
);
const all16 = await classifier("I am a proud Muslim engineer.", { top_k: null });
Show the code · worker.js — runSingleClassify() (125.44 MB q8 WASM worker)
Show the code · toxic-core.mjs — normalizeToxicScores()
3. Model Card, Ethical Notes & References
-
Upstream model card:
unitary/unbiased-toxic-roberta
(Apache-2.0; Detoxify
unbiasedcheckpoint trained on Jigsaw Unintended Bias / Civil Comments, 0.93639 score). - ONNX build for Transformers.js: onnx-community/unbiased-toxic-roberta-ONNX
- Dataset & bias literature: Jigsaw Unintended Bias in Toxicity Classification · Sap et al. (2019), The Risk of Racial Bias in Hate Speech Detection.