{ "cells": [ { "cell_type": "markdown", "metadata": { "id": "d86DXrMMd1_X" }, "source": [ "# 1. Get NL-Augmenter and install dependencies" ] }, { "cell_type": "markdown", "metadata": { "id": "AZHffzbAfii2" }, "source": [ "## Copy git repository of NL-Augmenter" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "6itEUtbWiYr8", "outputId": "090b81f5-d40d-4e5f-89cc-e214ca908a77" }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "fatal: destination path 'NL-Augmenter' already exists and is not an empty directory.\r\n" ] } ], "source": [ "!git clone https://www.github.com/GEM-benchmark/NL-Augmenter" ] }, { "cell_type": "markdown", "metadata": { "id": "0tPppU_HfrkS" }, "source": [ "## Go to newly copied directory" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "dR62jWALiZrn", "outputId": "60bc71a6-32c5-4424-eb2a-39de848e9bb2" }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "/mnt/data/mphasis.abinaya/squad_v2/NL-Augmenter\n" ] } ], "source": [ "cd NL-Augmenter" ] }, { "cell_type": "markdown", "metadata": { "id": "XVYUdoj2f7xW" }, "source": [ "## Install requirements" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "bUVJQTXRigRR", "outputId": "a446b5c8-b8b2-4c1a-defc-c80fba3b4c2d" }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[33mWARNING: Ignoring invalid distribution -umpy (/mnt/data/mphasis.abinaya/notebook/jupyter/lib/python3.7/site-packages)\u001b[0m\n", "\u001b[33mWARNING: Ignoring invalid distribution -umpy (/mnt/data/mphasis.abinaya/notebook/jupyter/lib/python3.7/site-packages)\u001b[0m\n", "\u001b[33mWARNING: Ignoring invalid distribution -umpy (/mnt/data/mphasis.abinaya/notebook/jupyter/lib/python3.7/site-packages)\u001b[0m\n", "\u001b[33mWARNING: Ignoring invalid distribution -umpy (/mnt/data/mphasis.abinaya/notebook/jupyter/lib/python3.7/site-packages)\u001b[0m\n", "\u001b[33mWARNING: Ignoring invalid distribution -umpy (/mnt/data/mphasis.abinaya/notebook/jupyter/lib/python3.7/site-packages)\u001b[0m\n", "\u001b[33mWARNING: Ignoring invalid distribution -umpy (/mnt/data/mphasis.abinaya/notebook/jupyter/lib/python3.7/site-packages)\u001b[0m\n", "\u001b[33mWARNING: You are using pip version 21.2.4; however, version 21.3.1 is available.\n", "You should consider upgrading via the '/mnt/data/mphasis.abinaya/notebook/jupyter/bin/python3.7 -m pip install --upgrade pip' command.\u001b[0m\n", "\u001b[33mWARNING: Ignoring invalid distribution -umpy (/mnt/data/mphasis.abinaya/notebook/jupyter/lib/python3.7/site-packages)\u001b[0m\n", "\u001b[33mWARNING: Ignoring invalid distribution -umpy (/mnt/data/mphasis.abinaya/notebook/jupyter/lib/python3.7/site-packages)\u001b[0m\n", "Collecting https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.0.0/en_core_web_sm-3.0.0.tar.gz\n", " Downloading https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.0.0/en_core_web_sm-3.0.0.tar.gz (13.7 MB)\n", "\u001b[K |████████████████████████████████| 13.7 MB 1.4 MB/s eta 0:00:01\n", "\u001b[?25hRequirement already satisfied: spacy<3.1.0,>=3.0.0 in /mnt/data/mphasis.abinaya/notebook/jupyter/lib/python3.7/site-packages (from en-core-web-sm==3.0.0) (3.0.0)\n", "Requirement already satisfied: tqdm<5.0.0,>=4.38.0 in /mnt/data/mphasis.abinaya/notebook/jupyter/lib/python3.7/site-packages (from spacy<3.1.0,>=3.0.0->en-core-web-sm==3.0.0) (4.49.0)\n", "Requirement already satisfied: murmurhash<1.1.0,>=0.28.0 in /mnt/data/mphasis.abinaya/notebook/jupyter/lib/python3.7/site-packages (from spacy<3.1.0,>=3.0.0->en-core-web-sm==3.0.0) (1.0.6)\n", "Requirement already satisfied: jinja2 in /mnt/data/mphasis.abinaya/notebook/jupyter/lib/python3.7/site-packages (from spacy<3.1.0,>=3.0.0->en-core-web-sm==3.0.0) (3.0.1)\n", "Requirement already satisfied: spacy-legacy<3.1.0,>=3.0.0 in /mnt/data/mphasis.abinaya/notebook/jupyter/lib/python3.7/site-packages (from spacy<3.1.0,>=3.0.0->en-core-web-sm==3.0.0) (3.0.8)\n", "Requirement already satisfied: requests<3.0.0,>=2.13.0 in /mnt/data/mphasis.abinaya/notebook/jupyter/lib/python3.7/site-packages (from spacy<3.1.0,>=3.0.0->en-core-web-sm==3.0.0) (2.26.0)\n", "Requirement already satisfied: importlib-metadata>=0.20 in /mnt/data/mphasis.abinaya/notebook/jupyter/lib/python3.7/site-packages (from spacy<3.1.0,>=3.0.0->en-core-web-sm==3.0.0) (4.8.1)\n", "Requirement already satisfied: typer<0.4.0,>=0.3.0 in /mnt/data/mphasis.abinaya/notebook/jupyter/lib/python3.7/site-packages (from spacy<3.1.0,>=3.0.0->en-core-web-sm==3.0.0) (0.3.2)\n", "Requirement already satisfied: wasabi<1.1.0,>=0.8.1 in /mnt/data/mphasis.abinaya/notebook/jupyter/lib/python3.7/site-packages (from spacy<3.1.0,>=3.0.0->en-core-web-sm==3.0.0) (0.8.2)\n", "Requirement already satisfied: srsly<3.0.0,>=2.4.0 in /mnt/data/mphasis.abinaya/notebook/jupyter/lib/python3.7/site-packages (from spacy<3.1.0,>=3.0.0->en-core-web-sm==3.0.0) (2.4.2)\n", "Requirement already satisfied: setuptools in /mnt/data/mphasis.abinaya/notebook/jupyter/lib/python3.7/site-packages (from spacy<3.1.0,>=3.0.0->en-core-web-sm==3.0.0) (58.1.0)\n", "Requirement already satisfied: pydantic<1.8.0,>=1.7.1 in /mnt/data/mphasis.abinaya/notebook/jupyter/lib/python3.7/site-packages (from spacy<3.1.0,>=3.0.0->en-core-web-sm==3.0.0) (1.7.4)\n", "Requirement already satisfied: numpy>=1.15.0 in /mnt/data/mphasis.abinaya/notebook/jupyter/lib/python3.7/site-packages (from spacy<3.1.0,>=3.0.0->en-core-web-sm==3.0.0) (1.19.5)\n", "Requirement already satisfied: thinc<8.1.0,>=8.0.0 in /mnt/data/mphasis.abinaya/notebook/jupyter/lib/python3.7/site-packages (from spacy<3.1.0,>=3.0.0->en-core-web-sm==3.0.0) (8.0.13)\n", "Requirement already satisfied: cymem<2.1.0,>=2.0.2 in /mnt/data/mphasis.abinaya/notebook/jupyter/lib/python3.7/site-packages (from spacy<3.1.0,>=3.0.0->en-core-web-sm==3.0.0) (2.0.6)\n", "Requirement already satisfied: catalogue<2.1.0,>=2.0.1 in /mnt/data/mphasis.abinaya/notebook/jupyter/lib/python3.7/site-packages (from spacy<3.1.0,>=3.0.0->en-core-web-sm==3.0.0) (2.0.6)\n", "Requirement already satisfied: packaging>=20.0 in /mnt/data/mphasis.abinaya/notebook/jupyter/lib/python3.7/site-packages (from spacy<3.1.0,>=3.0.0->en-core-web-sm==3.0.0) (21.0)\n", "Requirement already satisfied: pathy in /mnt/data/mphasis.abinaya/notebook/jupyter/lib/python3.7/site-packages (from spacy<3.1.0,>=3.0.0->en-core-web-sm==3.0.0) (0.6.0)\n", "Requirement already satisfied: typing-extensions>=3.7.4 in /mnt/data/mphasis.abinaya/notebook/jupyter/lib/python3.7/site-packages (from spacy<3.1.0,>=3.0.0->en-core-web-sm==3.0.0) (3.7.4.3)\n", "Requirement already satisfied: blis<0.8.0,>=0.4.0 in /mnt/data/mphasis.abinaya/notebook/jupyter/lib/python3.7/site-packages (from spacy<3.1.0,>=3.0.0->en-core-web-sm==3.0.0) (0.4.1)\n", "Requirement already satisfied: preshed<3.1.0,>=3.0.2 in /mnt/data/mphasis.abinaya/notebook/jupyter/lib/python3.7/site-packages (from spacy<3.1.0,>=3.0.0->en-core-web-sm==3.0.0) (3.0.5)\n", "Requirement already satisfied: zipp>=0.5 in /mnt/data/mphasis.abinaya/notebook/jupyter/lib/python3.7/site-packages (from catalogue<2.1.0,>=2.0.1->spacy<3.1.0,>=3.0.0->en-core-web-sm==3.0.0) (3.5.0)\n", "Requirement already satisfied: pyparsing>=2.0.2 in /mnt/data/mphasis.abinaya/notebook/jupyter/lib/python3.7/site-packages (from packaging>=20.0->spacy<3.1.0,>=3.0.0->en-core-web-sm==3.0.0) (2.4.7)\n", "Requirement already satisfied: certifi>=2017.4.17 in /mnt/data/mphasis.abinaya/notebook/jupyter/lib/python3.7/site-packages (from requests<3.0.0,>=2.13.0->spacy<3.1.0,>=3.0.0->en-core-web-sm==3.0.0) (2021.5.30)\n", "Requirement already satisfied: urllib3<1.27,>=1.21.1 in /mnt/data/mphasis.abinaya/notebook/jupyter/lib/python3.7/site-packages (from requests<3.0.0,>=2.13.0->spacy<3.1.0,>=3.0.0->en-core-web-sm==3.0.0) (1.26.7)\n", "Requirement already satisfied: charset-normalizer~=2.0.0 in /mnt/data/mphasis.abinaya/notebook/jupyter/lib/python3.7/site-packages (from requests<3.0.0,>=2.13.0->spacy<3.1.0,>=3.0.0->en-core-web-sm==3.0.0) (2.0.6)\n", "Requirement already satisfied: idna<4,>=2.5 in /mnt/data/mphasis.abinaya/notebook/jupyter/lib/python3.7/site-packages (from requests<3.0.0,>=2.13.0->spacy<3.1.0,>=3.0.0->en-core-web-sm==3.0.0) (3.2)\n", "Requirement already satisfied: click<7.2.0,>=7.1.1 in /mnt/data/mphasis.abinaya/notebook/jupyter/lib/python3.7/site-packages (from typer<0.4.0,>=0.3.0->spacy<3.1.0,>=3.0.0->en-core-web-sm==3.0.0) (7.1.2)\n", "Requirement already satisfied: MarkupSafe>=2.0 in /mnt/data/mphasis.abinaya/notebook/jupyter/lib/python3.7/site-packages (from jinja2->spacy<3.1.0,>=3.0.0->en-core-web-sm==3.0.0) (2.0.1)\n", "Requirement already satisfied: smart-open<6.0.0,>=5.0.0 in /mnt/data/mphasis.abinaya/notebook/jupyter/lib/python3.7/site-packages (from pathy->spacy<3.1.0,>=3.0.0->en-core-web-sm==3.0.0) (5.2.1)\n", "\u001b[33mWARNING: Ignoring invalid distribution -umpy (/mnt/data/mphasis.abinaya/notebook/jupyter/lib/python3.7/site-packages)\u001b[0m\n", "\u001b[33mWARNING: Ignoring invalid distribution -umpy (/mnt/data/mphasis.abinaya/notebook/jupyter/lib/python3.7/site-packages)\u001b[0m\n", "\u001b[33mWARNING: Ignoring invalid distribution -umpy (/mnt/data/mphasis.abinaya/notebook/jupyter/lib/python3.7/site-packages)\u001b[0m\n", "\u001b[33mWARNING: Ignoring invalid distribution -umpy (/mnt/data/mphasis.abinaya/notebook/jupyter/lib/python3.7/site-packages)\u001b[0m\n", "\u001b[33mWARNING: You are using pip version 21.2.4; however, version 21.3.1 is available.\n", "You should consider upgrading via the '/mnt/data/mphasis.abinaya/notebook/jupyter/bin/python3.7 -m pip install --upgrade pip' command.\u001b[0m\n" ] } ], "source": [ "!pip install -r requirements.txt --quiet\n", "!pip install https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.0.0/en_core_web_sm-3.0.0.tar.gz" ] }, { "cell_type": "markdown", "metadata": { "id": "A4n-PqAAfJes" }, "source": [ "# 2. Load the data" ] }, { "cell_type": "markdown", "metadata": { "id": "T_GV8XWlgMMr" }, "source": [ "## Get dataloader and use it to load CommonGen dataset" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 383, "referenced_widgets": [ "e4c1e861f8434fa29cff33f367c61d7a", "83f25fd2658142e4a2be06e00a7966cb", "3bbe92c3974641b98d8ef5777dc491de", "d6fcdf4b5c194a7380a8a0df60ae2298", "fc7335335b114e22b33db1a830ea90e4", "7402db88b7eb43b38f347384a49b53ec", "d77a514d39a14142a1c51a2e7d136565", "e2f417a1a55a463297ee168f687a29d3", "8fce5b95f6db4c13a99886bb178e4c1d", "bfb105f1cfdf4702a4822f207b927d1e", "07386fcb9b8a4a25b4a06136cf2d69c5", "e89ec92a3ae34d239e3b131fc240fc34", "0ad3dcd165ed43ad800fca8946d7716e", "d0e42ee4fc854b73b2b8929ff2a26cde", "29f4ba3028a3498ab802f96fb1c42fb8", "fa507001884643a387d7e0a46d498604", "90e1a383e3354125bd158c5952920ad3", "99dd5c88984f4952ad65f5ba1e5becc2", "249a2b434fa4421fbcaee04512306ef5", "e9f93c50c219406a82f55127ad09b555", "a4812e4c447c4288bff063b6bd86ee66", "c068b76648fa47b5a30c251c0630160c", "56a75ac849ef4e22a02de0b56d05d13e", "532c0b0e92ad4323bfada2ad17cd64c3", "8307844b3fda4eb68eebc048c5f9eb11", "815255b488c745519de3e645e96d7d19", "9ec7464fe62d4f359fb007eb47fa2343", "5463eaab09e640ce851d457ffc3ba2bb", "85d410e7c9024609bd80a54b449093e6", "7663b3bd79db43a1982c4c46d2d6a83a", "5feec27442e74914aa98c7b05a55af21", "18e6b91315504e95b45faf94698b4ab5", "9886e2d3e8114db39cc4adf098a50be5", "ca1c50a7ea1c47469339a0eab4c32fb8", "7bf0345f9db84e468ccb58901c881f39", "b68d75b7ad23470e9d5d1aa3f7639ecd", "b3887cde43174c40b5cc5575aba0f106", "7070284d09a640f296ad5337698a5e68", "83fb9bb42d734abe9878f7c4fcb212e9", "e4139a008d574efb9a5b1cec6790d848", "59abc07b8f594485a4cbe01360341705", "cea605e546a14d70bfb23cf6568eee27", "c269d4210e754a75a45e4995e4f9c3b5", "4b4984daa68a4cd6953539e58b763bdb", "0fe578cb04654fae89322571049c48e7", "89d31e1e5f99473485f4025971ed6a1d", "4c3312c6902e4436a5368f1e86eed65a", "91930c1187a04a91b4c59e0ceb883d56", "3abd5ba4771248d796a890b8ed055f01", "25034a9f750c442599809bed8f47a029", "1f2594d50c8c4df6ada87486ae897f58", "7d35cb7d0127409a9dc8b9203b228c79", "7475e328a906408492734428a2d5157d", "20aa9ff64ac5483095c849a35676958e", "99dbd39ad800493aa21656eaba325c68", "b3591d13bc4647b4b122244686f01793" ] }, "id": "VrIfrgGNj6WQ", "outputId": "4f261007-bb01-48b0-8ef6-7e289f305fd8" }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "Using custom data configuration default\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Downloading and preparing dataset squad_v2/default (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/mphasis.abinaya/.cache/huggingface/datasets/squad_v2/default/0.0.0/f5f48a1a69d6d37fb09e1d978247e78f1885a13ac6f4ad4c8c6388cb79c76cdd...\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(FloatProgress(value=1.0, bar_style='info', layout=Layout(width='20px'), max=1.0), HTML(value=''…" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stderr", "output_type": "stream", "text": [ "2021-11-30 09:07:54.781527: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory\n", "2021-11-30 09:07:54.781561: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(FloatProgress(value=1.0, bar_style='info', layout=Layout(width='20px'), max=1.0), HTML(value=''…" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(FloatProgress(value=1.0, bar_style='info', layout=Layout(width='20px'), max=1.0), HTML(value=''…" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "Dataset squad_v2 downloaded and prepared to /home/mphasis.abinaya/.cache/huggingface/datasets/squad_v2/default/0.0.0/f5f48a1a69d6d37fb09e1d978247e78f1885a13ac6f4ad4c8c6388cb79c76cdd. Subsequent calls will reuse this data.\n" ] } ], "source": [ "from datasets import load_dataset\n", "\n", "data = load_dataset(\"GEM/squad_v2\")" ] }, { "cell_type": "markdown", "metadata": { "id": "TpkLKbsvgeQp" }, "source": [ "## Explore data structure" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "9TononzpkSc2", "outputId": "6ceb023f-91e8-4485-a214-4781469d2c19" }, "outputs": [ { "data": { "text/plain": [ "DatasetDict({\n", " train: Dataset({\n", " features: ['gem_id', 'id', 'title', 'context', 'question', 'answers'],\n", " num_rows: 116397\n", " })\n", " validation: Dataset({\n", " features: ['gem_id', 'id', 'title', 'context', 'question', 'answers'],\n", " num_rows: 11873\n", " })\n", " test: Dataset({\n", " features: ['gem_id', 'id', 'title', 'context', 'question', 'answers'],\n", " num_rows: 13922\n", " })\n", "})" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "data" ] }, { "cell_type": "markdown", "metadata": { "id": "jWaFVlMtg3iG" }, "source": [ "## Retrieve one entry from a train subset" ] }, { "cell_type": "code", "execution_count": 10, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "D0Q3gMyMkcxt", "outputId": "16531896-0184-43f3-fd47-bf97ce69c662" }, "outputs": [ { "data": { "text/plain": [ "{'answers': {'answer_start': [59], 'text': ['the Republic of Guinea-Bissau']},\n", " 'context': 'Guinea-Bissau (i/ˈɡɪni bɪˈsaʊ/, GI-nee-bi-SOW), officially the Republic of Guinea-Bissau (Portuguese: República da Guiné-Bissau, pronounced: [ʁeˈpublikɐ dɐ ɡiˈnɛ biˈsaw]), is a country in West Africa. It covers 36,125 square kilometres (13,948 sq mi) with an estimated population of 1,704,000.',\n", " 'gem_id': 'gem-squad_v2-train-0',\n", " 'id': '56f89ee99b226e1400dd0cd5',\n", " 'question': 'What is the official name for Guinea-Bissau?',\n", " 'title': 'Guinea-Bissau'}" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "train_instance = data['train'][0]\n", "train_instance" ] }, { "cell_type": "markdown", "metadata": { "id": "QMJXgYtEhQkI" }, "source": [ "## Retrieve a target sentence from this entry object" ] }, { "cell_type": "code", "execution_count": 11, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 35 }, "id": "_vwM1nq2k_U3", "outputId": "b7e28d45-f2d1-4c5c-a334-007fcf99ab85" }, "outputs": [ { "data": { "text/plain": [ "'What is the official name for Guinea-Bissau?'" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sentence = train_instance.get(\"question\")\n", "sentence" ] }, { "cell_type": "markdown", "metadata": { "id": "gjXQnhLShpin" }, "source": [ "# 3. Test the filter" ] }, { "cell_type": "markdown", "metadata": { "id": "YpLi1-9Thyxk" }, "source": [ "## Load a filter class from a corresponding ditectory and try the example from its ReadMe" ] }, { "cell_type": "code", "execution_count": 12, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "GxpwSB9Uiim3", "outputId": "c8edeaed-6a90-4772-cbb0-14b5461fc5f9" }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "False\n", "True\n", "False\n", "False\n", "False\n", "False\n" ] } ], "source": [ "# QuestionFilter \n", "from filters.question_filter import *\n", "\n", "f1 = WhereQuestion()\n", "f2 = WhatQuestion()\n", "f3 = WhoQuestion()\n", "f4 = WhichQuestion()\n", "f5 = WhyQuestion()\n", "f6 = WhenQuestion()\n", "filter_obj = [f1, f2, f3, f4, f5, f6] # question filter\n", "for f in filter_obj:\n", " print(f.filter(question=sentence))" ] }, { "cell_type": "markdown", "metadata": { "id": "KgMK5NZ3iIMc" }, "source": [ "## Take a subset of target sentences from CommonGem dataset \n" ] }, { "cell_type": "code", "execution_count": 13, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "jM8b6hQ1rG_w", "outputId": "36be13fe-85bb-417d-82d4-97687d1f4ab0" }, "outputs": [ { "data": { "text/plain": [ "['What is the official name for Guinea-Bissau?',\n", " 'Where is Guinea-Bissau located?',\n", " 'How many square miles is Guinea-Bissau?',\n", " 'What is the estimated population of Guinea-Bissau?',\n", " 'How many kilometers does Guinea-Bissau cover?',\n", " 'What kingdom was Guinea-Bissau once part of?',\n", " 'What empire was Guinea-Bissau once part of?',\n", " 'What year was Guinea-Bissau declared independent?',\n", " 'What country did Guinea-Bissau seek to differentiate itself from?',\n", " 'Guinea-Bissau has a history of what since independence?',\n", " 'What percentage of the population speaks Portuguese?',\n", " 'What percentage of the population speaks Crioulo?',\n", " 'What are the two main religions?',\n", " 'What is their gross domestic product status?',\n", " 'What is the minority religion?',\n", " 'What Islamic organization does Guinea-Bissau belong to?',\n", " 'What Portuguese organization does Guinea-Bissau belong to?',\n", " 'What West African organization does Guinea-Bissau belong to?',\n", " 'What South Atlantic organization does Guinea-Bissau belong to?',\n", " 'What Latin organization does Guinea-Bissau belong to?',\n", " 'What area was known as the Slave Coast?',\n", " 'Who exported African slaves to the western hemisphere?',\n", " 'What kingdom was Guinea-Bissau once a part of?',\n", " 'How long did the Mali Empire persist?',\n", " 'Who traded slaves into the Middle East?',\n", " \"When was Alvise Cadamosto's voyage?\",\n", " \"When was Eustache de la Fosse's voyage?\",\n", " 'What was the name of the Portuguese explorer?',\n", " \"What river did Diogo Cao reach in the 1480's?\",\n", " 'What country is about 4200 km from Guinea-Bissau?',\n", " 'What areas were the first places colonized by the Portuguese?',\n", " 'When did the Portuguese first set up trading posts in Guinea-Bissau?',\n", " 'When did the Portuguese explore the interior of Guinea-Bissau?',\n", " 'Who controlled the inland trade in Guinea-Bissau during this time?',\n", " 'What ports were the Portuguese restricted to?',\n", " 'Who tried to establish a rival foothold at Bolama?',\n", " 'When was a rival foothold attempted at Bolama?',\n", " 'Who regarded Bolama as their own in the 19th century?',\n", " 'What other area did the Portuguese regard as their special territory?',\n", " 'What rival did the Portuguese fend off in Guinea-Bissau?',\n", " 'What group started an armed rebellion in Guinea-Bissau?',\n", " 'When did the armed rebellion begin?',\n", " 'Who was the leader of the armed rebellion?',\n", " 'Who supplied doctors and technicians to the rebels?',\n", " 'When was Cabral assassinated?',\n", " 'When was independence declared?',\n", " 'What date was independence considered universal? ',\n", " 'What event caused the recognition to be universal?',\n", " 'Where did a coup take place?',\n", " 'Who was overthrown in the coup?',\n", " 'Who was the first President of Guinea-Bissau?',\n", " 'How many Guinean soldiers did the PAIGC kill?',\n", " 'Where did one of the massacres occur?',\n", " 'When did the PAIGC acknowledge the executions?',\n", " 'Where were the soldiers buried?',\n", " 'Who controlled the country prior to 1984?',\n", " 'When were the first multi-party elections held?',\n", " 'What led to the Guinea-Bissau Civil War?',\n", " 'When was the president ousted?',\n", " 'Who was elected president in the 2000 election?',\n", " 'When was a military coup conducted?',\n", " 'Who did the military arrest?',\n", " 'When were legislative elections held?',\n", " 'When did the mutiny of military factions occur?',\n", " 'Who died in the mutiny?',\n", " 'After the coup, when were presidential elections held?',\n", " 'At that time, who ran claiming to be the legitimate president of the country?',\n", " 'Who won the election?',\n", " 'Who did Vieira beat in a runoff election?',\n", " 'When was Vieira, a former president, deposed?',\n", " 'What was reported to be entering the country prior to the election?',\n", " 'What type of \"disturbances\" were reported during the campaign?',\n", " 'How did foreign election monitors describe the election?',\n", " 'What year was the election held?',\n", " 'Where the election monitors local, or foreign?',\n", " 'When was the parliamentary election held?',\n", " 'Who won a strong majority in the election?',\n", " 'How many seats did PAIGC win in the election?',\n", " 'Whose residence was attacked by members of the armed forces?',\n", " 'When did the attack on the residence occur?',\n", " 'Who was assassinated on 2 March 2009?',\n", " 'Who was assassinated on 1 March 2009?',\n", " 'Who pledged to respect the constitutional order of succession?',\n", " 'Who was appointed interim president?',\n", " 'Who won the election in June 2009?',\n", " \"When was a coup d'etat staged?\",\n", " \"Who staged the coup d'etat?\",\n", " \"Who assumed control of the country after the coup d'etat?\",\n", " 'Who did Kuruma negotiate with?',\n", " \"What was Kuruma's former position?\",\n", " 'What country is listed as a republic?',\n", " 'When had the government been highly centralized?',\n", " 'When was multi-party governance established?',\n", " 'Who is the head of state?',\n", " 'Who is the head of government?',\n", " 'How many members compose the legislature?',\n", " 'Is the legislature bicameral or unicameral?',\n", " 'How long do members serve in the legislature?',\n", " 'What is the head of the judicial system?',\n", " 'How many justices are on the Supreme Court?']" ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "def get_sentences(split_name, num_iter):\n", " sentences = []\n", " for i in range(num_iter):\n", " sentence = data[split_name][i].get(\"question\")\n", " sentences.append(sentence)\n", " return sentences\n", "\n", "sentences = get_sentences('train', 100)\n", "sentences" ] }, { "cell_type": "markdown", "metadata": { "id": "itxrvpogigSD" }, "source": [ "## Apply a filter to this small subset" ] }, { "cell_type": "code", "execution_count": 14, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "vZN-yXquuP-j", "outputId": "2f6e8697-5642-44ee-b3fc-cb433988ee58" }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, True, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]\n", "[True, False, False, True, False, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, False, True, False, False, False, False, True, True, True, True, False, False, False, True, False, False, False, True, True, True, False, False, False, False, False, True, True, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, True, True, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, True, False, False, False, False, False, False, False, True, False]\n", "[False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, False, False, True, False, False, False, False, False, False, False, False, True, False, True, False, True, False, False, False, False, True, True, False, False, False, False, False, True, True, False, False, False, False, True, False, False, False, True, False, True, False, False, True, False, True, True, True, False, False, False, False, False, False, False, True, False, False, False, True, True, True, True, True, False, True, True, True, False, False, False, False, True, True, False, False, False, False, False]\n", "[False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]\n", "[False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]\n", "[False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, True, False, False, False, False, True, True, False, False, False, True, False, False, False, False, True, False, False, True, True, False, False, False, False, False, False, False, True, False, False, True, False, True, False, True, False, True, True, False, True, False, False, False, True, False, False, False, False, False, True, False, False, False, True, False, False, False, False, False, True, False, False, False, False, False, True, True, False, False, False, False, False, False, False]\n" ] } ], "source": [ "for f in filter_obj:\n", " print([f.filter(question=entry) for entry in sentences])" ] }, { "cell_type": "markdown", "metadata": { "id": "UUVKSJuhirRX" }, "source": [ "## Explore statistics which makes a filter returning the presence of gender bias" ] }, { "cell_type": "code", "execution_count": 15, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "98iL8OjXuliC", "outputId": "94901909-cf15-4b04-c7df-7eaa76d84c47" }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "WhereQuestion flagged questions : 5\n", "WhatQuestion flagged questions : 36\n", "WhoQuestion flagged questions : 27\n", "WhichQuestion flagged questions : 0\n", "WhyQuestion flagged questions : 0\n", "WhenQuestion flagged questions : 21\n" ] } ], "source": [ "def get_stats(text, filter_obj):\n", " for f in filter_obj:\n", " print(f\"{f.__class__.__name__} flagged questions : {sum([f.filter(question=entry) for entry in sentences])}\")\n", "\n", "get_stats(sentences, filter_obj)" ] }, { "cell_type": "markdown", "metadata": { "id": "x8Fyq4Qui5eU" }, "source": [ "## Retrieve the sentences, corresponding to the statistics" ] }, { "cell_type": "code", "execution_count": 16, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "R3qw6zORu-TI", "outputId": "b51711c7-9598-4ca0-cfee-8c0c01e829cd" }, "outputs": [ { "data": { "text/plain": [ "[{'WhereQuestion': ['Where is Guinea-Bissau located?',\n", " 'Where did a coup take place?',\n", " 'Where did one of the massacres occur?',\n", " 'Where were the soldiers buried?',\n", " 'Where the election monitors local, or foreign?']},\n", " {'WhatQuestion': ['What is the official name for Guinea-Bissau?',\n", " 'What is the estimated population of Guinea-Bissau?',\n", " 'What kingdom was Guinea-Bissau once part of?',\n", " 'What empire was Guinea-Bissau once part of?',\n", " 'What year was Guinea-Bissau declared independent?',\n", " 'What country did Guinea-Bissau seek to differentiate itself from?',\n", " 'Guinea-Bissau has a history of what since independence?',\n", " 'What percentage of the population speaks Portuguese?',\n", " 'What percentage of the population speaks Crioulo?',\n", " 'What are the two main religions?',\n", " 'What is their gross domestic product status?',\n", " 'What is the minority religion?',\n", " 'What Islamic organization does Guinea-Bissau belong to?',\n", " 'What Portuguese organization does Guinea-Bissau belong to?',\n", " 'What West African organization does Guinea-Bissau belong to?',\n", " 'What South Atlantic organization does Guinea-Bissau belong to?',\n", " 'What Latin organization does Guinea-Bissau belong to?',\n", " 'What area was known as the Slave Coast?',\n", " 'What kingdom was Guinea-Bissau once a part of?',\n", " 'What was the name of the Portuguese explorer?',\n", " \"What river did Diogo Cao reach in the 1480's?\",\n", " 'What country is about 4200 km from Guinea-Bissau?',\n", " 'What areas were the first places colonized by the Portuguese?',\n", " 'What ports were the Portuguese restricted to?',\n", " 'What other area did the Portuguese regard as their special territory?',\n", " 'What rival did the Portuguese fend off in Guinea-Bissau?',\n", " 'What group started an armed rebellion in Guinea-Bissau?',\n", " 'What date was independence considered universal? ',\n", " 'What event caused the recognition to be universal?',\n", " 'What led to the Guinea-Bissau Civil War?',\n", " 'What was reported to be entering the country prior to the election?',\n", " 'What type of \"disturbances\" were reported during the campaign?',\n", " 'What year was the election held?',\n", " \"What was Kuruma's former position?\",\n", " 'What country is listed as a republic?',\n", " 'What is the head of the judicial system?']},\n", " {'WhoQuestion': ['Who exported African slaves to the western hemisphere?',\n", " 'Who traded slaves into the Middle East?',\n", " 'Who controlled the inland trade in Guinea-Bissau during this time?',\n", " 'Who tried to establish a rival foothold at Bolama?',\n", " 'Who regarded Bolama as their own in the 19th century?',\n", " 'Who was the leader of the armed rebellion?',\n", " 'Who supplied doctors and technicians to the rebels?',\n", " 'Who was overthrown in the coup?',\n", " 'Who was the first President of Guinea-Bissau?',\n", " 'Who controlled the country prior to 1984?',\n", " 'Who was elected president in the 2000 election?',\n", " 'Who did the military arrest?',\n", " 'Who died in the mutiny?',\n", " 'At that time, who ran claiming to be the legitimate president of the country?',\n", " 'Who won the election?',\n", " 'Who did Vieira beat in a runoff election?',\n", " 'Who won a strong majority in the election?',\n", " 'Who was assassinated on 2 March 2009?',\n", " 'Who was assassinated on 1 March 2009?',\n", " 'Who pledged to respect the constitutional order of succession?',\n", " 'Who was appointed interim president?',\n", " 'Who won the election in June 2009?',\n", " \"Who staged the coup d'etat?\",\n", " \"Who assumed control of the country after the coup d'etat?\",\n", " 'Who did Kuruma negotiate with?',\n", " 'Who is the head of state?',\n", " 'Who is the head of government?']},\n", " {'WhichQuestion': []},\n", " {'WhyQuestion': []},\n", " {'WhenQuestion': [\"When was Alvise Cadamosto's voyage?\",\n", " \"When was Eustache de la Fosse's voyage?\",\n", " 'When did the Portuguese first set up trading posts in Guinea-Bissau?',\n", " 'When did the Portuguese explore the interior of Guinea-Bissau?',\n", " 'When was a rival foothold attempted at Bolama?',\n", " 'When did the armed rebellion begin?',\n", " 'When was Cabral assassinated?',\n", " 'When was independence declared?',\n", " 'When did the PAIGC acknowledge the executions?',\n", " 'When were the first multi-party elections held?',\n", " 'When was the president ousted?',\n", " 'When was a military coup conducted?',\n", " 'When were legislative elections held?',\n", " 'When did the mutiny of military factions occur?',\n", " 'After the coup, when were presidential elections held?',\n", " 'When was Vieira, a former president, deposed?',\n", " 'When was the parliamentary election held?',\n", " 'When did the attack on the residence occur?',\n", " \"When was a coup d'etat staged?\",\n", " 'When had the government been highly centralized?',\n", " 'When was multi-party governance established?']}]" ] }, "execution_count": 16, "metadata": {}, "output_type": "execute_result" } ], "source": [ "def get_phrases(sentences, filter_obj):\n", " group = []\n", " for f in filter_obj:\n", " sent_list = {}\n", " sent_list[f.__class__.__name__] = [entry for entry in sentences if f.filter(question=entry)]\n", " group.append(sent_list)\n", " return group\n", "\n", "grouped_list = get_phrases(sentences, filter_obj)\n", "grouped_list" ] }, { "cell_type": "code", "execution_count": 17, "metadata": { "id": "ecA9wIMZCQHX" }, "outputs": [], "source": [ "def create_filtered(split_name, num_iter, grouped_list):\n", " filtered_object = {'QuestionFilter':{}}\n", " for group in grouped_list:\n", " id_list = {}\n", " id_list[list(group)[0]] = [data[split_name][i].get(\"gem_id\") for i in range(num_iter) if data[split_name][i].get(\"question\") in group[list(group)[0]]]\n", " filtered_object['QuestionFilter'].update(id_list) \n", " return filtered_object\n" ] }, { "cell_type": "markdown", "metadata": { "id": "H1UQKf2dHctt" }, "source": [ "## Create final object with filtered data" ] }, { "cell_type": "code", "execution_count": 20, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "_neZXkvnFumE", "outputId": "f9ba67c6-979c-431b-9b10-12c9ea6d7394" }, "outputs": [ { "data": { "text/plain": [ "{'QuestionFilter': {'WhereQuestion': ['gem-squad_v2-train-1',\n", " 'gem-squad_v2-train-48',\n", " 'gem-squad_v2-train-52',\n", " 'gem-squad_v2-train-54',\n", " 'gem-squad_v2-train-74'],\n", " 'WhatQuestion': ['gem-squad_v2-train-0',\n", " 'gem-squad_v2-train-3',\n", " 'gem-squad_v2-train-5',\n", " 'gem-squad_v2-train-6',\n", " 'gem-squad_v2-train-7',\n", " 'gem-squad_v2-train-8',\n", " 'gem-squad_v2-train-9',\n", " 'gem-squad_v2-train-10',\n", " 'gem-squad_v2-train-11',\n", " 'gem-squad_v2-train-12',\n", " 'gem-squad_v2-train-13',\n", " 'gem-squad_v2-train-14',\n", " 'gem-squad_v2-train-15',\n", " 'gem-squad_v2-train-16',\n", " 'gem-squad_v2-train-17',\n", " 'gem-squad_v2-train-18',\n", " 'gem-squad_v2-train-19',\n", " 'gem-squad_v2-train-20',\n", " 'gem-squad_v2-train-22',\n", " 'gem-squad_v2-train-27',\n", " 'gem-squad_v2-train-28',\n", " 'gem-squad_v2-train-29',\n", " 'gem-squad_v2-train-30',\n", " 'gem-squad_v2-train-34',\n", " 'gem-squad_v2-train-38',\n", " 'gem-squad_v2-train-39',\n", " 'gem-squad_v2-train-40',\n", " 'gem-squad_v2-train-46',\n", " 'gem-squad_v2-train-47',\n", " 'gem-squad_v2-train-57',\n", " 'gem-squad_v2-train-70',\n", " 'gem-squad_v2-train-71',\n", " 'gem-squad_v2-train-73',\n", " 'gem-squad_v2-train-89',\n", " 'gem-squad_v2-train-90',\n", " 'gem-squad_v2-train-98'],\n", " 'WhoQuestion': ['gem-squad_v2-train-21',\n", " 'gem-squad_v2-train-24',\n", " 'gem-squad_v2-train-33',\n", " 'gem-squad_v2-train-35',\n", " 'gem-squad_v2-train-37',\n", " 'gem-squad_v2-train-42',\n", " 'gem-squad_v2-train-43',\n", " 'gem-squad_v2-train-49',\n", " 'gem-squad_v2-train-50',\n", " 'gem-squad_v2-train-55',\n", " 'gem-squad_v2-train-59',\n", " 'gem-squad_v2-train-61',\n", " 'gem-squad_v2-train-64',\n", " 'gem-squad_v2-train-66',\n", " 'gem-squad_v2-train-67',\n", " 'gem-squad_v2-train-68',\n", " 'gem-squad_v2-train-76',\n", " 'gem-squad_v2-train-80',\n", " 'gem-squad_v2-train-81',\n", " 'gem-squad_v2-train-82',\n", " 'gem-squad_v2-train-83',\n", " 'gem-squad_v2-train-84',\n", " 'gem-squad_v2-train-86',\n", " 'gem-squad_v2-train-87',\n", " 'gem-squad_v2-train-88',\n", " 'gem-squad_v2-train-93',\n", " 'gem-squad_v2-train-94'],\n", " 'WhichQuestion': [],\n", " 'WhyQuestion': [],\n", " 'WhenQuestion': ['gem-squad_v2-train-25',\n", " 'gem-squad_v2-train-26',\n", " 'gem-squad_v2-train-31',\n", " 'gem-squad_v2-train-32',\n", " 'gem-squad_v2-train-36',\n", " 'gem-squad_v2-train-41',\n", " 'gem-squad_v2-train-44',\n", " 'gem-squad_v2-train-45',\n", " 'gem-squad_v2-train-53',\n", " 'gem-squad_v2-train-56',\n", " 'gem-squad_v2-train-58',\n", " 'gem-squad_v2-train-60',\n", " 'gem-squad_v2-train-62',\n", " 'gem-squad_v2-train-63',\n", " 'gem-squad_v2-train-65',\n", " 'gem-squad_v2-train-69',\n", " 'gem-squad_v2-train-75',\n", " 'gem-squad_v2-train-79',\n", " 'gem-squad_v2-train-85',\n", " 'gem-squad_v2-train-91',\n", " 'gem-squad_v2-train-92']}}" ] }, "execution_count": 20, "metadata": {}, "output_type": "execute_result" } ], "source": [ "filtered_object = create_filtered(\"train\", len(sentences), grouped_list)\n", "filtered_object" ] }, { "cell_type": "markdown", "metadata": { "id": "1grVKh4ZHjtu" }, "source": [ "## Store the object in a json file" ] }, { "cell_type": "code", "execution_count": 21, "metadata": { "id": "mhsiQWcAFo1H" }, "outputs": [], "source": [ "import json\n", "\n", "with open('question_filter_train.json', 'w') as outfile:\n", " json.dump(filtered_object, outfile)" ] }, { "cell_type": "markdown", "metadata": { "id": "Ybx2Dw51vS-z" }, "source": [ "# 4. Apply the process to multiple entries" ] }, { "cell_type": "code", "execution_count": 39, "metadata": { "id": "dmDf962j3Ar0" }, "outputs": [], "source": [ "sentences = get_sentences('train', len(data[\"train\"]))" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "V4-8LRjD3erW", "outputId": "3954ed61-37a4-4f95-e628-bbd97d2d55ae" }, "outputs": [], "source": [ "get_stats(sentences, filter_obj)" ] }, { "cell_type": "code", "execution_count": 36, "metadata": { "id": "faO5Dh7Q3nZo" }, "outputs": [], "source": [ "grouped_list = get_phrases(sentences, filter_obj)" ] }, { "cell_type": "code", "execution_count": 37, "metadata": { "id": "INFDYWULH1Gg" }, "outputs": [], "source": [ "filtered_object = create_filtered(\"train\", len(data[\"train\"]), grouped_list)" ] }, { "cell_type": "code", "execution_count": 38, "metadata": { "id": "dbBRKpgCMnCq" }, "outputs": [], "source": [ "with open('challenge_sets/challenge_question_filter_train.json', 'w') as outfile:\n", " json.dump(filtered_object, outfile)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Filter out answerable and non-answerable questions\n", "This filteration doesn't use NL-Augmenter's filters. The idea here is to separate out the answerable questions (part of SQuAD1.1) from the non-answerable ones (part of SQuAD2.0)." ] }, { "cell_type": "code", "execution_count": 103, "metadata": {}, "outputs": [], "source": [ "# Filter answerable questions from non-answerable ones\n", "def create_filtered_data(data, split):\n", " filtered_object = {'AnswerFilter': {}}\n", " answerable_question = {'AnswerableQuestion': []}\n", " non_answerable_question = {'NonAnswerableQuestion': []}\n", " \n", " for entry in data[split]:\n", " if len(entry['answers']['answer_start']) == 0:\n", " non_answerable_question['NonAnswerableQuestion'].append(entry['gem_id'])\n", " else:\n", " answerable_question['AnswerableQuestion'].append(entry['gem_id']) \n", " filtered_object['AnswerFilter'].update(answerable_question)\n", " filtered_object['AnswerFilter'].update(non_answerable_question)\n", " return filtered_object" ] }, { "cell_type": "code", "execution_count": 104, "metadata": {}, "outputs": [], "source": [ "filtered_object = create_filtered_data(data, 'train')" ] }, { "cell_type": "code", "execution_count": 105, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Answerable questions : 77580\n", "Non-Answerable questions : 38817\n" ] } ], "source": [ "def get_stats(filtered_object):\n", " print(f\"Answerable questions : {len(filtered_object['AnswerFilter']['AnswerableQuestion'])}\")\n", " print(f\"Non-Answerable questions : {len(filtered_object['AnswerFilter']['NonAnswerableQuestion'])}\")\n", " \n", "get_stats(filtered_object)\n" ] }, { "cell_type": "code", "execution_count": 106, "metadata": {}, "outputs": [], "source": [ "with open('challenge_sets/challenge_answer_filter_train.json', 'w') as outfile:\n", " json.dump(filtered_object, outfile)" ] } ], "metadata": { "colab": { "collapsed_sections": [], "name": "GEM_Hackathon_2021_filters_tutorial.ipynb", "provenance": [] }, "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.5" }, "widgets": { "application/vnd.jupyter.widget-state+json": { "07386fcb9b8a4a25b4a06136cf2d69c5": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "HTMLModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_29f4ba3028a3498ab802f96fb1c42fb8", "placeholder": "​", "style": "IPY_MODEL_fa507001884643a387d7e0a46d498604", "value": " 101M/101M [00:07<00:00, 14.0MB/s]" } }, "0ad3dcd165ed43ad800fca8946d7716e": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "model_name": "LayoutModel", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "0fe578cb04654fae89322571049c48e7": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "model_name": "LayoutModel", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": "20px" } }, "18e6b91315504e95b45faf94698b4ab5": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "DescriptionStyleModel", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "1f2594d50c8c4df6ada87486ae897f58": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "HTMLModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_99dbd39ad800493aa21656eaba325c68", "placeholder": "​", "style": "IPY_MODEL_b3591d13bc4647b4b122244686f01793", "value": "39916 examples [00:03, 8913.27 examples/s]" } }, "20aa9ff64ac5483095c849a35676958e": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "ProgressStyleModel", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "ProgressStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "bar_color": null, "description_width": "initial" } }, "249a2b434fa4421fbcaee04512306ef5": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "HTMLModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_56a75ac849ef4e22a02de0b56d05d13e", "placeholder": "​", "style": "IPY_MODEL_532c0b0e92ad4323bfada2ad17cd64c3", "value": " 43.5M/43.5M [00:02<00:00, 20.4MB/s]" } }, "25034a9f750c442599809bed8f47a029": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "FloatProgressModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "FloatProgressModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "ProgressView", "bar_style": "info", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_7475e328a906408492734428a2d5157d", "max": 1, "min": 0, "orientation": "horizontal", "style": "IPY_MODEL_20aa9ff64ac5483095c849a35676958e", "value": 1 } }, "29f4ba3028a3498ab802f96fb1c42fb8": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "model_name": "LayoutModel", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "3abd5ba4771248d796a890b8ed055f01": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "HBoxModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HBoxModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HBoxView", "box_style": "", "children": [ "IPY_MODEL_25034a9f750c442599809bed8f47a029", "IPY_MODEL_1f2594d50c8c4df6ada87486ae897f58" ], "layout": "IPY_MODEL_7d35cb7d0127409a9dc8b9203b228c79" } }, "3bbe92c3974641b98d8ef5777dc491de": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "HTMLModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_d77a514d39a14142a1c51a2e7d136565", "placeholder": "​", "style": "IPY_MODEL_e2f417a1a55a463297ee168f687a29d3", "value": " 5.02k/5.02k [00:08<00:00, 616B/s]" } }, "4b4984daa68a4cd6953539e58b763bdb": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "model_name": "LayoutModel", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "4c3312c6902e4436a5368f1e86eed65a": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "model_name": "LayoutModel", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "532c0b0e92ad4323bfada2ad17cd64c3": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "DescriptionStyleModel", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "5463eaab09e640ce851d457ffc3ba2bb": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "model_name": "LayoutModel", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "56a75ac849ef4e22a02de0b56d05d13e": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "model_name": "LayoutModel", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "59abc07b8f594485a4cbe01360341705": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "HBoxModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HBoxModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HBoxView", "box_style": "", "children": [ "IPY_MODEL_cea605e546a14d70bfb23cf6568eee27", "IPY_MODEL_c269d4210e754a75a45e4995e4f9c3b5" ], "layout": "IPY_MODEL_4b4984daa68a4cd6953539e58b763bdb" } }, "5feec27442e74914aa98c7b05a55af21": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "model_name": "LayoutModel", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "7070284d09a640f296ad5337698a5e68": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "ProgressStyleModel", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "ProgressStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "bar_color": null, "description_width": "initial" } }, "7402db88b7eb43b38f347384a49b53ec": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "ProgressStyleModel", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "ProgressStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "bar_color": null, "description_width": "initial" } }, "7475e328a906408492734428a2d5157d": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "model_name": "LayoutModel", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": "20px" } }, "7663b3bd79db43a1982c4c46d2d6a83a": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "ProgressStyleModel", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "ProgressStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "bar_color": null, "description_width": "initial" } }, "7bf0345f9db84e468ccb58901c881f39": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "HTMLModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_83fb9bb42d734abe9878f7c4fcb212e9", "placeholder": "​", "style": "IPY_MODEL_e4139a008d574efb9a5b1cec6790d848", "value": "90403 examples [00:16, 15097.76 examples/s]" } }, "7d35cb7d0127409a9dc8b9203b228c79": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "model_name": "LayoutModel", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "815255b488c745519de3e645e96d7d19": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "FloatProgressModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "FloatProgressModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "ProgressView", "bar_style": "success", "description": "Downloading: 100%", "description_tooltip": null, "layout": "IPY_MODEL_85d410e7c9024609bd80a54b449093e6", "max": 14480863, "min": 0, "orientation": "horizontal", "style": "IPY_MODEL_7663b3bd79db43a1982c4c46d2d6a83a", "value": 14480863 } }, "8307844b3fda4eb68eebc048c5f9eb11": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "HBoxModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HBoxModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HBoxView", "box_style": "", "children": [ "IPY_MODEL_815255b488c745519de3e645e96d7d19", "IPY_MODEL_9ec7464fe62d4f359fb007eb47fa2343" ], "layout": "IPY_MODEL_5463eaab09e640ce851d457ffc3ba2bb" } }, "83f25fd2658142e4a2be06e00a7966cb": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "FloatProgressModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "FloatProgressModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "ProgressView", "bar_style": "success", "description": "Downloading: 100%", "description_tooltip": null, "layout": "IPY_MODEL_fc7335335b114e22b33db1a830ea90e4", "max": 5020, "min": 0, "orientation": "horizontal", "style": "IPY_MODEL_7402db88b7eb43b38f347384a49b53ec", "value": 5020 } }, "83fb9bb42d734abe9878f7c4fcb212e9": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "model_name": "LayoutModel", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "85d410e7c9024609bd80a54b449093e6": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "model_name": "LayoutModel", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "89d31e1e5f99473485f4025971ed6a1d": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "ProgressStyleModel", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "ProgressStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "bar_color": null, "description_width": "initial" } }, "8fce5b95f6db4c13a99886bb178e4c1d": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "HBoxModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HBoxModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HBoxView", "box_style": "", "children": [ "IPY_MODEL_bfb105f1cfdf4702a4822f207b927d1e", "IPY_MODEL_07386fcb9b8a4a25b4a06136cf2d69c5" ], "layout": "IPY_MODEL_e89ec92a3ae34d239e3b131fc240fc34" } }, "90e1a383e3354125bd158c5952920ad3": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "HBoxModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HBoxModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HBoxView", "box_style": "", "children": [ "IPY_MODEL_99dd5c88984f4952ad65f5ba1e5becc2", "IPY_MODEL_249a2b434fa4421fbcaee04512306ef5" ], "layout": "IPY_MODEL_e9f93c50c219406a82f55127ad09b555" } }, "91930c1187a04a91b4c59e0ceb883d56": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "DescriptionStyleModel", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "9886e2d3e8114db39cc4adf098a50be5": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "HBoxModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HBoxModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HBoxView", "box_style": "", "children": [ "IPY_MODEL_ca1c50a7ea1c47469339a0eab4c32fb8", "IPY_MODEL_7bf0345f9db84e468ccb58901c881f39" ], "layout": "IPY_MODEL_b68d75b7ad23470e9d5d1aa3f7639ecd" } }, "99dbd39ad800493aa21656eaba325c68": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "model_name": "LayoutModel", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "99dd5c88984f4952ad65f5ba1e5becc2": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "FloatProgressModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "FloatProgressModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "ProgressView", "bar_style": "success", "description": "Downloading: 100%", "description_tooltip": null, "layout": "IPY_MODEL_a4812e4c447c4288bff063b6bd86ee66", "max": 43457905, "min": 0, "orientation": "horizontal", "style": "IPY_MODEL_c068b76648fa47b5a30c251c0630160c", "value": 43457905 } }, "9ec7464fe62d4f359fb007eb47fa2343": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "HTMLModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_5feec27442e74914aa98c7b05a55af21", "placeholder": "​", "style": "IPY_MODEL_18e6b91315504e95b45faf94698b4ab5", "value": " 14.5M/14.5M [00:01<00:00, 10.5MB/s]" } }, "a4812e4c447c4288bff063b6bd86ee66": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "model_name": "LayoutModel", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "b3591d13bc4647b4b122244686f01793": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "DescriptionStyleModel", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "b3887cde43174c40b5cc5575aba0f106": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "model_name": "LayoutModel", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": "20px" } }, "b68d75b7ad23470e9d5d1aa3f7639ecd": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "model_name": "LayoutModel", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "bfb105f1cfdf4702a4822f207b927d1e": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "FloatProgressModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "FloatProgressModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "ProgressView", "bar_style": "success", "description": "Downloading: 100%", "description_tooltip": null, "layout": "IPY_MODEL_0ad3dcd165ed43ad800fca8946d7716e", "max": 101226421, "min": 0, "orientation": "horizontal", "style": "IPY_MODEL_d0e42ee4fc854b73b2b8929ff2a26cde", "value": 101226421 } }, "c068b76648fa47b5a30c251c0630160c": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "ProgressStyleModel", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "ProgressStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "bar_color": null, "description_width": "initial" } }, "c269d4210e754a75a45e4995e4f9c3b5": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "HTMLModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_4c3312c6902e4436a5368f1e86eed65a", "placeholder": "​", "style": "IPY_MODEL_91930c1187a04a91b4c59e0ceb883d56", "value": "11873 examples [00:01, 110.35 examples/s]" } }, "ca1c50a7ea1c47469339a0eab4c32fb8": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "FloatProgressModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "FloatProgressModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "ProgressView", "bar_style": "info", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_b3887cde43174c40b5cc5575aba0f106", "max": 1, "min": 0, "orientation": "horizontal", "style": "IPY_MODEL_7070284d09a640f296ad5337698a5e68", "value": 1 } }, "cea605e546a14d70bfb23cf6568eee27": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "FloatProgressModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "FloatProgressModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "ProgressView", "bar_style": "info", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_0fe578cb04654fae89322571049c48e7", "max": 1, "min": 0, "orientation": "horizontal", "style": "IPY_MODEL_89d31e1e5f99473485f4025971ed6a1d", "value": 1 } }, "d0e42ee4fc854b73b2b8929ff2a26cde": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "ProgressStyleModel", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "ProgressStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "bar_color": null, "description_width": "initial" } }, "d6fcdf4b5c194a7380a8a0df60ae2298": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "model_name": "LayoutModel", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "d77a514d39a14142a1c51a2e7d136565": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "model_name": "LayoutModel", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "e2f417a1a55a463297ee168f687a29d3": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "DescriptionStyleModel", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "e4139a008d574efb9a5b1cec6790d848": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "DescriptionStyleModel", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "e4c1e861f8434fa29cff33f367c61d7a": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "HBoxModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HBoxModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HBoxView", "box_style": "", "children": [ "IPY_MODEL_83f25fd2658142e4a2be06e00a7966cb", "IPY_MODEL_3bbe92c3974641b98d8ef5777dc491de" ], "layout": "IPY_MODEL_d6fcdf4b5c194a7380a8a0df60ae2298" } }, "e89ec92a3ae34d239e3b131fc240fc34": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "model_name": "LayoutModel", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "e9f93c50c219406a82f55127ad09b555": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "model_name": "LayoutModel", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "fa507001884643a387d7e0a46d498604": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "DescriptionStyleModel", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "fc7335335b114e22b33db1a830ea90e4": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "model_name": "LayoutModel", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } } } } }, "nbformat": 4, "nbformat_minor": 1 }