Conditional random field in PyTorch
Project description
pytorch-crf
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.
Requirements
Python 3.6
PyTorch 1.0.0
Installation
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
Documentation
License
MIT
Contributing
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.
Installing dependencies
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 .
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for pytorch_crf-0.7.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4d08440eea5b43ca8787988d61fdf2572bb4315891ba32d37e48257d611f8aa6 |
|
MD5 | a564655dbe887d10732abd8775418d82 |
|
BLAKE2b-256 | 03918de8d794612b8f70542c9d66684b92b1a6272f9263858b0e2fd5259c5613 |