Contrast and Generation Make BART a Good Dialogue Emotion Recognizer
- torch==1.7.1
- transformers==4.11.0
- numpy
- pickle
- tqdm
- sklearn
- fitlog
Model runs on one GPU by default, and we didn't try it on CPU.
We recommend using GPU with memory more than 24G , otherwise you may need to adjust the hyperparameters and the results may vary significantly.
To run the model on test sets of four datasets,
-
Download the pre-trained models:
For MELD, download the checkpoint , unzip it to
./save/MELD
For EmoryNLP, download the checkpoint , unzip it to
./save/EmoryNLP
For IEMOCAP, download the checkpoint , unzip it to
./save/IEMOCAP
For DailyDialog, download the checkpoint , unzip it to
./save/DailyDialog
-
Execute the following command in terminal:
For MELD:
bash eval.sh MELD ./save/MELD/best_model_762985
For EmoryNLP:
bash eval.sh EmoryNLP ./save/EmoryNLP/best_model_468186
For IEMOCAP:
bash eval.sh IEMOCAP ./save/IEMOCAP/best_model_981929
For DailyDialog:
bash eval.sh DailyDialog ./save/DailyDialog/best_model_738497
For MELD: bash train.sh MELD
For EmoryNLP: bash train.sh EmoryNLP
For IEMOCAP: bash train.sh IEMOCAP
For DailyDialog: bash train.sh DailyDialog
It should be noticed that performance is greatly affected by random seed. So we recommended some seeds in the script for reproduction.
For MELD: bash eval.sh MELD save/MELD/best_model_939239
For EmoryNLP: bash eval.sh EmoryNLP save/EmoryNLP/best_model_552848
For IEMOCAP: bash eval.sh IEMOCAP save/IEMOCAP/best_model_625968
For DailyDialog: bash eval.sh DailyDialog save/DailyDialog/best_model_269130
If you find this work useful, please cite our work:
@misc{li2021contrast,
title={Contrast and Generation Make BART a Good Dialogue Emotion Recognizer},
author={Shimin Li and Hang Yan and Xipeng Qiu},
year={2021},
eprint={2112.11202},
archivePrefix={arXiv},
primaryClass={cs.CL}
}
Some code of this project are referenced from TodKat and DialogXL. We thank their open source materials for contribution to this task.