Sentence Entity Resolver for RxNorm (Action / Treatment)

Description

This model maps clinical entities and concepts (like drugs/ingredients) to RxNorm codes using sbiobert_base_cased_mli Sentence Bert Embeddings. Additionally, this model returns actions and treatments of the drugs in all_k_aux_labels column.

Predicted Entities

RxNorm Codes, Action, Treatment

Download

How to use

documentAssembler = DocumentAssembler()\
    .setInputCol("text")\
    .setOutputCol("ner_chunk")

sbert_embedder = BertSentenceEmbeddings.pretrained("sbiobert_base_cased_mli", "en", "clinical/models")\
    .setInputCols(["ner_chunk"])\
    .setOutputCol("sbert_embeddings")

rxnorm_resolver = SentenceEntityResolverModel.pretrained("sbiobertresolve_rxnorm_action_treatment", "en", "clinical/models")\
    .setInputCols(["ner_chunk", "sbert_embeddings"])\
    .setOutputCol("rxnorm_code")\
    .setDistanceFunction("EUCLIDEAN")

pipelineModel = PipelineModel( stages = [ documentAssembler, sbert_embedder, rxnorm_resolver ])

light_model = LightPipeline(pipelineModel)

result = light_model.fullAnnotate(["Zita 200 mg", "coumadin 5 mg", "avandia 4 mg"])
val documentAssembler = new DocumentAssembler()
      .setInputCol("text")
      .setOutputCol("ner_chunk")

val sbert_embedder = BertSentenceEmbeddings.pretrained("sbiobert_base_cased_mli", "en","clinical/models")
      .setInputCols(Array("ner_chunk"))
      .setOutputCol("sbert_embeddings")
    
val rxnorm_resolver = SentenceEntityResolverModel.pretrained("sbiobertresolve_rxnorm_action_treatment", "en", "clinical/models")
      .setInputCols(Array("ner_chunk", "sbert_embeddings"))
      .setOutputCol("rxnorm_code")
      .setDistanceFunction("EUCLIDEAN")

val rxnorm_pipelineModel = new PipelineModel().setStages(Array(documentAssembler, sbert_embedder, rxnorm_resolver))

val light_model = LightPipeline(rxnorm_pipelineModel)

val result = light_model.fullAnnotate(Array("Zita 200 mg", "coumadin 5 mg", "avandia 4 mg"))

Results

|    | ner_chunk     |   rxnorm_code | action                                                   | treatment                                                                                                                                                       |
|---:|:--------------|--------------:|:---------------------------------------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------|
|  0 | Zita 200 mg   |        104080 | ['Analgesic', 'Antacid', 'Antipyretic', 'Pain Reliever'] | ['Backache', 'Pain', 'Sore Throat', 'Headache', 'Influenza', 'Toothache', 'Heartburn', 'Migraine', 'Muscular Aches And Pains', 'Neuralgia', 'Cold', 'Weakness'] |
|  1 | coumadin 5 mg |        855333 | ['Anticoagulant']                                        | ['Cerebrovascular Accident', 'Pulmonary Embolism', 'Heart Attack', 'AF', 'Embolization']                                                                        |
|  2 | avandia 4 mg  |        261242 | ['Drugs Used In Diabets', 'Hypoglycemic']                | ['Diabetes Mellitus', 'Type 1 Diabetes Mellitus', 'Type 2 Diabetes']                                                                                            |

Model Information

Model Name: sbiobertresolve_rxnorm_action_treatment
Compatibility: Spark NLP for Healthcare 3.5.1+
License: Licensed
Edition: Official
Input Labels: [sentence_embeddings]
Output Labels: [rxnorm_code]
Language: en
Size: 918.7 MB
Case sensitive: false