Symptom Text Matcher Pipeline

Description

This pipeline, extracts symptom entities in clinical text. It recognizes a comprehensive list of clinical symptoms.

Copy S3 URI

How to use


from sparknlp.pretrained import PretrainedPipeline

pipeline = PretrainedPipeline("symptom_matcher_pipeline", "en", "clinical/models")

sample_text = """ The patient presents with severe headache and nausea for 3 days. She reports chest pain radiating to left arm with shortness of breath. Review of systems positive for fatigue, dizziness, and palpitations. Patient also complains of abdominal pain and constipation."""

result = pipeline.transform(spark.createDataFrame([[sample_text]]).toDF("text"))


from johnsnowlabs import nlp, medical

pipeline = nlp.PretrainedPipeline("symptom_matcher_pipeline", "en", "clinical/models")

sample_text = """ The patient presents with severe headache and nausea for 3 days. She reports chest pain radiating to left arm with shortness of breath. Review of systems positive for fatigue, dizziness, and palpitations. Patient also complains of abdominal pain and constipation."""

result = pipeline.transform(spark.createDataFrame([[sample_text]]).toDF("text"))


import com.johnsnowlabs.nlp.pretrained.PretrainedPipeline

val pipeline = PretrainedPipeline("symptom_matcher_pipeline", "en", "clinical/models")

val sample_text = """ The patient presents with severe headache and nausea for 3 days. She reports chest pain radiating to left arm with shortness of breath. Review of systems positive for fatigue, dizziness, and palpitations. Patient also complains of abdominal pain and constipation."""

val result = pipeline.transform(spark.createDataFrame([[sample_text]]).toDF("text"))

Results


| chunk               | begin | end | label   |
| :------------------ | ----: | --: | :------ |
| severe headache     |    26 |  40 | SYMPTOM |
| nausea              |    46 |  51 | SYMPTOM |
| chest pain          |    77 |  86 | SYMPTOM |
| shortness of breath |   115 | 133 | SYMPTOM |
| fatigue             |   167 | 173 | SYMPTOM |
| dizziness           |   176 | 184 | SYMPTOM |
| palpitations        |   191 | 202 | SYMPTOM |
| abdominal pain      |   231 | 244 | SYMPTOM |
| constipation        |   250 | 261 | SYMPTOM |

Model Information

Model Name: symptom_matcher_pipeline
Type: pipeline
Compatibility: Healthcare NLP 6.3.0+
License: Licensed
Edition: Official
Language: en
Size: 963.9 KB

Included Models

  • DocumentAssembler
  • SentenceDetector
  • TokenizerModel
  • TextMatcherInternalModel
  • ChunkConverter