zenggo / affective-decoding-4-empathetic-dialog

The code of paper Affective Decoding for Empathetic Response Generation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Code of paper Affective Decoding for Empathetic Response Generation

5 branches for different experiment settings: master(Transfo), adde(AD, AD+DE), adm(AD + multi-task learning), tml(Transfo + multi-task learning), prepend (Transfo + prepending emotion label predicted by fasttext).

Usage

mkdir log
mkdir save
mkdir save/pretrained_lm // download

download the pretrained model params (GPT) from here. Put the files into save/pretrained_lm

Train

Run the command (GPU will be used if available, make sure CUDA is installed):

python train.py --save_path save/model

Interact with model

git checkout adm
python play.py --model_path save/model --turns 2

Requirements

  • PyTorch (version >=1.4)
  • tqdm
  • sklearn
  • spacy (version < 3)
  • ftfy
  • pandas
  • tensorboardX

About

The code of paper Affective Decoding for Empathetic Response Generation


Languages

Language:Python 92.6%Language:Perl 7.4%