GithubHelp home page GithubHelp logo

mlada's Introduction

Meta-Learning Adversarial Domain Adaptation Network for Few-Shot Text Classification

This repository contains the code and data for our ACL 2021 paper:

Meta-Learning Adversarial Domain Adaptation Network for Few-Shot Text Classification

If you find this work useful and use it on your own research, please cite our paper.

@inproceedings{MLADA:conf/acl/HanFZQGZ21,
  author    = {Chengcheng Han and
               Zeqiu Fan and
               Dongxiang Zhang and
               Minghui Qiu and
               Ming Gao and
               Aoying Zhou},
  title     = {Meta-Learning Adversarial Domain Adaptation Network for Few-Shot Text
               Classification},
  booktitle = {Findings of the Association for Computational Linguistics: {ACL/IJCNLP}
               2021, Online Event, August 1-6, 2021},
  series    = {Findings of {ACL}},
  volume    = {{ACL/IJCNLP} 2021},
  pages     = {1664--1673},
  publisher = {Association for Computational Linguistics},
  year      = {2021},
}

Overview

We propose an adversarial domain adaptation network to enhance meta-learning framework, with the objective of improving the model’s adaptive ability for new tasks in new domains.

We first utilize two neural networks competing against each other, separately playing the roles of a domain discriminator and a meta-knowledge generator. The adversarial network is able to strengthen the adaptability of the meta-learning architecture.

Moreover, we aggregate transferable features generated by the meta-knowledge generator with sentence-specific features to produce high-quality sentence embeddings.

Finally, we utilize a ridge regression classifier to obtain final classification results.

The figure gives an overview of our model.

Data

We ran experiments on a total of 4 datasets. You may unzip our processed data file data.zip and put the data files under data/ folder.

Dataset Notes
20 Newsgroups (link) Processed data available. We used the 20news-18828 version, available at the link provided.
Reuters-21578 (link) Processed data available.
Amazon reviews (link) We used a subset of the product review data. Processed data available.
HuffPost headlines (link) Processed data available.

Please download pretrained word embedding file wiki.en.vec from here and put it under pretrain_wordvec/ folder.

Quickstart

After you have finished configuring the data/ folder and the pretrain_wordvec/ folder, you can run our model with the following commands.

cd bin
sh mlada.sh

You can also adjust the model by modifying the parameters in the malada.sh file.

Dependencies

  • Python 3.7
  • PyTorch 1.6.0
  • numpy 1.18.5
  • torchtext 0.7.0
  • termcolor 1.1.0
  • tqdm 4.46.0
  • CUDA 10.2

mlada's People

Contributors

hccngu avatar

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.