nerblackbox: A High-level Library for Named Entity Recognition in Python (2023)

Abstract: We present **nerblackbox**, a python library to facilitate the use of state-of-the-art transformer-based models for named entity recognition. It provides simple-to-use yet powerful methods to access data and models from a wide range of sources, for fully automated model training and evaluation as well as versatile model inference. While many technical challenges are solved and hidden from the user by default, **nerblackbox** also offers fine-grained control and a rich set of customizable features. It is thus targeted both at application-oriented developers as well as machine learning experts and researchers.

## introduction named entity recognition (ner) is an important natural language processing task with a multitude of applications @xcite . while generative ai is currently ubiquitous in the scientific literature and public debate, it has not (yet) replaced discriminative ai for information extraction tasks like ner. fine-tuned, transformer-based encoder models are both sota in research foot_0 and commonly used by developers to solve real-world problems, see e.g. @xcite . popular open source frameworks, like the ones provided by huggingface @xcite @xcite , greatly facilitate the use of such models. they cover the whole workflow consisting of dataset integration, model training, evaluation and inference, see fig. 1 . however, they do require a certain degree of expertise and often some significant, use-case specific effort. some of the (general and ner-specific) challenges are: the aim of nerblackbox is to provide a high-level framework which makes the usage of sota ner models as simple as possible. as we will see in detail in sec. 3, it offers easy access to datasets from various sources, automated training and evaluation as well as simple but versatile model inference. it does so by hiding all technical complications from the user foot_1 and is targeted at developers as well as people who are not necessarily experts in machine learning or nlp. however, nerblackbox also allows fine-grained control over all sorts of low-level parameters and provides many advanced features, some of which we will cover in sec. 4. this might make the library appealing also for researchers and experts. ## related work the most commonly used framework for transformer-based nlp is arguably the hugging-face ecosystem, in particular the open source libraries transformers @xcite , datasets @xcite and evaluate @xcite . another popular alternative is spacy @xcite . high-level libraries that are build on top of transformers exist in the form of simple transformers @xcite and t-ner @xcite . simple transformers is a highlevel library that covers a broad range of nlp tasks with basic support for ner. t-ner is specific to ner with an emphasis on cross-domain and crosslingual model evaluation. of all the mentioned libraries, it is arguably the most similar to nerblackbox. however, as will be discussed in the following sections, nerblackbox offers many unique and powerful features that-to the best of our knowledgemake it distinct from any existing frameworks. a high-level overview of the involved components is shown in fig. 2 . ## advanced usage the nerblackbox workflow and the api are designed to be as simple as possible and to conceal technical complications from the user. however, they are also highly customizable in terms of optional function arguments, which may be particularly interesting for machine learning experts and researchers. in this section, we are going to cover a non-exhaustive selection of nerblackbox's advanced features, with a slight emphasis on the training part. for further information, the reader is referred to the library's documentation.