diff --git a/TDDE16_project.ipynb b/TDDE16_project.ipynb index aaabfcfaa7977b8f83251a43df4a3b2e4149e298..4b1ba54b86cbe75ab21d241a3757aab737665909 100644 --- a/TDDE16_project.ipynb +++ b/TDDE16_project.ipynb @@ -71,7 +71,7 @@ "metadata": { "id": "yaXQQX8pKK0d" }, - "execution_count": 11, + "execution_count": 8, "outputs": [] }, { @@ -82,7 +82,7 @@ "metadata": { "id": "SyoOYXaxKO_5" }, - "execution_count": 17, + "execution_count": 27, "outputs": [] }, { @@ -132,7 +132,7 @@ "height": 363 }, "id": "E3JrnaOnTuan", - "outputId": "47e22720-c9b2-43f2-de96-3f09e1d6c8dc" + "outputId": "a828b015-3170-40e0-b262-7ea2a051fbe7" }, "execution_count": 1, "outputs": [ @@ -166,7 +166,7 @@ ], "text/html": [ "\n", - " <div id=\"df-934507fe-e6af-4515-93d7-8d1104bf23f9\">\n", + " <div id=\"df-39b2af67-f892-4f42-ad50-bff11c942128\">\n", " <div class=\"colab-df-container\">\n", " <div>\n", "<style scoped>\n", @@ -244,7 +244,7 @@ " </tbody>\n", "</table>\n", "</div>\n", - " <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-934507fe-e6af-4515-93d7-8d1104bf23f9')\"\n", + " <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-39b2af67-f892-4f42-ad50-bff11c942128')\"\n", " title=\"Convert this dataframe to an interactive table.\"\n", " style=\"display:none;\">\n", " \n", @@ -295,12 +295,12 @@ "\n", " <script>\n", " const buttonEl =\n", - " document.querySelector('#df-934507fe-e6af-4515-93d7-8d1104bf23f9 button.colab-df-convert');\n", + " document.querySelector('#df-39b2af67-f892-4f42-ad50-bff11c942128 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-934507fe-e6af-4515-93d7-8d1104bf23f9');\n", + " const element = document.querySelector('#df-39b2af67-f892-4f42-ad50-bff11c942128');\n", " const dataTable =\n", " await google.colab.kernel.invokeFunction('convertToInteractive',\n", " [key], {});\n", @@ -360,9 +360,9 @@ "height": 424 }, "id": "4smlRgATTq9R", - "outputId": "b779d16a-0a91-423d-b4f8-929274168382" + "outputId": "40243bce-02f3-4acb-ddc3-17af8674d533" }, - "execution_count": 20, + "execution_count": 29, "outputs": [ { "output_type": "execute_result", @@ -385,7 +385,7 @@ ], "text/html": [ "\n", - " <div id=\"df-69dfb41a-c245-485f-af1a-8f14448fe882\">\n", + " <div id=\"df-5ebbd193-2122-402c-95b6-caad415b2590\">\n", " <div class=\"colab-df-container\">\n", " <div>\n", "<style scoped>\n", @@ -457,7 +457,7 @@ "</table>\n", "<p>200000 rows × 1 columns</p>\n", "</div>\n", - " <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-69dfb41a-c245-485f-af1a-8f14448fe882')\"\n", + " <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-5ebbd193-2122-402c-95b6-caad415b2590')\"\n", " title=\"Convert this dataframe to an interactive table.\"\n", " style=\"display:none;\">\n", " \n", @@ -508,12 +508,12 @@ "\n", " <script>\n", " const buttonEl =\n", - " document.querySelector('#df-69dfb41a-c245-485f-af1a-8f14448fe882 button.colab-df-convert');\n", + " document.querySelector('#df-5ebbd193-2122-402c-95b6-caad415b2590 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-69dfb41a-c245-485f-af1a-8f14448fe882');\n", + " const element = document.querySelector('#df-5ebbd193-2122-402c-95b6-caad415b2590');\n", " const dataTable =\n", " await google.colab.kernel.invokeFunction('convertToInteractive',\n", " [key], {});\n", @@ -536,7 +536,7 @@ ] }, "metadata": {}, - "execution_count": 20 + "execution_count": 29 } ] }, @@ -562,9 +562,9 @@ "base_uri": "https://localhost:8080/" }, "id": "efSxuraMaumc", - "outputId": "093e5603-ca31-417a-f493-882b4a6f6502" + "outputId": "55f24ccf-25e5-41ab-9cc6-7e8f443c5e79" }, - "execution_count": 6, + "execution_count": 2, "outputs": [ { "output_type": "stream", @@ -575,11 +575,21 @@ } ] }, + { + "cell_type": "code", + "source": [ + "import numpy as np" + ], + "metadata": { + "id": "YHEGU1xOyhHB" + }, + "execution_count": 3, + "outputs": [] + }, { "cell_type": "code", "source": [ "import matplotlib.pyplot as plt\n", - "import numpy as np\n", "\n", "art_word_count = np.zeros(train_df.shape[0])\n", "abs_word_count = np.zeros(train_df.shape[0])\n", @@ -721,7 +731,7 @@ "metadata": { "id": "JNbipR3lqJVN" }, - "execution_count": 4, + "execution_count": 5, "outputs": [] }, { @@ -736,9 +746,9 @@ "base_uri": "https://localhost:8080/" }, "id": "uL0sPSH6PVV9", - "outputId": "be7b0d37-4ebc-4eee-e80e-9c38a2df112b" + "outputId": "5aba39f1-c586-4263-db06-780d60a74672" }, - "execution_count": 5, + "execution_count": 6, "outputs": [ { "output_type": "execute_result", @@ -748,7 +758,7 @@ ] }, "metadata": {}, - "execution_count": 5 + "execution_count": 6 } ] }, @@ -766,15 +776,15 @@ "base_uri": "https://localhost:8080/" }, "id": "YmIWN4zxLB41", - "outputId": "edf4eff2-ab65-4194-b457-f87e90197c0f" + "outputId": "b86cd4a0-748f-409c-f7e9-e004ff56c822" }, - "execution_count": 6, + "execution_count": 9, "outputs": [ { "output_type": "stream", "name": "stderr", "text": [ - "100%|██████████| 11490/11490 [09:17<00:00, 20.62it/s]\n" + "100%|██████████| 11490/11490 [10:11<00:00, 18.80it/s]\n" ] } ] @@ -792,15 +802,15 @@ "base_uri": "https://localhost:8080/" }, "id": "CiOyTv4XpTpD", - "outputId": "29a2b9d2-24d3-40f4-855c-036f7dc38ff2" + "outputId": "c4cc6dc7-421b-4ca9-fa4c-cfd71112aa93" }, - "execution_count": 27, + "execution_count": 10, "outputs": [ { "output_type": "stream", "name": "stderr", "text": [ - "100%|██████████| 13368/13368 [03:37<00:00, 61.33it/s]\n" + "100%|██████████| 13368/13368 [03:34<00:00, 62.22it/s]\n" ] } ] @@ -829,6 +839,96 @@ "id": "xeMS33c-91DT" } }, + { + "cell_type": "code", + "source": [ + "!pip install rouge\n", + "from rouge import Rouge" + ], + "metadata": { + "id": "BryZtZwsOX4F" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "def balseline_predict(x):\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", + " y[i] = \"<s> \" + sentences[0].text + \" </s>\"\n", + "\n", + " return y\n", + "\n", + "\n", + "def show_res(res, ex_art=\"\", pred=\"\", ex_abs=\"\"):\n", + " print(\"rouge-1\", res[\"rouge-1\"])\n", + " print(\"rouge-2\", res[\"rouge-2\"])\n", + " print(\"rouge-l\", res[\"rouge-l\"])\n", + "\n", + " if ex_art:\n", + " print(ex_art)\n", + " print(pred)\n", + " print(ex_abs)" + ], + "metadata": { + "id": "7agp9wMpN0xz" + }, + "execution_count": 15, + "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])" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "L-0whCxfOTbt", + "outputId": "d548db26-c1e0-4072-80ec-fff359e8f12b" + }, + "execution_count": 52, + "outputs": [ + { + "output_type": "stream", + "name": "stderr", + "text": [ + "100%|██████████| 11490/11490 [00:01<00:00, 9720.53it/s]\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "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", + "rouge-l {'r': 0.2354625468211143, 'p': 0.41463153817664405, 'f': 0.29024010333878514}\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> 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 . </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" + ] + } + ] + }, + { + "cell_type": "markdown", + "source": [ + "### Baseline expation" + ], + "metadata": { + "id": "sOq7VEQZN1sp" + } + }, { "cell_type": "markdown", "source": [ @@ -841,6 +941,7 @@ { "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", @@ -850,25 +951,28 @@ " # -1 as the last element is not a senctance\n", " abs_legnth = len(row[\"abstract\"].split(\"</s>\")) - 1\n", "\n", - " legnths[index] = abs_legnth/art_legnth\n", + " rel_legnths[index] = abs_legnth/art_legnth\n", + " legnths[index] = abs_legnth\n", "\n", - "article_size = np.mean(legnths)\n", - "print('\\n',article_size)" + "article_size = np.mean(rel_legnths)\n", + "print('\\n',article_size)\n", + "mean_size = round(np.mean(legnths))\n", + "print(mean_size)" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "gYtzD-JJ9mP1", - "outputId": "78161288-ec14-4b92-fe55-a206bcf805c3" + "outputId": "02450357-9752-4f7f-93fa-4c130677f6a4" }, - "execution_count": 8, + "execution_count": 11, "outputs": [ { "output_type": "stream", "name": "stderr", "text": [ - "13368it [00:01, 7208.91it/s]" + "13368it [00:01, 8716.56it/s]" ] }, { @@ -876,7 +980,8 @@ "name": "stdout", "text": [ "\n", - " 0.1591287723319216\n" + " 0.1591287723319216\n", + "4\n" ] }, { @@ -891,56 +996,53 @@ { "cell_type": "code", "source": [ - "!pip install rouge" - ], - "metadata": { - "id": "4vG74DWb9wyY" - }, - "execution_count": null, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "from rouge import Rouge\n", + "def first_sentance_scoring(sentences):\n", + " scores = []\n", + " length = len(sentences)\n", + " pos = 0\n", + " for sent in sentences:\n", + " pos += 1\n", + " score = length - pos + 1\n", + " scores.append(score/length)\n", + " \n", + " return scores\n", + "\n", + "\n", + "def get_best_sentences(scores, sentences, n):\n", + " if n < 1:\n", + " n = max(round(len(sentences) * n), 1)\n", + " return np.array(sentences, dtype=object)[np.argsort(scores)[::-1][:n]]\n", "\n", "\n", - "def dummy_predict(x):\n", + "def score_predict(scores, sentences, n):\n", + " pred = get_best_sentences(scores, sentences, n)\n", + " pred = [\"<s> \" + el.text + \" </s>\" for el in pred]\n", + " return \" \".join(pred)\n", + "\n", + "\n", + "def potition_predict(x, 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", - " # Note, summarys has the <s> and </s> at the start and end of sentances\n", " \n", " sentences = list(x[i].sents)\n", - " n = max(round(len(sentences) * article_size), 1)\n", - "\n", - " pred = sentences[0:n] # take first n sentances\n", - " pred = [\"<s> \" + el.text + \" </s>\" for el in pred]\n", - " y[i] = \" \".join(pred)\n", "\n", - " return y\n", - "\n", - "def show_res(res, ex_art=\"\", pred=\"\", ex_abs=\"\"):\n", - " print(\"rouge-1\", res[\"rouge-1\"])\n", - " print(\"rouge-2\", res[\"rouge-2\"])\n", - " print(\"rouge-l\", res[\"rouge-l\"])\n", + " score = first_sentance_scoring(sentences)\n", + " y[i] = score_predict(score, sentences, n)\n", "\n", - " if ex_art:\n", - " print(ex_art)\n", - " print(pred)\n", - " print(ex_abs)" + " return y" ], "metadata": { "id": "azFyl5JO10kB" }, - "execution_count": 10, + "execution_count": 14, "outputs": [] }, { "cell_type": "code", "source": [ - "pred = dummy_predict(test_df[\"article\"])\n", - "res = Rouge().get_scores(pred, test_df[\"abstract\"], avg=True, ignore_empty=True) # 3 minuts\n", + "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])" ], @@ -949,26 +1051,26 @@ "base_uri": "https://localhost:8080/" }, "id": "2pVKOKCItw3o", - "outputId": "b48fd5ec-0cc3-4d8a-9bbe-98c9fc589810" + "outputId": "d76a6b1b-ef69-4f08-ed39-a40163637bf9" }, - "execution_count": 15, + "execution_count": 25, "outputs": [ { "output_type": "stream", "name": "stderr", "text": [ - "100%|██████████| 11490/11490 [00:02<00:00, 4192.62it/s]\n" + "100%|██████████| 11490/11490 [00:03<00:00, 3083.55it/s]\n" ] }, { "output_type": "stream", "name": "stdout", "text": [ - "rouge-1 {'r': 0.5980630536184217, 'p': 0.3474630054153283, 'f': 0.4223203014909853}\n", - "rouge-2 {'r': 0.2898344507023113, 'p': 0.15220125815434643, 'f': 0.18871526861854124}\n", - "rouge-l {'r': 0.5540219898724188, 'p': 0.32116153290820243, 'f': 0.3906562036677393}\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> 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 . </s> <s> marseille prosecutor brice robin told cnn that \" so far no videos were used in the crash investigation . \" </s> <s> he added , \" a person who has such a video needs to immediately give it to the investigators . \" </s> <s> 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 . </s> <s> all 150 on board were killed . </s> <s> paris match and bild reported that the video was recovered from a phone at the wreckage site . </s> <s> the two publications described the supposed video , but did not post it on their websites . </s> <s> the publications said that they watched the video , which was found by a source close to the investigation . \" </s>\n", + "rouge-1 {'r': 0.5787133737777755, 'p': 0.3612238237068001, 'f': 0.4349567252640679}\n", + "rouge-2 {'r': 0.27746472802087296, 'p': 0.15834677786172163, 'f': 0.19580566208795433}\n", + "rouge-l {'r': 0.5337311415715027, 'p': 0.3331051699825873, 'f': 0.4011161119311676}\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> 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 . </s> <s> marseille prosecutor brice robin told cnn that \" so far no videos were used in the crash investigation . \" </s> <s> he added , \" a person who has such a video needs to immediately give it to the investigators . \" </s> <s> 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 . </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" ] } @@ -1010,23 +1112,18 @@ " scores = []\n", " for sentence in sentences:\n", " score = 0\n", + " cnt = 0\n", " for word in sentence:\n", " if word.lemma_ in word_freq:\n", " score += word_freq[word.lemma_]\n", + " cnt += 1\n", " scores.append(score)\n", "\n", - " return scores\n", + " # Normilize (for the ensamble later)\n", + " for i in range(len(scores)):\n", + " scores[i] /= cnt\n", "\n", - "\n", - "def get_best_sentences(scores, sentences, n):\n", - " n = max(round(len(sentences) * n), 1)\n", - " return np.array(sentences, dtype=object)[np.argsort(scores)[::-1][:n]]\n", - "\n", - "\n", - "def score_predict(scores, sentences, n):\n", - " pred = get_best_sentences(scores, sentences, n)\n", - " pred = [\"<s> \" + el.text + \" </s>\" for el in pred]\n", - " return \" \".join(pred)\n", + " return scores\n", "\n", "\n", "def world_freq_predict(x, n=0.15):\n", @@ -1045,13 +1142,13 @@ "metadata": { "id": "5QLvk4Z_dOYt" }, - "execution_count": 11, + "execution_count": 26, "outputs": [] }, { "cell_type": "code", "source": [ - "pred = world_freq_predict(test_df[\"article\"], article_size)\n", + "pred = world_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])" @@ -1061,19 +1158,26 @@ "base_uri": "https://localhost:8080/" }, "id": "VDZk2CT3bcFq", - "outputId": "a707ce0a-b9e2-4841-83a6-26ef425e4bec" + "outputId": "3bd1bac8-a510-4589-aa9d-87894b07fd61" }, - "execution_count": 15, + "execution_count": 26, "outputs": [ + { + "output_type": "stream", + "name": "stderr", + "text": [ + "100%|██████████| 11490/11490 [00:22<00:00, 521.82it/s]\n" + ] + }, { "output_type": "stream", "name": "stdout", "text": [ - "rouge-1 {'r': 0.5351183302203895, 'p': 0.2571862805849292, 'f': 0.33115778761758863}\n", - "rouge-2 {'r': 0.21724416585192355, 'p': 0.09358535733523916, 'f': 0.12223977167631876}\n", - "rouge-l {'r': 0.4867935383251504, 'p': 0.2338962977383543, 'f': 0.3010944361978195}\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> 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 . \" </s> <s> 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 . </s> <s> 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 . </s> <s> 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 . </s> <s> but no matter what details emerge about his previous mental health struggles , there 's more to the story , said brian russell , a forensic psychologist . \" </s> <s> 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 . </s> <s> 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 . </s> <s> cell phones have been collected at the site , he said , but that they \" had n't been exploited yet . \" </s>\n", + "rouge-1 {'r': 0.5153784788936431, 'p': 0.26397131639984533, 'f': 0.3404755415544444}\n", + "rouge-2 {'r': 0.2087836253353453, 'p': 0.09429031913367779, 'f': 0.12580863552331523}\n", + "rouge-l {'r': 0.4677646498760434, 'p': 0.23963469605703272, 'f': 0.3090431011085219}\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> 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 . \" </s> <s> 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 . </s> <s> 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 . </s> <s> 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 . </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" ] } @@ -1097,7 +1201,7 @@ " for sents in sentences:\n", " text = []\n", " for word in sents:\n", - " if not word.is_stop and (word.pos_ == \"NOUN\" or word.pos_ == \"VERB\"):\n", + " if not word.is_stop and (word.pos_ == \"NOUN\" or word.pos_ == \"VERB\" or word.pos_ == \"PROPN\"):\n", " text.append(word.lemma_)\n", " if text:\n", " texts.append(\" \".join(text))\n", @@ -1122,14 +1226,14 @@ "metadata": { "id": "xBBHZTj6yqJT" }, - "execution_count": 16, + "execution_count": 12, "outputs": [] }, { "cell_type": "code", "source": [ "# Takes lotts of time\n", - "pred = tfidf_sentec_predict(test_df[\"article\"], article_size)\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])" @@ -1139,26 +1243,26 @@ "base_uri": "https://localhost:8080/" }, "id": "S27LXXEatbNe", - "outputId": "cae8873b-7d8c-4c47-8790-e6e346195604" + "outputId": "8982ed71-be52-4af3-eb00-a227e6919acb" }, - "execution_count": 21, + "execution_count": 17, "outputs": [ { "output_type": "stream", "name": "stderr", "text": [ - "100%|██████████| 11490/11490 [14:38<00:00, 13.08it/s]\n" + "100%|██████████| 11490/11490 [18:39<00:00, 10.26it/s]\n" ] }, { "output_type": "stream", "name": "stdout", "text": [ - "rouge-1 {'r': 0.5443683914073856, 'p': 0.2511477126978169, 'f': 0.3289015935042597}\n", - "rouge-2 {'r': 0.21405914656847966, 'p': 0.08900359259368615, 'f': 0.11811980069146771}\n", - "rouge-l {'r': 0.4950394575351968, 'p': 0.2279949154847164, 'f': 0.29868621196995626}\n", + "rouge-1 {'r': 0.5390942469298202, 'p': 0.2653432195605193, 'f': 0.3467860329036724}\n", + "rouge-2 {'r': 0.21902899372402257, 'p': 0.09705436435302771, 'f': 0.13019228035984926}\n", + "rouge-l {'r': 0.4895133161814999, 'p': 0.24094237771495597, 'f': 0.31487875553738726}\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> while flying was \" a big part of his life , \" the source said , it 's only one theory being considered . </s> <s> 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 . </s> <s> 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 . </s> <s> 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 . \" </s> <s> kumpa emphasized there 's no evidence suggesting lubitz was suicidal or acting aggressively before the crash . </s> <s> lubitz told his lufthansa flight training school in 2009 that he had a \" previous episode of severe depression , \" the airline said tuesday . </s> <s> 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 . </s> <s> 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 . </s>\n", + "<s> while flying was \" a big part of his life , \" the source said , it 's only one theory being considered . </s> <s> 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 . </s> <s> cell phones have been collected at the site , he said , but that they \" had n't been exploited yet . \" </s> <s> kumpa emphasized there 's no evidence suggesting lubitz was suicidal or acting aggressively before the crash . </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" ] } @@ -1178,7 +1282,7 @@ " for word in sentence:\n", " cnt += 1\n", " if word.lemma_ in word_freq and word.text in idf_dict and not word.is_stop:\n", - " idf = idf_dict[word.text] # The idf was not made with lemma\n", + " idf = idf_dict[word.text] # The custom idf was not made with lemma\n", " score += word_freq[word.lemma_] * idf\n", " scores.append(score/cnt)\n", " \n", @@ -1201,13 +1305,13 @@ "metadata": { "id": "k266huRznoRk" }, - "execution_count": 21, + "execution_count": 25, "outputs": [] }, { "cell_type": "code", "source": [ - "pred = custom_tfidf_sentec_predict(test_df[\"article\"], article_size)\n", + "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])" @@ -1217,26 +1321,26 @@ "base_uri": "https://localhost:8080/" }, "id": "dQ_QndW3q91T", - "outputId": "ce644f37-639a-4db3-f445-775f0102edc7" + "outputId": "a411e24a-a413-4c71-d6e2-162fe7aaed70" }, - "execution_count": 22, + "execution_count": 28, "outputs": [ { "output_type": "stream", "name": "stderr", "text": [ - "100%|██████████| 11490/11490 [00:24<00:00, 461.33it/s]\n" + "100%|██████████| 11490/11490 [00:25<00:00, 457.62it/s]\n" ] }, { "output_type": "stream", "name": "stdout", "text": [ - "rouge-1 {'r': 0.4615691623956495, 'p': 0.35154797497465046, 'f': 0.37899201000410787}\n", - "rouge-2 {'r': 0.19838343307724604, 'p': 0.14191182462991592, 'f': 0.15389540076660058}\n", - "rouge-l {'r': 0.42784556788316797, 'p': 0.3259834692605985, 'f': 0.35126522254133685}\n", + "rouge-1 {'r': 0.4327709425874722, 'p': 0.3657728143833699, 'f': 0.3808199957417612}\n", + "rouge-2 {'r': 0.18764872250033365, 'p': 0.14521596438649903, 'f': 0.15597825174954172}\n", + "rouge-l {'r': 0.40081557829880277, 'p': 0.33916952942387324, 'f': 0.35278001661268227}\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> germanwings crash compensation : what we know . </s> <s> what was mental state of germanwings co-pilot ? </s> <s> who was the captain of germanwings flight 9525 ? </s> <s> 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 . </s> <s> 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 . </s> <s> he noted that investigators only revealed they 'd recovered cell phones from the crash site after bild and paris match published their reports . \" </s> <s> marseille prosecutor brice robin told cnn that \" so far no videos were used in the crash investigation . \" </s> <s> paris match and bild reported that the video was recovered from a phone at the wreckage site . </s>\n", + "<s> germanwings crash compensation : what we know . </s> <s> what was mental state of germanwings co-pilot ? </s> <s> who was the captain of germanwings flight 9525 ? </s> <s> 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 . </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" ] } @@ -1284,13 +1388,13 @@ "metadata": { "id": "i-M_MJv1oU2P" }, - "execution_count": 25, + "execution_count": 24, "outputs": [] }, { "cell_type": "code", "source": [ - "pred = propn_sentec_predict(test_df[\"article\"], article_size)\n", + "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])" @@ -1300,26 +1404,26 @@ "base_uri": "https://localhost:8080/" }, "id": "3bqYxiql1m2e", - "outputId": "97533c39-3a56-4ba8-81c4-4fd243d96129" + "outputId": "d979c5ae-101d-40a5-c29e-38423a54d5e9" }, - "execution_count": 26, + "execution_count": 33, "outputs": [ { "output_type": "stream", "name": "stderr", "text": [ - "100%|██████████| 11490/11490 [00:10<00:00, 1124.40it/s]\n" + "100%|██████████| 11490/11490 [00:09<00:00, 1181.77it/s]\n" ] }, { "output_type": "stream", "name": "stdout", "text": [ - "rouge-1 {'r': 0.4559005733853858, 'p': 0.3025031052181378, 'f': 0.344317446580514}\n", - "rouge-2 {'r': 0.18417034114140576, 'p': 0.11787365795545679, 'f': 0.13327905589006836}\n", - "rouge-l {'r': 0.4208657572761921, 'p': 0.27955250706665685, 'f': 0.31790453121110424}\n", + "rouge-1 {'r': 0.4284412363876721, 'p': 0.3118531734804042, 'f': 0.34715671637753737}\n", + "rouge-2 {'r': 0.17486925077065454, 'p': 0.11942440267249803, 'f': 0.13523900318760687}\n", + "rouge-l {'r': 0.3953422449709436, 'p': 0.2882376544644397, 'f': 0.3204788702777791}\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 margot haddad reported from marseille and pamela brown from dusseldorf , while laura smith - spark wrote from london . </s> <s> cnn 's frederik pleitgen , pamela boykoff , antonia mortensen , sandrine amiel and anna - maja rappard contributed to this report . </s> <s> marseille prosecutor brice robin told cnn that \" so far no videos were used in the crash investigation . \" </s> <s> 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 . \" </s> <s> paris match and bild reported that the video was recovered from a phone at the wreckage site . </s> <s> kumpa emphasized there 's no evidence suggesting lubitz was suicidal or acting aggressively before the crash . </s> <s> 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 . </s> <s> 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 . </s>\n", + "<s> cnn 's margot haddad reported from marseille and pamela brown from dusseldorf , while laura smith - spark wrote from london . </s> <s> cnn 's frederik pleitgen , pamela boykoff , antonia mortensen , sandrine amiel and anna - maja rappard contributed to this report . </s> <s> marseille prosecutor brice robin told cnn that \" so far no videos were used in the crash investigation . \" </s> <s> 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 . \" </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" ] } @@ -1364,13 +1468,13 @@ "metadata": { "id": "cbHEbEyUtqfP" }, - "execution_count": 12, + "execution_count": 23, "outputs": [] }, { "cell_type": "code", "source": [ - "pred = pos_sentec_predict(test_df[\"article\"], article_size)\n", + "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])" @@ -1380,26 +1484,26 @@ "base_uri": "https://localhost:8080/" }, "id": "P_EDnZcOty2a", - "outputId": "3a8449a2-58ce-4fda-b24b-298df09fd98e" + "outputId": "433a7b66-98db-4a93-dd75-5130a22febb4" }, - "execution_count": 13, + "execution_count": 35, "outputs": [ { "output_type": "stream", "name": "stderr", "text": [ - "100%|██████████| 11490/11490 [00:05<00:00, 2208.78it/s]\n" + "100%|██████████| 11490/11490 [00:03<00:00, 3219.61it/s]\n" ] }, { "output_type": "stream", "name": "stdout", "text": [ - "rouge-1 {'r': 0.5494215445227096, 'p': 0.31382049589203415, 'f': 0.3819418425717233}\n", - "rouge-2 {'r': 0.24347091126140596, 'p': 0.12721553923575432, 'f': 0.15694917582673362}\n", - "rouge-l {'r': 0.5057761670218017, 'p': 0.2881108764020682, 'f': 0.35096591172636077}\n", + "rouge-1 {'r': 0.5151772281331103, 'p': 0.3185743140352747, 'f': 0.3841591283219293}\n", + "rouge-2 {'r': 0.219487595215552, 'p': 0.1258180777193021, 'f': 0.15486468957024846}\n", + "rouge-l {'r': 0.47141885940853145, 'p': 0.2913711753136618, 'f': 0.3514222337054375}\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> 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 . </s> <s> marseille prosecutor brice robin told cnn that \" so far no videos were used in the crash investigation . \" </s> <s> cnn 's frederik pleitgen , pamela boykoff , antonia mortensen , sandrine amiel and anna - maja rappard contributed to this report . </s> <s> cnn 's margot haddad reported from marseille and pamela brown from dusseldorf , while laura smith - spark wrote from london . </s> <s> he added , \" a person who has such a video needs to immediately give it to the investigators . \" </s> <s> 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 . </s> <s> who was the captain of germanwings flight 9525 ? </s> <s> all 150 on board were killed . </s>\n", + "<s> 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 . </s> <s> marseille prosecutor brice robin told cnn that \" so far no videos were used in the crash investigation . \" </s> <s> cnn 's frederik pleitgen , pamela boykoff , antonia mortensen , sandrine amiel and anna - maja rappard contributed to this report . </s> <s> cnn 's margot haddad reported from marseille and pamela brown from dusseldorf , while laura smith - spark wrote from london . </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" ] } @@ -1410,15 +1514,19 @@ "source": [ "def numeric_scoring(sentences):\n", " scores = []\n", + " cnt = 0\n", " for sent in sentences:\n", " score = 0\n", - " cnt = 0\n", " for word in sent:\n", - " cnt += 1\n", " if word.is_digit:\n", + " cnt += 1\n", " score += 1\n", - " scores.append(score/cnt)\n", + " scores.append(score)\n", " \n", + " if cnt != 0:\n", + " for i in range(len(scores)): \n", + " scores[i] /= cnt\n", + "\n", " return scores\n", "\n", "\n", @@ -1437,14 +1545,13 @@ "metadata": { "id": "PKYeKIeGzc-j" }, - "execution_count": 41, + "execution_count": 22, "outputs": [] }, { "cell_type": "code", "source": [ - "# needs to debug this\n", - "pred = num_sentec_predict(test_df[\"article\"], article_size)\n", + "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])" @@ -1454,26 +1561,26 @@ "base_uri": "https://localhost:8080/" }, "id": "iZmiX0HNzjC0", - "outputId": "0f6f4828-5ad6-47bd-e6da-e1c9dc3f793b" + "outputId": "ac81ec12-fcae-4c0a-a037-ced00b3e2d26" }, - "execution_count": 42, + "execution_count": 41, "outputs": [ { "output_type": "stream", "name": "stderr", "text": [ - "100%|██████████| 11490/11490 [00:12<00:00, 919.22it/s] \n" + "100%|██████████| 11490/11490 [00:06<00:00, 1825.70it/s]\n" ] }, { "output_type": "stream", "name": "stdout", "text": [ - "rouge-1 {'r': 0.46318097584816226, 'p': 0.2844912624278833, 'f': 0.3333100946996899}\n", - "rouge-2 {'r': 0.18203080740725897, 'p': 0.10613398668860083, 'f': 0.12442455696804694}\n", - "rouge-l {'r': 0.4248917672421064, 'p': 0.2613561679760674, 'f': 0.30582416736843016}\n", + "rouge-1 {'r': 0.46821896231543336, 'p': 0.28488436843207504, 'f': 0.3445767899948431}\n", + "rouge-2 {'r': 0.18628027018438126, 'p': 0.10520583476826827, 'f': 0.12977776347901512}\n", + "rouge-l {'r': 0.42762150266615073, 'p': 0.26034312280281585, 'f': 0.31477563659746677}\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> all 150 on board were killed . </s> <s> who was the captain of germanwings flight 9525 ? </s> <s> among those personal belongings could be more cell phones belonging to the 144 passengers and six crew on board . </s> <s> lubitz told his lufthansa flight training school in 2009 that he had a \" previous episode of severe depression , \" the airline said tuesday . </s> <s> 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 . </s> <s> 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 . </s> <s> 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 . \" </s> <s> 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 . </s>\n", + "<s> lubitz told his lufthansa flight training school in 2009 that he had a \" previous episode of severe depression , \" the airline said tuesday . </s> <s> among those personal belongings could be more cell phones belonging to the 144 passengers and six crew on board . </s> <s> 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 . </s> <s> all 150 on board were killed . </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" ] } @@ -1512,13 +1619,13 @@ "metadata": { "id": "cH7AfdoG0ICx" }, - "execution_count": 18, + "execution_count": 21, "outputs": [] }, { "cell_type": "code", "source": [ - "pred = length_sentec_predict(test_df[\"article\"], article_size)\n", + "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])" @@ -1528,26 +1635,26 @@ "base_uri": "https://localhost:8080/" }, "id": "sKJbeHNs0WCE", - "outputId": "4db72891-5523-4e92-83d1-8f01c663fe27" + "outputId": "45517ef6-ae08-4642-d40a-d7b3235a42e4" }, - "execution_count": 19, + "execution_count": 43, "outputs": [ { "output_type": "stream", "name": "stderr", "text": [ - "100%|██████████| 11490/11490 [00:13<00:00, 849.37it/s]\n" + "100%|██████████| 11490/11490 [00:10<00:00, 1114.34it/s]\n" ] }, { "output_type": "stream", "name": "stdout", "text": [ - "rouge-1 {'r': 0.5626407221854909, 'p': 0.23501802638584735, 'f': 0.3172780071290118}\n", - "rouge-2 {'r': 0.22363854068079292, 'p': 0.0824952450704585, 'f': 0.11326396343603767}\n", - "rouge-l {'r': 0.5112575700290121, 'p': 0.2131181830765364, 'f': 0.28781471160740657}\n", + "rouge-1 {'r': 0.5412036100620485, 'p': 0.24227678928861945, 'f': 0.32773924649427716}\n", + "rouge-2 {'r': 0.21092924299480134, 'p': 0.08364319845898473, 'f': 0.11651463692847655}\n", + "rouge-l {'r': 0.4891398649503912, 'p': 0.21905388555535926, 'f': 0.2962640357987838}\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> 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 . </s> <s> 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 . </s> <s> 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 . </s> <s> 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 . \" </s> <s> 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 . </s> <s> 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 . </s> <s> 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 . </s> <s> 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 . \" </s>\n", + "<s> 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 . </s> <s> 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 . </s> <s> 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 . </s> <s> 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 . \" </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" ] } @@ -1564,12 +1671,12 @@ " sentences = list(x[i].sents)\n", "\n", " word_freq = build_word_frequancy(sentences)\n", - " scores = 1.0*np.array(custom_tfidf_scoring(word_freq, sentences))\n", + " scores = 0.8*np.array(custom_tfidf_scoring(word_freq, sentences))\n", " scores = 0.7*np.add(numeric_scoring(sentences), scores)\n", - " scores = 0.7*np.add(leght_scoring(sentences), scores)\n", - " scores = 1.0*np.add(position_scoring(sentences), scores)\n", - " scores = 0.8*np.add(propn_scoring(sentences), scores)\n", - " scores = 0.6*np.add(lda_scoring(sentences), scores)\n", + " scores = 0.6*np.add(leght_scoring(sentences), scores)\n", + " scores = 1.0*np.add(first_sentance_scoring(sentences), scores)\n", + " scores = 0.7*np.add(propn_scoring(sentences), scores)\n", + " scores = 0.5*np.add(lda_scoring(sentences), scores)\n", "\n", "\n", " y[i] = score_predict(scores, sentences, n)\n", @@ -1579,13 +1686,13 @@ "metadata": { "id": "RizOIKNNMm1K" }, - "execution_count": 43, + "execution_count": 20, "outputs": [] }, { "cell_type": "code", "source": [ - "pred = ensamle_predict(test_df[\"article\"], article_size)\n", + "pred = ensamle_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])" @@ -1595,26 +1702,26 @@ "base_uri": "https://localhost:8080/" }, "id": "YFS-GvQKmupf", - "outputId": "5ef277f1-f5f4-4b27-e3c8-1264ad25c11e" + "outputId": "45ba7157-5089-4432-9895-4586504ed61d" }, - "execution_count": 44, + "execution_count": 30, "outputs": [ { "output_type": "stream", "name": "stderr", "text": [ - "100%|██████████| 11490/11490 [05:23<00:00, 35.47it/s]\n" + "100%|██████████| 11490/11490 [05:54<00:00, 32.42it/s]\n" ] }, { "output_type": "stream", "name": "stdout", "text": [ - "rouge-1 {'r': 0.5962947106516606, 'p': 0.2882247988758948, 'f': 0.3701446039275173}\n", - "rouge-2 {'r': 0.2730535722897956, 'p': 0.11817555344953194, 'f': 0.15398538492789024}\n", - "rouge-l {'r': 0.5487423147467031, 'p': 0.2647770765304575, 'f': 0.3401760025633091}\n", + "rouge-1 {'r': 0.5982864006956485, 'p': 0.3334903790227934, 'f': 0.418055320405354}\n", + "rouge-2 {'r': 0.28735963506046913, 'p': 0.14340382421341688, 'f': 0.18554955812317506}\n", + "rouge-l {'r': 0.5514295185753509, 'p': 0.307575963725818, 'f': 0.38545968945768494}\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 margot haddad reported from marseille and pamela brown from dusseldorf , while laura smith - spark wrote from london . </s> <s> cnn 's frederik pleitgen , pamela boykoff , antonia mortensen , sandrine amiel and anna - maja rappard contributed to this report . </s> <s> 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 . </s> <s> 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 . </s> <s> 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 . </s> <s> marseille prosecutor brice robin told cnn that \" so far no videos were used in the crash investigation . \" </s> <s> 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 . \" </s> <s> 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 . \" </s>\n", + "<s> 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 . </s> <s> 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 . </s> <s> marseille prosecutor brice robin told cnn that \" so far no videos were used in the crash investigation . \" </s> <s> 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 . \" </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" ] } @@ -1717,13 +1824,13 @@ "metadata": { "id": "q91PomLEFMmv" }, - "execution_count": 32, + "execution_count": 19, "outputs": [] }, { "cell_type": "code", "source": [ - "pred = lda_predict(test_df[\"article\"], article_size)\n", + "pred = lda_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])" @@ -1733,26 +1840,26 @@ "base_uri": "https://localhost:8080/" }, "id": "1Z56H8SFt4H9", - "outputId": "e7dda225-d3ff-442b-e5fa-c8590d40dd9c" + "outputId": "16187566-c925-4c3f-f4a6-8f5c60cf3239" }, - "execution_count": 33, + "execution_count": 46, "outputs": [ { "output_type": "stream", "name": "stderr", "text": [ - "100%|██████████| 11490/11490 [04:48<00:00, 39.77it/s]\n" + "100%|██████████| 11490/11490 [05:13<00:00, 36.69it/s]\n" ] }, { "output_type": "stream", "name": "stdout", "text": [ - "rouge-1 {'r': 0.4324258847937427, 'p': 0.265712930065131, 'f': 0.3107751651556145}\n", - "rouge-2 {'r': 0.15134060377559053, 'p': 0.08792030671460145, 'f': 0.10270380475424096}\n", - "rouge-l {'r': 0.39461799536273595, 'p': 0.24257259913765258, 'f': 0.28350462708699803}\n", + "rouge-1 {'r': 0.40624926706523945, 'p': 0.2759550419380839, 'f': 0.31687954426129866}\n", + "rouge-2 {'r': 0.1439318173986075, 'p': 0.09026064101787536, 'f': 0.10589603210535965}\n", + "rouge-l {'r': 0.3702133651946173, 'p': 0.25163006385563474, 'f': 0.2887891311907163}\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> 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 . </s> <s> cnn 's margot haddad reported from marseille and pamela brown from dusseldorf , while laura smith - spark wrote from london . </s> <s> 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 . </s> <s> 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 . \" </s> <s> 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 . </s> <s> 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 . </s> <s> among those personal belongings could be more cell phones belonging to the 144 passengers and six crew on board . </s>\n", + "<s> cnn 's frederik pleitgen , pamela boykoff , antonia mortensen , sandrine amiel and anna - maja rappard contributed to this report . </s> <s> 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 . </s> <s> it is a very disturbing scene , \" said julian reichelt , editor - in - chief of bild online . </s> <s> lubitz told his lufthansa flight training school in 2009 that he had a \" previous episode of severe depression , \" the airline said tuesday . </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" ] }