Skip to main content

fine-tune transformer-based language models for named entity recognition

Project description

A python package to fine-tune transformer-based language models for named entity recognition (NER).

PyPI PyPI - Python Version CI https://coveralls.io/repos/github/flxst/nerblackbox/badge.svg?branch=master https://img.shields.io/badge/code%20style-black-000000.svg PyPI - License

Resources

Installation

pip install nerblackbox

About

https://raw.githubusercontent.com/flxst/nerblackbox/master/docs/docs/images/nerblackbox.png

Fine-tune a language model for named entity recognition in a few simple steps:

  1. Define a fine-tuning experiment by choosing a pretrained model and a dataset

experiment = Experiment("my_experiment", model="bert-base-cased", dataset="conll2003")
  1. Run the experiment and get the performance of the fine-tuned model

experiment.run()
experiment.get_result(metric="f1", level="entity", phase="test")
# 0.9045
  1. Use the fine-tuned model for inference

model = Model.from_experiment("my_experiment")
model.predict("The United Nations has never recognised Jakarta's move.")
# [[
#  {'char_start': '4', 'char_end': '18', 'token': 'United Nations', 'tag': 'ORG'},
#  {'char_start': '40', 'char_end': '47', 'token': 'Jakarta', 'tag': 'LOC'}
# ]]

There is much more to it than that! See the documentation to get started.

Features

Data

  • Support for Different Data Formats

  • Support for Different Annotation Schemes

  • Integration of HuggingFace Datasets

  • Text Encoding

Training

  • Adaptive Fine-tuning

  • Hyperparameter Search

  • Multiple Runs with Different Random Seeds

  • Detailed Analysis of Training Results

Evaluation

  • Evaluation of a Model on a Dataset

Inference

  • Versatile Model Inference

Other

  • Compatibility with HuggingFace

  • GPU Support

  • Language Agnosticism

See the documentation for more details.

Citation

@misc{nerblackbox,
  author = {Stollenwerk, Felix},
  title  = {nerblackbox: a python package to fine-tune transformer-based language models for named entity recognition},
  year   = {2021},
  url    = {https://github.com/flxst/nerblackbox},
}

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

nerblackbox-0.0.14.tar.gz (116.9 kB view details)

Uploaded Source

Built Distribution

nerblackbox-0.0.14-py3-none-any.whl (162.2 kB view details)

Uploaded Python 3

File details

Details for the file nerblackbox-0.0.14.tar.gz.

File metadata

  • Download URL: nerblackbox-0.0.14.tar.gz
  • Upload date:
  • Size: 116.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.10

File hashes

Hashes for nerblackbox-0.0.14.tar.gz
Algorithm Hash digest
SHA256 f9b17f3d4e4e72d0d1169f9811ca1b990dcf4959384f1942784c529ca9fb12d7
MD5 8e1e0ae48a8dcc62990bfcb81566e5d7
BLAKE2b-256 5dfe84ac459f34e78867bc10ddcf50e09ab01ef53581c17a8b4e24967768e630

See more details on using hashes here.

File details

Details for the file nerblackbox-0.0.14-py3-none-any.whl.

File metadata

  • Download URL: nerblackbox-0.0.14-py3-none-any.whl
  • Upload date:
  • Size: 162.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.10

File hashes

Hashes for nerblackbox-0.0.14-py3-none-any.whl
Algorithm Hash digest
SHA256 fa4bc4df253f4bca3f60aab1fa9671ffe24dcfa5e66165bdc8e475914047f0dd
MD5 af4762f438d07db31d7d32df4b1c7a1d
BLAKE2b-256 7da4f6ce173d6bf79ae8ae24fa5c1071699e99802e7ff037abad291df876ec7e

See more details on using hashes here.

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