Registry / ai-ml / drug-named-entity-recognition

drug-named-entity-recognition

JSON →
library2.0.9pypypi✓ verified 81d ago

Drug Named Entity Recognition (NER) library to identify and resolve drug names in text, with entity linking to RxNorm and other drug databases. The current version is 2.0.9, supporting Python >=3.6. It provides pre-trained models for drug name extraction and normalization. The library is actively maintained with occasional releases.

pip install drug-named-entity-recognition
INSTALL
IMPORT
SIG · DRUG-NAMED-ENTITY-
D
drug-named-entity-recognition
ai-mlpythonv2.0.9
Install
2.1s avg
Import
Disk
21MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.0.9 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 22.6MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 2.1s · import 0.000s · 23MB
21MB installed
● package 21MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

drugs_finder
from drug_named_entity_recognition import drugs_finder
from drug_named_entity_recognition import DrugNER
find_drugs
from drug_named_entity_recognition import find_drugs
from drug_named_entity_recognition import DrugNER
molecular_properties
from drug_named_entity_recognition import molecular_properties
from drug_named_entity_recognition import DrugNER

Initialize DrugNER and extract drug entities from a text string.

from drug_named_entity_recognition import DrugNER drug_ner = DrugNER() text = "Patient was given 500mg of Paracetamol and 10mg of Diazepam." entities = drug_ner.find_entities(text) print(entities) # Example output: [{'name': 'paracetamol', 'rxnorm': '161', 'start': 24, 'end': 35, ...}, ...]
Debug
Known issues
gotchaThe first run downloads a large model (~2GB). Ensure sufficient disk space and a stable internet connection. The model is cached afterwards.
fix
Pre-download the model using: `pip install drug-named-entity-recognition && python -c \"from drug_named_entity_recognition import DrugNER; DrugNER()\"`
affects: all
breakingIn version 2.0, the API changed from `DrugNER().get_entities(text)` to `DrugNER().find_entities(text)`. Old code will break.
fix
Use `find_entities()` instead of `get_entities()`.
affects: 2.0+
deprecatedThe `DrugNER` constructor no longer accepts a `model_size` argument in 2.0.0+ (was `'small'`, `'medium'`, `'large'`).
fix
Remove the `model_size` argument. The model is now fixed.
affects: 2.0+
Upgrade
Version history
2.0.9latest on PyPI · released Jul 15, 2025
Audit
Dependencies
scispacyrequiredRequired for loading the biomedical NLP pipeline (en_core_sci_sm) used for drug entity recognition.
spacyrequiredCore NLP library dependency. Version must be compatible with scispacy.
Agent activity
19 hits · last 30 days
node
16
OpenAI (training)
2
Amazon
1
Resources
drug-named-entity-recognition — pip install drug-named-entity-recognition · libregistry