GithubHelp home page GithubHelp logo

huangxt39 / lstm-crf-pytorch Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 1.02 MB

simple implementation of LSTM-CRF for NER using pytorch

Perl 42.57% Python 57.43%
ner pytorch pytorch-implementation lstm-crf sequence-labeling bilstm-crf conditional-random-fields

lstm-crf-pytorch's Introduction

Introduction

This is a simple implementation of the paper (Lample et al., 2016), with all the code in a single file "lstm-crf-pytorch.py". This implementation supports batch training and batch inference.

Quick Start

First, you need to download the GloVe Word Embedding and unzip it. Then put the file "glove.6B.100d.txt" into the directory "dataset_ner"

Now you may run it on a GPU via

python lstm-crf-pytorch.py

Then the model will be trained from scratch and be evaluated every epoch, using CoNLL evaluation script.

If you want to run it on CPU, just remove all the ".cuda()" in the code and use the command above. This may sound sort of primitive...

Result

The model achieves 90.08 F1 score on test split, which is comparable to (Lample et al., 2016). You may achieve better results by selecting better hyperparameters.

lstm-crf-pytorch's People

Contributors

huangxt39 avatar

Stargazers

 avatar

Watchers

 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.