Skip to main content

Multiple CRF implementation for PyTorch

Project description

Masked CRF

NOT Official Pytorch implemented Masked CRF.

Installation

Dependencies

  • Python >= 3.6
    • torch == 1.5.1 (better > 1.0)
    • tqdm == 4.53.0
    • pyyaml == 5.3.1

Download and Install

  1. Editable installation:
pip install -e .
  1. Install from PyPI:
pip install pytorch-mcrf -i https://pypi.org/simple

Quick Start

Settings

All the settings are in config.yaml, you can change model settings from this file.

Run

python run.py

Results

Micro-F1 results

WeiboNER

Batch Size Optimizer Learning Rate Max Seqence Length
8 SGD 0.015 128
Method Dev Test #Illegal Tags
PlainCRF 57.564 51.733 4
MaskedCRF ( decoding only ) 55.662 51.351 0
MaskedCRF 55.380 50.287 0

MSRA

Batch Size Optimizer Learning Rate Max Seqence Length
8 SGD 0.015 250

Model is selected directly from test set since there is no official dev set.

Method Test #Illegal Tags
PlainCRF 86.274 1
MaskedCRF ( decoding only ) 86.285 0
MaskedCRF 84.714 0

Acknowledgements

UPDATES

  • v0.0.2: fix setuptools packages finding issue

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytorch-mcrf-0.0.3.tar.gz (21.0 kB view hashes)

Uploaded Source

Built Distribution

pytorch_mcrf-0.0.3-py3-none-any.whl (28.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page