Git Product home page Git Product logo

deep-crf's Introduction

DeepCRF: Neural Networks and CRFs for Sequence Labeling

A implementation of Conditional Random Fields (CRFs) with Deep Learning Method.

DeepCRF is a sequene labeling library that uses neural networks and CRFs in Python using Chainer, a flexible deep learning framework.

How to install?

git clone https://github.com/aonotas/deep-crf.git
cd deep-crf
python setup.py install

How to train?

train Ma and Hovy (2016) model

$ deep-crf train input_file.txt --delimiter ' ' --model_name bilstm-cnn-crf

Deep BiLSTM-CNN-CRF model (three layers)

$ deep-crf train input_file.txt --delimiter ' ' --model_name bilstm-cnn-crf --n_layer 3
$ cat input_file_multi.txt
Barack  NN B−PERSON 
Hussein NN I−PERSON 
Obama   NN E−PERSON
is      VBZ O 
a       DT  O 
man     NN  O 
.       .   O

Additional Feature Support

$ deep-crf train input_file_multi.txt --delimiter ' ' --model_name bilstm-cnn-crf −−input idx 0,1 −−output idx 2

Multi-Task Learning Support

$ deep-crf train input_file_multi.txt --delimiter ' ' --model_name bilstm-cnn-crf −−input idx 0 −−output idx 1,2

How to predict?

$ deep-crf predict input_raw_file.txt --model_name bilstm-cnn-crf --model_filename bilstm-cnn-crf_adam.model

Features

DeepCRF provides following features.

  • Bi-LSTM / Bi-GRU / Bi-RNN
  • CNN for character-level representation
  • Pre-trained word embedding
  • Pre-trained character embedding
  • CRFs at output layer
  • CoNLL format input/output
  • Raw text data input/output
  • Training : Your variable files
  • Test : Raw text file at command-line
  • Evaluation : F-measure, Accuracy

Experiment

POS Tagging

Model Accuracy
CRFsuit 96.39
deep-crf 97.45
dos Santos and Zadrozny (2014) 97.32
Ma and Hovy (2016) 97.55

Named Entity Recognition (NER)

Model Prec. Recall F1
CRFsuit 84.43 83.60 84.01
deep-crf 90.82 91.11 90.96
Ma and Hovy (2016) 91.35 91.06 91.21

Chunking

Model Prec. Recall F1
CRFsuit 93.77 93.45 93.61
deep-crf 94.67 94.43 94.55
Huang et al. (2015) - - 94.46

deep-crf's People

Contributors

aonotas avatar unnonouno avatar

Watchers

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