GithubHelp home page GithubHelp logo

saiajaym / metalearningforner Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chandan047/metalearningforner

0.0 0.0 0.0 991 KB

CSE NLP 597 project - Meta Learning framework for Named-Entity Recognition

License: MIT License

Python 99.71% Shell 0.29%

metalearningforner's Introduction

Meta-Learning for NER

This is built upon the base-code for the paper Learning to Learn to Disambiguate: Meta-Learning for Few-Shot Word Sense Disambiguation. The code will be updated soon to contain more experiments.

Getting started

  • Clone the repository: git clone [email protected]:Nithin-Holla/MetaWSD.git.
  • Create a virtual environment.
  • Install the required packages: pip install -r MetaWSD/requirements.txt.
  • Create a directory for storing the data: mkdir data.
  • Navigate to the data directory: cd data.
  • Copy the ontonotes-bert directory into the data folder.
  • Navigate back: cd ..

Preparing the data

  • Make sure train.txt, val.txt and test.txt are in the ontonotes-bert folder
  • The labels-train.txt and labels-test.txt indicate the entity classes for training episodes and test episodes respectively.

Training the models

  • The YAML configuration files for all the models are in config/wsd. To train a model, run python MetaWSD/train_ner.py --config CONFIG_FILE.
  • Training on multiple GPUs is supported for the MAML variants only. In order to use multiple GPUs, specify the flag --multi_gpu.

Troubleshooting

(Already done. No need to do it again.)

If you have a RuntimeError with Proto(FO)MAML and BERT, you can install the higher library from this fork: https://github.com/Nithin-Holla/higher, which has a temporary fix for this. Also, replace diffopt.step(loss) with diffopt.step(loss, retain_graph=True) in models/seq_meta.py.

Citation

If you use this code repository, please consider citing original paper that implemented the base code of our project:

@article{holla2020metawsd,
  title={Learning to Learn to Disambiguate: Meta-Learning for Few-Shot Word Sense Disambiguation.},
  author={Holla, Nithin and Mishra, Pushkar and Yannakoudakis, Helen and Shutova, Ekaterina},
  journal={arXiv preprint arXiv:2004.14355},
  year={2020}
}

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.