Pipeline to Detect Clinical Entities (Slim version, BertForTokenClassifier)

Description

This pretrained pipeline is built on the top of bert_token_classifier_ner_jsl_slim model.

Predicted Entities

Admission_Discharge, Age, Alergen, Birth_Entity, Body_Part, Clinical_Dept, Date_Time, Death_Entity, Demographics, Disease_Syndrome_Disorder, Drug, Header, Lifestyle, Medical_Device, Oncological, Physical_Measurement, Pregnancy_Newborn, Procedure, Substance_Quantity, Symptom, Test, Test_Result, Treatment, Vital_Sign

Copy S3 URI

How to use

from sparknlp.pretrained import PretrainedPipeline

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

text = '''HISTORY: 30-year-old female presents for digital bilateral mammography secondary to a soft tissue lump palpated by the patient in the upper right shoulder. The patient has a family history of breast cancer within her mother at age 58. Patient denies personal history of breast cancer.'''

result = pipeline.fullAnnotate(text)
import com.johnsnowlabs.nlp.pretrained.PretrainedPipeline

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

val text = "HISTORY: 30-year-old female presents for digital bilateral mammography secondary to a soft tissue lump palpated by the patient in the upper right shoulder. The patient has a family history of breast cancer within her mother at age 58. Patient denies personal history of breast cancer."

val result = pipeline.fullAnnotate(text)
import nlu
nlu.load("en.classify.token_bert.jsl_slim.pipeline").predict("""HISTORY: 30-year-old female presents for digital bilateral mammography secondary to a soft tissue lump palpated by the patient in the upper right shoulder. The patient has a family history of breast cancer within her mother at age 58. Patient denies personal history of breast cancer.""")

Results

|    | ner_chunk        |   begin |   end | ner_label    |   confidence |
|---:|:-----------------|--------:|------:|:-------------|-------------:|
|  0 | HISTORY:         |       0 |     7 | Header       |     0.994786 |
|  1 | 30-year-old      |       9 |    19 | Age          |     0.982408 |
|  2 | female           |      21 |    26 | Demographics |     0.99981  |
|  3 | mammography      |      59 |    69 | Test         |     0.993892 |
|  4 | soft tissue lump |      86 |   101 | Symptom      |     0.999448 |
|  5 | shoulder         |     146 |   153 | Body_Part    |     0.99978  |
|  6 | breast cancer    |     192 |   204 | Oncological  |     0.999466 |
|  7 | her mother       |     213 |   222 | Demographics |     0.997765 |
|  8 | age 58           |     227 |   232 | Age          |     0.997636 |
|  9 | breast cancer    |     270 |   282 | Oncological  |     0.999452 |

Model Information

Model Name: bert_token_classifier_ner_jsl_slim_pipeline
Type: pipeline
Compatibility: Healthcare NLP 4.3.0+
License: Licensed
Edition: Official
Language: en
Size: 405.0 MB

Included Models

  • DocumentAssembler
  • SentenceDetectorDLModel
  • TokenizerModel
  • MedicalBertForTokenClassifier
  • NerConverterInternalModel