Downloads · 30 days
12
12% of all-time downloads
jackleejm/en_spacy_medication_ner
en_spacy_medication_ner is a token classification model from jackleejm. Use it when you need labels on individual words, such as names. It is set up for spacy. The card lists the license as mit.
Downloads · 30 days
12
12% of all-time downloads
All-time downloads
104
Public
Repo size
11.8 MB
Likes
0
Public
Click a slice to open those files.
Other6.2 MB · 52%
From the Hugging Face model README
!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"
import spacy
nlp = spacy.load("en_spacy_medication_ner")
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 |
| Component | Labels |
|---|---|
ner | BRAND, DOSAGE, DRUG, QUANTITY, ROUTE |
| Type | Score |
|---|---|
ENTS_F | 98.99 |
ENTS_P | 98.99 |
ENTS_R | 98.99 |
TOK2VEC_LOSS | 30.12 |
NER_LOSS | 7.19 |