Skip to content

geri-emp/CAB

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CAB: Empathetic Dialogue Generation with Cognition, Affection and Behavior

This is the official implementation for paper CAB: Empathetic Dialogue Generation with Cognition, Affection and Behavior.

Model Architecture

Image of KEMP

Setup

  • Check the packages needed or simply run the command:
pip install -r requirements.txt
  • Download GloVe vectors from here (glove.840B.300d.txt) and put it into /data/.

  • Download the completely processed dataset data from Google Drive and place it into /data/ for experiments.

  • If you want to see the annotated dataset with dialogue act label and both interlector's emotion lables, then you could:

    • Download the processed EmpatheticDialogues dataset with dialogue act label and both interlector's emotion lables from here and place processed dataset train.json, valid.json and test.json into /data/ed_data/.
  • If you want to reconstruct knowledge paths, then you could:

    • Download the processed ConceptNet data and place processed data ConceptNet_ranked_dict.json into /data/knowledge_data/, meanwhile, download dataset_preproc.p and place it into /data/.
  • For reproducibility purposes, we place the model checkpoints. You could download and move it under /save/final/.

  • To skip training, please check folder /result/CAB/output.txt/.

Training

CAB (Our)

python main.py \
--cuda \
--batch_size 16 \
--lr 1e-4 \
--hidden_dim 300 \
--emo_dim 300 \
--act_dim 300 \
--latent_dim 200\
--hop 1 \
--heads 2 \
--pretrain_emb \
--model CAB \
--multi_hop 5 \
--K_num 5 \
--k_num 3 \
--path_num 15 \
--pointer_gen \
--emb_file data/glove.840B.300d.txt

Testing

Add --test into above commands.

You can directly run /evaluate_result.py script to evaluate the model predictions.

Citation

If you find our work useful, please cite our paper as follows:

@article{CAB2023,
      title={CAB: Empathetic Dialogue Generation with Cognition, Affection and Behavior}, 
      author={Pan Gao, Donghong Han, Rui Zhou, Xuejiao Zhang, Zikun Wang},
      journal={arXiv preprint arXiv:2302.01935},
      year={2023},
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages