Code Monkey home page Code Monkey logo

few-shot's Introduction

This repo provides a Pytorch implementation of match network and prototypical network for NLP.

Dataset

I make a few-shot dataset from NYT. This dataset contains 989 sentences. The task aims at predicting same entity in sentence.

Acknowledgements

Special thanks to https://github.com/gitabcworld/MatchingNetworks and https://github.com/orobix/Prototypical-Networks-for-Few-shot-Learning-PyTorch for their implementations.

Training

You can train match network and prototypical network with src/mainNYT.py. If you train match network, you should use fit_match_net(); If you train prototypical network, you should use fit_prototypical_net();

$ python mainNYT.py

The script takes the following command line options:

  • dataset_root: the root directory where tha dataset is stored, default to '../NYT'

You can ajust other parameters in src/config.py

Performance

                        val acc     test acc
match network           0.4769      0.4423        
prototypical network    0.70625     0.6938

few-shot's People

Contributors

zhang2010hao avatar

Stargazers

superldj avatar Talha Oz avatar zhangxinghua avatar yqtong avatar 小楼一夜听春雨 avatar  avatar AINLP avatar  avatar  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.