Coder Social home page Coder Social logo

garyyufei / promda Goto Github PK

View Code? Open in Web Editor NEW
67.0 5.0 11.0 3.31 MB

Source code for ACL 2022 Paper "Prompt-based Data Augmentation for Low-Resource NLU Tasks"

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

Python 91.92% Shell 8.08%
acl2022 prompt dataaugmentation

promda's Introduction

Prompt-based Data Augmentation for Low-Resource NLU Tasks

This repository is the official implementation of PromDA: Prompt-based Data Augmentation for Low-Resource NLU Tasks.

PromDA

Requirements

To install requirements:

conda create --name exp --file requirements.txt

Pre-training Soft Prompt

To obtain C4 realnewslike split, please run:

python get_large_pre_training_c4_data.py

We need to do the Prompt Pre-training, please run:

python pre_train_t5.py --config model_config/pre_train_keyword_pt.yml --serialization-dir pretrain_web_page_keyword_t5_short --train

In a Nvidia A100 GPU, it takes about 24 hours to complete the pre-training.

We also provide the checkpoint that we used in the paper here. Please put the file folder pretrain_web_page_keyword_t5_short in the root directory of this project.

Run PromDA

To run the full data augmentation experiments, please follow below instructuins:

Sequence Labelling Tasks

To run the wikiann experiments on the first GPU under the shot-10 setting using random seed 18, please run

bash script/run_few_shot_bert_prefix.sh 0 18 10 wikiann 1000

Sentence Classification Tasks

To run the sst2 experiments on the first GPU under the shot-10 setting using random seed 18, please run

bash script/run_few_shot_bert_prefix_sen_cls.sh 0 18 10 sst2 1000

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.