Conditional random field in PyTorch.
This package provides an implementation of conditional random field (CRF) in PyTorch. This implementation borrows mostly from AllenNLP CRF module with some modifications.
- Python 3.6
- PyTorch 1.0.0
Install with pip:
$ pip install pytorch-crf
Or, install from Github for the latest version:
$ pip install git+https://github.com/kmkurn/pytorch-crf#egg=pytorch_crf
https://pytorch-crf.readthedocs.io/en/latest/
MIT
Contributions are welcome! Please follow these instructions to install
dependencies and running the tests and linter. Make a pull request to
develop
branch once your contribution is ready.
Make sure you setup a virtual environment with Python and PyTorch
installed. Then, install all the dependencies in requirements.txt
file and
install this package in development mode.
$ pip install -r requirements.txt $ pip install -e .
Simply run:
$ ln -s ../../pre-commit.sh .git/hooks/pre-commit
Run pytest
in the project root directory.
Run flake8
in the project root directory. This will also run mypy
,
thanks to flake8-mypy
package.