File size: 58,959 Bytes
4d7c011
1
2
{"cells":[{"cell_type":"markdown","id":"3922a573","metadata":{},"source":["# Index creation"]},{"cell_type":"markdown","id":"viixGIJcKPSQ","metadata":{"id":"viixGIJcKPSQ"},"source":["## Preliminary operations"]},{"cell_type":"code","execution_count":1,"id":"MevE4jEZ5QBT","metadata":{"colab":{"base_uri":"https://localhost:8080/"},"executionInfo":{"elapsed":25189,"status":"ok","timestamp":1652189481823,"user":{"displayName":"Stefano Fiorucci","userId":"12409279692445770059"},"user_tz":-120},"id":"MevE4jEZ5QBT","outputId":"d4b2a927-e000-442b-ebc6-0d40d8a165d6"},"outputs":[{"name":"stdout","output_type":"stream","text":["Mounted at /content/drive\n"]}],"source":["from google.colab import drive\n","drive.mount('/content/drive')"]},{"cell_type":"code","execution_count":null,"id":"VYWRJ-Lf55nV","metadata":{"colab":{"base_uri":"https://localhost:8080/"},"executionInfo":{"elapsed":161669,"status":"ok","timestamp":1652189651623,"user":{"displayName":"Stefano Fiorucci","userId":"12409279692445770059"},"user_tz":-120},"id":"VYWRJ-Lf55nV","outputId":"5c860ef6-d4cb-4293-d704-51454a3f88bf"},"outputs":[],"source":["# install dependencies\n","! pip install farm-haystack[faiss-gpu]"]},{"cell_type":"markdown","id":"QVDuHAMIK4bg","metadata":{"id":"QVDuHAMIK4bg"},"source":["## Load data"]},{"cell_type":"code","execution_count":3,"id":"72139774","metadata":{"execution":{"iopub.execute_input":"2022-01-09T08:40:46.176031Z","iopub.status.busy":"2022-01-09T08:40:46.175755Z","iopub.status.idle":"2022-01-09T08:40:46.179554Z","shell.execute_reply":"2022-01-09T08:40:46.178704Z","shell.execute_reply.started":"2022-01-09T08:40:46.175959Z"},"executionInfo":{"elapsed":32,"status":"ok","timestamp":1652189651625,"user":{"displayName":"Stefano Fiorucci","userId":"12409279692445770059"},"user_tz":-120},"id":"72139774"},"outputs":[],"source":["import glob\n","import json"]},{"cell_type":"code","execution_count":4,"id":"4421e328","metadata":{"execution":{"iopub.execute_input":"2022-01-09T08:40:47.846999Z","iopub.status.busy":"2022-01-09T08:40:47.846757Z","iopub.status.idle":"2022-01-09T08:40:48.327632Z","shell.execute_reply":"2022-01-09T08:40:48.326829Z","shell.execute_reply.started":"2022-01-09T08:40:47.846975Z"},"executionInfo":{"elapsed":24363,"status":"ok","timestamp":1652189675961,"user":{"displayName":"Stefano Fiorucci","userId":"12409279692445770059"},"user_tz":-120},"id":"4421e328"},"outputs":[],"source":["DATA_DIRECTORY = '/content/drive/MyDrive/Colab Notebooks/wklp/data'\n","\n","docs=[]\n","\n","for json_file in glob.glob(f'{DATA_DIRECTORY}/*.json'):\n","    with open(json_file, 'r') as fin:\n","        json_content=json.load(fin)\n","        \n","    doc={'content': json_content['text'],\n","        'meta': {'name': json_content['name'],\n","                 'url': json_content['url']}}\n","    docs.append(doc)"]},{"cell_type":"code","execution_count":5,"id":"GR6qWQAn72WG","metadata":{"colab":{"base_uri":"https://localhost:8080/"},"executionInfo":{"elapsed":9,"status":"ok","timestamp":1652189679928,"user":{"displayName":"Stefano Fiorucci","userId":"12409279692445770059"},"user_tz":-120},"id":"GR6qWQAn72WG","outputId":"3e17336f-1145-43ff-c3ca-fab7604343d1"},"outputs":[{"data":{"text/plain":["1087"]},"execution_count":5,"metadata":{},"output_type":"execute_result"}],"source":["len(docs)"]},{"cell_type":"code","execution_count":6,"id":"aa231b94","metadata":{"colab":{"base_uri":"https://localhost:8080/"},"execution":{"iopub.execute_input":"2022-01-09T08:40:48.796741Z","iopub.status.busy":"2022-01-09T08:40:48.796550Z","iopub.status.idle":"2022-01-09T08:40:48.805224Z","shell.execute_reply":"2022-01-09T08:40:48.804705Z","shell.execute_reply.started":"2022-01-09T08:40:48.796722Z"},"executionInfo":{"elapsed":10,"status":"ok","timestamp":1652189681394,"user":{"displayName":"Stefano Fiorucci","userId":"12409279692445770059"},"user_tz":-120},"id":"aa231b94","outputId":"a42147fb-b9a4-4500-cc96-ce73177030f9"},"outputs":[{"data":{"text/plain":["{'content': \"Pete Lindstrom\\nPete Lindstrom was a citizen of Twin Peaks, Washington who was killed in the Blizzard of 1889.\\nHis death was witnessed by Knut Zimmerman, who reported that wind had plunged a candle from the Annual Candlelighting and Christmas Tree Ceremony into the back of Lindstrom's head, killing him.\",\n"," 'meta': {'name': 'Pete_Lindstrom',\n","  'url': 'https://twinpeaks.fandom.com/wiki/Pete_Lindstrom'}}"]},"execution_count":6,"metadata":{},"output_type":"execute_result"}],"source":["docs[5]"]},{"cell_type":"markdown","id":"Yu3bAUPoLrPI","metadata":{"id":"Yu3bAUPoLrPI"},"source":["## Define document store ([FAISS](https://github.com/facebookresearch/faiss)) and write documents\n","\n"]},{"cell_type":"code","execution_count":8,"id":"bfe846df","metadata":{"colab":{"base_uri":"https://localhost:8080/"},"execution":{"iopub.execute_input":"2022-01-09T08:40:59.678181Z","iopub.status.busy":"2022-01-09T08:40:59.678003Z","iopub.status.idle":"2022-01-09T08:40:59.753228Z","shell.execute_reply":"2022-01-09T08:40:59.752500Z","shell.execute_reply.started":"2022-01-09T08:40:59.678161Z"},"executionInfo":{"elapsed":10410,"status":"ok","timestamp":1652190218453,"user":{"displayName":"Stefano Fiorucci","userId":"12409279692445770059"},"user_tz":-120},"id":"bfe846df","outputId":"187c2d40-470a-4f87-ab50-ec4082bccb33"},"outputs":[{"name":"stderr","output_type":"stream","text":["INFO - haystack.modeling.model.optimization -  apex not found, won't use it. See https://nvidia.github.io/apex/\n","ERROR - root -  Failed to import 'magic' (from 'python-magic' and 'python-magic-bin' on Windows). FileTypeClassifier will not perform mimetype detection on extensionless files. Please make sure the necessary OS libraries are installed if you need this functionality.\n","INFO - haystack.telemetry -  Haystack sends anonymous usage data to understand the actual usage and steer dev efforts towards features that are most meaningful to users. You can opt-out at anytime by calling disable_telemetry() or by manually setting the environment variable HAYSTACK_TELEMETRY_ENABLED as described for different operating systems on the documentation page. More information at https://haystack.deepset.ai/guides/telemetry\n"]}],"source":["from haystack.document_stores import FAISSDocumentStore\n","\n","# the document store settings are those compatible with Embedding Retriever\n","document_store = FAISSDocumentStore(\n","    similarity=\"dot_product\",\n","    embedding_dim=768)"]},{"cell_type":"code","execution_count":9,"id":"bc5adb1c","metadata":{"colab":{"base_uri":"https://localhost:8080/"},"execution":{"iopub.execute_input":"2022-01-09T08:41:04.538529Z","iopub.status.busy":"2022-01-09T08:41:04.538227Z","iopub.status.idle":"2022-01-09T08:41:05.147190Z","shell.execute_reply":"2022-01-09T08:41:05.146513Z","shell.execute_reply.started":"2022-01-09T08:41:04.538503Z"},"executionInfo":{"elapsed":2085,"status":"ok","timestamp":1652190317389,"user":{"displayName":"Stefano Fiorucci","userId":"12409279692445770059"},"user_tz":-120},"id":"bc5adb1c","outputId":"4cc11a2d-5ce5-41c1-e5eb-a0ee411ab00b"},"outputs":[{"name":"stdout","output_type":"stream","text":["[nltk_data] Downloading package punkt to /root/nltk_data...\n","[nltk_data]   Unzipping tokenizers/punkt.zip.\n"]},{"name":"stderr","output_type":"stream","text":["  0%|          | 0/1087 [00:00<?, ?docs/s]WARNING - haystack.nodes.preprocessor.preprocessor -  One or more sentence found with word count higher than the split length.\n","100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 1087/1087 [00:01<00:00, 980.44docs/s]\n"]}],"source":["# preprocess documents, splitting by chunks of 200 words\n","\n","from haystack.nodes import PreProcessor\n","\n","processor = PreProcessor(\n","    clean_empty_lines=True,\n","    clean_whitespace=True,\n","    clean_header_footer=True,\n","    split_by=\"word\",\n","    split_length=200,\n","   split_respect_sentence_boundary=True,\n","    split_overlap=0,\n","    language ='en'\n",")\n","preprocessed_docs = processor.process(docs)"]},{"cell_type":"code","execution_count":11,"id":"41986306","metadata":{"colab":{"base_uri":"https://localhost:8080/"},"execution":{"iopub.execute_input":"2022-01-09T08:41:07.414905Z","iopub.status.busy":"2022-01-09T08:41:07.414681Z","iopub.status.idle":"2022-01-09T08:41:07.418856Z","shell.execute_reply":"2022-01-09T08:41:07.418094Z","shell.execute_reply.started":"2022-01-09T08:41:07.414884Z"},"executionInfo":{"elapsed":370,"status":"ok","timestamp":1652190335845,"user":{"displayName":"Stefano Fiorucci","userId":"12409279692445770059"},"user_tz":-120},"id":"41986306","outputId":"04292f05-fd20-432f-febc-8b91ce3d47c4"},"outputs":[{"name":"stdout","output_type":"stream","text":["<Document: id=3f6b71a59e1226326e53871d05393810, content='Pete Lindstrom\n","Pete Lindstrom was a citizen of Twin Peaks, Washington who was killed in the Blizzard ...'>\n"]}],"source":["print(preprocessed_docs[5])\n"]},{"cell_type":"code","execution_count":12,"id":"b9PS0PkM_1EF","metadata":{"colab":{"base_uri":"https://localhost:8080/"},"executionInfo":{"elapsed":370,"status":"ok","timestamp":1652190343399,"user":{"displayName":"Stefano Fiorucci","userId":"12409279692445770059"},"user_tz":-120},"id":"b9PS0PkM_1EF","outputId":"25fba54f-46d9-4c53-b0c1-15e8a878cad0"},"outputs":[{"data":{"text/plain":["2825"]},"execution_count":12,"metadata":{},"output_type":"execute_result"}],"source":["len(preprocessed_docs)"]},{"cell_type":"code","execution_count":81,"id":"191144b4","metadata":{"colab":{"base_uri":"https://localhost:8080/","height":49,"referenced_widgets":["425730d860514e2d87c0870cbb943842","06c58f8fc29343fa96e36d5b1f8dd078","046fa73af99645cc88b49c0f3e5f96b7","e256a26a0f41436a9755c56f3ffebd11","1e2bf8bf2ab14c9e880c06b04f752a1b","1377c76f1051467fb391c2c0119b0634","4d4babe9fcb24dd7996ecbeb7006018f","ff4bc8be1b8041e6a116bc37e366bf96","e004a6c61f2d4e1d8e9d02c51dcc6ebd","88c675dce7bd4247842ffeb6470d31dd","1d447ec86fe84008b29495ecb78a7fac"]},"execution":{"iopub.execute_input":"2022-01-09T08:41:10.695292Z","iopub.status.busy":"2022-01-09T08:41:10.695064Z","iopub.status.idle":"2022-01-09T08:41:22.144864Z","shell.execute_reply":"2022-01-09T08:41:22.144203Z","shell.execute_reply.started":"2022-01-09T08:41:10.695271Z"},"executionInfo":{"elapsed":11491,"status":"ok","timestamp":1652179167100,"user":{"displayName":"Stefano Fiorucci","userId":"12409279692445770059"},"user_tz":-120},"id":"191144b4","outputId":"c30f2216-2c6c-4f28-867c-dfc0bd76bc09"},"outputs":[{"data":{"application/vnd.jupyter.widget-view+json":{"model_id":"425730d860514e2d87c0870cbb943842","version_major":2,"version_minor":0},"text/plain":["Writing Documents:   0%|          | 0/2825 [00:00<?, ?it/s]"]},"metadata":{},"output_type":"display_data"}],"source":["# write documents\n","document_store.write_documents(preprocessed_docs)\n"]},{"cell_type":"markdown","id":"O7Eo9F7yf1N_","metadata":{"id":"O7Eo9F7yf1N_"},"source":["## Define retriever (Embedding Retriever) and generate document embeddings\n"]},{"cell_type":"code","execution_count":82,"id":"7993e609","metadata":{"colab":{"base_uri":"https://localhost:8080/","height":188,"referenced_widgets":["ab5054496cae4e56b8f884db8cfa1cf7","61f277dcf14c4cc692c1cf6dd7c5a846","c7a72de53d104ff2b470ffe9a24b5a05","0f2a6092eb35478693982c6ba694eedf","abe2fe0c05634127bc61ddae4ecbefe9","617fefdfbf594f9d84b64528d58e391e","364f355213fd49e89373c5cc2bbbd646","99cd62ad76d740d197ca16db71359c9f","161afc4e516a4436a7edd60c8fe12dbf","d03003493ce243d38512f5a3990a80f7","ae739e7eca68419ca55f741ee17e325c","bb09ce6273944cd9be20a5d4730acfe5","ddd00b44cb994eaca361ee9d182854f5","8fc242cfcf074a0dbdd852a2d65d3c43","8f74df40a42443e1beda8e8f25d33c4d","902784ed90204018afb1050e58ab5785","e5586e38136f4bedb7f2c12e7d7993ee","02e6b8d39ac1478e8b831690d542937b","f8cd3a71bd724590bb22f01100931b30","04989dd1884b48c795cf59aa33686866","2e4df25efaa64b95acb29e7bce65e4c0","520ae85fb0804dafa7c6a56a81b80769"]},"execution":{"iopub.execute_input":"2022-01-09T08:41:22.146473Z","iopub.status.busy":"2022-01-09T08:41:22.146213Z","iopub.status.idle":"2022-01-09T08:41:30.833036Z","shell.execute_reply":"2022-01-09T08:41:30.832333Z","shell.execute_reply.started":"2022-01-09T08:41:22.146441Z"},"executionInfo":{"elapsed":95127,"status":"ok","timestamp":1652179262209,"user":{"displayName":"Stefano Fiorucci","userId":"12409279692445770059"},"user_tz":-120},"id":"7993e609","outputId":"f31a14d8-281c-46b0-f882-22f7eb98d338"},"outputs":[{"name":"stderr","output_type":"stream","text":["INFO - haystack.modeling.utils -  Using devices: CUDA:0\n","INFO - haystack.modeling.utils -  Number of GPUs: 1\n","INFO - haystack.nodes.retriever.dense -  Init retriever using embeddings of model sentence-transformers/multi-qa-mpnet-base-dot-v1\n","WARNING - haystack.nodes.retriever._embedding_encoder -  You are using a Sentence Transformer with the dot_product function. We recommend using cosine instead. This can be set when initializing the DocumentStore\n","INFO - haystack.document_stores.faiss -  Updating embeddings for 2811 docs...\n"]},{"data":{"application/vnd.jupyter.widget-view+json":{"model_id":"ab5054496cae4e56b8f884db8cfa1cf7","version_major":2,"version_minor":0},"text/plain":["Updating Embedding:   0%|          | 0/2811 [00:00<?, ? docs/s]"]},"metadata":{},"output_type":"display_data"},{"data":{"application/vnd.jupyter.widget-view+json":{"model_id":"bb09ce6273944cd9be20a5d4730acfe5","version_major":2,"version_minor":0},"text/plain":["Batches:   0%|          | 0/88 [00:00<?, ?it/s]"]},"metadata":{},"output_type":"display_data"}],"source":["from haystack.nodes import EmbeddingRetriever\n","\n","retriever = EmbeddingRetriever(\n","    document_store=document_store,\n","   embedding_model=\"sentence-transformers/multi-qa-mpnet-base-dot-v1\",\n","   model_format=\"sentence_transformers\"\n",")\n","document_store.update_embeddings(retriever)"]},{"cell_type":"markdown","id":"9QhguDpYf_5u","metadata":{"id":"9QhguDpYf_5u"},"source":["## Save and export index\n"]},{"cell_type":"code","execution_count":102,"id":"jLKDYZ1tnNZo","metadata":{"executionInfo":{"elapsed":195,"status":"ok","timestamp":1652180221595,"user":{"displayName":"Stefano Fiorucci","userId":"12409279692445770059"},"user_tz":-120},"id":"jLKDYZ1tnNZo"},"outputs":[],"source":["import shutil\n","import glob"]},{"cell_type":"code","execution_count":100,"id":"7DVPCyzAhPEA","metadata":{"executionInfo":{"elapsed":174,"status":"ok","timestamp":1652180142621,"user":{"displayName":"Stefano Fiorucci","userId":"12409279692445770059"},"user_tz":-120},"id":"7DVPCyzAhPEA"},"outputs":[],"source":["document_store.save(\"my_faiss_index.faiss\")"]},{"cell_type":"code","execution_count":null,"id":"8fYMVd_ggJnw","metadata":{"id":"8fYMVd_ggJnw"},"outputs":[],"source":["OUT_DIR = '/content/drive/MyDrive/Colab Notebooks/wklp/'"]},{"cell_type":"code","execution_count":105,"id":"F1GnHXZ4nPJI","metadata":{"colab":{"base_uri":"https://localhost:8080/"},"executionInfo":{"elapsed":508,"status":"ok","timestamp":1652180314288,"user":{"displayName":"Stefano Fiorucci","userId":"12409279692445770059"},"user_tz":-120},"id":"F1GnHXZ4nPJI","outputId":"31b385af-af6b-4ad2-dc1a-c48dd6956990"},"outputs":[{"name":"stdout","output_type":"stream","text":["my_faiss_index.faiss\n","my_faiss_index.json\n","faiss_document_store.db\n","faiss_document_store.db\n"]}],"source":["for f in glob.glob('*faiss*.*')+glob.glob('faiss*.*'):\n","  print(f)\n","  shutil.copy(f, OUT_DIR)"]},{"cell_type":"markdown","id":"9x7Bo95fgTkm","metadata":{"id":"9x7Bo95fgTkm"},"source":["## Define reader"]},{"cell_type":"code","execution_count":52,"id":"9oJ3b3ukcT10","metadata":{"executionInfo":{"elapsed":204,"status":"ok","timestamp":1652177889794,"user":{"displayName":"Stefano Fiorucci","userId":"12409279692445770059"},"user_tz":-120},"id":"9oJ3b3ukcT10"},"outputs":[],"source":["from haystack.nodes import FARMReader\n"]},{"cell_type":"code","execution_count":88,"id":"f5299f38","metadata":{"colab":{"base_uri":"https://localhost:8080/"},"execution":{"iopub.execute_input":"2022-01-09T08:42:49.473881Z","iopub.status.busy":"2022-01-09T08:42:49.473628Z","iopub.status.idle":"2022-01-09T08:42:58.250644Z","shell.execute_reply":"2022-01-09T08:42:58.249808Z","shell.execute_reply.started":"2022-01-09T08:42:49.473851Z"},"executionInfo":{"elapsed":9316,"status":"ok","timestamp":1652179820100,"user":{"displayName":"Stefano Fiorucci","userId":"12409279692445770059"},"user_tz":-120},"id":"f5299f38","outputId":"0209e180-0307-4f7f-cfad-27866307cf4a"},"outputs":[{"name":"stderr","output_type":"stream","text":["INFO - haystack.modeling.utils -  Using devices: CUDA:0\n","INFO - haystack.modeling.utils -  Number of GPUs: 1\n","INFO - haystack.modeling.model.language_model -  LOADING MODEL\n","INFO - haystack.modeling.model.language_model -  =============\n","INFO - haystack.modeling.model.language_model -  Could not find deepset/roberta-base-squad2-distilled locally.\n","INFO - haystack.modeling.model.language_model -  Looking on Transformers Model Hub (in local cache and online)...\n","INFO - haystack.modeling.model.language_model -  Loaded deepset/roberta-base-squad2-distilled\n","INFO - haystack.modeling.utils -  Using devices: CUDA\n","INFO - haystack.modeling.utils -  Number of GPUs: 1\n","INFO - haystack.modeling.infer -  Got ya 2 parallel workers to do inference ...\n","INFO - haystack.modeling.infer -   0     0  \n","INFO - haystack.modeling.infer -  /w\\   /w\\ \n","INFO - haystack.modeling.infer -  /'\\   / \\ \n"]}],"source":["reader = FARMReader(model_name_or_path=\"deepset/roberta-base-squad2-distilled\", use_gpu=True)"]},{"cell_type":"markdown","id":"tRgVAepagXo1","metadata":{"id":"tRgVAepagXo1"},"source":["## Define and try pipeline (retriever + reader)"]},{"cell_type":"code","execution_count":89,"id":"a2226345","metadata":{"execution":{"iopub.execute_input":"2022-01-09T08:42:58.252390Z","iopub.status.busy":"2022-01-09T08:42:58.252188Z","iopub.status.idle":"2022-01-09T08:42:58.256054Z","shell.execute_reply":"2022-01-09T08:42:58.255544Z","shell.execute_reply.started":"2022-01-09T08:42:58.252363Z"},"executionInfo":{"elapsed":9,"status":"ok","timestamp":1652179820101,"user":{"displayName":"Stefano Fiorucci","userId":"12409279692445770059"},"user_tz":-120},"id":"a2226345"},"outputs":[],"source":["from haystack.pipelines import ExtractiveQAPipeline\n"]},{"cell_type":"code","execution_count":90,"id":"0fc15887","metadata":{"execution":{"iopub.execute_input":"2022-01-09T08:42:58.257027Z","iopub.status.busy":"2022-01-09T08:42:58.256867Z","iopub.status.idle":"2022-01-09T08:42:58.261446Z","shell.execute_reply":"2022-01-09T08:42:58.260756Z","shell.execute_reply.started":"2022-01-09T08:42:58.257009Z"},"executionInfo":{"elapsed":8,"status":"ok","timestamp":1652179820102,"user":{"displayName":"Stefano Fiorucci","userId":"12409279692445770059"},"user_tz":-120},"id":"0fc15887"},"outputs":[],"source":["pipe = ExtractiveQAPipeline(reader, retriever)\n"]},{"cell_type":"code","execution_count":91,"id":"24fd8084","metadata":{"execution":{"iopub.execute_input":"2022-01-09T08:42:58.262798Z","iopub.status.busy":"2022-01-09T08:42:58.262569Z","iopub.status.idle":"2022-01-09T08:42:58.267587Z","shell.execute_reply":"2022-01-09T08:42:58.267054Z","shell.execute_reply.started":"2022-01-09T08:42:58.262772Z"},"executionInfo":{"elapsed":349,"status":"ok","timestamp":1652179820444,"user":{"displayName":"Stefano Fiorucci","userId":"12409279692445770059"},"user_tz":-120},"id":"24fd8084"},"outputs":[],"source":["import time\n","from haystack.utils import print_answers"]},{"cell_type":"code","execution_count":99,"id":"e8bae423","metadata":{"colab":{"base_uri":"https://localhost:8080/","height":920,"referenced_widgets":["1158604d42434203bc096856ed22bab8","c21f9accc8854d5fa3b60e4cd4891923","e13a9fe3eba54b7e8b5efe219f515f46","d0921da424dd4f68bcf85099820d17ba","d64dc173913146f0a6a413b158177ba5","f620a1ca0d47465ba079ecc3518b7abe","a44f766857084ecc95f9ea1ab879085e","f3e510c515b2456a8025c4b2e71f0463","4904f0e333824ff39f40807d415b9af0","898ea2f834cb444f920eeae85f941ebf","82055fffe4bc447492b9ab67d0d04ad2"]},"execution":{"iopub.execute_input":"2022-01-09T08:56:33.759683Z","iopub.status.busy":"2022-01-09T08:56:33.759457Z","iopub.status.idle":"2022-01-09T08:56:34.894724Z","shell.execute_reply":"2022-01-09T08:56:34.894183Z","shell.execute_reply.started":"2022-01-09T08:56:33.759662Z"},"executionInfo":{"elapsed":2574,"status":"ok","timestamp":1652180092923,"user":{"displayName":"Stefano Fiorucci","userId":"12409279692445770059"},"user_tz":-120},"id":"e8bae423","outputId":"82f874ca-77df-4933-c9f1-ce55a8065ece"},"outputs":[{"data":{"application/vnd.jupyter.widget-view+json":{"model_id":"1158604d42434203bc096856ed22bab8","version_major":2,"version_minor":0},"text/plain":["Batches:   0%|          | 0/1 [00:00<?, ?it/s]"]},"metadata":{},"output_type":"display_data"},{"name":"stderr","output_type":"stream","text":["Inferencing Samples:   0%|          | 0/1 [00:00<?, ? Batches/s]/usr/local/lib/python3.7/dist-packages/haystack/modeling/model/prediction_head.py:483: UserWarning: __floordiv__ is deprecated, and its behavior will change in a future version of pytorch. It currently rounds toward 0 (like the 'trunc' function NOT 'floor'). This results in incorrect rounding for negative values. To keep the current behavior, use torch.div(a, b, rounding_mode='trunc'), or for actual floor division, use torch.div(a, b, rounding_mode='floor').\n","  start_indices = flat_sorted_indices // max_seq_len\n","Inferencing Samples: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 1/1 [00:00<00:00,  5.75 Batches/s]\n","Inferencing Samples: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 1/1 [00:00<00:00,  5.42 Batches/s]\n","Inferencing Samples: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 1/1 [00:00<00:00,  7.92 Batches/s]\n","Inferencing Samples: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 1/1 [00:00<00:00, 12.85 Batches/s]\n","Inferencing Samples: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 1/1 [00:00<00:00, 13.09 Batches/s]\n","Inferencing Samples: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 1/1 [00:00<00:00,  6.00 Batches/s]\n","Inferencing Samples: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 1/1 [00:00<00:00, 12.42 Batches/s]\n","Inferencing Samples: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 1/1 [00:00<00:00, 19.19 Batches/s]\n","Inferencing Samples: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 1/1 [00:00<00:00, 20.71 Batches/s]\n","Inferencing Samples: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 1/1 [00:00<00:00, 13.32 Batches/s]"]},{"name":"stdout","output_type":"stream","text":["\n","2.474968910217285\n","\n","Query: Where is Twin Peaks\n","Answers:\n","[   {   'answer': 'Washington',\n","        'context': 'Highway J\\n'\n","                   'Highway J was a highway that ran through Twin Peaks, '\n","                   'Washington. Notable buildings\\n'\n","                   \"Gentleman Jim's\\n\"\n","                   \"Horne's Department Store\\n\"\n","                   'Pine View Motel ',\n","        'score': 0.9937074482440948},\n","    {   'answer': 'Washington',\n","        'context': 'Chapel-in-the-Woods\\n'\n","                   'Chapel-in-the-Woods was a chapel in Twin Peaks, '\n","                   'Washington. Hank Jennings and Norma Jennings as well as Ed '\n","                   'Hurley and Nadine Hurle',\n","        'score': 0.9566615521907806},\n","    {   'answer': 'northeastern Washington State',\n","        'context': 'eriff Harry S. Truman\\n'\n","                   'Twin Peaks was a small logging town in northeastern '\n","                   'Washington State, five miles south of the Canadian border '\n","                   'and twelve miles w',\n","        'score': 0.9068273603916168},\n","    {   'answer': 'along the shores of Black Lake',\n","        'context': 'od National Forest. By 1888, the town of Twin Peaks '\n","                   'existed along the shores of Black Lake and was settled by '\n","                   'refugees, trappers, and thieves. The chi',\n","        'score': 0.4931739866733551},\n","    {   'answer': 'Twin Peaks, Washington',\n","        'context': 'ation Guide\\n'\n","                   'For descriptions of locations seen in the show, see Twin '\n","                   'Peaks, Washington\\n'\n","                   '\"Location Guide\" is a featurette originally released in '\n","                   'the 200',\n","        'score': 0.49235279858112335}]\n"]},{"name":"stderr","output_type":"stream","text":["\n"]}],"source":["start_time=time.time()\n","\n","prediction = pipe.run(\n","    query=\"Where is Twin Peaks\", params={\"Retriever\": {\"top_k\": 10}, \"Reader\": {\"top_k\": 5}}\n",")\n","\n","end_time=time.time()\n","\n","print()\n","print(end_time - start_time)\n","print_answers(prediction, details=\"medium\")\n"]},{"cell_type":"code","execution_count":71,"id":"be150456","metadata":{"colab":{"base_uri":"https://localhost:8080/"},"execution":{"iopub.execute_input":"2022-01-09T08:56:36.820622Z","iopub.status.busy":"2022-01-09T08:56:36.820402Z","iopub.status.idle":"2022-01-09T08:56:36.830219Z","shell.execute_reply":"2022-01-09T08:56:36.826251Z","shell.execute_reply.started":"2022-01-09T08:56:36.820601Z"},"executionInfo":{"elapsed":22,"status":"ok","timestamp":1652178864337,"user":{"displayName":"Stefano Fiorucci","userId":"12409279692445770059"},"user_tz":-120},"id":"be150456","outputId":"89216adc-4242-49cc-e3d8-efd52aa6d608"},"outputs":[{"name":"stdout","output_type":"stream","text":["\n","Query: Who killed Laura Palmer?\n","Answers:\n","[   {   'answer': 'Leland',\n","        'context': '\" he remembered the name Laura had whispered into his ear '\n","                   'in his dream.\\n'\n","                   ' Leland was taken back to the station and while under '\n","                   'control of BOB, he confe',\n","        'score': 0.8553578555583954},\n","    {   'answer': 'Benjamin Horne',\n","        'context': 'urdering Maddy just before she intended to go home.\\n'\n","                   ' Two days later, Benjamin Horne had been arrested by the '\n","                   \"sheriff's department, with Sheriff Truman\",\n","        'score': 0.7564241290092468},\n","    {   'answer': 'Sarah',\n","        'context': \"Laura's murder\\n\"\n","                   ' Sarah stood in her kitchen the next morning, February 24, '\n","                   '1989.\\n'\n","                   ' She impatiently called for her daughter to wake up, but '\n","                   'received no a',\n","        'score': 0.2567792162299156},\n","    {   'answer': 'Sarah',\n","        'context': 'here Dale Cooper said she had once lived, Carrie Page '\n","                   'heard the sounds of Sarah calling Laura downstairs the '\n","                   'morning her body was discovered, and bega',\n","        'score': 0.10802637040615082},\n","    {   'answer': '\"Sheriff Truman',\n","        'context': 'ura would have left a note if she was with Bobby.\\n'\n","                   ' Leland then said, \"Sheriff Truman,\" leading her to worry '\n","                   'even more.\\n'\n","                   \" Sarah's suspicion was confirme\",\n","        'score': 0.016497892793267965}]\n"]}],"source":["print_answers(prediction, details=\"medium\")\n"]}],"metadata":{"accelerator":"GPU","colab":{"collapsed_sections":["viixGIJcKPSQ"],"name":"wklp_embeddingretriever.ipynb","provenance":[],"toc_visible":true},"kernelspec":{"display_name":"saturn (Python 3)","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.9.5"},"widgets":{"application/vnd.jupyter.widget-state+json":{"02e6b8d39ac1478e8b831690d542937b":{"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":""}},"046fa73af99645cc88b49c0f3e5f96b7":{"model_module":"@jupyter-widgets/controls","model_module_version":"1.5.0","model_name":"FloatProgressModel","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"FloatProgressModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"ProgressView","bar_style":"success","description":"","description_tooltip":null,"layout":"IPY_MODEL_ff4bc8be1b8041e6a116bc37e366bf96","max":2825,"min":0,"orientation":"horizontal","style":"IPY_MODEL_e004a6c61f2d4e1d8e9d02c51dcc6ebd","value":2825}},"04989dd1884b48c795cf59aa33686866":{"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":""}},"06c58f8fc29343fa96e36d5b1f8dd078":{"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_1377c76f1051467fb391c2c0119b0634","placeholder":"​","style":"IPY_MODEL_4d4babe9fcb24dd7996ecbeb7006018f","value":"Writing Documents: "}},"0f2a6092eb35478693982c6ba694eedf":{"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_d03003493ce243d38512f5a3990a80f7","placeholder":"​","style":"IPY_MODEL_ae739e7eca68419ca55f741ee17e325c","value":" 10000/? [01:29&lt;00:00, 111.81 docs/s]"}},"1158604d42434203bc096856ed22bab8":{"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_c21f9accc8854d5fa3b60e4cd4891923","IPY_MODEL_e13a9fe3eba54b7e8b5efe219f515f46","IPY_MODEL_d0921da424dd4f68bcf85099820d17ba"],"layout":"IPY_MODEL_d64dc173913146f0a6a413b158177ba5"}},"1377c76f1051467fb391c2c0119b0634":{"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}},"161afc4e516a4436a7edd60c8fe12dbf":{"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":""}},"1d447ec86fe84008b29495ecb78a7fac":{"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":""}},"1e2bf8bf2ab14c9e880c06b04f752a1b":{"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}},"2e4df25efaa64b95acb29e7bce65e4c0":{"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}},"364f355213fd49e89373c5cc2bbbd646":{"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":""}},"425730d860514e2d87c0870cbb943842":{"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_06c58f8fc29343fa96e36d5b1f8dd078","IPY_MODEL_046fa73af99645cc88b49c0f3e5f96b7","IPY_MODEL_e256a26a0f41436a9755c56f3ffebd11"],"layout":"IPY_MODEL_1e2bf8bf2ab14c9e880c06b04f752a1b"}},"4904f0e333824ff39f40807d415b9af0":{"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":""}},"4d4babe9fcb24dd7996ecbeb7006018f":{"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":""}},"520ae85fb0804dafa7c6a56a81b80769":{"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":""}},"617fefdfbf594f9d84b64528d58e391e":{"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}},"61f277dcf14c4cc692c1cf6dd7c5a846":{"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_617fefdfbf594f9d84b64528d58e391e","placeholder":"​","style":"IPY_MODEL_364f355213fd49e89373c5cc2bbbd646","value":"Documents Processed: "}},"82055fffe4bc447492b9ab67d0d04ad2":{"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":""}},"88c675dce7bd4247842ffeb6470d31dd":{"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}},"898ea2f834cb444f920eeae85f941ebf":{"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}},"8f74df40a42443e1beda8e8f25d33c4d":{"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_2e4df25efaa64b95acb29e7bce65e4c0","placeholder":"​","style":"IPY_MODEL_520ae85fb0804dafa7c6a56a81b80769","value":" 88/88 [01:28&lt;00:00,  5.40it/s]"}},"8fc242cfcf074a0dbdd852a2d65d3c43":{"model_module":"@jupyter-widgets/controls","model_module_version":"1.5.0","model_name":"FloatProgressModel","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"FloatProgressModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"ProgressView","bar_style":"success","description":"","description_tooltip":null,"layout":"IPY_MODEL_f8cd3a71bd724590bb22f01100931b30","max":88,"min":0,"orientation":"horizontal","style":"IPY_MODEL_04989dd1884b48c795cf59aa33686866","value":88}},"902784ed90204018afb1050e58ab5785":{"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}},"99cd62ad76d740d197ca16db71359c9f":{"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}},"a44f766857084ecc95f9ea1ab879085e":{"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":""}},"ab5054496cae4e56b8f884db8cfa1cf7":{"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_61f277dcf14c4cc692c1cf6dd7c5a846","IPY_MODEL_c7a72de53d104ff2b470ffe9a24b5a05","IPY_MODEL_0f2a6092eb35478693982c6ba694eedf"],"layout":"IPY_MODEL_abe2fe0c05634127bc61ddae4ecbefe9"}},"abe2fe0c05634127bc61ddae4ecbefe9":{"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}},"ae739e7eca68419ca55f741ee17e325c":{"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":""}},"bb09ce6273944cd9be20a5d4730acfe5":{"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_ddd00b44cb994eaca361ee9d182854f5","IPY_MODEL_8fc242cfcf074a0dbdd852a2d65d3c43","IPY_MODEL_8f74df40a42443e1beda8e8f25d33c4d"],"layout":"IPY_MODEL_902784ed90204018afb1050e58ab5785"}},"c21f9accc8854d5fa3b60e4cd4891923":{"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_f620a1ca0d47465ba079ecc3518b7abe","placeholder":"​","style":"IPY_MODEL_a44f766857084ecc95f9ea1ab879085e","value":"Batches: 100%"}},"c7a72de53d104ff2b470ffe9a24b5a05":{"model_module":"@jupyter-widgets/controls","model_module_version":"1.5.0","model_name":"FloatProgressModel","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"FloatProgressModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"ProgressView","bar_style":"success","description":"","description_tooltip":null,"layout":"IPY_MODEL_99cd62ad76d740d197ca16db71359c9f","max":2811,"min":0,"orientation":"horizontal","style":"IPY_MODEL_161afc4e516a4436a7edd60c8fe12dbf","value":2811}},"d03003493ce243d38512f5a3990a80f7":{"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}},"d0921da424dd4f68bcf85099820d17ba":{"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_898ea2f834cb444f920eeae85f941ebf","placeholder":"​","style":"IPY_MODEL_82055fffe4bc447492b9ab67d0d04ad2","value":" 1/1 [00:00&lt;00:00,  9.08it/s]"}},"d64dc173913146f0a6a413b158177ba5":{"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}},"ddd00b44cb994eaca361ee9d182854f5":{"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_e5586e38136f4bedb7f2c12e7d7993ee","placeholder":"​","style":"IPY_MODEL_02e6b8d39ac1478e8b831690d542937b","value":"Batches: 100%"}},"e004a6c61f2d4e1d8e9d02c51dcc6ebd":{"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":""}},"e13a9fe3eba54b7e8b5efe219f515f46":{"model_module":"@jupyter-widgets/controls","model_module_version":"1.5.0","model_name":"FloatProgressModel","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"FloatProgressModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"ProgressView","bar_style":"success","description":"","description_tooltip":null,"layout":"IPY_MODEL_f3e510c515b2456a8025c4b2e71f0463","max":1,"min":0,"orientation":"horizontal","style":"IPY_MODEL_4904f0e333824ff39f40807d415b9af0","value":1}},"e256a26a0f41436a9755c56f3ffebd11":{"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_88c675dce7bd4247842ffeb6470d31dd","placeholder":"​","style":"IPY_MODEL_1d447ec86fe84008b29495ecb78a7fac","value":" 10000/? [00:11&lt;00:00, 898.29it/s]"}},"e5586e38136f4bedb7f2c12e7d7993ee":{"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}},"f3e510c515b2456a8025c4b2e71f0463":{"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}},"f620a1ca0d47465ba079ecc3518b7abe":{"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}},"f8cd3a71bd724590bb22f01100931b30":{"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}},"ff4bc8be1b8041e6a116bc37e366bf96":{"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":5}