# bulk-ner 0.24.1
![](https://img.shields.io/badge/Python-3.9-brightgreen.svg)
![](https://img.shields.io/badge/AREkit-0.25.0-orange.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)
<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 powered by
[AREkit](https://github.com/nicolay-r/AREkit) and the related [text-processing pipelines](https://github.com/nicolay-r/AREkit/wiki/Pipelines:-Text-Processing).
The key benefits of this tiny framework are as follows:
1. ☑️ Native support of batching;
2. ☑️ Native long-input contexts handling.
# Installation
```bash
pip install bulk-ner==0.24.1
```
# Usage
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" \
%% \
--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
* 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/5c/a4/73e2041b958cc5271512cd9b01f9c9f6b5a186970c6e969805310c65258d/bulk_ner-0.24.1.tar.gz",
"platform": null,
"description": "# bulk-ner 0.24.1 \n![](https://img.shields.io/badge/Python-3.9-brightgreen.svg)\n![](https://img.shields.io/badge/AREkit-0.25.0-orange.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\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 powered by \n[AREkit](https://github.com/nicolay-r/AREkit) and the related [text-processing pipelines](https://github.com/nicolay-r/AREkit/wiki/Pipelines:-Text-Processing).\n\nThe key benefits of this tiny framework are as follows:\n1. \u2611\ufe0f Native support of batching;\n2. \u2611\ufe0f Native long-input contexts handling.\n\n# Installation\n\n```bash\npip install bulk-ner==0.24.1\n```\n\n# Usage\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 %% \\\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\n* 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.24.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": "9b2581e810cde34fd377b8920e3f0d977c31a44526b24de50c41856d08aa970d",
"md5": "9af9f885358c1a817f409de34f0639bd",
"sha256": "4768480b839eded74f0191bd52802d10d76d918c375d5cd5972de5587ad884fe"
},
"downloads": -1,
"filename": "bulk_ner-0.24.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "9af9f885358c1a817f409de34f0639bd",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 12107,
"upload_time": "2024-11-04T21:48:43",
"upload_time_iso_8601": "2024-11-04T21:48:43.055080Z",
"url": "https://files.pythonhosted.org/packages/9b/25/81e810cde34fd377b8920e3f0d977c31a44526b24de50c41856d08aa970d/bulk_ner-0.24.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "5ca473e2041b958cc5271512cd9b01f9c9f6b5a186970c6e969805310c65258d",
"md5": "91ff313c00d4f6333245958a34c208cf",
"sha256": "cc3898d0b7f39fb5b7729a01f6c7fa92a011601cf3ba77a1115d1856e67fe011"
},
"downloads": -1,
"filename": "bulk_ner-0.24.1.tar.gz",
"has_sig": false,
"md5_digest": "91ff313c00d4f6333245958a34c208cf",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 11639,
"upload_time": "2024-11-04T21:48:44",
"upload_time_iso_8601": "2024-11-04T21:48:44.048654Z",
"url": "https://files.pythonhosted.org/packages/5c/a4/73e2041b958cc5271512cd9b01f9c9f6b5a186970c6e969805310c65258d/bulk_ner-0.24.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-04 21:48:44",
"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"
}