The GoEmotions Dataset: 27 Emotions + Neutral, Explained

Updated · 10 min read

GoEmotions is a dataset of English Reddit comments, each labeled with one or more of 27 emotions or "neutral". It was released by Google Research in 2020 and has become the standard training set for fine-grained text emotion classification. If you have used an "emotion detection" model from the Hugging Face Hub, it was probably trained on GoEmotions or something derived from it.

This guide covers how the dataset was built, the label set, the available configurations and splits, how to load it, the quirks that trip people up (mostly label imbalance), and what to expect from models trained on it.

GoEmotions at a glance

PropertyValue
PublisherGoogle Research
PaperDemszky et al., “GoEmotions: A Dataset of Fine-Grained Emotions”, ACL 2020
Source textReddit comments (English)
Size58,009 comments
Labels27 emotions + neutral (28 total)
Task typeMulti-label classification
Hugging Face idgo_emotions (also google-research-datasets/go_emotions)
Configurationssimplified (train/validation/test) and raw (per-rater annotations)

How the dataset was built

The authors sampled comments from popular English-language subreddits and had human raters annotate each comment with every emotion they thought it expressed. Several design decisions shape how the data behaves:

  • Fine-grained taxonomy by design. Rather than adopt Ekman's six emotions, the authors built a larger set meant to cover the range of emotion actually expressed in online conversation. That is why it includes labels like curiosity, confusion, approval and realization, which barely appear in classic taxonomies.
  • Multiple raters per comment. Each comment was annotated by several people. The raw configuration keeps every individual judgment. The simplified configuration keeps labels that enough raters agreed on.
  • Curation of the source. The authors filtered offensive content and tried to reduce some biases, such as masking names and religion terms with special tokens. Some comments therefore contain placeholders like [NAME], which matters if you compare model outputs with raw Reddit text.
  • Hierarchical groupings. The paper also groups the 27 emotions into sentiment groups (positive, negative, ambiguous) and maps them onto Ekman's six basic emotions plus neutral. That makes it easy to train or evaluate at a coarser level.

The 28 labels

Grouped roughly by sentiment, the labels are:

  • Positive (12): admiration, amusement, approval, caring, desire, excitement, gratitude, joy, love, optimism, pride, relief
  • Negative (11): anger, annoyance, disappointment, disapproval, disgust, embarrassment, fear, grief, nervousness, remorse, sadness
  • Ambiguous (4): confusion, curiosity, realization, surprise
  • Neutral (1): neutral

For a definition, example sentences and easily-confused neighbours for every label, see the list of 28 GoEmotions emotions. For how this taxonomy compares with Ekman and Plutchik, see emotion detection vs. sentiment analysis.

Configurations and splits

On the Hugging Face Hub the dataset comes in two main configurations.

simplified

This is what most people use. Each example has the comment text, a list of integer labels (indices into the 28-label list) and an id. It comes with the standard splits:

SplitExamples
train43,410
validation5,426
test5,427

raw

The raw configuration has one row per rater annotation, with one 0/1 column per emotion plus metadata such as the rater id, subreddit and whether the example was marked very unclear. Use it if you want to study annotator agreement, build soft labels (the fraction of raters who chose each emotion), or apply your own agreement threshold.

Loading GoEmotions in Python

With the Hugging Face datasets library:

# pip install datasets
from datasets import load_dataset

ds = load_dataset("google-research-datasets/go_emotions", "simplified")
label_names = ds["train"].features["labels"].feature.names  # 28 names

example = ds["train"][0]
print(example["text"])
print([label_names[i] for i in example["labels"]])

# Multi-hot encode for a multi-label classifier
import numpy as np

def to_multi_hot(batch):
    y = np.zeros((len(batch["labels"]), len(label_names)), dtype=np.float32)
    for row, labels in enumerate(batch["labels"]):
        y[row, labels] = 1.0
    return {"targets": y.tolist()}

train = ds["train"].map(to_multi_hot, batched=True)

Older code refers to the dataset simply as "go_emotions". If that id fails in your environment, use the namespaced id above. Check the dataset card for the current license and citation.

Label imbalance and other quirks

GoEmotions is very useful but not uniform. Know these properties before you train on it or trust a model built from it.

Heavy label imbalance

Neutral is by far the most frequent label, and admiration and approval are also very common. At the other end, grief, pride, relief and nervousness have only a small number of examples. In practice:

  • Rare-label F1 scores are much lower than common-label scores, and they vary a lot between runs.
  • A single global threshold such as 0.5 under-predicts rare labels. Tune thresholds per label on the validation set.
  • Report macro-averaged metrics as well as micro or weighted ones, otherwise the frequent labels hide poor rare-label performance.

Annotator disagreement

Fine-grained emotion is subjective. Neighbouring labels such as annoyance and anger, approval and admiration, or sadness and disappointment often get split votes. Treat them as related, not mutually exclusive. When reporting results to non-specialists, rolling up to the Ekman groups or to positive/negative/ambiguous is often more honest.

Domain and demographic bias

The text is English Reddit, with Reddit's demographic skew, slang and humour. Sarcasm is common and hard to label. Models trained only on GoEmotions can be miscalibrated on formal text such as support emails, on other platforms, and on dialects that are underrepresented on Reddit. Validate on a sample of your own data.

Training and evaluating models

The standard recipe is a pretrained transformer encoder (BERT, RoBERTa, DistilBERT or a multilingual variant) with a 28-unit output layer and a sigmoid activation, trained with binary cross-entropy. Softmax with cross-entropy is the wrong choice here: it forces labels to compete, but GoEmotions examples can legitimately carry several emotions.

from transformers import AutoModelForSequenceClassification

model = AutoModelForSequenceClassification.from_pretrained(
    "bert-base-uncased",
    num_labels=28,
    problem_type="multi_label_classification",  # sigmoid + BCE loss
)

Tips that consistently help:

  • Per-label thresholds tuned on validation usually beat class reweighting and are trivial to implement.
  • Short sequence lengths are fine. Reddit comments are short, and a max length of 128 tokens covers most of them.
  • Evaluate at several granularities: all 28 labels, Ekman groups and sentiment groups. The paper reports these too, so your numbers are comparable.
  • Don't compare across configs. Results on raw (per-rater) labels and simplified (aggregated) labels are not directly comparable.

Beyond English: multilingual GoEmotions models

GoEmotions itself is English-only. Teams that need other languages usually either (a) machine-translate the dataset and fine-tune a multilingual encoder such as mBERT or XLM-R on the combined data, or (b) translate inputs to English at inference time. Option (a) avoids translation cost and latency at inference and usually keeps more of the emotional nuance. The trade-offs are covered in multilingual sentiment analysis.

The model behind the Sentiment API, AnasAlokla/multilingual_go_emotions_V1.1, follows the first approach. It is an mBERT model fine-tuned for the 28 GoEmotions labels across Arabic, English, French, Spanish, German and Turkish, with multi-label (sigmoid) outputs.

Using a GoEmotions model without training one

Training is the easy part. Serving a transformer on a GPU, batching requests, scaling to zero and keeping it patched is where the time goes. If you just need the scores, the Sentiment API returns every one of the 28 GoEmotions scores, the top emotion and a valence score in [-1, 1] for each message:

{
  "text": "I can't believe it finally works, thank you!",
  "predictions": [
    { "label": "gratitude", "score": 0.95 },
    { "label": "joy", "score": 0.38 },
    { "label": "surprise", "score": 0.21 }
    // ...all 28 labels, sorted by score
  ],
  "top_emotion": "gratitude",
  "top_score": 0.95,
  "valence": 0.9
}
// illustrative values

There is no subscription. You authenticate with an API key and pay per message from prepaid credit. Batches can hold up to 10,000 texts. A short message costs a fraction of a cent; current numbers are on the pricing page. If you are still choosing training data, see our roundup of sentiment analysis datasets.

Frequently asked questions

How many emotions are in GoEmotions?

GoEmotions has 27 emotion categories plus a neutral label, for 28 labels in total. Each comment can carry more than one label because the dataset is multi-label.

How big is the GoEmotions dataset?

It contains 58,009 English Reddit comments. The commonly used simplified configuration has a train split of 43,410 examples, a validation split of 5,426 and a test split of 5,427. The raw configuration keeps every individual rater annotation, so it has many more rows.

Is GoEmotions single-label or multi-label?

Multi-label. Raters could select every emotion they saw in a comment, so a single example may have several labels. Models trained on it typically use a sigmoid output per label rather than a softmax across labels.

What language is GoEmotions in?

The original dataset is English only, drawn from Reddit. Multilingual models exist that were fine-tuned on translated or extended versions of the data, such as the mBERT-based model behind the Sentiment API, which covers Arabic, English, French, Spanish, German and Turkish.

Can I map GoEmotions to positive and negative sentiment?

Yes. The paper groups the 27 emotions into positive, negative and ambiguous sentiment groups and into Ekman's six basic emotions. You can also assign a polarity weight per label and combine the scores into a single valence score, which is how the Sentiment API computes its valence field.

Try it on your own text

Sentiment is a pay-per-request API that returns all 28 GoEmotions scores plus a valence score for text in Arabic, English, French, Spanish, German and Turkish. No subscription — pay a fraction of a cent per message from prepaid credit.

Related guides