CPT Contextual Parser Pipeline

Description

This pipeline, extracts CPT entities from clinical texts.

How to use


from sparknlp.pretrained import PretrainedPipeline

pipeline = PretrainedPipeline("cpt_parser_pipeline", "en", "clinical/models")

sample_text = """ The patient underwent procedure CPT 99213 for office visit.
Laboratory tests were performed using CPT code 80053 for comprehensive metabolic panel.
The radiology department billed CPT 93000 for electrocardiogram.
Surgical procedure was coded as CPT 36415 for routine venipuncture.
The final billing included CPT 85025 for complete blood count with differential."""

result = pipeline.transform(spark.createDataFrame([[sample_text]]).toDF("text"))


from johnsnowlabs import nlp, medical

pipeline = nlp.PretrainedPipeline("cpt_parser_pipeline", "en", "clinical/models")

sample_text = """ The patient underwent procedure CPT 99213 for office visit.
Laboratory tests were performed using CPT code 80053 for comprehensive metabolic panel.
The radiology department billed CPT 93000 for electrocardiogram.
Surgical procedure was coded as CPT 36415 for routine venipuncture.
The final billing included CPT 85025 for complete blood count with differential."""

result = pipeline.transform(spark.createDataFrame([[sample_text]]).toDF("text"))


import com.johnsnowlabs.nlp.pretrained.PretrainedPipeline

val pipeline = PretrainedPipeline("cpt_parser_pipeline", "en", "clinical/models")

val sample_text = """ The patient underwent procedure CPT 99213 for office visit.
Laboratory tests were performed using CPT code 80053 for comprehensive metabolic panel.
The radiology department billed CPT 93000 for electrocardiogram.
Surgical procedure was coded as CPT 36415 for routine venipuncture.
The final billing included CPT 85025 for complete blood count with differential."""

val result = pipeline.transform(spark.createDataFrame([[sample_text]]).toDF("text"))

Results


|   cpt_id |   begin |   end | label   |
|---------:|--------:|------:|:--------|
|    99213 |      36 |    41 | CPT     |
|    80053 |     107 |   112 | CPT     |
|    93000 |     184 |   189 | CPT     |
|    36415 |     249 |   254 | CPT     |
|    85025 |     312 |   317 | CPT     |

Model Information

Model Name: cpt_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

References

CPT resolver models are removed from the Models Hub due to license restrictions and can only be shared with the users who already have a valid CPT license. If you possess one and wish to use this model, kindly contact us at support@johnsnowlabs.com.