GithubHelp home page GithubHelp logo

song-xx / bilstm-crf Goto Github PK

View Code? Open in Web Editor NEW

This project forked from goxdve/bilstm-crf

0.0 1.0 0.0 26.85 MB

A Pytorch implementation for NER using BiLSTM-CRF

Python 64.87% Shell 1.99% Perl 33.15%

bilstm-crf's Introduction

Named Entity Recognition (NER) using BiLSTM CRF

This is a Pytorch implementation of BiLSTM-CRF for Named Entity Recognition, which is described in Bidirectional LSTM-CRF Models for Sequence Tagging

Data

The corpus in the data folder is MSRA Chinese NER corpus. Since there are no development data, we split the data in train.txt into training and development part when traing the model.

Usage

For training the model, you can use the following command:

sh run.sh train

For those who are not able to use GPU, use the following command to train:

sh run.sh train-without-cuda

For testing, you can use the following command:

sh run.sh test

Also, if you have no GPU, you can use the following command(this procedure won't take long time when using CPU):

sh run.sh test-without-cuda

There is already a trained model in the model folder, so you can execute the testing command directly without training.

If you want to change some hyper-parameters, use the following command to refer to the options.

python run.py --help

Result

We use conlleval.pl to evaluate the model's performance on test data, and the experiment result on testing data of the trained model is as follows:

processed 172601 tokens with 6192 phrases; found: 5660 phrases; correct: 4820.
accuracy:  97.70%; precision:  85.16%; recall:  77.84%; FB1:  81.34
              LOC: precision:  90.45%; recall:  82.31%; FB1:  86.19  2618
              ORG: precision:  78.18%; recall:  75.66%; FB1:  76.90  1288
              PER: precision:  82.38%; recall:  72.83%; FB1:  77.31  1754

Reference

  1. Bidirectional LSTM-CRF Models for Sequence Tagging
  2. cs224n Assignment 4

bilstm-crf's People

Contributors

goxdve avatar

Watchers

James Cloos 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.