https://github.com/kmkurn/pytorch-crf
(Linear-chain) Conditional random field in PyTorch.
https://github.com/kmkurn/pytorch-crf
conditional-random-fields neural-networks pytorch
Last synced: 8 months ago
JSON representation
(Linear-chain) Conditional random field in PyTorch.
- Host: GitHub
- URL: https://github.com/kmkurn/pytorch-crf
- Owner: kmkurn
- License: mit
- Created: 2017-11-25T05:03:44.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2024-06-09T12:30:21.000Z (almost 2 years ago)
- Last Synced: 2025-05-14T21:53:17.731Z (about 1 year ago)
- Topics: conditional-random-fields, neural-networks, pytorch
- Language: Python
- Homepage: https://pytorch-crf.readthedocs.io
- Size: 101 KB
- Stars: 962
- Watchers: 7
- Forks: 153
- Open Issues: 1
-
Metadata Files:
- Readme: README.rst
- License: LICENSE.txt
Awesome Lists containing this project
- awesome-colab-project - pytorch-crf
README
pytorch-crf
===========
Conditional random field in `PyTorch `_.
.. image:: https://img.shields.io/pypi/pyversions/pytorch-crf.svg?style=flat
:target: https://img.shields.io/pypi/pyversions/pytorch-crf.svg?style=flat
:alt: Python versions
.. image:: https://img.shields.io/pypi/v/pytorch-crf.svg?style=flat
:target: https://pypi.org/project/pytorch-crf
:alt: PyPI project
.. image:: https://github.com/kmkurn/pytorch-crf/actions/workflows/run_tests.yml/badge.svg
:target: https://github.com/kmkurn/pytorch-crf/actions/workflows/run_tests.yml
:alt: Build status
.. image:: https://img.shields.io/readthedocs/pytorch-crf.svg?style=flat
:target: https://pytorch-crf.readthedocs.io
:alt: Documentation status
.. image:: https://img.shields.io/coveralls/github/kmkurn/pytorch-crf.svg?style=flat
:target: https://coveralls.io/github/kmkurn/pytorch-crf
:alt: Code coverage
.. image:: https://img.shields.io/pypi/l/pytorch-crf.svg?style=flat
:target: https://choosealicense.com/licenses/mit/
:alt: License
.. image:: https://cdn.rawgit.com/syl20bnr/spacemacs/442d025779da2f62fc86c2082703697714db6514/assets/spacemacs-badge.svg
:target: http://spacemacs.org
:alt: 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.