# bulk-ner 0.25.1
![](https://img.shields.io/badge/Python-3.9-brightgreen.svg)
[![](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/nicolay-r/ner-service/blob/main/NER_annotation_service.ipynb)
[![twitter](https://img.shields.io/twitter/url/https/shields.io.svg?style=social)](https://x.com/nicolayr_/status/1842300499011260827)
[![PyPI downloads](https://img.shields.io/pypi/dm/bulk-ner.svg)](https://pypistats.org/packages/bulk-ner)
<p align="center">
<img src="logo.png"/>
</p>
A no-strings inference implementation framework [Named Entity Recognition (NER)](https://en.wikipedia.org/wiki/Named-entity_recognition) service of wrapped AI models.
The key features of this framework are:
1. ☑️ Native support of batching;
2. ☑️ Native long-input contexts handling.
# Installation
From PyPI:
```bash
pip install bulk-ner
```
or latest from Github:
```bash
pip install git+https://github.com/nicolay-r/bulk-ner@main
```
# Usage
## API
Please take a look at the [**related Wiki page**](https://github.com/nicolay-r/bulk-ner/wiki)
## Shell
> **NOTE:** You have to install `source-iter` package
This is an example for using `DeepPavlov==1.3.0` as an adapter for NER models passed via `--adapter` parameter:
```bash
python -m bulk_ner.annotate \
--src "test/data/test.tsv" \
--prompt "{text}" \
--batch-size 10 \
--adapter "dynamic:models/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
> **Quick example**: Check out the [default DeepPavlov wrapper implementation](/models/dp_130.py)
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]](https://github.com/nicolay-r/AREkit)
<p float="left">
<a href="https://github.com/nicolay-r/AREkit"><img src="https://github.com/nicolay-r/ARElight/assets/14871187/01232f7a-970f-416c-b7a4-1cda48506afe"/></a>
</p>
Raw data
{
"_id": null,
"home_page": "https://github.com/nicolay-r/bulk-ner",
"name": "bulk-ner",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": "natural language processing, named entity recognition, ner",
"author": "Nicolay Rusnachenko",
"author_email": "rusnicolay@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/76/ef/95422f036e655a29cf6af218e05d12f7143dfb062788e55ee936d02ca056/bulk_ner-0.25.1.tar.gz",
"platform": null,
"description": "# bulk-ner 0.25.1 \n![](https://img.shields.io/badge/Python-3.9-brightgreen.svg)\n[![](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/nicolay-r/ner-service/blob/main/NER_annotation_service.ipynb)\n[![twitter](https://img.shields.io/twitter/url/https/shields.io.svg?style=social)](https://x.com/nicolayr_/status/1842300499011260827)\n[![PyPI downloads](https://img.shields.io/pypi/dm/bulk-ner.svg)](https://pypistats.org/packages/bulk-ner)\n\n<p align=\"center\">\n <img src=\"logo.png\"/>\n</p>\n\nA no-strings inference implementation framework [Named Entity Recognition (NER)](https://en.wikipedia.org/wiki/Named-entity_recognition) service of wrapped AI models.\n\nThe key features of this framework are:\n1. \u2611\ufe0f Native support of batching;\n2. \u2611\ufe0f Native long-input contexts handling.\n\n# Installation\n\nFrom PyPI:\n```bash\npip install bulk-ner\n```\n\nor latest from Github:\n```bash\npip install git+https://github.com/nicolay-r/bulk-ner@main\n```\n\n# Usage\n\n## API\n\nPlease take a look at the [**related Wiki page**](https://github.com/nicolay-r/bulk-ner/wiki)\n\n## Shell\n\n> **NOTE:** You have to install `source-iter` package\n\nThis is an example for using `DeepPavlov==1.3.0` as an adapter for NER models passed via `--adapter` parameter:\n\n```bash\npython -m bulk_ner.annotate \\\n --src \"test/data/test.tsv\" \\\n --prompt \"{text}\" \\\n --batch-size 10 \\\n --adapter \"dynamic:models/dp_130.py:DeepPavlovNER\" \\\n --output \"test-annotated.jsonl\" \\\n %%m \\\n --model \"ner_ontonotes_bert_mult\"\n```\n\nYou can choose the other models via `--model` parameter.\n\nList of the supported models is available here: \nhttps://docs.deeppavlov.ai/en/master/features/models/NER.html\n\n## Deploy your model\n\n> **Quick example**: Check out the [default DeepPavlov wrapper implementation](/models/dp_130.py)\n\nAll you have to do is to implement the `BaseNER` class that has the following protected method:\n* `_forward(sequences)` -- expected to return two lists of the same length:\n * `terms` -- related to the list of atomic elements of the text (usually words)\n * `labels` -- B-I-O labels for each term.\n \n\n## Powered by\n\nThe pipeline construction components were taken from AREkit [[github]](https://github.com/nicolay-r/AREkit)\n\n<p float=\"left\">\n<a href=\"https://github.com/nicolay-r/AREkit\"><img src=\"https://github.com/nicolay-r/ARElight/assets/14871187/01232f7a-970f-416c-b7a4-1cda48506afe\"/></a>\n</p>\n",
"bugtrack_url": null,
"license": "MIT License",
"summary": "A no-strings inference implementation framework Named Entity Recognition (NER) service of wrapped AI models powered by AREkit and the related text-processing pipelines.",
"version": "0.25.1",
"project_urls": {
"Homepage": "https://github.com/nicolay-r/bulk-ner"
},
"split_keywords": [
"natural language processing",
" named entity recognition",
" ner"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "0e7199b7e42d4fd69d5fbdc12157b0d0779b998a9ac5e5f2a9db6b614343eea4",
"md5": "4e22287e2195fcafb7c2a34d01854e68",
"sha256": "37353e72078012c7efdcf079b60c3c9f155e50a4995fd36e248ae4d71c0f14d2"
},
"downloads": -1,
"filename": "bulk_ner-0.25.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "4e22287e2195fcafb7c2a34d01854e68",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 17540,
"upload_time": "2025-01-21T20:07:44",
"upload_time_iso_8601": "2025-01-21T20:07:44.356043Z",
"url": "https://files.pythonhosted.org/packages/0e/71/99b7e42d4fd69d5fbdc12157b0d0779b998a9ac5e5f2a9db6b614343eea4/bulk_ner-0.25.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "76ef95422f036e655a29cf6af218e05d12f7143dfb062788e55ee936d02ca056",
"md5": "ad5aa1ddad755751066a48014fe09eec",
"sha256": "7e1f6ea087b35cc8016fda37c9e048f96a1e26e9885a0c6fd7b80a076cd75d5e"
},
"downloads": -1,
"filename": "bulk_ner-0.25.1.tar.gz",
"has_sig": false,
"md5_digest": "ad5aa1ddad755751066a48014fe09eec",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 14290,
"upload_time": "2025-01-21T20:07:45",
"upload_time_iso_8601": "2025-01-21T20:07:45.654233Z",
"url": "https://files.pythonhosted.org/packages/76/ef/95422f036e655a29cf6af218e05d12f7143dfb062788e55ee936d02ca056/bulk_ner-0.25.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-21 20:07:45",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "nicolay-r",
"github_project": "bulk-ner",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "bulk-ner"
}