Relation Extraction Model Clinical

Description

Relation Extraction model based on syntactic features using deep learning. This model can be used to identify drug-drug interactions relationships among drug entities.

Included Relations

DDI-advise, DDI-effect, DDI-mechanism, DDI-int, DDI-false.

Open in ColabDownload

How to use

...
ddi_re_model = RelationExtractionModel.pretrained("re_drug_drug_interaction_clinical","en","clinical/models")\
	.setInputCols("word_embeddings","chunk","pos","dependency")\
	.setOutputCol("category")
nlp_pipeline = Pipeline(stages=[documenter, sentencer, tokenizer, words_embedder, pos_tagger, ner_tagger, ner_converter, dependency_parser, ddi_re_model])

light_pipeline = LightPipeline(nlp_pipeline.fit(spark.createDataFrame([['']]).toDF("text")))
annotations = light_pipeline.fullAnnotate("""When carbamazepine is withdrawn from the combination therapy, aripiprazole dose should then be reduced. If additional adrenergic drugs are to be administered by any route, they should be used with caution because the pharmacologically predictable sympathetic effects of Metformin may be potentiated""")
...

val ddi_re_model = RelationExtractionModel.pretrained("re_drug_drug_interaction_clinical","en","clinical/models")
	.setInputCols("word_embeddings","chunk","pos","dependency")
	.setOutputCol("category")

val pipeline = new Pipeline().setStages(Array(documenter, sentencer, tokenizer, words_embedder, pos_tagger, ner_tagger, ner_converter, dependency_parser, ddi_re_model))

val result = pipeline.fit(Seq.empty["When carbamazepine is withdrawn from the combination therapy, aripiprazole dose should then be reduced. If additional adrenergic drugs are to be administered by any route, they should be used with caution because the pharmacologically predictable sympathetic effects of Metformin may be potentiated"].toDS.toDF("text")).transform(data)

Results


|relation   | entity1 | entity1_begin | entity1_end | chunk1         | entity2  |entity2_begin | entity2_end | chunk2        |
|DDI-advise | DRUG    |      5        |      17     | carbamazepine  |  DRUG    |     62             73      | aripiprazole  |

Model Information

Name: re_drug_drug_interaction_clinical  
Type: RelationExtractionModel  
Compatibility: Spark NLP 2.5.5+  
License: Licensed  
Edition: Official  
Input labels: [word_embeddings, chunk, pos, dependency]  
Output labels: [category]  
Language: en  
Case sensitive: False  
Dependencies: embeddings_clinical  

Data Source

Trained on data gathered and manually annotated by John Snow Labs.

Benchmarking

+-------------+------+------+------+
|     relation|recall| prec |   f1 |
+-------------+------+------+------+
|      DDI-int|  0.40| 0.41 | 0.40 |
|DDI-mechanism|  0.77| 0.28 | 0.41 |
|   DDI-effect|  0.76| 0.38 | 0.51 |
|    DDI-false|  0.72| 0.97 | 0.83 |
|   DDI-advise|  0.74| 0.39 | 0.51 |
+-------------+------+------+------+