Details: https://github.com/JackLeeJM/slm-medication-ner

Usage

  1. Install using PIP:
!pip install "en_spacy_medication_ner @ https://huggingface.co/jackleejm/en_spacy_medication_ner/resolve/main/en_spacy_medication_ner-any-py3-none-any.whl"
  1. Load model:
import spacy

nlp = spacy.load("en_spacy_medication_ner")
  1. Run inferences:
input = ["Acetaminophen 325 MG Oral Tablet"]
docs = list(nlp.pipe(input))
results = [
  [
    {
      "word": ent.text,
      "entity_group": ent.label_,
      "start": ent.start_char,
      "end": ent.end_char,
    }
    for ent in doc.ents
  ]
  for doc in docs
]

print(results)

# Outputs
[
  [
    {
      "word": "Acetaminophen",
      "entity_group": "DRUG",
      "start": 0,
      "end": 13
    },
    {
      "word": "325 MG",
      "entity_group": "DOSAGE",
      "start": 14,
      "end": 20
    },
    {
      "word": "Oral Tablet",
      "entity_group": "ROUTE",
      "start": 21,
      "end": 32
    }
  ]
]
Feature Description
Name en_spacy_medication_ner
Version 1.0.0
spaCy >=3.8.4,<3.9.0
Default Pipeline tok2vec, ner
Components tok2vec, ner
Vectors 0 keys, 0 unique vectors (0 dimensions)
Sources n/a
License MIT
Author JackLeeJM

Label Scheme

View label scheme (5 labels for 1 components)
Component Labels
ner BRAND, DOSAGE, DRUG, QUANTITY, ROUTE

Accuracy

Type Score
ENTS_F 98.99
ENTS_P 98.99
ENTS_R 98.99
TOK2VEC_LOSS 30.12
NER_LOSS 7.19
Downloads last month
12
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Evaluation results