Skip to content

farisxiong/UAR

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

UAR: Towards Unified Affective Reasoning via In-Context Reinforcement Learning

This repository contains the official implementation for our SIGIR '26 paper UAR: Towards Unified Affective Reasoning via In-Context Reinforcement Learning. UAR studies unified affective reasoning across emotion recognition, sentiment analysis, stance detection, sarcasm detection.

The codebase provides reinforcement learning training scripts built on top of verl, and evaluation scripts for both in-domain and out-of-domain benchmarks.

📁 Repository Structure

.
├── data/                 # Raw and processed datasets
├── eval/                 # In-domain and OOD evaluation scripts
├── outputs/              # Evaluation outputs and logs
├── preprocess/           # Preprocessing utilities
├── scripts/              # RL training entry scripts
└── verl/                 # verl training framework

⚙️ Environment Setup

We recommend using a fresh Python environment.

conda create -n uar python=3.10
conda activate uar
pip install -r requirements.txt

🗂️ Data Preparation

Processed files used by the training scripts are expected under data/processed/, for example:

data/processed/train.parquet
data/processed/test.pkl
data/processed/test_ood.pkl

🚀 Training

Training is launched through the scripts in scripts/. Before running, update the model path, working directory, GPU settings, and logging configuration in the script or pass overrides from the command line.

Run UAR training with in-context data:

bash scripts/run.sh

📊 Evaluation

The evaluation pipeline supports two model backends:

  • vllm: start a local OpenAI-compatible vLLM server automatically.
  • openai: call a remote OpenAI-compatible API endpoint.

For in-domain evaluation, configure the environment variables in eval/run_eval.sh, then run:

bash eval/run_eval.sh

For OOD evaluation, run:

bash eval/run_eval_ood.sh

🧾 Result Summarization

Use the summarization utility to aggregate evaluation outputs:

python eval/summarize_results.py outputs/evaluation/results_your_experiment.json

📝 Citation

If you find our work useful in your research, please consider citing:

@inproceedings{xiong2026uar,
  title     = {Towards Unified Affective Reasoning via In-Context Reinforcement Learning},
  author    = {Xiong, Feng and Wang, Jun and Xu, Ruifeng},
  booktitle = {Proceedings of the 49th International ACM SIGIR Conference on Research and Development in Information Retrieval (SIGIR '26)},
  year      = {2026},
}

About

[SIGIR’ 26] Official code for "Towards Unified Affective Reasoning via In-Context Reinforcement Learning"

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages