Giter VIP home page Giter VIP logo

hierarchical-seq2seq's Introduction

Hierarchical Sequence to Sequence Model for Multi-Turn Dialog Generation

A hierarchical sequence to sequence model similar to the hierarchical recurrent encoder-decoder (HRED) in the following paper.

Iulian Vlad Serban, Alessandro Sordoni, Yoshua Bengio, Aaron C. Courville, and Joelle Pineau. Building End-To-End Dialogue Systems Using Generative Hierarchical Neural Network Models. AAAI 2016.

The model consists of three RNNs. At each time step, the encoder RNN takes one utterance as input and encodes it into a fixed-sized context vector, which is the input to the context RNN, and then the decoder RNN generates the response by decoding the output of the context RNN. Unlike the original paper, the context vector serves only as the initial hidden state of the decoder RNN.

Dataset

We use the DailyDialog dataset, which contains 13,118 multi-turn dialogs in total. In addition, each utterance in each dialog is labeled with one of the Ekman's six emotions plus a neutral one.

Yanran Li, Hui Su, Xiaoyu Shen, Wenjie Li, Ziqiang Cao, and Shuzi Niu. DailyDialog: A Manually Labelled Multi-turn Dialogue Dataset. IJCNLP 2017.

How to Run

The model is implemented using TensorFlow. We use Python version 3.

Please download the dataset from the link provided above, and then extract everything from the ijcnlp_dailydialog.zip file. Rename the extracted folder to corpus. Run python read.py to preprocess the text data. To train the model, run python main.py. To predict, run python main.py --predict, and make sure that you have a space before each punctuation when you type some input text. For various command line arguments, please see the source files.

TODO

  • Multi-layer bidirectional RNN. Currently only single-layer unidirectional architecture is implemented.
  • Attention mechanism. Currently there is no attention mechanism.
  • Model evaluation. Currently all the data are used for training, and no evaluation method is implemented.

hierarchical-seq2seq's People

Stargazers

quantum avatar HanYinong avatar Peihua Chen avatar  avatar Dikea avatar

Watchers

James Cloos avatar Yubo Xie avatar Dikea avatar

hierarchical-seq2seq's Issues

Question about Attention

Hi. I tried to add attention mechanism to your code. But when I run, an error about the shape of input always occurred. And I realized that there was no padding step in your code. Does it influence? I will be very grateful if you can give some suggestion.

Training on GPU

Hi, I try to run your code on a computer with a GeForce 1060 GPU, but it always runs on CPU. Is there anything wrong? I didn't change any code.

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.