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
- Editable installation:
pip install -e .
- 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
- Official: MaskedCRF
- pytorch-crf
- allennlp
- ChineseWeiboNER
UPDATES
- v0.0.2: fix setuptools packages finding issue
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
pytorch-mcrf-0.0.2.tar.gz
(20.9 kB
view details)
Built Distribution
File details
Details for the file pytorch-mcrf-0.0.2.tar.gz
.
File metadata
- Download URL: pytorch-mcrf-0.0.2.tar.gz
- Upload date:
- Size: 20.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.53.0 CPython/3.7.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a52dee9530848cd59b6007f7756e1679d071bf7a2235639cef02f49761472870 |
|
MD5 | efdc6670cb1d9b3c43625c85914b0f61 |
|
BLAKE2b-256 | af0cd53f0385f27c1bf965bfad2f23a076eb9131cb0173db9bb5d66b83971909 |
File details
Details for the file pytorch_mcrf-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: pytorch_mcrf-0.0.2-py3-none-any.whl
- Upload date:
- Size: 28.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.53.0 CPython/3.7.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 32b5b032f3ca014dc6f167d07cbbc679a09b3f19c868328926d8af0fb9786860 |
|
MD5 | c0aaa641cd7653e949ff9798a4ac3c91 |
|
BLAKE2b-256 | f96565f0172326816d6e3275dd8cc38a198c472e6ad977dc0009700edabfb090 |