File size: 96,243 Bytes
3ebe0ac |
1 |
{"cells":[{"cell_type":"code","execution_count":1,"id":"4a504967","metadata":{"id":"4a504967","executionInfo":{"status":"ok","timestamp":1735377507962,"user_tz":-180,"elapsed":1315,"user":{"displayName":"Yasmeen Mohammad","userId":"07702318889052952256"}}},"outputs":[],"source":["import json\n","\n","with open('intents.json') as file:\n"," data = json.load(file)"]},{"cell_type":"code","execution_count":2,"id":"99436914","metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"99436914","executionInfo":{"status":"ok","timestamp":1735377510710,"user_tz":-180,"elapsed":6,"user":{"displayName":"Yasmeen Mohammad","userId":"07702318889052952256"}},"outputId":"27f9a5e1-aca9-489d-ef16-00e7321c80b5"},"outputs":[{"output_type":"execute_result","data":{"text/plain":["dict"]},"metadata":{},"execution_count":2}],"source":["type(data)"]},{"cell_type":"code","execution_count":3,"id":"480c67b7","metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"480c67b7","executionInfo":{"status":"ok","timestamp":1735377513639,"user_tz":-180,"elapsed":12,"user":{"displayName":"Yasmeen Mohammad","userId":"07702318889052952256"}},"outputId":"4dfdb3b2-793d-4e0c-9568-8fc20ac85ec5"},"outputs":[{"output_type":"execute_result","data":{"text/plain":["{'intents': [{'class': 'Epilepsy',\n"," 'patterns': ['22 years old, experiencing body tremors with inability to move or speak.',\n"," '50 years old, experiencing loss of consciousness with shaking and fatigue.',\n"," '28 years old, experiencing convulsions with fatigue and inability to move or speak.',\n"," '30 years old, experiencing violent shaking with inability to speak.',\n"," 'Severe convulsions with inability to control oneself',\n"," 'Falling with body shaking, fatigue, and inability to speak',\n"," 'Convulsions with pale face and fatigue.',\n"," 'Body shaking with inability to speak and breathing difficulties',\n"," 'Shaking with tight muscles, strange sounds, and saliva secretion',\n"," 'Convulsions with pale face and difficulty speaking.',\n"," 'Faisal Al-Ghamdi, 32 years old, suffers from sudden loss of consciousness and convulsions, especially when stressed, and feels exhausted',\n"," 'Abdulaziz Al-Mutairi, 25 years old, suffers from seizures and loss of consciousness',\n"," 'A seizure with muscle twitching, loss of consciousness, and inability to balance',\n"," 'Convulsive seizures with loss of consciousness and body muscle contractions',\n"," 'Loss of consciousness and seizures with involuntary movements',\n"," 'Sudden seizures with loss of consciousness and strange noises',\n"," 'Seizures that begin with bright sounds and lights and loss of consciousness',\n"," '35 years old, involuntary movements and facial spasms, with loss of the ability to communicate',\n"," 'Khaled, 20 years old, has convulsions and inability to control himself',\n"," '14 years old, body shaking with fatigue and paleness',\n"," '25 years old, falling to the ground with body shaking and strange sounds',\n"," 'Young man, 25 years old, his body shakes and does not respond, his eyes are turned down, and saliva is dripping from his mouth',\n"," 'A 10-year-old girl suffers from a seizure and loses consciousness. Saliva comes out of her mouth and her lips are blue',\n"," 'A 50-year-old man with epilepsy is unable to move, his breathing is heavy, and he falls to the ground',\n"," 'Khaled Al-Asiri, 28 years old, random movement of hands and feet with inability to remember',\n"," 'Fall with convulsions in the limbs with loss of consciousness and salivation',\n"," 'Loss of consciousness with muscle tremors and difficulty breathing',\n"," 'Falling to the ground with muscle tremors and loss of consciousness',\n"," 'Falling to the ground with abnormal movements of the hands and feet and difficulty breathing'],\n"," 'responses': ['Stay calm and make sure the person is safe.',\n"," 'Protect them by removing hard or sharp objects around.',\n"," 'Place a soft item, like a pillow, under their head.',\n"," 'Do not restrain their movements or try to open their mouth by force.',\n"," 'Turn them on their side after the seizure to avoid choking on vomit.']},\n"," {'class': 'Asthma',\n"," 'patterns': ['Mazen has a severe cough, chest pain and difficulty breathing',\n"," 'Rami is experiencing mild chest pain with a persistent cough.',\n"," 'A person is suffering from wheezing while breathing and tightness in the chest.\\n\\n',\n"," 'A person suffering from severe cough, fatigue, and shortness of breath.',\n"," 'Khaled is suffering from chest pain, difficulty breathing, and wheezing.',\n"," 'Ahmed, 35 years old, suffers from a cough, chest pain, and wheezing during breathing',\n"," 'Suha, 14 years old, suffers from wheezing in breathing and chest pain.',\n"," 'Sami suffers from coughing and difficulty breathing.',\n"," 'informant suffers from cough, shortness of breath, and fatigue.',\n"," 'Hamid suffers from wheezing in breathing and difficulty speaking.',\n"," 'Ruba is experiencing wheezing in breathing, coughing, and fatigue.',\n"," 'The patient is suffering from chest pain and cough.',\n"," 'Samira is suffering from recurrent episodes of dry cough and chest pain.'],\n"," 'responses': ['Sit the person upright to help them breathe more easily.',\n"," 'Assist them in using their prescribed inhaler promptly.',\n"," 'Encourage slow, deep breaths to help reduce anxiety and improve airflow.',\n"," \"If there's no improvement after several minutes, call emergency services.\",\n"," 'Stay with the person until medical help arrives.']},\n"," {'class': 'Heatstroke',\n"," 'patterns': ['old man with a high body temperature and redness on the skin.',\n"," 'Souad, 13 years old, suffers from a severe headache and dizziness with a high body temperature.',\n"," 'Abu Ibrahim, 47 years old, was exposed to the sun for a long time, which led to a rise in his body temperature, causing him to lose consciousness.',\n"," 'Abdulrahman Azhar, 33 years old, suffers from a high temperature with a headache and a rapid heartbeat.',\n"," 'A young man in his twenties, unconscious with a high temperature; his skin color is red.',\n"," 'hadi Suleiman, 21 years old, feels nauseous and has a high body temperature.',\n"," 'Said Al-Shahri, 65 years old, lost consciousness suddenly and has a rapid heartbeat.',\n"," 'Faris Al-Harbi, 39 years old, had a rise in body temperature to the point of losing consciousness.',\n"," 'Faris Al-Harbi, 39 years old, had a rise in body temperature to the point of losing consciousness.',\n"," 'Fares Al-Mutrefi, 26 years old, was exposed to the sun for a long time, resulting in a high fever and headache.',\n"," 'Ahmed, 48 years old, has been feeling dizzy and nauseous for a while, and his fever has started to rise.',\n"," 'Um Saad, 73 years old, is suffering from a severe fever; her skin is red and moist.',\n"," 'Salem, 21 years old, is experiencing a high fever and feels a strong heartbeat.',\n"," 'A girl under 17 years old, unconscious, and her skin is very hot; she needs urgent intervention.',\n"," 'Faisal Al-Subaie, 69 years old, is experiencing headache, nausea, and very high body temperature.',\n"," 'The girl is named Sarah Mohammed; she is suffering from a fever, nausea, and headache.',\n"," '55-year-old man is experiencing a high fever, dizziness, and fatigue.',\n"," 'A man suffering from exhaustion, facial redness, and strong headaches.',\n"," 'Ahmed Al-Ghamdi, 25 years old, suffers from dizziness and headache, along with redness and peeling of the skin',\n"," 'Fahd Al-Qahtani, 30 years old, suffers from nausea, dizziness and high temperature',\n"," 'Laila Al-Saadi, 22 years old, suffers from headaches, lack of concentration, and itchy, dry skin',\n"," 'Hamed, 40 years old, suffers from headache, dizziness, and red and swollen feet',\n"," 'A person experiences headache, dizziness, and fatigue with hot skin and a weak pulse',\n"," 'Khaled, 35 years old, suffers from headache, dizziness, and fatigue, along with dry, hot skin, and a weak pulse',\n"," 'A woman suffers from dizziness, headache, and fatigue with hot skin and a weak pulse',\n"," 'Majed, 50 years old, suffers from headache, dizziness, and an altered level of consciousness, with a weak pulse',\n"," 'A person approximately 60 years old suffers from headache, dizziness, and fatigue with dry, hot skin',\n"," 'Souad, 45 years old, suffers from headaches, dizziness, and fatigue, along with clammy, hot skin, and a weak pulse',\n"," 'A young man, approximately 20 years old, suffers from dizziness, headache, and fatigue, with hot skin and a weak pulse',\n"," 'Hassan Al-Jaber suffers from headache, dizziness, and an altered level of consciousness, with dry, hot skin, and a weak pulse',\n"," 'An elderly woman suffers from dizziness, headache, hot skin, and a weak pulse',\n"," 'Ahmed, 30 years old, suffers from headache, dizziness, and fatigue, along with hot skin and a weak pulse'],\n"," 'responses': ['Move the person to a cooler environment immediately.',\n"," 'Wrap them in a wet sheet and reapply every 10 minutes if needed.',\n"," 'If no sheet is available, spray cold water on their neck, face, and armpits.',\n"," 'Place them near a fan or air conditioner to improve cooling.',\n"," 'Offer water slowly to hydrate them if they are conscious.']},\n"," {'class': 'Hyperglycemia High Blood Sugar',\n"," 'patterns': ['A man suffering from severe thirst, fatigue, and difficulty concentrating.',\n"," 'An old woman suffering from shortness of breath, exhaustion, and blurred vision.',\n"," 'A man suffering from persistent fatigue, frequent urination, and exhaustion.',\n"," 'A person suffering from exhaustion, headaches, and blurred vision.',\n"," 'An elderly man suffering from dry mouth, constant thirst, and severe fatigue.',\n"," 'A young man suffering from pallor, severe dizziness, and trembling.',\n"," 'A woman suffering from recurrent dizziness, cold sweating, and loss of balance.',\n"," 'A person suffering from general weakness and difficulty standing.',\n"," 'A woman suffering from exhaustion, difficulty speaking, and trembling in the hands.',\n"," 'A man suffering from severe dizziness and inability to stand.',\n"," 'Ahmed Al-Khalidi suffers from blurry vision, headache, and dry mouth. He is forty years old',\n"," '60 years old, extreme fatigue, heavy breathing, and constant thirst',\n"," 'Pale face with fatigue, thirst and difficulty breathing',\n"," 'Muhammad, 22 years old, fatigue, difficulty breathing, pale face, and constant thirst',\n"," 'Severe tremors and paleness of the face with a fruity breath odor',\n"," 'Salem, 14 years old, excessive sweating, pale face, and inability to stand',\n"," 'Badriya Al-Shahri, 42 years old, suffers from dizziness, dry mouth, and lethargy.',\n"," 'Khaled Al-Harthi, 49 years old, has a fever, nausea and fatigue.',\n"," 'Salma Al-Asiri, 38 years old, has tremors in her hands, headache, dry mouth, and lethargy.',\n"," 'Ali Al-Shahrani, 48 years old, feels numbness in his feet, headache, lethargy, and a feeling of hunger.',\n"," 'Nasser Al-Otaibi, 47 years old, feels burning in the eyes, lethargy and dry mouth'],\n"," 'responses': ['Let the person drink a lot of water to help flush out excess sugar.',\n"," 'Encourage them to engage in light physical activity, like walking.']},\n"," {'class': 'Hypoglycemia Low Blood Sugar',\n"," 'patterns': ['Sarah Muhammad suffers from tremors, sweating, and a rapid heartbeat. She is 60 years old',\n"," 'A 20-year-old diabetic patient has tremors, sweats a lot, does not respond, her eyes are closed, and she has not eaten well',\n"," 'Ahmed suffers from severe dizziness, fatigue, severe sweating, and blurry vision',\n"," 'He suffers from body tremors, blurry vision and fatigue',\n"," 'A 16-year-old woman suffers from tremors, dizziness, severe sweating, and paleness',\n"," 'A 60-year-old man suffers from paleness, tremors, inability to speak, and dizziness',\n"," 'He suffers from pale face, dizziness, and blurred vision'],\n"," 'responses': ['Provide two teaspoons of sugar dissolved in water or sweet juice.',\n"," 'If symptoms continue, repeat the same dose after 10-15 minutes until improvement is seen.']},\n"," {'class': 'Heat Exhaustion',\n"," 'patterns': ['Noura Abdullah, 32 years old, suffers from fatigue, dizziness, sweating, nausea, high heart rate, and fever.',\n"," 'A street worker is very tired, sweating, and unresponsive',\n"," 'A 12-year-old girl fell due to severe dizziness',\n"," 'Ahmed Al-Mutairi, 27 years old, severe fatigue with sweating, headache and body heat',\n"," 'Dizziness with sweating, fever and inability to move',\n"," 'Fatigue with body heat and profuse sweating',\n"," 'A person who has fainted is sweating profusely and has a weak heartbeat.'],\n"," 'responses': ['Take the person to a cool, shaded, or air-conditioned area.',\n"," 'Remove outer clothing, keeping only what is necessary.',\n"," 'Offer cold water gradually to hydrate them and avoid caffeine-containing drinks.',\n"," 'Let them lie down with their legs raised above the body.']},\n"," {'class': 'Nosebleed',\n"," 'patterns': ['Muhammad Al-Hazmi, 18 years old, suffers from nosebleeds, dizziness, confusion, and mild headache',\n"," 'A young man was bleeding from his nose and the bleeding did not stop, his features were pale and dizzy',\n"," 'A young man has a nosebleed that does not stop and dizziness'],\n"," 'responses': ['Sit upright and lean forward slightly to prevent swallowing blood.',\n"," 'Pinch the soft part of the nose between the thumb and index finger.',\n"," 'Maintain pressure for 10 to 15 minutes without interruption.',\n"," 'Apply a cold compress to the nose and cheeks to constrict blood vessels.',\n"," 'If bleeding continues after 30 minutes, seek medical attention.']},\n"," {'class': 'Dehydration',\n"," 'patterns': ['A 15-year-old girl feels dizzy, dizzy, and unable to stand, with her lips turning blue and nausea',\n"," 'A 5-year-old child has not drunk water for a day and cries without tears',\n"," 'A young man became dehydrated in the sun and fell to the ground',\n"," 'Sarah suffers from fatigue, dizziness, extreme thirst, and rapid breathing',\n"," 'Khaled Al Zahrani, 29 years old, fatigue with dry lips and dizziness',\n"," 'Khaled Al Zahrani, 29 years old, inability to stand with headache and dryness',\n"," 'Dry skin and lips with constant dizziness and fatigue',\n"," 'Inability to speak with fatigue and cracked lips',\n"," 'Muhammad Al-Maliki, 38 years old, severe dehydration, inability to stand, and headache'],\n"," 'responses': ['Stay in a cool area to minimize sweating.',\n"," 'Drink lots of water and diluted sweetened juices to stay hydrated.',\n"," 'Use sports drinks to replenish lost electrolytes effectively.']},\n"," {'class': 'Food Poisoning',\n"," 'patterns': ['Mahmoud Al-Salami, 17 years old. After eating, he felt severe pain in his abdomen, and he vomited three times, feeling dizziness and tingling in his skin',\n"," 'Rashid Abdel Samad, 16 years old, ate a meal and then felt cramps, vomiting, and dizziness',\n"," 'A 10-year-old child vomits, diarrhea, paleness, and abdominal pain after eating a meal',\n"," 'A 4-year-old child drank juice and had severe diarrhea and high fever',\n"," 'Mai Al-Abdeli, 20 years old, has abdominal pain, dizziness and vomiting.',\n"," 'Rana Ahmed, 29 years old, suffers from headache, stomach pain and vomiting.',\n"," 'Khaled Radhi, 36 years old, suffers from colic and frequent vomiting.',\n"," 'Fatima Ayman suffers from body temperature, dry mouth, stomach pain, vomiting and dizziness.',\n"," 'Hassan suffers from headache, stomach pain, frequent vomiting and lethargy.'],\n"," 'responses': ['Give small sips of water to keep them hydrated.',\n"," 'Encourage them to rest in a calm and comfortable place.',\n"," 'Avoid forcing food or drink if they are not ready to consume it.']}]}"]},"metadata":{},"execution_count":3}],"source":["data"]},{"cell_type":"code","execution_count":4,"id":"700e3266","metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"700e3266","executionInfo":{"status":"ok","timestamp":1735377523988,"user_tz":-180,"elapsed":1489,"user":{"displayName":"Yasmeen Mohammad","userId":"07702318889052952256"}},"outputId":"eae6842a-d2b3-47a7-d2cb-55d61da2d17f"},"outputs":[{"output_type":"stream","name":"stdout","text":["Epilepsy\n","Asthma\n","Heatstroke\n","Hyperglycemia High Blood Sugar\n","Hypoglycemia Low Blood Sugar\n","Heat Exhaustion\n","Nosebleed\n","Dehydration\n","Food Poisoning\n"]}],"source":["for intent in data[\"intents\"]:\n"," c = intent[\"class\"]\n"," print(c)"]},{"cell_type":"code","execution_count":7,"id":"858e83e7","metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"858e83e7","executionInfo":{"status":"ok","timestamp":1735377643627,"user_tz":-180,"elapsed":431,"user":{"displayName":"Yasmeen Mohammad","userId":"07702318889052952256"}},"outputId":"95e25d4d-3850-407d-811e-4ceda5d07338"},"outputs":[{"output_type":"stream","name":"stderr","text":["[nltk_data] Downloading package punkt to /root/nltk_data...\n","[nltk_data] Package punkt is already up-to-date!\n","[nltk_data] Downloading package punkt_tab to /root/nltk_data...\n","[nltk_data] Unzipping tokenizers/punkt_tab.zip.\n","[nltk_data] Downloading package wordnet to /root/nltk_data...\n","[nltk_data] Package wordnet is already up-to-date!\n","[nltk_data] Downloading package stopwords to /root/nltk_data...\n","[nltk_data] Package stopwords is already up-to-date!\n","[nltk_data] Downloading package omw-1.4 to /root/nltk_data...\n","[nltk_data] Package omw-1.4 is already up-to-date!\n"]}],"source":["import nltk\n","\n","nltk.download(\"punkt\")\n","\n","nltk.download('punkt_tab')\n","\n","nltk.download(\"wordnet\")\n","\n","nltk.download(\"stopwords\")\n","\n","nltk.download('omw-1.4')\n","\n","from nltk.corpus import stopwords\n","\n","from nltk.stem import WordNetLemmatizer\n","\n","import string"]},{"cell_type":"code","execution_count":8,"id":"054fa831","metadata":{"id":"054fa831","executionInfo":{"status":"ok","timestamp":1735377646450,"user_tz":-180,"elapsed":418,"user":{"displayName":"Yasmeen Mohammad","userId":"07702318889052952256"}}},"outputs":[],"source":["vocab = []\n","\n","classes = []\n","\n","doc_X = []\n","\n","doc_y = []\n","\n","for intent in data[\"intents\"]:\n","\n"," for pattern in intent[\"patterns\"]:\n","\n"," tokens = nltk.word_tokenize(pattern)\n","\n"," vocab.extend(tokens)\n","\n"," doc_X.append(pattern)\n","\n"," doc_y.append(intent[\"class\"])\n","\n"," if intent[\"class\"] not in classes:\n"," classes.append(intent[\"class\"])"]},{"cell_type":"code","execution_count":9,"id":"53b03bd6","metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"53b03bd6","executionInfo":{"status":"ok","timestamp":1735377654894,"user_tz":-180,"elapsed":4378,"user":{"displayName":"Yasmeen Mohammad","userId":"07702318889052952256"}},"outputId":"59b4b901-7956-4927-c6ee-517bbbb6b33f"},"outputs":[{"output_type":"execute_result","data":{"text/plain":["['10-year-old',\n"," '12-year-old',\n"," '13',\n"," '14',\n"," '15-year-old',\n"," '16',\n"," '16-year-old',\n"," '17',\n"," '18',\n"," '20',\n"," '20-year-old',\n"," '21',\n"," '22',\n"," '25',\n"," '26',\n"," '27',\n"," '28',\n"," '29',\n"," '30',\n"," '32',\n"," '33',\n"," '35',\n"," '36',\n"," '38',\n"," '39',\n"," '4-year-old',\n"," '40',\n"," '42',\n"," '45',\n"," '47',\n"," '48',\n"," '49',\n"," '5-year-old',\n"," '50',\n"," '50-year-old',\n"," '55-year-old',\n"," '60',\n"," '60-year-old',\n"," '65',\n"," '69',\n"," '73',\n"," 'abdel',\n"," 'abdomen',\n"," 'abdominal',\n"," 'abdulaziz',\n"," 'abdullah',\n"," 'abdulrahman',\n"," 'ability',\n"," 'abnormal',\n"," 'abu',\n"," 'ahmed',\n"," 'al',\n"," 'al-abdeli',\n"," 'al-asiri',\n"," 'al-ghamdi',\n"," 'al-harbi',\n"," 'al-harthi',\n"," 'al-hazmi',\n"," 'al-jaber',\n"," 'al-khalidi',\n"," 'al-maliki',\n"," 'al-mutairi',\n"," 'al-mutrefi',\n"," 'al-otaibi',\n"," 'al-qahtani',\n"," 'al-saadi',\n"," 'al-salami',\n"," 'al-shahrani',\n"," 'al-shahri',\n"," 'al-subaie',\n"," 'ali',\n"," 'along',\n"," 'altered',\n"," 'approximately',\n"," 'ate',\n"," 'ayman',\n"," 'azhar',\n"," 'badriya',\n"," 'balance',\n"," 'became',\n"," 'begin',\n"," 'bleeding',\n"," 'blue',\n"," 'blurred',\n"," 'blurry',\n"," 'body',\n"," 'breath',\n"," 'breathing',\n"," 'bright',\n"," 'burning',\n"," 'causing',\n"," 'chest',\n"," 'child',\n"," 'clammy',\n"," 'closed',\n"," 'cold',\n"," 'colic',\n"," 'color',\n"," 'come',\n"," 'communicate',\n"," 'concentrating',\n"," 'concentration',\n"," 'confusion',\n"," 'consciousness',\n"," 'constant',\n"," 'contraction',\n"," 'control',\n"," 'convulsion',\n"," 'convulsive',\n"," 'cough',\n"," 'coughing',\n"," 'cracked',\n"," 'cramp',\n"," 'cry',\n"," 'day',\n"," 'dehydrated',\n"," 'dehydration',\n"," 'diabetic',\n"," 'diarrhea',\n"," 'difficulty',\n"," 'dizziness',\n"," 'dizzy',\n"," 'doe',\n"," 'drank',\n"," 'dripping',\n"," 'drunk',\n"," 'dry',\n"," 'dryness',\n"," 'due',\n"," 'eaten',\n"," 'eating',\n"," 'elderly',\n"," 'epilepsy',\n"," 'episode',\n"," 'especially',\n"," 'excessive',\n"," 'exhausted',\n"," 'exhaustion',\n"," 'experience',\n"," 'experiencing',\n"," 'exposed',\n"," 'extreme',\n"," 'eye',\n"," 'face',\n"," 'facial',\n"," 'fahd',\n"," 'fainted',\n"," 'faisal',\n"," 'fall',\n"," 'falling',\n"," 'fare',\n"," 'faris',\n"," 'fatigue',\n"," 'fatima',\n"," 'feature',\n"," 'feel',\n"," 'feeling',\n"," 'fell',\n"," 'felt',\n"," 'fever',\n"," 'foot',\n"," 'forty',\n"," 'frequent',\n"," 'fruity',\n"," 'general',\n"," 'girl',\n"," 'ground',\n"," 'ha',\n"," 'hadi',\n"," 'hamed',\n"," 'hamid',\n"," 'hand',\n"," 'hassan',\n"," 'headache',\n"," 'heart',\n"," 'heartbeat',\n"," 'heat',\n"," 'heavy',\n"," 'high',\n"," 'hot',\n"," 'hunger',\n"," 'ibrahim',\n"," 'inability',\n"," 'informant',\n"," 'intervention',\n"," 'involuntary',\n"," 'itchy',\n"," 'juice',\n"," 'khaled',\n"," 'lack',\n"," 'laila',\n"," 'led',\n"," 'lethargy',\n"," 'level',\n"," 'light',\n"," 'limb',\n"," 'lip',\n"," 'long',\n"," 'lose',\n"," 'loses',\n"," 'losing',\n"," 'loss',\n"," 'lost',\n"," 'lot',\n"," 'mahmoud',\n"," 'mai',\n"," 'majed',\n"," 'man',\n"," 'mazen',\n"," 'meal',\n"," 'mild',\n"," 'mohammed',\n"," 'moist',\n"," 'mouth',\n"," 'move',\n"," 'movement',\n"," 'muhammad',\n"," 'muscle',\n"," 'named',\n"," 'nasser',\n"," 'nausea',\n"," 'nauseous',\n"," 'need',\n"," 'noise',\n"," 'nose',\n"," 'nosebleed',\n"," 'noura',\n"," 'numbness',\n"," 'odor',\n"," 'old',\n"," 'oneself',\n"," 'pain',\n"," 'pale',\n"," 'paleness',\n"," 'pallor',\n"," 'patient',\n"," 'peeling',\n"," 'persistent',\n"," 'person',\n"," 'point',\n"," 'profuse',\n"," 'profusely',\n"," 'pulse',\n"," 'radhi',\n"," 'ramus',\n"," 'rana',\n"," 'random',\n"," 'rapid',\n"," 'rashid',\n"," 'rate',\n"," 'recurrent',\n"," 'red',\n"," 'redness',\n"," 'remember',\n"," 'respond',\n"," 'resulting',\n"," 'rise',\n"," 'ruba',\n"," 'saad',\n"," 'said',\n"," 'salem',\n"," 'saliva',\n"," 'salivation',\n"," 'salma',\n"," 'samad',\n"," 'sami',\n"," 'samira',\n"," 'sarah',\n"," 'secretion',\n"," 'seizure',\n"," 'severe',\n"," 'shake',\n"," 'shaking',\n"," 'shortness',\n"," 'skin',\n"," 'souad',\n"," 'sound',\n"," 'spasm',\n"," 'speak',\n"," 'speaking',\n"," 'stand',\n"," 'standing',\n"," 'started',\n"," 'stomach',\n"," 'stop',\n"," 'strange',\n"," 'street',\n"," 'stressed',\n"," 'strong',\n"," 'sudden',\n"," 'suddenly',\n"," 'suffering',\n"," 'suffers',\n"," 'suha',\n"," 'suleiman',\n"," 'sun',\n"," 'sweat',\n"," 'sweating',\n"," 'swollen',\n"," 'tear',\n"," 'temperature',\n"," 'thirst',\n"," 'three',\n"," 'tight',\n"," 'tightness',\n"," 'time',\n"," 'tingling',\n"," 'tired',\n"," 'trembling',\n"," 'tremor',\n"," 'turned',\n"," 'turning',\n"," 'twenty',\n"," 'twitching',\n"," 'um',\n"," 'unable',\n"," 'unconscious',\n"," 'unresponsive',\n"," 'urgent',\n"," 'urination',\n"," 'violent',\n"," 'vision',\n"," 'vomit',\n"," 'vomited',\n"," 'vomiting',\n"," 'wa',\n"," 'water',\n"," 'weak',\n"," 'weakness',\n"," 'well',\n"," 'wheezing',\n"," 'without',\n"," 'woman',\n"," 'worker',\n"," 'year',\n"," 'young',\n"," 'zahrani']"]},"metadata":{},"execution_count":9}],"source":["vocab = [word for word in vocab if word not in string.punctuation]\n","\n","lemmatizer = WordNetLemmatizer()\n","\n","vocab = [lemmatizer.lemmatize(word.lower() ) for word in vocab]\n","\n","stop_words = stopwords.words('english')\n","vocab = [word for word in vocab if word not in stop_words]\n","\n","vocab = set(vocab)\n","\n","vocab = sorted(vocab)\n","vocab"]},{"cell_type":"code","execution_count":10,"id":"6786a91f","metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"6786a91f","executionInfo":{"status":"ok","timestamp":1735377664566,"user_tz":-180,"elapsed":407,"user":{"displayName":"Yasmeen Mohammad","userId":"07702318889052952256"}},"outputId":"b2ed5931-4f8b-49aa-b934-75bb04db5e8a"},"outputs":[{"output_type":"execute_result","data":{"text/plain":["['Asthma',\n"," 'Dehydration',\n"," 'Epilepsy',\n"," 'Food Poisoning',\n"," 'Heat Exhaustion',\n"," 'Heatstroke',\n"," 'Hyperglycemia High Blood Sugar',\n"," 'Hypoglycemia Low Blood Sugar',\n"," 'Nosebleed']"]},"metadata":{},"execution_count":10}],"source":["classes = sorted(set(classes))\n","classes"]},{"cell_type":"code","execution_count":11,"id":"98f7cc78","metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"98f7cc78","executionInfo":{"status":"ok","timestamp":1735377671790,"user_tz":-180,"elapsed":450,"user":{"displayName":"Yasmeen Mohammad","userId":"07702318889052952256"}},"outputId":"f9fb900d-fcfc-4407-e533-5b468a741c98"},"outputs":[{"output_type":"execute_result","data":{"text/plain":["['22 years old, experiencing body tremors with inability to move or speak.',\n"," '50 years old, experiencing loss of consciousness with shaking and fatigue.',\n"," '28 years old, experiencing convulsions with fatigue and inability to move or speak.',\n"," '30 years old, experiencing violent shaking with inability to speak.',\n"," 'Severe convulsions with inability to control oneself',\n"," 'Falling with body shaking, fatigue, and inability to speak',\n"," 'Convulsions with pale face and fatigue.',\n"," 'Body shaking with inability to speak and breathing difficulties',\n"," 'Shaking with tight muscles, strange sounds, and saliva secretion',\n"," 'Convulsions with pale face and difficulty speaking.',\n"," 'Faisal Al-Ghamdi, 32 years old, suffers from sudden loss of consciousness and convulsions, especially when stressed, and feels exhausted',\n"," 'Abdulaziz Al-Mutairi, 25 years old, suffers from seizures and loss of consciousness',\n"," 'A seizure with muscle twitching, loss of consciousness, and inability to balance',\n"," 'Convulsive seizures with loss of consciousness and body muscle contractions',\n"," 'Loss of consciousness and seizures with involuntary movements',\n"," 'Sudden seizures with loss of consciousness and strange noises',\n"," 'Seizures that begin with bright sounds and lights and loss of consciousness',\n"," '35 years old, involuntary movements and facial spasms, with loss of the ability to communicate',\n"," 'Khaled, 20 years old, has convulsions and inability to control himself',\n"," '14 years old, body shaking with fatigue and paleness',\n"," '25 years old, falling to the ground with body shaking and strange sounds',\n"," 'Young man, 25 years old, his body shakes and does not respond, his eyes are turned down, and saliva is dripping from his mouth',\n"," 'A 10-year-old girl suffers from a seizure and loses consciousness. Saliva comes out of her mouth and her lips are blue',\n"," 'A 50-year-old man with epilepsy is unable to move, his breathing is heavy, and he falls to the ground',\n"," 'Khaled Al-Asiri, 28 years old, random movement of hands and feet with inability to remember',\n"," 'Fall with convulsions in the limbs with loss of consciousness and salivation',\n"," 'Loss of consciousness with muscle tremors and difficulty breathing',\n"," 'Falling to the ground with muscle tremors and loss of consciousness',\n"," 'Falling to the ground with abnormal movements of the hands and feet and difficulty breathing',\n"," 'Mazen has a severe cough, chest pain and difficulty breathing',\n"," 'Rami is experiencing mild chest pain with a persistent cough.',\n"," 'A person is suffering from wheezing while breathing and tightness in the chest.\\n\\n',\n"," 'A person suffering from severe cough, fatigue, and shortness of breath.',\n"," 'Khaled is suffering from chest pain, difficulty breathing, and wheezing.',\n"," 'Ahmed, 35 years old, suffers from a cough, chest pain, and wheezing during breathing',\n"," 'Suha, 14 years old, suffers from wheezing in breathing and chest pain.',\n"," 'Sami suffers from coughing and difficulty breathing.',\n"," 'informant suffers from cough, shortness of breath, and fatigue.',\n"," 'Hamid suffers from wheezing in breathing and difficulty speaking.',\n"," 'Ruba is experiencing wheezing in breathing, coughing, and fatigue.',\n"," 'The patient is suffering from chest pain and cough.',\n"," 'Samira is suffering from recurrent episodes of dry cough and chest pain.',\n"," 'old man with a high body temperature and redness on the skin.',\n"," 'Souad, 13 years old, suffers from a severe headache and dizziness with a high body temperature.',\n"," 'Abu Ibrahim, 47 years old, was exposed to the sun for a long time, which led to a rise in his body temperature, causing him to lose consciousness.',\n"," 'Abdulrahman Azhar, 33 years old, suffers from a high temperature with a headache and a rapid heartbeat.',\n"," 'A young man in his twenties, unconscious with a high temperature; his skin color is red.',\n"," 'hadi Suleiman, 21 years old, feels nauseous and has a high body temperature.',\n"," 'Said Al-Shahri, 65 years old, lost consciousness suddenly and has a rapid heartbeat.',\n"," 'Faris Al-Harbi, 39 years old, had a rise in body temperature to the point of losing consciousness.',\n"," 'Faris Al-Harbi, 39 years old, had a rise in body temperature to the point of losing consciousness.',\n"," 'Fares Al-Mutrefi, 26 years old, was exposed to the sun for a long time, resulting in a high fever and headache.',\n"," 'Ahmed, 48 years old, has been feeling dizzy and nauseous for a while, and his fever has started to rise.',\n"," 'Um Saad, 73 years old, is suffering from a severe fever; her skin is red and moist.',\n"," 'Salem, 21 years old, is experiencing a high fever and feels a strong heartbeat.',\n"," 'A girl under 17 years old, unconscious, and her skin is very hot; she needs urgent intervention.',\n"," 'Faisal Al-Subaie, 69 years old, is experiencing headache, nausea, and very high body temperature.',\n"," 'The girl is named Sarah Mohammed; she is suffering from a fever, nausea, and headache.',\n"," '55-year-old man is experiencing a high fever, dizziness, and fatigue.',\n"," 'A man suffering from exhaustion, facial redness, and strong headaches.',\n"," 'Ahmed Al-Ghamdi, 25 years old, suffers from dizziness and headache, along with redness and peeling of the skin',\n"," 'Fahd Al-Qahtani, 30 years old, suffers from nausea, dizziness and high temperature',\n"," 'Laila Al-Saadi, 22 years old, suffers from headaches, lack of concentration, and itchy, dry skin',\n"," 'Hamed, 40 years old, suffers from headache, dizziness, and red and swollen feet',\n"," 'A person experiences headache, dizziness, and fatigue with hot skin and a weak pulse',\n"," 'Khaled, 35 years old, suffers from headache, dizziness, and fatigue, along with dry, hot skin, and a weak pulse',\n"," 'A woman suffers from dizziness, headache, and fatigue with hot skin and a weak pulse',\n"," 'Majed, 50 years old, suffers from headache, dizziness, and an altered level of consciousness, with a weak pulse',\n"," 'A person approximately 60 years old suffers from headache, dizziness, and fatigue with dry, hot skin',\n"," 'Souad, 45 years old, suffers from headaches, dizziness, and fatigue, along with clammy, hot skin, and a weak pulse',\n"," 'A young man, approximately 20 years old, suffers from dizziness, headache, and fatigue, with hot skin and a weak pulse',\n"," 'Hassan Al-Jaber suffers from headache, dizziness, and an altered level of consciousness, with dry, hot skin, and a weak pulse',\n"," 'An elderly woman suffers from dizziness, headache, hot skin, and a weak pulse',\n"," 'Ahmed, 30 years old, suffers from headache, dizziness, and fatigue, along with hot skin and a weak pulse',\n"," 'A man suffering from severe thirst, fatigue, and difficulty concentrating.',\n"," 'An old woman suffering from shortness of breath, exhaustion, and blurred vision.',\n"," 'A man suffering from persistent fatigue, frequent urination, and exhaustion.',\n"," 'A person suffering from exhaustion, headaches, and blurred vision.',\n"," 'An elderly man suffering from dry mouth, constant thirst, and severe fatigue.',\n"," 'A young man suffering from pallor, severe dizziness, and trembling.',\n"," 'A woman suffering from recurrent dizziness, cold sweating, and loss of balance.',\n"," 'A person suffering from general weakness and difficulty standing.',\n"," 'A woman suffering from exhaustion, difficulty speaking, and trembling in the hands.',\n"," 'A man suffering from severe dizziness and inability to stand.',\n"," 'Ahmed Al-Khalidi suffers from blurry vision, headache, and dry mouth. He is forty years old',\n"," '60 years old, extreme fatigue, heavy breathing, and constant thirst',\n"," 'Pale face with fatigue, thirst and difficulty breathing',\n"," 'Muhammad, 22 years old, fatigue, difficulty breathing, pale face, and constant thirst',\n"," 'Severe tremors and paleness of the face with a fruity breath odor',\n"," 'Salem, 14 years old, excessive sweating, pale face, and inability to stand',\n"," 'Badriya Al-Shahri, 42 years old, suffers from dizziness, dry mouth, and lethargy.',\n"," 'Khaled Al-Harthi, 49 years old, has a fever, nausea and fatigue.',\n"," 'Salma Al-Asiri, 38 years old, has tremors in her hands, headache, dry mouth, and lethargy.',\n"," 'Ali Al-Shahrani, 48 years old, feels numbness in his feet, headache, lethargy, and a feeling of hunger.',\n"," 'Nasser Al-Otaibi, 47 years old, feels burning in the eyes, lethargy and dry mouth',\n"," 'Sarah Muhammad suffers from tremors, sweating, and a rapid heartbeat. She is 60 years old',\n"," 'A 20-year-old diabetic patient has tremors, sweats a lot, does not respond, her eyes are closed, and she has not eaten well',\n"," 'Ahmed suffers from severe dizziness, fatigue, severe sweating, and blurry vision',\n"," 'He suffers from body tremors, blurry vision and fatigue',\n"," 'A 16-year-old woman suffers from tremors, dizziness, severe sweating, and paleness',\n"," 'A 60-year-old man suffers from paleness, tremors, inability to speak, and dizziness',\n"," 'He suffers from pale face, dizziness, and blurred vision',\n"," 'Noura Abdullah, 32 years old, suffers from fatigue, dizziness, sweating, nausea, high heart rate, and fever.',\n"," 'A street worker is very tired, sweating, and unresponsive',\n"," 'A 12-year-old girl fell due to severe dizziness',\n"," 'Ahmed Al-Mutairi, 27 years old, severe fatigue with sweating, headache and body heat',\n"," 'Dizziness with sweating, fever and inability to move',\n"," 'Fatigue with body heat and profuse sweating',\n"," 'A person who has fainted is sweating profusely and has a weak heartbeat.',\n"," 'Muhammad Al-Hazmi, 18 years old, suffers from nosebleeds, dizziness, confusion, and mild headache',\n"," 'A young man was bleeding from his nose and the bleeding did not stop, his features were pale and dizzy',\n"," 'A young man has a nosebleed that does not stop and dizziness',\n"," 'A 15-year-old girl feels dizzy, dizzy, and unable to stand, with her lips turning blue and nausea',\n"," 'A 5-year-old child has not drunk water for a day and cries without tears',\n"," 'A young man became dehydrated in the sun and fell to the ground',\n"," 'Sarah suffers from fatigue, dizziness, extreme thirst, and rapid breathing',\n"," 'Khaled Al Zahrani, 29 years old, fatigue with dry lips and dizziness',\n"," 'Khaled Al Zahrani, 29 years old, inability to stand with headache and dryness',\n"," 'Dry skin and lips with constant dizziness and fatigue',\n"," 'Inability to speak with fatigue and cracked lips',\n"," 'Muhammad Al-Maliki, 38 years old, severe dehydration, inability to stand, and headache',\n"," 'Mahmoud Al-Salami, 17 years old. After eating, he felt severe pain in his abdomen, and he vomited three times, feeling dizziness and tingling in his skin',\n"," 'Rashid Abdel Samad, 16 years old, ate a meal and then felt cramps, vomiting, and dizziness',\n"," 'A 10-year-old child vomits, diarrhea, paleness, and abdominal pain after eating a meal',\n"," 'A 4-year-old child drank juice and had severe diarrhea and high fever',\n"," 'Mai Al-Abdeli, 20 years old, has abdominal pain, dizziness and vomiting.',\n"," 'Rana Ahmed, 29 years old, suffers from headache, stomach pain and vomiting.',\n"," 'Khaled Radhi, 36 years old, suffers from colic and frequent vomiting.',\n"," 'Fatima Ayman suffers from body temperature, dry mouth, stomach pain, vomiting and dizziness.',\n"," 'Hassan suffers from headache, stomach pain, frequent vomiting and lethargy.']"]},"metadata":{},"execution_count":11}],"source":["doc_X"]},{"cell_type":"code","execution_count":12,"id":"950f0391","metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"950f0391","executionInfo":{"status":"ok","timestamp":1735377678703,"user_tz":-180,"elapsed":415,"user":{"displayName":"Yasmeen Mohammad","userId":"07702318889052952256"}},"outputId":"c37076e6-813a-4e56-be4a-9127ce6a7db4"},"outputs":[{"output_type":"execute_result","data":{"text/plain":["['Epilepsy',\n"," 'Epilepsy',\n"," 'Epilepsy',\n"," 'Epilepsy',\n"," 'Epilepsy',\n"," 'Epilepsy',\n"," 'Epilepsy',\n"," 'Epilepsy',\n"," 'Epilepsy',\n"," 'Epilepsy',\n"," 'Epilepsy',\n"," 'Epilepsy',\n"," 'Epilepsy',\n"," 'Epilepsy',\n"," 'Epilepsy',\n"," 'Epilepsy',\n"," 'Epilepsy',\n"," 'Epilepsy',\n"," 'Epilepsy',\n"," 'Epilepsy',\n"," 'Epilepsy',\n"," 'Epilepsy',\n"," 'Epilepsy',\n"," 'Epilepsy',\n"," 'Epilepsy',\n"," 'Epilepsy',\n"," 'Epilepsy',\n"," 'Epilepsy',\n"," 'Epilepsy',\n"," 'Asthma',\n"," 'Asthma',\n"," 'Asthma',\n"," 'Asthma',\n"," 'Asthma',\n"," 'Asthma',\n"," 'Asthma',\n"," 'Asthma',\n"," 'Asthma',\n"," 'Asthma',\n"," 'Asthma',\n"," 'Asthma',\n"," 'Asthma',\n"," 'Heatstroke',\n"," 'Heatstroke',\n"," 'Heatstroke',\n"," 'Heatstroke',\n"," 'Heatstroke',\n"," 'Heatstroke',\n"," 'Heatstroke',\n"," 'Heatstroke',\n"," 'Heatstroke',\n"," 'Heatstroke',\n"," 'Heatstroke',\n"," 'Heatstroke',\n"," 'Heatstroke',\n"," 'Heatstroke',\n"," 'Heatstroke',\n"," 'Heatstroke',\n"," 'Heatstroke',\n"," 'Heatstroke',\n"," 'Heatstroke',\n"," 'Heatstroke',\n"," 'Heatstroke',\n"," 'Heatstroke',\n"," 'Heatstroke',\n"," 'Heatstroke',\n"," 'Heatstroke',\n"," 'Heatstroke',\n"," 'Heatstroke',\n"," 'Heatstroke',\n"," 'Heatstroke',\n"," 'Heatstroke',\n"," 'Heatstroke',\n"," 'Heatstroke',\n"," 'Hyperglycemia High Blood Sugar',\n"," 'Hyperglycemia High Blood Sugar',\n"," 'Hyperglycemia High Blood Sugar',\n"," 'Hyperglycemia High Blood Sugar',\n"," 'Hyperglycemia High Blood Sugar',\n"," 'Hyperglycemia High Blood Sugar',\n"," 'Hyperglycemia High Blood Sugar',\n"," 'Hyperglycemia High Blood Sugar',\n"," 'Hyperglycemia High Blood Sugar',\n"," 'Hyperglycemia High Blood Sugar',\n"," 'Hyperglycemia High Blood Sugar',\n"," 'Hyperglycemia High Blood Sugar',\n"," 'Hyperglycemia High Blood Sugar',\n"," 'Hyperglycemia High Blood Sugar',\n"," 'Hyperglycemia High Blood Sugar',\n"," 'Hyperglycemia High Blood Sugar',\n"," 'Hyperglycemia High Blood Sugar',\n"," 'Hyperglycemia High Blood Sugar',\n"," 'Hyperglycemia High Blood Sugar',\n"," 'Hyperglycemia High Blood Sugar',\n"," 'Hyperglycemia High Blood Sugar',\n"," 'Hypoglycemia Low Blood Sugar',\n"," 'Hypoglycemia Low Blood Sugar',\n"," 'Hypoglycemia Low Blood Sugar',\n"," 'Hypoglycemia Low Blood Sugar',\n"," 'Hypoglycemia Low Blood Sugar',\n"," 'Hypoglycemia Low Blood Sugar',\n"," 'Hypoglycemia Low Blood Sugar',\n"," 'Heat Exhaustion',\n"," 'Heat Exhaustion',\n"," 'Heat Exhaustion',\n"," 'Heat Exhaustion',\n"," 'Heat Exhaustion',\n"," 'Heat Exhaustion',\n"," 'Heat Exhaustion',\n"," 'Nosebleed',\n"," 'Nosebleed',\n"," 'Nosebleed',\n"," 'Dehydration',\n"," 'Dehydration',\n"," 'Dehydration',\n"," 'Dehydration',\n"," 'Dehydration',\n"," 'Dehydration',\n"," 'Dehydration',\n"," 'Dehydration',\n"," 'Dehydration',\n"," 'Food Poisoning',\n"," 'Food Poisoning',\n"," 'Food Poisoning',\n"," 'Food Poisoning',\n"," 'Food Poisoning',\n"," 'Food Poisoning',\n"," 'Food Poisoning',\n"," 'Food Poisoning',\n"," 'Food Poisoning']"]},"metadata":{},"execution_count":12}],"source":["doc_y"]},{"cell_type":"code","execution_count":13,"id":"1f1ce326","metadata":{"id":"1f1ce326","executionInfo":{"status":"ok","timestamp":1735377683755,"user_tz":-180,"elapsed":3,"user":{"displayName":"Yasmeen Mohammad","userId":"07702318889052952256"}}},"outputs":[],"source":["import random\n","import numpy as np\n","\n","X = []\n","\n","y= []\n","\n","for idx, doc in enumerate(doc_X):\n"," bow = []\n","\n"," doc = lemmatizer.lemmatize(doc.lower())\n","\n"," for word in vocab:\n"," bow.append(1) if word in doc else bow.append(0)\n","\n"," X.append(bow)\n","\n"," output_row = [0] * len(classes)\n","\n"," cl = doc_y[idx]\n","\n"," cl_index= classes.index(cl)\n"," output_row[cl_index] = 1\n","\n"," y.append(output_row)"]},{"cell_type":"code","execution_count":14,"id":"e14ed744","metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"e14ed744","executionInfo":{"status":"ok","timestamp":1735377687454,"user_tz":-180,"elapsed":7,"user":{"displayName":"Yasmeen Mohammad","userId":"07702318889052952256"}},"outputId":"74358f47-b07c-4e04-d750-2ac22e019622"},"outputs":[{"output_type":"stream","name":"stdout","text":["A seizure with muscle twitching, loss of consciousness, and inability to balance\n","[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\n"]}],"source":["print(doc_X[12])\n","print(X[12])"]},{"cell_type":"code","execution_count":15,"id":"fc6d29b5","metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"fc6d29b5","executionInfo":{"status":"ok","timestamp":1735377695147,"user_tz":-180,"elapsed":403,"user":{"displayName":"Yasmeen Mohammad","userId":"07702318889052952256"}},"outputId":"e3a1db58-bd3c-4302-e9c9-d7efa50323aa"},"outputs":[{"output_type":"stream","name":"stdout","text":["Epilepsy\n","[0, 0, 1, 0, 0, 0, 0, 0, 0]\n"]}],"source":["print(doc_y[12])\n","print(y[12])"]},{"cell_type":"code","execution_count":16,"id":"8bba716c","metadata":{"id":"8bba716c","executionInfo":{"status":"ok","timestamp":1735377700811,"user_tz":-180,"elapsed":3485,"user":{"displayName":"Yasmeen Mohammad","userId":"07702318889052952256"}}},"outputs":[],"source":["from keras import Sequential\n","from keras.layers import Input, Dense, Dropout\n","\n","input_shape = (len(X[0]),)\n","\n","output_shape = len(y[0])\n","\n","model = Sequential()\n","model.add(Input(shape=input_shape))\n","model.add(Dense(128, activation=\"relu\"))\n","model.add(Dropout(0.5))\n","model.add(Dense(64, activation=\"relu\"))\n","model.add(Dropout(0.3))\n","model.add(Dense(output_shape, activation = \"softmax\"))"]},{"cell_type":"code","execution_count":17,"id":"49e74eb7","metadata":{"id":"49e74eb7","executionInfo":{"status":"ok","timestamp":1735377706939,"user_tz":-180,"elapsed":402,"user":{"displayName":"Yasmeen Mohammad","userId":"07702318889052952256"}}},"outputs":[],"source":["model.compile(loss='categorical_crossentropy',\n"," optimizer='adam',\n"," metrics=[\"accuracy\"])"]},{"cell_type":"code","execution_count":22,"id":"ef0a8768","metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"ef0a8768","executionInfo":{"status":"ok","timestamp":1735377857022,"user_tz":-180,"elapsed":15540,"user":{"displayName":"Yasmeen Mohammad","userId":"07702318889052952256"}},"outputId":"cc6b0d06-a688-45a4-a16f-87934a21abee"},"outputs":[{"output_type":"stream","name":"stdout","text":["Epoch 1/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m3s\u001b[0m 6ms/step - accuracy: 0.1775 - loss: 2.1727\n","Epoch 2/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 0.2505 - loss: 2.0919 \n","Epoch 3/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 0.2979 - loss: 2.0003 \n","Epoch 4/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 0.3589 - loss: 1.9104 \n","Epoch 5/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 0.3913 - loss: 1.8468 \n","Epoch 6/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 0.4728 - loss: 1.7484 \n","Epoch 7/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 0.4461 - loss: 1.7304 \n","Epoch 8/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 0.4418 - loss: 1.5968 \n","Epoch 9/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 0.4646 - loss: 1.5445 \n","Epoch 10/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 0.5164 - loss: 1.4733 \n","Epoch 11/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 0.5330 - loss: 1.3836 \n","Epoch 12/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 0.5084 - loss: 1.4526 \n","Epoch 13/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 0.5071 - loss: 1.3605 \n","Epoch 14/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 0.5564 - loss: 1.3109 \n","Epoch 15/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 0.6192 - loss: 1.2332 \n","Epoch 16/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 0.6355 - loss: 1.1315 \n","Epoch 17/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 0.6181 - loss: 1.1256 \n","Epoch 18/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 0.6488 - loss: 1.0955 \n","Epoch 19/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 0.6973 - loss: 1.0387 \n","Epoch 20/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 0.7433 - loss: 0.9729 \n","Epoch 21/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 0.7552 - loss: 0.8370 \n","Epoch 22/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 0.7953 - loss: 0.8498 \n","Epoch 23/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 0.8012 - loss: 0.7906 \n","Epoch 24/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 0.8161 - loss: 0.6974 \n","Epoch 25/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 0.8648 - loss: 0.6334 \n","Epoch 26/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 0.8917 - loss: 0.5916 \n","Epoch 27/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 0.8700 - loss: 0.5715 \n","Epoch 28/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 5ms/step - accuracy: 0.8786 - loss: 0.5723 \n","Epoch 29/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 0.9189 - loss: 0.4908 \n","Epoch 30/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 0.9080 - loss: 0.4142 \n","Epoch 31/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 0.9184 - loss: 0.4441 \n","Epoch 32/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 0.9690 - loss: 0.3662 \n","Epoch 33/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 0.9495 - loss: 0.3316 \n","Epoch 34/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 0.9275 - loss: 0.3832 \n","Epoch 35/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 0.9650 - loss: 0.3303 \n","Epoch 36/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 0.9728 - loss: 0.3154 \n","Epoch 37/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 0.9918 - loss: 0.2808 \n","Epoch 38/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 0.9659 - loss: 0.2853 \n","Epoch 39/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 0.9555 - loss: 0.2385 \n","Epoch 40/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 0.9754 - loss: 0.2596 \n","Epoch 41/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 0.9689 - loss: 0.2215 \n","Epoch 42/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 0.9706 - loss: 0.2254 \n","Epoch 43/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 0.9741 - loss: 0.1766 \n","Epoch 44/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 0.9862 - loss: 0.1936 \n","Epoch 45/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 0.9784 - loss: 0.1762 \n","Epoch 46/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 1.0000 - loss: 0.1450 \n","Epoch 47/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 1.0000 - loss: 0.1628 \n","Epoch 48/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 0.9918 - loss: 0.1409 \n","Epoch 49/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 5ms/step - accuracy: 0.9728 - loss: 0.1981 \n","Epoch 50/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 0.9754 - loss: 0.1521 \n","Epoch 51/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 0.9693 - loss: 0.1723 \n","Epoch 52/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 0.9918 - loss: 0.1240 \n","Epoch 53/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 0.9827 - loss: 0.1200 \n","Epoch 54/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 0.9784 - loss: 0.1184 \n","Epoch 55/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 0.9862 - loss: 0.1015 \n","Epoch 56/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 0.9879 - loss: 0.1127 \n","Epoch 57/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 0.9732 - loss: 0.1159 \n","Epoch 58/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 0.9866 - loss: 0.0987 \n","Epoch 59/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 0.9918 - loss: 0.0924 \n","Epoch 60/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 0.9923 - loss: 0.1099 \n","Epoch 61/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 0.9797 - loss: 0.0947 \n","Epoch 62/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 0.9961 - loss: 0.0741 \n","Epoch 63/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 0.9862 - loss: 0.0788 \n","Epoch 64/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 0.9598 - loss: 0.0893 \n","Epoch 65/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 1.0000 - loss: 0.0611 \n","Epoch 66/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 1.0000 - loss: 0.0574 \n","Epoch 67/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 1.0000 - loss: 0.0532 \n","Epoch 68/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 5ms/step - accuracy: 1.0000 - loss: 0.0527 \n","Epoch 69/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 0.9866 - loss: 0.0659 \n","Epoch 70/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 0.9944 - loss: 0.0501 \n","Epoch 71/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 0.9918 - loss: 0.0418 \n","Epoch 72/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 1.0000 - loss: 0.0553 \n","Epoch 73/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 1.0000 - loss: 0.0477 \n","Epoch 74/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 0.9961 - loss: 0.0384 \n","Epoch 75/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 5ms/step - accuracy: 1.0000 - loss: 0.0683 \n","Epoch 76/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 1.0000 - loss: 0.0429 \n","Epoch 77/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 1.0000 - loss: 0.0596 \n","Epoch 78/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 0.9918 - loss: 0.0329 \n","Epoch 79/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 0.9918 - loss: 0.0599 \n","Epoch 80/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 1.0000 - loss: 0.0474 \n","Epoch 81/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 0.9732 - loss: 0.0751 \n","Epoch 82/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 1.0000 - loss: 0.0402 \n","Epoch 83/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 0.9944 - loss: 0.0495 \n","Epoch 84/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 0.9961 - loss: 0.0573 \n","Epoch 85/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 5ms/step - accuracy: 0.9918 - loss: 0.0480 \n","Epoch 86/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 1.0000 - loss: 0.0327 \n","Epoch 87/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 1.0000 - loss: 0.0496 \n","Epoch 88/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 0.9923 - loss: 0.0543 \n","Epoch 89/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 0.9866 - loss: 0.0652 \n","Epoch 90/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 0.9732 - loss: 0.0653 \n","Epoch 91/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 5ms/step - accuracy: 1.0000 - loss: 0.0293 \n","Epoch 92/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 5ms/step - accuracy: 0.9879 - loss: 0.0328 \n","Epoch 93/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 1.0000 - loss: 0.0294 \n","Epoch 94/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 1.0000 - loss: 0.0199 \n","Epoch 95/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 1.0000 - loss: 0.0338 \n","Epoch 96/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 1.0000 - loss: 0.0245 \n","Epoch 97/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 1.0000 - loss: 0.0278 \n","Epoch 98/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 5ms/step - accuracy: 1.0000 - loss: 0.0206 \n","Epoch 99/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 0.9918 - loss: 0.0427 \n","Epoch 100/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 5ms/step - accuracy: 1.0000 - loss: 0.0275 \n","Epoch 101/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 1.0000 - loss: 0.0231 \n","Epoch 102/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 5ms/step - accuracy: 1.0000 - loss: 0.0269 \n","Epoch 103/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 1.0000 - loss: 0.0318 \n","Epoch 104/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 1.0000 - loss: 0.0151 \n","Epoch 105/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 0.9918 - loss: 0.0356 \n","Epoch 106/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 0.9866 - loss: 0.0386 \n","Epoch 107/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 5ms/step - accuracy: 1.0000 - loss: 0.0265 \n","Epoch 108/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 6ms/step - accuracy: 1.0000 - loss: 0.0228 \n","Epoch 109/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 0.9961 - loss: 0.0382 \n","Epoch 110/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 0.9944 - loss: 0.0296 \n","Epoch 111/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 7ms/step - accuracy: 0.9961 - loss: 0.0269 \n","Epoch 112/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 5ms/step - accuracy: 1.0000 - loss: 0.0235 \n","Epoch 113/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 5ms/step - accuracy: 1.0000 - loss: 0.0173 \n","Epoch 114/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 5ms/step - accuracy: 1.0000 - loss: 0.0076 \n","Epoch 115/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 5ms/step - accuracy: 1.0000 - loss: 0.0395 \n","Epoch 116/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 6ms/step - accuracy: 0.9810 - loss: 0.0374 \n","Epoch 117/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 1.0000 - loss: 0.0195 \n","Epoch 118/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 1.0000 - loss: 0.0156 \n","Epoch 119/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 6ms/step - accuracy: 1.0000 - loss: 0.0183 \n","Epoch 120/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 5ms/step - accuracy: 1.0000 - loss: 0.0164 \n","Epoch 121/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 5ms/step - accuracy: 1.0000 - loss: 0.0253 \n","Epoch 122/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 5ms/step - accuracy: 1.0000 - loss: 0.0249 \n","Epoch 123/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 8ms/step - accuracy: 1.0000 - loss: 0.0137 \n","Epoch 124/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 5ms/step - accuracy: 1.0000 - loss: 0.0160 \n","Epoch 125/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 5ms/step - accuracy: 1.0000 - loss: 0.0153 \n","Epoch 126/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 5ms/step - accuracy: 1.0000 - loss: 0.0095 \n","Epoch 127/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 1.0000 - loss: 0.0144 \n","Epoch 128/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 1.0000 - loss: 0.0128 \n","Epoch 129/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 0.9905 - loss: 0.0259 \n","Epoch 130/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 1.0000 - loss: 0.0218 \n","Epoch 131/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 1.0000 - loss: 0.0117 \n","Epoch 132/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 1.0000 - loss: 0.0138 \n","Epoch 133/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 1.0000 - loss: 0.0130 \n","Epoch 134/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 1.0000 - loss: 0.0127 \n","Epoch 135/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 1.0000 - loss: 0.0123 \n","Epoch 136/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 1.0000 - loss: 0.0243 \n","Epoch 137/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 1.0000 - loss: 0.0119 \n","Epoch 138/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 1.0000 - loss: 0.0182 \n","Epoch 139/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 1.0000 - loss: 0.0147 \n","Epoch 140/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 5ms/step - accuracy: 0.9918 - loss: 0.0152 \n","Epoch 141/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 1.0000 - loss: 0.0091 \n","Epoch 142/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 1.0000 - loss: 0.0102 \n","Epoch 143/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 1.0000 - loss: 0.0133 \n","Epoch 144/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 1.0000 - loss: 0.0144 \n","Epoch 145/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 1.0000 - loss: 0.0114 \n","Epoch 146/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 1.0000 - loss: 0.0158 \n","Epoch 147/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 1.0000 - loss: 0.0211 \n","Epoch 148/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 1.0000 - loss: 0.0101 \n","Epoch 149/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 1.0000 - loss: 0.0161 \n","Epoch 150/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 1.0000 - loss: 0.0087 \n","Epoch 151/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 1.0000 - loss: 0.0099 \n","Epoch 152/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 0.9944 - loss: 0.0196 \n","Epoch 153/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 1.0000 - loss: 0.0183 \n","Epoch 154/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 0.9879 - loss: 0.0198 \n","Epoch 155/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 1.0000 - loss: 0.0253 \n","Epoch 156/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 5ms/step - accuracy: 1.0000 - loss: 0.0199 \n","Epoch 157/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 1.0000 - loss: 0.0161 \n","Epoch 158/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 1.0000 - loss: 0.0114 \n","Epoch 159/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 0.9944 - loss: 0.0111 \n","Epoch 160/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 1.0000 - loss: 0.0176 \n","Epoch 161/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 1.0000 - loss: 0.0290 \n","Epoch 162/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 1.0000 - loss: 0.0158 \n","Epoch 163/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 1.0000 - loss: 0.0111 \n","Epoch 164/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 1.0000 - loss: 0.0104 \n","Epoch 165/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 1.0000 - loss: 0.0084 \n","Epoch 166/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 1.0000 - loss: 0.0164 \n","Epoch 167/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 1.0000 - loss: 0.0035 \n","Epoch 168/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 1.0000 - loss: 0.0079 \n","Epoch 169/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 1.0000 - loss: 0.0088 \n","Epoch 170/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 1.0000 - loss: 0.0058 \n","Epoch 171/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 1.0000 - loss: 0.0083 \n","Epoch 172/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 1.0000 - loss: 0.0087 \n","Epoch 173/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 1.0000 - loss: 0.0077 \n","Epoch 174/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 5ms/step - accuracy: 0.9974 - loss: 0.0148 \n","Epoch 175/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 1.0000 - loss: 0.0068 \n","Epoch 176/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 1.0000 - loss: 0.0127 \n","Epoch 177/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 1.0000 - loss: 0.0106 \n","Epoch 178/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 1.0000 - loss: 0.0155 \n","Epoch 179/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 1.0000 - loss: 0.0096 \n","Epoch 180/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 1.0000 - loss: 0.0128 \n","Epoch 181/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 1.0000 - loss: 0.0130 \n","Epoch 182/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 0.9866 - loss: 0.0277 \n","Epoch 183/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 1.0000 - loss: 0.0152 \n","Epoch 184/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 1.0000 - loss: 0.0044 \n","Epoch 185/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 1.0000 - loss: 0.0075 \n","Epoch 186/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 5ms/step - accuracy: 0.9944 - loss: 0.0265 \n","Epoch 187/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 1.0000 - loss: 0.0053 \n","Epoch 188/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 1.0000 - loss: 0.0110 \n","Epoch 189/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 1.0000 - loss: 0.0110 \n","Epoch 190/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 5ms/step - accuracy: 1.0000 - loss: 0.0110 \n","Epoch 191/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 5ms/step - accuracy: 1.0000 - loss: 0.0059 \n","Epoch 192/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 1.0000 - loss: 0.0045 \n","Epoch 193/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 1.0000 - loss: 0.0121 \n","Epoch 194/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 5ms/step - accuracy: 1.0000 - loss: 0.0075 \n","Epoch 195/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 1.0000 - loss: 0.0067 \n","Epoch 196/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 1.0000 - loss: 0.0076 \n","Epoch 197/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 1.0000 - loss: 0.0128 \n","Epoch 198/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 1.0000 - loss: 0.0126 \n","Epoch 199/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 3ms/step - accuracy: 1.0000 - loss: 0.0060 \n","Epoch 200/200\n","\u001b[1m5/5\u001b[0m \u001b[32mββββββββββββββββββββ\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - accuracy: 1.0000 - loss: 0.0068 \n"]},{"output_type":"execute_result","data":{"text/plain":["<keras.src.callbacks.history.History at 0x78a3ba25a560>"]},"metadata":{},"execution_count":22}],"source":["import numpy as np\n","\n","# Before calling model.fit, convert X and y to NumPy arrays:\n","X = np.array(X)\n","y = np.array(y)\n","\n","model.fit(X, y, epochs=200)"]},{"cell_type":"code","execution_count":23,"id":"30789863","metadata":{"id":"30789863","executionInfo":{"status":"ok","timestamp":1735377868517,"user_tz":-180,"elapsed":450,"user":{"displayName":"Yasmeen Mohammad","userId":"07702318889052952256"}}},"outputs":[],"source":["model.save('chatbot_model.keras')\n","\n","import pickle\n","\n","vocab_path = 'chatbot_vocab'\n","with open(vocab_path, 'wb') as file:\n"," pickle.dump(vocab, file)\n","\n","classes_path = 'chatbot_classes'\n","with open(classes_path, 'wb') as file:\n"," pickle.dump(classes, file)"]},{"cell_type":"code","execution_count":29,"id":"7af81c4e","metadata":{"id":"7af81c4e","executionInfo":{"status":"ok","timestamp":1735378079918,"user_tz":-180,"elapsed":399,"user":{"displayName":"Yasmeen Mohammad","userId":"07702318889052952256"}}},"outputs":[],"source":["import nltk\n","\n","def clean_text(text):\n","\n"," tokens = nltk.word_tokenize(text)\n"," tokens = [lemmatizer.lemmatize(word) for word in tokens ]\n","\n"," stop_words = stopwords.words('english')\n","\n"," tokens = [word for word in tokens if word not in stop_words]\n","\n"," return tokens\n","\n","\n","def bag_of_words(text, vocab):\n","\n"," tokens = clean_text(text)\n"," bow = [0] * len(vocab)\n"," for w in tokens:\n"," for idx, word in enumerate(vocab):\n"," if word == w:\n"," bow[idx] = 1\n"," return bow\n","\n","def pred_class(text, model, vocab, classes):\n","\n"," bow = bag_of_words(text, vocab)\n"," #predictions = model.predict([bow], verbose=0)[0]#\n"," # Convert bow to a NumPy array before prediction\n"," predictions = model.predict(np.array([bow]), verbose=0)[0]\n"," max_index=np.argmax(predictions)\n","\n"," return classes[max_index]\n","\n","def get_response(pred_cl, intents_json):\n"," list_of_intents = intents_json[\"intents\"]\n"," for x in list_of_intents:\n"," if x[\"class\"] == pred_cl:\n"," result = random.choice(x[\"responses\"])\n"," break\n"," return result"]},{"cell_type":"code","execution_count":30,"id":"16c203c0","metadata":{"id":"16c203c0","executionInfo":{"status":"ok","timestamp":1735378082911,"user_tz":-180,"elapsed":399,"user":{"displayName":"Yasmeen Mohammad","userId":"07702318889052952256"}}},"outputs":[],"source":["import json\n","\n","from keras.models import load_model\n","import pickle\n","\n","def chatbot(intents_path, model_path, vocab_path, classes_path):\n"," with open(intents_path) as file:\n"," data = json.load(file)\n","\n"," model = load_model(model_path)\n","\n"," with open(vocab_path, 'rb') as file:\n"," vocab = pickle.load(file)\n","\n"," with open(classes_path, 'rb') as file:\n"," classes = pickle.load(file)\n","\n"," message = input(\"\")\n"," while len(message)>0:\n"," message= message.lower()\n"," pred_cl = pred_class(message, model, vocab, classes)\n"," result = get_response(pred_cl, data)\n"," print(result)\n"," message = input(\"\")"]},{"cell_type":"code","execution_count":31,"id":"46be5eda","metadata":{"colab":{"base_uri":"https://localhost:8080/","height":617},"id":"46be5eda","executionInfo":{"status":"error","timestamp":1735378659047,"user_tz":-180,"elapsed":573974,"user":{"displayName":"Yasmeen Mohammad","userId":"07702318889052952256"}},"outputId":"183b8ed2-01d6-4685-f984-f5e6d40a84d9"},"outputs":[{"output_type":"stream","name":"stdout","text":["old man with a high body temperature and redness on the skin.\n","Offer water slowly to hydrate them if they are conscious.\n","hi\n","Protect them by removing hard or sharp objects around.\n","high heat \n","Take the person to a cool, shaded, or air-conditioned area.\n","a person need help\n","Assist them in using their prescribed inhaler promptly.\n","My stomach hurts\n","Avoid forcing food or drink if they are not ready to consume it.\n","A child has a fever and vomiting\n","Avoid forcing food or drink if they are not ready to consume it.\n","Avoid forcing food or drink if they are not ready to consume it.\n","Do not restrain their movements or try to open their mouth by force.\n","A child has a fever and vomiting\n","Give small sips of water to keep them hydrated.\n","A child has a fever and vomiting\n","Avoid forcing food or drink if they are not ready to consume it.\n"]},{"output_type":"error","ename":"KeyboardInterrupt","evalue":"Interrupted by user","traceback":["\u001b[0;31m---------------------------------------------------------------------------\u001b[0m","\u001b[0;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)","\u001b[0;32m<ipython-input-31-de5943f05fce>\u001b[0m in \u001b[0;36m<cell line: 1>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mchatbot\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'intents.json'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m'chatbot_model.keras'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m'chatbot_vocab'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m'chatbot_classes'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m","\u001b[0;32m<ipython-input-30-4f10c4a42307>\u001b[0m in \u001b[0;36mchatbot\u001b[0;34m(intents_path, model_path, vocab_path, classes_path)\u001b[0m\n\u001b[1;32m 22\u001b[0m \u001b[0mresult\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mget_response\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mpred_cl\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdata\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 23\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mresult\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 24\u001b[0;31m \u001b[0mmessage\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0minput\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m","\u001b[0;32m/usr/local/lib/python3.10/dist-packages/ipykernel/kernelbase.py\u001b[0m in \u001b[0;36mraw_input\u001b[0;34m(self, prompt)\u001b[0m\n\u001b[1;32m 849\u001b[0m \u001b[0;34m\"raw_input was called, but this frontend does not support input requests.\"\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 850\u001b[0m )\n\u001b[0;32m--> 851\u001b[0;31m return self._input_request(str(prompt),\n\u001b[0m\u001b[1;32m 852\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_parent_ident\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 853\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_parent_header\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n","\u001b[0;32m/usr/local/lib/python3.10/dist-packages/ipykernel/kernelbase.py\u001b[0m in \u001b[0;36m_input_request\u001b[0;34m(self, prompt, ident, parent, password)\u001b[0m\n\u001b[1;32m 893\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mKeyboardInterrupt\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 894\u001b[0m \u001b[0;31m# re-raise KeyboardInterrupt, to truncate traceback\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 895\u001b[0;31m \u001b[0;32mraise\u001b[0m \u001b[0mKeyboardInterrupt\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"Interrupted by user\"\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mfrom\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 896\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mException\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0me\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 897\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mlog\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mwarning\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"Invalid Message:\"\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mexc_info\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mTrue\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n","\u001b[0;31mKeyboardInterrupt\u001b[0m: Interrupted by user"]}],"source":["chatbot('intents.json', 'chatbot_model.keras', 'chatbot_vocab', 'chatbot_classes')"]}],"metadata":{"kernelspec":{"display_name":"Python 3 (ipykernel)","language":"python","name":"python3"},"language_info":{"codemirror_mode":{"name":"ipython","version":3},"file_extension":".py","mimetype":"text/x-python","name":"python","nbconvert_exporter":"python","pygments_lexer":"ipython3","version":"3.11.5"},"colab":{"provenance":[]}},"nbformat":4,"nbformat_minor":5} |