fine-tune pretrained transformer-based models for named entity recognition
Project description
A python package to smoothly fine-tune transformer-based models for Named Entity Recognition (NER).
Resources
Source Code: https://github.com/af-ai-center/nerblackbox
Documentation: https://af-ai-center.github.io/nerblackbox
About
Transformer-based models like BERT have had a game-changing impact on Natural Language Processing.
In order to utilize the publicly accessible pretrained models for Named Entity Recognition, one needs to retrain (or “fine-tune”) them using labeled text.
nerblackbox makes this easy.
You give it
a Dataset (labeled text)
a Pretrained Model (transformers)
and you get
the best Fine-tuned Model
its Performance on the dataset
Installation
pip install nerblackbox
Usage
Fine-tuning can be done in a few simple steps using an “experiment configuration file”
# cat <experiment_name>.ini
dataset_name = swedish_ner_corpus
pretrained_model_name = af-ai-center/bert-base-swedish-uncased
and either the Command Line Interface (CLI) or the Python API:
# CLI
nerbb run_experiment <experiment_name> # fine-tune
nerbb get_experiment_results <experiment_name> # get results/performance
nerbb predict <experiment_name> <text_input> # apply best model
# Python API
nerbb = NerBlackBox()
nerbb.run_experiment(<experiment_name>) # fine-tune
nerbb.get_experiment_results(<experiment_name>) # get results/performance
nerbb.predict(<experiment_name>, <text_input>) # apply best model
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
Built Distribution
File details
Details for the file nerblackbox-0.0.5.tar.gz
.
File metadata
- Download URL: nerblackbox-0.0.5.tar.gz
- Upload date:
- Size: 44.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/47.3.2 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb3ef05d84660b3a16a3304f078d2e11cc7ac0fd23409545c69eccb2699af26d |
|
MD5 | 0d546cfeebd70a187dbac9ff240abf46 |
|
BLAKE2b-256 | d62c806dfd92524532a29e5b0c83f0d4a71890f7e1160a54e208f76f84d34c3f |
File details
Details for the file nerblackbox-0.0.5-py3-none-any.whl
.
File metadata
- Download URL: nerblackbox-0.0.5-py3-none-any.whl
- Upload date:
- Size: 64.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/47.3.2 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 21e04e43bae67694f970541b252d2a33e2f5243b34bc00c1fef3011e219c3a1e |
|
MD5 | 8b1995f3d46bff06bd730ce0faab44d6 |
|
BLAKE2b-256 | 2278d21d4c828e7196feea746ddbe83a721500566abee5a50136a634bd2bd8cc |