/Distributional-Signatures

Few-shot Text Classification with Distributional Signatures

Primary LanguagePythonMIT LicenseMIT

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

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 pretrain word vector 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