Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2024-12-19-medication_resolver_transform_pipeline_en #1672

Open
wants to merge 25 commits into
base: models_hub_internal
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
51484b5
Add model 2024-12-19-medication_resolver_transform_pipeline_en
Meryem1425 Dec 19, 2024
6b3ecc2
Update 2024-12-19-medication_resolver_transform_pipeline_en.md
akrztrk Dec 19, 2024
71f1282
Add model 2024-12-19-medication_resolver_pipeline_en
Meryem1425 Dec 19, 2024
036aac0
Update 2024-12-19-medication_resolver_pipeline_en.md
akrztrk Dec 19, 2024
788a5ac
Add model 2024-12-21-zeroshot_ner_deid_generic_multi_large_xx
Meryem1425 Dec 21, 2024
58f844b
Update 2024-12-21-zeroshot_ner_deid_generic_multi_large_xx.md
akrztrk Dec 21, 2024
46a6b24
Add model 2024-12-21-zeroshot_ner_deid_generic_multi_medium_xx
Meryem1425 Dec 21, 2024
0ae5b00
Update 2024-12-21-zeroshot_ner_deid_generic_multi_large_xx.md
akrztrk Dec 21, 2024
c1bd82e
Update 2024-12-21-zeroshot_ner_deid_generic_multi_medium_xx.md
akrztrk Dec 21, 2024
08d9a46
Add model 2024-12-23-snomed_multi_mapper_pipeline_en
Meryem1425 Dec 23, 2024
addc8b4
Update 2024-12-23-snomed_multi_mapper_pipeline_en.md
akrztrk Dec 23, 2024
f2c7301
Add model 2024-12-23-umls_drug_substance_resolver_pipeline_en
Meryem1425 Dec 23, 2024
0de85ed
Update 2024-12-23-umls_drug_substance_resolver_pipeline_en.md
akrztrk Dec 23, 2024
6560c45
Update 2024-12-23-umls_drug_substance_resolver_pipeline_en.md
akrztrk Dec 23, 2024
2ce00ea
Update 2024-12-23-umls_drug_substance_resolver_pipeline_en.md
akrztrk Dec 23, 2024
b388d0e
Add model 2024-12-23-umls_clinical_findings_resolver_pipeline_en
Meryem1425 Dec 23, 2024
41028c8
Update 2024-12-23-umls_clinical_findings_resolver_pipeline_en.md
akrztrk Dec 23, 2024
27490a5
Add model 2024-12-24-umls_drug_resolver_pipeline_en
Meryem1425 Dec 24, 2024
29db60a
Update 2024-12-24-umls_drug_resolver_pipeline_en.md
akrztrk Dec 24, 2024
7f72a4f
Update 2024-12-21-zeroshot_ner_deid_generic_multi_large_xx.md
akrztrk Dec 24, 2024
7394b8c
Update 2024-12-21-zeroshot_ner_deid_generic_multi_medium_xx.md
akrztrk Dec 24, 2024
8db5adf
Add model 2024-12-24-umls_disease_syndrome_resolver_pipeline_en
Meryem1425 Dec 24, 2024
d159398
Update 2024-12-24-umls_disease_syndrome_resolver_pipeline_en.md
akrztrk Dec 24, 2024
0c28abd
Add model 2024-12-24-umls_major_concepts_resolver_pipeline_en
Meryem1425 Dec 24, 2024
1c386d1
Update 2024-12-24-umls_major_concepts_resolver_pipeline_en.md
akrztrk Dec 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
132 changes: 132 additions & 0 deletions docs/_posts/Meryem1425/2024-12-19-medication_resolver_pipeline_en.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
---
layout: model
title: Pipeline to Resolve Medication Codes
author: John Snow Labs
name: medication_resolver_pipeline
date: 2024-12-19
tags: [licensed, en, resolver, snomed, umls, rxnorm, ndc, ade, pipeline]
task: [Pipeline Healthcare, Named Entity Recognition]
language: en
edition: Healthcare NLP 5.5.1
spark_version: 3.2
supported: true
annotator: PipelineModel
article_header:
type: cover
use_language_switcher: "Python-Scala-Java"
---

## Description

A pretrained resolver pipeline to extract medications and resolve their adverse reactions (ADE), RxNorm, UMLS, NDC, SNOMED CT codes, and action/treatments in clinical text.

Action/treatments are available for branded medication, and SNOMED codes are available for non-branded medication.

This pipeline can be used as Lightpipeline (with `annotate/fullAnnotate`). You can use `medication_resolver_transform_pipeline` for Spark transform.

## Predicted Entities

`DRUG`

{:.btn-box}
<button class="button button-orange" disabled>Live Demo</button>
<button class="button button-orange" disabled>Open in Colab</button>
[Download](https://s3.amazonaws.com/auxdata.johnsnowlabs.com/clinical/models/medication_resolver_pipeline_en_5.5.1_3.2_1734640548198.zip){:.button.button-orange.button-orange-trans.arr.button-icon.hidden}
[Copy S3 URI](s3://auxdata.johnsnowlabs.com/clinical/models/medication_resolver_pipeline_en_5.5.1_3.2_1734640548198.zip){:.button.button-orange.button-orange-trans.button-icon.button-copy-s3}

## How to use



<div class="tabs-box" markdown="1">
{% include programmingLanguageSelectScalaPythonNLU.html %}

```python

from sparknlp.pretrained import PretrainedPipeline

ner_pipeline = PretrainedPipeline("medication_resolver_pipeline", "en", "clinical/models")

result = ner_pipeline.annotate("""The patient was prescribed Amlodopine Vallarta 10-320mg, Eviplera.
The other patient is given Lescol 40 MG and Everolimus 1.5 mg tablet.
""")

```

{:.jsl-block}
```python

ner_pipeline = nlp.PretrainedPipeline("medication_resolver_pipeline", "en", "clinical/models")

result = ner_pipeline.annotate("""The patient was prescribed Amlodopine Vallarta 10-320mg, Eviplera.
The other patient is given Lescol 40 MG and Everolimus 1.5 mg tablet.
""")

```
```scala

import com.johnsnowlabs.nlp.pretrained.PretrainedPipeline

val ner_pipeline = PretrainedPipeline("medication_resolver_pipeline", "en", "clinical/models")

val result = ner_pipeline.annotate("""The patient was prescribed Amlodopine Vallarta 10-320mg, Eviplera.
The other patient is given Lescol 40 MG and Everolimus 1.5 mg tablet.
""")

```
</div>

## Results

```bash


+----------------------------+---------+---------------------------+-------+--------------------------+------------------------------------------+--------+----------------+-----------+-------------+
|chunk |ner_label|ADE |RxNorm |Action |Treatment |UMLS |SNOMED_CT |NDC_Product|NDC_Package |
+----------------------------+---------+---------------------------+-------+--------------------------+------------------------------------------+--------+----------------+-----------+-------------+
|Amlodopine Vallarta 10-320mg|DRUG |Gynaecomastia |722131 |NONE |NONE |C1949334|1153435009 |00093-7693 |00093-7693-56|
|Eviplera |DRUG |Anxiety |217010 |Inhibitory Bone Resorption|Osteoporosis |C0720318|NONE |NONE |NONE |
|Lescol 40 MG |DRUG |NONE |103919 |Hypocholesterolemic |Heterozygous Familial Hypercholesterolemia|C0353573|NONE |00078-0234 |00078-0234-05|
|Everolimus 1.5 mg tablet |DRUG |Acute myocardial infarction|2056895|NONE |NONE |C4723581|1029521000202102|00054-0604 |00054-0604-21|
+----------------------------+---------+---------------------------+-------+--------------------------+------------------------------------------+--------+----------------+-----------+-------------+


```

{:.model-param}
## Model Information

{:.table-model}
|---|---|
|Model Name:|medication_resolver_pipeline|
|Type:|pipeline|
|Compatibility:|Healthcare NLP 5.5.1+|
|License:|Licensed|
|Edition:|Official|
|Language:|en|
|Size:|3.3 GB|

## Included Models

- DocumentAssembler
- SentenceDetectorDLModel
- TokenizerModel
- WordEmbeddingsModel
- MedicalNerModel
- NerConverterInternalModel
- TextMatcherInternalModel
- ChunkMergeModel
- ChunkMapperModel
- ChunkMapperModel
- ChunkMapperFilterer
- Chunk2Doc
- BertSentenceEmbeddings
- SentenceEntityResolverModel
- ResolverMerger
- ChunkMapperModel
- ChunkMapperModel
- ChunkMapperModel
- ChunkMapperModel
- ChunkMapperModel
- ChunkMapperModel
- Finisher
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
---
layout: model
title: Pipeline to Resolve Medication Codes(Transform)
author: John Snow Labs
name: medication_resolver_transform_pipeline
date: 2024-12-19
tags: [licensed, en, resolver, snomed, umls, rxnorm, ndc, ade, pipeline]
task: [Pipeline Healthcare, Named Entity Recognition]
language: en
edition: Healthcare NLP 5.5.1
spark_version: 3.2
supported: true
annotator: PipelineModel
article_header:
type: cover
use_language_switcher: "Python-Scala-Java"
---

## Description

A pretrained resolver pipeline to extract medications and resolve their adverse reactions (ADE), RxNorm, UMLS, NDC, SNOMED CT codes, and action/treatments in clinical text.

Action/treatments are available for branded medication, and SNOMED codes are available for non-branded medication.

This pipeline can be used with Spark transform. You can use `medication_resolver_pipeline` as Lightpipeline (with `annotate/fullAnnotate`).

## Predicted Entities

`DRUG`

{:.btn-box}
<button class="button button-orange" disabled>Live Demo</button>
<button class="button button-orange" disabled>Open in Colab</button>
[Download](https://s3.amazonaws.com/auxdata.johnsnowlabs.com/clinical/models/medication_resolver_transform_pipeline_en_5.5.1_3.2_1734636623226.zip){:.button.button-orange.button-orange-trans.arr.button-icon.hidden}
[Copy S3 URI](s3://auxdata.johnsnowlabs.com/clinical/models/medication_resolver_transform_pipeline_en_5.5.1_3.2_1734636623226.zip){:.button.button-orange.button-orange-trans.button-icon.button-copy-s3}

## How to use



<div class="tabs-box" markdown="1">
{% include programmingLanguageSelectScalaPythonNLU.html %}

```python

from sparknlp.pretrained import PretrainedPipeline

medication_resolver_pipeline = PretrainedPipeline("medication_resolver_transform_pipeline", "en", "clinical/models")

text = """The patient was prescribed Amlodopine Vallarta 10-320mg, Eviplera.
The other patient is given Lescol 40 MG and Everolimus 1.5 mg tablet."""

data = spark.createDataFrame([[text]]).toDF("text")

result = medication_resolver_pipeline.transform(data)

```

{:.jsl-block}
```python

medication_resolver_pipeline = nlp.PretrainedPipeline("medication_resolver_transform_pipeline", "en", "clinical/models")

text = """The patient was prescribed Amlodopine Vallarta 10-320mg, Eviplera.
The other patient is given Lescol 40 MG and Everolimus 1.5 mg tablet."""

data = spark.createDataFrame([[text]]).toDF("text")

result = medication_resolver_pipeline.transform(data)


```
```scala

import com.johnsnowlabs.nlp.pretrained.PretrainedPipeline

val medication_resolver_pipeline = new PretrainedPipeline("medication_resolver_transform_pipeline", "en", "clinical/models")

val data = Seq("""The patient was prescribed Amlodopine Vallarta 10-320mg, Eviplera.
The other patient is given Lescol 40 MG and Everolimus 1.5 mg tablet.""").toDS.toDF("text")

val result = medication_resolver_pipeline.fit(data).transform(data)

```
</div>

## Results

```bash


+----------------------------+---------+---------------------------+-------+--------------------------+------------------------------------------+--------+----------------+-----------+-------------+
|chunk |ner_label|ADE |RxNorm |Action |Treatment |UMLS |SNOMED_CT |NDC_Product|NDC_Package |
+----------------------------+---------+---------------------------+-------+--------------------------+------------------------------------------+--------+----------------+-----------+-------------+
|Amlodopine Vallarta 10-320mg|DRUG |Gynaecomastia |722131 |NONE |NONE |C1949334|1153435009 |00093-7693 |00093-7693-56|
|Eviplera |DRUG |Anxiety |217010 |Inhibitory Bone Resorption|Osteoporosis |C0720318|NONE |NONE |NONE |
|Lescol 40 MG |DRUG |NONE |103919 |Hypocholesterolemic |Heterozygous Familial Hypercholesterolemia|C0353573|NONE |00078-0234 |00078-0234-05|
|Everolimus 1.5 mg tablet |DRUG |Acute myocardial infarction|2056895|NONE |NONE |C4723581|1029521000202102|00054-0604 |00054-0604-21|
+----------------------------+---------+---------------------------+-------+--------------------------+------------------------------------------+--------+----------------+-----------+-------------+


```

{:.model-param}
## Model Information

{:.table-model}
|---|---|
|Model Name:|medication_resolver_transform_pipeline|
|Type:|pipeline|
|Compatibility:|Healthcare NLP 5.5.1+|
|License:|Licensed|
|Edition:|Official|
|Language:|en|
|Size:|3.3 GB|

## Included Models

- DocumentAssembler
- SentenceDetectorDLModel
- TokenizerModel
- WordEmbeddingsModel
- MedicalNerModel
- NerConverterInternalModel
- TextMatcherInternalModel
- ChunkMergeModel
- ChunkMapperModel
- ChunkMapperModel
- ChunkMapperFilterer
- Chunk2Doc
- BertSentenceEmbeddings
- SentenceEntityResolverModel
- ResolverMerger
- Doc2Chunk
- ChunkMapperModel
- ChunkMapperModel
- ChunkMapperModel
- ChunkMapperModel
- ChunkMapperModel
- Doc2Chunk
- ChunkMapperModel
- Finisher
Loading