← All models

text-classification Β· text Β· WASM Β· ~125 MB

RoBERTa GoEmotions β€” read 28 emotions at once

Binary sentiment tells you positive or negative. This RoBERTa model, fine-tuned on Google's GoEmotions, is multi-label: it scores text across 28 distinct emotions β€” gratitude, curiosity, annoyance, grief, pride… β€” each with its own independent confidence. Several can fire at once. Type below and watch the whole emotional profile light up, all on-device.

At a glance

ModelSamLowe/roberta-base-go_emotions-onnx
Task / pipelinetext-classification (multi-label)
Labels28 GoEmotions classes + neutral; per-class sigmoid (scores are independent, don't sum to 1)
ArchitectureRoBERTa-base (125M params) fine-tuned on the GoEmotions corpus (58k Reddit comments)
Quantizationq8 (8-bit) ONNX
BackendWebAssembly (runs anywhere; no WebGPU needed)
Download~125 MB, cached after first load
LicenseMIT
Web APIsWebAssembly, Web Workers β€” all Baseline widely available

Run it

Type anything. The emotional profile re-scores automatically (debounced) a moment after you stop typing. The pills show every emotion above the threshold β€” often more than one.

See inside β€” all 28 sigmoid scores

This is the model's raw output: one independent probability per class, from a sigmoid β€” not a softmax. That's the whole point of multi-label. A softmax would force the 28 scores to compete and sum to 1 (pick one winner); a sigmoid lets "gratitude" and "relief" both be 0.9 because they aren't mutually exclusive. Drag the threshold to see which emotions the model would report β€” the line between "present" and "absent" is a choice you make, not the model.

Why it matters

Sentiment flattens feeling into a single axis. Emotion detection keeps the nuance β€” and doing it in the browser means you can read how someone feels as they type, privately, with no round-trip.

Use cases

Basics

Type a message and see every emotion the model detects, ranked, updating live.

Practical

Auto-route a queue of support tickets by their dominant emotion β€” escalate, praise, help, general.

Wild

Plot the emotional arc of a pasted story, sentence by sentence, and watch the feeling move.

Multi-model

Detect emotion in any language: M2M100 translates to English, then this model scores it.

How the API works

Multi-label classification is one call; ask for all 28 scores with top_k:

import { pipeline } from "@huggingface/transformers";

const classify = await pipeline(
  "text-classification",
  "SamLowe/roberta-base-go_emotions-onnx",
); // downloads + caches ~125 MB once

const out = await classify("thank you, I was so worried!", { top_k: 28 });
// β†’ [{ label: "gratitude", score: 0.92 }, { label: "relief", score: 0.78 },
//    { label: "nervousness", score: 0.41 }, … all 28, each independent ]

The model's config declares problem_type: "multi_label_classification", so Transformers.js applies a sigmoid per class instead of a softmax β€” that's why the scores don't sum to 1. All of it runs in a Web Worker so typing never janks.

References