diff --git a/docs/_posts/Cabir40/2023-05-04-bert_token_classifier_ner_jsl_en.md b/docs/_posts/Cabir40/2023-05-04-bert_token_classifier_ner_jsl_en.md index 2666f19e5b..793d13f278 100644 --- a/docs/_posts/Cabir40/2023-05-04-bert_token_classifier_ner_jsl_en.md +++ b/docs/_posts/Cabir40/2023-05-04-bert_token_classifier_ner_jsl_en.md @@ -10,6 +10,7 @@ language: en edition: Healthcare NLP 3.4.0 spark_version: 3.0 supported: true +recommended: true engine: tensorflow annotator: MedicalBertForTokenClassifier article_header: diff --git a/docs/_posts/Damla-Gurbaz/2023-05-01-bert_token_classifier_ner_jsl_en.md b/docs/_posts/Damla-Gurbaz/2023-05-01-bert_token_classifier_ner_jsl_en.md deleted file mode 100644 index 046701b4ef..0000000000 --- a/docs/_posts/Damla-Gurbaz/2023-05-01-bert_token_classifier_ner_jsl_en.md +++ /dev/null @@ -1,242 +0,0 @@ ---- -layout: model -title: Detect Clinical Entities (BertForTokenClassifier) -author: John Snow Labs -name: bert_token_classifier_ner_jsl -date: 2023-05-01 -tags: [berfortokenclassification, ner_jsl, ner, en, licensed, tensorflow] -task: Named Entity Recognition -language: en -edition: Healthcare NLP 4.3.2 -spark_version: 3.0 -supported: true -engine: tensorflow -annotator: MedicalBertForTokenClassifier -article_header: - type: cover -use_language_switcher: "Python-Scala-Java" ---- - -## Description - -Pretrained named entity recognition deep learning model for clinical terminology. This model is trained with BertForTokenClassification method from transformers library and imported into Spark NLP. - -Definitions of Predicted Entities: - -- `Injury_or_Poisoning`: Physical harm or injury caused to the body, including those caused by accidents, falls, or poisoning of a patient or someone else. -- `Direction`: All the information relating to the laterality of the internal and external organs. -- `Test`: Mentions of laboratory, pathology, and radiological tests. -- `Admission_Discharge`: Terms that indicate the admission and/or the discharge of a patient. -- `Death_Entity`: Mentions that indicate the death of a patient. -- `Relationship_Status`: State of patients romantic or social relationships (e.g. single, married, divorced). -- `Duration`: The duration of a medical treatment or medication use. -- `Respiration`: Number of breaths per minute. -- `Hyperlipidemia`: Terms that indicate hyperlipidemia with relevant subtypes and synonims. -- `Birth_Entity`: Mentions that indicate giving birth. -- `Age`: All mention of ages, past or present, related to the patient or with anybody else. -- `Labour_Delivery`: Extractions include stages of labor and delivery. -- `Family_History_Header`: identifies section headers that correspond to Family History of the patient. -- `BMI`: Numeric values and other text information related to Body Mass Index. -- `Temperature`: All mentions that refer to body temperature. -- `Alcohol`: Terms that indicate alcohol use, abuse or drinking issues of a patient or someone else. -- `Kidney_Disease`: Terms that refer to any kidney diseases (includes mentions of modifiers such as "Acute" or "Chronic"). -- `Oncological`: All the cancer, tumor or metastasis related extractions mentioned in the document, of the patient or someone else. -- `Medical_History_Header`: Identifies section headers that correspond to Past Medical History of a patient. -- `Cerebrovascular_Disease`: All terms that refer to cerebrovascular diseases and events. -- `Oxygen_Therapy`: Breathing support triggered by patient or entirely or partially by machine (e.g. ventilator, BPAP, CPAP). -- `O2_Saturation`: Systemic arterial, venous or peripheral oxygen saturation measurements. -- `Psychological_Condition`: All the Mental health diagnosis, disorders, conditions or syndromes of a patient or someone else. -- `Heart_Disease`: All mentions of acquired, congenital or degenerative heart diseases. -- `Employment`: All mentions of patient or provider occupational titles and employment status . -- `Obesity`: Terms related to a patient being obese (overweight and BMI are extracted as different labels). -- `Disease_Syndrome_Disorder`: All the diseases mentioned in the document, of the patient or someone else (excluding diseases that are extracted with their specific labels, such as "Heart_Disease" etc.). -- `Pregnancy`: All terms related to Pregnancy (excluding terms that are extracted with their specific labels, such as "Labour_Delivery" etc.). -- `ImagingFindings`: All mentions of radiographic and imagistic findings. -- `Procedure`: All mentions of invasive medical or surgical procedures or treatments. -- `Medical_Device`: All mentions related to medical devices and supplies. -- `Race_Ethnicity`: All terms that refer to racial and national origin of sociocultural groups. -- `Section_Header`: All the section headers present in the text (Medical History, Family History, Social History, Physical Examination and Vital signs Headers are extracted separately with their specific labels). -- `Symptom`: All the symptoms mentioned in the document, of a patient or someone else. -- `Treatment`: Includes therapeutic and minimally invasive treatment and procedures (invasive treatments or procedures are extracted as "Procedure"). -- `Substance`: All mentions of substance use related to the patient or someone else (recreational drugs, illicit drugs). -- `Route`: Drug and medication administration routes available described by [FDA](http://wayback.archive-it.org/7993/20171115111313/https:/www.fda.gov/Drugs/DevelopmentApprovalProcess/FormsSubmissionRequirements/ElectronicSubmissions/DataStandardsManualmonographs/ucm071667.htm). -- `Drug_Ingredient`: Active ingredient/s found in drug products. -- `Blood_Pressure`: Systemic blood pressure, mean arterial pressure, systolic and/or diastolic are extracted. -- `Diet`: All mentions and information regarding patients dietary habits. -- `External_body_part_or_region`: All mentions related to external body parts or organs that can be examined by naked eye. -- `LDL`: All mentions related to the lab test and results for LDL (Low Density Lipoprotein). -- `VS_Finding`: Qualitative data (e.g. Fever, Cyanosis, Tachycardia) and any other symptoms that refers to vital signs. -- `Allergen`: Allergen related extractions mentioned in the document. -- `EKG_Findings`: All mentions of EKG readings. -- `Imaging_Technique`: All mentions of special radiographic views or special imaging techniques used in radiology. -- `Triglycerides`: All mentions terms related to specific lab test for Triglycerides. -- `RelativeTime`: Time references that are relative to different times or events (e.g. words such as "approximately", "in the morning"). -- `Gender`: Gender-specific nouns and pronouns. -- `Pulse`: Peripheral heart rate, without advanced information like measurement location. -- `Social_History_Header`: Identifies section headers that correspond to Social History of a patient. -- `Substance_Quantity`: All mentions of substance quantity (quantitative information related to illicit/recreational drugs). -- `Diabetes`: All terms related to diabetes mellitus. -- `Modifier`: Terms that modify the symptoms, diseases or risk factors. If a modifier is included in ICD-10 name of a specific disease, the respective modifier is not extracted separately. -- `Internal_organ_or_component`: All mentions related to internal body parts or organs that can not be examined by naked eye. -- `Clinical_Dept`: Terms that indicate the medical and/or surgical departments. -- `Form`: Drug and medication forms available described by [FDA](http://wayback.archive-it.org/7993/20171115111313/https:/www.fda.gov/Drugs/DevelopmentApprovalProcess/FormsSubmissionRequirements/ElectronicSubmissions/DataStandardsManualmonographs/ucm071667.htm). -- `Drug_BrandName`: Commercial labeling name chosen by the labeler or the drug manufacturer for a drug containing a single or multiple drug active ingredients. -- `Strength`: Potency of one unit of drug (or a combination of drugs) the measurement units available are described by [FDA](http://wayback.archive-it.org/7993/20171115111313/https:/www.fda.gov/Drugs/DevelopmentApprovalProcess/FormsSubmissionRequirements/ElectronicSubmissions/DataStandardsManualmonographs/ucm071667.htm). -- `Fetus_NewBorn`: All terms related to fetus, infant, new born (excluding terms that are extracted with their specific labels, such as "Labour_Delivery", "Pregnancy" etc.). -- `RelativeDate`: Temporal references that are relative to the date of the text or to any other specific date (e.g. "approximately two years ago", "about two days ago"). -- `Height`: All mentions related to a patients height. -- `Test_Result`: Terms related to all the test results present in the document (clinical tests results are included). -- `Sexually_Active_or_Sexual_Orientation`: All terms that are related to sexuality, sexual orientations and sexual activity. -- `Frequency`: Frequency of administration for a dose prescribed. -- `Time`: Specific time references (hour and/or minutes). -- `Weight`: All mentions related to a patients weight. -- `Vaccine`: Generic and brand name of vaccines or vaccination procedure. -- `Vital_Signs_Header`: Identifies section headers that correspond to Vital Signs of a patient. -- `Communicable_Disease`: Includes all mentions of communicable diseases. -- `Dosage`: Quantity prescribed by the physician for an active ingredient; measurement units are available described by [FDA](http://wayback.archive-it.org/7993/20171115111313/https:/www.fda.gov/Drugs/DevelopmentApprovalProcess/FormsSubmissionRequirements/ElectronicSubmissions/DataStandardsManualmonographs/ucm071667.htm). -- `Overweight`: Terms related to the patient being overweight (BMI and Obesity is extracted separately). -- `Hypertension`: All terms related to Hypertension (quantitative data such as 150/100 is extracted as Blood_Pressure). -- `HDL`: Terms related to the lab test for HDL (High Density Lipoprotein). -- `Total_Cholesterol`: Terms related to the lab test and results for cholesterol. -- `Smoking`: All mentions of smoking status of a patient. -- `Date`: Mentions of an exact date, in any format, including day number, month and/or year. - -## Predicted Entities - -`Injury_or_Poisoning`, `Direction`, `Test`, `Admission_Discharge`, `Death_Entity`, `Relationship_Status`, `Duration`, `Respiration`, `Hyperlipidemia`, `Birth_Entity`, `Age`, `Labour_Delivery`, `Family_History_Header`, `BMI`, `Temperature`, `Alcohol`, `Kidney_Disease`, `Oncological`, `Medical_History_Header`, `Cerebrovascular_Disease`, `Oxygen_Therapy`, `O2_Saturation`, `Psychological_Condition`, `Heart_Disease`, `Employment`, `Obesity`, `Disease_Syndrome_Disorder`, `Pregnancy`, `ImagingFindings`, `Procedure`, `Medical_Device`, `Race_Ethnicity`, `Section_Header`, `Symptom`, `Treatment`, `Substance`, `Route`, `Drug_Ingredient`, `Blood_Pressure`, `Diet`, `External_body_part_or_region`, `LDL`, `VS_Finding`, `Allergen`, `EKG_Findings`, `Imaging_Technique`, `Triglycerides`, `RelativeTime`, `Gender`, `Pulse`, `Social_History_Header`, `Substance_Quantity`, `Diabetes`, `Modifier`, `Internal_organ_or_component`, `Clinical_Dept`, `Form`, `Drug_BrandName`, `Strength`, `Fetus_NewBorn`, `RelativeDate`, `Height`, `Test_Result`, `Sexually_Active_or_Sexual_Orientation`, `Frequency`, `Time`, `Weight`, `Vaccine`, `Vaccine_Name`, `Vital_Signs_Header`, `Communicable_Disease`, `Dosage`, `Overweight`, `Hypertension`, `HDL`, `Total_Cholesterol`, `Smoking`, `Date` - -{:.btn-box} -[Live Demo](https://demo.johnsnowlabs.com/healthcare/NER_JSL/){:.button.button-orange} -[Open in Colab](https://colab.research.google.com/github/JohnSnowLabs/spark-nlp-workshop/blob/master/tutorials/Certification_Trainings/Healthcare/1.Clinical_Named_Entity_Recognition_Model.ipynb){:.button.button-orange.button-orange-trans.co.button-icon} -[Download](https://s3.amazonaws.com/auxdata.johnsnowlabs.com/clinical/models/bert_token_classifier_ner_jsl_en_4.3.2_3.0_1682934532927.zip){:.button.button-orange} -[Copy S3 URI](s3://auxdata.johnsnowlabs.com/clinical/models/bert_token_classifier_ner_jsl_en_4.3.2_3.0_1682934532927.zip){:.button.button-orange.button-orange-trans.button-icon.button-copy-s3} - -## How to use - - - -
-{% include programmingLanguageSelectScalaPythonNLU.html %} -```python -documentAssembler = DocumentAssembler()\ - .setInputCol("text")\ - .setOutputCol("document") - -sentenceDetector = SentenceDetectorDLModel.pretrained("sentence_detector_dl_healthcare","en","clinical/models")\ - .setInputCols(["document"])\ - .setOutputCol("sentence") - -tokenizer = Tokenizer()\ - .setInputCols("sentence")\ - .setOutputCol("token") - -tokenClassifier = MedicalBertForTokenClassifier.pretrained("bert_token_classifier_ner_jsl", "en", "clinical/models")\ - .setInputCols(["token", "sentence"])\ - .setOutputCol("ner")\ - .setCaseSensitive(True) - -ner_converter = NerConverter()\ - .setInputCols(["sentence","token","ner"])\ - .setOutputCol("ner_chunk") - -pipeline = Pipeline(stages=[ - documentAssembler, - sentenceDetector, - tokenizer, - tokenClassifier, - ner_converter]) - - -sample_text = """The patient is a 21-day-old Caucasian male here for 2 days of congestion - mom has been suctioning yellow discharge from the patient's nares, plus she has noticed some mild problems with his breathing while feeding (but negative for any perioral cyanosis or retractions). One day ago, mom also noticed a tactile temperature and gave the patient Tylenol. Baby-girl also has had some decreased p.o. intake. His normal breast-feeding is down from 20 minutes q.2h. to 5 to 10 minutes secondary to his respiratory congestion. He sleeps well, but has been more tired and has been fussy over the past 2 days. The parents noticed no improvement with albuterol treatments given in the ER. His urine output has also decreased; normally he has 8 to 10 wet and 5 dirty diapers per 24 hours, now he has down to 4 wet diapers per 24 hours. Mom denies any diarrhea. His bowel movements are yellow colored and soft in nature.""" - -df = spark.createDataFrame([[sample_text]]).toDF("text") - -result = pipeline.fit(df).transform(df) -``` -```scala -val documentAssembler = new DocumentAssembler() - .setInputCol("text") - .setOutputCol("document") - -val sentenceDetector = SentenceDetectorDLModel.pretrained("sentence_detector_dl_healthcare","en","clinical/models") - .setInputCols(Array("document")) - .setOutputCol("sentence") - -val tokenizer = new Tokenizer() - .setInputCols("sentence") - .setOutputCol("token") - -val tokenClassifier = MedicalBertForTokenClassifier.pretrained("bert_token_classifier_ner_jsl", "en", "clinical/models") - .setInputCols(Array("token", "sentence")) - .setOutputCol("ner") - .setCaseSensitive(True) - -val ner_converter = new NerConverter() - .setInputCols(Array("sentence","token","ner")) - .setOutputCol("ner_chunk") - -val pipeline = new Pipeline().setStages(Array( - documentAssembler, - sentenceDetector, - tokenizer, - tokenClassifier, - ner_converter)) - -val sample_text = Seq("""The patient is a 21-day-old Caucasian male here for 2 days of congestion - mom has been suctioning yellow discharge from the patient's nares, plus she has noticed some mild problems with his breathing while feeding (but negative for any perioral cyanosis or retractions). One day ago, mom also noticed a tactile temperature and gave the patient Tylenol. Baby-girl also has had some decreased p.o. intake. His normal breast-feeding is down from 20 minutes q.2h. to 5 to 10 minutes secondary to his respiratory congestion. He sleeps well, but has been more tired and has been fussy over the past 2 days. The parents noticed no improvement with albuterol treatments given in the ER. His urine output has also decreased; normally he has 8 to 10 wet and 5 dirty diapers per 24 hours, now he has down to 4 wet diapers per 24 hours. Mom denies any diarrhea. His bowel movements are yellow colored and soft in nature.""").toDS.toDF("text") - -val result = pipeline.fit(sample_text).transform(sample_text) -``` - - -{:.nlu-block} -```python -import nlu -nlu.load("en.classify.token_bert.ner_jsl").predict("""The patient is a 21-day-old Caucasian male here for 2 days of congestion - mom has been suctioning yellow discharge from the patient's nares, plus she has noticed some mild problems with his breathing while feeding (but negative for any perioral cyanosis or retractions). One day ago, mom also noticed a tactile temperature and gave the patient Tylenol. Baby-girl also has had some decreased p.o. intake. His normal breast-feeding is down from 20 minutes q.2h. to 5 to 10 minutes secondary to his respiratory congestion. He sleeps well, but has been more tired and has been fussy over the past 2 days. The parents noticed no improvement with albuterol treatments given in the ER. His urine output has also decreased; normally he has 8 to 10 wet and 5 dirty diapers per 24 hours, now he has down to 4 wet diapers per 24 hours. Mom denies any diarrhea. His bowel movements are yellow colored and soft in nature.""") -``` - -
- -## Results - -```bash -+-----------------------------------------+----------------------------+ -|chunk |ner_label | -+-----------------------------------------+----------------------------+ -|21-day-old |Age | -|Caucasian |Race_Ethnicity | -|male |Gender | -|2 days |Duration | -|congestion |Symptom | -|mom |Gender | -|yellow |Symptom | -|discharge |Symptom | -|nares |External_body_part_or_region| -|she |Gender | -|mild |Modifier | -|problems with his breathing while feeding|Symptom | -|perioral cyanosis |Symptom | -|retractions |Symptom | -|One day ago |RelativeDate | -|mom |Gender | -|tactile temperature |Symptom | -|Tylenol |Drug_BrandName | -|Baby-girl |Age | -|decreased |Symptom | -+-----------------------------------------+----------------------------+ -``` - -{:.model-param} -## Model Information - -{:.table-model} -|---|---| -|Model Name:|bert_token_classifier_ner_jsl| -|Compatibility:|Healthcare NLP 4.3.2+| -|License:|Licensed| -|Edition:|Official| -|Input Labels:|[document, token]| -|Output Labels:|[ner]| -|Language:|en| -|Size:|444.2 MB| -|Case sensitive:|true| -|Max sentence length:|128| \ No newline at end of file diff --git a/docs/_posts/HashamUlHaq/2021-02-06-sbiobertresolve_icd10cm_augmented_billable_hcc_en.md b/docs/_posts/HashamUlHaq/2021-02-06-sbiobertresolve_icd10cm_augmented_billable_hcc_en.md index b332a16fa2..7a4a027e22 100644 --- a/docs/_posts/HashamUlHaq/2021-02-06-sbiobertresolve_icd10cm_augmented_billable_hcc_en.md +++ b/docs/_posts/HashamUlHaq/2021-02-06-sbiobertresolve_icd10cm_augmented_billable_hcc_en.md @@ -21,7 +21,6 @@ use_language_switcher: "Python-Scala-Java" This model maps extracted medical entities to ICD10-CM codes using chunk embeddings (augmented with synonyms, four times richer than previous resolver). It also adds support of 7-digit codes with HCC status. -For reference: http://www.formativhealth.com/wp-content/uploads/2018/06/HCC-White-Paper.pdf ## Predicted Entities diff --git a/docs/_posts/HashamUlHaq/2021-05-16-sbiobertresolve_icd10cm_augmented_billable_hcc_en.md b/docs/_posts/HashamUlHaq/2021-05-16-sbiobertresolve_icd10cm_augmented_billable_hcc_en.md index c495a4c0c4..bf0a10aa1b 100644 --- a/docs/_posts/HashamUlHaq/2021-05-16-sbiobertresolve_icd10cm_augmented_billable_hcc_en.md +++ b/docs/_posts/HashamUlHaq/2021-05-16-sbiobertresolve_icd10cm_augmented_billable_hcc_en.md @@ -18,7 +18,7 @@ use_language_switcher: "Python-Scala-Java" ## Description -This model maps extracted medical entities to ICD10-CM codes using `sbiobert_base_cased_mli` Sentence Bert Embeddings, and has faster load time, with a speedup of about 6X when compared to previous versions. The load process now is more memory friendly meaning that the maximum memory required during load time is smaller, reducing the chances of OOM exceptions, and thus relaxing hardware requirements. It has been augmented with synonyms, four times richer than previous resolver. It also adds support of 7-digit codes with HCC status.For reference: http://www.formativhealth.com/wp-content/uploads/2018/06/HCC-White-Paper.pdf +This model maps extracted medical entities to ICD10-CM codes using `sbiobert_base_cased_mli` Sentence Bert Embeddings, and has faster load time, with a speedup of about 6X when compared to previous versions. The load process now is more memory friendly meaning that the maximum memory required during load time is smaller, reducing the chances of OOM exceptions, and thus relaxing hardware requirements. It has been augmented with synonyms, four times richer than previous resolver. It also adds support of 7-digit codes with HCC status. ## Predicted Entities diff --git a/docs/_posts/dcecchini/2023-05-29-summarizer_clinical_laymen_en.md b/docs/_posts/dcecchini/2023-05-29-summarizer_clinical_laymen_en.md deleted file mode 100644 index 3b73ab29c5..0000000000 --- a/docs/_posts/dcecchini/2023-05-29-summarizer_clinical_laymen_en.md +++ /dev/null @@ -1,82 +0,0 @@ ---- -layout: model -title: Summarize Clinical Notes in Layman Terms -author: John Snow Labs -name: summarizer_clinical_laymen -date: 2023-05-29 -tags: [licensed, en, clinical, summarization, tensorflow] -task: Summarization -language: en -edition: Healthcare NLP 4.4.2 -spark_version: 3.0 -supported: true -engine: tensorflow -annotator: MedicalSummarizer -article_header: - type: cover -use_language_switcher: "Python-Scala-Java" ---- - -## Description - -This model is a modified version of Flan-T5 (LLM) based summarization model that is finetuned with custom dataset by John Snow Labs to avoid using clinical jargon on the summaries. It can generate summaries up to 512 tokens given an input text (max 1024 tokens). - -## Predicted Entities - - - -{:.btn-box} - - -[Download](https://s3.amazonaws.com/auxdata.johnsnowlabs.com/clinical/models/summarizer_clinical_laymen_en_4.4.2_3.0_1685360017257.zip){:.button.button-orange.button-orange-trans.arr.button-icon.hidden} -[Copy S3 URI](s3://auxdata.johnsnowlabs.com/clinical/models/summarizer_clinical_laymen_en_4.4.2_3.0_1685360017257.zip){:.button.button-orange.button-orange-trans.button-icon.button-copy-s3} - -## How to use - - - -
-{% include programmingLanguageSelectScalaPythonNLU.html %} -```python - -document_assembler = DocumentAssembler()\ - .setInputCol("text")\ - .setOutputCol("document") - -summarizer = MedicalSummarizer.pretrained("summarizer_clinical_laymen", "en", "clinical/models")\ - .setInputCols(["document"])\ - .setOutputCol("summary")\ - .setMaxNewTokens(512) - -pipeline = sparknlp.base.Pipeline(stages=[ - document_assembler, - summarizer -]) - -text ="""Olivia Smith was seen in my office for evaluation for elective surgical weight loss on October 6, 2008. Olivia Smith is a 34-year-old female with a BMI of 43. She is 5'6" tall and weighs 267 pounds. She is motivated to attempt surgical weight loss because she has been overweight for over 20 years and wants to have more energy and improve her self-image. She is not only affected physically, but also socially by her weight. When she loses weight she always regains it and she always gains back more weight than she has lost. At one time, she lost 100 pounds and gained the weight back within a year. She has tried numerous commercial weight loss programs including Weight Watcher's for four months in 1992 with 15-pound weight loss, RS for two months in 1990 with six-pound weight loss, Slim Fast for six weeks in 2004 with eight-pound weight loss, an exercise program for two months in 2007 with a five-pound weight loss, Atkin's Diet for three months in 2008 with a ten-pound weight loss, and Dexatrim for one month in 2005 with a five-pound weight loss. She has also tried numerous fat reduction or fad diets. She was on Redux for nine months with a 100-pound weight loss.\n\nPAST MEDICAL HISTORY: She has a history of hypertension and shortness of breath.\n\nPAST SURGICAL HISTORY: Pertinent for cholecystectomy.\n\nPSYCHOLOGICAL HISTORY: Negative.\n\nSOCIAL HISTORY: She is single. She drinks alcohol once a week. She does not smoke.\n\nFAMILY HISTORY: Pertinent for obesity and hypertension.\n\nMEDICATIONS: Include Topamax 100 mg twice daily, Zoloft 100 mg twice daily, Abilify 5 mg daily, Motrin 800 mg daily, and a multivitamin.\n\nALLERGIES: She has no known drug allergies.\n\nREVIEW OF SYSTEMS: Negative.\n\nPHYSICAL EXAM: This is a pleasant female in no acute distress. Alert and oriented x 3. HEENT: Normocephalic, atraumatic. Extraocular muscles intact, nonicteric sclerae. Chest is clear to auscultation bilaterally. Cardiovascular is normal sinus rhythm. Abdomen is obese, soft, nontender and nondistended. Extremities show no edema, clubbing or cyanosis.\n\nASSESSMENT/PLAN: This is a 34-year-old female with a BMI of 43 who is interested in surgical weight via the gastric bypass as opposed to Lap-Band. Olivia Smith will be asking for a letter of medical necessity from Dr. Andrew Johnson. She will also see my nutritionist and social worker and have an upper endoscopy. Once this is completed, we will submit her to her insurance company for approval. -""" - -data = spark.createDataFrame([[text]]).toDF("text") - -result = pipeline.fit(data).transform(data) -``` - -
- -## Results - -```bash -['This is a clinical note about a 34-year-old woman who is interested in having weight loss surgery. She has been overweight for over 20 years and wants to have more energy and improve her self-image. She has tried many diets and weight loss programs, but has not been successful in keeping the weight off. She has a history of hypertension and shortness of breath, but is not allergic to any medications. She will have an upper endoscopy and will be contacted by a nutritionist and social worker. The plan is to have her weight loss surgery through the gastric bypass, rather than Lap-Band.'] -``` - -{:.model-param} -## Model Information - -{:.table-model} -|---|---| -|Model Name:|summarizer_clinical_laymen| -|Compatibility:|Healthcare NLP 4.4.2+| -|License:|Licensed| -|Edition:|Official| -|Language:|en| -|Size:|920.5 MB| diff --git a/docs/_posts/mellahysf/2023-05-29-ner_deid_subentity_ar.md b/docs/_posts/mellahysf/2023-05-29-ner_deid_subentity_ar.md deleted file mode 100644 index 8976ee5bc9..0000000000 --- a/docs/_posts/mellahysf/2023-05-29-ner_deid_subentity_ar.md +++ /dev/null @@ -1,188 +0,0 @@ ---- -layout: model -title: Detect Subentity PHI for Deidentification (Arabic) -author: John Snow Labs -name: ner_deid_subentity -date: 2023-05-29 -tags: [licensed, ner, clinical, deidentification, arabic, ar] -task: Named Entity Recognition -language: ar -edition: Healthcare NLP 4.4.2 -spark_version: 3.0 -supported: true -annotator: MedicalNerModel -article_header: - type: cover -use_language_switcher: "Python-Scala-Java" ---- - -## Description - -Named Entity Recognition annotators allow for a generic model to be trained by using a Deep Learning architecture (Char CNNs - BiLSTM - CRF - word embeddings) inspired on a former state of the art model for NER: Chiu & Nicols, Named Entity Recognition with Bidirectional LSTM,CNN. - -Deidentification NER (Arabic) is a Named Entity Recognition model that annotates text to find protected health information that may need to be de-identified. It detects 17 entities. This NER model is trained with a combination of custom datasets, and several data augmentation mechanisms. This model Word2Vec Arabic Clinical Embeddings. - -## Predicted Entities - -`PATIENT`, `HOSPITAL`, `DATE`, `ORGANIZATION`, `CITY`, `STREET`, `USERNAME`, `SEX`, `IDNUM`, `EMAIL`, `ZIP`, `MEDICALRECORD`, `PROFESSION`, `PHONE`, `COUNTRY`, `DOCTOR`, `AGE` - -{:.btn-box} - -[Open in Colab](https://colab.research.google.com/github/JohnSnowLabs/spark-nlp-workshop/blob/master/healthcare-nlp/04.1.Clinical_Multi_Language_Deidentification.ipynb){:.button.button-orange.button-orange-trans.co.button-icon} -[Download](https://s3.amazonaws.com/auxdata.johnsnowlabs.com/clinical/models/ner_deid_subentity_ar_4.4.2_3.0_1685387641635.zip){:.button.button-orange.button-orange-trans.arr.button-icon.hidden} -[Copy S3 URI](s3://auxdata.johnsnowlabs.com/clinical/models/ner_deid_subentity_ar_4.4.2_3.0_1685387641635.zip){:.button.button-orange.button-orange-trans.button-icon.button-copy-s3} - -## How to use - - - -
-{% include programmingLanguageSelectScalaPythonNLU.html %} - -```python -documentAssembler = DocumentAssembler()\ - .setInputCol("text")\ - .setOutputCol("document") - -sentenceDetector = SentenceDetectorDLModel.pretrained("sentence_detector_dl", "xx")\ - .setInputCols(["document"])\ - .setOutputCol("sentence") - -tokenizer = Tokenizer()\ - .setInputCols(["sentence"])\ - .setOutputCol("token") - -embeddings = WordEmbeddingsModel.pretrained("arabic_w2v_cc_300d", "ar")\ - .setInputCols(["document", "token"])\ - .setOutputCol("embeddings") - -clinical_ner = MedicalNerModel.pretrained("ner_deid_subentity", "ar", "clinical/models")\ - .setInputCols(["sentence","token","embeddings"])\ - .setOutputCol("ner") - -ner_converter = NerConverterInternal()\ - .setInputCols(["sentence","token","ner"])\ - .setOutputCol("ner_chunk") - -nlpPipeline = Pipeline(stages=[ - documentAssembler, - sentenceDetector, - tokenizer, - embeddings, - clinical_ner, - ner_converter]) - -text = ''' -عالج الدكتور محمد المريض أحمد البالغ من العمر 55 سنة في 15/05/2000 في مستشفى مدينة الرباط. رقم هاتفه هو 0610948235 وبريده الإلكتروني -mohamedmell@gmail.com. - ''' - -data = spark.createDataFrame([[text]]).toDF("text") - -results = nlpPipeline .fit(data).transform(data) - -``` - -```scala -val documentAssembler = new DocumentAssembler() -.setInputCol("text") -.setOutputCol("document") - -val sentenceDetector = SentenceDetectorDLModel.pretrained("sentence_detector_dl", "xx") -.setInputCols(Array("document")) -.setOutputCol("sentence") - -val tokenizer = new Tokenizer() -.setInputCols(Array("sentence")) -.setOutputCol("token") - -val embeddings = WordEmbeddingsModel.pretrained("arabic_w2v_cc_300d", "ar") -.setInputCols(Array("sentence","token")) -.setOutputCol("word_embeddings") - -val clinical_ner = MedicalNerModel.pretrained("ner_deid_subentity", "ar", "clinical/models") -.setInputCols(Array("sentence","token","word_embeddings")) -.setOutputCol("ner") - -val ner_converter = new NerConverterInternal() -.setInputCols(Array("sentence", "token", "ner")) -.setOutputCol("ner_chunk") - -val pipeline = new Pipeline().setStages(Array( - documentAssembler, - sentenceDetector, - tokenizer, - embeddings, - clinical_ner, - ner_converter)) - -text = ''' -عالج الدكتور محمد المريض أحمد البالغ من العمر 55 سنة في 15/05/2000 في مستشفى مدينة الرباط. رقم هاتفه هو 0610948235 وبريده الإلكتروني -mohamedmell@gmail.com. - ''' - -val data = Seq(text).toDS.toDF("text") - -val results = pipeline.fit(data).transform(data) -``` -
- -## Results - -```bash -+------------------------------------------------+----------------+ -|chunk |ner_label| -+------------------------------------------------+---------------+ -|محمد |DOCTOR | -|55 سنة |AGE | -|15/05/2000 |DATE | -|الرباط |CITY | -|0610948235 |PHONE | -|mohamedmell@gmail.com |EMAIL | -+------------------------------------------------+--------------+ -``` - -{:.model-param} -## Model Information - -{:.table-model} -|---|---| -|Model Name:|ner_deid_subentity| -|Compatibility:|Healthcare NLP 4.4.2+| -|License:|Licensed| -|Edition:|Official| -|Input Labels:|[sentence, token, embeddings]| -|Output Labels:|[ner]| -|Language:|ar| -|Size:|15.0 MB| - -## References - -Custom John Snow Labs datasets - -Data augmentation techniques - -## Benchmarking - -```bash - label tp fp fn total precision recall f1 - PATIENT 196.0 26.0 32.0 228.0 0.8829 0.8596 0.8711 - HOSPITAL 193.0 41.0 37.0 230.0 0.8248 0.8391 0.8319 - DATE 877.0 14.0 8.0 885.0 0.9843 0.991 0.9876 - ORGANIZATION 41.0 11.0 6.0 47.0 0.7885 0.8723 0.8283 - CITY 260.0 8.0 5.0 265.0 0.9701 0.9811 0.9756 - STREET 103.0 3.0 0.0 103.0 0.9717 1.0 0.9856 - USERNAME 8.0 0.0 0.0 8.0 1.0 1.0 1.0 - SEX 300.0 9.0 69.0 369.0 0.9709 0.813 0.885 - IDNUM 13.0 1.0 0.0 13.0 0.9286 1.0 0.963 - EMAIL 112.0 5.0 0.0 112.0 0.9573 1.0 0.9782 - ZIP 80.0 4.0 0.0 80.0 0.9524 1.0 0.9756 -MEDICALRECORD 17.0 1.0 0.0 17.0 0.9444 1.0 0.9714 - PROFESSION 303.0 27.0 32.0 335.0 0.9182 0.9045 0.9113 - PHONE 38.0 4.0 2.0 40.0 0.9048 0.95 0.9268 - COUNTRY 158.0 10.0 8.0 166.0 0.9405 0.9518 0.9461 - DOCTOR 440.0 23.0 34.0 474.0 0.9503 0.9283 0.9392 - AGE 610.0 18.0 7.0 617.0 0.9713 0.9887 0.9799 - macro - - - - - - 0.9386 - micro - - - - - - 0.9434 -``` diff --git a/docs/_posts/muhammetsnts/2021-11-01-sbiobertresolve_icd10cm_augmented_billable_hcc_en.md b/docs/_posts/muhammetsnts/2021-11-01-sbiobertresolve_icd10cm_augmented_billable_hcc_en.md index e07349f437..5d3074422f 100644 --- a/docs/_posts/muhammetsnts/2021-11-01-sbiobertresolve_icd10cm_augmented_billable_hcc_en.md +++ b/docs/_posts/muhammetsnts/2021-11-01-sbiobertresolve_icd10cm_augmented_billable_hcc_en.md @@ -19,7 +19,7 @@ use_language_switcher: "Python-Scala-Java" ## Description -This model maps extracted medical entities to ICD10-CM codes using `sbiobert_base_cased_mli` Sentence Bert Embeddings and it supports 7-digit codes with HCC status. It has been updated by dropping the invalid codes that exist in the previous versions. In the result, look for the `all_k_aux_labels` parameter in the metadata to get HCC status. The HCC status can be divided to get further information: `billable status`, `hcc status`, and `hcc score`. For reference: [please click here](http://www.formativhealth.com/wp-content/uploads/2018/06/HCC-White-Paper.pdf) . +This model maps extracted medical entities to ICD10-CM codes using `sbiobert_base_cased_mli` Sentence Bert Embeddings and it supports 7-digit codes with HCC status. It has been updated by dropping the invalid codes that exist in the previous versions. In the result, look for the `all_k_aux_labels` parameter in the metadata to get HCC status. The HCC status can be divided to get further information: `billable status`, `hcc status`, and `hcc score`. ## Predicted Entities