• Stars
    star
    930
  • Rank 47,395 (Top 1.0 %)
  • Language
    Python
  • License
    MIT License
  • Created over 6 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

(Linear-chain) Conditional random field in PyTorch.

pytorch-crf

Conditional random field in PyTorch.

Python versions PyPI project Build status Documentation status Code coverage License Built with Spacemacs

This package provides an implementation of linear-chain conditional random field (CRF) in PyTorch. This implementation borrows mostly from AllenNLP CRF module with some modifications.

Documentation

https://pytorch-crf.readthedocs.io/

License

MIT

Contributing

Contributions are welcome! Please follow these instructions to install dependencies and running the tests and linter.

Installing dependencies

Make sure you setup a virtual environment with Python. Then, install all the dependencies in requirements.txt file and install this package in development mode.

pip install -r requirements.txt
pip install -e .

Setup pre-commit hook

Simply run:

ln -s ../../pre-commit.sh .git/hooks/pre-commit

Running tests

Run pytest in the project root directory.

Running linter

Run flake8 in the project root directory. This will also run mypy, thanks to flake8-mypy package.