Giter Club home page Giter Club logo

bilstm-crf-for-sequence-tagging's Introduction

BiLSTM-CRF-for-sequence-tagging

Implementation of BiLSTM-CRF for sequence tagging

Requirements:

Python 3.6

Pytorch
numpy
pickle
sklearn

Usage:

NOTE: To run the BLSTM on Duolingo data, switch to the add_feats branch and follow the instructions in the README there.

This command will run the model on a gpu using CUDA, if you would like to run the model without CUDA then in ner_train.py or pos_train.py change the 'use_gpu = 1' line after the imports at the top to 'use_gpu = 0'.

NER:

python ner_train.py

POS:

python pos_train.py

Data

The data should be stored in the data directory in the following format:

data

├── conll2000

│   ├── test.txt

│   └── train.txt

├── ner

│   ├── eng.testa

│   ├── eng.testb

│   └── eng.train

└── pos

  ├── dev.txt

  ├── test.txt

  └── train.txt

Embeddings

Make a directory named embeddings and add senna_obj.pkl file(Senna embeddings dictionary) and glove_obj.pkl (glove embeddings dictionary).

Code

ner_train.py and pos_train.py contain code which runs the same model on the data detailed above. The neural network code is in the models/ directory, where the relevant files are lstm_cnn.py, which containes the BLSTM-CNN-CRF main code and imports the CRF code from crf.py. The rest of the files are not used in running the final model.

Duolingo

To prepare sequential duolingo dataset cd preproc/ python duolingo_split.py

To train from duolingo dataset, python duolingo_train.py

For post-hoc analysis on duolingo python duolingo_analysis.py

bilstm-crf-for-sequence-tagging's People

Contributors

glarik avatar himavarsha94 avatar xeniaqian94 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

rasica

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.