Pipeline for Extracting Clinical Entities Related to LOINC Codes

Description

This pipeline is designed to extract all entities mappable to LOINC codes.

2 NER models are used to achieve this task.

Copy S3 URI

How to use


from sparknlp.pretrained import PretrainedPipeline

ner_pipeline = PretrainedPipeline("ner_loinc_pipeline", "en", "clinical/models")

result = ner_pipeline.annotate("""
A 65-year-old woman presents to the office with generalized fatigue for the last 4 months.
  She used to walk 1 mile each evening but now gets tired after 1-2 blocks. She has a history of Crohn disease and hypertension
  for which she receives appropriate medications. She is married and lives with her husband. She eats a balanced diet that
  includes chicken, fish, pork, fruits, and vegetables. She rarely drinks alcohol and denies tobacco use. Vital signs are
  within normal limits. A physical examination is unremarkable. Laboratory studies show the following: Hemoglobin: 9.8g/dL,
  Hematocrit: 32%, Mean Corpuscular Volume: 110 μm3.
""")


import com.johnsnowlabs.nlp.pretrained.PretrainedPipeline

val ner_pipeline = PretrainedPipeline("ner_loinc_pipeline", "en", "clinical/models")

val result = ner_pipeline.annotate("""
A 65-year-old woman presents to the office with generalized fatigue for the last 4 months.
  She used to walk 1 mile each evening but now gets tired after 1-2 blocks. She has a history of Crohn disease and hypertension
  for which she receives appropriate medications. She is married and lives with her husband. She eats a balanced diet that
  includes chicken, fish, pork, fruits, and vegetables. She rarely drinks alcohol and denies tobacco use. Vital signs are
  within normal limits. A physical examination is unremarkable. Laboratory studies show the following: Hemoglobin: 9.8g/dL,
  Hematocrit: 32%, Mean Corpuscular Volume: 110 μm3.
""")

Results

|    | chunks                  |   begin |   end | entities   |
|---:|:------------------------|--------:|------:|:-----------|
|  0 | Vital signs             |     449 |   459 | Test       |
|  1 | A physical examination  |     489 |   510 | Test       |
|  2 | Laboratory studies      |     529 |   546 | Test       |
|  3 | Hemoglobin              |     568 |   577 | Test       |
|  4 | Hematocrit              |     591 |   600 | Test       |
|  5 | Mean Corpuscular Volume |     608 |   630 | Test       |

Model Information

Model Name: ner_loinc_pipeline
Type: pipeline
Compatibility: Healthcare NLP 6.0.2+
License: Licensed
Edition: Official
Language: en
Size: 1.7 GB

Included Models

  • DocumentAssembler
  • SentenceDetectorDLModel
  • TokenizerModel
  • WordEmbeddingsModel
  • MedicalNerModel
  • NerConverterInternalModel
  • MedicalNerModel
  • NerConverterInternalModel
  • ChunkMergeModel