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
Metadata
Release files for pytorch-mcrf 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pytorch-mcrf-0.0.3.tar.gz | 21.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pytorch_mcrf-0.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 49.9 kB
Release files / pytorch-mcrf-0.0.3.tar.gz
| Download URL | pytorch-mcrf-0.0.3.tar.gz |
|---|---|
| Size | 21.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7405ea38737b5dfa783f7895e99266129430db5caa4bee5db1f27e837c50a0fa
|
|
BLAKE2b-256 checksum How to use checksums |
39812849d48596d7144bb546b675d8f4cba570423455cdbf39746fff86a248e1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Release files / pytorch_mcrf-0.0.3-py3-none-any.whl
| Download URL | pytorch_mcrf-0.0.3-py3-none-any.whl |
|---|---|
| Size | 28.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2451e53e6b9216b231f52f68778d16c6bda1b64e06e23a5fa7e9a594e77dbfcc
|
|
BLAKE2b-256 checksum How to use checksums |
9db6c44bc6e47d01f9696074d003c0ccc486b9ace94f8e27b0d69b2685b0aa67
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|