EmpDialogue_RecEC
EmpDialogue_RecEC copied to clipboard
Source code for our paper "Improving Empathetic Response Generation by Recognizing Emotion Cause in Conversations"
Source code for our paper "Improving Empathetic Response Generation by Recognizing Emotion Cause in Conversations"
this repository is maintained by both Jun Gao and Yuhan Liu
Environment Requirment
- pytorch >= 1.4.0
- texar.torch
- bert-score
- nltk
Model Overview

Running
-
we use RECCON to train an emotion cause detection model and apply it to annatate EmpatheticDialogues. The processed data is in
Data. -
Then you need to pretrain the emotion classification model, here you need to download glove.6B.300d first and then running the following command. Here
$GLOVEis the glove embedding file:bash ./bash/run_emotion.sh --glove $GLOVE --gpu_id 0 -
To train the model and generate the automatic metric results, firstly you need to make sure that bert-score is successfully installed. In our paper, we use roberta-large-en rescaled with baseline to calculate BERTScore. You can download roberta-large-en from Hugginface. For the rescaled_baseline file, we can download it from here.
Then run the following command. Here
$ROBERTA_DIRis the downloaded roberta-large-en model directory and$BASELINEis downloaded baseline file.to train soft-gate model:
bash ./bash/run_generation.sh --glove $GLOVE --gpu_id 0 --mode soft --roberta $ROERBTA_DIR --baseline $BASELINE --do_trainto test soft-gate model:
bash ./bash/run_generation.sh --glove $GLOVE --gpu_id 0 --mode soft --roberta $ROERBTA_DIR --baseline $BASELINE --do_testto train hard-gate model:
bash ./bash/run_generation.sh --glove $GLOVE --gpu_id 0 --mode hard --roberta $ROERBTA_DIR --baseline $BASELINE --do_trainto test hard-gate model:
bash ./bash/run_generation.sh --glove $GLOVE --gpu_id 0 --mode hard --roberta $ROERBTA_DIR --baseline $BASELINE --do_test
Acknowledgement
@inproceedings{gao-etal-2021-improving-empathetic,
title = "Improving Empathetic Response Generation by Recognizing Emotion Cause in Conversations",
author = "Gao, Jun and Liu, Yuhan and Deng, Haolin and Wang, Wei and Cao, Yu and Du, Jiachen and Xu, Ruifeng",
booktitle = "Findings of the Association for Computational Linguistics: EMNLP 2021",
month = nov,
year = "2021",
pages = "807--819",
publisher = "Association for Computational Linguistics"
}