Description
This pretrained pipeline is built on the top of umls_drug_substance_mapper model and maps entities (Drug Substances) with corresponding UMLS CUI codes.
How to use
from sparknlp.pretrained import PretrainedPipeline
pipeline = PretrainedPipeline("umls_drug_substance_mapping", "en", "clinical/models")
sample_text = """ The patient was given metformin, lenvatinib and gallopamil 50 MG Oral Tablet."""
result = pipeline.transform(spark.createDataFrame([[sample_text]]).toDF("text"))
from johnsnowlabs import nlp, medical
pipeline = nlp.PretrainedPipeline("umls_drug_substance_mapping", "en", "clinical/models")
sample_text = """ The patient was given metformin, lenvatinib and gallopamil 50 MG Oral Tablet."""
result = pipeline.transform(spark.createDataFrame([[sample_text]]).toDF("text"))
import com.johnsnowlabs.nlp.pretrained.PretrainedPipeline
val pipeline = PretrainedPipeline("umls_drug_substance_mapping", "en", "clinical/models")
val sample_text = """ The patient was given metformin, lenvatinib and gallopamil 50 MG Oral Tablet."""
val result = pipeline.transform(spark.createDataFrame([[sample_text]]).toDF("text"))
Results
| ner_chunk | umls_code |
| :--------------------------- | :-------- |
| metformin | C0025598 |
| lenvatinib | C2986924 |
| gallopamil 50 MG Oral Tablet | C0787234 |
Model Information
| Model Name: | umls_drug_substance_mapping |
| Type: | pipeline |
| Compatibility: | Healthcare NLP 6.3.0+ |
| License: | Licensed |
| Edition: | Official |
| Language: | en |
| Size: | 1.8 GB |
Included Models
- DocumentAssembler
- SentenceDetector
- TokenizerModel
- WordEmbeddingsModel
- MedicalNerModel
- NerConverterInternalModel
- ChunkMapperModel