diff --git a/examples/colab/healthcare/medical_named_entity_recognition/NLU_explain_clinical_doc_generic_pipeline.ipynb b/examples/colab/healthcare/medical_named_entity_recognition/NLU_explain_clinical_doc_generic_pipeline.ipynb new file mode 100644 index 00000000..65b2262a --- /dev/null +++ b/examples/colab/healthcare/medical_named_entity_recognition/NLU_explain_clinical_doc_generic_pipeline.ipynb @@ -0,0 +1,814 @@ +{ + "nbformat": 4, + "nbformat_minor": 0, + "metadata": { + "colab": { + "provenance": [], + "machine_shape": "hm", + "gpuType": "T4" + }, + "kernelspec": { + "name": "python3", + "display_name": "Python 3" + }, + "language_info": { + "name": "python" + }, + "accelerator": "GPU" + }, + "cells": [ + { + "cell_type": "markdown", + "source": [ + "![JohnSnowLabs](https://nlp.johnsnowlabs.com/assets/images/logo.png)\n", + "\n", + "[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/JohnSnowLabs/nlu/blob/master/examples/colab/component_examples/named_entity_recognition_NER/NLU_explain_clinical_doc_generic_pipeline.ipynb)\n", + "\n", + "#Explain Clinical Document Generic\n", + "\n", + "This pipeline is designed to:\n", + "\n", + "- extract clinical/medical entities\n", + "- assign assertion status to the extracted entities\n", + "- establish relations between the extracted entities\n", + "\n", + "from clinical texts. In this pipeline, 4 NER models, one assertion model, and one relation extraction model were used to achieve those tasks." + ], + "metadata": { + "id": "jJ4POSNF8qzD" + } + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "0mxspMbm8fcE" + }, + "outputs": [], + "source": [ + "! pip install nlu pyspark==3.1.2" + ] + }, + { + "cell_type": "code", + "source": [ + "! pip install johnsnowlabs" + ], + "metadata": { + "id": "kEyCNAVO9PdX" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "import json, os\n", + "from google.colab import files\n", + "\n", + "if 'spark_jsl.json' not in os.listdir():\n", + " license_keys = files.upload()\n", + " os.rename(list(license_keys.keys())[0], 'spark_jsl.json')\n", + "\n", + "with open('spark_jsl.json') as f:\n", + " license_keys = json.load(f)\n", + "\n", + "# Defining license key-value pairs as local variables\n", + "locals().update(license_keys)\n", + "os.environ.update(license_keys)" + ], + "metadata": { + "id": "a1HT1V_N9THF" + }, + "execution_count": 1, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "# Installing pyspark and spark-nlp\n", + "! pip install --upgrade -q pyspark==3.1.2 spark-nlp==$PUBLIC_VERSION\n", + "\n", + "# Installing NLU\n", + "! pip install --upgrade --q nlu --no-dependencies\n", + "\n", + "# Installing Spark NLP Healthcare\n", + "! pip install --upgrade -q spark-nlp-jsl==$JSL_VERSION --extra-index-url https://pypi.johnsnowlabs.com/$SECRET\n", + "\n", + "# Installing Spark NLP Display Library for visualization\n", + "! pip install -q spark-nlp-display" + ], + "metadata": { + "id": "s1fprtHN9TFO" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "import json\n", + "import os\n", + "\n", + "import sparknlp\n", + "import sparknlp_jsl\n", + "import nlu\n", + "\n", + "from sparknlp.base import *\n", + "from sparknlp.annotator import *\n", + "from sparknlp_jsl.annotator import *\n", + "\n", + "from pyspark.sql import SparkSession\n", + "from pyspark.sql import functions as F\n", + "from pyspark.ml import Pipeline,PipelineModel\n", + "\n", + "import pandas as pd\n", + "pd.set_option('display.max_colwidth', 200)\n", + "\n", + "import warnings\n", + "warnings.filterwarnings('ignore')\n", + "\n", + "params = {\"spark.driver.memory\":\"16G\",\n", + " \"spark.kryoserializer.buffer.max\":\"2000M\",\n", + " \"spark.driver.maxResultSize\":\"2000M\"}\n", + "\n", + "print(\"Spark NLP Version :\", sparknlp.version())\n", + "print(\"Spark NLP_JSL Version :\", sparknlp_jsl.version())\n", + "\n", + "spark = sparknlp_jsl.start(license_keys['SECRET'],params=params)\n", + "\n", + "spark" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 257 + }, + "id": "drDXkUeq9TBZ", + "outputId": "61e33d7d-e789-4bee-c114-dcdb596aeb88" + }, + "execution_count": 2, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Spark NLP Version : 5.3.0\n", + "Spark NLP_JSL Version : 5.3.0\n" + ] + }, + { + "output_type": "execute_result", + "data": { + "text/plain": [ + "" + ], + "text/html": [ + "\n", + "
\n", + "

SparkSession - in-memory

\n", + " \n", + "
\n", + "

SparkContext

\n", + "\n", + "

Spark UI

\n", + "\n", + "
\n", + "
Version
\n", + "
v3.1.2
\n", + "
Master
\n", + "
local[*]
\n", + "
AppName
\n", + "
Spark NLP Licensed
\n", + "
\n", + "
\n", + " \n", + "
\n", + " " + ] + }, + "metadata": {}, + "execution_count": 2 + } + ] + }, + { + "cell_type": "code", + "source": [ + "model = nlu.load(\"en.explain_doc.clinical_generic.pipeline\")" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "qZ_4Fz559S_V", + "outputId": "e25c43dd-bdce-49ad-d5c1-4188f7e2e2f4" + }, + "execution_count": 3, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Warning::Spark Session already created, some configs may not take.\n", + "Warning::Spark Session already created, some configs may not take.\n", + "explain_clinical_doc_generic download started this may take some time.\n", + "Approx size to download 1.7 GB\n", + "[OK!]\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "text = [\"\"\"Patient with severe fever and sore throat.\n", + "He shows no stomach pain. He maintained on an epidural and PCA for pain control.\n", + "After CT, lung tumor located at the right lower lobe. Father with Alzheimer.\"\"\"]" + ], + "metadata": { + "id": "62fOREz--k3I" + }, + "execution_count": 4, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "df = model.predict(text)" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "xFyyGMFN9S9W", + "outputId": "ba48da6f-25e8-4fa4-9c25-6cacaebabab7" + }, + "execution_count": 5, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Warning::Spark Session already created, some configs may not take.\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "df" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 1000 + }, + "id": "KuCeqmwN9S66", + "outputId": "8ee8b116-5d3f-46a9-a307-ddfaf5ead09f" + }, + "execution_count": 6, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + " assertion \\\n", + "0 [Present, Present, Absent, Past, Past, Hypothetical, Past, Present, Family] \n", + "0 [Present, Present, Absent, Past, Past, Hypothetical, Past, Present, Family] \n", + "0 [Present, Present, Absent, Past, Past, Hypothetical, Past, Present, Family] \n", + "0 [Present, Present, Absent, Past, Past, Hypothetical, Past, Present, Family] \n", + "\n", + " document \\\n", + "0 Patient with severe fever and sore throat.\\nHe shows no stomach pain. He maintained on an epidural and PCA for pain control.\\nAfter CT, lung tumor located at the right lower lobe. Father with Alzh... \n", + "0 Patient with severe fever and sore throat.\\nHe shows no stomach pain. He maintained on an epidural and PCA for pain control.\\nAfter CT, lung tumor located at the right lower lobe. Father with Alzh... \n", + "0 Patient with severe fever and sore throat.\\nHe shows no stomach pain. He maintained on an epidural and PCA for pain control.\\nAfter CT, lung tumor located at the right lower lobe. Father with Alzh... \n", + "0 Patient with severe fever and sore throat.\\nHe shows no stomach pain. He maintained on an epidural and PCA for pain control.\\nAfter CT, lung tumor located at the right lower lobe. Father with Alzh... \n", + "\n", + " entities_clinical_ner_chunk \\\n", + "0 [severe fever, sore throat, stomach pain, an epidural, PCA, pain control, CT, lung tumor, Alzheimer] \n", + "0 [severe fever, sore throat, stomach pain, an epidural, PCA, pain control, CT, lung tumor, Alzheimer] \n", + "0 [severe fever, sore throat, stomach pain, an epidural, PCA, pain control, CT, lung tumor, Alzheimer] \n", + "0 [severe fever, sore throat, stomach pain, an epidural, PCA, pain control, CT, lung tumor, Alzheimer] \n", + "\n", + " entities_clinical_ner_chunk_class \\\n", + "0 [PROBLEM, PROBLEM, PROBLEM, TREATMENT, TREATMENT, TREATMENT, TEST, PROBLEM, PROBLEM] \n", + "0 [PROBLEM, PROBLEM, PROBLEM, TREATMENT, TREATMENT, TREATMENT, TEST, PROBLEM, PROBLEM] \n", + "0 [PROBLEM, PROBLEM, PROBLEM, TREATMENT, TREATMENT, TREATMENT, TEST, PROBLEM, PROBLEM] \n", + "0 [PROBLEM, PROBLEM, PROBLEM, TREATMENT, TREATMENT, TREATMENT, TEST, PROBLEM, PROBLEM] \n", + "\n", + " entities_clinical_ner_chunk_confidence \\\n", + "0 [0.902, 0.98815, 0.9933, 0.96599996, 0.9813, 0.73165, 0.9933, 0.9019, 0.9912] \n", + "0 [0.902, 0.98815, 0.9933, 0.96599996, 0.9813, 0.73165, 0.9933, 0.9019, 0.9912] \n", + "0 [0.902, 0.98815, 0.9933, 0.96599996, 0.9813, 0.73165, 0.9933, 0.9019, 0.9912] \n", + "0 [0.902, 0.98815, 0.9933, 0.96599996, 0.9813, 0.73165, 0.9933, 0.9019, 0.9912] \n", + "\n", + " entities_clinical_ner_chunk_origin_chunk \\\n", + "0 [0, 1, 2, 3, 4, 5, 6, 7, 8] \n", + "0 [0, 1, 2, 3, 4, 5, 6, 7, 8] \n", + "0 [0, 1, 2, 3, 4, 5, 6, 7, 8] \n", + "0 [0, 1, 2, 3, 4, 5, 6, 7, 8] \n", + "\n", + " entities_clinical_ner_chunk_origin_sentence \\\n", + "0 [0, 0, 1, 2, 2, 2, 3, 3, 4] \n", + "0 [0, 0, 1, 2, 2, 2, 3, 3, 4] \n", + "0 [0, 0, 1, 2, 2, 2, 3, 3, 4] \n", + "0 [0, 0, 1, 2, 2, 2, 3, 3, 4] \n", + "\n", + " entities_jsl_ner_chunk \\\n", + "0 [fever, sore throat, stomach pain, PCA, pain, CT, lung tumor, Alzheimer] \n", + "0 [fever, sore throat, stomach pain, PCA, pain, CT, lung tumor, Alzheimer] \n", + "0 [fever, sore throat, stomach pain, PCA, pain, CT, lung tumor, Alzheimer] \n", + "0 [fever, sore throat, stomach pain, PCA, pain, CT, lung tumor, Alzheimer] \n", + "\n", + " entities_jsl_ner_chunk_class \\\n", + "0 [TEST, PROBLEM, PROBLEM, TREATMENT, PROBLEM, TEST, PROBLEM, PROBLEM] \n", + "0 [TEST, PROBLEM, PROBLEM, TREATMENT, PROBLEM, TEST, PROBLEM, PROBLEM] \n", + "0 [TEST, PROBLEM, PROBLEM, TREATMENT, PROBLEM, TEST, PROBLEM, PROBLEM] \n", + "0 [TEST, PROBLEM, PROBLEM, TREATMENT, PROBLEM, TEST, PROBLEM, PROBLEM] \n", + "\n", + " entities_jsl_ner_chunk_confidence \\\n", + "0 [0.9943, 0.69635, 0.82834995, 0.8087, 0.9875, 0.9934, 0.87944996, 0.9796] \n", + "0 [0.9943, 0.69635, 0.82834995, 0.8087, 0.9875, 0.9934, 0.87944996, 0.9796] \n", + "0 [0.9943, 0.69635, 0.82834995, 0.8087, 0.9875, 0.9934, 0.87944996, 0.9796] \n", + "0 [0.9943, 0.69635, 0.82834995, 0.8087, 0.9875, 0.9934, 0.87944996, 0.9796] \n", + "\n", + " ... relations_entity1_class relations_entity1_end relations_entity2 \\\n", + "0 ... PROBLEM 24 sore throat \n", + "0 ... TREATMENT 96 PCA \n", + "0 ... TREATMENT 104 pain \n", + "0 ... TEST 131 lung tumor \n", + "\n", + " relations_entity2_begin relations_entity2_class relations_entity2_end \\\n", + "0 30 PROBLEM 40 \n", + "0 102 TREATMENT 104 \n", + "0 110 PROBLEM 113 \n", + "0 134 PROBLEM 143 \n", + "\n", + " relations_origin_sentence \\\n", + "0 0 \n", + "0 2 \n", + "0 2 \n", + "0 3 \n", + "\n", + " sentence_dl \\\n", + "0 [Patient with severe fever and sore throat., He shows no stomach pain., He maintained on an epidural and PCA for pain control., After CT, lung tumor located at the right lower lobe., Father with A... \n", + "0 [Patient with severe fever and sore throat., He shows no stomach pain., He maintained on an epidural and PCA for pain control., After CT, lung tumor located at the right lower lobe., Father with A... \n", + "0 [Patient with severe fever and sore throat., He shows no stomach pain., He maintained on an epidural and PCA for pain control., After CT, lung tumor located at the right lower lobe., Father with A... \n", + "0 [Patient with severe fever and sore throat., He shows no stomach pain., He maintained on an epidural and PCA for pain control., After CT, lung tumor located at the right lower lobe., Father with A... \n", + "\n", + " unlabeled_dependency \\\n", + "0 [ROOT, fever, fever, Patient, sore, throat, fever, Patient, shows, ROOT, stomach, pain, shows, shows, maintained, ROOT, epidural, epidural, maintained, PCA, epidural, control, control, PCA, mainta... \n", + "0 [ROOT, fever, fever, Patient, sore, throat, fever, Patient, shows, ROOT, stomach, pain, shows, shows, maintained, ROOT, epidural, epidural, maintained, PCA, epidural, control, control, PCA, mainta... \n", + "0 [ROOT, fever, fever, Patient, sore, throat, fever, Patient, shows, ROOT, stomach, pain, shows, shows, maintained, ROOT, epidural, epidural, maintained, PCA, epidural, control, control, PCA, mainta... \n", + "0 [ROOT, fever, fever, Patient, sore, throat, fever, Patient, shows, ROOT, stomach, pain, shows, shows, maintained, ROOT, epidural, epidural, maintained, PCA, epidural, control, control, PCA, mainta... \n", + "\n", + " word_embedding_embeddings \n", + "0 [[-0.08453157544136047, 0.20632991194725037, -0.05394839495420456, -0.364096075296402, -0.7453896999359131, -0.45486748218536377, 0.1968030333518982, -0.7794908285140991, -0.08118873834609985, 0.2... \n", + "0 [[-0.08453157544136047, 0.20632991194725037, -0.05394839495420456, -0.364096075296402, -0.7453896999359131, -0.45486748218536377, 0.1968030333518982, -0.7794908285140991, -0.08118873834609985, 0.2... \n", + "0 [[-0.08453157544136047, 0.20632991194725037, -0.05394839495420456, -0.364096075296402, -0.7453896999359131, -0.45486748218536377, 0.1968030333518982, -0.7794908285140991, -0.08118873834609985, 0.2... \n", + "0 [[-0.08453157544136047, 0.20632991194725037, -0.05394839495420456, -0.364096075296402, -0.7453896999359131, -0.45486748218536377, 0.1968030333518982, -0.7794908285140991, -0.08118873834609985, 0.2... \n", + "\n", + "[4 rows x 34 columns]" + ], + "text/html": [ + "\n", + "
\n", + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
assertiondocumententities_clinical_ner_chunkentities_clinical_ner_chunk_classentities_clinical_ner_chunk_confidenceentities_clinical_ner_chunk_origin_chunkentities_clinical_ner_chunk_origin_sentenceentities_jsl_ner_chunkentities_jsl_ner_chunk_classentities_jsl_ner_chunk_confidence...relations_entity1_classrelations_entity1_endrelations_entity2relations_entity2_beginrelations_entity2_classrelations_entity2_endrelations_origin_sentencesentence_dlunlabeled_dependencyword_embedding_embeddings
0[Present, Present, Absent, Past, Past, Hypothetical, Past, Present, Family]Patient with severe fever and sore throat.\\nHe shows no stomach pain. He maintained on an epidural and PCA for pain control.\\nAfter CT, lung tumor located at the right lower lobe. Father with Alzh...[severe fever, sore throat, stomach pain, an epidural, PCA, pain control, CT, lung tumor, Alzheimer][PROBLEM, PROBLEM, PROBLEM, TREATMENT, TREATMENT, TREATMENT, TEST, PROBLEM, PROBLEM][0.902, 0.98815, 0.9933, 0.96599996, 0.9813, 0.73165, 0.9933, 0.9019, 0.9912][0, 1, 2, 3, 4, 5, 6, 7, 8][0, 0, 1, 2, 2, 2, 3, 3, 4][fever, sore throat, stomach pain, PCA, pain, CT, lung tumor, Alzheimer][TEST, PROBLEM, PROBLEM, TREATMENT, PROBLEM, TEST, PROBLEM, PROBLEM][0.9943, 0.69635, 0.82834995, 0.8087, 0.9875, 0.9934, 0.87944996, 0.9796]...PROBLEM24sore throat30PROBLEM400[Patient with severe fever and sore throat., He shows no stomach pain., He maintained on an epidural and PCA for pain control., After CT, lung tumor located at the right lower lobe., Father with A...[ROOT, fever, fever, Patient, sore, throat, fever, Patient, shows, ROOT, stomach, pain, shows, shows, maintained, ROOT, epidural, epidural, maintained, PCA, epidural, control, control, PCA, mainta...[[-0.08453157544136047, 0.20632991194725037, -0.05394839495420456, -0.364096075296402, -0.7453896999359131, -0.45486748218536377, 0.1968030333518982, -0.7794908285140991, -0.08118873834609985, 0.2...
0[Present, Present, Absent, Past, Past, Hypothetical, Past, Present, Family]Patient with severe fever and sore throat.\\nHe shows no stomach pain. He maintained on an epidural and PCA for pain control.\\nAfter CT, lung tumor located at the right lower lobe. Father with Alzh...[severe fever, sore throat, stomach pain, an epidural, PCA, pain control, CT, lung tumor, Alzheimer][PROBLEM, PROBLEM, PROBLEM, TREATMENT, TREATMENT, TREATMENT, TEST, PROBLEM, PROBLEM][0.902, 0.98815, 0.9933, 0.96599996, 0.9813, 0.73165, 0.9933, 0.9019, 0.9912][0, 1, 2, 3, 4, 5, 6, 7, 8][0, 0, 1, 2, 2, 2, 3, 3, 4][fever, sore throat, stomach pain, PCA, pain, CT, lung tumor, Alzheimer][TEST, PROBLEM, PROBLEM, TREATMENT, PROBLEM, TEST, PROBLEM, PROBLEM][0.9943, 0.69635, 0.82834995, 0.8087, 0.9875, 0.9934, 0.87944996, 0.9796]...TREATMENT96PCA102TREATMENT1042[Patient with severe fever and sore throat., He shows no stomach pain., He maintained on an epidural and PCA for pain control., After CT, lung tumor located at the right lower lobe., Father with A...[ROOT, fever, fever, Patient, sore, throat, fever, Patient, shows, ROOT, stomach, pain, shows, shows, maintained, ROOT, epidural, epidural, maintained, PCA, epidural, control, control, PCA, mainta...[[-0.08453157544136047, 0.20632991194725037, -0.05394839495420456, -0.364096075296402, -0.7453896999359131, -0.45486748218536377, 0.1968030333518982, -0.7794908285140991, -0.08118873834609985, 0.2...
0[Present, Present, Absent, Past, Past, Hypothetical, Past, Present, Family]Patient with severe fever and sore throat.\\nHe shows no stomach pain. He maintained on an epidural and PCA for pain control.\\nAfter CT, lung tumor located at the right lower lobe. Father with Alzh...[severe fever, sore throat, stomach pain, an epidural, PCA, pain control, CT, lung tumor, Alzheimer][PROBLEM, PROBLEM, PROBLEM, TREATMENT, TREATMENT, TREATMENT, TEST, PROBLEM, PROBLEM][0.902, 0.98815, 0.9933, 0.96599996, 0.9813, 0.73165, 0.9933, 0.9019, 0.9912][0, 1, 2, 3, 4, 5, 6, 7, 8][0, 0, 1, 2, 2, 2, 3, 3, 4][fever, sore throat, stomach pain, PCA, pain, CT, lung tumor, Alzheimer][TEST, PROBLEM, PROBLEM, TREATMENT, PROBLEM, TEST, PROBLEM, PROBLEM][0.9943, 0.69635, 0.82834995, 0.8087, 0.9875, 0.9934, 0.87944996, 0.9796]...TREATMENT104pain110PROBLEM1132[Patient with severe fever and sore throat., He shows no stomach pain., He maintained on an epidural and PCA for pain control., After CT, lung tumor located at the right lower lobe., Father with A...[ROOT, fever, fever, Patient, sore, throat, fever, Patient, shows, ROOT, stomach, pain, shows, shows, maintained, ROOT, epidural, epidural, maintained, PCA, epidural, control, control, PCA, mainta...[[-0.08453157544136047, 0.20632991194725037, -0.05394839495420456, -0.364096075296402, -0.7453896999359131, -0.45486748218536377, 0.1968030333518982, -0.7794908285140991, -0.08118873834609985, 0.2...
0[Present, Present, Absent, Past, Past, Hypothetical, Past, Present, Family]Patient with severe fever and sore throat.\\nHe shows no stomach pain. He maintained on an epidural and PCA for pain control.\\nAfter CT, lung tumor located at the right lower lobe. Father with Alzh...[severe fever, sore throat, stomach pain, an epidural, PCA, pain control, CT, lung tumor, Alzheimer][PROBLEM, PROBLEM, PROBLEM, TREATMENT, TREATMENT, TREATMENT, TEST, PROBLEM, PROBLEM][0.902, 0.98815, 0.9933, 0.96599996, 0.9813, 0.73165, 0.9933, 0.9019, 0.9912][0, 1, 2, 3, 4, 5, 6, 7, 8][0, 0, 1, 2, 2, 2, 3, 3, 4][fever, sore throat, stomach pain, PCA, pain, CT, lung tumor, Alzheimer][TEST, PROBLEM, PROBLEM, TREATMENT, PROBLEM, TEST, PROBLEM, PROBLEM][0.9943, 0.69635, 0.82834995, 0.8087, 0.9875, 0.9934, 0.87944996, 0.9796]...TEST131lung tumor134PROBLEM1433[Patient with severe fever and sore throat., He shows no stomach pain., He maintained on an epidural and PCA for pain control., After CT, lung tumor located at the right lower lobe., Father with A...[ROOT, fever, fever, Patient, sore, throat, fever, Patient, shows, ROOT, stomach, pain, shows, shows, maintained, ROOT, epidural, epidural, maintained, PCA, epidural, control, control, PCA, mainta...[[-0.08453157544136047, 0.20632991194725037, -0.05394839495420456, -0.364096075296402, -0.7453896999359131, -0.45486748218536377, 0.1968030333518982, -0.7794908285140991, -0.08118873834609985, 0.2...
\n", + "

4 rows × 34 columns

\n", + "
\n", + "
\n", + "\n", + "
\n", + " \n", + "\n", + " \n", + "\n", + " \n", + "
\n", + "\n", + "\n", + "
\n", + " \n", + "\n", + "\n", + "\n", + " \n", + "
\n", + "\n", + "
\n", + " \n", + " \n", + " \n", + "
\n", + "\n", + "
\n", + "
\n" + ], + "application/vnd.google.colaboratory.intrinsic+json": { + "type": "dataframe", + "variable_name": "df" + } + }, + "metadata": {}, + "execution_count": 6 + } + ] + }, + { + "cell_type": "code", + "source": [], + "metadata": { + "id": "ShKt275l9S40" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "source": [], + "metadata": { + "id": "E4t7g6jS9S2W" + }, + "execution_count": null, + "outputs": [] + } + ] +} \ No newline at end of file diff --git a/nlu/spellbook.py b/nlu/spellbook.py index 004e00c0..0df9ef02 100644 --- a/nlu/spellbook.py +++ b/nlu/spellbook.py @@ -10646,6 +10646,7 @@ class Spellbook: 'en.explain_doc.clinical_granular': 'explain_clinical_doc_granular', 'en.explain_doc.pipeline_vop': 'explain_clinical_doc_radiology', 'en.explain_doc.clinical_oncology.pipeline': 'explain_clinical_doc_oncology', + 'en.explain_doc.clinical_generic.pipeline': 'explain_clinical_doc_generic', 'en.icd10_icd9.mapping': 'icd10_icd9_mapping', 'en.icd10cm.umls.mapping': 'icd10cm_umls_mapping', 'en.icd10cm_resolver.pipeline': 'icd10cm_resolver_pipeline',