YujiaBao / Distributional-Signatures

"Few-shot Text Classification with Distributional Signatures" ICLR 2020
https://arxiv.org/abs/1908.06039
MIT License
254 stars 57 forks source link

How to use the bert pre-trained model on text classification #2

Closed xuetrdi closed 5 years ago

xuetrdi commented 5 years ago

About how to use the bert pre-trained model in this project on text classification, i don't understand. Should I do the following steps? bert==True snapshot=/path/to/pytorch-bert-pre-trained-model.ebd

YujiaBao commented 5 years ago

Snapshot is for loading pertrained model, not BERT. Here is an example of using AVG + prototypical network with BERT embedding on huffpost: python src/main.py --cuda=1 --shot=5 --way=5 --embedding=avg --classifier=proto --mode=train --dataset=huffpost --data_path=data/huffpost_bert_uncase.json -- n_train_class 20 --n_val_class 5 --n_test_class 16 --meta_w_target --meta_idf --bert_path=/data/rsg/nlp/yujia/.pytorch_pretrained_bert --bert