Description
This model is capable of summarizing radiology reports while preserving the important information such as imaging tests and findings.
Predicted Entities
How to use
document = DocumentAssembler()\
.setInputCol("text")\
.setOutputCol("document")
summarizer = MedicalSummarizer.pretrained("summarizer_radiology", "en", "clinical/models")\
.setInputCols(["document"])\
.setOutputCol("summary")\
.setMaxTextLength(512)\
.setMaxNewTokens(512)
pipeline = 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)
val document_assembler = new DocumentAssembler()
.setInputCol("text")
.setOutputCol("document")
val summarizer = MedicalSummarizer.pretrained("summarizer_radiology", "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
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 Information
Model Name: | summarizer_radiology |
Compatibility: | Healthcare NLP 4.4.0+ |
License: | Licensed |
Edition: | Official |
Language: | en |
Size: | 920.4 MB |