Giter Site home page Giter Site logo

wyu-du / self-training-dialogue-generation Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 0.0 5.94 MB

This repository contains the data and code for the paper "Self-training with Two-phase Self-augmentation for Few-shot Dialogue Generation" (EMNLP2022-Findings).

Home Page: https://arxiv.org/abs/2205.09661

License: Apache License 2.0

Shell 1.16% Python 98.84%
data-selection dialogue-generation few-shot-generation few-shot-learning self-training text-augmentation uncertainty-estimation transformers

self-training-dialogue-generation's Introduction

Self-Training-Dialogue-Generation

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

framework
Here are a few data examples generated by our method:
data

Environment Setup

  1. Install and setup the environment:
conda env create -f environment.yml
conda activate sa2st
  1. 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/

Datasets

  1. Data statistics for FewShotWoz woz

  2. Data statistics for FewShotSGD sgd

Models

Inference Only

  1. Download the model checkpoints on 2 datasets across all domains (check here).
  2. Put the downloaded checkpoints under models.
  3. 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, ...).

Self-training and Inference

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, ...).

Evaluation

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.

Citation

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},  
}

self-training-dialogue-generation's People

Contributors

wyu-du avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

self-training-dialogue-generation's Issues

Link not working

Thank you very much for your work, the link you provided for the pretrained scgpt checkpoint is not working, is it convenient to provide it again?
image

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.