Run this model with HF Jobs
Run jackleejm/en_spacy_medication_ner on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/jackleejm/en_spacy_medication_ner. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/jackleejm/en_spacy_medication_ner on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use jackleejm/en_spacy_medication_ner with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- spaCy
How to use jackleejm/en_spacy_medication_ner with spaCy:
!pip install https://huggingface.co/jackleejm/en_spacy_medication_ner/resolve/main/en_spacy_medication_ner-any-py3-none-any.whl # Using spacy.load(). import spacy nlp = spacy.load("en_spacy_medication_ner") # Importing as module. import en_spacy_medication_ner nlp = en_spacy_medication_ner.load() - Notebooks
- Google Colab
- Kaggle
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 |
- Downloads last month
- -
Evaluation results
- NER Precisionself-reported0.990
- NER Recallself-reported0.990
- NER F Scoreself-reported0.990