{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Data Preparation" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Я нашел три датасета на kaggle по классификации фейков. Они все на английском, поэтому для поддержки русскуязычных статей будем использовать специально обученную для перевода новостей модель wmt19-ru-en. \n", "\n", "Выбранные датасеты:\n", "* https://www.kaggle.com/c/fake-news/data\n", "* https://www.kaggle.com/c/fakenewskdd2020/data\n", "* https://www.kaggle.com/c/classifying-the-fake-news/data" ] }, { "cell_type": "code", "execution_count": 95, "metadata": {}, "outputs": [], "source": [ "import pandas as pd\n", "\n", "df1_train = pd.read_csv('./data1/train.csv')" ] }, { "cell_type": "code", "execution_count": 96, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\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", " \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", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
idtitleauthortextlabel
00House Dem Aide: We Didn’t Even See Comey’s Let...Darrell LucusHouse Dem Aide: We Didn’t Even See Comey’s Let...1
11FLYNN: Hillary Clinton, Big Woman on Campus - ...Daniel J. FlynnEver get the feeling your life circles the rou...0
22Why the Truth Might Get You FiredConsortiumnews.comWhy the Truth Might Get You Fired October 29, ...1
3315 Civilians Killed In Single US Airstrike Hav...Jessica PurkissVideos 15 Civilians Killed In Single US Airstr...1
44Iranian woman jailed for fictional unpublished...Howard PortnoyPrint \\nAn Iranian woman has been sentenced to...1
..................
2079520795Rapper T.I.: Trump a ’Poster Child For White S...Jerome HudsonRapper T. I. unloaded on black celebrities who...0
2079620796N.F.L. Playoffs: Schedule, Matchups and Odds -...Benjamin HoffmanWhen the Green Bay Packers lost to the Washing...0
2079720797Macy’s Is Said to Receive Takeover Approach by...Michael J. de la Merced and Rachel AbramsThe Macy’s of today grew from the union of sev...0
2079820798NATO, Russia To Hold Parallel Exercises In Bal...Alex AnsaryNATO, Russia To Hold Parallel Exercises In Bal...1
2079920799What Keeps the F-35 AliveDavid SwansonDavid Swanson is an author, activist, journa...1
\n", "

20800 rows × 5 columns

\n", "
" ], "text/plain": [ " id title \\\n", "0 0 House Dem Aide: We Didn’t Even See Comey’s Let... \n", "1 1 FLYNN: Hillary Clinton, Big Woman on Campus - ... \n", "2 2 Why the Truth Might Get You Fired \n", "3 3 15 Civilians Killed In Single US Airstrike Hav... \n", "4 4 Iranian woman jailed for fictional unpublished... \n", "... ... ... \n", "20795 20795 Rapper T.I.: Trump a ’Poster Child For White S... \n", "20796 20796 N.F.L. Playoffs: Schedule, Matchups and Odds -... \n", "20797 20797 Macy’s Is Said to Receive Takeover Approach by... \n", "20798 20798 NATO, Russia To Hold Parallel Exercises In Bal... \n", "20799 20799 What Keeps the F-35 Alive \n", "\n", " author \\\n", "0 Darrell Lucus \n", "1 Daniel J. Flynn \n", "2 Consortiumnews.com \n", "3 Jessica Purkiss \n", "4 Howard Portnoy \n", "... ... \n", "20795 Jerome Hudson \n", "20796 Benjamin Hoffman \n", "20797 Michael J. de la Merced and Rachel Abrams \n", "20798 Alex Ansary \n", "20799 David Swanson \n", "\n", " text label \n", "0 House Dem Aide: We Didn’t Even See Comey’s Let... 1 \n", "1 Ever get the feeling your life circles the rou... 0 \n", "2 Why the Truth Might Get You Fired October 29, ... 1 \n", "3 Videos 15 Civilians Killed In Single US Airstr... 1 \n", "4 Print \\nAn Iranian woman has been sentenced to... 1 \n", "... ... ... \n", "20795 Rapper T. I. unloaded on black celebrities who... 0 \n", "20796 When the Green Bay Packers lost to the Washing... 0 \n", "20797 The Macy’s of today grew from the union of sev... 0 \n", "20798 NATO, Russia To Hold Parallel Exercises In Bal... 1 \n", "20799 David Swanson is an author, activist, journa... 1 \n", "\n", "[20800 rows x 5 columns]" ] }, "execution_count": 96, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df1_train" ] }, { "cell_type": "code", "execution_count": 97, "metadata": {}, "outputs": [], "source": [ "df1_train['text'] = df1_train.apply(lambda x: str(x.title) + '. ' + str(x.text), axis=1)\n", "df1_train = df1_train[['text', 'label']]" ] }, { "cell_type": "code", "execution_count": 98, "metadata": {}, "outputs": [], "source": [ "df2_train = pd.read_csv('./data2/train.csv', sep='\\t')" ] }, { "cell_type": "code", "execution_count": 99, "metadata": {}, "outputs": [], "source": [ "# Битая строка\n", "df2_train = df2_train.drop([1615])" ] }, { "cell_type": "code", "execution_count": 100, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\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", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
textlabel
0Get the latest from TODAY Sign up for our news...1
12d Conan On The Funeral Trump Will Be Invited...1
2It’s safe to say that Instagram Stories has fa...0
3Much like a certain Amazon goddess with a lass...0
4At a time when the perfect outfit is just one ...0
.........
4982The storybook romance of WWE stars John Cena a...0
4983The actor told friends he’s responsible for en...0
4984Sarah Hyland is getting real. The Modern Fami...0
4985Production has been suspended on the sixth and...0
4986A jury ruled against Bill Cosby in his sexual ...0
\n", "

4986 rows × 2 columns

\n", "
" ], "text/plain": [ " text label\n", "0 Get the latest from TODAY Sign up for our news... 1\n", "1 2d Conan On The Funeral Trump Will Be Invited... 1\n", "2 It’s safe to say that Instagram Stories has fa... 0\n", "3 Much like a certain Amazon goddess with a lass... 0\n", "4 At a time when the perfect outfit is just one ... 0\n", "... ... ...\n", "4982 The storybook romance of WWE stars John Cena a... 0\n", "4983 The actor told friends he’s responsible for en... 0\n", "4984 Sarah Hyland is getting real. The Modern Fami... 0\n", "4985 Production has been suspended on the sixth and... 0\n", "4986 A jury ruled against Bill Cosby in his sexual ... 0\n", "\n", "[4986 rows x 2 columns]" ] }, "execution_count": 100, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df2_train" ] }, { "cell_type": "code", "execution_count": 104, "metadata": {}, "outputs": [], "source": [ "df3_train = pd.read_csv('./data3/training.csv')" ] }, { "cell_type": "code", "execution_count": 105, "metadata": {}, "outputs": [], "source": [ "df3_train['text'] = df3_train.apply(lambda x: str(x.title) + '. ' + str(x.text), axis=1)\n", "df3_train = df3_train[['text', 'label']]" ] }, { "cell_type": "code", "execution_count": 106, "metadata": {}, "outputs": [], "source": [ "all_data_train = df1_train.append(df2_train).append(df3_train)\n", "all_data_train.to_csv('./train.csv', index=False)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Training" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "id": "zriTdjauH8iQ" }, "outputs": [], "source": [ "#!pip install transformers\n", "import transformers" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "id": "TFh3upySL3XG" }, "outputs": [], "source": [ "from transformers import Trainer, TrainingArguments, LineByLineTextDataset" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "id": "H2Ym6YhyNfON" }, "outputs": [], "source": [ "import pandas as pd" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "id": "ueRyDnvgNgpW" }, "outputs": [], "source": [ "from datasets import Dataset" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "id": "HVBCtqyjNhLn" }, "outputs": [], "source": [ "df = pd.read_csv('./train.csv')" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 424 }, "id": "f7j8fEl1Nogb", "outputId": "3b5b13a0-4c34-412c-9718-5b0decb855cc" }, "outputs": [ { "data": { "text/html": [ "
\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", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
textlabel
0House Dem Aide: We Didn’t Even See Comey’s Let...1
1FLYNN: Hillary Clinton, Big Woman on Campus - ...0
2Why the Truth Might Get You Fired.Why the Trut...1
315 Civilians Killed In Single US Airstrike Hav...1
4Iranian woman jailed for fictional unpublished...1
.........
57209CHICAGO TRUMP RALLY CANCELLED: Radicals And BL...1
57210Trump supports completion of Dakota Access Pip...0
57211Obama Can’t Stop Winning As New Jobs Report S...1
57212Turkey bank regulator dismisses 'rumors' after...0
57213California mayors ask for governor's support f...0
\n", "

57214 rows × 2 columns

\n", "
" ], "text/plain": [ " text label\n", "0 House Dem Aide: We Didn’t Even See Comey’s Let... 1\n", "1 FLYNN: Hillary Clinton, Big Woman on Campus - ... 0\n", "2 Why the Truth Might Get You Fired.Why the Trut... 1\n", "3 15 Civilians Killed In Single US Airstrike Hav... 1\n", "4 Iranian woman jailed for fictional unpublished... 1\n", "... ... ...\n", "57209 CHICAGO TRUMP RALLY CANCELLED: Radicals And BL... 1\n", "57210 Trump supports completion of Dakota Access Pip... 0\n", "57211 Obama Can’t Stop Winning As New Jobs Report S... 1\n", "57212 Turkey bank regulator dismisses 'rumors' after... 0\n", "57213 California mayors ask for governor's support f... 0\n", "\n", "[57214 rows x 2 columns]" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df" ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "id": "L0ET6Z83Pcxu" }, "outputs": [], "source": [ "df['labels'] = df['label']" ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "id": "39Zv6HBJPgEt" }, "outputs": [], "source": [ "df = df[['text', 'labels']]" ] }, { "cell_type": "code", "execution_count": 9, "metadata": { "id": "bPGVPY17NI7x" }, "outputs": [], "source": [ "dataset = Dataset.from_pandas(df)" ] }, { "cell_type": "code", "execution_count": 10, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "3LTGwWrINmZq", "outputId": "177d8749-68cf-4f81-a91b-1097bf155478" }, "outputs": [ { "data": { "text/plain": [ "Dataset({\n", " features: ['text', 'labels'],\n", " num_rows: 57214\n", "})" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dataset" ] }, { "cell_type": "code", "execution_count": 11, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "3DrWrMiDd7e-", "outputId": "d331ebe6-5ed4-4fef-8a8d-41d25ed4b638" }, "outputs": [], "source": [ "import torch\n", "from transformers import AutoTokenizer, AutoModel, pipeline\n", "\n", "model_name = 'distilbert-base-uncased-finetuned-sst-2-english'\n", "tokenizer = AutoTokenizer.from_pretrained(model_name)" ] }, { "cell_type": "code", "execution_count": 12, "metadata": { "id": "dRJOO2c5PT3V" }, "outputs": [], "source": [ "def preprocess_function(examples):\n", " return tokenizer(examples[\"text\"], padding=True, truncation=True)" ] }, { "cell_type": "code", "execution_count": 13, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 49, "referenced_widgets": [ "5b49dc833234406da3da7435b9045fd2", "300b70ed57dd493997afb0b3f25f4245", "c03cc68b079c4e23b339e9de5ba38d29", "57c3794731c84c42bb49618482b6b8cc", "e306828f6d7444ddafce604e9a170467", "9e11898bc51e483d91301387099368a4", "a43574fa5fdf47ba9d5598b2b31f2082", "482bae742d2a461cad525888e6ee8b91", "e9c56275d73545a6961efe5704308ede", "d604380b5e444f62ad36c4598230c561", "c52ad745acb3423494b4ea5af5a934c7" ] }, "id": "hCxs-HasPQ7s", "outputId": "be4f8483-316c-4677-f804-12c78f358fac" }, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "67689f0c8fb842b2969c4fc584fa3a4b", "version_major": 2, "version_minor": 0 }, "text/plain": [ " 0%| | 0/58 [00:00\n", " \n", " \n", " [8050/8050 1:31:55, Epoch 10/10]\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", " \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", "
EpochTraining LossValidation LossAccuracy
11.1245000.6551700.631423
20.6359000.6169280.696435
30.6174000.5928790.727019
40.5912000.5779410.734533
50.5771000.5646650.747466
60.5693000.5560960.749913
70.5632000.5513890.755330
80.5599000.5467560.754981
90.5548000.5444960.759000
100.5540000.5436040.760398

" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stderr", "output_type": "stream", "text": [ "The following columns in the evaluation set don't have a corresponding argument in `DistilBertForSequenceClassification.forward` and have been ignored: text. If text are not expected by `DistilBertForSequenceClassification.forward`, you can safely ignore this message.\n", "***** Running Evaluation *****\n", " Num examples = 5722\n", " Batch size = 64\n", "Saving model checkpoint to ./my_saved_model\\checkpoint-805\n", "Configuration saved in ./my_saved_model\\checkpoint-805\\config.json\n", "Model weights saved in ./my_saved_model\\checkpoint-805\\pytorch_model.bin\n", "The following columns in the evaluation set don't have a corresponding argument in `DistilBertForSequenceClassification.forward` and have been ignored: text. If text are not expected by `DistilBertForSequenceClassification.forward`, you can safely ignore this message.\n", "***** Running Evaluation *****\n", " Num examples = 5722\n", " Batch size = 64\n", "Saving model checkpoint to ./my_saved_model\\checkpoint-1610\n", "Configuration saved in ./my_saved_model\\checkpoint-1610\\config.json\n", "Model weights saved in ./my_saved_model\\checkpoint-1610\\pytorch_model.bin\n", "The following columns in the evaluation set don't have a corresponding argument in `DistilBertForSequenceClassification.forward` and have been ignored: text. If text are not expected by `DistilBertForSequenceClassification.forward`, you can safely ignore this message.\n", "***** Running Evaluation *****\n", " Num examples = 5722\n", " Batch size = 64\n", "Saving model checkpoint to ./my_saved_model\\checkpoint-2415\n", "Configuration saved in ./my_saved_model\\checkpoint-2415\\config.json\n", "Model weights saved in ./my_saved_model\\checkpoint-2415\\pytorch_model.bin\n", "Deleting older checkpoint [my_saved_model\\checkpoint-805] due to args.save_total_limit\n", "The following columns in the evaluation set don't have a corresponding argument in `DistilBertForSequenceClassification.forward` and have been ignored: text. If text are not expected by `DistilBertForSequenceClassification.forward`, you can safely ignore this message.\n", "***** Running Evaluation *****\n", " Num examples = 5722\n", " Batch size = 64\n", "Saving model checkpoint to ./my_saved_model\\checkpoint-3220\n", "Configuration saved in ./my_saved_model\\checkpoint-3220\\config.json\n", "Model weights saved in ./my_saved_model\\checkpoint-3220\\pytorch_model.bin\n", "Deleting older checkpoint [my_saved_model\\checkpoint-1610] due to args.save_total_limit\n", "The following columns in the evaluation set don't have a corresponding argument in `DistilBertForSequenceClassification.forward` and have been ignored: text. If text are not expected by `DistilBertForSequenceClassification.forward`, you can safely ignore this message.\n", "***** Running Evaluation *****\n", " Num examples = 5722\n", " Batch size = 64\n", "Saving model checkpoint to ./my_saved_model\\checkpoint-4025\n", "Configuration saved in ./my_saved_model\\checkpoint-4025\\config.json\n", "Model weights saved in ./my_saved_model\\checkpoint-4025\\pytorch_model.bin\n", "Deleting older checkpoint [my_saved_model\\checkpoint-2415] due to args.save_total_limit\n", "The following columns in the evaluation set don't have a corresponding argument in `DistilBertForSequenceClassification.forward` and have been ignored: text. If text are not expected by `DistilBertForSequenceClassification.forward`, you can safely ignore this message.\n", "***** Running Evaluation *****\n", " Num examples = 5722\n", " Batch size = 64\n", "Saving model checkpoint to ./my_saved_model\\checkpoint-4830\n", "Configuration saved in ./my_saved_model\\checkpoint-4830\\config.json\n", "Model weights saved in ./my_saved_model\\checkpoint-4830\\pytorch_model.bin\n", "Deleting older checkpoint [my_saved_model\\checkpoint-3220] due to args.save_total_limit\n", "The following columns in the evaluation set don't have a corresponding argument in `DistilBertForSequenceClassification.forward` and have been ignored: text. If text are not expected by `DistilBertForSequenceClassification.forward`, you can safely ignore this message.\n", "***** Running Evaluation *****\n", " Num examples = 5722\n", " Batch size = 64\n", "Saving model checkpoint to ./my_saved_model\\checkpoint-5635\n", "Configuration saved in ./my_saved_model\\checkpoint-5635\\config.json\n", "Model weights saved in ./my_saved_model\\checkpoint-5635\\pytorch_model.bin\n", "Deleting older checkpoint [my_saved_model\\checkpoint-4025] due to args.save_total_limit\n", "The following columns in the evaluation set don't have a corresponding argument in `DistilBertForSequenceClassification.forward` and have been ignored: text. If text are not expected by `DistilBertForSequenceClassification.forward`, you can safely ignore this message.\n", "***** Running Evaluation *****\n", " Num examples = 5722\n", " Batch size = 64\n", "Saving model checkpoint to ./my_saved_model\\checkpoint-6440\n", "Configuration saved in ./my_saved_model\\checkpoint-6440\\config.json\n", "Model weights saved in ./my_saved_model\\checkpoint-6440\\pytorch_model.bin\n", "Deleting older checkpoint [my_saved_model\\checkpoint-4830] due to args.save_total_limit\n", "The following columns in the evaluation set don't have a corresponding argument in `DistilBertForSequenceClassification.forward` and have been ignored: text. If text are not expected by `DistilBertForSequenceClassification.forward`, you can safely ignore this message.\n", "***** Running Evaluation *****\n", " Num examples = 5722\n", " Batch size = 64\n", "Saving model checkpoint to ./my_saved_model\\checkpoint-7245\n", "Configuration saved in ./my_saved_model\\checkpoint-7245\\config.json\n", "Model weights saved in ./my_saved_model\\checkpoint-7245\\pytorch_model.bin\n", "Deleting older checkpoint [my_saved_model\\checkpoint-5635] due to args.save_total_limit\n", "The following columns in the evaluation set don't have a corresponding argument in `DistilBertForSequenceClassification.forward` and have been ignored: text. If text are not expected by `DistilBertForSequenceClassification.forward`, you can safely ignore this message.\n", "***** Running Evaluation *****\n", " Num examples = 5722\n", " Batch size = 64\n", "Saving model checkpoint to ./my_saved_model\\checkpoint-8050\n", "Configuration saved in ./my_saved_model\\checkpoint-8050\\config.json\n", "Model weights saved in ./my_saved_model\\checkpoint-8050\\pytorch_model.bin\n", "Deleting older checkpoint [my_saved_model\\checkpoint-6440] due to args.save_total_limit\n", "\n", "\n", "Training completed. Do not forget to share your model on huggingface.co/models =)\n", "\n", "\n", "Loading best model from ./my_saved_model\\checkpoint-8050 (score: 0.543603777885437).\n" ] }, { "data": { "text/plain": [ "TrainOutput(global_step=8050, training_loss=0.6166538418598057, metrics={'train_runtime': 5516.6092, 'train_samples_per_second': 93.34, 'train_steps_per_second': 1.459, 'total_flos': 6.821011291594752e+16, 'train_loss': 0.6166538418598057, 'epoch': 10.0})" ] }, "execution_count": 26, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from transformers import Trainer, TrainingArguments\n", "\n", "trainer = Trainer(\n", " model=model, train_dataset=dataset_splitted['train'], \n", " eval_dataset=dataset_splitted['test'],\n", " compute_metrics=compute_metrics,\n", " args=TrainingArguments(\n", " load_best_model_at_end=True,\n", " output_dir=\"./my_saved_model\", overwrite_output_dir=True,\n", " num_train_epochs=10, per_device_train_batch_size=64, \n", " per_device_eval_batch_size=64,\n", " evaluation_strategy = \"epoch\",\n", " save_strategy = \"epoch\",\n", " save_steps=10_000, save_total_limit=2),\n", ")\n", "\n", "trainer.train()" ] } ], "metadata": { "accelerator": "GPU", "colab": { "collapsed_sections": [], "name": "Копия блокнота \"ysda_2022.03.07.ipynb\"", "provenance": [] }, "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.12" }, "widgets": { "application/vnd.jupyter.widget-state+json": { "300b70ed57dd493997afb0b3f25f4245": { "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_9e11898bc51e483d91301387099368a4", "placeholder": "​", "style": "IPY_MODEL_a43574fa5fdf47ba9d5598b2b31f2082", "value": "100%" } }, "482bae742d2a461cad525888e6ee8b91": { "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 } }, "57c3794731c84c42bb49618482b6b8cc": { "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_d604380b5e444f62ad36c4598230c561", "placeholder": "​", "style": "IPY_MODEL_c52ad745acb3423494b4ea5af5a934c7", "value": " 58/58 [02:02<00:00, 1.83s/ba]" } }, "5b49dc833234406da3da7435b9045fd2": { "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_300b70ed57dd493997afb0b3f25f4245", "IPY_MODEL_c03cc68b079c4e23b339e9de5ba38d29", "IPY_MODEL_57c3794731c84c42bb49618482b6b8cc" ], "layout": "IPY_MODEL_e306828f6d7444ddafce604e9a170467" } }, "9e11898bc51e483d91301387099368a4": { "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 } }, "a43574fa5fdf47ba9d5598b2b31f2082": { "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": "" } }, "c03cc68b079c4e23b339e9de5ba38d29": { "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_482bae742d2a461cad525888e6ee8b91", "max": 58, "min": 0, "orientation": "horizontal", "style": "IPY_MODEL_e9c56275d73545a6961efe5704308ede", "value": 58 } }, "c52ad745acb3423494b4ea5af5a934c7": { "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": "" } }, "d604380b5e444f62ad36c4598230c561": { "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 } }, "e306828f6d7444ddafce604e9a170467": { "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 } }, "e9c56275d73545a6961efe5704308ede": { "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": "" } } } } }, "nbformat": 4, "nbformat_minor": 1 }