Description
This pipeline, extracts drug administration route entities in clinical text. It recognizes routes including oral, IV, IM, subcutaneous, topical, transdermal, inhalation, sublingual, rectal, and more.
How to use
from sparknlp.pretrained import PretrainedPipeline
pipeline = PretrainedPipeline("drug_route_matcher_pipeline", "en", "clinical/models")
sample_text = """ Metformin 500mg orally twice daily. Insulin glargine subcutaneously at bedtime. Morphine 4mg IV for pain. Albuterol via inhalation every 4 hours PRN."""
result = pipeline.transform(spark.createDataFrame([[sample_text]]).toDF("text"))
from johnsnowlabs import nlp, medical
pipeline = nlp.PretrainedPipeline("drug_route_matcher_pipeline", "en", "clinical/models")
sample_text = """ Metformin 500mg orally twice daily. Insulin glargine subcutaneously at bedtime. Morphine 4mg IV for pain. Albuterol via inhalation every 4 hours PRN."""
result = pipeline.transform(spark.createDataFrame([[sample_text]]).toDF("text"))
import com.johnsnowlabs.nlp.pretrained.PretrainedPipeline
val pipeline = PretrainedPipeline("drug_route_matcher_pipeline", "en", "clinical/models")
val sample_text = """ Metformin 500mg orally twice daily. Insulin glargine subcutaneously at bedtime. Morphine 4mg IV for pain. Albuterol via inhalation every 4 hours PRN."""
val result = pipeline.transform(spark.createDataFrame([[sample_text]]).toDF("text"))
Results
| chunk | begin | end | label |
| :--------- | ----: | --: | :--------- |
| orally | 16 | 21 | DRUG_ROUTE |
| IV | 93 | 94 | DRUG_ROUTE |
| inhalation | 120 | 129 | DRUG_ROUTE |
Model Information
| Model Name: | drug_route_matcher_pipeline |
| Type: | pipeline |
| Compatibility: | Healthcare NLP 6.3.0+ |
| License: | Licensed |
| Edition: | Official |
| Language: | en |
| Size: | 937.8 KB |
Included Models
- DocumentAssembler
- SentenceDetector
- TokenizerModel
- TextMatcherInternalModel
- ChunkConverter