metadata
tags:
- spacy
- token-classification
language:
- en
model-index:
- name: en_spacy_medication_ner
results:
- task:
name: NER
type: token-classification
metrics:
- name: NER Precision
type: precision
value: 0.9899159664
- name: NER Recall
type: recall
value: 0.9899159664
- name: NER F Score
type: f_score
value: 0.9899159664
license: mit
Details: https://github.com/JackLeeJM/slm-medication-ner
Usage
- 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"
- Load model:
import spacy
nlp = spacy.load("en_spacy_medication_ner")
- 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 |