Pipeline for Detect Medication

Description

A pretrained pipeline to detect medication entities. It was built on the top of ner_posology_greedy model and also augmented with the drug names mentioned in UK and US drugbank datasets.

Copy S3 URI

How to use

from sparknlp.pretrained import PretrainedPipeline

ner_medication_pipeline = PretrainedPipeline("ner_medication_pipeline", "en", "clinical/models")

text = """The patient was prescribed metformin 1000 MG, and glipizide 2.5 MG. The other patient was given Fragmin 5000 units, Xenaderm to wounds topically b.i.d. and OxyContin 30 mg."""

result = ner_medication_pipeline.fullAnnotate([text])
import com.johnsnowlabs.nlp.pretrained.PretrainedPipeline

val ner_medication_pipeline = new PretrainedPipeline("ner_medication_pipeline", "en", "clinical/models")

val result = ner_medication_pipeline.fullAnnotate("The patient was prescribed metformin 1000 MG, and glipizide 2.5 MG. The other patient was given Fragmin 5000 units, Xenaderm to wounds topically b.i.d. and OxyContin 30 mg."")
| ner_chunk          | entity   |
|:-------------------|:---------|
| metformin 1000 MG  | DRUG     |
| glipizide 2.5 MG   | DRUG     |
| Fragmin 5000 units | DRUG     |
| Xenaderm           | DRUG     |
| OxyContin 30 mg    | DRUG     |

Model Information

Model Name: ner_medication_pipeline
Type: pipeline
Compatibility: Healthcare NLP 4.0.0+
License: Licensed
Edition: Official
Language: en
Size: 1.7 GB

Included Models

  • DocumentAssembler
  • SentenceDetectorDLModel
  • TokenizerModel
  • WordEmbeddingsModel
  • MedicalNerModel
  • NerConverterInternalModel
  • TextMatcherModel
  • ChunkMergeModel
  • Finisher