GithubHelp home page GithubHelp logo

meta-sn's Introduction

Meta-Learning Siamese Network for Few-Shot TextClassification

This repository contains the code and data for our DASFAA 2023 paper:

Meta-Learning Siamese Network for Few-Shot TextClassification

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

@inproceedings{han2023meta,
  title={Meta-learning Siamese Network for Few-Shot Text Classification},
  author={Han, Chengcheng and Wang, Yuhe and Fu, Yingnan and Li, Xiang and Qiu, Minghui and Gao, Ming and Zhou, Aoying},
  booktitle={Database Systems for Advanced Applications: 28th International Conference, DASFAA 2023, Tianjin, China, April 17--20, 2023, Proceedings, Part III},
  pages={737--752},
  year={2023},
  organization={Springer}
}

Data

We ran experiments on a total of 6 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.
RCV1 (link) Processed data available.
FewRel (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 1-shot.sh

or

cd bin
sh 5-shot.sh

You can also adjust the model by modifying the parameters in the 1-shot.sh or 5-shot.sh file to run on diffrent data sets.

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

meta-sn's People

Contributors

hccngu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

meta-sn's Issues

I'm curious if this is a bug

Hello, during my study of your code, I noticed that in the return values of loader.load_dataset(), was "val_data" mistakenly written as "test_data"?

how to use BERT as encoder?

I try to run your model for my research.
for fair comparison, I try to use BERT as encoder. In your paper, you also did an experiment of BERT as encoder.
BUT, I cannot find how to use BERT as encoder for your model.

I found that an argument (--bert) in shell script. however, I cannot find any source code to use BERT as an encoder in the source.

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.