Description
This pretrained pipeline is built on the top of umls_clinical_drugs_mapper model and maps entities (Clinical Drugs) with their corresponding UMLS CUI codes.
How to use
from sparknlp.pretrained import PretrainedPipeline
pipeline = PretrainedPipeline("umls_clinical_drugs_mapping", "en", "clinical/models")
sample_text = """ The patient was prescribed Neosporin Cream to be applied externally to the infected area, metformin 1000 mg for diabetes management, and acetaminophen 500 mg oral capsule for pain relief."""
result = pipeline.transform(spark.createDataFrame([[sample_text]]).toDF("text"))
from johnsnowlabs import nlp, medical
pipeline = nlp.PretrainedPipeline("umls_clinical_drugs_mapping", "en", "clinical/models")
sample_text = """ The patient was prescribed Neosporin Cream to be applied externally to the infected area, metformin 1000 mg for diabetes management, and acetaminophen 500 mg oral capsule for pain relief."""
result = pipeline.transform(spark.createDataFrame([[sample_text]]).toDF("text"))
import com.johnsnowlabs.nlp.pretrained.PretrainedPipeline
val pipeline = PretrainedPipeline("umls_clinical_drugs_mapping", "en", "clinical/models")
val sample_text = """ The patient was prescribed Neosporin Cream to be applied externally to the infected area, metformin 1000 mg for diabetes management, and acetaminophen 500 mg oral capsule for pain relief."""
val result = pipeline.transform(spark.createDataFrame([[sample_text]]).toDF("text"))
Results
| chunk | umls_code |
| :-------------------------------- | :-------- |
| Neosporin Cream | C0132149 |
| metformin 1000 mg | C0987664 |
| acetaminophen 500 mg oral capsule | C0691088 |
Model Information
| Model Name: | umls_clinical_drugs_mapping |
| Type: | pipeline |
| Compatibility: | Healthcare NLP 6.3.0+ |
| License: | Licensed |
| Edition: | Official |
| Language: | en |
| Size: | 1.7 GB |
Included Models
- DocumentAssembler
- SentenceDetector
- TokenizerModel
- WordEmbeddingsModel
- MedicalNerModel
- NerConverterInternalModel
- ChunkMapperModel