Home

Awesome

Multi-turn Response Selection

Paper: Multi-turn Response Selection using Dialogue Dependency Relations has been accepted by EMNLP 2020 (link).

Response selection

Download the dataset

Download the discourse parsed DSTC7 datasets from Google Drive and unzip into ~/code/data.

The other other two dataset used in this paper can be downloaded here:

Getting Started

The code for this paper is based on ParlAI. The original codes this repository based on can be downloaded here.

To build the environment with anaconda:

conda create -n Thread-Enc python=3.7 pytorch=1.1
conda activate Thread-Enc
pip install -r requirements.txt

Run the following commands to setup the code:

cd ~/code; 
python setup.py develop

Run this command to finetune Thread-bi encoder (e.g. DSTC7):

python3 -u examples/train_model.py --init-model zoo:pretrained_transformers/poly_model_huge_reddit/model --shuffle True --eval-batchsize 4 --batchsize 32  --model transformer/parencoder --warmup_updates 100 --lr-scheduler-patience 0 --lr-scheduler-decay 0.4 -lr 5e-05 --data-parallel True --history-size 20 --label-truncate 72 --text-truncate 360 -vp 3 -veps 0.5 --validation-metric accuracy --validation-metric-mode max --save-after-valid True --log_every_n_secs 20 --candidates batch --dict-tokenizer bpe  --dict-lower True --optimizer adamax --output-scaling 0.06 --variant xlm --reduction_type mean --share-encoders False --learn-positional-embeddings True --n-layers 12 --n-heads 12 --ffn-size 3072 --attention-dropout 0.1 --relu-dropout 0.0 --dropout 0.1 --n-positions 1024 --embedding-size 768 --activation gelu --embeddings-scale False --n-segments 2 --learn-embeddings True --share-word-embeddings False --dict-endtoken __start__ -pyt par_dstc7 --fp16 False --par_type basic --par_num 4 --reduction-type mean --parencoder-type codes --model-file ./thread_bi_dstc7

Run this command to finetune Thread-poly encoder(e.g. DSTC7):

python3 -u examples/train_model.py --init-model zoo:pretrained_transformers/poly_model_huge_reddit/model -pyt par_dstc7 --eval-batchsize 4 --batchsize 32  --model transformer/parpolyencoder --warmup_updates 100 --lr-scheduler-patience 0 --lr-scheduler-decay 0.4 -lr 5e-05 --data-parallel True --history-size 20 --label-truncate 72 --text-truncate 360 -vp 3 -veps 0.5 --validation-metric accuracy --validation-metric-mode max --save-after-valid True --log_every_n_secs 20 --candidates batch --dict-tokenizer bpe  --dict-lower True --optimizer adamax --output-scaling 0.06 --variant xlm --reduction_type mean --share-encoders False --learn-positional-embeddings True --n-layers 12 --n-heads 12 --ffn-size 3072 --attention-dropout 0.1 --relu-dropout 0.0 --dropout 0.1 --n-positions 1024 --embedding-size 768 --activation gelu --embeddings-scale False --n-segments 2 --learn-embeddings True --share-word-embeddings False --dict-endtoken __start__ --fp16 False --polyencoder-type codes --codes-attention-type basic --poly-n-codes 64 --poly-attention-type basic --polyencoder-attention-keys context --par_type basic --par_num 4 --reduction-type mean --parencoder-type codes --model-file ./thread_poly_dstc7

The comparison of baselines and our models on DSTC7 are shown as follows:

hits@1hits@10hits@50MRR
DAM (Zhou et al., 2018)34.766.3-35.6
ESIM-18 (Dong and Huang, 2018)50.178.395.459.3
ESIM-19 (Chen and Wang, 2019)64.590.299.473.5
Bi-Enc (Humeau et al., 2019)70.990.6-78.1
Poly-Enc (Humeau et al., 2019)70.991.5-78.0
Cross-Enc (Humeau et al., 2019)71.792.4-79.0
Thread-bi73.392.599.380.2
Thread-poly73.293.699.180.4

Dependency Parsing

The new dataset we used to train the dependency parsing model is transformed from the dataset proposed in "A large-scale corpus for conversation disentanglement".

The new dataset can be downloaded here. It includes:

It should be noted that we only use this model to predict if there exists a dependency relation between two utterances and ignored the relation types. The "type" of each relation in our generated dataset is meaningless.