{ "cells": [ { "cell_type": "code", "execution_count": 2, "id": "809c06bc", "metadata": {}, "outputs": [], "source": [ "import pandas as pd\n", "import numpy as np\n", "import spacy" ] }, { "cell_type": "code", "execution_count": 3, "id": "e8b0dce4", "metadata": {}, "outputs": [], "source": [ "import en_ner_bc5cdr_md\n", "import en_core_med7_lg" ] }, { "cell_type": "code", "execution_count": 4, "id": "84d4467f", "metadata": {}, "outputs": [], "source": [ "# To install spaCy's pre-trained model en_ner_bc5cdr_md, en_core_med7_lg use the link below. You can also install the transformer\n", "\n", "# !pip install https://s3-us-west-2.amazonaws.com/ai2-s2-scispacy/releases/v0.5.1/en_ner_bc5cdr_md-0.5.1.tar.gz\n", "# !pip install https://huggingface.co/kormilitzin/en_core_med7_trf/resolve/main/en_core_med7_trf-any-py3-none-any.whl --user\n", "# !pip install https://huggingface.co/kormilitzin/en_core_med7_lg/resolve/main/en_core_med7_lg-any-py3-none-any.whl --user" ] }, { "cell_type": "code", "execution_count": 5, "id": "1ee710ca", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | description | \n", "medical_specialty | \n", "sample_name | \n", "transcription | \n", "keywords | \n", "
---|---|---|---|---|---|
0 | \n", "A 23-year-old white female presents with comp... | \n", "Allergy / Immunology | \n", "Allergic Rhinitis | \n", "SUBJECTIVE:, This 23-year-old white female pr... | \n", "allergy / immunology, allergic rhinitis, aller... | \n", "
1 | \n", "Consult for laparoscopic gastric bypass. | \n", "Bariatrics | \n", "Laparoscopic Gastric Bypass Consult - 2 | \n", "PAST MEDICAL HISTORY:, He has difficulty climb... | \n", "bariatrics, laparoscopic gastric bypass, weigh... | \n", "
2 | \n", "Consult for laparoscopic gastric bypass. | \n", "Bariatrics | \n", "Laparoscopic Gastric Bypass Consult - 1 | \n", "HISTORY OF PRESENT ILLNESS: , I have seen ABC ... | \n", "bariatrics, laparoscopic gastric bypass, heart... | \n", "
3 | \n", "2-D M-Mode. Doppler. | \n", "Cardiovascular / Pulmonary | \n", "2-D Echocardiogram - 1 | \n", "2-D M-MODE: , ,1. Left atrial enlargement wit... | \n", "cardiovascular / pulmonary, 2-d m-mode, dopple... | \n", "
4 | \n", "2-D Echocardiogram | \n", "Cardiovascular / Pulmonary | \n", "2-D Echocardiogram - 2 | \n", "1. The left ventricular cavity size and wall ... | \n", "cardiovascular / pulmonary, 2-d, doppler, echo... | \n", "