Emotion-S1
A System One decision model for per-turn emotion detection. It is a fine-tuned ModernBERT-base encoder (about 150M parameters) with three typed heads:
- choice β pick one label from a list you provide (option-conditioned, so the inventory can change)
- score β a 1β5 intensity / valence score, returned as an expected value over five calibrated bins
- yes/no β a probability and a boolean answer (
noulin the code)
Each head has its own temperature, stored in heads.pt, for confidence calibration. This is not a drop-in AutoModelForSequenceClassification checkpoint. Load it with the emotion_s1_core.py helper in this repo, as in the example below.
The comparison code, both result sets, and the training notebook are in davolu/decision-model-vs-llm-emotion-s1. The Colab notebook with outputs is here.
Input format
The model reads a short conversation state: the target (latest) user turn, plus up to 4 earlier turns, truncated on the left to a maximum of 192 tokens. Older context is dropped first; the latest turn is kept.
Earlier turns:
Assistant: Did that fix it?
Latest user turn:
User: I've asked three times and it's STILL broken.
format_state() and ask() in emotion_s1_core.py build this for you.
Usage (CPU)
Inference only. No training is required to try the model.
pip install torch transformers huggingface_hub
import sys
from huggingface_hub import snapshot_download
model_dir = snapshot_download("davolu/emotion-s1")
sys.path.insert(0, model_dir)
from emotion_s1_core import load_emotion_s1, ask
model = load_emotion_s1(model_dir, device="cpu")
questions = {
"emotion": {
"type": "choice",
"question": "What is the user's emotion in this turn?",
"options": ["anger", "disgust", "fear", "joy", "sadness", "surprise", "neutral"],
},
"intensity": {
"type": "score",
"question": "How intense is the user's emotion on a 1 to 5 scale?",
"scale": [1, 5],
},
"frustrated": {
"type": "noul",
"question": "Is the user frustrated?",
},
"needs_support": {
"type": "noul",
"question": "Does the user need emotional support?",
},
}
out = ask(
model,
"I've asked three times and it's STILL broken.",
questions,
context=[("Assistant", "Did that fix it?")],
)
print(out)
All questions for one turn go through a single batched forward pass. A choice question uses one encoder row per option.
You can also run the same script from this repo: python example.py (downloads the model) or python example.py --model-dir /path/to/emotion-s1.
Requirements: torch, transformers>=4.48.0 (for ModernBERT), and huggingface_hub. The published weights are fp32 (~596 MB). CPU inference is enough; a GPU is not required.
Results
Numbers below are copied from the comparison reports dated 16 November 2026 (Africa/Lagos, UTC+1). They were measured on an 8-core Intel Xeon CPU. No numbers have been rounded beyond what those reports already show.
Honest summary: Emotion-S1 wins on held-out test data from its training datasets. On unseen datasets it trails Claude, GPT and Jev on fine-grained choice, and is about level on yes/no.
Held-out test data (in-domain)
Same 600 held-out questions (200 choice, 200 yes/no, 200 score), stratified across the training datasets, plus 100 second-pass repeats for consistency. All 2,800 calls succeeded and parsed. Emotion-S1 was trained on the training splits of these datasets, not on these exact held-out messages. Claude, GPT and Jev were not trained on this labelled set in the same way, so this comparison asks whether a specialist model can replace an LLM judge on its own domain, not which system is a better general reasoner.
| System | Choice acc | Yes/No acc | Score MAE (within 1) | ECE (c / y-n / s) | Median ms | p95 ms | $ per 1,000 turns | Self-disagreement | Parse-fail |
|---|---|---|---|---|---|---|---|---|---|
| Emotion-S1 (CPU) | 0.7 | 0.795 | 0.4122 (0.89) | 0.078 / 0.0772 / 0.0563 | 40.5 | 184.0 | 0.0 | 0.0 | 0.0/0.0/0.0 |
| anthropic:claude-sonnet-5-5 | 0.625 | 0.77 | 1.0299 (0.65) | 0.0831 / 0.1274 / 0.3206 | 877.6 | 1536.0 | 2.1466 | 0.02 | 0.0/0.0/0.0 |
| openai:gpt-6.1-sol | 0.64 | 0.775 | 1.0374 (0.655) | 0.2136 / 0.1788 / 0.4869 | 2133.1 | 4163.9 | 1.5718 | 0.03 | 0.0/0.0/0.0 |
| typesafe:jev-latest | 0.665 | 0.76 | 0.9928 (0.59) | 0.1661 / 0.1117 / 0.3604 | 119.0 | 159.3 | 0.0455 | 0.29* | 0.0/0.0/0.0 |
*Jev's 0.29 exact-match disagreement is almost all soft score wobble of 0.01β0.07 on the 1β5 scale (max 0.07; none above 0.10). Categorical flips were 2/34 choice and 1/33 yes/no. If scores within 0.10 count as the same answer, Jev's disagreement rate is 0.03, in line with Claude and GPT. Emotion-S1 is deterministic.
Settings: Claude claude-sonnet-5-5 with output_config.effort=low; GPT gpt-6.1-sol with reasoning_effort=low; Jev jev-latest served as jev-1.14.0. Latency in this table is per question on the 600-question mix: a local forward pass for Emotion-S1, and the HTTPS round-trip for the APIs. A "turn" for the cost column is three questions (choice + score + yes/no) about one message.
The full in-domain report is in the GitHub repo at compare/results/results.md.
Unseen datasets (MELD, EmoWOZ, CARER)
Same four systems, official test splits only, on kinds of text Emotion-S1 never trained on: MELD (multi-party Friends transcripts), EmoWOZ (task-oriented userβsystem dialogue), and CARER (single-turn tweets). 600 questions (300 choice, 300 yes/no; 100 of each type from each dataset) plus 100 repeats. Score questions were omitted because none of the three datasets has an official intensity label.
| System | Choice acc | Yes/No acc | ECE (c / y-n) | Median ms | p95 ms | $ per 1,000 two-question turns | Self-disagreement | Parse-fail |
|---|---|---|---|---|---|---|---|---|
| Emotion-S1 (CPU) | 0.3433 | 0.75 | 0.3147 / 0.1131 | 95.6 | 464.1 | 0.0 | 0.0 | 0.0/0.0 |
| anthropic:claude-sonnet-5-5 | 0.4733 | 0.7533 | 0.1668 / 0.0767 | 930.0 | 2079.8 | 1.8426 | 0.02 | 0.0/0.0 |
| openai:gpt-6.1-sol | 0.4567 | 0.7933 | 0.4024 / 0.1526 | 2262.9 | 8579.6 | 1.1076 | 0.04 | 0.0/0.0 |
| typesafe:jev-latest | 0.4467 | 0.76 | 0.3439 / 0.0744 | 114.8 | 160.7 | 0.0302 | 0.04 | 0.0/0.0 |
By dataset (choice / yes-no):
| Dataset | Random choice | Emotion-S1 | Claude | GPT | Jev |
|---|---|---|---|---|---|
| MELD (Friends TV) | 14.3% | 29% / 75% | 53% / 72% | 56% / 84% | 48% / 73% |
| EmoWOZ (task-oriented) | 14.3% | 29% / 74% | 45% / 84% | 40% / 83% | 45% / 84% |
| CARER (tweets) | 16.7% | 45% / 76% | 44% / 70% | 41% / 71% | 41% / 71% |
In-domain vs out-of-domain:
| System | Choice in-domain β OOD | Yes/No in-domain β OOD |
|---|---|---|
| Emotion-S1 | 70% β 34% (β36 pp) | 79.5% β 75% (β4.5 pp) |
| Claude Sonnet 5.5 | 62.5% β 47% (β15 pp) | 77% β 75% (β2 pp) |
| GPT-6.1 Sol | 64% β 46% (β18 pp) | 77.5% β 79% (+1.5 pp) |
| Jev 1.14.0 | 66.5% β 45% (β22 pp) | 76% β 76% (0 pp) |
The specialist's advantage is in-domain. On unseen kinds of chat, the hosted systems take the lead on fine-grained choice, while yes/no questions stay close for everyone (Emotion-S1 even leads on the tweet set). Emotion-S1's choice ECE rises to 0.31 out of domain: it can still be confident when the label inventory or style no longer matches training. The OOD Emotion-S1 latency in the table used 4 CPU threads and should not be treated as the official 8-core speed figure below.
The full out-of-domain report is in the GitHub repo at compare/results_ood/results.md.
CPU latency, size and cost
Measured after warm-up on the same 8-core Intel Xeon box, with no other heavy jobs running (torch 2.15.0+cpu, 8 threads). One yes/no question is one encoder row. The four-question turn is choice over 6 emotions + intensity + "frustrated?" + "needs support?" (9 encoder rows).
| Median | p95 | n | |
|---|---|---|---|
| One yes/no question (fp32) | 44.7 ms | 57.1 ms | 40 |
| All four questions, one turn (fp32) | 310.6 ms | 387.3 ms | 40 |
Across the 600 mixed in-domain comparison questions (fp32), median was 40.5 ms and p95 was 184.0 ms. Choice questions are slower because each option is an encoder row. Cost is $0 per call (local inference). The published checkpoint is fp32, 596.1 MB on disk (backbone + heads).
metrics.json also records Colab timings from training (Tesla T4 GPU, and a 2-core Colab CPU). Those Colab CPU numbers are much slower and are not the official speed figure.
Training
Trained for 26.1 minutes (3,566 steps, 78,100 training questions) on a Tesla T4 in Colab, starting from answerdotai/ModernBERT-base. COMMERCIAL_SAFE was off, so all six sources below were used. Per-head temperatures after calibration: yes/no 0.9658, choice 1.1947, score 0.9846 (also stored in heads.pt).
Licence
This model is released under CC BY-NC-SA 4.0. It is free to use for research, evaluation and non-commercial testing, with attribution, and adaptations must be shared under the same licence. Commercial use is not allowed.
That restriction is inherited from the training data, not chosen for its own sake:
| Dataset | Used for | Licence | Commercial use |
|---|---|---|---|
| GoEmotions | choice, yes/no, neutral score anchors | Apache-2.0 | Yes |
| EmoBank | score (valence, arousal) | CC BY-SA 4.0 | Yes, with attribution and share-alike on the data |
| DailyDialog | choice and yes/no per turn, with context | CC BY-NC-SA 4.0 | No |
| EmpatheticDialogues | choice, yes/no, support | CC BY-NC 4.0 | No |
| ESConv | distress score, support, emotion type | CC BY-NC 4.0 | No |
| SemEval-2018 Task 1, EI-reg | per-emotion intensity score | Research only; do not redistribute (NRC terms of use) | Research only |
A model trained on non-commercial or research-only data inherits those restrictions, so this full checkpoint is for a tutorial, demo or research β not a product. The training notebook has a COMMERCIAL_SAFE = True switch that trains only on GoEmotions and EmoBank; that is a starting point if you need a commercially usable model, and fine-tuning on your own labelled chat logs is better still. This repository does not redistribute the datasets.
Limitations
- The accuracy advantage is on held-out messages from the training datasets. It is not a general-purpose emotion model.
- On unseen datasets, fine-grained choice accuracy drops sharply (70% β 34%) and trails Claude, GPT and Jev. Yes/no transfers better (79.5% β 75%) and stays about level with the hosted systems.
- Out-of-domain choice confidence is poorly calibrated (ECE 0.3147). If you use this model in a pipeline, treat low (or, on unfamiliar genres, even high) confidence carefully and fall back to an LLM when the decision matters.
- Some yes/no labels used in evaluation (especially "frustrated" and "needs support") were derived from other annotations and are noisy. Fine-grained emotion labels also overlap (fear vs surprise, anger vs disgust). That caps everyone's accuracy, not just this model's.
- English only. Context is at most 4 previous turns and 192 tokens.
- The Hugging Face
text-classificationpipeline tag is only a category. Do not load this repo withAutoModelForSequenceClassification; useload_emotion_s1/ask.
Files
| File | Role |
|---|---|
backbone/model.safetensors |
Fine-tuned ModernBERT-base encoder (fp32) |
backbone/config.json, backbone/tokenizer.json, backbone/tokenizer_config.json |
Encoder config and tokenizer |
heads.pt |
Yes/no, choice and score heads, plus per-head calibration temperatures, max_len (192) and n_bins (5) |
emotion_s1_core.py |
Input formatting, model class, load_emotion_s1, and ask |
example.py |
CPU usage example |
metrics.json |
Training-run metrics and Colab latency log |
LICENSE |
CC BY-NC-SA 4.0 |
Links
- GitHub (scripts, both result sets, training notebook): https://github.com/davolu/decision-model-vs-llm-emotion-s1
- Colab notebook with outputs: https://colab.research.google.com/drive/1FjluwT6thpshMoTF-NON1fLEVa8UFCkx
- Base model: https://huggingface.co/answerdotai/ModernBERT-base
Model tree for davolu/emotion-s1
Base model
answerdotai/ModernBERT-base