Home

Awesome

few-shot-text-classification

Few-shot binary text classification with Induction Networks and Word2Vec weights initialization

Reference

This is an PyTorch implementation of IJCNLP 2019 paper Induction Networks for Few-Shot Text Classification.

Few-shot Classification

Prerequisites

pip install -r requirements.txt

Parameters

Dataset: Amazon Review Sentiment Classification (ARSC)

This dataset comes from NAACL 2018 paper Diverse Few-Shot Text Classification with Multiple Metrics.

Train TasksDev TasksTest Tasks
19 * 3 = 574 * 3 = 124 * 3 = 12

Download

Process

python data.py

Word2Vec

python word2vec.py

Model

Train, Dev and Test

export CUDA_VISIBLE_DEVICES=1
python main.py

Result on ARSC

tensorboard --logdir=log/
Train LossTrain Accuracy
train_losstrain_acc
Dev Accuracy (achieves the highest 0.8410 at episode 9200)Test Accuracy (at episode 9200)Test Accuracy (paper)
dev_loss0.84520.8563

Author

Zhongyu Chen