This repository contains the data and code for the paper:
Self-training with Two-phase Self-augmentation for Few-shot Dialogue Generation
Wanyu Du, Hanjie Chen and Yangfeng Ji
Findings of EMNLP 2022
Here are a few data examples generated by our method:
- Install and setup the environment:
conda env create -f environment.yml
conda activate sa2st
- Download the pretrained scgpt checkpoint, put it under
src
:
wget https://bapengstorage.blob.core.windows.net/fileshare/scgpt.tar.gz
tar xvf scgpt.tar.gz
mv scgpt src/
- Download the model checkpoints on 2 datasets across all domains (check here).
- Put the downloaded checkpoints under
models
. - Run the following script to obtain our models' predictions on dev and test set:
bash sa2_infer.sh {DATASET} {DOMAIN} {CUDA}
{DATASET}
indicates the dataset, including FewShotWoz, FewShotSGD.
{DOMAIN}
indicates the domain, including attraction, hotel, laptop, ....
{CUDA}
indicates the index of the GPU (e.g. 0, 1, 2, 3, ...).
If you want to train the model from scratch, you can run the following script:
bash sa2_woz.sh {DOMAIN} {FLAG} {LR} {EPOCH} {CUDA}
{DOMAIN}
indicates the domain, including attraction, hotel, laptop, ...
{FLAG}
indicates the model checkpoint name flag.
{LR}
indicates the learning rate.
{EPOCH}
indicates the training epoch.
{CUDA}
indicates the index of the GPU (e.g. 0, 1, 2, 3, ...).
The evaluation srcipt is included in sa2_inference.py
and sa2_self_training.py
.
The evaluation scores on dev and test set will be saved under the current model checkpoint folder.
If you find this work useful for your research, please cite our paper:
@inproceedings{du2022sa,
title = {Self-training with Two-phase Self-augmentation for Few-shot Dialogue Generation},
author = {Du, Wanyu and Chen, Hanjie and Ji, Yangfeng},
journal = {arXiv preprint arXiv:2204.01227},
year = {2022},
doi = {10.48550/ARXIV.2205.09661},
url = {https://arxiv.org/abs/2205.09661},
}