From 4adf1714b76176ddba0cfe9c4e0d882599b045ce Mon Sep 17 00:00:00 2001
From: kevin <kevba753@student.liu.se>
Date: Wed, 15 Mar 2023 19:43:55 +0100
Subject: [PATCH] uppdate

---
 TDDE16_project.ipynb | 1247 ++++++++++++++++++++++--------------------
 1 file changed, 664 insertions(+), 583 deletions(-)

diff --git a/TDDE16_project.ipynb b/TDDE16_project.ipynb
index bdc4599..ea3ba80 100644
--- a/TDDE16_project.ipynb
+++ b/TDDE16_project.ipynb
@@ -1,45 +1,31 @@
 {
-  "nbformat": 4,
-  "nbformat_minor": 0,
-  "metadata": {
-    "colab": {
-      "provenance": []
-    },
-    "kernelspec": {
-      "name": "python3",
-      "display_name": "Python 3"
-    },
-    "language_info": {
-      "name": "python"
-    }
-  },
   "cells": [
     {
       "cell_type": "markdown",
-      "source": [
-        "# NPL CNN News Summarization"
-      ],
       "metadata": {
         "id": "2_7wfU7PN0YU"
-      }
+      },
+      "source": [
+        "# NPL CNN News Summarization"
+      ]
     },
     {
       "cell_type": "markdown",
-      "source": [
-        "# Data handeling"
-      ],
       "metadata": {
         "id": "p6wpoANuTAaU"
-      }
+      },
+      "source": [
+        "# Data handeling"
+      ]
     },
     {
       "cell_type": "markdown",
-      "source": [
-        "### Get data"
-      ],
       "metadata": {
         "id": "DSb8vu8NTS1w"
-      }
+      },
+      "source": [
+        "### Get data"
+      ]
     },
     {
       "cell_type": "code",
@@ -56,117 +42,61 @@
     },
     {
       "cell_type": "markdown",
-      "source": [
-        "### Memory maningment"
-      ],
       "metadata": {
         "id": "aspNekigKIVF"
-      }
+      },
+      "source": [
+        "### Memory maningment"
+      ]
     },
     {
       "cell_type": "code",
-      "source": [
-        "del train_df"
-      ],
+      "execution_count": null,
       "metadata": {
         "id": "yaXQQX8pKK0d"
       },
-      "execution_count": 8,
-      "outputs": []
+      "outputs": [],
+      "source": [
+        "del train_df"
+      ]
     },
     {
       "cell_type": "code",
-      "source": [
-        "del val_df"
-      ],
+      "execution_count": null,
       "metadata": {
         "id": "SyoOYXaxKO_5"
       },
-      "execution_count": 15,
-      "outputs": []
+      "outputs": [],
+      "source": [
+        "del val_df"
+      ]
     },
     {
       "cell_type": "markdown",
-      "source": [
-        "### View the data"
-      ],
       "metadata": {
         "id": "aA8YbNEZTPg_"
-      }
+      },
+      "source": [
+        "### View the data"
+      ]
     },
     {
       "cell_type": "code",
-      "source": [
-        "import struct\n",
-        "from tensorflow.core.example import example_pb2\n",
-        "import pandas as pd\n",
-        "\n",
-        "def bin_to_pd(file, n=-1):\n",
-        "\n",
-        "  with open(\"/content/drive/MyDrive/liu/TDDE16/finished_files/\" + file, \"rb\") as f:\n",
-        "    res = {\"article\": [], \"abstract\": []}\n",
-        "    count = 0 # For demo\n",
-        "    while True:\n",
-        "      count += 1\n",
-        "\n",
-        "      lenght = f.read(8)\n",
-        "      if not lenght: break\n",
-        "\n",
-        "      lenght = struct.unpack('q', lenght)[0]\n",
-        "\n",
-        "      data = example_pb2.Example.FromString(f.read(lenght))\n",
-        "\n",
-        "      res[\"article\"].append(data.features.feature['article'].bytes_list.value[0].decode(\"utf-8\") )\n",
-        "      res[\"abstract\"].append(data.features.feature['abstract'].bytes_list.value[0].decode(\"utf-8\") )\n",
-        "\n",
-        "      if n != -1 and not count < n: break\n",
-        "\n",
-        "  return pd.DataFrame(res)\n",
-        "\n",
-        "# chunked/test_000.bin\n",
-        "bin_to_pd(\"train.bin\", 10)"
-      ],
+      "execution_count": null,
       "metadata": {
         "colab": {
           "base_uri": "https://localhost:8080/",
           "height": 363
         },
         "id": "E3JrnaOnTuan",
-        "outputId": "8e6bdbb8-180e-48b6-a0b1-a3a1536514bf"
+        "outputId": "2cb8985b-bd84-4cce-b05d-c358ac8e3398"
       },
-      "execution_count": 2,
       "outputs": [
         {
-          "output_type": "execute_result",
           "data": {
-            "text/plain": [
-              "                                             article  \\\n",
-              "0  editor 's note : in our behind the scenes seri...   \n",
-              "1  london , england ( reuters ) -- harry potter s...   \n",
-              "2  minneapolis , minnesota ( cnn ) -- drivers who...   \n",
-              "3  baghdad , iraq ( cnn ) -- dressed in a superma...   \n",
-              "4  washington ( cnn ) -- doctors removed five sma...   \n",
-              "5  ( cnn ) -- the national football league has in...   \n",
-              "6  baghdad , iraq ( cnn ) -- the women are too af...   \n",
-              "7  washington ( cnn ) -- white house press secret...   \n",
-              "8  washington ( cnn ) -- as he awaits a crucial p...   \n",
-              "9  washington ( cnn ) -- there is \" no remaining ...   \n",
-              "\n",
-              "                                            abstract  \n",
-              "0  <s> mentally ill inmates in miami are housed o...  \n",
-              "1  <s> harry potter star daniel radcliffe gets £ ...  \n",
-              "2  <s> new : \" i thought i was going to die , \" d...  \n",
-              "3  <s> parents beam with pride , ca n't stop from...  \n",
-              "4  <s> five small polyps found during procedure ;...  \n",
-              "5  <s> new : nfl chief , atlanta falcons owner cr...  \n",
-              "6  <s> aid workers : violence , increased cost of...  \n",
-              "7  <s> president bush says tony snow \" will battl...  \n",
-              "8  <s> president bush to address the veterans of ...  \n",
-              "9  <s> new : president bush says he and first lad...  "
-            ],
             "text/html": [
               "\n",
-              "  <div id=\"df-1071f195-cf82-4cfb-b075-9edc58449554\">\n",
+              "  <div id=\"df-f45f885a-6428-4275-b62c-3c009ab94f36\">\n",
               "    <div class=\"colab-df-container\">\n",
               "      <div>\n",
               "<style scoped>\n",
@@ -244,7 +174,7 @@
               "  </tbody>\n",
               "</table>\n",
               "</div>\n",
-              "      <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-1071f195-cf82-4cfb-b075-9edc58449554')\"\n",
+              "      <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-f45f885a-6428-4275-b62c-3c009ab94f36')\"\n",
               "              title=\"Convert this dataframe to an interactive table.\"\n",
               "              style=\"display:none;\">\n",
               "        \n",
@@ -295,12 +225,12 @@
               "\n",
               "      <script>\n",
               "        const buttonEl =\n",
-              "          document.querySelector('#df-1071f195-cf82-4cfb-b075-9edc58449554 button.colab-df-convert');\n",
+              "          document.querySelector('#df-f45f885a-6428-4275-b62c-3c009ab94f36 button.colab-df-convert');\n",
               "        buttonEl.style.display =\n",
               "          google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
               "\n",
               "        async function convertToInteractive(key) {\n",
-              "          const element = document.querySelector('#df-1071f195-cf82-4cfb-b075-9edc58449554');\n",
+              "          const element = document.querySelector('#df-f45f885a-6428-4275-b62c-3c009ab94f36');\n",
               "          const dataTable =\n",
               "            await google.colab.kernel.invokeFunction('convertToInteractive',\n",
               "                                                     [key], {});\n",
@@ -320,40 +250,72 @@
               "    </div>\n",
               "  </div>\n",
               "  "
+            ],
+            "text/plain": [
+              "                                             article  \\\n",
+              "0  editor 's note : in our behind the scenes seri...   \n",
+              "1  london , england ( reuters ) -- harry potter s...   \n",
+              "2  minneapolis , minnesota ( cnn ) -- drivers who...   \n",
+              "3  baghdad , iraq ( cnn ) -- dressed in a superma...   \n",
+              "4  washington ( cnn ) -- doctors removed five sma...   \n",
+              "5  ( cnn ) -- the national football league has in...   \n",
+              "6  baghdad , iraq ( cnn ) -- the women are too af...   \n",
+              "7  washington ( cnn ) -- white house press secret...   \n",
+              "8  washington ( cnn ) -- as he awaits a crucial p...   \n",
+              "9  washington ( cnn ) -- there is \" no remaining ...   \n",
+              "\n",
+              "                                            abstract  \n",
+              "0  <s> mentally ill inmates in miami are housed o...  \n",
+              "1  <s> harry potter star daniel radcliffe gets £ ...  \n",
+              "2  <s> new : \" i thought i was going to die , \" d...  \n",
+              "3  <s> parents beam with pride , ca n't stop from...  \n",
+              "4  <s> five small polyps found during procedure ;...  \n",
+              "5  <s> new : nfl chief , atlanta falcons owner cr...  \n",
+              "6  <s> aid workers : violence , increased cost of...  \n",
+              "7  <s> president bush says tony snow \" will battl...  \n",
+              "8  <s> president bush to address the veterans of ...  \n",
+              "9  <s> new : president bush says he and first lad...  "
             ]
           },
+          "execution_count": 2,
           "metadata": {},
-          "execution_count": 2
+          "output_type": "execute_result"
         }
-      ]
-    },
-    {
-      "cell_type": "code",
+      ],
       "source": [
-        "from math import log\n",
+        "import struct\n",
+        "from tensorflow.core.example import example_pb2\n",
+        "import pandas as pd\n",
         "\n",
-        "f = open(\"/content/drive/MyDrive/liu/TDDE16/finished_files/vocab\", \"r\")\n",
-        "rows = f.read().split('\\n')\n",
+        "def bin_to_pd(file, n=-1):\n",
         "\n",
-        "n = len(rows) - 1 # last row is not an entry\n",
+        "  with open(\"/content/drive/MyDrive/liu/TDDE16/finished_files/\" + file, \"rb\") as f:\n",
+        "    res = {\"article\": [], \"abstract\": []}\n",
+        "    count = 0 # For demo\n",
+        "    while True:\n",
+        "      count += 1\n",
         "\n",
-        "words = []\n",
-        "vocab = {\"n\": []}\n",
-        "idf_dict = {} # Custom idf calculations\n",
-        "for row in rows:\n",
-        "  if not row: break # At end\n",
-        "  res = row.split(\" \")\n",
-        "  words.append(res[0])\n",
-        "  vocab[\"n\"].append(int(res[1]))\n",
+        "      lenght = f.read(8)\n",
+        "      if not lenght: break\n",
+        "\n",
+        "      lenght = struct.unpack('q', lenght)[0]\n",
         "\n",
+        "      data = example_pb2.Example.FromString(f.read(lenght))\n",
         "\n",
-        "  idf = int(res[1])/n # The averige amount of apperaces per document\n",
-        "  idf_dict[res[0]] = log(1/idf + 1) # +1 to avoid negative values for terms that apper on avrige one or more times per document\n",
+        "      res[\"article\"].append(data.features.feature['article'].bytes_list.value[0].decode(\"utf-8\") )\n",
+        "      res[\"abstract\"].append(data.features.feature['abstract'].bytes_list.value[0].decode(\"utf-8\") )\n",
         "\n",
+        "      if n != -1 and not count < n: break\n",
         "\n",
-        "vocab = pd.DataFrame(vocab, index=words)\n",
-        "vocab"
-      ],
+        "  return pd.DataFrame(res)\n",
+        "\n",
+        "# chunked/test_000.bin\n",
+        "bin_to_pd(\"train.bin\", 10)"
+      ]
+    },
+    {
+      "cell_type": "code",
+      "execution_count": null,
       "metadata": {
         "colab": {
           "base_uri": "https://localhost:8080/",
@@ -362,27 +324,9 @@
         "id": "4smlRgATTq9R",
         "outputId": "40243bce-02f3-4acb-ddc3-17af8674d533"
       },
-      "execution_count": null,
       "outputs": [
         {
-          "output_type": "execute_result",
           "data": {
-            "text/plain": [
-              "                             n\n",
-              ".                     12124579\n",
-              "the                   11903863\n",
-              ",                      9609615\n",
-              "to                     5768839\n",
-              "a                      5101926\n",
-              "...                        ...\n",
-              "duor                         4\n",
-              "compartmentalization         4\n",
-              "yabuli                       4\n",
-              "lar                          4\n",
-              "elevanise                    4\n",
-              "\n",
-              "[200000 rows x 1 columns]"
-            ],
             "text/html": [
               "\n",
               "  <div id=\"df-5ebbd193-2122-402c-95b6-caad415b2590\">\n",
@@ -533,30 +477,67 @@
               "    </div>\n",
               "  </div>\n",
               "  "
+            ],
+            "text/plain": [
+              "                             n\n",
+              ".                     12124579\n",
+              "the                   11903863\n",
+              ",                      9609615\n",
+              "to                     5768839\n",
+              "a                      5101926\n",
+              "...                        ...\n",
+              "duor                         4\n",
+              "compartmentalization         4\n",
+              "yabuli                       4\n",
+              "lar                          4\n",
+              "elevanise                    4\n",
+              "\n",
+              "[200000 rows x 1 columns]"
             ]
           },
+          "execution_count": 29,
           "metadata": {},
-          "execution_count": 29
+          "output_type": "execute_result"
         }
+      ],
+      "source": [
+        "from math import log\n",
+        "\n",
+        "f = open(\"/content/drive/MyDrive/liu/TDDE16/finished_files/vocab\", \"r\")\n",
+        "rows = f.read().split('\\n')\n",
+        "\n",
+        "n = len(rows) - 1 # last row is not an entry\n",
+        "\n",
+        "words = []\n",
+        "vocab = {\"n\": []}\n",
+        "idf_dict = {} # Custom idf calculations\n",
+        "for row in rows:\n",
+        "  if not row: break # At end\n",
+        "  res = row.split(\" \")\n",
+        "  words.append(res[0])\n",
+        "  vocab[\"n\"].append(int(res[1]))\n",
+        "\n",
+        "\n",
+        "  idf = int(res[1])/n # The averige amount of apperaces per document\n",
+        "  idf_dict[res[0]] = log(1/idf + 1) # +1 to avoid negative values for terms that apper on avrige one or more times per document\n",
+        "\n",
+        "\n",
+        "vocab = pd.DataFrame(vocab, index=words)\n",
+        "vocab"
       ]
     },
     {
       "cell_type": "markdown",
-      "source": [
-        "Closer look at data"
-      ],
       "metadata": {
         "id": "ynx29tZWarPx"
-      }
+      },
+      "source": [
+        "Closer look at data"
+      ]
     },
     {
       "cell_type": "code",
-      "source": [
-        "train_df = bin_to_pd(\"train.bin\")\n",
-        "\n",
-        "print(train_df.duplicated(subset= ['article', 'abstract']).sum())\n",
-        "train_df = train_df.drop_duplicates(subset= ['article', 'abstract']).reset_index(drop=True)"
-      ],
+      "execution_count": null,
       "metadata": {
         "colab": {
           "base_uri": "https://localhost:8080/"
@@ -564,48 +545,36 @@
         "id": "efSxuraMaumc",
         "outputId": "068cb895-20c6-4ce2-aa33-055aa62b6e5f"
       },
-      "execution_count": 3,
       "outputs": [
         {
-          "output_type": "stream",
           "name": "stdout",
+          "output_type": "stream",
           "text": [
             "3121\n"
           ]
         }
+      ],
+      "source": [
+        "train_df = bin_to_pd(\"train.bin\")\n",
+        "\n",
+        "print(train_df.duplicated(subset= ['article', 'abstract']).sum())\n",
+        "train_df = train_df.drop_duplicates(subset= ['article', 'abstract']).reset_index(drop=True)"
       ]
     },
     {
       "cell_type": "code",
-      "source": [
-        "import numpy as np"
-      ],
+      "execution_count": null,
       "metadata": {
         "id": "YHEGU1xOyhHB"
       },
-      "execution_count": 3,
-      "outputs": []
+      "outputs": [],
+      "source": [
+        "import numpy as np"
+      ]
     },
     {
       "cell_type": "code",
-      "source": [
-        "import matplotlib.pyplot as plt\n",
-        "\n",
-        "art_word_count = np.zeros(train_df.shape[0])\n",
-        "abs_word_count = np.zeros(train_df.shape[0])\n",
-        "\n",
-        "for index, row in train_df.iterrows():\n",
-        "\n",
-        "  abs_word_count[index] = len(row[\"abstract\"].split(\" \"))\n",
-        "  art_word_count[index] = len(row[\"article\"].split(\" \"))\n",
-        "\n",
-        "length_df = pd.DataFrame({'article':art_word_count, 'abstract':abs_word_count})\n",
-        "\n",
-        "length_df.hist(bins = 30)\n",
-        "plt.show()\n",
-        "print(\"Article: \", art_word_count.min(), art_word_count.mean(), art_word_count.max())\n",
-        "print(\"Abstract: \", abs_word_count.min(), abs_word_count.mean(), abs_word_count.max())"
-      ],
+      "execution_count": null,
       "metadata": {
         "colab": {
           "base_uri": "https://localhost:8080/",
@@ -614,43 +583,48 @@
         "id": "H_wMY4q6a0N1",
         "outputId": "7c29ae28-1acb-4591-bbc4-c1a89b70933f"
       },
-      "execution_count": 5,
       "outputs": [
         {
-          "output_type": "display_data",
           "data": {
+            "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYMAAAEICAYAAAC9E5gJAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/NK7nSAAAACXBIWXMAAAsTAAALEwEAmpwYAAAdiklEQVR4nO3df5BV5Z3n8fcnIIYyiaBmuhh0A1mpTVAmJFJIKqldRjeK+gemyri41gCGCcmoO8kuVRucyY6ZqLu4VcQxs4kuKShxyhEYk6xsgssyht6USfA3EdE4tkhWCMoIiLbZmLTz3T/Ot+Ohubf70t33V9/Pq+pWn/s9zznnOd3n9vee5zznOYoIzMyss72r2RUwM7PmczIwMzMnAzMzczIwMzOcDMzMDCcDMzPDyWBMknSnpP9UQ7luSX/ciDqZDUbSUkkPNbsenczJoM1V+hBFxBci4qZm1cmsUeqdRCTdJenmeq2/lTgZtDFJ45tdB7NWJ2lcs+vQDpwMWpCklZJekPSGpGckfTrjSyX9WNJtkg4BG4E7gY9L6pX0WpY75tuMpIWSdkp6Pde7oMp2PyvpWUlHJG2V9IH67611kmrH9juz9d8kHZX0c0kXlmYslbQnl3tR0tWSPkz14/8OSVskvQn8oaTLJD2Zn4GXJH11QL0+Keknkl7L+UslLQeuBv5jrv9/1vv301QR4VeLvYDPAL9Pkaz/DfAmMAVYCvQB/w4YD0zM2EMDlr8LuDmn5wJHgU/l+qYCH8p53cAf5/RCoAf4cK77K8BPmv278GtsvWo4tv89cFLOOwqcB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7GvLfsbG0pnB727vj4jfAP239zdFRPwIODwgvBBYn9PrgctL8bujsAOYJGkKcDGwLSIOR8QRYBuwoI51PhART+T0G8CzFHfKtnq9IyJ68+1J+QrgAuC+KvXu35/7gAslKeMbIuKtiHgR6KE4rlpVSx3zw9WOn5XhauXP2FhKBpVu75/apLpU0xURB3L6ZaArp6vVvWn7lE0nH6X4lt3y9ZY0TtJO4CDFB+MF4LWI6KtQh9/VL+cfBU5vRr1HqN3qeyJa/pgbqVb7jI2lZNBWojjXa8l+vZLeA3wH+FJEvF6e16r1joi3I2I2xZ28c4EPNbdGNlpa9ZgbiVb8jI2lZNAOt/e/kqd45M+DGa9W94bvk6STKA7SeyLiu+1S734R8RqwHfg4xSl1/42V5Tr8rn45/1TgEO1xDJW1W31PRNsccyeqVT9jYykZtMPt/ZuB/qv+S4D7S/HF2XNgHnA0Txm3AhdJmpy9Cy7KWF1ku/la4NmI+Hob1fv9kibl9ESKZwQ8S5EUrqhS7/79uQL4YX4b2wwsyt5G04EZwCP1qvcoaIdjfrha+pgbrpb+jDX76vpoviiuvP8DRXvxnze5LvcCB4DfUrTnLaNol34QeB74e+C0LCuKB528AOwC5pTW81mKC5k9wDV1rvMnKU5PnwJ25uvSNqj3HwBPZr2fBv4i4x+k+GfeA/wdcHLG353ve3L+B0vr+vPcn+eAS5p9TLfTMT+CfWi7z8oI9rVlP2MejsLMzMZUM5GZmQ2Tk4GZmTkZmJmZk4GZmeFkYGZmOBmYmRlOBmZmBvx/DuivNeuBet4AAAAASUVORK5CYII=\n",
             "text/plain": [
               "<Figure size 432x288 with 2 Axes>"
-            ],
-            "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYMAAAEICAYAAAC9E5gJAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/NK7nSAAAACXBIWXMAAAsTAAALEwEAmpwYAAAdiklEQVR4nO3df5BV5Z3n8fcnIIYyi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Jmpy9Cy7KWF1ku/la4NmI+Hob1fv9kibl9ESKZwQ8S5EUrqhS7/79uQL4YX4b2wwsyt5G04EZwCP1qvcoaIdjfrha+pgbrpb+jDX76vpoviiuvP8DRXvxnze5LvcCB4DfUrTnLaNol34QeB74e+C0LCuKB528AOwC5pTW81mKC5k9wDV1rvMnKU5PnwJ25uvSNqj3HwBPZr2fBv4i4x+k+GfeA/wdcHLG353ve3L+B0vr+vPcn+eAS5p9TLfTMT+CfWi7z8oI9rVlP2MejsLMzMZUM5GZmQ2Tk4GZmTkZmJmZk4GZmeFkYGZmOBmYmRlOBmZmBvx/DuivNeuBet4AAAAASUVORK5CYII=\n"
+            ]
           },
-          "metadata": {
-            "needs_background": "light"
-          }
+          "metadata": {},
+          "output_type": "display_data"
         },
         {
-          "output_type": "stream",
           "name": "stdout",
+          "output_type": "stream",
           "text": [
             "Article:  1.0 804.1773880171485 2914.0\n",
             "Abstract:  6.0 64.05585239312087 2238.0\n"
           ]
         }
+      ],
+      "source": [
+        "import matplotlib.pyplot as plt\n",
+        "\n",
+        "art_word_count = np.zeros(train_df.shape[0])\n",
+        "abs_word_count = np.zeros(train_df.shape[0])\n",
+        "\n",
+        "for index, row in train_df.iterrows():\n",
+        "\n",
+        "  abs_word_count[index] = len(row[\"abstract\"].split(\" \"))\n",
+        "  art_word_count[index] = len(row[\"article\"].split(\" \"))\n",
+        "\n",
+        "length_df = pd.DataFrame({'article':art_word_count, 'abstract':abs_word_count})\n",
+        "\n",
+        "length_df.hist(bins = 30)\n",
+        "plt.show()\n",
+        "print(\"Article: \", art_word_count.min(), art_word_count.mean(), art_word_count.max())\n",
+        "print(\"Abstract: \", abs_word_count.min(), abs_word_count.mean(), abs_word_count.max())"
       ]
     },
     {
       "cell_type": "code",
-      "source": [
-        "print(\"Articals: \")\n",
-        "print(np.percentile(art_word_count, 90))\n",
-        "print(np.percentile(art_word_count, 95))\n",
-        "print(np.percentile(art_word_count, 99))\n",
-        "\n",
-        "print(\"Abstract: \")\n",
-        "print(np.percentile(abs_word_count, 90))\n",
-        "print(np.percentile(abs_word_count, 95))\n",
-        "print(np.percentile(abs_word_count, 99))"
-      ],
+      "execution_count": null,
       "metadata": {
         "colab": {
           "base_uri": "https://localhost:8080/"
@@ -658,11 +632,10 @@
         "id": "8yAcbtaLa5oj",
         "outputId": "32c61239-6a28-4b6c-f146-49a453c3acc0"
       },
-      "execution_count": null,
       "outputs": [
         {
-          "output_type": "stream",
           "name": "stdout",
+          "output_type": "stream",
           "text": [
             "Articals: \n",
             "1358.0\n",
@@ -674,51 +647,67 @@
             "146.0\n"
           ]
         }
+      ],
+      "source": [
+        "print(\"Articals: \")\n",
+        "print(np.percentile(art_word_count, 90))\n",
+        "print(np.percentile(art_word_count, 95))\n",
+        "print(np.percentile(art_word_count, 99))\n",
+        "\n",
+        "print(\"Abstract: \")\n",
+        "print(np.percentile(abs_word_count, 90))\n",
+        "print(np.percentile(abs_word_count, 95))\n",
+        "print(np.percentile(abs_word_count, 99))"
       ]
     },
     {
       "cell_type": "markdown",
-      "source": [
-        "# Text summarization methods"
-      ],
       "metadata": {
         "id": "X7N7qeurBuH3"
-      }
+      },
+      "source": [
+        "# Text summarization methods"
+      ]
     },
     {
       "cell_type": "markdown",
-      "source": [
-        "### Pre-Processing"
-      ],
       "metadata": {
         "id": "jMpktRcZKJ76"
-      }
+      },
+      "source": [
+        "### Pre-Processing"
+      ]
     },
     {
       "cell_type": "code",
+      "execution_count": null,
+      "metadata": {
+        "id": "4XSwYhMiC87e"
+      },
+      "outputs": [],
       "source": [
         "import spacy\n",
         "nlp = spacy.load(\"en_core_web_sm\")\n",
         "disable = [ \"parser\", \"ner\", \"textcat\"]\n",
         "nlp.add_pipe(\"sentencizer\")"
-      ],
-      "metadata": {
-        "id": "4XSwYhMiC87e"
-      },
-      "execution_count": null,
-      "outputs": []
+      ]
     },
     {
       "cell_type": "markdown",
-      "source": [
-        "The input is already tokenised"
-      ],
       "metadata": {
         "id": "VdmJ6xMWqMEe"
-      }
+      },
+      "source": [
+        "The input is already tokenised"
+      ]
     },
     {
       "cell_type": "code",
+      "execution_count": null,
+      "metadata": {
+        "id": "JNbipR3lqJVN"
+      },
+      "outputs": [],
       "source": [
         "from spacy.tokens import Doc\n",
         "\n",
@@ -726,142 +715,142 @@
         "    return Doc(nlp.vocab, text.split(\" \"))\n",
         "\n",
         "nlp.tokenizer = custom_tokenizer"
-      ],
-      "metadata": {
-        "id": "JNbipR3lqJVN"
-      },
-      "execution_count": 5,
-      "outputs": []
+      ]
     },
     {
       "cell_type": "code",
-      "source": [
-        "import multiprocessing\n",
-        "n_process = int(multiprocessing.cpu_count())\n",
-        "n_process"
-      ],
+      "execution_count": null,
       "metadata": {
         "colab": {
           "base_uri": "https://localhost:8080/"
         },
         "id": "uL0sPSH6PVV9",
-        "outputId": "4d37e9cb-4c12-44f6-de16-960f144fa633"
+        "outputId": "1e1f10f8-2eb3-4fd3-b1f5-c27ad1b6c044"
       },
-      "execution_count": 6,
       "outputs": [
         {
-          "output_type": "execute_result",
           "data": {
             "text/plain": [
               "2"
             ]
           },
+          "execution_count": 6,
           "metadata": {},
-          "execution_count": 6
+          "output_type": "execute_result"
         }
+      ],
+      "source": [
+        "import multiprocessing\n",
+        "n_process = int(multiprocessing.cpu_count())\n",
+        "n_process"
       ]
     },
     {
       "cell_type": "code",
-      "source": [
-        "from tqdm import tqdm"
-      ],
+      "execution_count": null,
       "metadata": {
         "id": "U9gVEH7CKSHT"
       },
-      "execution_count": 7,
-      "outputs": []
+      "outputs": [],
+      "source": [
+        "from tqdm import tqdm"
+      ]
     },
     {
       "cell_type": "code",
-      "source": [
-        "# 10 minuts\n",
-        "test_df = bin_to_pd(\"test.bin\")\n",
-        "#n_process=n_process, # Other process keeps on dying\n",
-        "test_df['article'] = list(nlp.pipe(tqdm(test_df['article'].tolist(), position=0, leave=True), disable=disable))"
-      ],
+      "execution_count": null,
       "metadata": {
         "colab": {
           "base_uri": "https://localhost:8080/"
         },
         "id": "YmIWN4zxLB41",
-        "outputId": "8031179e-73d2-4e79-a637-593cc79a2a9c"
+        "outputId": "493aa335-48f7-4d6b-b7fc-93945ac4834a"
       },
-      "execution_count": 48,
       "outputs": [
         {
-          "output_type": "stream",
           "name": "stderr",
+          "output_type": "stream",
           "text": [
-            "100%|██████████| 11490/11490 [12:03<00:00, 15.88it/s]\n"
+            "100%|██████████| 11490/11490 [10:13<00:00, 18.73it/s]\n"
           ]
         }
+      ],
+      "source": [
+        "# 10 minuts\n",
+        "test_df = bin_to_pd(\"test.bin\")\n",
+        "#n_process=n_process, # Other process keeps on dying\n",
+        "test_df['article'] = list(nlp.pipe(tqdm(test_df['article'].tolist(), position=0, leave=True), disable=disable))"
       ]
     },
     {
       "cell_type": "code",
-      "source": [
-        "# 4 minuts\n",
-        "val_df = bin_to_pd(\"val.bin\")\n",
-        "val_df['article'] = list(nlp.pipe(tqdm(val_df['article'].tolist(), position=0, leave=True), \\\n",
-        "                         disable=disable + [\"tok2vec\", \"tagger\", \"lemmatizer\"], n_process=n_process))"
-      ],
+      "execution_count": null,
       "metadata": {
         "colab": {
           "base_uri": "https://localhost:8080/"
         },
         "id": "CiOyTv4XpTpD",
-        "outputId": "1750145c-ccef-4060-f41f-3e780a40bc12"
+        "outputId": "a5a41760-f704-4669-e19c-a263c0a021e9"
       },
-      "execution_count": 9,
       "outputs": [
         {
-          "output_type": "stream",
           "name": "stderr",
+          "output_type": "stream",
           "text": [
-            "100%|██████████| 13368/13368 [04:02<00:00, 55.21it/s]\n"
+            "100%|██████████| 13368/13368 [03:55<00:00, 56.71it/s]\n"
           ]
         }
+      ],
+      "source": [
+        "# 4 minuts\n",
+        "val_df = bin_to_pd(\"val.bin\")\n",
+        "val_df['article'] = list(nlp.pipe(tqdm(val_df['article'].tolist(), position=0, leave=True), \\\n",
+        "                         disable=disable + [\"tok2vec\", \"tagger\", \"lemmatizer\"], n_process=n_process))"
       ]
     },
     {
       "cell_type": "code",
+      "execution_count": null,
+      "metadata": {
+        "id": "KxdIibePj7Cq"
+      },
+      "outputs": [],
       "source": [
         "from sklearn.feature_extraction.text import TfidfVectorizer\n",
         "\n",
         "vectorizer = TfidfVectorizer(stop_words='english')\n",
         "vector = vectorizer.fit_transform(train_df['article']) #  2 minuts"
-      ],
-      "metadata": {
-        "id": "KxdIibePj7Cq"
-      },
-      "execution_count": null,
-      "outputs": []
+      ]
     },
     {
       "cell_type": "markdown",
+      "metadata": {
+        "id": "xeMS33c-91DT"
+      },
       "source": [
         "## Baseline\n",
         "Take the first sentance as the summary"
-      ],
-      "metadata": {
-        "id": "xeMS33c-91DT"
-      }
+      ]
     },
     {
       "cell_type": "code",
-      "source": [
-        "!pip install rouge\n",
-        "from rouge import Rouge"
-      ],
+      "execution_count": null,
       "metadata": {
         "id": "BryZtZwsOX4F"
       },
-      "execution_count": null,
-      "outputs": []
+      "outputs": [],
+      "source": [
+        "!pip install rouge\n",
+        "from rouge import Rouge"
+      ]
     },
     {
       "cell_type": "code",
+      "execution_count": null,
+      "metadata": {
+        "id": "7agp9wMpN0xz"
+      },
+      "outputs": [],
       "source": [
         "def balseline_predict(x):\n",
         "  y = np.full(x.shape, \"\", dtype=object)\n",
@@ -884,21 +873,11 @@
         "    print(ex_art)\n",
         "    print(pred)\n",
         "    print(ex_abs)"
-      ],
-      "metadata": {
-        "id": "7agp9wMpN0xz"
-      },
-      "execution_count": 11,
-      "outputs": []
+      ]
     },
     {
       "cell_type": "code",
-      "source": [
-        "pred = balseline_predict(test_df[\"article\"])\n",
-        "res = Rouge().get_scores(pred, test_df[\"abstract\"], avg=True, ignore_empty=True)\n",
-        "\n",
-        "show_res(res, test_df[\"article\"][0], pred[0], test_df[\"abstract\"][0])"
-      ],
+      "execution_count": null,
       "metadata": {
         "colab": {
           "base_uri": "https://localhost:8080/"
@@ -906,18 +885,17 @@
         "id": "L-0whCxfOTbt",
         "outputId": "d548db26-c1e0-4072-80ec-fff359e8f12b"
       },
-      "execution_count": null,
       "outputs": [
         {
-          "output_type": "stream",
           "name": "stderr",
+          "output_type": "stream",
           "text": [
             "100%|██████████| 11490/11490 [00:01<00:00, 9720.53it/s]\n"
           ]
         },
         {
-          "output_type": "stream",
           "name": "stdout",
+          "output_type": "stream",
           "text": [
             "rouge-1 {'r': 0.2653283034949623, 'p': 0.46415187226477445, 'f': 0.3264453606597371}\n",
             "rouge-2 {'r': 0.07380511111205938, 'p': 0.15206153370168626, 'f': 0.09553657251587828}\n",
@@ -927,47 +905,35 @@
             "<s> marseille prosecutor says \" so far no videos were used in the crash investigation \" despite media reports . </s> <s> journalists at bild and paris match are \" very confident \" the video clip is real , an editor says . </s> <s> andreas lubitz had informed his lufthansa training school of an episode of severe depression , airline says . </s>\n"
           ]
         }
+      ],
+      "source": [
+        "pred = balseline_predict(test_df[\"article\"])\n",
+        "res = Rouge().get_scores(pred, test_df[\"abstract\"], avg=True, ignore_empty=True)\n",
+        "\n",
+        "show_res(res, test_df[\"article\"][0], pred[0], test_df[\"abstract\"][0])"
       ]
     },
     {
       "cell_type": "markdown",
-      "source": [
-        "### Baseline expation"
-      ],
       "metadata": {
         "id": "sOq7VEQZN1sp"
-      }
+      },
+      "source": [
+        "### Baseline expation"
+      ]
     },
     {
       "cell_type": "markdown",
-      "source": [
-        "get an estimate for the parameter n, that determines how many sentances to have in the sumirazation"
-      ],
       "metadata": {
         "id": "RoGWX_TC9qWr"
-      }
+      },
+      "source": [
+        "get an estimate for the parameter n, that determines how many sentances to have in the sumirazation"
+      ]
     },
     {
       "cell_type": "code",
-      "source": [
-        "rel_legnths = np.zeros(val_df.shape[0])\n",
-        "legnths = np.zeros(val_df.shape[0])\n",
-        "\n",
-        "for index, row in tqdm(val_df.iterrows(), position=0, leave=True):\n",
-        "\n",
-        "  art_legnth = len(list(row[\"article\"].sents))\n",
-        "\n",
-        "  # -1 as the last element is not a senctance\n",
-        "  abs_legnth = len(row[\"abstract\"].split(\"</s>\")) - 1\n",
-        "\n",
-        "  rel_legnths[index] = abs_legnth/art_legnth\n",
-        "  legnths[index] = abs_legnth\n",
-        "\n",
-        "article_size = np.mean(rel_legnths)\n",
-        "print('\\n',article_size)\n",
-        "mean_size = round(np.mean(legnths))\n",
-        "print(mean_size)"
-      ],
+      "execution_count": null,
       "metadata": {
         "colab": {
           "base_uri": "https://localhost:8080/"
@@ -975,18 +941,17 @@
         "id": "gYtzD-JJ9mP1",
         "outputId": "1a061564-fa6a-45f1-cd8e-e3ab4f873b54"
       },
-      "execution_count": 12,
       "outputs": [
         {
-          "output_type": "stream",
           "name": "stderr",
+          "output_type": "stream",
           "text": [
             "13368it [00:02, 5864.85it/s]"
           ]
         },
         {
-          "output_type": "stream",
           "name": "stdout",
+          "output_type": "stream",
           "text": [
             "\n",
             " 0.1591287723319216\n",
@@ -994,16 +959,40 @@
           ]
         },
         {
-          "output_type": "stream",
           "name": "stderr",
+          "output_type": "stream",
           "text": [
             "\n"
           ]
         }
+      ],
+      "source": [
+        "rel_legnths = np.zeros(val_df.shape[0])\n",
+        "legnths = np.zeros(val_df.shape[0])\n",
+        "\n",
+        "for index, row in tqdm(val_df.iterrows(), position=0, leave=True):\n",
+        "\n",
+        "  art_legnth = len(list(row[\"article\"].sents))\n",
+        "\n",
+        "  # -1 as the last element is not a senctance\n",
+        "  abs_legnth = len(row[\"abstract\"].split(\"</s>\")) - 1\n",
+        "\n",
+        "  rel_legnths[index] = abs_legnth/art_legnth\n",
+        "  legnths[index] = abs_legnth\n",
+        "\n",
+        "article_size = np.mean(rel_legnths)\n",
+        "print('\\n',article_size)\n",
+        "mean_size = round(np.mean(legnths))\n",
+        "print(mean_size)"
       ]
     },
     {
       "cell_type": "code",
+      "execution_count": null,
+      "metadata": {
+        "id": "azFyl5JO10kB"
+      },
+      "outputs": [],
       "source": [
         "def first_sentance_scoring(sentences):\n",
         "  scores = []\n",
@@ -1040,21 +1029,11 @@
         "    y[i] = score_predict(score, sentences, n)\n",
         "\n",
         "  return y"
-      ],
-      "metadata": {
-        "id": "azFyl5JO10kB"
-      },
-      "execution_count": 12,
-      "outputs": []
-    },
-    {
-      "cell_type": "code",
-      "source": [
-        "pred = potition_predict(test_df[\"article\"], mean_size)\n",
-        "res = Rouge().get_scores(pred, test_df[\"abstract\"], avg=True, ignore_empty=True) # 2 minuts\n",
-        "\n",
-        "show_res(res, test_df[\"article\"][0], pred[0], test_df[\"abstract\"][0])"
-      ],
+      ]
+    },
+    {
+      "cell_type": "code",
+      "execution_count": null,
       "metadata": {
         "colab": {
           "base_uri": "https://localhost:8080/"
@@ -1062,18 +1041,17 @@
         "id": "2pVKOKCItw3o",
         "outputId": "d76a6b1b-ef69-4f08-ed39-a40163637bf9"
       },
-      "execution_count": null,
       "outputs": [
         {
-          "output_type": "stream",
           "name": "stderr",
+          "output_type": "stream",
           "text": [
             "100%|██████████| 11490/11490 [00:03<00:00, 3083.55it/s]\n"
           ]
         },
         {
-          "output_type": "stream",
           "name": "stdout",
+          "output_type": "stream",
           "text": [
             "rouge-1 {'r': 0.5787133737777755, 'p': 0.3612238237068001, 'f': 0.4349567252640679}\n",
             "rouge-2 {'r': 0.27746472802087296, 'p': 0.15834677786172163, 'f': 0.19580566208795433}\n",
@@ -1083,20 +1061,31 @@
             "<s> marseille prosecutor says \" so far no videos were used in the crash investigation \" despite media reports . </s> <s> journalists at bild and paris match are \" very confident \" the video clip is real , an editor says . </s> <s> andreas lubitz had informed his lufthansa training school of an episode of severe depression , airline says . </s>\n"
           ]
         }
+      ],
+      "source": [
+        "pred = potition_predict(test_df[\"article\"], mean_size)\n",
+        "res = Rouge().get_scores(pred, test_df[\"abstract\"], avg=True, ignore_empty=True) # 2 minuts\n",
+        "\n",
+        "show_res(res, test_df[\"article\"][0], pred[0], test_df[\"abstract\"][0])"
       ]
     },
     {
       "cell_type": "markdown",
+      "metadata": {
+        "id": "zUFzOLGXtouS"
+      },
       "source": [
         "## TF-IDF scoring\n",
         "Improvement score using a tf-idf like score to downplay common words"
-      ],
-      "metadata": {
-        "id": "zUFzOLGXtouS"
-      }
+      ]
     },
     {
       "cell_type": "code",
+      "execution_count": null,
+      "metadata": {
+        "id": "xBBHZTj6yqJT"
+      },
+      "outputs": [],
       "source": [
         "def word_freq_tfidf_scoring(sentences):\n",
         "  texts = []\n",
@@ -1124,22 +1113,11 @@
         "    y[i] = score_predict(sores, sentences, n)\n",
         "\n",
         "  return y"
-      ],
-      "metadata": {
-        "id": "xBBHZTj6yqJT"
-      },
-      "execution_count": null,
-      "outputs": []
+      ]
     },
     {
       "cell_type": "code",
-      "source": [
-        "# Takes lotts of time\n",
-        "pred = tfidf_sentec_predict(test_df[\"article\"], mean_size)\n",
-        "res = Rouge().get_scores(pred, test_df[\"abstract\"], avg=True, ignore_empty=True)\n",
-        "\n",
-        "show_res(res, test_df[\"article\"][0], pred[0], test_df[\"abstract\"][0])"
-      ],
+      "execution_count": null,
       "metadata": {
         "colab": {
           "base_uri": "https://localhost:8080/"
@@ -1147,18 +1125,17 @@
         "id": "S27LXXEatbNe",
         "outputId": "8982ed71-be52-4af3-eb00-a227e6919acb"
       },
-      "execution_count": null,
       "outputs": [
         {
-          "output_type": "stream",
           "name": "stderr",
+          "output_type": "stream",
           "text": [
             "100%|██████████| 11490/11490 [18:39<00:00, 10.26it/s]\n"
           ]
         },
         {
-          "output_type": "stream",
           "name": "stdout",
+          "output_type": "stream",
           "text": [
             "rouge-1 {'r': 0.5390942469298202, 'p': 0.2653432195605193, 'f': 0.3467860329036724}\n",
             "rouge-2 {'r': 0.21902899372402257, 'p': 0.09705436435302771, 'f': 0.13019228035984926}\n",
@@ -1168,19 +1145,31 @@
             "<s> marseille prosecutor says \" so far no videos were used in the crash investigation \" despite media reports . </s> <s> journalists at bild and paris match are \" very confident \" the video clip is real , an editor says . </s> <s> andreas lubitz had informed his lufthansa training school of an episode of severe depression , airline says . </s>\n"
           ]
         }
+      ],
+      "source": [
+        "# Takes lotts of time\n",
+        "pred = tfidf_sentec_predict(test_df[\"article\"], mean_size)\n",
+        "res = Rouge().get_scores(pred, test_df[\"abstract\"], avg=True, ignore_empty=True)\n",
+        "\n",
+        "show_res(res, test_df[\"article\"][0], pred[0], test_df[\"abstract\"][0])"
       ]
     },
     {
       "cell_type": "markdown",
-      "source": [
-        "### Custom TF-IDF impementation"
-      ],
       "metadata": {
         "id": "Oyz2RR7IJ9J7"
-      }
+      },
+      "source": [
+        "### Custom TF-IDF impementation"
+      ]
     },
     {
       "cell_type": "code",
+      "execution_count": null,
+      "metadata": {
+        "id": "k266huRznoRk"
+      },
+      "outputs": [],
       "source": [
         "def custom_tfidf_scoring(word_freq, sentences):\n",
         "\n",
@@ -1212,21 +1201,11 @@
         "    y[i] = score_predict(sores, sentences, n)\n",
         "\n",
         "  return y"
-      ],
-      "metadata": {
-        "id": "k266huRznoRk"
-      },
-      "execution_count": null,
-      "outputs": []
+      ]
     },
     {
       "cell_type": "code",
-      "source": [
-        "pred = custom_tfidf_sentec_predict(test_df[\"article\"], mean_size)\n",
-        "res = Rouge().get_scores(pred, test_df[\"abstract\"], avg=True, ignore_empty=True)\n",
-        "\n",
-        "show_res(res, test_df[\"article\"][0], pred[0], test_df[\"abstract\"][0])"
-      ],
+      "execution_count": null,
       "metadata": {
         "colab": {
           "base_uri": "https://localhost:8080/"
@@ -1234,18 +1213,17 @@
         "id": "dQ_QndW3q91T",
         "outputId": "a411e24a-a413-4c71-d6e2-162fe7aaed70"
       },
-      "execution_count": null,
       "outputs": [
         {
-          "output_type": "stream",
           "name": "stderr",
+          "output_type": "stream",
           "text": [
             "100%|██████████| 11490/11490 [00:25<00:00, 457.62it/s]\n"
           ]
         },
         {
-          "output_type": "stream",
           "name": "stdout",
+          "output_type": "stream",
           "text": [
             "rouge-1 {'r': 0.4327709425874722, 'p': 0.3657728143833699, 'f': 0.3808199957417612}\n",
             "rouge-2 {'r': 0.18764872250033365, 'p': 0.14521596438649903, 'f': 0.15597825174954172}\n",
@@ -1255,29 +1233,40 @@
             "<s> marseille prosecutor says \" so far no videos were used in the crash investigation \" despite media reports . </s> <s> journalists at bild and paris match are \" very confident \" the video clip is real , an editor says . </s> <s> andreas lubitz had informed his lufthansa training school of an episode of severe depression , airline says . </s>\n"
           ]
         }
+      ],
+      "source": [
+        "pred = custom_tfidf_sentec_predict(test_df[\"article\"], mean_size)\n",
+        "res = Rouge().get_scores(pred, test_df[\"abstract\"], avg=True, ignore_empty=True)\n",
+        "\n",
+        "show_res(res, test_df[\"article\"][0], pred[0], test_df[\"abstract\"][0])"
       ]
     },
     {
       "cell_type": "markdown",
-      "source": [
-        "##Esamble mutple features for scoring"
-      ],
       "metadata": {
         "id": "AVlkDBtzJ6Qw"
-      }
+      },
+      "source": [
+        "##Esamble mutple features for scoring"
+      ]
     },
     {
       "cell_type": "markdown",
+      "metadata": {
+        "id": "cAEdN-ZkJcLk"
+      },
       "source": [
         "### Topic Frequancy sentace scoring\n",
         "Improvedmet, score each sentace using the frequancy of word in the article"
-      ],
-      "metadata": {
-        "id": "cAEdN-ZkJcLk"
-      }
+      ]
     },
     {
       "cell_type": "code",
+      "execution_count": null,
+      "metadata": {
+        "id": "GCg0iDFqSZjr"
+      },
+      "outputs": [],
       "source": [
         "# No stop words\n",
         "def build_word_frequancy(sentences):\n",
@@ -1330,15 +1319,15 @@
         "  scores = [score / norm for score in scores]\n",
         "  \n",
         "  return scores"
-      ],
-      "metadata": {
-        "id": "GCg0iDFqSZjr"
-      },
-      "execution_count": 13,
-      "outputs": []
+      ]
     },
     {
       "cell_type": "code",
+      "execution_count": null,
+      "metadata": {
+        "id": "TaablRQOJJXI"
+      },
+      "outputs": [],
       "source": [
         "# Need the look over that this is corect\n",
         "def topic_token_freq_predict(x, n=0.15):\n",
@@ -1367,21 +1356,11 @@
         "    y[i] = score_predict(scores, sentences, n)\n",
         "\n",
         "  return y"
-      ],
-      "metadata": {
-        "id": "TaablRQOJJXI"
-      },
-      "execution_count": 14,
-      "outputs": []
+      ]
     },
     {
       "cell_type": "code",
-      "source": [
-        "pred = topic_token_freq_predict(test_df[\"article\"], mean_size)\n",
-        "res = Rouge().get_scores(pred, test_df[\"abstract\"], avg=True, ignore_empty=True)\n",
-        "\n",
-        "show_res(res, test_df[\"article\"][0], pred[0], test_df[\"abstract\"][0])"
-      ],
+      "execution_count": null,
       "metadata": {
         "colab": {
           "base_uri": "https://localhost:8080/"
@@ -1389,11 +1368,10 @@
         "id": "Z6RFkb04JUCt",
         "outputId": "c12caa0c-6315-46fb-b07b-817ec828f463"
       },
-      "execution_count": 21,
       "outputs": [
         {
-          "output_type": "stream",
           "name": "stdout",
+          "output_type": "stream",
           "text": [
             "rouge-1 {'r': 0.5190308051487181, 'p': 0.2511848848659009, 'f': 0.3306927573938434}\n",
             "rouge-2 {'r': 0.20396973150132666, 'p': 0.08600626846502998, 'f': 0.11739511046531927}\n",
@@ -1403,16 +1381,17 @@
             "<s> marseille prosecutor says \" so far no videos were used in the crash investigation \" despite media reports . </s> <s> journalists at bild and paris match are \" very confident \" the video clip is real , an editor says . </s> <s> andreas lubitz had informed his lufthansa training school of an episode of severe depression , airline says . </s>\n"
           ]
         }
-      ]
-    },
-    {
-      "cell_type": "code",
+      ],
       "source": [
-        "pred = topic_freq_predict(test_df[\"article\"], mean_size)\n",
+        "pred = topic_token_freq_predict(test_df[\"article\"], mean_size)\n",
         "res = Rouge().get_scores(pred, test_df[\"abstract\"], avg=True, ignore_empty=True)\n",
         "\n",
         "show_res(res, test_df[\"article\"][0], pred[0], test_df[\"abstract\"][0])"
-      ],
+      ]
+    },
+    {
+      "cell_type": "code",
+      "execution_count": null,
       "metadata": {
         "colab": {
           "base_uri": "https://localhost:8080/"
@@ -1420,18 +1399,17 @@
         "id": "qY9xlXF8T_2d",
         "outputId": "9768ae4d-9ce7-474b-d270-daefe895eff4"
       },
-      "execution_count": 22,
       "outputs": [
         {
-          "output_type": "stream",
           "name": "stderr",
+          "output_type": "stream",
           "text": [
             "100%|██████████| 11490/11490 [00:19<00:00, 604.03it/s]\n"
           ]
         },
         {
-          "output_type": "stream",
           "name": "stdout",
+          "output_type": "stream",
           "text": [
             "rouge-1 {'r': 0.5153720235486683, 'p': 0.26397154823933255, 'f': 0.3404738734103197}\n",
             "rouge-2 {'r': 0.20877466897314648, 'p': 0.09429312394070075, 'f': 0.12580899623205288}\n",
@@ -1441,20 +1419,31 @@
             "<s> marseille prosecutor says \" so far no videos were used in the crash investigation \" despite media reports . </s> <s> journalists at bild and paris match are \" very confident \" the video clip is real , an editor says . </s> <s> andreas lubitz had informed his lufthansa training school of an episode of severe depression , airline says . </s>\n"
           ]
         }
+      ],
+      "source": [
+        "pred = topic_freq_predict(test_df[\"article\"], mean_size)\n",
+        "res = Rouge().get_scores(pred, test_df[\"abstract\"], avg=True, ignore_empty=True)\n",
+        "\n",
+        "show_res(res, test_df[\"article\"][0], pred[0], test_df[\"abstract\"][0])"
       ]
     },
     {
       "cell_type": "markdown",
+      "metadata": {
+        "id": "yG5DAit4bRkj"
+      },
       "source": [
         "### Proper nounes scoring\n",
         "Scores a sentace depending on the relative amound of proper nounes in a sentace"
-      ],
-      "metadata": {
-        "id": "yG5DAit4bRkj"
-      }
+      ]
     },
     {
       "cell_type": "code",
+      "execution_count": null,
+      "metadata": {
+        "id": "i-M_MJv1oU2P"
+      },
+      "outputs": [],
       "source": [
         "def propn_scoring(sentences):\n",
         "  scores = []\n",
@@ -1481,21 +1470,11 @@
         "    y[i] = score_predict(sores, sentences, n)\n",
         "\n",
         "  return y"
-      ],
-      "metadata": {
-        "id": "i-M_MJv1oU2P"
-      },
-      "execution_count": 15,
-      "outputs": []
+      ]
     },
     {
       "cell_type": "code",
-      "source": [
-        "pred = propn_sentec_predict(test_df[\"article\"], mean_size)\n",
-        "res = Rouge().get_scores(pred, test_df[\"abstract\"], avg=True, ignore_empty=True)\n",
-        "\n",
-        "show_res(res, test_df[\"article\"][0], pred[0], test_df[\"abstract\"][0])"
-      ],
+      "execution_count": null,
       "metadata": {
         "colab": {
           "base_uri": "https://localhost:8080/"
@@ -1503,18 +1482,17 @@
         "id": "3bqYxiql1m2e",
         "outputId": "d979c5ae-101d-40a5-c29e-38423a54d5e9"
       },
-      "execution_count": null,
       "outputs": [
         {
-          "output_type": "stream",
           "name": "stderr",
+          "output_type": "stream",
           "text": [
             "100%|██████████| 11490/11490 [00:09<00:00, 1181.77it/s]\n"
           ]
         },
         {
-          "output_type": "stream",
           "name": "stdout",
+          "output_type": "stream",
           "text": [
             "rouge-1 {'r': 0.4284412363876721, 'p': 0.3118531734804042, 'f': 0.34715671637753737}\n",
             "rouge-2 {'r': 0.17486925077065454, 'p': 0.11942440267249803, 'f': 0.13523900318760687}\n",
@@ -1524,19 +1502,30 @@
             "<s> marseille prosecutor says \" so far no videos were used in the crash investigation \" despite media reports . </s> <s> journalists at bild and paris match are \" very confident \" the video clip is real , an editor says . </s> <s> andreas lubitz had informed his lufthansa training school of an episode of severe depression , airline says . </s>\n"
           ]
         }
+      ],
+      "source": [
+        "pred = propn_sentec_predict(test_df[\"article\"], mean_size)\n",
+        "res = Rouge().get_scores(pred, test_df[\"abstract\"], avg=True, ignore_empty=True)\n",
+        "\n",
+        "show_res(res, test_df[\"article\"][0], pred[0], test_df[\"abstract\"][0])"
       ]
     },
     {
       "cell_type": "markdown",
-      "source": [
-        "### Doubel positinal feature"
-      ],
       "metadata": {
         "id": "kOfoONa3N4s4"
-      }
+      },
+      "source": [
+        "### Doubel positinal feature"
+      ]
     },
     {
       "cell_type": "code",
+      "execution_count": null,
+      "metadata": {
+        "id": "cbHEbEyUtqfP"
+      },
+      "outputs": [],
       "source": [
         "def position_scoring(sentences):\n",
         "  scores = []\n",
@@ -1561,21 +1550,11 @@
         "    y[i] = score_predict(sores, sentences, n)\n",
         "\n",
         "  return y"
-      ],
-      "metadata": {
-        "id": "cbHEbEyUtqfP"
-      },
-      "execution_count": 16,
-      "outputs": []
+      ]
     },
     {
       "cell_type": "code",
-      "source": [
-        "pred = pos_sentec_predict(test_df[\"article\"], mean_size)\n",
-        "res = Rouge().get_scores(pred, test_df[\"abstract\"], avg=True, ignore_empty=True)\n",
-        "\n",
-        "show_res(res, test_df[\"article\"][0], pred[0], test_df[\"abstract\"][0])"
-      ],
+      "execution_count": null,
       "metadata": {
         "colab": {
           "base_uri": "https://localhost:8080/"
@@ -1583,18 +1562,17 @@
         "id": "P_EDnZcOty2a",
         "outputId": "433a7b66-98db-4a93-dd75-5130a22febb4"
       },
-      "execution_count": null,
       "outputs": [
         {
-          "output_type": "stream",
           "name": "stderr",
+          "output_type": "stream",
           "text": [
             "100%|██████████| 11490/11490 [00:03<00:00, 3219.61it/s]\n"
           ]
         },
         {
-          "output_type": "stream",
           "name": "stdout",
+          "output_type": "stream",
           "text": [
             "rouge-1 {'r': 0.5151772281331103, 'p': 0.3185743140352747, 'f': 0.3841591283219293}\n",
             "rouge-2 {'r': 0.219487595215552, 'p': 0.1258180777193021, 'f': 0.15486468957024846}\n",
@@ -1604,19 +1582,30 @@
             "<s> marseille prosecutor says \" so far no videos were used in the crash investigation \" despite media reports . </s> <s> journalists at bild and paris match are \" very confident \" the video clip is real , an editor says . </s> <s> andreas lubitz had informed his lufthansa training school of an episode of severe depression , airline says . </s>\n"
           ]
         }
+      ],
+      "source": [
+        "pred = pos_sentec_predict(test_df[\"article\"], mean_size)\n",
+        "res = Rouge().get_scores(pred, test_df[\"abstract\"], avg=True, ignore_empty=True)\n",
+        "\n",
+        "show_res(res, test_df[\"article\"][0], pred[0], test_df[\"abstract\"][0])"
       ]
     },
     {
       "cell_type": "markdown",
-      "source": [
-        "### numeric feature"
-      ],
       "metadata": {
         "id": "lQIgd5YxJqqW"
-      }
+      },
+      "source": [
+        "### numeric feature"
+      ]
     },
     {
       "cell_type": "code",
+      "execution_count": null,
+      "metadata": {
+        "id": "PKYeKIeGzc-j"
+      },
+      "outputs": [],
       "source": [
         "def numeric_scoring(sentences):\n",
         "  scores = []\n",
@@ -1647,21 +1636,11 @@
         "    y[i] = score_predict(sores, sentences, n)\n",
         "\n",
         "  return y"
-      ],
-      "metadata": {
-        "id": "PKYeKIeGzc-j"
-      },
-      "execution_count": 17,
-      "outputs": []
+      ]
     },
     {
       "cell_type": "code",
-      "source": [
-        "pred = num_sentec_predict(test_df[\"article\"], mean_size)\n",
-        "res = Rouge().get_scores(pred, test_df[\"abstract\"], avg=True, ignore_empty=True)\n",
-        "\n",
-        "show_res(res, test_df[\"article\"][0], pred[0], test_df[\"abstract\"][0])"
-      ],
+      "execution_count": null,
       "metadata": {
         "colab": {
           "base_uri": "https://localhost:8080/"
@@ -1669,18 +1648,17 @@
         "id": "iZmiX0HNzjC0",
         "outputId": "ac81ec12-fcae-4c0a-a037-ced00b3e2d26"
       },
-      "execution_count": null,
       "outputs": [
         {
-          "output_type": "stream",
           "name": "stderr",
+          "output_type": "stream",
           "text": [
             "100%|██████████| 11490/11490 [00:06<00:00, 1825.70it/s]\n"
           ]
         },
         {
-          "output_type": "stream",
           "name": "stdout",
+          "output_type": "stream",
           "text": [
             "rouge-1 {'r': 0.46821896231543336, 'p': 0.28488436843207504, 'f': 0.3445767899948431}\n",
             "rouge-2 {'r': 0.18628027018438126, 'p': 0.10520583476826827, 'f': 0.12977776347901512}\n",
@@ -1690,19 +1668,30 @@
             "<s> marseille prosecutor says \" so far no videos were used in the crash investigation \" despite media reports . </s> <s> journalists at bild and paris match are \" very confident \" the video clip is real , an editor says . </s> <s> andreas lubitz had informed his lufthansa training school of an episode of severe depression , airline says . </s>\n"
           ]
         }
+      ],
+      "source": [
+        "pred = num_sentec_predict(test_df[\"article\"], mean_size)\n",
+        "res = Rouge().get_scores(pred, test_df[\"abstract\"], avg=True, ignore_empty=True)\n",
+        "\n",
+        "show_res(res, test_df[\"article\"][0], pred[0], test_df[\"abstract\"][0])"
       ]
     },
     {
       "cell_type": "markdown",
-      "source": [
-        "### Legth featuer"
-      ],
       "metadata": {
         "id": "G4lJTh3bJk41"
-      }
+      },
+      "source": [
+        "### Legth featuer"
+      ]
     },
     {
       "cell_type": "code",
+      "execution_count": null,
+      "metadata": {
+        "id": "cH7AfdoG0ICx"
+      },
+      "outputs": [],
       "source": [
         "def leght_scoring(sentences):\n",
         "  scores = []\n",
@@ -1730,21 +1719,11 @@
         "    y[i] = score_predict(sores, sentences, n)\n",
         "\n",
         "  return y"
-      ],
-      "metadata": {
-        "id": "cH7AfdoG0ICx"
-      },
-      "execution_count": 18,
-      "outputs": []
+      ]
     },
     {
       "cell_type": "code",
-      "source": [
-        "pred = length_sentec_predict(test_df[\"article\"], mean_size)\n",
-        "res = Rouge().get_scores(pred, test_df[\"abstract\"], avg=True, ignore_empty=True)\n",
-        "\n",
-        "show_res(res, test_df[\"article\"][0], pred[0], test_df[\"abstract\"][0])"
-      ],
+      "execution_count": null,
       "metadata": {
         "colab": {
           "base_uri": "https://localhost:8080/"
@@ -1752,18 +1731,17 @@
         "id": "sKJbeHNs0WCE",
         "outputId": "45517ef6-ae08-4642-d40a-d7b3235a42e4"
       },
-      "execution_count": null,
       "outputs": [
         {
-          "output_type": "stream",
           "name": "stderr",
+          "output_type": "stream",
           "text": [
             "100%|██████████| 11490/11490 [00:10<00:00, 1114.34it/s]\n"
           ]
         },
         {
-          "output_type": "stream",
           "name": "stdout",
+          "output_type": "stream",
           "text": [
             "rouge-1 {'r': 0.5412036100620485, 'p': 0.24227678928861945, 'f': 0.32773924649427716}\n",
             "rouge-2 {'r': 0.21092924299480134, 'p': 0.08364319845898473, 'f': 0.11651463692847655}\n",
@@ -1773,19 +1751,30 @@
             "<s> marseille prosecutor says \" so far no videos were used in the crash investigation \" despite media reports . </s> <s> journalists at bild and paris match are \" very confident \" the video clip is real , an editor says . </s> <s> andreas lubitz had informed his lufthansa training school of an episode of severe depression , airline says . </s>\n"
           ]
         }
+      ],
+      "source": [
+        "pred = length_sentec_predict(test_df[\"article\"], mean_size)\n",
+        "res = Rouge().get_scores(pred, test_df[\"abstract\"], avg=True, ignore_empty=True)\n",
+        "\n",
+        "show_res(res, test_df[\"article\"][0], pred[0], test_df[\"abstract\"][0])"
       ]
     },
     {
       "cell_type": "markdown",
-      "source": [
-        "###Document feature"
-      ],
       "metadata": {
         "id": "kb5CBrWVQaEn"
-      }
+      },
+      "source": [
+        "###Document feature"
+      ]
     },
     {
       "cell_type": "code",
+      "execution_count": null,
+      "metadata": {
+        "id": "CAA43zT9HQML"
+      },
+      "outputs": [],
       "source": [
         "def document_scoring(sentences):\n",
         "  scores = []\n",
@@ -1813,21 +1802,11 @@
         "    y[i] = score_predict(sores, sentences, n)\n",
         "\n",
         "  return y"
-      ],
-      "metadata": {
-        "id": "CAA43zT9HQML"
-      },
-      "execution_count": 19,
-      "outputs": []
+      ]
     },
     {
       "cell_type": "code",
-      "source": [
-        "pred = documetn_feature_predict(test_df[\"article\"], mean_size)\n",
-        "res = Rouge().get_scores(pred, test_df[\"abstract\"], avg=True, ignore_empty=True)\n",
-        "\n",
-        "show_res(res, test_df[\"article\"][0], pred[0], test_df[\"abstract\"][0])"
-      ],
+      "execution_count": null,
       "metadata": {
         "colab": {
           "base_uri": "https://localhost:8080/"
@@ -1835,18 +1814,17 @@
         "id": "VU69Wx7zQdwz",
         "outputId": "e6718697-795b-4914-9a30-81085f8a812b"
       },
-      "execution_count": 28,
       "outputs": [
         {
-          "output_type": "stream",
           "name": "stderr",
+          "output_type": "stream",
           "text": [
             "100%|██████████| 1000/1000 [00:00<00:00, 1954.35it/s]\n"
           ]
         },
         {
-          "output_type": "stream",
           "name": "stdout",
+          "output_type": "stream",
           "text": [
             "rouge-1 {'r': 0.5456546117233861, 'p': 0.17197558127325838, 'f': 0.2581732344778769}\n",
             "rouge-2 {'r': 0.20439768714368356, 'p': 0.053170689363587466, 'f': 0.08308144269583169}\n",
@@ -1856,19 +1834,30 @@
             "<s> marseille prosecutor says \" so far no videos were used in the crash investigation \" despite media reports . </s> <s> journalists at bild and paris match are \" very confident \" the video clip is real , an editor says . </s> <s> andreas lubitz had informed his lufthansa training school of an episode of severe depression , airline says . </s>\n"
           ]
         }
+      ],
+      "source": [
+        "pred = documetn_feature_predict(test_df[\"article\"], mean_size)\n",
+        "res = Rouge().get_scores(pred, test_df[\"abstract\"], avg=True, ignore_empty=True)\n",
+        "\n",
+        "show_res(res, test_df[\"article\"][0], pred[0], test_df[\"abstract\"][0])"
       ]
     },
     {
       "cell_type": "markdown",
-      "source": [
-        "### Skip bigram feature"
-      ],
       "metadata": {
         "id": "ZgQyBwPoUZXf"
-      }
+      },
+      "source": [
+        "### Skip bigram feature"
+      ]
     },
     {
       "cell_type": "code",
+      "execution_count": null,
+      "metadata": {
+        "id": "v44FmbyUUctw"
+      },
+      "outputs": [],
       "source": [
         "def create_skip_bigram(sentence):\n",
         "    bigrams = []\n",
@@ -1924,21 +1913,11 @@
         "    y[i] = score_predict(sores, sentences, n)\n",
         "\n",
         "  return y"
-      ],
-      "metadata": {
-        "id": "v44FmbyUUctw"
-      },
-      "execution_count": 20,
-      "outputs": []
+      ]
     },
     {
       "cell_type": "code",
-      "source": [
-        "pred = skip_bigram_predict(test_df[\"article\"], mean_size)\n",
-        "res = Rouge().get_scores(pred, test_df[\"abstract\"], avg=True, ignore_empty=True)\n",
-        "\n",
-        "show_res(res, test_df[\"article\"][0], pred[0], test_df[\"abstract\"][0])"
-      ],
+      "execution_count": null,
       "metadata": {
         "colab": {
           "base_uri": "https://localhost:8080/"
@@ -1946,18 +1925,17 @@
         "id": "oU1lcRiEUeDb",
         "outputId": "f8b9723e-30e3-437a-f4d5-f45300ef57a6"
       },
-      "execution_count": 34,
       "outputs": [
         {
-          "output_type": "stream",
           "name": "stderr",
+          "output_type": "stream",
           "text": [
             "100%|██████████| 11490/11490 [00:36<00:00, 311.96it/s]\n"
           ]
         },
         {
-          "output_type": "stream",
           "name": "stdout",
+          "output_type": "stream",
           "text": [
             "rouge-1 {'r': 0.5331517161344754, 'p': 0.2697788013344374, 'f': 0.34812225462745083}\n",
             "rouge-2 {'r': 0.21986440865039367, 'p': 0.09965623444666807, 'f': 0.13208358610321472}\n",
@@ -1967,19 +1945,30 @@
             "<s> marseille prosecutor says \" so far no videos were used in the crash investigation \" despite media reports . </s> <s> journalists at bild and paris match are \" very confident \" the video clip is real , an editor says . </s> <s> andreas lubitz had informed his lufthansa training school of an episode of severe depression , airline says . </s>\n"
           ]
         }
+      ],
+      "source": [
+        "pred = skip_bigram_predict(test_df[\"article\"], mean_size)\n",
+        "res = Rouge().get_scores(pred, test_df[\"abstract\"], avg=True, ignore_empty=True)\n",
+        "\n",
+        "show_res(res, test_df[\"article\"][0], pred[0], test_df[\"abstract\"][0])"
       ]
     },
     {
       "cell_type": "markdown",
-      "source": [
-        "### Ensamle features"
-      ],
       "metadata": {
         "id": "JBwZlHUsQeJA"
-      }
+      },
+      "source": [
+        "### Ensamle features"
+      ]
     },
     {
       "cell_type": "code",
+      "execution_count": null,
+      "metadata": {
+        "id": "RizOIKNNMm1K"
+      },
+      "outputs": [],
       "source": [
         "def ensamle_predict(x, n=0.15):\n",
         "  y = np.full(x.shape, \"\", dtype=object)\n",
@@ -2026,21 +2015,11 @@
         "    y[i] = score_predict(scores, sentences, n)\n",
         "\n",
         "  return y"
-      ],
-      "metadata": {
-        "id": "RizOIKNNMm1K"
-      },
-      "execution_count": 46,
-      "outputs": []
+      ]
     },
     {
       "cell_type": "code",
-      "source": [
-        "pred = ensamle_predict(test_df[\"article\"], 4) # mean_size\n",
-        "res = Rouge().get_scores(pred, test_df[\"abstract\"], avg=True, ignore_empty=True)\n",
-        "\n",
-        "show_res(res, test_df[\"article\"][0], pred[0], test_df[\"abstract\"][0])"
-      ],
+      "execution_count": null,
       "metadata": {
         "colab": {
           "base_uri": "https://localhost:8080/"
@@ -2048,18 +2027,17 @@
         "id": "YFS-GvQKmupf",
         "outputId": "fd094766-c37d-437f-a891-0c60101496c6"
       },
-      "execution_count": 49,
       "outputs": [
         {
-          "output_type": "stream",
           "name": "stderr",
+          "output_type": "stream",
           "text": [
             "100%|██████████| 11490/11490 [01:42<00:00, 112.42it/s]\n"
           ]
         },
         {
-          "output_type": "stream",
           "name": "stdout",
+          "output_type": "stream",
           "text": [
             "rouge-1 {'r': 0.554803029931865, 'p': 0.2653813729833077, 'f': 0.3506436134433733}\n",
             "rouge-2 {'r': 0.2350577387321205, 'p': 0.09902583716219295, 'f': 0.13517847729980678}\n",
@@ -2069,23 +2047,33 @@
             "<s> marseille prosecutor says \" so far no videos were used in the crash investigation \" despite media reports . </s> <s> journalists at bild and paris match are \" very confident \" the video clip is real , an editor says . </s> <s> andreas lubitz had informed his lufthansa training school of an episode of severe depression , airline says . </s>\n"
           ]
         }
+      ],
+      "source": [
+        "pred = ensamle_predict(test_df[\"article\"], 4) # mean_size\n",
+        "res = Rouge().get_scores(pred, test_df[\"abstract\"], avg=True, ignore_empty=True)\n",
+        "\n",
+        "show_res(res, test_df[\"article\"][0], pred[0], test_df[\"abstract\"][0])"
       ]
     },
     {
       "cell_type": "markdown",
-      "source": [
-        "## LDA sentance classification\n",
-        "Classify each sentance and compare with the class of the articale"
-      ],
       "metadata": {
         "id": "J-jAOSeOk_hU"
-      }
+      },
+      "source": [
+        "## Topic model sentance classification\n",
+        "Classify each sentance and compare with the class of the articale"
+      ]
     },
     {
       "cell_type": "code",
+      "execution_count": null,
+      "metadata": {
+        "id": "8BLks7a-9sm7"
+      },
+      "outputs": [],
       "source": [
         "from gensim.corpora import Dictionary\n",
-        "from gensim.models.ldamodel import LdaModel\n",
         "\n",
         "document = []\n",
         "for text in val_df[\"article\"]:\n",
@@ -2097,22 +2085,18 @@
         "\n",
         "dictionary = Dictionary(document)\n",
         "\n",
-        "corpus = [dictionary.doc2bow(text) for text in document]\n",
-        "\n",
-        "num_topics=200\n",
-        "\n",
-        "model = LdaModel(corpus, num_topics=num_topics, id2word=dictionary, passes=10)"
-      ],
-      "metadata": {
-        "id": "lyTHO9DkBxKw"
-      },
-      "execution_count": null,
-      "outputs": []
+        "corpus = [dictionary.doc2bow(text) for text in document]"
+      ]
     },
     {
       "cell_type": "code",
+      "execution_count": null,
+      "metadata": {
+        "id": "ygrlg6K5-yFg"
+      },
+      "outputs": [],
       "source": [
-        "def lda_scoring(sentences):\n",
+        "def topic_model_scoring(sentences, model):\n",
         "\n",
         "  document = []\n",
         "  sent_tokens = []\n",
@@ -2125,7 +2109,7 @@
         "    document += tokens\n",
         "    sent_tokens.append(tokens)\n",
         "\n",
-        "  document_class = model[tokens] # modle is a global var\n",
+        "  document_class = model[tokens]\n",
         "\n",
         "  scores = []\n",
         "\n",
@@ -2153,32 +2137,46 @@
         "  \n",
         "  return scores\n",
         "\n",
-        "def lda_predict(x, n=0.15):\n",
+        "def topic_model_predict(x, model, n=0.15):\n",
         "  y = np.full(x.shape, \"\", dtype=object)\n",
         "\n",
         "  for i in tqdm(range(x.shape[0]), position=0, leave=True):\n",
         "\n",
         "    sentences = list(x[i].sents)\n",
         "\n",
-        "    sores = lda_scoring(sentences)\n",
+        "    sores = topic_model_scoring(sentences, model)\n",
         "    y[i] = score_predict(sores, sentences, n)\n",
         "\n",
         "  return y"
-      ],
+      ]
+    },
+    {
+      "cell_type": "markdown",
       "metadata": {
-        "id": "q91PomLEFMmv"
+        "id": "dt6QMPbW9eEe"
       },
-      "execution_count": 13,
-      "outputs": []
+      "source": [
+        "### LDA model"
+      ]
     },
     {
       "cell_type": "code",
+      "execution_count": null,
+      "metadata": {
+        "id": "lyTHO9DkBxKw"
+      },
+      "outputs": [],
       "source": [
-        "pred = lda_predict(test_df[\"article\"], mean_size)\n",
-        "res = Rouge().get_scores(pred, test_df[\"abstract\"], avg=True, ignore_empty=True)\n",
+        "from gensim.models import LdaModel\n",
         "\n",
-        "show_res(res, test_df[\"article\"][0], pred[0], test_df[\"abstract\"][0])"
-      ],
+        "num_topics=200\n",
+        "\n",
+        "ldamodel = LdaModel(corpus, num_topics=num_topics, id2word=dictionary, passes=10)"
+      ]
+    },
+    {
+      "cell_type": "code",
+      "execution_count": null,
       "metadata": {
         "colab": {
           "base_uri": "https://localhost:8080/"
@@ -2186,18 +2184,17 @@
         "id": "1Z56H8SFt4H9",
         "outputId": "5f4ce39f-9256-465d-b69f-d185d7582814"
       },
-      "execution_count": 23,
       "outputs": [
         {
-          "output_type": "stream",
           "name": "stderr",
+          "output_type": "stream",
           "text": [
             "100%|██████████| 11490/11490 [05:32<00:00, 34.55it/s]\n"
           ]
         },
         {
-          "output_type": "stream",
           "name": "stdout",
+          "output_type": "stream",
           "text": [
             "rouge-1 {'r': 0.41612549730559995, 'p': 0.27636609361551073, 'f': 0.32059772268343856}\n",
             "rouge-2 {'r': 0.14973316966611186, 'p': 0.09159569017280092, 'f': 0.10872732234493579}\n",
@@ -2207,7 +2204,91 @@
             "<s> marseille prosecutor says \" so far no videos were used in the crash investigation \" despite media reports . </s> <s> journalists at bild and paris match are \" very confident \" the video clip is real , an editor says . </s> <s> andreas lubitz had informed his lufthansa training school of an episode of severe depression , airline says . </s>\n"
           ]
         }
+      ],
+      "source": [
+        "pred = topic_model_predict(test_df[\"article\"], ldamodel, mean_size)\n",
+        "res = Rouge().get_scores(pred, test_df[\"abstract\"], avg=True, ignore_empty=True)\n",
+        "\n",
+        "show_res(res, test_df[\"article\"][0], pred[0], test_df[\"abstract\"][0])"
+      ]
+    },
+    {
+      "cell_type": "markdown",
+      "metadata": {
+        "id": "xpJQo5sNjIu2"
+      },
+      "source": [
+        "### LSI\n",
+        "Not realy ment for this but whanted to try"
+      ]
+    },
+    {
+      "cell_type": "code",
+      "execution_count": 26,
+      "metadata": {
+        "id": "tKgIsvQvjKiP"
+      },
+      "outputs": [],
+      "source": [
+        "from gensim.models import LsiModel\n",
+        "\n",
+        "num_topics=200\n",
+        "\n",
+        "lsimodel = LsiModel(corpus, num_topics=num_topics, id2word=dictionary)"
+      ]
+    },
+    {
+      "cell_type": "code",
+      "execution_count": null,
+      "metadata": {
+        "colab": {
+          "background_save": true,
+          "base_uri": "https://localhost:8080/"
+        },
+        "id": "CH-sPbqV-e6M",
+        "outputId": "be348cad-e07a-4d12-818c-301bc43441de"
+      },
+      "outputs": [
+        {
+          "name": "stderr",
+          "output_type": "stream",
+          "text": [
+            "100%|██████████| 11490/11490 [03:47<00:00, 50.61it/s]\n"
+          ]
+        },
+        {
+          "name": "stdout",
+          "output_type": "stream",
+          "text": [
+            "rouge-1 {'r': 0.32190889627816954, 'p': 0.2757006069341293, 'f': 0.2841674845861466}\n",
+            "rouge-2 {'r': 0.10358059902316921, 'p': 0.08231057647815537, 'f': 0.08679217159929435}\n",
+            "rouge-l {'r': 0.29611260730049355, 'p': 0.25407712985802794, 'f': 0.26153426798162704}\n",
+            "marseille , france ( cnn ) the french prosecutor leading an investigation into the crash of germanwings flight 9525 insisted wednesday that he was not aware of any video footage from on board the plane . marseille prosecutor brice robin told cnn that \" so far no videos were used in the crash investigation . \" he added , \" a person who has such a video needs to immediately give it to the investigators . \" robin 's comments follow claims by two magazines , german daily bild and french paris match , of a cell phone video showing the harrowing final seconds from on board germanwings flight 9525 as it crashed into the french alps . all 150 on board were killed . paris match and bild reported that the video was recovered from a phone at the wreckage site . the two publications described the supposed video , but did not post it on their websites . the publications said that they watched the video , which was found by a source close to the investigation . \" one can hear cries of ' my god ' in several languages , \" paris match reported . \" metallic banging can also be heard more than three times , perhaps of the pilot trying to open the cockpit door with a heavy object . towards the end , after a heavy shake , stronger than the others , the screaming intensifies . then nothing . \" \" it is a very disturbing scene , \" said julian reichelt , editor - in - chief of bild online . an official with france 's accident investigation agency , the bea , said the agency is not aware of any such video . lt. col. jean - marc menichini , a french gendarmerie spokesman in charge of communications on rescue efforts around the germanwings crash site , told cnn that the reports were \" completely wrong \" and \" unwarranted . \" cell phones have been collected at the site , he said , but that they \" had n't been exploited yet . \" menichini said he believed the cell phones would need to be sent to the criminal research institute in rosny sous - bois , near paris , in order to be analyzed by specialized technicians working hand - in - hand with investigators . but none of the cell phones found so far have been sent to the institute , menichini said . asked whether staff involved in the search could have leaked a memory card to the media , menichini answered with a categorical \" no . \" reichelt told \" erin burnett : outfront \" that he had watched the video and stood by the report , saying bild and paris match are \" very confident \" that the clip is real . he noted that investigators only revealed they 'd recovered cell phones from the crash site after bild and paris match published their reports . \" that is something we did not know before . ... overall we can say many things of the investigation were n't revealed by the investigation at the beginning , \" he said . what was mental state of germanwings co-pilot ? german airline lufthansa confirmed tuesday that co-pilot andreas lubitz had battled depression years before he took the controls of germanwings flight 9525 , which he 's accused of deliberately crashing last week in the french alps . lubitz told his lufthansa flight training school in 2009 that he had a \" previous episode of severe depression , \" the airline said tuesday . email correspondence between lubitz and the school discovered in an internal investigation , lufthansa said , included medical documents he submitted in connection with resuming his flight training . the announcement indicates that lufthansa , the parent company of germanwings , knew of lubitz 's battle with depression , allowed him to continue training and ultimately put him in the cockpit . lufthansa , whose ceo carsten spohr previously said lubitz was 100 % fit to fly , described its statement tuesday as a \" swift and seamless clarification \" and said it was sharing the information and documents -- including training and medical records -- with public prosecutors . spohr traveled to the crash site wednesday , where recovery teams have been working for the past week to recover human remains and plane debris scattered across a steep mountainside . he saw the crisis center set up in seyne - les - alpes , laid a wreath in the village of le vernet , closer to the crash site , where grieving families have left flowers at a simple stone memorial . menichini told cnn late tuesday that no visible human remains were left at the site but recovery teams would keep searching . french president francois hollande , speaking tuesday , said that it should be possible to identify all the victims using dna analysis by the end of the week , sooner than authorities had previously suggested . in the meantime , the recovery of the victims ' personal belongings will start wednesday , menichini said . among those personal belongings could be more cell phones belonging to the 144 passengers and six crew on board . check out the latest from our correspondents . the details about lubitz 's correspondence with the flight school during his training were among several developments as investigators continued to delve into what caused the crash and lubitz 's possible motive for downing the jet . a lufthansa spokesperson told cnn on tuesday that lubitz had a valid medical certificate , had passed all his examinations and \" held all the licenses required . \" earlier , a spokesman for the prosecutor 's office in dusseldorf , christoph kumpa , said medical records reveal lubitz suffered from suicidal tendencies at some point before his aviation career and underwent psychotherapy before he got his pilot 's license . kumpa emphasized there 's no evidence suggesting lubitz was suicidal or acting aggressively before the crash . investigators are looking into whether lubitz feared his medical condition would cause him to lose his pilot 's license , a european government official briefed on the investigation told cnn on tuesday . while flying was \" a big part of his life , \" the source said , it 's only one theory being considered . another source , a law enforcement official briefed on the investigation , also told cnn that authorities believe the primary motive for lubitz to bring down the plane was that he feared he would not be allowed to fly because of his medical problems . lubitz 's girlfriend told investigators he had seen an eye doctor and a neuropsychologist , both of whom deemed him unfit to work recently and concluded he had psychological issues , the european government official said . but no matter what details emerge about his previous mental health struggles , there 's more to the story , said brian russell , a forensic psychologist . \" psychology can explain why somebody would turn rage inward on themselves about the fact that maybe they were n't going to keep doing their job and they 're upset about that and so they 're suicidal , \" he said . \" but there is no mental illness that explains why somebody then feels entitled to also take that rage and turn it outward on 149 other people who had nothing to do with the person 's problems . \" germanwings crash compensation : what we know . who was the captain of germanwings flight 9525 ? cnn 's margot haddad reported from marseille and pamela brown from dusseldorf , while laura smith - spark wrote from london . cnn 's frederik pleitgen , pamela boykoff , antonia mortensen , sandrine amiel and anna - maja rappard contributed to this report . \n",
+            "<s> cnn 's frederik pleitgen , pamela boykoff , antonia mortensen , sandrine amiel and anna - maja rappard contributed to this report . </s> <s> then nothing . \" \" </s> <s> check out the latest from our correspondents . </s> <s> towards the end , after a heavy shake , stronger than the others , the screaming intensifies . </s>\n",
+            "<s> marseille prosecutor says \" so far no videos were used in the crash investigation \" despite media reports . </s> <s> journalists at bild and paris match are \" very confident \" the video clip is real , an editor says . </s> <s> andreas lubitz had informed his lufthansa training school of an episode of severe depression , airline says . </s>\n"
+          ]
+        }
+      ],
+      "source": [
+        "pred = topic_model_predict(test_df[\"article\"], lsimodel, 4) # mean_size\n",
+        "res = Rouge().get_scores(pred, test_df[\"abstract\"], avg=True, ignore_empty=True)\n",
+        "\n",
+        "show_res(res, test_df[\"article\"][0], pred[0], test_df[\"abstract\"][0])"
       ]
     }
-  ]
+  ],
+  "metadata": {
+    "colab": {
+      "provenance": []
+    },
+    "kernelspec": {
+      "display_name": "Python 3",
+      "name": "python3"
+    },
+    "language_info": {
+      "name": "python"
+    }
+  },
+  "nbformat": 4,
+  "nbformat_minor": 0
 }
\ No newline at end of file
-- 
GitLab