Description
This pipeline, extracts medical_record entities from clinical texts.
How to use
from sparknlp.pretrained import PretrainedPipeline
pipeline = PretrainedPipeline("med_parser_pipeline", "en", "clinical/models")
sample_text = """ Month DD, YYYY
XYZ
RE: ABC
MEDICAL RECORD#: 12332
MRN: 1233567
MEDICAL RECORD#: 45678
MRN: 9876543
MEDICAL RECORD#: 11111
Dear Dr. XYZ:
I saw ABC back in Neuro-Oncology Clinic today."""
result = pipeline.transform(spark.createDataFrame([[sample_text]]).toDF("text"))
from johnsnowlabs import nlp, medical
pipeline = nlp.PretrainedPipeline("med_parser_pipeline", "en", "clinical/models")
sample_text = """ Month DD, YYYY
XYZ
RE: ABC
MEDICAL RECORD#: 12332
MRN: 1233567
MEDICAL RECORD#: 45678
MRN: 9876543
MEDICAL RECORD#: 11111
Dear Dr. XYZ:
I saw ABC back in Neuro-Oncology Clinic today."""
result = pipeline.transform(spark.createDataFrame([[sample_text]]).toDF("text"))
import com.johnsnowlabs.nlp.pretrained.PretrainedPipeline
val pipeline = PretrainedPipeline("med_parser_pipeline", "en", "clinical/models")
val sample_text = """ Month DD, YYYY
XYZ
RE: ABC
MEDICAL RECORD#: 12332
MRN: 1233567
MEDICAL RECORD#: 45678
MRN: 9876543
MEDICAL RECORD#: 11111
Dear Dr. XYZ:
I saw ABC back in Neuro-Oncology Clinic today."""
val result = pipeline.transform(spark.createDataFrame([[sample_text]]).toDF("text"))
Results
| chunk | begin | end | label |
|--------:|--------:|------:|:--------------|
| 12332 | 44 | 48 | MEDICALRECORD |
| 1233567 | 55 | 61 | MEDICALRECORD |
| 45678 | 80 | 84 | MEDICALRECORD |
| 9876543 | 91 | 97 | MEDICALRECORD |
| 11111 | 116 | 120 | MEDICALRECORD |
Model Information
| Model Name: | med_parser_pipeline |
| Type: | pipeline |
| Compatibility: | Healthcare NLP 6.3.0+ |
| License: | Licensed |
| Edition: | Official |
| Language: | en |
| Size: | 396.6 KB |
Included Models
- DocumentAssembler
- SentenceDetectorDLModel
- TokenizerModel
- ContextualParserModel
- ChunkConverter