{
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "gatm9nDSapqw"
      },
      "source": [
        "# ***Setup***"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 1,
      "metadata": {
        "id": "qk6uYaReapqy"
      },
      "outputs": [],
      "source": [
        "import matplotlib.pyplot as plt\n",
        "import numpy as np\n",
        "\n",
        "from nltk.tokenize import word_tokenize\n",
        "from nltk.stem import WordNetLemmatizer\n",
        "from nltk import pos_tag\n",
        "from nltk.corpus import stopwords\n",
        "\n",
        "import spacy\n",
        "\n",
        "import stanza\n",
        "\n",
        "from sklearn.feature_extraction.text import TfidfVectorizer\n",
        "from sklearn.feature_selection import SelectKBest, chi2, f_classif\n",
        "\n",
        "from sklearn.naive_bayes import MultinomialNB\n",
        "from sklearn.metrics import accuracy_score, classification_report\n",
        "\n",
        "from tabulate import tabulate\n",
        "\n",
        "import pandas as pd"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 2,
      "metadata": {},
      "outputs": [],
      "source": [
        "import sys\n",
        "import os\n",
        "parent_dir = os.path.abspath('..')\n",
        "sys.path.append(parent_dir)\n",
        "from constants import CONSTANTS\n",
        "%load_ext autoreload\n",
        "%autoreload 2"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "zNmpwOj8apq1"
      },
      "source": [
        "**Download necessary resources**  \n",
        "**Uncomment if you haven't already**"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 3,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 154,
          "referenced_widgets": [
            "9d70845e64794c6b8106c3fe64162a2d",
            "c0e2c1b10f054d988d76156b00b365fa",
            "a926aebf4cd04973a41212d9190e6843",
            "eea873c87e604da2ace21488da0e3b15",
            "124654ed293048939cc3079c3830d442",
            "2404eaf487674d57b9a521ead9b5c630",
            "828e294255a344019fa039493e32d63d",
            "c61cc4e7855a4f349f135f60c8762b31",
            "373e48c87af44595a31e0f56b05c6067",
            "351734f9730e4c58921b50d133300be2",
            "9bb6f0b528b648edbba83c0168183280",
            "e12ad39c277e4fcf8ab1861bc51dff7a",
            "81fa24a559584412a5939dbb5e3e7e15",
            "a097a37ecf7e45b1a69da7ab668ca571",
            "4e2771b19cf64bce978fa7fa7cb179a0",
            "eee26d36117749a98e1012ea161dd9a9",
            "d69b63d52a964bf2a2096e348068ba28",
            "a8dcb828bfda431da62adde1d030ebe3",
            "a7641ef3d1ba42b5aabf7e747e8d0d85",
            "853bc4060b324bdb9fecccb76417b4de",
            "de13f70cdf9d4036bdec2262bc1419a7",
            "d660034f9792438080551d4598a0b20a"
          ]
        },
        "id": "t9JD7z0xapq1",
        "outputId": "87256c6d-3ff6-49fa-ed2f-b6124d92108a"
      },
      "outputs": [],
      "source": [
        "# stanza.download('en')"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 4,
      "metadata": {
        "id": "9cP2IQr3apq1"
      },
      "outputs": [],
      "source": [
        "nlp_spacy = spacy.load('en_core_web_sm')"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 5,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "tIuWpzMxapq1",
        "outputId": "183fe8b5-cc00-4292-8324-14d47bbda951"
      },
      "outputs": [],
      "source": [
        "# nlp_stanza = stanza.Pipeline('en', download_method=None)\n",
        "nlp_stanza = stanza.Pipeline('en', processors='tokenize,pos,lemma', download_method=None)"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "sB4dOy-rapq2"
      },
      "source": [
        "## ***Some helper functions***"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 6,
      "metadata": {
        "id": "Abtu3X4Gapq2"
      },
      "outputs": [],
      "source": [
        "lemmatizer_nltk = WordNetLemmatizer()\n",
        "\n",
        "def get_wordnet_pos(treebank_tag):\n",
        "    if treebank_tag.startswith('J'):\n",
        "        return 'a'  # Adjective\n",
        "    elif treebank_tag.startswith('V'):\n",
        "        return 'v'  # Verb\n",
        "    elif treebank_tag.startswith('N'):\n",
        "        return 'n'  # Noun\n",
        "    elif treebank_tag.startswith('R'):\n",
        "        return 'r'  # Adverb\n",
        "    else:\n",
        "        return None\n",
        "\n",
        "def lemmatize_text_nltk(text):\n",
        "    tokens = word_tokenize(text)\n",
        "    pos_tags = pos_tag(tokens)  # Get POS tags for the tokens\n",
        "    lemmatized_tokens = []\n",
        "\n",
        "    for token, tag in pos_tags:\n",
        "        wordnet_pos = get_wordnet_pos(tag)  # Convert to WordNet POS\n",
        "        if wordnet_pos:  # If there's a valid POS tag\n",
        "            lemmatized_token = lemmatizer_nltk.lemmatize(token, pos=wordnet_pos)\n",
        "        else:\n",
        "            lemmatized_token = lemmatizer_nltk.lemmatize(token)\n",
        "        lemmatized_tokens.append(lemmatized_token)\n",
        "\n",
        "    return ' '.join(lemmatized_tokens)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 7,
      "metadata": {
        "id": "gRNtm6BCapq3"
      },
      "outputs": [],
      "source": [
        "def lemmatize_text_spacy(text):\n",
        "    doc = nlp_spacy(text)  # Process the text with SpaCy\n",
        "    lemmatized_tokens = [token.lemma_ for token in doc]  # Apply lemmatization\n",
        "    return ' '.join(lemmatized_tokens)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 8,
      "metadata": {
        "id": "5dIXMj5xapq3"
      },
      "outputs": [],
      "source": [
        "def lemmatize_text_stanza(text):\n",
        "    doc = nlp_stanza(text)  # Process the text with Stanza\n",
        "    lemmatized_tokens = [word.lemma for sentence in doc.sentences for word in sentence.words]  # Apply lemmatization\n",
        "    return ' '.join(lemmatized_tokens)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 9,
      "metadata": {
        "id": "xdP9gxw3apq3"
      },
      "outputs": [],
      "source": [
        "stop_words = set(stopwords.words('english'))\n",
        "\n",
        "def remove_stopwords(text):\n",
        "    tokens = word_tokenize(text)  # Tokenize the text\n",
        "    filtered_tokens = [word for word in tokens if word not in stop_words]  # Remove stop words\n",
        "    return ' '.join(filtered_tokens)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 10,
      "metadata": {
        "id": "wmWy6w2sapq4"
      },
      "outputs": [],
      "source": [
        "def print_clf_report_as_table(report):\n",
        "    data = []\n",
        "    for key, value in report.items():\n",
        "        if key != 'accuracy' and key != 'macro avg' and key != 'weighted avg':\n",
        "            data.append([key, value['precision'], value['recall'], value['f1-score'], value['support']])\n",
        "\n",
        "    data.append(['accuracy', '', '', report['accuracy'], ''])\n",
        "\n",
        "    data.append(['macro avg', report['macro avg']['precision'], report['macro avg']['recall'], report['macro avg']['f1-score'], ''])\n",
        "\n",
        "    data.append(['weighted avg', report['weighted avg']['precision'], report['weighted avg']['recall'], report['weighted avg']['f1-score'], ''])\n",
        "\n",
        "    print(tabulate(data, headers=['Class', 'Precision', 'Recall', 'F1-score', 'Support'], tablefmt='psql'))"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 11,
      "metadata": {
        "id": "GCMRmDzhapq4"
      },
      "outputs": [],
      "source": [
        "def get_prepared_data():\n",
        "    train_set = pd.read_csv(\"augmented_Preprocessed_Symptom2Disease_Train.csv\")\n",
        "    X_train = train_set['text']\n",
        "    y_train = train_set['label']\n",
        "    test_set = pd.read_csv(\"augmented_Preprocessed_Symptom2Disease_Test.csv\")\n",
        "    X_test = test_set['text']\n",
        "    y_test = test_set['label']\n",
        "    X_train = X_train.apply(remove_stopwords)\n",
        "    X_test = X_test.apply(remove_stopwords)\n",
        "    return X_train, X_test, y_train, y_test\n",
        "\n",
        "X_train, X_test, y_train, y_test = get_prepared_data()"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 12,
      "metadata": {
        "id": "v8BAsUgLapq4"
      },
      "outputs": [],
      "source": [
        "def apply_lemmatizer(lemmatizer):\n",
        "    # Apply lemmatization\n",
        "    X_train_lemmatized = X_train.apply(lemmatizer)\n",
        "    X_test_lemmatized = X_test.apply(lemmatizer)\n",
        "\n",
        "    # Apply TF_IDF\n",
        "    vectorizer = TfidfVectorizer()\n",
        "    X_train_lemmatized = vectorizer.fit_transform(X_train_lemmatized)\n",
        "    X_test_lemmatized = vectorizer.transform(X_test_lemmatized)\n",
        "\n",
        "    return X_train_lemmatized, X_test_lemmatized\n",
        "\n",
        "def features_selection(X_train_lemmatized, X_test_lemmatized, scorer, k_value):\n",
        "\n",
        "    # Apply features selection\n",
        "    selector = SelectKBest(score_func=scorer, k=k_value)\n",
        "    X_train_selected = selector.fit_transform(X_train_lemmatized, y_train)\n",
        "    X_test_selected = selector.transform(X_test_lemmatized)\n",
        "    return X_train_selected, X_test_selected\n",
        "\n",
        "def tune_model(lemmatizer, model):\n",
        "    train_accuracies = []\n",
        "    test_accuracies = []\n",
        "    features_counts = []\n",
        "\n",
        "    X_train_lemmatized, X_test_lemmatized = apply_lemmatizer(lemmatizer)\n",
        "    _, max_count = X_train_lemmatized.shape\n",
        "    for i in range(100, max_count, 50):\n",
        "        X_train_selected, X_test_selected = features_selection(X_train_lemmatized, X_test_lemmatized, chi2, i)\n",
        "        model.fit(X_train_selected, y_train)\n",
        "\n",
        "        # Training set acc\n",
        "        y_train_pred = model.predict(X_train_selected)\n",
        "        train_accuracy = accuracy_score(y_train, y_train_pred)\n",
        "        train_accuracies.append(train_accuracy)\n",
        "\n",
        "        # Testing set acc\n",
        "        y_pred = model.predict(X_test_selected)\n",
        "        test_accuracy = accuracy_score(y_test, y_pred)\n",
        "        test_accuracies.append(test_accuracy)\n",
        "\n",
        "        features_counts.append(i)\n",
        "\n",
        "    # Plotting the accuracies\n",
        "    plt.figure(figsize=(10, 6))\n",
        "    plt.plot(features_counts, train_accuracies, label='Train Accuracy', marker='.')\n",
        "    plt.plot(features_counts, test_accuracies, label='Test Accuracy', marker='.')\n",
        "    plt.title('Train and Test Accuracy vs Number of Features')\n",
        "    plt.xlabel('Number of Features Selected')\n",
        "    plt.ylabel('Accuracy')\n",
        "    plt.legend()\n",
        "    plt.grid()\n",
        "\n",
        "    # Finding closest points (3)\n",
        "    differences = np.abs(np.array(train_accuracies) - np.array(test_accuracies))\n",
        "    closest_indices = np.argsort(differences)[:3]  # indices of the three smallest differences\n",
        "    colors = ['darkgreen', 'mediumseagreen', 'lightgreen']\n",
        "\n",
        "    # Draw a rect\n",
        "    for i, idx in enumerate(closest_indices):\n",
        "        x = features_counts[idx] - 5\n",
        "        y_bottom = min(train_accuracies[idx], test_accuracies[idx])\n",
        "        y_top = max(train_accuracies[idx], test_accuracies[idx])\n",
        "        height = y_top - y_bottom\n",
        "\n",
        "        plt.gca().add_patch(plt.Rectangle(\n",
        "            (x, y_bottom), 10, height,\n",
        "            color=colors[i], alpha=0.5\n",
        "        ))\n",
        "\n",
        "    plt.show()"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 13,
      "metadata": {
        "id": "1OqrEVwHapq4"
      },
      "outputs": [],
      "source": [
        "def evaluate_method(lemmatizer, scorer, k_value, model):\n",
        "    X_train_lemmatized, X_test_lemmatized = apply_lemmatizer(lemmatizer)\n",
        "    X_train_selected, X_test_selected = features_selection(X_train_lemmatized, X_test_lemmatized, scorer, k_value)\n",
        "    model.fit(X_train_selected, y_train)\n",
        "\n",
        "    # Training set acc\n",
        "    y_train_pred = model.predict(X_train_selected)\n",
        "    train_accuracy = accuracy_score(y_train, y_train_pred)\n",
        "\n",
        "    # Testing set acc\n",
        "    y_pred = model.predict(X_test_selected)\n",
        "    test_accuracy = accuracy_score(y_test, y_pred)\n",
        "\n",
        "    print(f'Train Accuracy: {train_accuracy}')\n",
        "    print(f'Test Accuracy: {test_accuracy}')\n",
        "    print(f'Difference: {train_accuracy-test_accuracy}')\n",
        "    # Print classification report\n",
        "    report = classification_report(y_test, y_pred, output_dict=True)\n",
        "    print_clf_report_as_table(report)\n"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "hp_f7YQVapq5"
      },
      "source": [
        "# ***1- Nltk lemmatizer***"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "27Gvaqsyapq5"
      },
      "source": [
        "**Note:** This lemmatizer uses POS tagging"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 14,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 564
        },
        "id": "niY4JRPcapq5",
        "outputId": "cee6a308-fa09-48a0-e845-eb622bba9b30"
      },
      "outputs": [
        {
          "data": {
            "image/png": "[encoded data, 54772 characters]",
            "text/plain": [
              "<Figure size 1000x600 with 1 Axes>"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        }
      ],
      "source": [
        "classifier = MultinomialNB()\n",
        "tune_model(lemmatize_text_nltk, classifier)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 15,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 564
        },
        "id": "5webTrL8apq5",
        "outputId": "ea63af7b-48f9-4c4a-d245-893909ecdb0d"
      },
      "outputs": [
        {
          "data": {
            "image/png": "[encoded data, 53768 characters]",
            "text/plain": [
              "<Figure size 1000x600 with 1 Axes>"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        }
      ],
      "source": [
        "classifier = MultinomialNB(alpha=0.1)\n",
        "tune_model(lemmatize_text_nltk, classifier)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 16,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "zy3pHu7napq6",
        "outputId": "3b26084c-0800-4eb8-c7a5-407ab77f369e"
      },
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "Train Accuracy: 0.9891203703703704\n",
            "Test Accuracy: 0.9625\n",
            "Difference: 0.02662037037037035\n",
            "+---------------------------------+--------------------+--------------------+------------+-----------+\n",
            "| Class                           | Precision          | Recall             |   F1-score | Support   |\n",
            "|---------------------------------+--------------------+--------------------+------------+-----------|\n",
            "| Acne                            | 1.0                | 1.0                |   1        | 21.0      |\n",
            "| Arthritis                       | 1.0                | 1.0                |   1        | 20.0      |\n",
            "| Bronchial Asthma                | 1.0                | 0.9473684210526315 |   0.972973 | 19.0      |\n",
            "| Cervical spondylosis            | 0.9130434782608695 | 1.0                |   0.954545 | 21.0      |\n",
            "| Chicken pox                     | 0.7142857142857143 | 1.0                |   0.833333 | 15.0      |\n",
            "| Common Cold                     | 1.0                | 1.0                |   1        | 21.0      |\n",
            "| Dengue                          | 0.95               | 0.8636363636363636 |   0.904762 | 22.0      |\n",
            "| Dimorphic Hemorrhoids           | 1.0                | 1.0                |   1        | 19.0      |\n",
            "| Fungal infection                | 1.0                | 1.0                |   1        | 26.0      |\n",
            "| Hypertension                    | 1.0                | 1.0                |   1        | 18.0      |\n",
            "| Impetigo                        | 0.9583333333333334 | 1.0                |   0.978723 | 23.0      |\n",
            "| Jaundice                        | 1.0                | 1.0                |   1        | 22.0      |\n",
            "| Malaria                         | 1.0                | 1.0                |   1        | 17.0      |\n",
            "| Migraine                        | 1.0                | 1.0                |   1        | 24.0      |\n",
            "| Pneumonia                       | 1.0                | 1.0                |   1        | 22.0      |\n",
            "| Psoriasis                       | 1.0                | 0.8235294117647058 |   0.903226 | 17.0      |\n",
            "| Typhoid                         | 1.0                | 1.0                |   1        | 18.0      |\n",
            "| Varicose Veins                  | 1.0                | 0.8                |   0.888889 | 25.0      |\n",
            "| allergy                         | 0.8235294117647058 | 0.9333333333333333 |   0.875    | 15.0      |\n",
            "| diabetes                        | 1.0                | 0.9411764705882353 |   0.969697 | 17.0      |\n",
            "| drug reaction                   | 1.0                | 1.0                |   1        | 16.0      |\n",
            "| gastroesophageal reflux disease | 0.9047619047619048 | 0.9047619047619048 |   0.904762 | 21.0      |\n",
            "| peptic ulcer disease            | 0.9411764705882353 | 0.8888888888888888 |   0.914286 | 18.0      |\n",
            "| urinary tract infection         | 0.92               | 1.0                |   0.958333 | 23.0      |\n",
            "| accuracy                        |                    |                    |   0.9625   |           |\n",
            "| macro avg                       | 0.9635470963747818 | 0.9626122830844194 |   0.960772 |           |\n",
            "| weighted avg                    | 0.9672582980656032 | 0.9625             |   0.962777 |           |\n",
            "+---------------------------------+--------------------+--------------------+------------+-----------+\n"
          ]
        }
      ],
      "source": [
        "classifier = MultinomialNB(alpha=0.1)\n",
        "evaluate_method(lemmatize_text_nltk, chi2, 700, classifier)"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "s_XycZ4Papq6"
      },
      "source": [
        "# ***2- Stanza lemmatizer***"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 17,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 564
        },
        "id": "I7d4_AhUapq6",
        "outputId": "4d1a8c70-55ab-449b-e51b-bf916443b814"
      },
      "outputs": [
        {
          "data": {
            "image/png": "[encoded data, 60828 characters]",
            "text/plain": [
              "<Figure size 1000x600 with 1 Axes>"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        }
      ],
      "source": [
        "classifier = MultinomialNB(alpha=0.1)\n",
        "tune_model(lemmatize_text_stanza, classifier)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 18,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "OVHFAcpVoW0z",
        "outputId": "0cdece52-03db-4a1e-e97c-70cc38de7ddd"
      },
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "Train Accuracy: 0.9842592592592593\n",
            "Test Accuracy: 0.9645833333333333\n",
            "Difference: 0.01967592592592593\n",
            "+---------------------------------+--------------------+--------------------+------------+-----------+\n",
            "| Class                           | Precision          | Recall             |   F1-score | Support   |\n",
            "|---------------------------------+--------------------+--------------------+------------+-----------|\n",
            "| Acne                            | 1.0                | 1.0                |   1        | 21.0      |\n",
            "| Arthritis                       | 1.0                | 1.0                |   1        | 20.0      |\n",
            "| Bronchial Asthma                | 1.0                | 0.8947368421052632 |   0.944444 | 19.0      |\n",
            "| Cervical spondylosis            | 0.875              | 1.0                |   0.933333 | 21.0      |\n",
            "| Chicken pox                     | 0.7142857142857143 | 1.0                |   0.833333 | 15.0      |\n",
            "| Common Cold                     | 1.0                | 1.0                |   1        | 21.0      |\n",
            "| Dengue                          | 1.0                | 0.8636363636363636 |   0.926829 | 22.0      |\n",
            "| Dimorphic Hemorrhoids           | 1.0                | 1.0                |   1        | 19.0      |\n",
            "| Fungal infection                | 1.0                | 1.0                |   1        | 26.0      |\n",
            "| Hypertension                    | 1.0                | 1.0                |   1        | 18.0      |\n",
            "| Impetigo                        | 0.9583333333333334 | 1.0                |   0.978723 | 23.0      |\n",
            "| Jaundice                        | 1.0                | 1.0                |   1        | 22.0      |\n",
            "| Malaria                         | 1.0                | 1.0                |   1        | 17.0      |\n",
            "| Migraine                        | 1.0                | 1.0                |   1        | 24.0      |\n",
            "| Pneumonia                       | 1.0                | 1.0                |   1        | 22.0      |\n",
            "| Psoriasis                       | 1.0                | 0.8235294117647058 |   0.903226 | 17.0      |\n",
            "| Typhoid                         | 1.0                | 1.0                |   1        | 18.0      |\n",
            "| Varicose Veins                  | 1.0                | 0.84               |   0.913043 | 25.0      |\n",
            "| allergy                         | 0.8235294117647058 | 0.9333333333333333 |   0.875    | 15.0      |\n",
            "| diabetes                        | 0.9444444444444444 | 1.0                |   0.971429 | 17.0      |\n",
            "| drug reaction                   | 1.0                | 0.9375             |   0.967742 | 16.0      |\n",
            "| gastroesophageal reflux disease | 0.9047619047619048 | 0.9047619047619048 |   0.904762 | 21.0      |\n",
            "| peptic ulcer disease            | 0.9444444444444444 | 0.9444444444444444 |   0.944444 | 18.0      |\n",
            "| urinary tract infection         | 1.0                | 1.0                |   1        | 23.0      |\n",
            "| accuracy                        |                    |                    |   0.964583 |           |\n",
            "| macro avg                       | 0.9651999688764396 | 0.9642475958352507 |   0.962346 |           |\n",
            "| weighted avg                    | 0.9698738523187054 | 0.9645833333333333 |   0.965103 |           |\n",
            "+---------------------------------+--------------------+--------------------+------------+-----------+\n"
          ]
        }
      ],
      "source": [
        "classifier = MultinomialNB(alpha=0.1)\n",
        "evaluate_method(lemmatize_text_stanza, chi2, 550, classifier)"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "MZv3alLIapq6"
      },
      "source": [
        "# ***3- SpaCy lemmatizer***"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 19,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 564
        },
        "id": "4h692dmFapq6",
        "outputId": "c1a0be11-415c-45eb-84f2-8ab600699601"
      },
      "outputs": [
        {
          "data": {
            "image/png": "[encoded data, 60708 characters]",
            "text/plain": [
              "<Figure size 1000x600 with 1 Axes>"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        }
      ],
      "source": [
        "classifier = MultinomialNB(alpha=0.1)\n",
        "tune_model(lemmatize_text_spacy, classifier)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 20,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "CyUJ2Qhsapq6",
        "outputId": "3936d8c5-fa2a-4946-dfd9-6613cc567b0e"
      },
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "Train Accuracy: 0.9657407407407408\n",
            "Test Accuracy: 0.95625\n",
            "Difference: 0.009490740740740744\n",
            "+---------------------------------+--------------------+--------------------+------------+-----------+\n",
            "| Class                           | Precision          | Recall             |   F1-score | Support   |\n",
            "|---------------------------------+--------------------+--------------------+------------+-----------|\n",
            "| Acne                            | 1.0                | 1.0                |   1        | 21.0      |\n",
            "| Arthritis                       | 1.0                | 1.0                |   1        | 20.0      |\n",
            "| Bronchial Asthma                | 1.0                | 1.0                |   1        | 19.0      |\n",
            "| Cervical spondylosis            | 0.9545454545454546 | 1.0                |   0.976744 | 21.0      |\n",
            "| Chicken pox                     | 0.6086956521739131 | 0.9333333333333333 |   0.736842 | 15.0      |\n",
            "| Common Cold                     | 0.9523809523809523 | 0.9523809523809523 |   0.952381 | 21.0      |\n",
            "| Dengue                          | 1.0                | 0.7272727272727273 |   0.842105 | 22.0      |\n",
            "| Dimorphic Hemorrhoids           | 1.0                | 1.0                |   1        | 19.0      |\n",
            "| Fungal infection                | 1.0                | 1.0                |   1        | 26.0      |\n",
            "| Hypertension                    | 0.9473684210526315 | 1.0                |   0.972973 | 18.0      |\n",
            "| Impetigo                        | 1.0                | 1.0                |   1        | 23.0      |\n",
            "| Jaundice                        | 1.0                | 1.0                |   1        | 22.0      |\n",
            "| Malaria                         | 0.9444444444444444 | 1.0                |   0.971429 | 17.0      |\n",
            "| Migraine                        | 1.0                | 1.0                |   1        | 24.0      |\n",
            "| Pneumonia                       | 1.0                | 1.0                |   1        | 22.0      |\n",
            "| Psoriasis                       | 1.0                | 0.8235294117647058 |   0.903226 | 17.0      |\n",
            "| Typhoid                         | 1.0                | 1.0                |   1        | 18.0      |\n",
            "| Varicose Veins                  | 1.0                | 0.84               |   0.913043 | 25.0      |\n",
            "| allergy                         | 0.7368421052631579 | 0.9333333333333333 |   0.823529 | 15.0      |\n",
            "| diabetes                        | 1.0                | 1.0                |   1        | 17.0      |\n",
            "| drug reaction                   | 1.0                | 0.8125             |   0.896552 | 16.0      |\n",
            "| gastroesophageal reflux disease | 0.9090909090909091 | 0.9523809523809523 |   0.930233 | 21.0      |\n",
            "| peptic ulcer disease            | 0.9444444444444444 | 0.9444444444444444 |   0.944444 | 18.0      |\n",
            "| urinary tract infection         | 1.0                | 1.0                |   1        | 23.0      |\n",
            "| accuracy                        |                    |                    |   0.95625  |           |\n",
            "| macro avg                       | 0.9582421826414963 | 0.954965631454602  |   0.952646 |           |\n",
            "| weighted avg                    | 0.9654742023592139 | 0.95625            |   0.957358 |           |\n",
            "+---------------------------------+--------------------+--------------------+------------+-----------+\n"
          ]
        }
      ],
      "source": [
        "classifier = MultinomialNB(alpha=0.1)\n",
        "evaluate_method(lemmatize_text_spacy, chi2, 300, classifier)"
      ]
    }
  ],
  "metadata": {
    "accelerator": "GPU",
    "colab": {
      "gpuType": "T4",
      "provenance": []
    },
    "kernelspec": {
      "display_name": "Python 3",
      "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.9.20"
    },
    "widgets": {
      "application/vnd.jupyter.widget-state+json": {
        "124654ed293048939cc3079c3830d442": {
          "model_module": "@jupyter-widgets/base",
          "model_module_version": "1.2.0",
          "model_name": "LayoutModel",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "2404eaf487674d57b9a521ead9b5c630": {
          "model_module": "@jupyter-widgets/base",
          "model_module_version": "1.2.0",
          "model_name": "LayoutModel",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "351734f9730e4c58921b50d133300be2": {
          "model_module": "@jupyter-widgets/base",
          "model_module_version": "1.2.0",
          "model_name": "LayoutModel",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "373e48c87af44595a31e0f56b05c6067": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "ProgressStyleModel",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "ProgressStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "bar_color": null,
            "description_width": ""
          }
        },
        "4e2771b19cf64bce978fa7fa7cb179a0": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "HTMLModel",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_de13f70cdf9d4036bdec2262bc1419a7",
            "placeholder": "​",
            "style": "IPY_MODEL_d660034f9792438080551d4598a0b20a",
            "value": " 526M/526M [00:07&lt;00:00, 122MB/s]"
          }
        },
        "81fa24a559584412a5939dbb5e3e7e15": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "HTMLModel",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_d69b63d52a964bf2a2096e348068ba28",
            "placeholder": "​",
            "style": "IPY_MODEL_a8dcb828bfda431da62adde1d030ebe3",
            "value": "Downloading https://huggingface.co/stanfordnlp/stanza-en/resolve/v1.9.0/models/default.zip: 100%"
          }
        },
        "828e294255a344019fa039493e32d63d": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "DescriptionStyleModel",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "853bc4060b324bdb9fecccb76417b4de": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "ProgressStyleModel",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "ProgressStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "bar_color": null,
            "description_width": ""
          }
        },
        "9bb6f0b528b648edbba83c0168183280": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "DescriptionStyleModel",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "9d70845e64794c6b8106c3fe64162a2d": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "HBoxModel",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HBoxModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HBoxView",
            "box_style": "",
            "children": [
              "IPY_MODEL_c0e2c1b10f054d988d76156b00b365fa",
              "IPY_MODEL_a926aebf4cd04973a41212d9190e6843",
              "IPY_MODEL_eea873c87e604da2ace21488da0e3b15"
            ],
            "layout": "IPY_MODEL_124654ed293048939cc3079c3830d442"
          }
        },
        "a097a37ecf7e45b1a69da7ab668ca571": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "FloatProgressModel",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "FloatProgressModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "ProgressView",
            "bar_style": "success",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_a7641ef3d1ba42b5aabf7e747e8d0d85",
            "max": 526358230,
            "min": 0,
            "orientation": "horizontal",
            "style": "IPY_MODEL_853bc4060b324bdb9fecccb76417b4de",
            "value": 526358230
          }
        },
        "a7641ef3d1ba42b5aabf7e747e8d0d85": {
          "model_module": "@jupyter-widgets/base",
          "model_module_version": "1.2.0",
          "model_name": "LayoutModel",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "a8dcb828bfda431da62adde1d030ebe3": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "DescriptionStyleModel",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "a926aebf4cd04973a41212d9190e6843": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "FloatProgressModel",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "FloatProgressModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "ProgressView",
            "bar_style": "success",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_c61cc4e7855a4f349f135f60c8762b31",
            "max": 48453,
            "min": 0,
            "orientation": "horizontal",
            "style": "IPY_MODEL_373e48c87af44595a31e0f56b05c6067",
            "value": 48453
          }
        },
        "c0e2c1b10f054d988d76156b00b365fa": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "HTMLModel",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_2404eaf487674d57b9a521ead9b5c630",
            "placeholder": "​",
            "style": "IPY_MODEL_828e294255a344019fa039493e32d63d",
            "value": "Downloading https://raw.githubusercontent.com/stanfordnlp/stanza-resources/main/resources_1.9.0.json: "
          }
        },
        "c61cc4e7855a4f349f135f60c8762b31": {
          "model_module": "@jupyter-widgets/base",
          "model_module_version": "1.2.0",
          "model_name": "LayoutModel",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "d660034f9792438080551d4598a0b20a": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "DescriptionStyleModel",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "d69b63d52a964bf2a2096e348068ba28": {
          "model_module": "@jupyter-widgets/base",
          "model_module_version": "1.2.0",
          "model_name": "LayoutModel",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "de13f70cdf9d4036bdec2262bc1419a7": {
          "model_module": "@jupyter-widgets/base",
          "model_module_version": "1.2.0",
          "model_name": "LayoutModel",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "e12ad39c277e4fcf8ab1861bc51dff7a": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "HBoxModel",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HBoxModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HBoxView",
            "box_style": "",
            "children": [
              "IPY_MODEL_81fa24a559584412a5939dbb5e3e7e15",
              "IPY_MODEL_a097a37ecf7e45b1a69da7ab668ca571",
              "IPY_MODEL_4e2771b19cf64bce978fa7fa7cb179a0"
            ],
            "layout": "IPY_MODEL_eee26d36117749a98e1012ea161dd9a9"
          }
        },
        "eea873c87e604da2ace21488da0e3b15": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "HTMLModel",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_351734f9730e4c58921b50d133300be2",
            "placeholder": "​",
            "style": "IPY_MODEL_9bb6f0b528b648edbba83c0168183280",
            "value": " 392k/? [00:00&lt;00:00, 8.36MB/s]"
          }
        },
        "eee26d36117749a98e1012ea161dd9a9": {
          "model_module": "@jupyter-widgets/base",
          "model_module_version": "1.2.0",
          "model_name": "LayoutModel",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        }
      }
    }
  },
  "nbformat": 4,
  "nbformat_minor": 0
}
