Skip to content

A pure-Python implementation of the Linear-Chain Conditional Random Fields

License

Notifications You must be signed in to change notification settings

lancifollia/crf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

crf

A pure python implementation of the Linear-Chain Conditional Random Fields

Dependencies

  • Numpy
  • Scipy

Usage

You can test this code with CoNLL 2000 Chunking Data.

Training

# format
python3 crf_train.py <train_file> <model_file>

# example
python3 crf_train.py data/chunking_small/small_train.data small_model.json

Test

# format
python3 crf_test.py <test_file> <trained_model_file>

# example
python3 crf_test.py data/chunking_small/small_test.data small_model.json

Benchmark Result

Accuracy

crf CRF++
chunking_full 0.960128 0.960128
chunking_small 0.899072 0.889474

License

MIT

Reference

An Introduction to Conditional Random Fields / Charles Sutton, Andrew McCallum/ 2010

About

A pure-Python implementation of the Linear-Chain Conditional Random Fields

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages