Mapping SNOMED Codes with Their Corresponding ICDO Codes

Description

This pretrained model maps SNOMED codes to corresponding ICDO codes under the Unified Medical Language System (UMLS).

Predicted Entities

icdo_code

Open in Colab Copy S3 URI

How to use

documentAssembler = DocumentAssembler()\
.setInputCol("text")\
.setOutputCol("ner_chunk")

sbert_embedder = BertSentenceEmbeddings\
.pretrained("sbiobert_base_cased_mli", "en", "clinical/models")\
.setInputCols(["ner_chunk"])\
.setOutputCol("sbert_embeddings")

snomed_resolver = SentenceEntityResolverModel\
.pretrained("sbiobertresolve_snomed_findings_aux_concepts", "en", "clinical/models") \
.setInputCols(["ner_chunk", "sbert_embeddings"]) \
.setOutputCol("snomed_code")\
.setDistanceFunction("EUCLIDEAN")

chunkerMapper = ChunkMapperModel\
.pretrained("snomed_icdo_mapper", "en", "clinical/models")\
.setInputCols(["snomed_code"])\
.setOutputCol("icdo_mappings")\
.setRels(["icdo_code"])


pipeline = Pipeline(stages = [
documentAssembler,
sbert_embedder,
snomed_resolver,
chunkerMapper
])

model = pipeline.fit(spark.createDataFrame([[""]]).toDF("text"))

light_pipeline= LightPipeline(model)

result = light_pipeline.fullAnnotate("Structure of tendon of gluteus minimus")
val documentAssembler = new DocumentAssembler()
.setInputCol("text")
.setOutputCol("ner_chunk")

val sbert_embedder = BertSentenceEmbeddings
.pretrained("sbiobert_base_cased_mli", "en", "clinical/models")
.setInputCols("ner_chunk")
.setOutputCol("sbert_embeddings")

val snomed_resolver = SentenceEntityResolverModel
.pretrained("sbiobertresolve_snomed_findings_aux_concepts", "en", "clinical/models")
.setInputCols(Array("ner_chunk", "sbert_embeddings"))
.setOutputCol("snomed_code")
.setDistanceFunction("EUCLIDEAN")

val chunkerMapper = ChunkMapperModel
.pretrained("snomed_icdo_mapper", "en", "clinical/models")
.setInputCols("snomed_code")
.setOutputCol("icdo_mappings")
.setRels(Array("icdo_code"))

val pipeline = new Pipeline(stages = Array(
documentAssembler,
sbert_embedder,
snomed_resolver,
chunkerMapper
))

val data = Seq("Structure of tendon of gluteus minimus").toDS.toDF("text")

val result= pipeline.fit(data).transform(data)
import nlu
nlu.load("en.snomed_to_icdo").predict("""Structure of tendon of gluteus minimus""")

Results

|    | ner_chunk                              | snomed_code |   icdo_mappings |
|---:|:---------------------------------------|:------------|----------------:|
|  0 | Structure of tendon of gluteus minimus | 128501000   |           C49.5 |

Model Information

Model Name: snomed_icdo_mapper
Compatibility: Healthcare NLP 3.5.3+
License: Licensed
Edition: Official
Input Labels: [snomed_code]
Output Labels: [mappings]
Language: en
Size: 203.5 KB