Emotion-S1
fast CPU-based emotion detector for dialogue
2 min readupdated
A compact model by davolu built to detect user emotions in chat conversations. Based on the ModernBERT-base encoder (~150M parameters), it handles three types of questions about the latest message in a single pass while factoring in up to 4 previous messages: picking an emotion from a custom list, rating its intensity on a 1–5 scale, or answering yes/no questions (such as whether the user needs support). Unlike heavy LLMs like Claude or GPT, the model is roughly 596 MB and runs locally on a CPU with zero API costs. It is a great fit for developers building English-language chatbots and routing pipelines where low latency and free inference matter.
Key features
- Three specialized heads: classification from an arbitrary list of options (choice), intensity scoring from 1–5 (score), and binary questions with probability outputs (yes/no).
- Runs on standard CPUs: on an 8-core Intel Xeon, median latency is 40.5 ms per question (and around 310 ms for a batch of four questions at once).
- Confidence calibration: each head has its own temperature parameter stored in
heads.ptfor more accurate probability estimates. - Context-aware: processes the latest message along with up to 4 previous dialogue turns (up to 192 tokens).
What you can do
- Fast customer support router: check in real time whether a user is frustrated and needs escalation to a human agent without burning tokens on large LLMs.
- Dialogue log annotation: batch-process large archives of English chat logs locally on your own server for sentiment analytics.
- Cascading LLM pipeline: use the model as a cheap first-pass filter on familiar dialogue types and route complex or edge cases to larger models.
Example
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")
out = ask(model, "I've asked three times and it's STILL broken.", {"frustrated": {"type": "noul", "question": "Is the user frustrated?"}})
Read more
DetailsOn in-domain test data, Emotion-S1 outperforms Claude Sonnet 5.5 and GPT-6.1 Sol (choice accuracy of 0.70 vs. 0.625–0.64, and 0.795 on yes/no), though choice accuracy drops to 0.34 on out-of-domain datasets (MELD, EmoWOZ).
The checkpoint size is 596.1 MB (fp32) and requires no GPU; it loads via a custom
emotion_s1_core.py script rather than the standard AutoModelForSequenceClassification.Limitations: English only, a 192-token context window, and a CC BY-NC-SA 4.0 license (research and non-commercial use only).










Comments