Skip to content

Official repository of the AAAI'2022 paper "Contrast and Generation Make BART a Good Dialogue Emotion Recognizer"

License

Notifications You must be signed in to change notification settings

whatissimondoing/CoG-BART

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CoG-BART

Contrast and Generation Make BART a Good Dialogue Emotion Recognizer

Required Packages:

  • torch==1.7.1
  • transformers==4.11.0
  • numpy
  • pickle
  • tqdm
  • sklearn
  • fitlog

Run on GPU:

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.

Quick Start

To run the model on test sets of four datasets,

  1. 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

  2. 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

Training:

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.

Evaluation and Prediction:

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

Citation

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}
}

Acknowledgement

Some code of this project are referenced from TodKat and DialogXL. We thank their open source materials for contribution to this task.

About

Official repository of the AAAI'2022 paper "Contrast and Generation Make BART a Good Dialogue Emotion Recognizer"

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published