Code Monkey home page Code Monkey logo

color4dial's Introduction

Color4Dial

This repository contains code and data for the paper Dialogue Planning via Brownian Bridge Stochastic Process for Goal-directed Proactive Dialogue accepted by ACL Findings 2023.

Overview

Goal-directed dialogue systems aim to proactively reach a pre-determined target through multi-turn conversations. The key to achieving this task lies in planning dialogue paths that smoothly and coherently direct conversations towards the target. In this work, we propose a coherent dialogue planning approach via Brownian bridge (COLOR) stochastic process, to model the temporal dynamics of dialogue paths. We define a latent space that captures the coherence of goal-directed behavior using a Brownian bridge process, which allows us to incorporate user feedback flexibly in dialogue planning. Based on the derived latent trajectories, we generate dialogue paths explicitly using pre-trained language models. We finally employ these paths as natural language prompts to guide dialogue generation.

Requirements

The required packages are listed in requirements.txt. Suppose you use Anaconda to manage the Python dependencies, you can install them by running:

conda create -n color4dial python=3.10
conda activate color4dial
pip install -r requirements.txt

Datasets

We upload the datasets used in our experiments to the OneDrive cloud. Please download DuRecDial 2.0 and TGConv datasets and put them in the data folder.

cd data
unzip DuRecDial2.zip & rm DuRecDial2.zip
unzip TGConv.zip & rm TGConv.zip

Quickstart

Take the DuRecDial 2.0 dataset as an example, our experiments are divided into three stages.

Stage 1: Brownian Bridge Mapping

In this stage, we learn a mapping in the Brownian bridge latent space that captures coherent temporal dynamics for planning dialogue paths.

bash scripts/durecdial_planning_train_bridge.sh

For more details of parameter settings, please refer to main_planning.py.

Stage 2: Planning Dialogue Paths

Based on the learned Brownian bridge mapping, we train a planner model and use it to plan dialogue paths.

# model training
bash scripts/durecdial_planning_train_planner.sh

# model inference
bash scripts/durecdial_planning_infer_planner.sh

For more details of parameter settings, please refer to main_planning.py.

Stage 3: Generating Dialogue Utterances

Finally, we employ the planned dialogue paths as natural language prompts to guide dialogue generation.

# model training
bash scripts/durecdial_dialog_train.sh

# model inference
bash scripts/durecdial_dialog_test.sh

For more details of parameter settings, please refer to main_dialog.py.

Evaluation

To evaluate the performance dialogue planning, please run:

python eval/eval_planning.py --dataset <dataset_name> \
  --eval_file <path_to_eval> \
  --gold_file <path_to_gold_data>

To evaluate the performance of dialogue generation, please run:

# for DuRecDial 2.0 dataset
python eval/eval_dialog_durecdial.py --eval_file <path_to_eval> \
  --gold_file <path_to_gold_data>

# for TGConv dataset
python eval/eval_dialog_tgconv_selfplay.py --eval_file <path_to_eval>

Acknowledgement

Our code is based on parts of the implementations of Huggingface Transformers and Language Modeling via Stochastic Processes. We thank the authors for their excellent work.

Citation

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

@inproceedings{wang-etal-2023-dialogue,
    title = "Dialogue Planning via Brownian Bridge Stochastic Process for Goal-directed Proactive Dialogue",
    author = "Wang, Jian  and
      Lin, Dongding  and
      Li, Wenjie",
    booktitle = "Findings of the Association for Computational Linguistics: ACL 2023",
    month = jul,
    year = "2023",
    address = "Toronto, Canada",
    publisher = "Association for Computational Linguistics",
    url = "https://aclanthology.org/2023.findings-acl.25",
    pages = "370--387"
}

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.