Description
This pretrained resolver pipeline extracts SNOMED terms and map them to their corresponding SNOMED codes using BertSentenceChunkEmbeddings
which gets the embeddings of the sentence and the chunks then averages them. This helps the pipeline to return more context-aware resolutions. Also you can find the SNOMED code domain classes in the all_k_aux_labels
column in the metadata.
How to use
from sparknlp.pretrained import PretrainedPipeline
ner_pipeline = PretrainedPipeline("snomed_term_resolver_pipeline", "en", "clinical/models")
result = ner_pipeline.annotate("""[['The patient was diagnosed with acute appendicitis and scheduled for immediate surgery.'],
['His hypertension is currently managed with a combination of lifestyle modifications and medication.'],
['Laboratory tests indicate the individual has hyperthyroidism requiring further endocrinological assessment.'],
['The patient exhibited recurrent upper respiratory tract infections and presented with symptoms such as nasal congestion which persisted despite previous courses of symptomatic treatment.']]""")
import com.johnsnowlabs.nlp.pretrained.PretrainedPipeline
val ner_pipeline = PretrainedPipeline("snomed_term_resolver_pipeline", "en", "clinical/models")
val result = ner_pipeline.annotate("""[['The patient was diagnosed with acute appendicitis and scheduled for immediate surgery.'],
['His hypertension is currently managed with a combination of lifestyle modifications and medication.'],
['Laboratory tests indicate the individual has hyperthyroidism requiring further endocrinological assessment.'],
['The patient exhibited recurrent upper respiratory tract infections and presented with symptoms such as nasal congestion which persisted despite previous courses of symptomatic treatment.']]""")
Results
+-------+----------------------------------+-----------+-----------+-------------------------------------------+------------------------------------------------------------+------------------------------------------------------------+------------------------------------------------------------+
|text_id| ner_chunk| entity|snomed_code| description| all_codes| resolutions| all_k_aux_labels|
+-------+----------------------------------+-----------+-----------+-------------------------------------------+------------------------------------------------------------+------------------------------------------------------------+------------------------------------------------------------+
| 0| acute appendicitis|snomed_term| 85189001| acute appendicitis|85189001:::286967008:::4998000:::84534001:::235770006:::2...|acute appendicitis:::acute perforated appendicitis:::acut...|Clinical Finding:::Clinical Finding:::Clinical Finding:::...|
| 1| hypertension|snomed_term| 302192008| on treatment for hypertension|302192008:::38341003:::275944005:::308502002:::270440008:...|on treatment for hypertension:::hypertension:::hypertensi...|Procedure:::Clinical Finding:::Procedure:::Clinical Findi...|
| 2| hyperthyroidism|snomed_term| 34486009| hyperthyroidism|34486009:::237510004:::4997005:::161442007:::722941003:::...|hyperthyroidism:::iodine-induced hyperthyroidism:::factit...|Clinical Finding:::Clinical Finding:::Clinical Finding:::...|
| 3|upper respiratory tract infections|snomed_term| 195708003|recurrent upper respiratory tract infection|195708003:::54150009:::312118003:::54398005:::195647007::...|recurrent upper respiratory tract infection:::upper respi...|Clinical Finding:::Clinical Finding:::Clinical Finding:::...|
| 3| nasal congestion|snomed_term| 68235000| nasal congestion|68235000:::267100006:::2571000112102:::19452008:::6461100...|nasal congestion:::nasal obstruction present:::recurrent ...|Clinical Finding:::Context-dependent:::No_Concept_Class::...|
+-------+----------------------------------+-----------+-----------+-------------------------------------------+------------------------------------------------------------+------------------------------------------------------------+------------------------------------------------------------+
Model Information
Model Name: | snomed_term_resolver_pipeline |
Type: | pipeline |
Compatibility: | Healthcare NLP 5.3.1+ |
License: | Licensed |
Edition: | Official |
Language: | en |
Size: | 4.3 GB |
Included Models
- DocumentAssembler
- SentenceDetectorDLModel
- TokenizerModel
- WordEmbeddingsModel
- MedicalNerModel
- NerConverterInternalModel
- BertSentenceChunkEmbeddings
- SentenceEntityResolverModel