Giter Site home page Giter Site logo

siat-nlp / ddmn Goto Github PK

View Code? Open in Web Editor NEW
13.0 3.0 5.0 5.53 MB

Code and data for the paper "Dual Dynamic Memory Network for End-to-End Multi-turn Task-oriented Dialog Systems".

License: Apache License 2.0

Python 96.01% Shell 0.71% Perl 3.28%
task-oriented-dialogue dialogue-generation memory-network

ddmn's Introduction

DDMN

This repository contains data and code for the COLING'2020 paper "Dual Dynamic Memory Network for End-to-End Multi-turn Task-oriented Dialog Systems".

In this paper, we propose a Dual Dynamic Memory Network (DDMN) for multi-turn dialog generation, which maintains two core components: dialog memory manager and KB memory manager. The dialog memory manager dynamically expands the dialog memory turn by turn and keeps track of dialog history with an updating mechanism, which encourages the model to filter irrelevant dialog history and memorize important newly coming information. The KB memory manager shares the structural KB triples throughout the whole conversation, and dynamically extracts KB information with a memory pointer at each turn.

Requirements

The implementation is based on Python 3.x. To install the dependencies used in this project, please run:

pip install -r requirements.txt

Quickstart

Step 1: Training

For different datasets, please first set up the following parameters in the script run_train.sh:

data_dir=[xxx]        # directory of the specific dataset
save_dir=[xxx]        # directory to store trained models

and then run:

sh run_train.sh

Note that more arguments for training can be found in the main.py.

For self-critical sequence training, please set up num_epochs larger than pre_epochs but no larger than 3 epochs, since self-critical sequence training for a long time might be unstable sometimes.

Step 2: Testing

For different datasets, please first set up the following parameters in the script run_test.sh:

data_dir=[xxx]        # directory of the specific dataset
save_dir=[xxx]        # directory of the rrtrained models
output_dir=[xxx]      # directory to store generation results

and then run:

sh run_test.sh

Note that more arguments for testing can be found in the main.py.

Step 3: Evaluation

For different datasets, please first set up the following parameters in the script run_eval.sh:

data_name=[xxx]      # ['kvr', 'camrest', 'multiwoz']
data_dir=[xxx]       # directory of the specific dataset
eval_dir=[xxx]       # directory of the generation output

and then run:

sh run_eval.sh

Citation

If you use our code in your work, please cite as:

@inproceedings{wang-etal-2020-dual,
    title = "Dual Dynamic Memory Network for End-to-End Multi-turn Task-oriented Dialog Systems",
    author = "Wang, Jian  and
      Liu, Junhao  and
      Bi, Wei  and
      Liu, Xiaojiang  and
      He, Kejing  and
      Xu, Ruifeng  and
      Yang, Min",
    booktitle = "Proceedings of the 28th International Conference on Computational Linguistics",
    year = "2020",
    address = "Barcelona, Spain (Online)",
    publisher = "International Committee on Computational Linguistics",
    pages = "4100--4110"
}

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.