From a50447d9fc3cd2ea4e8bc08ce27c1bf3a588086f Mon Sep 17 00:00:00 2001 From: HashamUlHaq Date: Sun, 23 Apr 2023 10:01:09 +0700 Subject: [PATCH 1/2] Add model 2023-04-23-summarizer_jsl_radiology_en --- .../2023-04-23-summarizer_jsl_radiology_en.md | 142 ++++++++++++++++++ 1 file changed, 142 insertions(+) create mode 100644 docs/_posts/HashamUlHaq/2023-04-23-summarizer_jsl_radiology_en.md diff --git a/docs/_posts/HashamUlHaq/2023-04-23-summarizer_jsl_radiology_en.md b/docs/_posts/HashamUlHaq/2023-04-23-summarizer_jsl_radiology_en.md new file mode 100644 index 0000000000..170743db3c --- /dev/null +++ b/docs/_posts/HashamUlHaq/2023-04-23-summarizer_jsl_radiology_en.md @@ -0,0 +1,142 @@ +--- +layout: model +title: Summarize Radiology Reports +author: John Snow Labs +name: summarizer_jsl_radiology +date: 2023-04-23 +tags: [clinical, licensed, en, summarization, tensorflow] +task: Summarization +language: en +edition: Healthcare NLP 4.4.0 +spark_version: 3.0 +supported: true +engine: tensorflow +annotator: MedicalSummarizer +article_header: + type: cover +use_language_switcher: "Python-Scala-Java" +--- + +## Description + +This model is capable of summarizing radiology reports while preserving the important information + +## Predicted Entities + + + +{:.btn-box} + + +[Download](https://s3.amazonaws.com/auxdata.johnsnowlabs.com/clinical/models/summarizer_jsl_radiology_en_4.4.0_3.0_1682218525772.zip){:.button.button-orange} +[Copy S3 URI](s3://auxdata.johnsnowlabs.com/clinical/models/summarizer_jsl_radiology_en_4.4.0_3.0_1682218525772.zip){:.button.button-orange.button-orange-trans.button-icon.button-copy-s3} + +## How to use + + + +
+{% include programmingLanguageSelectScalaPythonNLU.html %} +```python +document = DocumentAssembler().setInputCol('text').setOutputCol('document') + +summarizer = MedicalSummarizer.pretrained("summarizer_jsl_radiology", "en", "clinical/models").setInputCols(['document'])\ + .setOutputCol('summary')\ + .setMaxTextLength(512)\ + .setMaxNewTokens(512) + +pipeline = sparknlp.base.Pipeline(stages=[ + document, + summarizer +]) + +text = """INDICATIONS: Peripheral vascular disease with claudication. + +RIGHT: + +1. Normal arterial imaging of right lower extremity. +2. Peak systolic velocity is normal. + +3. Arterial waveform is triphasic. + +4. Ankle brachial index is 0.96. + +LEFT: +1. Normal arterial imaging of left lower extremity. + +2. Peak systolic velocity is normal. +3. Arterial waveform is triphasic throughout except in posterior +tibial artery where it is biphasic. + +4. Ankle brachial index is 1.06. + +IMPRESSION: + +Normal arterial imaging of both lower lobes. +""" + +data = spark.createDataFrame([[text]]).toDF("text") + +result = pipeline.fit(data).transform(data) +``` +```scala +val document_assembler = new DocumentAssembler() + .setInputCol("text") + .setOutputCol("document") + +val summarizer = MedicalSummarizer.pretrained("summarizer_clinical_jsl", "en", "clinical/models") + .setInputCols(['document']) + .setOutputCol('summary') + .setMaxTextLength(512) + .setMaxNewTokens(512) + +val pipeline = new Pipeline().setStages(Array(document_assembler, summarizer)) + +val text = """INDICATIONS: Peripheral vascular disease with claudication. + +RIGHT: + +1. Normal arterial imaging of right lower extremity. +2. Peak systolic velocity is normal. + +3. Arterial waveform is triphasic. + +4. Ankle brachial index is 0.96. + +LEFT: +1. Normal arterial imaging of left lower extremity. + +2. Peak systolic velocity is normal. +3. Arterial waveform is triphasic throughout except in posterior +tibial artery where it is biphasic. + +4. Ankle brachial index is 1.06. + +IMPRESSION: + +Normal arterial imaging of both lower lobes. +""" + +val data = Seq(text).toDS.toDF("text") + +val result = pipeline.fit(data).transform(data) +``` +
+ +## Results + +```bash +The patient has peripheral vascular disease with claudication. The right lower extremity shows normal arterial imaging, but the peak systolic velocity is normal. The arterial waveform is triphasic throughout, except for the posterior tibial artery, which is biphasic. The ankle brachial index is 0.96. The impression is normal arterial imaging of both lower lobes. +``` + +{:.model-param} +## Model Information + +{:.table-model} +|---|---| +|Model Name:|summarizer_jsl_radiology| +|Compatibility:|Healthcare NLP 4.4.0+| +|License:|Licensed| +|Edition:|Official| +|Language:|en| +|Size:|920.4 MB| \ No newline at end of file From 9ecc656fbfde7ae662e2ce3984c2586083d0d83a Mon Sep 17 00:00:00 2001 From: Cabir C <64752006+Cabir40@users.noreply.github.com> Date: Sun, 23 Apr 2023 10:00:14 +0300 Subject: [PATCH 2/2] Update 2023-04-23-summarizer_jsl_radiology_en.md --- .../2023-04-23-summarizer_jsl_radiology_en.md | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/docs/_posts/HashamUlHaq/2023-04-23-summarizer_jsl_radiology_en.md b/docs/_posts/HashamUlHaq/2023-04-23-summarizer_jsl_radiology_en.md index 170743db3c..d40503eb79 100644 --- a/docs/_posts/HashamUlHaq/2023-04-23-summarizer_jsl_radiology_en.md +++ b/docs/_posts/HashamUlHaq/2023-04-23-summarizer_jsl_radiology_en.md @@ -2,7 +2,7 @@ layout: model title: Summarize Radiology Reports author: John Snow Labs -name: summarizer_jsl_radiology +name: summarizer_radiology date: 2023-04-23 tags: [clinical, licensed, en, summarization, tensorflow] task: Summarization @@ -28,8 +28,8 @@ This model is capable of summarizing radiology reports while preserving the impo {:.btn-box} -[Download](https://s3.amazonaws.com/auxdata.johnsnowlabs.com/clinical/models/summarizer_jsl_radiology_en_4.4.0_3.0_1682218525772.zip){:.button.button-orange} -[Copy S3 URI](s3://auxdata.johnsnowlabs.com/clinical/models/summarizer_jsl_radiology_en_4.4.0_3.0_1682218525772.zip){:.button.button-orange.button-orange-trans.button-icon.button-copy-s3} +[Download](https://s3.amazonaws.com/auxdata.johnsnowlabs.com/clinical/models/summarizer_radiology_en_4.4.0_3.0_1682218525772.zip){:.button.button-orange} +[Copy S3 URI](s3://auxdata.johnsnowlabs.com/clinical/models/summarizer_radiology_en_4.4.0_3.0_1682218525772.zip){:.button.button-orange.button-orange-trans.button-icon.button-copy-s3} ## How to use @@ -37,11 +37,13 @@ This model is capable of summarizing radiology reports while preserving the impo
{% include programmingLanguageSelectScalaPythonNLU.html %} + ```python document = DocumentAssembler().setInputCol('text').setOutputCol('document') -summarizer = MedicalSummarizer.pretrained("summarizer_jsl_radiology", "en", "clinical/models").setInputCols(['document'])\ - .setOutputCol('summary')\ +summarizer = MedicalSummarizer.pretrained("summarizer_radiology", "en", "clinical/models")\ + .setInputCols(["document"])\ + .setOutputCol("summary")\ .setMaxTextLength(512)\ .setMaxNewTokens(512) @@ -84,9 +86,9 @@ val document_assembler = new DocumentAssembler() .setInputCol("text") .setOutputCol("document") -val summarizer = MedicalSummarizer.pretrained("summarizer_clinical_jsl", "en", "clinical/models") - .setInputCols(['document']) - .setOutputCol('summary') +val summarizer = MedicalSummarizer.pretrained("summarizer_radiology", "en", "clinical/models") + .setInputCols("document") + .setOutputCol("summary") .setMaxTextLength(512) .setMaxNewTokens(512) @@ -134,9 +136,9 @@ The patient has peripheral vascular disease with claudication. The right lower e {:.table-model} |---|---| -|Model Name:|summarizer_jsl_radiology| +|Model Name:|summarizer_radiology| |Compatibility:|Healthcare NLP 4.4.0+| |License:|Licensed| |Edition:|Official| |Language:|en| -|Size:|920.4 MB| \ No newline at end of file +|Size:|920.4 MB|