Giter Site home page Giter Site logo

shiweiba / deep-reinforcement-learning-for-dialogue-generation-in-pytorch Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ls-dai/deep-reinforcement-learning-for-dialogue-generation-in-pytorch

0.0 0.0 0.0 19.81 MB

License: MIT License

Python 100.00%

deep-reinforcement-learning-for-dialogue-generation-in-pytorch's Introduction

Reinforcement Learning for Dialogue Generation

This is the repo for ELEN 6885 Reinforcement Learning Project.

We reimplement the paper Deep Reinforcement Learning for Dialogue Generation in PyTorch. Compared to the original paper, we changed the dataset.

Authors: Lisen Dai, Xiangcong Kong, Yixian Cheng, Rui Sun. Report.

Abstract

Recently, neural models in dialogue generation have shown great promise for generating responses in conversational agents. But they tend to be shortsighted and predicting utterances one at a time while ignoring their impact on future outcomes. As a result, predicting the future content of a dialogue is significant to generate coherent, rational and interesting dialogues. It shows a need to let traditional NLP dialogue models be combined with reinforcement learning. In this paper, we show how these goals are integrated, which means we apply deep reinforcement learning to model future reward in chatbot dialogue. The model simulates dialogues between two virtual agents, using policy gradient methods to reward sequences that display some important conversational properties: informativity, coherence, and ease of answering. Then, we evaluate our model on diversity, length as well as with human judges, showing that the proposed algorithm generates more interactive responses and manages to foster a more sustained conversation in dialogue simulation.

Installation

  • Clone this repo, and we'll call the directory that you cloned as ${DRL4DG_ROOT}
  • Install dependencies. We use python 3.8 and pytorch >= 1.7.0
conda create -n DRL4DG
conda activate DRL4DG
conda install pytorch==1.7.0 torchvision==0.8.0 cudatoolkit=10.2 -c pytorch
cd ${DRL4DG_ROOT}
pip install -r requirements.txt

Dataset

High-quality first sentence as the starting of dialogue is important to the simulation. Some sentences, such as "What?", are not good enough for the simulation. Those are so vague and lack of context, making it confusing to answer. To avoid this, we choose a very standard dataset named "DailyDialog". DailyDialog is a high-quality multi-turn dialog dataset, human-written and less noisy. Not only the dialogue text, it also has labels of communication intention and emotion information. However, in our experiments, we only use the texts.

Apart from this, we also use the scripts from Rick and Morty to train our model. We found the dataset on Kaggle. It might be a little bit noisy but more likely to be daily.

Training

We trained the model on one GeForce GTX 1080 Ti GPU. Training on GPUs is recommended.

cd ${DRL4DG_ROOT}
CUDA_VISIBLE_DEVICES=0 python train.py

Experimental Results

image

image

image

Acknowledgement

Thanks for the assistance from Prof.Li and Prof.Wang. Also, thanks for every member's commitment.

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.