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

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
fb7a98c
Add model 2024-12-19-medication_resolver_transform_pipeline_en
akrztrk Dec 19, 2024
a3988e9
Update 2024-12-19-medication_resolver_transform_pipeline_en.md
akrztrk Dec 19, 2024
06676eb
Add model 2024-12-19-medication_resolver_pipeline_en
akrztrk Dec 19, 2024
59f25b8
Update 2024-12-19-medication_resolver_pipeline_en.md
akrztrk Dec 19, 2024
9a2eb70
Add model 2024-12-23-snomed_multi_mapper_pipeline_en
akrztrk Dec 23, 2024
feace77
Update 2024-12-23-snomed_multi_mapper_pipeline_en.md
akrztrk Dec 23, 2024
ad4a1c6
Add model 2024-12-23-umls_drug_substance_resolver_pipeline_en
akrztrk Dec 23, 2024
5196eae
Update 2024-12-23-umls_drug_substance_resolver_pipeline_en.md
akrztrk Dec 23, 2024
c3b8d17
Update 2024-12-23-umls_drug_substance_resolver_pipeline_en.md
akrztrk Dec 23, 2024
140fbfa
Update 2024-12-23-umls_drug_substance_resolver_pipeline_en.md
akrztrk Dec 23, 2024
1d2db97
Add model 2024-12-23-umls_clinical_findings_resolver_pipeline_en
akrztrk Dec 23, 2024
9599571
Update 2024-12-23-umls_clinical_findings_resolver_pipeline_en.md
akrztrk Dec 23, 2024
4f984d3
Add model 2024-12-24-umls_drug_resolver_pipeline_en
akrztrk Dec 24, 2024
5298850
Update 2024-12-24-umls_drug_resolver_pipeline_en.md
akrztrk Dec 24, 2024
c2f8721
Add model 2024-12-24-umls_disease_syndrome_resolver_pipeline_en
akrztrk Dec 24, 2024
010f232
Update 2024-12-24-umls_disease_syndrome_resolver_pipeline_en.md
akrztrk Dec 24, 2024
5d1a333
Add model 2024-12-24-umls_major_concepts_resolver_pipeline_en
akrztrk Dec 24, 2024
ecd100b
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/akrztrk/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.0
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.0_1734639447518.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.0_1734639447518.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.0
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.0_1734635642246.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.0_1734635642246.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/akrztrk/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.0
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.0_1734953947952.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.0_1734953947952.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