text-classification ยท text ยท WASM ยท ~82 MB
Where the 28-class GoEmotions model lets many emotions fire at once (multi-label sigmoid), this compact DistilRoBERTa classifier is single-label: it runs a softmax over the seven Ekman emotions โ anger, disgust, fear, joy, neutral, sadness, surprise โ so the seven scores compete and sum to 1, and exactly one wins. Type below and watch the whole distribution light up the emotion wheel, on-device.
| Model | onnx-community/emotion-english-distilroberta-base-ONNX |
|---|---|
| Task / pipeline | text-classification (single-label) |
| Labels | 7 Ekman classes โ anger, disgust, fear, joy, neutral, sadness, surprise; softmax (scores compete and sum to ~1) |
| Architecture | DistilRoBERTa-base (82M params) fine-tuned on 6 diverse emotion datasets (j-hartmann) |
| Quantization | q8 (8-bit) ONNX |
| Backend | WebAssembly (runs anywhere; no WebGPU needed) |
| Download | ~82 MB, cached after first load |
| License | Unspecified upstream โ research/demo use; base DistilRoBERTa is Apache-2.0 |
| Web APIs | WebAssembly, Web Workers โ all Baseline widely available |
Type anything. The emotion re-scores automatically (debounced) a moment after you stop typing. One emotion wins โ the softmax makes the seven scores compete.
The wheel (a 7-axis radar) is the model's full softmax distribution in one shape: each spoke is one emotion, the polygon reaches out as far as that emotion's probability. Because it's a softmax โ not a sigmoid โ the seven values compete and sum to 1: push one up and the rest fall. That's the difference from multi-label GoEmotions, where every emotion has its own independent score and several can be high at once.
A single, decisive emotion label is often exactly what a product needs โ one route, one tag, one reaction. A small softmax classifier gives you that decision plus its confidence, privately, with no round-trip.
Type a message and watch one emotion win, with the full 7-way distribution and wheel updating live.
Route a queue of support messages by their dominant Ekman emotion โ escalate, empathy, celebrate, standard.
Paste a poem or song lyric and plot its emotional arc, line by line, as the feeling moves.
Contrast 7-emotion detail against a binary sentiment model on the same text โ nuance vs a single axis.
Single-label classification is one call; ask for all 7 scores with top_k:
import { pipeline } from "@huggingface/transformers";
const classify = await pipeline(
"text-classification",
"onnx-community/emotion-english-distilroberta-base-ONNX",
); // downloads + caches ~82 MB once
const out = await classify("what a wonderful surprise!", { top_k: 7 });
// โ [{ label: "joy", score: 0.86 }, { label: "surprise", score: 0.11 },
// { label: "neutral", score: 0.01 }, โฆ all 7, and they SUM to ~1 ]
The config uses the default problem_type, so Transformers.js applies a softmax
across the 7 classes โ that's why exactly one wins and the scores sum to 1. All of it runs in a Web Worker so
typing never janks.