{"id":23638,"library":"drug-named-entity-recognition","title":"Drug Named Entity Recognition","description":"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.","status":"active","version":"2.0.9","language":"python","source_language":"en","source_url":"https://github.com/philgooch/drug-named-entity-recognition","tags":["drug","ner","named entity recognition","biomedical","nlp"],"install":[{"cmd":"pip install drug-named-entity-recognition","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Required for loading the biomedical NLP pipeline (en_core_sci_sm) used for drug entity recognition.","package":"scispacy","optional":false},{"reason":"Core NLP library dependency. Version must be compatible with scispacy.","package":"spacy","optional":false}],"imports":[{"note":"Correct import path for the main class","symbol":"DrugNER","correct":"from drug_named_entity_recognition import DrugNER"}],"quickstart":{"code":"from drug_named_entity_recognition import DrugNER\n\ndrug_ner = DrugNER()\ntext = \"Patient was given 500mg of Paracetamol and 10mg of Diazepam.\"\nentities = drug_ner.find_entities(text)\nprint(entities)\n# Example output: [{'name': 'paracetamol', 'rxnorm': '161', 'start': 24, 'end': 35, ...}, ...]","lang":"python","description":"Initialize DrugNER and extract drug entities from a text string."},"warnings":[{"fix":"Pre-download the model using: `pip install drug-named-entity-recognition && python -c \\\"from drug_named_entity_recognition import DrugNER; DrugNER()\\\"`","message":"The first run downloads a large model (~2GB). Ensure sufficient disk space and a stable internet connection. The model is cached afterwards.","severity":"gotcha","affected_versions":"all"},{"fix":"Use `find_entities()` instead of `get_entities()`.","message":"In version 2.0, the API changed from `DrugNER().get_entities(text)` to `DrugNER().find_entities(text)`. Old code will break.","severity":"breaking","affected_versions":"2.0+"},{"fix":"Remove the `model_size` argument. The model is now fixed.","message":"The `DrugNER` constructor no longer accepts a `model_size` argument in 2.0.0+ (was `'small'`, `'medium'`, `'large'`).","severity":"deprecated","affected_versions":"2.0+"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run: `pip install scispacy`","cause":"Missing scispacy dependency.","error":"ModuleNotFoundError: No module named 'scispacy'"},{"fix":"Run: `pip install scispacy && python -m spacy download en_core_sci_sm`","cause":"The spaCy model required by scispacy is not installed or not found.","error":"OSError: [E050] Can't find model 'en_core_sci_sm'."},{"fix":"Delete the cache directory (~/.drug_named_entity_recognition) and run again.","cause":"The model download failed or is corrupted.","error":"ValueError: DrugNER model not loaded. Try again later."}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}