Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/himkt/allennlp-NER
☯️ AllenNLP training configurations for promising models on Named Entity Recognition. (BiLSTM-CRF, BiLSTM-CNN-CRF, BERT, BERT-CRF)
https://github.com/himkt/allennlp-NER
allennlp bert named-entity-recognition natural-language-processing ner
Last synced: about 1 month ago
JSON representation
☯️ AllenNLP training configurations for promising models on Named Entity Recognition. (BiLSTM-CRF, BiLSTM-CNN-CRF, BERT, BERT-CRF)
- Host: GitHub
- URL: https://github.com/himkt/allennlp-NER
- Owner: himkt
- Created: 2020-05-22T16:32:15.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-11-26T16:09:32.000Z (about 4 years ago)
- Last Synced: 2024-08-02T02:08:49.713Z (4 months ago)
- Topics: allennlp, bert, named-entity-recognition, natural-language-processing, ner
- Language: Python
- Homepage:
- Size: 152 KB
- Stars: 15
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-ner - himkt/allennlp-NER
README
# AllenNLP NER: AllenNLP Models for Named Entity Recognition
## Installation
AllenNLP NER uses `poetry` for library management.
If you don't have `poetry`, please run `pip3 install poetry`.```
git clone [email protected]:himkt/allennlp_ner && cd allennlp_ner
poetry install
```## Run model training
```
poetry run allennlp train config/bert.jsonnet --include-pacakge allennlp_ner -s model/bert
poetry run allennlp train config/bert-crf.jsonnet -s model/bert-crf
poetry run allennlp train config/bilstm-crf.jsonnet -s model/bilstm-crf
poetry run allennlp train config/bilstm-cnn-crf.jsonnet -s model/bilstm-cnn-crf
```## [New!] Hyperparameter Optimization
You can try hyperparameter optimization for BiLSTM-CNN-CRF!
It uses [Optuna](https://github.com/optuna/optuna), please read [AllenNLP guide](https://guide.allennlp.org/hyperparameter-optimization) if you want to learn more.```
poetry run python hpo.py
```Or, you can also use [`allennlp-optuna`](https://github.com/himkt/allennlp-optuna).
```
poetry run allennlp tune \
config/bilstm-cnn-crf-hpo.jsonnet \
config/bilstm-cnn-crf.hparams.json \
--serialization-dir result \
--metrics best_validation_f1-measure-overall \
--direction maximize
```## References
- [BiLSTM-CRF](./config/bilstm-crf.jsonnet) [Lample+, NAACL2016]: https://www.aclweb.org/anthology/N16-1030/
- [BiLSTM-CNN-CRF](./config/bilstm-cnn-crf.jsonnet) [Ma+, ACL2016]: https://www.aclweb.org/anthology/P16-1101/
- [BERT](./config/bert.jsonnet) [Devlin+, NAACL2019]: https://www.aclweb.org/anthology/N19-1423/
- [BERT-CRF](./config/bert-crf.jsonnet) [Devlin+, NAACL2019]: https://www.aclweb.org/anthology/N19-1423/ + CRF