A multi-label emotion intensity classifier fine-tuned on US tweets, campaign speeches and congressional speeches. Built on distilbert-base-uncased with GPT-4o-mini annotation via the OpenAI Batch API.
Labels
The model predicts 8 independent emotion intensities (sigmoid, range 0–1):
| Label |
|---|---|
| anger |
| sadness |
| fear |
| disgust |
| pride |
| joy |
| gratitude |
| hope |
Scores are independent — multiple emotions can be high simultaneously.
Training
Setting
Value
Base model
distilbert-base-uncased
Architecture
DistilBertForSequenceClassification (multi-label)
Problem type
multi_label_classification
Training data
~200,000 labeled documents
Annotation
GPT-4o-mini (temperature=0) via OpenAI Batch API
Epochs
4
Learning rate
2e-5
Batch size
16
Max length
512 tokens
Domain
US tweets about policy, campaign speeches and congressional floor speeches
Usage
python
1from transformers import AutoTokenizer, AutoModelForSequenceClassification
2import torch
34model_id ="thomasrenault/emotion"5tokenizer = AutoTokenizer.from_pretrained(model_id)6model = AutoModelForSequenceClassification.from_pretrained(model_id)7model.eval()89EMOTIONS =["anger","sadness","fear","disgust","pride","joy","gratitude","hope"]10THRESHOLD =0.51112defpredict(text):13 enc = tokenizer(text, return_tensors="pt", truncation=True, max_length=512)14with torch.no_grad():15 probs = torch.sigmoid(model(**enc).logits).squeeze().tolist()16 matched =[t for t, p inzip(EMOTIONS, probs)if p >= THRESHOLD]17return matched or["no emotion"]181920sentences =["Enough lies, enough hypocrisy","I'm so proud of our govenrment","Climate change is a risk to our planet","Trump is the president of the US"]21for sentence in sentences:22print(sentence, predict(sentence))2324# Enough lies, enough hypocrisy ['anger']25# I'm so proud of our govenrment ['pride']26# Climate change is a risk to our planet ['fear']27# Trump is the president of the US ['no emotion']28
Intended Use
Academic research on emotion in political communication
Analysis of congressional speeches and social media
Temporal trend analysis of emotional rhetoric
Limitations
Trained exclusively on US English political text — performance may degrade on other domains
Emotions are subjective; inter-annotator agreement on intensity scores is inherently noisy
Labels are silver-standard (LLM-generated), not human-verified gold labels