Mapping Entities with Corresponding SNOMED Codes - Pipeline

Description

This pipeline extracts clinical entities from text and maps them to their corresponding SNOMED CT concept codes via a direct dictionary lookup.

Wraps the snomed_mapper_20260901 mapper, trained on the SNOMED CT US Edition 20260901 release.

Live Demo Open in Colab Copy S3 URI

How to use


from sparknlp.pretrained import PretrainedPipeline

snomed_pipeline = PretrainedPipeline("snomed_mapping_pipeline_20260901", "en", "clinical/models")

data = spark.createDataFrame([["The patient underwent an appendectomy for acute appendicitis and was diagnosed with type 2 diabetes mellitus. She reported hemolysis and chest pain on recent labs, was noted to have coronary artery disease, and was started on aspirin."]]).toDF("text")
result = snomed_pipeline.transform(data)


from johnsnowlabs import nlp, medical

snomed_pipeline = nlp.PretrainedPipeline("snomed_mapping_pipeline_20260901", "en", "clinical/models")

data = spark.createDataFrame([["The patient underwent an appendectomy for acute appendicitis and was diagnosed with type 2 diabetes mellitus. She reported hemolysis and chest pain on recent labs, was noted to have coronary artery disease, and was started on aspirin."]]).toDF("text")
result = snomed_pipeline.transform(data)


import com.johnsnowlabs.nlp.pretrained.PretrainedPipeline

val snomed_pipeline = PretrainedPipeline("snomed_mapping_pipeline_20260901", "en", "clinical/models")

val data = Seq("The patient underwent an appendectomy for acute appendicitis and was diagnosed with type 2 diabetes mellitus. She reported hemolysis and chest pain on recent labs, was noted to have coronary artery disease, and was started on aspirin.").toDF("text")
val result = snomed_pipeline.transform(data)

Results

| ner_chunk                |   snomed_code | all_k_resolutions                |
|:-------------------------|--------------:|:---------------------------------|
| appendectomy             |      80146002 | 80146002:::                      |
| appendicitis             |      74400008 | 74400008:::                      |
| type 2 diabetes mellitus |      44054006 | 44054006:::                      |
| hemolysis                |     260882000 | 260882000:::404227002:::73320003 |
| chest pain               |      29857009 | 29857009:::                      |
| coronary artery disease  |      53741008 | 53741008:::                      |
| aspirin                  |     387458008 | 387458008:::                     |

Model Information

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

Included Models

  • DocumentAssembler
  • SentenceDetectorDLModel
  • TokenizerModel
  • WordEmbeddingsModel
  • MedicalNerModel
  • NerConverterInternalModel
  • ChunkMapperModel