Reward-EmoPair
Pairwise reward model trained on the EmoPair dataset for scoring text along three emotional dimensions: Valence, Arousal, and Dominance.
Model description
A roberta-large encoder with three scalar output heads:
- Valence head: regression against gold 1–5 EmoBank scores (MSE loss)
- Arousal head: pairwise ranking trained with BCE loss on paired comparisons
- Dominance head: pairwise ranking trained with BCE loss on paired comparisons
The model outputs continuous scores for each dimension; Arousal and Dominance scores are correlated with Bradley-Terry scores derived from pairwise annotations.
Base model: roberta-large
Training details
| Parameter | Value |
|---|---|
| Epochs (max) | 20 |
| Mini-batch size | 16 |
| Effective batch size | 64 |
| Learning rate | 2e-06 |
| Weight decay | 0.05 |
| Dropout | 0.2 |
| Max sequence length | 256 |
| Early-stopping patience | 7 |
| Seed | 42 |
Evaluation results
Pairwise test-set accuracy
| Metric | Valence | Arousal | Dominance | Overall |
|---|---|---|---|---|
| Accuracy | 0.8313 | 0.8537 | 0.7703 | 0.8184 |
Pearson correlation with Bradley-Terry scores (A/D) and gold V
| Split | Valence r | Arousal BT r | Dominance BT r |
|---|---|---|---|
| Dev | 0.8015 | 0.8254 | 0.7094 |
| Test | 0.8051 | 0.8706 | 0.7263 |
Files
| File | Description |
|---|---|
pytorch_model.pth |
Full model checkpoint (weights + optimizer + scheduler state) |
training_args.json |
Hyperparameters used during training |
test_results.csv |
Per-split test-set metrics |
regression_metrics.json |
Dev/test Pearson correlations vs BT and gold V scores |
training_history.csv |
Per-epoch training and eval losses |
Usage
The example below assumes you have cloned this repository and downloaded the model files from the Hugging Face repo into the current working directory.
from huggingface_hub import snapshot_download
from pathlib import Path
import importlib.util
repo_id = "edsi-umd/Reward-EmoPair"
local_dir = snapshot_download(repo_id=repo_id, repo_type="model")
# Dynamically load the RewardModel class from the downloaded repository
reward_model_path = Path(local_dir) / "RewardModel.py"
spec = importlib.util.spec_from_file_location("reward_model", str(reward_model_path))
reward_mod = importlib.util.module_from_spec(spec)
spec.loader.exec_module(reward_mod)
RewardModel = reward_mod.RewardModel
model = RewardModel(model_name="roberta-large", max_length=256)
checkpoint = Path(local_dir) / "pytorch_model.pth"
model.load(str(checkpoint))
model.eval()
scores = model.score_text("I can't believe how amazing this feels!")
print(scores) # {'valence': ..., 'arousal': ..., 'dominance': ...}
If you prefer to keep the class definition in a separate file, the same snippet works as long as the repository checkout is on sys.path and the checkpoint file is available next to your current working directory.
Citation
If you use this model, please cite the EmoPair paper and dataset using the most recent citation on the GitHub repository, https://github.com/EDSI-UMD-College-Park/EMOPAIR.