Giter VIP home page Giter VIP logo

metast's Introduction

Meta Self-training for Few-shot Neural Sequence Labeling

This is the implementation of the paper Meta Self-training for Few-shot Neural Sequence Labeling. MetaST is short for meta-learning for self-training.

Overview

In this work we present MetaST, a self-training framework with auto data selection technique to prevent error probagation. You can find more details of this work in our paper.

Setup Environment

Install via pip:

  1. create a conda environment running Python 3.6:
conda create --name MetaST python=3.6
conda activate MetaST
  1. install the required dependencies:
pip install -r requirements.txt

Use docker:

  1. Pull docker
docker pull yaqing/pytorch-meta-st:v0.3
  1. Run docker
docker run -it --rm --runtime nvidia  yaqing/pytorch-meta-st:v0.3 bash

Please refer to the following link if you first use docker: https://docs.docker.com/

Quick start

Run MetaST

Training on SNIPS
> bash ./scripts/run_snips.sh

Note that we ran experiments on V100 GPU (32GB) for base MetaST models. You may need to reduce batch size for other GPUs.

Supported datasets:

SNIPS, CONLL03 (En / multilingulal), MIT Movie, MIT restaurant, Wikiann (En / multilingulal) with shot of 5, 10, 20, 100.

Supported models:

  1. BERT: BERT-based classifier

We will soon add more language model families.

Notes and Acknowledgments

The implementation is based on https://github.com/huggingface/transformers
We also used some code from: https://github.com/cliang1453/BOND

How do I cite MetaST?

@inproceedings{10.1145/3447548.3467235,
author = {Wang, Yaqing and Mukherjee, Subhabrata and Chu, Haoda and Tu, Yuancheng and Wu, Ming and Gao, Jing and Awadallah, Ahmed Hassan},
title = {Meta Self-Training for Few-Shot Neural Sequence Labeling},
year = {2021},
publisher = {Association for Computing Machinery},
booktitle = {Proceedings of the 27th ACM SIGKDD Conference on Knowledge Discovery & Data Mining},
pages = {1737โ€“1747},
series = {KDD '21}
}

metast's People

Contributors

microsoftopensource avatar subhomj avatar yaqingwang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

metast's Issues

error in update_parameters

CUDA out of memory when runing update_parameters
File "/data/med-NLP/li-BERT-NER-Pytorch-master/metaST/modeling_meta_bert.py", line 339, line 339, in update_parameters
create_graph=not first_order, allow_unused=True)
File "/home/anaconda3/envs/wlhtc/lib/python3.7/site-packages/torch/autograd/init.py", line 228, in grad
inputs, allow_unused, accumulate_grad=False)
RuntimeError: CUDA out of memory. Tried to allocate 48.00 MiB (GPU 0; 10.76 GiB total capacity; 9.44 GiB already allocated; 5.12 MiB free; 9.61 GiB reserved in total by PyTorch)

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.