Description
This pipeline, can identify drug form entities in clinical text. It recognizes various pharmaceutical forms including tablet, capsule, injection, cream, solution, spray, and many more drug delivery forms commonly found in medication prescriptions and clinical documentation.
How to use
from sparknlp.pretrained import PretrainedPipeline
pipeline = PretrainedPipeline("drug_form_matcher_pipeline", "en", "clinical/models")
sample_text = """ The patient was started on Metformin 500mg tablet twice daily with meals. For pain, Oxycodone 5mg capsule every 6 hours PRN was prescribed. Insulin glargine injection 20 units subcutaneously at bedtime. Apply Hydrocortisone 1% cream to affected areas twice daily. Fentanyl 25mcg/hr transdermal patch applied every 72 hours. Albuterol solution via nebulizer every 4 hours PRN."""
result = pipeline.transform(spark.createDataFrame([[sample_text]]).toDF("text"))
from johnsnowlabs import nlp, medical
pipeline = nlp.PretrainedPipeline("drug_form_matcher_pipeline", "en", "clinical/models")
sample_text = """ The patient was started on Metformin 500mg tablet twice daily with meals. For pain, Oxycodone 5mg capsule every 6 hours PRN was prescribed. Insulin glargine injection 20 units subcutaneously at bedtime. Apply Hydrocortisone 1% cream to affected areas twice daily. Fentanyl 25mcg/hr transdermal patch applied every 72 hours. Albuterol solution via nebulizer every 4 hours PRN."""
result = pipeline.transform(spark.createDataFrame([[sample_text]]).toDF("text"))
import com.johnsnowlabs.nlp.pretrained.PretrainedPipeline
val pipeline = PretrainedPipeline("drug_form_matcher_pipeline", "en", "clinical/models")
val sample_text = """ The patient was started on Metformin 500mg tablet twice daily with meals. For pain, Oxycodone 5mg capsule every 6 hours PRN was prescribed. Insulin glargine injection 20 units subcutaneously at bedtime. Apply Hydrocortisone 1% cream to affected areas twice daily. Fentanyl 25mcg/hr transdermal patch applied every 72 hours. Albuterol solution via nebulizer every 4 hours PRN."""
val result = pipeline.transform(spark.createDataFrame([[sample_text]]).toDF("text"))
Results
| chunk | begin | end | label |
| :---------------- | ----: | --: | :-------- |
| tablet | 43 | 48 | DRUG_FORM |
| capsule | 98 | 104 | DRUG_FORM |
| injection | 157 | 165 | DRUG_FORM |
| cream | 227 | 231 | DRUG_FORM |
| transdermal patch | 282 | 298 | DRUG_FORM |
| solution | 334 | 341 | DRUG_FORM |
Model Information
| Model Name: | drug_form_matcher_pipeline |
| Type: | pipeline |
| Compatibility: | Healthcare NLP 6.3.0+ |
| License: | Licensed |
| Edition: | Official |
| Language: | en |
| Size: | 933.6 KB |
Included Models
- DocumentAssembler
- SentenceDetector
- TokenizerModel
- TextMatcherInternalModel
- ChunkConverter