Code Monkey home page Code Monkey logo

cog-bart's Introduction

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.

cog-bart's People

Contributors

whatissimondoing avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.