The present repo contains the code for the paper https://arxiv.org/abs/2003.02958 on empathetic dialog system. The repository is heavily influenced by https://github.com/huggingface/transfer-learning-conv-ai
To install and use the training and inference scripts please clone the repo and install the requirements:
git clone git@github.com:roholazandie/EmpTransfo.git
cd EmpTransfo
pip install -r requirements.txt
You can download the the checkpoint model here, extract and point to it from interact_config.json "model_checkpoint" value. For example:
"model_checkpoint" : "/home/rohola/codes/EmpTransfo/emp_transfo_checkpoint"
Then run interact.py
python interact.py
The original daily dialog dataset is here. We changed the format to our purpose and can be download from here. If you want the dataset with topics you can download it here
The script train_multihead.py uses three heads with all features.
The script train_full.py uses two heads (next sentence prediction and LM head), but uses all the features.
The script train_emotion_recognition.py trains to predict the next emotion (wihtout no_emotion).
The script train.py trains without any features of the dataset (the base model).
For all training scripts just change the dataset_path in config.json file related to that task, and then run the script without any arguments.
If you use this code in your research, you can cite our ANLP paper:
@inproceedings{zandie2020emptransfo,
title={EmpTransfo: A Multi-head Transformer Architecture for Creating Empathetic Dialog Systems},
author={Zandie, Rohola and Mahoor, Mohammad H},
booktitle={The Thirty-Third International Flairs Conference},
year={2020}
}