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. If you want the dataset with topics you can download it 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:

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

emptransfo's People

Contributors

roholazandie avatar

Stargazers

han avatar  avatar  avatar jiaqiangwjq avatar wonderengg avatar Aditya Thakur avatar  avatar Parker Hsu avatar Zero avatar mengjiao gan avatar  avatar  avatar nik_kon avatar  avatar Osamu Mitsuishi avatar  avatar Mike Lay avatar  avatar Hafiza Mahnoor Abbasi avatar  avatar  avatar  avatar CMind Lin avatar Lirean avatar huygrijhuir avatar anna avatar Ali Ahmadnejad avatar

Watchers

James Cloos avatar Ali Ahmadnejad avatar  avatar Lirean avatar paper2code - bot avatar

emptransfo's Issues

Where are the emotion and action embeddings?

In your report you mention using additional embeddings for emotions and actions. I can not find any reference to these in the source code. Are they missing, or named something non-obvious?

dialog act classification

Hello.
I'm trying to fine-tune the model with new dataset, I'm searching for dialog act classification for "candidates_acts", would you recommending a good model.
thanks for help!

Issue with running EmpTransfo code

Got an error with initial setup and code reproducing. Please help me out running the code.

INFO:train_multihead.py:Build inputs and labels
INFO:train_multihead.py:Pad inputs and convert to Tensor
Traceback (most recent call last):
File "train_multihead.py", line 308, in
train()
File "train_multihead.py", line 204, in train
train_loader, val_loader, train_sampler, valid_sampler = get_data_loaders(config, tokenizer)
File "train_multihead.py", line 147, in get_data_loaders
tensor = torch.tensor(dataset[input_name])
TypeError: an integer is required (got type list)

Topic key error when i try to train with the train_multihead.py script

File "train_multihead.py", line 202, in train
train_loader, val_loader, train_sampler, valid_sampler = get_data_loaders(config, tokenizer)
File "train_multihead.py", line 118, in get_data_loaders
topic = dialog["topic"]
KeyError: 'topic'

It doesn't exist 'topic' key in the format dataset you propose from what i understand ?

Deprication of tb_logger.attach( ..., another_engine=trainer),...)

Hi,

Sorry for the confusing issue name but as I understand it, the ignite Engine has depricated the use of some of their engine functionalities including the "another_engine" parameter in train.py. When attempting a quick fix to remove this parameter, the model does not train beyond the first epoch.

Is there a way to run this code in the intended ignite and pytorch requirements so as to not get deprication warnings and unexpected functionalities? Is it possible to dockerize this code by any chance?

Thank you.

下载的模型

下载的模型是已经预训练好的么 还是什么模型

data preprocessing

Can you provide the code to process the original dataset?
thank you very much😃

seq2seq + attention model

Hello, is the dataset used in seq2seq + attention in the paper multiple rounds or single theory?
Is the multi-round divided into a single round?

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.