Examples

 

Usage examples of NLU.load()

The following examples demonstrate how to use nlu’s load api accompanied by the outputs generated by it. It enables loading any model or pipeline in one line
You need to pass one NLU reference to the load method.
You can also pass multiple whitespace separated references.
You can find all NLU references here

Medical Named Entity Recognition (NER)

Medical NER tutorial notebook

NLU provided a seperate and highly tuned medical NER models for various Healthcare domains.
These medical NER models are trained to extract various medical named entities.

data ="""The patient is a 5-month-old infant who presented initially on Monday with a cold, cough, and runny nose for 2 days."""
df = nlu.load('med_ner.jsl.wip.clinical en.resolve_chunk.cpt_clinical').predict(data)
entities@clinical_results meta_entities@clinical_entity meta_entities@clinical_confidence chunk_resolution_results meta_chunk_resolution_all_k_aux_labels meta_chunk_resolution_target_text meta_chunk_resolution_distance meta_chunk_resolution_confidence meta_chunk_resolution_all_k_results meta_chunk_resolution_all_k_distances meta_chunk_resolution_all_k_cosine_distances
5-month-old Age 0.9982 49496   5-month-old 15.0536 1 49496 15.0536 0.5153
infant Age 0.9999 49492   infant 6.7093 1 49492 6.7093 0.3702
Monday RelativeDate 0.9983 59857   Monday 12.6501 1 59857 12.6501 0.5324
cold Symptom 0.7517 50547   cold 2.6313 1 50547 2.6313 0.4492
cough Symptom 0.9969 32215   cough 3.5559 1 32215 3.5559 0.4847
runny nose Symptom 0.7796 60281   runny nose 3.3286 1 60281 3.3286 0.3959
for 2 days Duration 0.5479 35390   for 2 days 2.3929 1 35390 2.3929 0.22

See the Models Hub for all avaiable Entity Resolution Models

Entity Resolution (for sentences)

Entity Resolution tutorial notebook

Classify each sentence extracted by a sentence detector into one of C resolvable classes. These classes usually are international disease , medicine , or procedure codes based on ICD standards.

data = ["""He has a starvation ketosis but nothing found for significant for dry oral mucosa"""]
 nlu.load('med_ner.jsl.wip.clinical resolve.icd10pcs').predict(data)
sentence_results sentence_resolution_results entities@clinical_results meta_entities@clinical_entity meta_entities@clinical_confidence
The patient is a 5-month-old infant who presented initially on Monday with a cold, cough, and runny nose for 2 days. DU12BBZ [‘5-month-old’, ‘infant’, ‘Monday’, ‘cold’, ‘cough’, ‘runny nose’, ‘for 2 days’, ‘Mom’, ‘she’, ‘fever’, ‘Her’, ‘she’, ‘spitting up a lot’] [‘Age’, ‘Age’, ‘RelativeDate’, ‘Symptom’, ‘Symptom’, ‘Symptom’, ‘Duration’, ‘Gender’, ‘Gender’, ‘VS_Finding’, ‘Gender’, ‘Gender’, ‘Symptom’] [‘0.9982’, ‘0.9999’, ‘0.9983’, ‘0.7517’, ‘0.9969’, ‘0.7796’, ‘0.5479’, ‘0.9427’, ‘0.9994’, ‘0.9975’, ‘0.9996’, ‘0.9985’, ‘0.30217502’]
Mom states she had no fever. F00ZNQZ [‘5-month-old’, ‘infant’, ‘Monday’, ‘cold’, ‘cough’, ‘runny nose’, ‘for 2 days’, ‘Mom’, ‘she’, ‘fever’, ‘Her’, ‘she’, ‘spitting up a lot’] [‘Age’, ‘Age’, ‘RelativeDate’, ‘Symptom’, ‘Symptom’, ‘Symptom’, ‘Duration’, ‘Gender’, ‘Gender’, ‘VS_Finding’, ‘Gender’, ‘Gender’, ‘Symptom’] [‘0.9982’, ‘0.9999’, ‘0.9983’, ‘0.7517’, ‘0.9969’, ‘0.7796’, ‘0.5479’, ‘0.9427’, ‘0.9994’, ‘0.9975’, ‘0.9996’, ‘0.9985’, ‘0.30217502’]
Her appetite was good but she was spitting up a lot. F08Z3YZ [‘5-month-old’, ‘infant’, ‘Monday’, ‘cold’, ‘cough’, ‘runny nose’, ‘for 2 days’, ‘Mom’, ‘she’, ‘fever’, ‘Her’, ‘she’, ‘spitting up a lot’] [‘Age’, ‘Age’, ‘RelativeDate’, ‘Symptom’, ‘Symptom’, ‘Symptom’, ‘Duration’, ‘Gender’, ‘Gender’, ‘VS_Finding’, ‘Gender’, ‘Gender’, ‘Symptom’] [‘0.9982’, ‘0.9999’, ‘0.9983’, ‘0.7517’, ‘0.9969’, ‘0.7796’, ‘0.5479’, ‘0.9427’, ‘0.9994’, ‘0.9975’, ‘0.9996’, ‘0.9985’, ‘0.30217502’]

See the Models Hub for all avaiable Entity Resolution Models

Entity Resolution (for chunks)

Entity Resolution tutorial notebook

Classify each entitiy extracted by a Named Entity Recognizer into one out of C classes. These classes usually are international disease , medicine , or procedure codes based on ICD standards. This reduces dimensionality of your dataset, by merging the various for representations for semantically equal entities into a common representation. For example, a disease , medicine , or procedure the resolvers map them to common ICD codes. A simplified example would be

data ="""The patient is a 5-month-old infant who presented initially on Monday with a cold, cough, and runny nose for 2 days."""
df = nlu.load('med_ner.jsl.wip.clinical en.resolve_chunk.cpt_clinical').predict(data)
entities@clinical_results meta_entities@clinical_entity meta_entities@clinical_confidence chunk_resolution_results meta_chunk_resolution_target_text meta_chunk_resolution_distance meta_chunk_resolution_confidence meta_chunk_resolution_all_k_results meta_chunk_resolution_all_k_distances meta_chunk_resolution_all_k_cosine_distances
5-month-old Age 0.9982 49496 5-month-old 15.0536 1 49496 15.0536 0.5153
infant Age 0.9999 49492 infant 6.7093 1 49492 6.7093 0.3702
Monday RelativeDate 0.9983 59857 Monday 12.6501 1 59857 12.6501 0.5324
cold Symptom 0.7517 50547 cold 2.6313 1 50547 2.6313 0.4492
cough Symptom 0.9969 32215 cough 3.5559 1 32215 3.5559 0.4847
runny nose Symptom 0.7796 60281 runny nose 3.3286 1 60281 3.3286 0.3959
for 2 days Duration 0.5479 35390 for 2 days 2.3929 1 35390 2.3929 0.22

See the Models Hub for all avaiable Entity Resolution Models

Relation Extraction

Relation Extraction tutorial notebook

Classify for pairs of entities what kind of relation exists between them.
It classifies for every named entity , which type of relationship exists to the other entities.
More precisely, internally the relation extractor classifies every pair of entities into one out of C potential relation classes.
There could be no relation between a pair of entities or there could a relation, which is specified by ` the predicted relation label` .

You can specify predict(data,output_level='relation to have one row per classified relation in your resulting dataframe.
Depending on what models are loaded in your pipe, NLU infers output_level=relation automatically and configures to that, unless specified otherwise.
See the Models Hub for all avaiable Relation Extractor Models

data = 'MRI demonstrated infarction in the upper brain stem , left cerebellum and  right basil ganglia'
df = nlu.load('en.med_ner.jsl.wip.clinical.greedy en.relation').predict(data)
document_results relation_results meta_relation_entity1 meta_relation_entity2 meta_relation_chunk1 meta_relation_chunk2 meta_relation_confidence entities@greedy_results meta_entities@greedy_entity meta_entities@greedy_confidence
MRI demonstrated infarction in the upper brain stem , left cerebellum and right basil ganglia” 0 Test Disease_Syndrome_Disorder MRI infarction 0.900999 [‘MRI’, ‘infarction’, ‘upper’, ‘brain stem’, ‘left’, ‘cerebellum’, ‘right’, ‘basil ganglia’] [‘Test’, ‘Disease_Syndrome_Disorder’, ‘Direction’, ‘Internal_organ_or_component’, ‘Direction’, ‘Internal_organ_or_component’, ‘Direction’, ‘Internal_organ_or_component’] [‘0.9979’, ‘0.5062’, ‘0.2152’, ‘0.2636’, ‘0.4775’, ‘0.8135’, ‘0.5086’, ‘0.3236’]
MRI demonstrated infarction in the upper brain stem , left cerebellum and right basil ganglia” 0 Test Direction MRI upper 0.947945 [‘MRI’, ‘infarction’, ‘upper’, ‘brain stem’, ‘left’, ‘cerebellum’, ‘right’, ‘basil ganglia’] [‘Test’, ‘Disease_Syndrome_Disorder’, ‘Direction’, ‘Internal_organ_or_component’, ‘Direction’, ‘Internal_organ_or_component’, ‘Direction’, ‘Internal_organ_or_component’] [‘0.9979’, ‘0.5062’, ‘0.2152’, ‘0.2636’, ‘0.4775’, ‘0.8135’, ‘0.5086’, ‘0.3236’]
MRI demonstrated infarction in the upper brain stem , left cerebellum and right basil ganglia” 0 Test Internal_organ_or_component MRI brain stem 0.654686 [‘MRI’, ‘infarction’, ‘upper’, ‘brain stem’, ‘left’, ‘cerebellum’, ‘right’, ‘basil ganglia’] [‘Test’, ‘Disease_Syndrome_Disorder’, ‘Direction’, ‘Internal_organ_or_component’, ‘Direction’, ‘Internal_organ_or_component’, ‘Direction’, ‘Internal_organ_or_component’] [‘0.9979’, ‘0.5062’, ‘0.2152’, ‘0.2636’, ‘0.4775’, ‘0.8135’, ‘0.5086’, ‘0.3236’]
MRI demonstrated infarction in the upper brain stem , left cerebellum and right basil ganglia” 0 Test Direction MRI left 0.944728 [‘MRI’, ‘infarction’, ‘upper’, ‘brain stem’, ‘left’, ‘cerebellum’, ‘right’, ‘basil ganglia’] [‘Test’, ‘Disease_Syndrome_Disorder’, ‘Direction’, ‘Internal_organ_or_component’, ‘Direction’, ‘Internal_organ_or_component’, ‘Direction’, ‘Internal_organ_or_component’] [‘0.9979’, ‘0.5062’, ‘0.2152’, ‘0.2636’, ‘0.4775’, ‘0.8135’, ‘0.5086’, ‘0.3236’]
MRI demonstrated infarction in the upper brain stem , left cerebellum and right basil ganglia” 0 Test Internal_organ_or_component MRI cerebellum 0.683124 [‘MRI’, ‘infarction’, ‘upper’, ‘brain stem’, ‘left’, ‘cerebellum’, ‘right’, ‘basil ganglia’] [‘Test’, ‘Disease_Syndrome_Disorder’, ‘Direction’, ‘Internal_organ_or_component’, ‘Direction’, ‘Internal_organ_or_component’, ‘Direction’, ‘Internal_organ_or_component’] [‘0.9979’, ‘0.5062’, ‘0.2152’, ‘0.2636’, ‘0.4775’, ‘0.8135’, ‘0.5086’, ‘0.3236’]
MRI demonstrated infarction in the upper brain stem , left cerebellum and right basil ganglia” 0 Test Direction MRI right 0.96001 [‘MRI’, ‘infarction’, ‘upper’, ‘brain stem’, ‘left’, ‘cerebellum’, ‘right’, ‘basil ganglia’] [‘Test’, ‘Disease_Syndrome_Disorder’, ‘Direction’, ‘Internal_organ_or_component’, ‘Direction’, ‘Internal_organ_or_component’, ‘Direction’, ‘Internal_organ_or_component’] [‘0.9979’, ‘0.5062’, ‘0.2152’, ‘0.2636’, ‘0.4775’, ‘0.8135’, ‘0.5086’, ‘0.3236’]
MRI demonstrated infarction in the upper brain stem , left cerebellum and right basil ganglia” 0 Test Internal_organ_or_component MRI basil ganglia 0.958023 [‘MRI’, ‘infarction’, ‘upper’, ‘brain stem’, ‘left’, ‘cerebellum’, ‘right’, ‘basil ganglia’] [‘Test’, ‘Disease_Syndrome_Disorder’, ‘Direction’, ‘Internal_organ_or_component’, ‘Direction’, ‘Internal_organ_or_component’, ‘Direction’, ‘Internal_organ_or_component’] [‘0.9979’, ‘0.5062’, ‘0.2152’, ‘0.2636’, ‘0.4775’, ‘0.8135’, ‘0.5086’, ‘0.3236’]
MRI demonstrated infarction in the upper brain stem , left cerebellum and right basil ganglia” 0 Disease_Syndrome_Disorder Direction infarction upper 0.986427 [‘MRI’, ‘infarction’, ‘upper’, ‘brain stem’, ‘left’, ‘cerebellum’, ‘right’, ‘basil ganglia’] [‘Test’, ‘Disease_Syndrome_Disorder’, ‘Direction’, ‘Internal_organ_or_component’, ‘Direction’, ‘Internal_organ_or_component’, ‘Direction’, ‘Internal_organ_or_component’] [‘0.9979’, ‘0.5062’, ‘0.2152’, ‘0.2636’, ‘0.4775’, ‘0.8135’, ‘0.5086’, ‘0.3236’]
MRI demonstrated infarction in the upper brain stem , left cerebellum and right basil ganglia” 0 Disease_Syndrome_Disorder Internal_organ_or_component infarction brain stem 0.872217 [‘MRI’, ‘infarction’, ‘upper’, ‘brain stem’, ‘left’, ‘cerebellum’, ‘right’, ‘basil ganglia’] [‘Test’, ‘Disease_Syndrome_Disorder’, ‘Direction’, ‘Internal_organ_or_component’, ‘Direction’, ‘Internal_organ_or_component’, ‘Direction’, ‘Internal_organ_or_component’] [‘0.9979’, ‘0.5062’, ‘0.2152’, ‘0.2636’, ‘0.4775’, ‘0.8135’, ‘0.5086’, ‘0.3236’]
MRI demonstrated infarction in the upper brain stem , left cerebellum and right basil ganglia” 0 Disease_Syndrome_Disorder Direction infarction left 0.983788 [‘MRI’, ‘infarction’, ‘upper’, ‘brain stem’, ‘left’, ‘cerebellum’, ‘right’, ‘basil ganglia’] [‘Test’, ‘Disease_Syndrome_Disorder’, ‘Direction’, ‘Internal_organ_or_component’, ‘Direction’, ‘Internal_organ_or_component’, ‘Direction’, ‘Internal_organ_or_component’] [‘0.9979’, ‘0.5062’, ‘0.2152’, ‘0.2636’, ‘0.4775’, ‘0.8135’, ‘0.5086’, ‘0.3236’]
MRI demonstrated infarction in the upper brain stem , left cerebellum and right basil ganglia” 0 Disease_Syndrome_Disorder Internal_organ_or_component infarction cerebellum 0.974557 [‘MRI’, ‘infarction’, ‘upper’, ‘brain stem’, ‘left’, ‘cerebellum’, ‘right’, ‘basil ganglia’] [‘Test’, ‘Disease_Syndrome_Disorder’, ‘Direction’, ‘Internal_organ_or_component’, ‘Direction’, ‘Internal_organ_or_component’, ‘Direction’, ‘Internal_organ_or_component’] [‘0.9979’, ‘0.5062’, ‘0.2152’, ‘0.2636’, ‘0.4775’, ‘0.8135’, ‘0.5086’, ‘0.3236’]
MRI demonstrated infarction in the upper brain stem , left cerebellum and right basil ganglia” 0 Disease_Syndrome_Disorder Direction infarction right 0.981092 [‘MRI’, ‘infarction’, ‘upper’, ‘brain stem’, ‘left’, ‘cerebellum’, ‘right’, ‘basil ganglia’] [‘Test’, ‘Disease_Syndrome_Disorder’, ‘Direction’, ‘Internal_organ_or_component’, ‘Direction’, ‘Internal_organ_or_component’, ‘Direction’, ‘Internal_organ_or_component’] [‘0.9979’, ‘0.5062’, ‘0.2152’, ‘0.2636’, ‘0.4775’, ‘0.8135’, ‘0.5086’, ‘0.3236’]
MRI demonstrated infarction in the upper brain stem , left cerebellum and right basil ganglia” 0 Disease_Syndrome_Disorder Internal_organ_or_component infarction basil ganglia 0.968148 [‘MRI’, ‘infarction’, ‘upper’, ‘brain stem’, ‘left’, ‘cerebellum’, ‘right’, ‘basil ganglia’] [‘Test’, ‘Disease_Syndrome_Disorder’, ‘Direction’, ‘Internal_organ_or_component’, ‘Direction’, ‘Internal_organ_or_component’, ‘Direction’, ‘Internal_organ_or_component’] [‘0.9979’, ‘0.5062’, ‘0.2152’, ‘0.2636’, ‘0.4775’, ‘0.8135’, ‘0.5086’, ‘0.3236’]
MRI demonstrated infarction in the upper brain stem , left cerebellum and right basil ganglia” 1 Direction Internal_organ_or_component upper brain stem 0.999582 [‘MRI’, ‘infarction’, ‘upper’, ‘brain stem’, ‘left’, ‘cerebellum’, ‘right’, ‘basil ganglia’] [‘Test’, ‘Disease_Syndrome_Disorder’, ‘Direction’, ‘Internal_organ_or_component’, ‘Direction’, ‘Internal_organ_or_component’, ‘Direction’, ‘Internal_organ_or_component’] [‘0.9979’, ‘0.5062’, ‘0.2152’, ‘0.2636’, ‘0.4775’, ‘0.8135’, ‘0.5086’, ‘0.3236’]
MRI demonstrated infarction in the upper brain stem , left cerebellum and right basil ganglia” 0 Direction Direction upper left 0.98803 [‘MRI’, ‘infarction’, ‘upper’, ‘brain stem’, ‘left’, ‘cerebellum’, ‘right’, ‘basil ganglia’] [‘Test’, ‘Disease_Syndrome_Disorder’, ‘Direction’, ‘Internal_organ_or_component’, ‘Direction’, ‘Internal_organ_or_component’, ‘Direction’, ‘Internal_organ_or_component’] [‘0.9979’, ‘0.5062’, ‘0.2152’, ‘0.2636’, ‘0.4775’, ‘0.8135’, ‘0.5086’, ‘0.3236’]
MRI demonstrated infarction in the upper brain stem , left cerebellum and right basil ganglia” 0 Direction Internal_organ_or_component upper cerebellum 0.990115 [‘MRI’, ‘infarction’, ‘upper’, ‘brain stem’, ‘left’, ‘cerebellum’, ‘right’, ‘basil ganglia’] [‘Test’, ‘Disease_Syndrome_Disorder’, ‘Direction’, ‘Internal_organ_or_component’, ‘Direction’, ‘Internal_organ_or_component’, ‘Direction’, ‘Internal_organ_or_component’] [‘0.9979’, ‘0.5062’, ‘0.2152’, ‘0.2636’, ‘0.4775’, ‘0.8135’, ‘0.5086’, ‘0.3236’]
MRI demonstrated infarction in the upper brain stem , left cerebellum and right basil ganglia” 0 Direction Direction upper right 0.989708 [‘MRI’, ‘infarction’, ‘upper’, ‘brain stem’, ‘left’, ‘cerebellum’, ‘right’, ‘basil ganglia’] [‘Test’, ‘Disease_Syndrome_Disorder’, ‘Direction’, ‘Internal_organ_or_component’, ‘Direction’, ‘Internal_organ_or_component’, ‘Direction’, ‘Internal_organ_or_component’] [‘0.9979’, ‘0.5062’, ‘0.2152’, ‘0.2636’, ‘0.4775’, ‘0.8135’, ‘0.5086’, ‘0.3236’]
MRI demonstrated infarction in the upper brain stem , left cerebellum and right basil ganglia” 0 Direction Internal_organ_or_component upper basil ganglia 0.971543 [‘MRI’, ‘infarction’, ‘upper’, ‘brain stem’, ‘left’, ‘cerebellum’, ‘right’, ‘basil ganglia’] [‘Test’, ‘Disease_Syndrome_Disorder’, ‘Direction’, ‘Internal_organ_or_component’, ‘Direction’, ‘Internal_organ_or_component’, ‘Direction’, ‘Internal_organ_or_component’] [‘0.9979’, ‘0.5062’, ‘0.2152’, ‘0.2636’, ‘0.4775’, ‘0.8135’, ‘0.5086’, ‘0.3236’]
MRI demonstrated infarction in the upper brain stem , left cerebellum and right basil ganglia” 0 Internal_organ_or_component Direction brain stem left 0.768312 [‘MRI’, ‘infarction’, ‘upper’, ‘brain stem’, ‘left’, ‘cerebellum’, ‘right’, ‘basil ganglia’] [‘Test’, ‘Disease_Syndrome_Disorder’, ‘Direction’, ‘Internal_organ_or_component’, ‘Direction’, ‘Internal_organ_or_component’, ‘Direction’, ‘Internal_organ_or_component’] [‘0.9979’, ‘0.5062’, ‘0.2152’, ‘0.2636’, ‘0.4775’, ‘0.8135’, ‘0.5086’, ‘0.3236’]
MRI demonstrated infarction in the upper brain stem , left cerebellum and right basil ganglia” 1 Internal_organ_or_component Internal_organ_or_component brain stem cerebellum 0.504254 [‘MRI’, ‘infarction’, ‘upper’, ‘brain stem’, ‘left’, ‘cerebellum’, ‘right’, ‘basil ganglia’] [‘Test’, ‘Disease_Syndrome_Disorder’, ‘Direction’, ‘Internal_organ_or_component’, ‘Direction’, ‘Internal_organ_or_component’, ‘Direction’, ‘Internal_organ_or_component’] [‘0.9979’, ‘0.5062’, ‘0.2152’, ‘0.2636’, ‘0.4775’, ‘0.8135’, ‘0.5086’, ‘0.3236’]
MRI demonstrated infarction in the upper brain stem , left cerebellum and right basil ganglia” 0 Internal_organ_or_component Direction brain stem right 0.939806 [‘MRI’, ‘infarction’, ‘upper’, ‘brain stem’, ‘left’, ‘cerebellum’, ‘right’, ‘basil ganglia’] [‘Test’, ‘Disease_Syndrome_Disorder’, ‘Direction’, ‘Internal_organ_or_component’, ‘Direction’, ‘Internal_organ_or_component’, ‘Direction’, ‘Internal_organ_or_component’] [‘0.9979’, ‘0.5062’, ‘0.2152’, ‘0.2636’, ‘0.4775’, ‘0.8135’, ‘0.5086’, ‘0.3236’]
MRI demonstrated infarction in the upper brain stem , left cerebellum and right basil ganglia” 0 Internal_organ_or_component Internal_organ_or_component brain stem basil ganglia 0.944104 [‘MRI’, ‘infarction’, ‘upper’, ‘brain stem’, ‘left’, ‘cerebellum’, ‘right’, ‘basil ganglia’] [‘Test’, ‘Disease_Syndrome_Disorder’, ‘Direction’, ‘Internal_organ_or_component’, ‘Direction’, ‘Internal_organ_or_component’, ‘Direction’, ‘Internal_organ_or_component’] [‘0.9979’, ‘0.5062’, ‘0.2152’, ‘0.2636’, ‘0.4775’, ‘0.8135’, ‘0.5086’, ‘0.3236’]
MRI demonstrated infarction in the upper brain stem , left cerebellum and right basil ganglia” 1 Direction Internal_organ_or_component left cerebellum 0.999842 [‘MRI’, ‘infarction’, ‘upper’, ‘brain stem’, ‘left’, ‘cerebellum’, ‘right’, ‘basil ganglia’] [‘Test’, ‘Disease_Syndrome_Disorder’, ‘Direction’, ‘Internal_organ_or_component’, ‘Direction’, ‘Internal_organ_or_component’, ‘Direction’, ‘Internal_organ_or_component’] [‘0.9979’, ‘0.5062’, ‘0.2152’, ‘0.2636’, ‘0.4775’, ‘0.8135’, ‘0.5086’, ‘0.3236’]
MRI demonstrated infarction in the upper brain stem , left cerebellum and right basil ganglia” 0 Direction Direction left right 0.99164 [‘MRI’, ‘infarction’, ‘upper’, ‘brain stem’, ‘left’, ‘cerebellum’, ‘right’, ‘basil ganglia’] [‘Test’, ‘Disease_Syndrome_Disorder’, ‘Direction’, ‘Internal_organ_or_component’, ‘Direction’, ‘Internal_organ_or_component’, ‘Direction’, ‘Internal_organ_or_component’] [‘0.9979’, ‘0.5062’, ‘0.2152’, ‘0.2636’, ‘0.4775’, ‘0.8135’, ‘0.5086’, ‘0.3236’]
MRI demonstrated infarction in the upper brain stem , left cerebellum and right basil ganglia” 0 Direction Internal_organ_or_component left basil ganglia 0.985331 [‘MRI’, ‘infarction’, ‘upper’, ‘brain stem’, ‘left’, ‘cerebellum’, ‘right’, ‘basil ganglia’] [‘Test’, ‘Disease_Syndrome_Disorder’, ‘Direction’, ‘Internal_organ_or_component’, ‘Direction’, ‘Internal_organ_or_component’, ‘Direction’, ‘Internal_organ_or_component’] [‘0.9979’, ‘0.5062’, ‘0.2152’, ‘0.2636’, ‘0.4775’, ‘0.8135’, ‘0.5086’, ‘0.3236’]
MRI demonstrated infarction in the upper brain stem , left cerebellum and right basil ganglia” 0 Internal_organ_or_component Direction cerebellum right 0.986705 [‘MRI’, ‘infarction’, ‘upper’, ‘brain stem’, ‘left’, ‘cerebellum’, ‘right’, ‘basil ganglia’] [‘Test’, ‘Disease_Syndrome_Disorder’, ‘Direction’, ‘Internal_organ_or_component’, ‘Direction’, ‘Internal_organ_or_component’, ‘Direction’, ‘Internal_organ_or_component’] [‘0.9979’, ‘0.5062’, ‘0.2152’, ‘0.2636’, ‘0.4775’, ‘0.8135’, ‘0.5086’, ‘0.3236’]
MRI demonstrated infarction in the upper brain stem , left cerebellum and right basil ganglia” 0 Internal_organ_or_component Internal_organ_or_component cerebellum basil ganglia 0.975779 [‘MRI’, ‘infarction’, ‘upper’, ‘brain stem’, ‘left’, ‘cerebellum’, ‘right’, ‘basil ganglia’] [‘Test’, ‘Disease_Syndrome_Disorder’, ‘Direction’, ‘Internal_organ_or_component’, ‘Direction’, ‘Internal_organ_or_component’, ‘Direction’, ‘Internal_organ_or_component’] [‘0.9979’, ‘0.5062’, ‘0.2152’, ‘0.2636’, ‘0.4775’, ‘0.8135’, ‘0.5086’, ‘0.3236’]
MRI demonstrated infarction in the upper brain stem , left cerebellum and right basil ganglia” 1 Direction Internal_organ_or_component right basil ganglia 0.999613 [‘MRI’, ‘infarction’, ‘upper’, ‘brain stem’, ‘left’, ‘cerebellum’, ‘right’, ‘basil ganglia’] [‘Test’, ‘Disease_Syndrome_Disorder’, ‘Direction’, ‘Internal_organ_or_component’, ‘Direction’, ‘Internal_organ_or_component’, ‘Direction’, ‘Internal_organ_or_component’] [‘0.9979’, ‘0.5062’, ‘0.2152’, ‘0.2636’, ‘0.4775’, ‘0.8135’, ‘0.5086’, ‘0.3236’]

Assertion

Assertion tutorial notebook

Assert for each entity the status into one out of C classes. These classes usually are : hypothetical, present, absent, possible, conditional, associated_with_someone_else.

data = "He has a starvation ketosis but nothing found for significant for dry oral mucosa"
assert_df = nlu.load('en.med_ner.clinical en.assert ').predict(data)

| entities@clinical_results | meta_entities@clinical_entity | meta_entities@clinical_confidence | assertion_results | meta_assertion_confidence | |:—————————-|:——————————–|————————————:|:——————–|—————————-:| | a starvation ketosis | PROBLEM | 0.932233 | present | 0.9938 | | dry oral mucosa | PROBLEM | 0.797567 | present | 0.9997 |

See the Models Hub for all avaiable Assertion Models

De-Identification

De-Identification tutorial notebook

Detect sensitive information in a string and replace the sensitive data with anonymized labels

data= 'DR Johnson administerd to the patient Peter Parker last week 30 MG of penicilin on Friday 25. March 1999'
df = nlu.load('de_identify').predict(data)
deidentified_results entities@ner_results meta_entities@ner_entity
[‘DR administerd to the patient last week 30 MG of penicilin on Friday 25.', ' March '] Johnson PER
[‘DR administerd to the patient last week 30 MG of penicilin on Friday 25.', ' March '] Peter Parker PER

See the Models Hub for all avaiable De-Identification Models

Authorize access to licensed features and install healthcare dependencies

You need a set of credentials to access the licensed healthcare features.
You can grab one here

Automatically Authorize Google Colab via JSON file

By default, nlu checks /content/spark_nlp_for_healthcare.json on google colabe enviroments for a spark_nlp_for_healthcare.json file that you recieve via E-mail from us. If you upload the spark_nlp_for_healthcare.json file to the standard colab directory, nlu.load() will automatically find it and authorize your enviroment.

Authorize anywhere via providing via JSON file

You can specify the location of your spark_nlp_for_healthcare.json like this :

path = '/path/to/spark_nlp_for_healthcare.json'
nlu.auth(path).load('licensed_model').predict(data)

Authorize via providing String parameters

import nlu
SPARK_NLP_LICENSE           = 'YOUR_SECRETS'
AWS_ACCESS_KEY_ID           = 'YOUR_SECRETS'
AWS_SECRET_ACCESS_KEY       = 'YOUR_SECRETS'
JSL_SECRET                  = 'YOUR_SECRETS'

nlu.auth(SPARK_NLP_LICENSE,AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY,JSL_SECRET)


Last updated