Giter Site home page Giter Site logo

emptransfo's Introduction

EmpTransfo: A Multi-head Transformer Architecture for Creating Empathetic Dialog Systems

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

Installation

To install and use the training and inference scripts please clone the repo and install the requirements:

git clone [email protected]:roholazandie/EmpTransfo.git
cd EmpTransfo
pip install -r requirements.txt

Interact with the chatbot

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

Dataset

The original daily dialog dataset is here. We changed the format to our purpose and can be download from here.

Training

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.

Citation

If you use this code in your research, you can cite our ANLP paper:

@article{zandie2020emptransfo,
  title={EmpTransfo: A Multi-head Transformer Architecture for Creating Empathetic Dialog Systems},
  author={Zandie, Rohola and Mahoor, Mohammad H},
  journal={arXiv preprint arXiv:2003.02958},
  year={2020}
}

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.