bulk-ner 0.25.2
February 15, 2025 · View on GitHub
Third-party providers hosting↗️
A no-strings inference implementation framework Named Entity Recognition (NER) service of wrapped AI models ↗️.
The key features of this framework are:
- ☑️ Native support of batching;
- ☑️ Native long-input contexts handling.
Installation
From PyPI:
pip install bulk-ner
or latest from Github:
pip install git+https://github.com/nicolay-r/bulk-ner@main
Usage
API
Please take a look at the related Wiki page
Shell
NOTE: You have to install
source-iterpackage
This is an example for using DeepPavlov==1.3.0 as an adapter for NER models passed via --adapter parameter:
- Downloading provider:
wget https://raw.githubusercontent.com/nicolay-r/nlp-thirdgate/refs/heads/master/ner/dp_130.py
- Launching inference:
python -m bulk_ner.annotate \
--src "test/data/test.tsv" \
--prompt "{text}" \
--batch-size 10 \
--adapter "dynamic:dp_130.py:DeepPavlovNER" \
--output "test-annotated.jsonl" \
%%m \
--model "ner_ontonotes_bert_mult"
You can choose the other models via --model parameter.
List of the supported models is available here: https://docs.deeppavlov.ai/en/master/features/models/NER.html
Deploy your model
Third-party providers hosting↗️
Quick example: Check out the default DeepPavlov wrapper implementation
All you have to do is to implement the BaseNER class that has the following protected method:
_forward(sequences)-- expected to return two lists of the same length:terms-- related to the list of atomic elements of the text (usually words)labels-- B-I-O labels for each term.
Powered by
The pipeline construction components were taken from AREkit [github]