Code Monkey home page Code Monkey logo

dir-vhred's Introduction

Dirichlet Latent Variable Hierarchical Recurrent Encoder-Decoder in dialogue generation(EMNLP2019)

Description

This repository hosts the Dir-VHRED model for dialogue generation as described by Min and Yisen et al.2019

requirements

  • pandas==0.20.3
  • numpy==1.14.0
  • gensim==3.1.0
  • spacy==1.9.0
  • tqdm==4.15.0
  • nltk==3.2.5
  • tensorboardX==1.1
  • torch==0.4

1.Prepare the dataset:

1.download the ubuntu corpus in http://dataset.cs.mcgill.ca/ubuntu-corpus-1.0/ & movie corpus in https://www.cs.cornell.edu/~cristian/Cornell_Movie-Dialogs_Corpus.html

2.split the dataset with train/validation/test rate: 0.8,0.1,0.1

3.run code: python3 cornell_preprocess.py python3 ubuntu_preprocess.py

2.Train the model:

python3 train.py --data=ubuntu --batch_size=40 --eval_batch_size=40 --kl_annealing_iter=100000 --word_drop=0.25 --z_sent_size=3

python3 train.py --data=cornell --batch_size=40 --eval_batch_size=40 --kl_annealing_iter=20000 --word_drop=0.25 --z_sent_size=3

3.Evaluate the model(negative log-likelihood):

python3 eval.py --data=ubuntu --batch_size=40 --eval_batch_size=40 --z_sent_size=3 --checkpoint=xxxx

python3 eval.py --data=cornell --batch_size=40 --eval_batch_size=40 --z_sent_size=3 --checkpoint=xxxx

4.Evaluate the model(word-embedding metric):

python3 eval_embed.py --data=ubuntu --batch_size=40 --eval_batch_size=40 --z_sent_size=3 --checkpoint=xxxx --beam_size=5 --n_sample_step=3 #n_sample_step=1 means 1-turn while n_sample_step=3 means 3-turn responses

python3 eval_embed.py --data=cornell --batch_size=40 --eval_batch_size=40 --z_sent_size=3 --checkpoint=xxxx --beam_size=5 --n_sample-step=3

5.Generate the response:

python3 generate_sentence.py --data=ubuntu --batch_size=40 --kl_annealing_iter=100000 --word_drop=0.25 --z_sent_size=3 --checkpoint=xxx

python3 generate_sentence.py --data=cornell --batch_size=40 --kl_annealing_iter=20000 --word_drop=0.25 --z_sent_size=3 --checkpoint=xxx

dir-vhred's People

Contributors

cloversjtu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

dir-vhred's Issues

Problems about the beam search code

Hi, first of all, thank you so much for releasing this nice codes, especially the beam search.

And I have one question about the beam search. It seems that you implemented the beam search from scratch. But, why don't you use the PriorityQueue module in the python? Is there any special reason for this?

Hope to respond to me. Thank you.

Originally posted by @passing2961 in #1 (comment)

Problems about paper and dataset

Hi, first of all, I really thank you for the open-source codes of this wonderful repo.
I searched all the HRED-based codes on GitHub but nothing can help me.
Your pytorch-based HRED codes seem to help me a lot.
So I really appreciate you about this repo.

But I still have some questions. First, I cannot find your paper on the web resource except the EMNLP 2019 accepted paper page and I also want to get in touch with your ideas.
If you are willing to send your paper to me, I will be very happy. (my email address can be found on my GitHub homepage).

Then, I'm also very curious about the dataset. Can I load other datasets to run your code?
Is there anything I should care about?

Hope to respond to me. Thank you!

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.