Sentence Entity Resolver for CPT codes (procedures and measurements) - Augmented

Description

This model maps medical entities to CPT codes using Sentence Bert Embeddings. The corpus of this model has been extented to measurements, and this model is capable of mapping both procedures and measurement concepts/entities to CPT codes. Measurement codes are helpful in codifying medical entities related to tests and their results.

Predicted Entities

CPT codes and their descriptions.

Open in Colab Download

How to use

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

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

cpt_resolver = SentenceEntityResolverModel\
      .pretrained("sbiobertresolve_cpt_procedures_measurements_augmented", "en", "clinical/models") \
      .setInputCols(["ner_chunk", "sbert_embeddings"]) \
      .setOutputCol("cpt_code")

cpt_pipelineModel = PipelineModel(
    stages = [
        documentAssembler,
        jsl_sbert_embedder,
        cpt_resolver])

cpt_lp = LightPipeline(cpt_pipelineModel)
result = cpt_lp.fullAnnotate(['calcium score', 'heart surgery'])
val document_assembler = DocumentAssembler()
      .setInputCol("text")
      .setOutputCol("ner_chunk")

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

val cpt_resolver = SentenceEntityResolverModel
      .pretrained("sbiobertresolve_cpt_procedures_measurements_augmented", "en", "clinical/models) 
      .setInputCols(Array("ner_chunk", "sbert_embeddings")) 
      .setOutputCol("cpt_code")

val cpt_pipelineModel= new PipelineModel().setStages(Array(document_assembler, sbert_embedder, cpt_resolver))

val cpt_lp = LightPipeline(cpt_pipelineModel)
val result = cpt_lp.fullAnnotate(['calcium score', 'heart surgery'])

Results

|    | chunks        | code  | resolutions                                                                                                                                                                                                                               |
|---:|:--------------|:----- |:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|  0 | calcium score | 82310 | Calcium measurement [Calcium; total]                                                                                                                                                                                                      |
|  1 | heart surgery | 33257 | Cardiac surgery procedure [Operative tissue ablation and reconstruction of atria, performed at the time of other cardiac procedure(s), limited (eg, modified maze procedure) (List separately in addition to code for primary procedure)] |

Model Information

Model Name: sbiobertresolve_cpt_procedures_measurements_augmented
Compatibility: Spark NLP for Healthcare 3.1.0+
License: Licensed
Edition: Official
Input Labels: [sbert_embeddings]
Output Labels: [cpt_code]
Language: en
Case sensitive: true

Data Source

Trained on Current Procedural Terminology dataset with sbiobert_base_cased_mli sentence embeddings.