Giter VIP home page Giter VIP logo

cab's Introduction

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},
}

cab's People

Contributors

geri-emp avatar

Stargazers

 avatar  avatar 夏慵懒 avatar  avatar  avatar han avatar

Watchers

 avatar

Forkers

zxiaohen

cab's Issues

some questions of concept_proc.py

we have some questions about the processing of knowledge paths. Because the values of 'triples', 'key_tokens' that we get just based on the concept_proc.py file that you provided, And the "triple" value and key_token' value in all_ed_concept_dataset_preproc.p provided by you are quite different. Can you provide specific operation and use steps of concept_proc.py file? We found many unreasonable aspects in concept_proc.py.
Thanks !

tra_preproc.json

FileNotFoundError: [Errno 2] No such file or directory: '../prepare_data/tra_preproc.json'

The code in the data processing file has bug

We found that data/process/data_loader.py has a line of code self.data["key_tokens"][index], what is its relationship with self.data["key_concepts"][index], in data/process/concept_proc.py The processing code does not get data such as self.data["key_tokens"], where does the data of self.data["key_tokens"] come from?

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.