diff --git "a/Rubert_tiny.ipynb" "b/Rubert_tiny.ipynb" new file mode 100644--- /dev/null +++ "b/Rubert_tiny.ipynb" @@ -0,0 +1,5751 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "source": [ + "Данная задача типа \"Question-Answering\". Для дообучения (fine-tuning) была взята модель BERT, обученная на русских текстах - rubert-tiny2(автор Давид Дале @cointegrated)\n", + "\n", + "Обучение производилось на платформе Google Colab с использованием Hugging face API. " + ], + "metadata": { + "id": "WLCc4S5dV3Yn" + } + }, + { + "cell_type": "markdown", + "source": [ + "Загрузка и обработка данных" + ], + "metadata": { + "id": "YR1gaSC4Y36P" + } + }, + { + "cell_type": "code", + "source": [ + "import json\n", + "with open('train.json', 'r') as f:\n", + " data = json.load(f)" + ], + "metadata": { + "id": "8UxyerW6jCsB" + }, + "execution_count": 1, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "def answer_positions(dataset):\n", + " new_dataset = dataset\n", + " for i in range(len(dataset)):\n", + " new_dataset[i]['extracted_part']['text'] = dataset[i]['extracted_part']['text'][0]\n", + " new_dataset[i]['extracted_part']['answer_start'] = dataset[i]['extracted_part']['answer_start'][0]\n", + " new_dataset[i]['extracted_part']['answer_end'] = dataset[i]['extracted_part']['answer_end'][0]\n", + " return new_dataset" + ], + "metadata": { + "id": "bgX3gRohjGBR" + }, + "execution_count": 2, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "def prep_data(dataset):\n", + " ids = []\n", + " questions = []\n", + " contexts = []\n", + " answers = []\n", + " new_dataset = answer_positions(dataset)\n", + " for i in range(len(dataset)):\n", + " ids.append(dataset[i]['id'])\n", + " questions.append(dataset[i]['label'])\n", + " contexts.append(dataset[i]['text'])\n", + " answers.append(new_dataset[i]['extracted_part'])\n", + " return {\n", + " 'id': ids,\n", + " 'question': questions,\n", + " 'context': contexts,\n", + " 'answers': answers\n", + " }" + ], + "metadata": { + "id": "_5BaOWJdjF71" + }, + "execution_count": 3, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "dataset = prep_data(data)" + ], + "metadata": { + "id": "bwV7HYQ-jF5m" + }, + "execution_count": 4, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "import pandas as pd" + ], + "metadata": { + "id": "LVzYo8vHj9n7" + }, + "execution_count": 5, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "cols = ['id', 'context','question','answers']\n", + "\n", + "data_df = pd.DataFrame(dataset, columns=cols) " + ], + "metadata": { + "id": "tuOj1xWpj8GB" + }, + "execution_count": 6, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "data_df['question'].unique()" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "1L7Qo4cJVWi9", + "outputId": "cb2778bb-164b-464e-8c2b-60c2505fdb43" + }, + "execution_count": 8, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + "array(['обеспечение исполнения контракта',\n", + " 'обеспечение гарантийных обязательств'], dtype=object)" + ] + }, + "metadata": {}, + "execution_count": 8 + } + ] + }, + { + "cell_type": "code", + "source": [ + "len(data_df[data_df['question']=='обеспечение исполнения контракта'])" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "aaAgfOadVWTr", + "outputId": "63773f38-78d6-438a-8273-62f973f55dbc" + }, + "execution_count": 9, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + "988" + ] + }, + "metadata": {}, + "execution_count": 9 + } + ] + }, + { + "cell_type": "code", + "source": [ + "len(data_df[data_df['question']=='обеспечение гарантийных обязательств'])" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "MxUrKPknV_Zo", + "outputId": "15ebe135-bce6-4fa1-d898-aa376ff32105" + }, + "execution_count": 10, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + "811" + ] + }, + "metadata": {}, + "execution_count": 10 + } + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "id": "O3iJ7fWXOfTd" + }, + "outputs": [], + "source": [ + "val_data = data_df[:360].reset_index(drop=True)\n", + "train_data = data_df[360:].reset_index(drop=True)" + ] + }, + { + "cell_type": "code", + "source": [ + "len(train_data[train_data['question']=='обеспечение исполнения контракта'])" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "E0i9VbNDWOlL", + "outputId": "570f47bc-9be5-4d34-8f4f-f63ee5d2d412" + }, + "execution_count": 13, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + "634" + ] + }, + "metadata": {}, + "execution_count": 13 + } + ] + }, + { + "cell_type": "code", + "source": [ + "len(train_data[train_data['question']=='обеспечение гарантийных обязательств'])" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "W7mgpJLuWGt0", + "outputId": "03669209-75b5-4a69-874b-6227794f77c2" + }, + "execution_count": 12, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + "805" + ] + }, + "metadata": {}, + "execution_count": 12 + } + ] + }, + { + "cell_type": "markdown", + "source": [ + "Токенизация данных" + ], + "metadata": { + "id": "SjUJRCfaY_-1" + } + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "APxoezdR0HAG", + "outputId": "8345657c-1704-44ea-e3df-128bea1f5e4f" + }, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/\n", + "Collecting transformers\n", + " Downloading transformers-4.28.1-py3-none-any.whl (7.0 MB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m7.0/7.0 MB\u001b[0m \u001b[31m88.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hRequirement already satisfied: filelock in /usr/local/lib/python3.9/dist-packages (from transformers) (3.11.0)\n", + "Collecting huggingface-hub<1.0,>=0.11.0\n", + " Downloading huggingface_hub-0.13.4-py3-none-any.whl (200 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m200.1/200.1 kB\u001b[0m \u001b[31m25.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hRequirement already satisfied: regex!=2019.12.17 in /usr/local/lib/python3.9/dist-packages (from transformers) (2022.10.31)\n", + "Requirement already satisfied: pyyaml>=5.1 in /usr/local/lib/python3.9/dist-packages (from transformers) (6.0)\n", + "Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.9/dist-packages (from transformers) (23.1)\n", + "Requirement already satisfied: requests in /usr/local/lib/python3.9/dist-packages (from transformers) (2.27.1)\n", + "Requirement already satisfied: tqdm>=4.27 in /usr/local/lib/python3.9/dist-packages (from transformers) (4.65.0)\n", + "Collecting tokenizers!=0.11.3,<0.14,>=0.11.1\n", + " Downloading tokenizers-0.13.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (7.8 MB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m7.8/7.8 MB\u001b[0m \u001b[31m108.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hRequirement already satisfied: numpy>=1.17 in /usr/local/lib/python3.9/dist-packages (from transformers) (1.22.4)\n", + "Requirement already satisfied: typing-extensions>=3.7.4.3 in /usr/local/lib/python3.9/dist-packages (from huggingface-hub<1.0,>=0.11.0->transformers) (4.5.0)\n", + "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.9/dist-packages (from requests->transformers) (2022.12.7)\n", + "Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.9/dist-packages (from requests->transformers) (3.4)\n", + "Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/local/lib/python3.9/dist-packages (from requests->transformers) (1.26.15)\n", + "Requirement already satisfied: charset-normalizer~=2.0.0 in /usr/local/lib/python3.9/dist-packages (from requests->transformers) (2.0.12)\n", + "Installing collected packages: tokenizers, huggingface-hub, transformers\n", + "Successfully installed huggingface-hub-0.13.4 tokenizers-0.13.3 transformers-4.28.1\n" + ] + } + ], + "source": [ + "!pip install transformers" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "id": "TfUAdt-50FsM", + "colab": { + "base_uri": "https://localhost:8080/", + "height": 145, + "referenced_widgets": [ + "4a600f04043f42a8aa1632bd85bec064", + "f019b718ded749f09398d712e22c4adb", + "208b4a458545455491d9c47982a15280", + "8a8b7ce52ca944e09c96ccce8ce1edfe", + "76c67484b8c0450da788c0003bb735fe", + "864dd3297f4d4e15969f0f7a5ba9c266", + "1dd6b51fade640a4a365d3692dfc588a", + "95e6657278a0414b81c766d134912779", + "d2e25dd85abf46e4b8f80a4859ee6448", + "cf3c88d943ca4d4f9afe13d5069de462", + "5cdee514797b43fba35ccbe90f0d26ab", + "e914ee56357b4eeb9a3badf0a001c8bd", + "b758f0bd879d4a9691bbb11d95321960", + "2fd13ce223b64835bb8d8cb93ff9edaf", + "753f08112f864f248343afd2a927376a", + "301f0d5ee1fd4cf18bb771fed9aeb84e", + "e391d31d701f4a7ea2e59d91e0eef608", + "42a8cae67ac14bc5aa4ff663a9583ce7", + "91806d22295f44259a317d61ffbb9fdf", + "5bc7611b73ef4132abfba59c26da44a3", + "25c6d721c1fa4e1ab6ee5639c1c000ce", + "0cb2b7d977e34dbba04538124c5f5736", + "73c8edc9b5fe496ea4080d1fa433a708", + "9f4cad1a329c4e1e8c31edd4a9bd12e3", + "6df741ad8a364a179ad9a3523a82fa88", + "414106077e5e4c968ca9d48b767955ec", + "9d758d58b1fb4178a0fec8b759371317", + "aa7666d14bd5478db1ea7ee07401cecb", + "3eea6e336662469a84671979f4bee94e", + "d5c0875d6db5494db2502702e3dde5b8", + "2005e59ccc7e4aeba4e4861ea7f5cf30", + "eec286fb7a0245049098ab79690910fa", + "66f2aead108d4af2b1fe5f87df4d46b8", + "99c8f4049dad479b89ce83f14e8c9ac6", + "6a42cfebe1c74c2d91f3d4454c3d4952", + "bb6a6fb9b54647259c562dfe029c6519", + "63f2413b431d41ee8e837d1ee7938621", + "3baf26183f524f2b9645bc3cc5d0432b", + "b76fc9d7d6f4453ca939a7eecb5bb19d", + "19490f91bf7a4dd8b699ddb30bcb313b", + "6fc07d49719f40a9ad98daa8fcf2d7ad", + "7ef4c3111428461ba11162793f3a9428", + "76e08ae1548b445e968e18e3bb51213c", + "eec454a6cd83429aa44f28aa262dd3fc" + ] + }, + "outputId": "ecb6dd62-7e37-4ad1-d419-64a1d5085b92" + }, + "outputs": [ + { + "output_type": "display_data", + "data": { + "text/plain": [ + "Downloading (…)okenizer_config.json: 0%| | 0.00/401 [00:00 start_char or offset[context_end][1] < end_char:\n", + " start_positions.append(0)\n", + " end_positions.append(0)\n", + " else:\n", + " # Если ответ в контексте, то начало и конец это токены\n", + " idx = context_start\n", + " while idx <= context_end and offset[idx][0] <= start_char:\n", + " idx += 1\n", + " start_positions.append(idx - 1)\n", + "\n", + " idx = context_end\n", + " while idx >= context_start and offset[idx][1] >= end_char:\n", + " idx -= 1\n", + " end_positions.append(idx + 1)\n", + "\n", + " inputs[\"start_positions\"] = start_positions\n", + " inputs[\"end_positions\"] = end_positions\n", + "\n", + " return inputs" + ] + }, + { + "cell_type": "code", + "source": [ + "max_length = 512\n", + "stride = 128\n", + "\n", + "def preprocess_validation_examples(examples):\n", + " inputs = tokenizer(\n", + " examples[\"question\"],\n", + " examples[\"context\"],\n", + " max_length=max_length,\n", + " truncation=\"only_second\", \n", + " stride=stride, \n", + " return_overflowing_tokens=True, \n", + " return_offsets_mapping=True, \n", + " padding=\"max_length\" \n", + " )\n", + "\n", + " offset_mapping = inputs[\"offset_mapping\"]\n", + " sample_map = inputs.pop(\"overflow_to_sample_mapping\")\n", + " answers = examples['answers']\n", + " start_positions = []\n", + " end_positions = []\n", + " example_ids = []\n", + "\n", + " for i, offset in enumerate(offset_mapping):\n", + " sample_idx = sample_map[i]\n", + " answer = answers[sample_idx]\n", + " start_char = answer[\"answer_start\"]\n", + " end_char = answer[\"answer_end\"]\n", + "\n", + " sequence_ids = inputs.sequence_ids(i)\n", + "\n", + " #Поиск начала и конца контекста\n", + " idx = 0\n", + " while sequence_ids[idx] != 1:\n", + " idx += 1\n", + " context_start = idx\n", + " while sequence_ids[idx] == 1:\n", + " idx += 1\n", + " context_end = idx - 1\n", + "\n", + " # Если ответ не в данном контексте, то (0, 0)\n", + " if (start_char == 0 and end_char == 0) or offset[context_start][0] > start_char or offset[context_end][1] < end_char:\n", + " start_positions.append(0)\n", + " end_positions.append(0)\n", + " else:\n", + " # Если ответ в контексте, то начало и конец это токены\n", + " idx = context_start\n", + " while idx <= context_end and offset[idx][0] <= start_char:\n", + " idx += 1\n", + " start_positions.append(idx - 1)\n", + "\n", + " idx = context_end\n", + " while idx >= context_start and offset[idx][1] >= end_char:\n", + " idx -= 1\n", + " end_positions.append(idx + 1)\n", + "\n", + " for i in range(len(inputs[\"input_ids\"])):\n", + " sample_idx = sample_map[i]\n", + " example_ids.append(examples[\"id\"][sample_idx])\n", + "\n", + " sequence_ids = inputs.sequence_ids(i)\n", + " offset = inputs[\"offset_mapping\"][i]\n", + " inputs[\"offset_mapping\"][i] = [\n", + " o if sequence_ids[k] == 1 else None for k, o in enumerate(offset)\n", + " ]\n", + "\n", + " inputs[\"example_id\"] = example_ids\n", + "\n", + " inputs[\"start_positions\"] = start_positions\n", + " inputs[\"end_positions\"] = end_positions\n", + "\n", + " return inputs" + ], + "metadata": { + "id": "odj_nTuip4sm" + }, + "execution_count": 19, + "outputs": [] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "KvHaFS642pOd", + "outputId": "a3fe39f8-5103-429e-97b4-223e535356a8" + }, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/\n", + "Collecting datasets\n", + " Downloading datasets-2.11.0-py3-none-any.whl (468 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m468.7/468.7 kB\u001b[0m \u001b[31m22.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hCollecting evaluate\n", + " Downloading evaluate-0.4.0-py3-none-any.whl (81 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m81.4/81.4 kB\u001b[0m \u001b[31m11.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hRequirement already satisfied: transformers[sentencepiece] in /usr/local/lib/python3.9/dist-packages (4.28.1)\n", + "Requirement already satisfied: tqdm>=4.62.1 in /usr/local/lib/python3.9/dist-packages (from datasets) (4.65.0)\n", + "Collecting dill<0.3.7,>=0.3.0\n", + " Downloading dill-0.3.6-py3-none-any.whl (110 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m110.5/110.5 kB\u001b[0m \u001b[31m15.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hCollecting multiprocess\n", + " Downloading multiprocess-0.70.14-py39-none-any.whl (132 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m132.9/132.9 kB\u001b[0m \u001b[31m18.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hCollecting responses<0.19\n", + " Downloading responses-0.18.0-py3-none-any.whl (38 kB)\n", + "Requirement already satisfied: pandas in /usr/local/lib/python3.9/dist-packages (from datasets) (1.5.3)\n", + "Requirement already satisfied: fsspec[http]>=2021.11.1 in /usr/local/lib/python3.9/dist-packages (from datasets) (2023.4.0)\n", + "Collecting aiohttp\n", + " Downloading aiohttp-3.8.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.0 MB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.0/1.0 MB\u001b[0m \u001b[31m40.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hRequirement already satisfied: packaging in /usr/local/lib/python3.9/dist-packages (from datasets) (23.1)\n", + "Requirement already satisfied: pyyaml>=5.1 in /usr/local/lib/python3.9/dist-packages (from datasets) (6.0)\n", + "Requirement already satisfied: huggingface-hub<1.0.0,>=0.11.0 in /usr/local/lib/python3.9/dist-packages (from datasets) (0.13.4)\n", + "Requirement already satisfied: pyarrow>=8.0.0 in /usr/local/lib/python3.9/dist-packages (from datasets) (9.0.0)\n", + "Collecting xxhash\n", + " Downloading xxhash-3.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (212 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m212.2/212.2 kB\u001b[0m \u001b[31m21.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hRequirement already satisfied: requests>=2.19.0 in /usr/local/lib/python3.9/dist-packages (from datasets) (2.27.1)\n", + "Requirement already satisfied: numpy>=1.17 in /usr/local/lib/python3.9/dist-packages (from datasets) (1.22.4)\n", + "Requirement already satisfied: tokenizers!=0.11.3,<0.14,>=0.11.1 in /usr/local/lib/python3.9/dist-packages (from transformers[sentencepiece]) (0.13.3)\n", + "Requirement already satisfied: filelock in /usr/local/lib/python3.9/dist-packages (from transformers[sentencepiece]) (3.11.0)\n", + "Requirement already satisfied: regex!=2019.12.17 in /usr/local/lib/python3.9/dist-packages (from transformers[sentencepiece]) (2022.10.31)\n", + "Collecting protobuf<=3.20.2\n", + " Downloading protobuf-3.20.2-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl (1.0 MB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.0/1.0 MB\u001b[0m \u001b[31m29.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hCollecting sentencepiece!=0.1.92,>=0.1.91\n", + " Downloading sentencepiece-0.1.98-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.3 MB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.3/1.3 MB\u001b[0m \u001b[31m21.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hCollecting async-timeout<5.0,>=4.0.0a3\n", + " Downloading async_timeout-4.0.2-py3-none-any.whl (5.8 kB)\n", + "Requirement already satisfied: attrs>=17.3.0 in /usr/local/lib/python3.9/dist-packages (from aiohttp->datasets) (23.1.0)\n", + "Requirement already satisfied: charset-normalizer<4.0,>=2.0 in /usr/local/lib/python3.9/dist-packages (from aiohttp->datasets) (2.0.12)\n", + "Collecting multidict<7.0,>=4.5\n", + " Downloading multidict-6.0.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (114 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m114.2/114.2 kB\u001b[0m \u001b[31m10.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hCollecting frozenlist>=1.1.1\n", + " Downloading frozenlist-1.3.3-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (158 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m158.8/158.8 kB\u001b[0m \u001b[31m19.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hCollecting aiosignal>=1.1.2\n", + " Downloading aiosignal-1.3.1-py3-none-any.whl (7.6 kB)\n", + "Collecting yarl<2.0,>=1.0\n", + " Downloading yarl-1.9.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (269 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m269.3/269.3 kB\u001b[0m \u001b[31m29.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hRequirement already satisfied: typing-extensions>=3.7.4.3 in /usr/local/lib/python3.9/dist-packages (from huggingface-hub<1.0.0,>=0.11.0->datasets) (4.5.0)\n", + "Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/local/lib/python3.9/dist-packages (from requests>=2.19.0->datasets) (1.26.15)\n", + "Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.9/dist-packages (from requests>=2.19.0->datasets) (3.4)\n", + "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.9/dist-packages (from requests>=2.19.0->datasets) (2022.12.7)\n", + "Requirement already satisfied: pytz>=2020.1 in /usr/local/lib/python3.9/dist-packages (from pandas->datasets) (2022.7.1)\n", + "Requirement already satisfied: python-dateutil>=2.8.1 in /usr/local/lib/python3.9/dist-packages (from pandas->datasets) (2.8.2)\n", + "Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.9/dist-packages (from python-dateutil>=2.8.1->pandas->datasets) (1.16.0)\n", + "Installing collected packages: sentencepiece, xxhash, protobuf, multidict, frozenlist, dill, async-timeout, yarl, responses, multiprocess, aiosignal, aiohttp, datasets, evaluate\n", + " Attempting uninstall: protobuf\n", + " Found existing installation: protobuf 3.20.3\n", + " Uninstalling protobuf-3.20.3:\n", + " Successfully uninstalled protobuf-3.20.3\n", + "\u001b[31mERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.\n", + "tensorflow 2.12.0 requires protobuf!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5,<5.0.0dev,>=3.20.3, but you have protobuf 3.20.2 which is incompatible.\n", + "tensorflow-metadata 1.13.1 requires protobuf<5,>=3.20.3, but you have protobuf 3.20.2 which is incompatible.\u001b[0m\u001b[31m\n", + "\u001b[0mSuccessfully installed aiohttp-3.8.4 aiosignal-1.3.1 async-timeout-4.0.2 datasets-2.11.0 dill-0.3.6 evaluate-0.4.0 frozenlist-1.3.3 multidict-6.0.4 multiprocess-0.70.14 protobuf-3.20.2 responses-0.18.0 sentencepiece-0.1.98 xxhash-3.2.0 yarl-1.9.1\n" + ] + } + ], + "source": [ + "!pip install datasets evaluate transformers[sentencepiece]" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "id": "I2NzMkF02GKT" + }, + "outputs": [], + "source": [ + "import datasets\n", + "train_dataset2 = datasets.Dataset.from_pandas(train_data)\n", + "val_dataset2 = datasets.Dataset.from_pandas(val_data)" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 17, + "referenced_widgets": [ + "bd0a06646e0f4048bd1812b3a951b673", + "3565e762bc464b3faa317b3d6d41a6b4", + "ebe4d445c1c841988f0f9a6108df5eda", + "e4d50bd57e81464686850ccd7452a66e", + "a92276817c4241618ca53eb76d399c74", + "805e83a887b34533b4f681890374ce76", + "8a7e34f1d64f4ac4be7d22ba24d6b178", + "89a02375b2884cfab5096eecd6dc5ac7", + "4bde6e4e2a19446f929cab67fb7cde0b", + "744219b30e4c466dbee29b36eb0aa447", + "4d9d80b5b1a042a1af883dfee76d20a2" + ] + }, + "id": "iUn1hjZ42-fu", + "outputId": "19ce3e3d-98a2-4216-a29d-323d9eb3e9f7" + }, + "outputs": [ + { + "output_type": "display_data", + "data": { + "text/plain": [ + "Map: 0%| | 0/1439 [00:00" + ], + "text/html": [ + "\n", + "
\n", + " \n", + " \n", + " [3750/3750 05:49, Epoch 15/15]\n", + "
\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
StepTraining LossValidation Loss
5001.7537000.459091
10000.6984000.358507
15000.5046000.354087
20000.4056000.349343
25000.3263000.330827
30000.2802000.342384
35000.2423000.340906

" + ] + }, + "metadata": {} + }, + { + "output_type": "execute_result", + "data": { + "text/plain": [ + "TrainOutput(global_step=3750, training_loss=0.5772412089029948, metrics={'train_runtime': 352.8405, 'train_samples_per_second': 84.982, 'train_steps_per_second': 10.628, 'total_flos': 212120119203840.0, 'train_loss': 0.5772412089029948, 'epoch': 15.0})" + ] + }, + "metadata": {}, + "execution_count": 30 + } + ], + "source": [ + "trainer.train()" + ] + }, + { + "cell_type": "markdown", + "source": [ + "Расчет метрик" + ], + "metadata": { + "id": "INW4ZvIA6EtU" + } + }, + { + "cell_type": "code", + "source": [ + "from tqdm.auto import tqdm\n", + "import collections\n", + "\n", + "n_best = 20\n", + "max_answer_length = 30\n", + "\n", + "def compute_metrics(start_logits, end_logits, features, examples):\n", + " example_to_features = collections.defaultdict(list)\n", + " for idx, feature in enumerate(features):\n", + " example_to_features[feature[\"example_id\"]].append(idx)\n", + "\n", + " predicted_answers = []\n", + " for example in tqdm(examples):\n", + " example_id = example[\"id\"]\n", + " context = example[\"context\"]\n", + " answers = []\n", + "\n", + " for feature_index in example_to_features[example_id]:\n", + " start_logit = start_logits[feature_index]\n", + " end_logit = end_logits[feature_index]\n", + " offsets = features[feature_index][\"offset_mapping\"]\n", + "\n", + " start_indexes = np.argsort(start_logit)[-1 : -n_best - 1 : -1].tolist()\n", + " end_indexes = np.argsort(end_logit)[-1 : -n_best - 1 : -1].tolist()\n", + " for start_index in start_indexes:\n", + " for end_index in end_indexes:\n", + " if offsets[start_index] is None or offsets[end_index] is None:\n", + " continue\n", + " if (\n", + " end_index < start_index\n", + " or end_index - start_index + 1 > max_answer_length\n", + " ):\n", + " continue\n", + "\n", + " answer = {\n", + " \"text\": context[offsets[start_index][0] : offsets[end_index][1]],\n", + " \"logit_score\": start_logit[start_index] + end_logit[end_index],\n", + " }\n", + " answers.append(answer)\n", + "\n", + " if len(answers) > 0:\n", + " best_answer = max(answers, key=lambda x: x[\"logit_score\"])\n", + " predicted_answers.append(\n", + " {\"id\": str(example_id), \"prediction_text\": best_answer[\"text\"]}\n", + " )\n", + " else:\n", + " predicted_answers.append({\"id\": str(example_id), \"prediction_text\": \"\"})\n", + " theoretical_answers = [{'id': str(ex[\"id\"]), 'answers': {'text': [ex[\"answers\"][\"text\"]], 'answer_start': [ex[\"answers\"][\"answer_start\"]]}} for ex in examples]\n", + " return metric.compute(predictions=predicted_answers, references=theoretical_answers)" + ], + "metadata": { + "id": "osoGk-m36G32" + }, + "execution_count": 31, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "import numpy as np" + ], + "metadata": { + "id": "Z1c2Nh83lXAq" + }, + "execution_count": 32, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "predictions, _, _ = trainer.predict(validation_dataset)\n", + "start_logits, end_logits = predictions\n", + "compute_metrics(start_logits, end_logits, validation_dataset, val_dataset2)" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 66, + "referenced_widgets": [ + "ed0e8381a6a044a396142b1114b1fb83", + "cc64b59d2e764b37baed083ea57a2368", + "edff2be342b5463eb26c8623d1309a09", + "ab68c5f7347d4a9cb8fde25da7f8b7cc", + "972848da90f64de58fd4848e64a0337b", + "9fe9a530a5754616b85f694793629bbb", + "e704eb13e1494e16914c4b010551f91d", + "2854107d59d64e0182ff80a2efdc8bd3", + "e584b16106884edca796fad525b23e7a", + "57e49271f6644e24a4fc633e94403637", + "0028d8ca8d7246fc857520a75685fdb2" + ] + }, + "id": "nFBVKMCC6Ibq", + "outputId": "c93032c0-cea5-4085-8adc-96b47ad3dc55" + }, + "execution_count": 33, + "outputs": [ + { + "output_type": "display_data", + "data": { + "text/plain": [ + "" + ], + "text/html": [] + }, + "metadata": {} + }, + { + "output_type": "display_data", + "data": { + "text/plain": [ + " 0%| | 0/360 [00:00
Copy a token from your Hugging Face\ntokens page and paste it below.
Immediately click login after copying\nyour token or it might be stored in plain text in this notebook file. " + } + }, + "63267c0738fc4824ba662538a6953423": { + "model_module": "@jupyter-widgets/controls", + "model_name": "PasswordModel", + "model_module_version": "1.5.0", + "state": { + "_dom_classes": [], + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "PasswordModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/controls", + "_view_module_version": "1.5.0", + "_view_name": "PasswordView", + "continuous_update": true, + "description": "Token:", + "description_tooltip": null, + "disabled": false, + "layout": "IPY_MODEL_7ba03dfde93343ed88f10ca062b54ad3", + "placeholder": "​", + "style": "IPY_MODEL_0cc1664c2ddb413ab30f2fa616d9063c", + "value": "" + } + }, + "9a8dd1afc40342299c4bb37d52dfda5a": { + "model_module": "@jupyter-widgets/controls", + "model_name": "CheckboxModel", + "model_module_version": "1.5.0", + "state": { + "_dom_classes": [], + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "CheckboxModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/controls", + "_view_module_version": "1.5.0", + "_view_name": "CheckboxView", + "description": "Add token as git credential?", + "description_tooltip": null, + "disabled": false, + "indent": true, + "layout": "IPY_MODEL_ecca16e15e074bbcb2ec55ca70571a46", + "style": "IPY_MODEL_06c30b40e1c848b99c0f009c53b55331", + "value": true + } + }, + "f722caf8bb5640649f2944aa3d782250": { + "model_module": "@jupyter-widgets/controls", + "model_name": "ButtonModel", + "model_module_version": "1.5.0", + "state": { + "_dom_classes": [], + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "ButtonModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/controls", + "_view_module_version": "1.5.0", + "_view_name": "ButtonView", + "button_style": "", + "description": "Login", + "disabled": false, + "icon": "", + "layout": "IPY_MODEL_73597f8263164754b64b2b4da67a1eb2", + "style": "IPY_MODEL_414412c26f34447eb494f1e73c5c3c9a", + "tooltip": "" + } + }, + "a1e7d61cae754d69ab199bc66a8b5ea3": { + "model_module": "@jupyter-widgets/controls", + "model_name": "HTMLModel", + "model_module_version": "1.5.0", + "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_f2341937cf7e4a3790c7b2774f4eb71e", + "placeholder": "​", + "style": "IPY_MODEL_49ad74da496649f5ad15c6cab7bd9f2d", + "value": "\nPro Tip: If you don't already have one, you can create a dedicated\n'notebooks' token with 'write' access, that you can then easily reuse for all\nnotebooks. " + } + }, + "70920f76797e4dfe82bf2dd91569e495": { + "model_module": "@jupyter-widgets/base", + "model_name": "LayoutModel", + "model_module_version": "1.2.0", + "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": "center", + "align_self": null, + "border": null, + "bottom": null, + "display": "flex", + "flex": null, + "flex_flow": "column", + "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": "50%" + } + }, + "1771af413c4b4d91b546225c94c2c892": { + "model_module": "@jupyter-widgets/base", + "model_name": "LayoutModel", + "model_module_version": "1.2.0", + "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 + } + }, + "83156e3cec0e476eb3c87d34757317f3": { + "model_module": "@jupyter-widgets/controls", + "model_name": "DescriptionStyleModel", + "model_module_version": "1.5.0", + "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": "" + } + }, + "7ba03dfde93343ed88f10ca062b54ad3": { + "model_module": "@jupyter-widgets/base", + "model_name": "LayoutModel", + "model_module_version": "1.2.0", + "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 + } + }, + "0cc1664c2ddb413ab30f2fa616d9063c": { + "model_module": "@jupyter-widgets/controls", + "model_name": "DescriptionStyleModel", + "model_module_version": "1.5.0", + "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": "" + } + }, + "ecca16e15e074bbcb2ec55ca70571a46": { + "model_module": "@jupyter-widgets/base", + "model_name": "LayoutModel", + "model_module_version": "1.2.0", + "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 + } + }, + "06c30b40e1c848b99c0f009c53b55331": { + "model_module": "@jupyter-widgets/controls", + "model_name": "DescriptionStyleModel", + "model_module_version": "1.5.0", + "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": "" + } + }, + "73597f8263164754b64b2b4da67a1eb2": { + "model_module": "@jupyter-widgets/base", + "model_name": "LayoutModel", + "model_module_version": "1.2.0", + "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 + } + }, + "414412c26f34447eb494f1e73c5c3c9a": { + "model_module": "@jupyter-widgets/controls", + "model_name": "ButtonStyleModel", + "model_module_version": "1.5.0", + "state": { + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "ButtonStyleModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "StyleView", + "button_color": null, + "font_weight": "" + } + }, + "f2341937cf7e4a3790c7b2774f4eb71e": { + "model_module": "@jupyter-widgets/base", + "model_name": "LayoutModel", + "model_module_version": "1.2.0", + "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 + } + }, + "49ad74da496649f5ad15c6cab7bd9f2d": { + "model_module": "@jupyter-widgets/controls", + "model_name": "DescriptionStyleModel", + "model_module_version": "1.5.0", + "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": "" + } + }, + "ed0e8381a6a044a396142b1114b1fb83": { + "model_module": "@jupyter-widgets/controls", + "model_name": "HBoxModel", + "model_module_version": "1.5.0", + "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_cc64b59d2e764b37baed083ea57a2368", + "IPY_MODEL_edff2be342b5463eb26c8623d1309a09", + "IPY_MODEL_ab68c5f7347d4a9cb8fde25da7f8b7cc" + ], + "layout": "IPY_MODEL_972848da90f64de58fd4848e64a0337b" + } + }, + "cc64b59d2e764b37baed083ea57a2368": { + "model_module": "@jupyter-widgets/controls", + "model_name": "HTMLModel", + "model_module_version": "1.5.0", + "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_9fe9a530a5754616b85f694793629bbb", + "placeholder": "​", + "style": "IPY_MODEL_e704eb13e1494e16914c4b010551f91d", + "value": "100%" + } + }, + "edff2be342b5463eb26c8623d1309a09": { + "model_module": "@jupyter-widgets/controls", + "model_name": "FloatProgressModel", + "model_module_version": "1.5.0", + "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_2854107d59d64e0182ff80a2efdc8bd3", + "max": 360, + "min": 0, + "orientation": "horizontal", + "style": "IPY_MODEL_e584b16106884edca796fad525b23e7a", + "value": 360 + } + }, + "ab68c5f7347d4a9cb8fde25da7f8b7cc": { + "model_module": "@jupyter-widgets/controls", + "model_name": "HTMLModel", + "model_module_version": "1.5.0", + "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_57e49271f6644e24a4fc633e94403637", + "placeholder": "​", + "style": "IPY_MODEL_0028d8ca8d7246fc857520a75685fdb2", + "value": " 360/360 [00:01<00:00, 301.37it/s]" + } + }, + "972848da90f64de58fd4848e64a0337b": { + "model_module": "@jupyter-widgets/base", + "model_name": "LayoutModel", + "model_module_version": "1.2.0", + "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 + } + }, + "9fe9a530a5754616b85f694793629bbb": { + "model_module": "@jupyter-widgets/base", + "model_name": "LayoutModel", + "model_module_version": "1.2.0", + "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 + } + }, + "e704eb13e1494e16914c4b010551f91d": { + "model_module": "@jupyter-widgets/controls", + "model_name": "DescriptionStyleModel", + "model_module_version": "1.5.0", + "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": "" + } + }, + "2854107d59d64e0182ff80a2efdc8bd3": { + "model_module": "@jupyter-widgets/base", + "model_name": "LayoutModel", + "model_module_version": "1.2.0", + "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 + } + }, + "e584b16106884edca796fad525b23e7a": { + "model_module": "@jupyter-widgets/controls", + "model_name": "ProgressStyleModel", + "model_module_version": "1.5.0", + "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": "" + } + }, + "57e49271f6644e24a4fc633e94403637": { + "model_module": "@jupyter-widgets/base", + "model_name": "LayoutModel", + "model_module_version": "1.2.0", + "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 + } + }, + "0028d8ca8d7246fc857520a75685fdb2": { + "model_module": "@jupyter-widgets/controls", + "model_name": "DescriptionStyleModel", + "model_module_version": "1.5.0", + "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": "" + } + } + } + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} \ No newline at end of file