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 #1673

Open
wants to merge 18 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
18 commits
Select commit Hold shift + click to select a range
9c3c47d
Add model 2024-12-19-medication_resolver_transform_pipeline_en
gokhanturer Dec 19, 2024
7ed476f
Update 2024-12-19-medication_resolver_transform_pipeline_en.md
akrztrk Dec 19, 2024
6f78109
Add model 2024-12-19-medication_resolver_pipeline_en
gokhanturer Dec 19, 2024
cbf832a
Update 2024-12-19-medication_resolver_pipeline_en.md
akrztrk Dec 19, 2024
99401b5
Add model 2024-12-23-snomed_multi_mapper_pipeline_en
gokhanturer Dec 23, 2024
b9283a5
Update 2024-12-23-snomed_multi_mapper_pipeline_en.md
akrztrk Dec 23, 2024
9719cda
Add model 2024-12-23-umls_drug_substance_resolver_pipeline_en
gokhanturer Dec 23, 2024
d2c475d
Update 2024-12-23-umls_drug_substance_resolver_pipeline_en.md
akrztrk Dec 23, 2024
96c2b2f
Update 2024-12-23-umls_drug_substance_resolver_pipeline_en.md
akrztrk Dec 23, 2024
e93ba20
Update 2024-12-23-umls_drug_substance_resolver_pipeline_en.md
akrztrk Dec 23, 2024
c552b0d
Add model 2024-12-23-umls_clinical_findings_resolver_pipeline_en
gokhanturer Dec 23, 2024
6747f44
Update 2024-12-23-umls_clinical_findings_resolver_pipeline_en.md
akrztrk Dec 23, 2024
dc5c69f
Add model 2024-12-24-umls_drug_resolver_pipeline_en
gokhanturer Dec 24, 2024
9e6ac05
Update 2024-12-24-umls_drug_resolver_pipeline_en.md
akrztrk Dec 24, 2024
c3259b6
Add model 2024-12-24-umls_disease_syndrome_resolver_pipeline_en
gokhanturer Dec 24, 2024
424a5ec
Update 2024-12-24-umls_disease_syndrome_resolver_pipeline_en.md
akrztrk Dec 24, 2024
83a28c9
Add model 2024-12-24-umls_major_concepts_resolver_pipeline_en
gokhanturer Dec 24, 2024
8d0f422
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/gokhanturer/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.4
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.4_1734641720568.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.4_1734641720568.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.4
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.4_1734638332532.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.4_1734638332532.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
100 changes: 100 additions & 0 deletions docs/_posts/gokhanturer/2024-12-23-snomed_multi_mapper_pipeline_en.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
---
layout: model
title: SNOMED Code Mapping Pipeline
author: John Snow Labs
name: snomed_multi_mapper_pipeline
date: 2024-12-23
tags: [licensed, en, snomed, pipeline]
task: Pipeline Healthcare
language: en
edition: Healthcare NLP 5.5.1
spark_version: 3.4
supported: true
annotator: PipelineModel
article_header:
type: cover
use_language_switcher: "Python-Scala-Java"
---

## Description

This pretrained pipeline maps SNOMED codes to their corresponding ICD-10, ICD-O, and UMLS codes.

## Predicted Entities

`snomed_code`

{:.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/snomed_multi_mapper_pipeline_en_5.5.1_3.4_1734958604723.zip){:.button.button-orange.button-orange-trans.arr.button-icon.hidden}
[Copy S3 URI](s3://auxdata.johnsnowlabs.com/clinical/models/snomed_multi_mapper_pipeline_en_5.5.1_3.4_1734958604723.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

mapper_pipeline = PretrainedPipeline("snomed_multi_mapper_pipeline", "en", "clinical/models")

result = mapper_pipeline.fullAnnotate(["10000006", "128501000"])

```

{:.jsl-block}
```python

mapper_pipeline = nlp.PretrainedPipeline("snomed_multi_mapper_pipeline", "en", "clinical/models")

result = mapper_pipeline.fullAnnotate(["10000006", "128501000"])

```
```scala

import com.johnsnowlabs.nlp.pretrained.PretrainedPipeline

val mapper_pipeline = PretrainedPipeline("snomed_multi_mapper_pipeline", "en", "clinical/models")

val result = mapper_pipeline.fullAnnotate(["10000006", "128501000"])

```
</div>

## Results

```bash

+-----------+------------+---------+---------+
|snomed_code|icd10cm_code|icdo_code|umls_code|
+-----------+------------+---------+---------+
| 10000006| R07.9| NONE| C0232289|
| 128501000| NONE| C49.5| C0448606|
+-----------+------------+---------+---------+

```

{:.model-param}
## Model Information

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

## Included Models

- DocumentAssembler
- DocMapperModel
- DocMapperModel
- DocMapperModel
Loading