shivasai824 commited on
Commit
f0c1d20
1 Parent(s): 1d0b5ea

Upload Yet_another_copy_of_Bert_Classifier_Sentiment_Analysis.ipynb

Browse files
Yet_another_copy_of_Bert_Classifier_Sentiment_Analysis.ipynb ADDED
@@ -0,0 +1,1700 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "code",
5
+ "execution_count": null,
6
+ "metadata": {
7
+ "colab": {
8
+ "base_uri": "https://localhost:8080/"
9
+ },
10
+ "id": "Pr7vJKcKd4gr",
11
+ "outputId": "0f6cc3c7-24d7-49d0-dc9d-26bc45a64cdd"
12
+ },
13
+ "outputs": [
14
+ {
15
+ "output_type": "stream",
16
+ "name": "stdout",
17
+ "text": [
18
+ "Requirement already satisfied: transformers in /usr/local/lib/python3.10/dist-packages (4.35.2)\n",
19
+ "Requirement already satisfied: torch in /usr/local/lib/python3.10/dist-packages (2.1.0+cu118)\n",
20
+ "Requirement already satisfied: scikit-learn in /usr/local/lib/python3.10/dist-packages (1.2.2)\n",
21
+ "Requirement already satisfied: pandas in /usr/local/lib/python3.10/dist-packages (1.5.3)\n",
22
+ "Requirement already satisfied: filelock in /usr/local/lib/python3.10/dist-packages (from transformers) (3.13.1)\n",
23
+ "Requirement already satisfied: huggingface-hub<1.0,>=0.16.4 in /usr/local/lib/python3.10/dist-packages (from transformers) (0.19.4)\n",
24
+ "Requirement already satisfied: numpy>=1.17 in /usr/local/lib/python3.10/dist-packages (from transformers) (1.23.5)\n",
25
+ "Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.10/dist-packages (from transformers) (23.2)\n",
26
+ "Requirement already satisfied: pyyaml>=5.1 in /usr/local/lib/python3.10/dist-packages (from transformers) (6.0.1)\n",
27
+ "Requirement already satisfied: regex!=2019.12.17 in /usr/local/lib/python3.10/dist-packages (from transformers) (2023.6.3)\n",
28
+ "Requirement already satisfied: requests in /usr/local/lib/python3.10/dist-packages (from transformers) (2.31.0)\n",
29
+ "Requirement already satisfied: tokenizers<0.19,>=0.14 in /usr/local/lib/python3.10/dist-packages (from transformers) (0.15.0)\n",
30
+ "Requirement already satisfied: safetensors>=0.3.1 in /usr/local/lib/python3.10/dist-packages (from transformers) (0.4.0)\n",
31
+ "Requirement already satisfied: tqdm>=4.27 in /usr/local/lib/python3.10/dist-packages (from transformers) (4.66.1)\n",
32
+ "Requirement already satisfied: typing-extensions in /usr/local/lib/python3.10/dist-packages (from torch) (4.5.0)\n",
33
+ "Requirement already satisfied: sympy in /usr/local/lib/python3.10/dist-packages (from torch) (1.12)\n",
34
+ "Requirement already satisfied: networkx in /usr/local/lib/python3.10/dist-packages (from torch) (3.2.1)\n",
35
+ "Requirement already satisfied: jinja2 in /usr/local/lib/python3.10/dist-packages (from torch) (3.1.2)\n",
36
+ "Requirement already satisfied: fsspec in /usr/local/lib/python3.10/dist-packages (from torch) (2023.6.0)\n",
37
+ "Requirement already satisfied: triton==2.1.0 in /usr/local/lib/python3.10/dist-packages (from torch) (2.1.0)\n",
38
+ "Requirement already satisfied: scipy>=1.3.2 in /usr/local/lib/python3.10/dist-packages (from scikit-learn) (1.11.3)\n",
39
+ "Requirement already satisfied: joblib>=1.1.1 in /usr/local/lib/python3.10/dist-packages (from scikit-learn) (1.3.2)\n",
40
+ "Requirement already satisfied: threadpoolctl>=2.0.0 in /usr/local/lib/python3.10/dist-packages (from scikit-learn) (3.2.0)\n",
41
+ "Requirement already satisfied: python-dateutil>=2.8.1 in /usr/local/lib/python3.10/dist-packages (from pandas) (2.8.2)\n",
42
+ "Requirement already satisfied: pytz>=2020.1 in /usr/local/lib/python3.10/dist-packages (from pandas) (2023.3.post1)\n",
43
+ "Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.10/dist-packages (from python-dateutil>=2.8.1->pandas) (1.16.0)\n",
44
+ "Requirement already satisfied: MarkupSafe>=2.0 in /usr/local/lib/python3.10/dist-packages (from jinja2->torch) (2.1.3)\n",
45
+ "Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/dist-packages (from requests->transformers) (3.3.2)\n",
46
+ "Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests->transformers) (3.4)\n",
47
+ "Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests->transformers) (2.0.7)\n",
48
+ "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests->transformers) (2023.7.22)\n",
49
+ "Requirement already satisfied: mpmath>=0.19 in /usr/local/lib/python3.10/dist-packages (from sympy->torch) (1.3.0)\n"
50
+ ]
51
+ }
52
+ ],
53
+ "source": [
54
+ "!pip install transformers torch scikit-learn pandas"
55
+ ]
56
+ },
57
+ {
58
+ "cell_type": "code",
59
+ "source": [
60
+ "from google.colab import drive\n",
61
+ "drive.mount('/content/drive')"
62
+ ],
63
+ "metadata": {
64
+ "colab": {
65
+ "base_uri": "https://localhost:8080/"
66
+ },
67
+ "id": "tH2zIdlZg5cF",
68
+ "outputId": "3490654d-09c5-4270-966d-6e5aba363443"
69
+ },
70
+ "execution_count": 2,
71
+ "outputs": [
72
+ {
73
+ "output_type": "stream",
74
+ "name": "stdout",
75
+ "text": [
76
+ "Drive already mounted at /content/drive; to attempt to forcibly remount, call drive.mount(\"/content/drive\", force_remount=True).\n"
77
+ ]
78
+ }
79
+ ]
80
+ },
81
+ {
82
+ "cell_type": "code",
83
+ "execution_count": null,
84
+ "metadata": {
85
+ "id": "6L-RdDLGUDNv"
86
+ },
87
+ "outputs": [],
88
+ "source": [
89
+ "import os\n",
90
+ "import torch\n",
91
+ "from torch import nn\n",
92
+ "from torch.utils.data import DataLoader, Dataset\n",
93
+ "from transformers import BertTokenizer, BertModel, AdamW, get_linear_schedule_with_warmup\n",
94
+ "from sklearn.model_selection import train_test_split\n",
95
+ "from sklearn.metrics import accuracy_score, classification_report\n",
96
+ "import pandas as pd"
97
+ ]
98
+ },
99
+ {
100
+ "cell_type": "code",
101
+ "execution_count": null,
102
+ "metadata": {
103
+ "id": "RlR2_pMvU5iF"
104
+ },
105
+ "outputs": [],
106
+ "source": [
107
+ "data_file = \"/content/drive/MyDrive/Colab Notebooks/Twitter_Data.csv\"\n",
108
+ "df = pd.read_csv(data_file)\n",
109
+ "df.dropna(subset=['category'], inplace=True)\n",
110
+ "# df = df.drop(df[df['category'] == 0].index)\n",
111
+ "df['category']=[int(i) for i in df['category']]\n",
112
+ "df['category']=[2 if i==1 else i for i in df['category']]\n",
113
+ "df['category']=[1 if i==0 else i for i in df['category']]\n",
114
+ "df['category']=[0 if i==-1 else i for i in df['category']]\n",
115
+ "df['clean_text']=[str(i) for i in df['clean_text']]\n",
116
+ "df=df.sample(10000)\n",
117
+ "texts = df['clean_text'].tolist()\n",
118
+ "labels=df['category'].tolist()"
119
+ ]
120
+ },
121
+ {
122
+ "cell_type": "code",
123
+ "source": [
124
+ "df.shape"
125
+ ],
126
+ "metadata": {
127
+ "colab": {
128
+ "base_uri": "https://localhost:8080/"
129
+ },
130
+ "id": "bGwnFQgjaAeO",
131
+ "outputId": "9a416f57-06b2-4c89-e16a-9d670260bb58"
132
+ },
133
+ "execution_count": null,
134
+ "outputs": [
135
+ {
136
+ "output_type": "execute_result",
137
+ "data": {
138
+ "text/plain": [
139
+ "(10000, 2)"
140
+ ]
141
+ },
142
+ "metadata": {},
143
+ "execution_count": 24
144
+ }
145
+ ]
146
+ },
147
+ {
148
+ "cell_type": "code",
149
+ "execution_count": null,
150
+ "metadata": {
151
+ "colab": {
152
+ "base_uri": "https://localhost:8080/"
153
+ },
154
+ "id": "rQOk57pXU6gS",
155
+ "outputId": "e8e861fe-1fb9-4467-9718-8d497c72eff9"
156
+ },
157
+ "outputs": [
158
+ {
159
+ "output_type": "execute_result",
160
+ "data": {
161
+ "text/plain": [
162
+ "['mean seriously there should reality show how shameless one can become launched bjp contested bjp with narendra modi leading contestant nation will love going history elections guess all love touch drama']"
163
+ ]
164
+ },
165
+ "metadata": {},
166
+ "execution_count": 25
167
+ }
168
+ ],
169
+ "source": [
170
+ "import random\n",
171
+ "random.choices(texts)"
172
+ ]
173
+ },
174
+ {
175
+ "cell_type": "code",
176
+ "execution_count": null,
177
+ "metadata": {
178
+ "colab": {
179
+ "base_uri": "https://localhost:8080/"
180
+ },
181
+ "id": "oiRLdjU8U9CG",
182
+ "outputId": "84e61a8b-2f0e-46e7-8650-a0f0febae12d"
183
+ },
184
+ "outputs": [
185
+ {
186
+ "output_type": "execute_result",
187
+ "data": {
188
+ "text/plain": [
189
+ "[0, 0, 1, 1, 1]"
190
+ ]
191
+ },
192
+ "metadata": {},
193
+ "execution_count": 26
194
+ }
195
+ ],
196
+ "source": [
197
+ "random.sample(labels,5)"
198
+ ]
199
+ },
200
+ {
201
+ "cell_type": "code",
202
+ "execution_count": null,
203
+ "metadata": {
204
+ "id": "pDcj8B3uVA9X"
205
+ },
206
+ "outputs": [],
207
+ "source": [
208
+ "class TextClassificationDataset(Dataset):\n",
209
+ " def __init__(self, texts, labels, tokenizer, max_length):\n",
210
+ " self.texts = texts\n",
211
+ " self.labels = labels\n",
212
+ " self.tokenizer = tokenizer\n",
213
+ " self.max_length = max_length\n",
214
+ " def __len__(self):\n",
215
+ " return len(self.texts)\n",
216
+ " def __getitem__(self, idx):\n",
217
+ " text = self.texts[idx]\n",
218
+ " label = self.labels[idx]\n",
219
+ " encoding = self.tokenizer(text, return_tensors='pt', max_length=self.max_length, padding='max_length', truncation=True)\n",
220
+ " return {'input_ids': encoding['input_ids'].flatten(), 'attention_mask': encoding['attention_mask'].flatten(), 'label': torch.tensor(label)}\n"
221
+ ]
222
+ },
223
+ {
224
+ "cell_type": "code",
225
+ "execution_count": null,
226
+ "metadata": {
227
+ "id": "Uz3IzNx6VSoX"
228
+ },
229
+ "outputs": [],
230
+ "source": [
231
+ "class BERTClassifier(nn.Module):\n",
232
+ " def __init__(self, bert_model_name, num_classes):\n",
233
+ " super(BERTClassifier, self).__init__()\n",
234
+ " self.bert = BertModel.from_pretrained(bert_model_name)\n",
235
+ " self.dropout = nn.Dropout(0.1)\n",
236
+ " self.fc = nn.Linear(self.bert.config.hidden_size, num_classes)\n",
237
+ "\n",
238
+ " def forward(self, input_ids, attention_mask):\n",
239
+ " outputs = self.bert(input_ids=input_ids, attention_mask=attention_mask)\n",
240
+ " pooled_output = outputs.pooler_output\n",
241
+ " x = self.dropout(pooled_output)\n",
242
+ " logits = self.fc(x)\n",
243
+ " return logits"
244
+ ]
245
+ },
246
+ {
247
+ "cell_type": "code",
248
+ "execution_count": null,
249
+ "metadata": {
250
+ "id": "JoI_Ya8RVVBO"
251
+ },
252
+ "outputs": [],
253
+ "source": [
254
+ "def train(model, data_loader, optimizer, scheduler, device):\n",
255
+ " model.train()\n",
256
+ " for batch in data_loader:\n",
257
+ " optimizer.zero_grad()\n",
258
+ " input_ids = batch['input_ids'].to(device)\n",
259
+ " attention_mask = batch['attention_mask'].to(device)\n",
260
+ " labels = batch['label'].to(device)\n",
261
+ " outputs = model(input_ids=input_ids, attention_mask=attention_mask)\n",
262
+ " loss = nn.CrossEntropyLoss()(outputs, labels)\n",
263
+ " loss.backward()\n",
264
+ " optimizer.step()\n",
265
+ " scheduler.step()"
266
+ ]
267
+ },
268
+ {
269
+ "cell_type": "code",
270
+ "execution_count": null,
271
+ "metadata": {
272
+ "id": "E9nHv8IsVXJw"
273
+ },
274
+ "outputs": [],
275
+ "source": [
276
+ "def evaluate(model, data_loader, device):\n",
277
+ " model.eval()\n",
278
+ " predictions = []\n",
279
+ " actual_labels = []\n",
280
+ " with torch.no_grad():\n",
281
+ " for batch in data_loader:\n",
282
+ " input_ids = batch['input_ids'].to(device)\n",
283
+ " attention_mask = batch['attention_mask'].to(device)\n",
284
+ " labels = batch['label'].to(device)\n",
285
+ " outputs = model(input_ids=input_ids, attention_mask=attention_mask)\n",
286
+ " _, preds = torch.max(outputs, dim=1)\n",
287
+ " predictions.extend(preds.cpu().tolist())\n",
288
+ " actual_labels.extend(labels.cpu().tolist())\n",
289
+ " return accuracy_score(actual_labels, predictions), classification_report(actual_labels, predictions)"
290
+ ]
291
+ },
292
+ {
293
+ "cell_type": "code",
294
+ "execution_count": null,
295
+ "metadata": {
296
+ "id": "kbrYHrYtVX5o"
297
+ },
298
+ "outputs": [],
299
+ "source": [
300
+ "def predict_sentiments(texts, model, tokenizer, device, max_length=128):\n",
301
+ " model.eval()\n",
302
+ " all_predictions = []\n",
303
+ "\n",
304
+ " with torch.no_grad():\n",
305
+ " for text in texts:\n",
306
+ " encoding = tokenizer(text, return_tensors='pt', max_length=max_length, padding='max_length', truncation=True)\n",
307
+ " input_ids = encoding['input_ids'].to(device)\n",
308
+ " attention_mask = encoding['attention_mask'].to(device)\n",
309
+ "\n",
310
+ " outputs = model(input_ids=input_ids, attention_mask=attention_mask)\n",
311
+ " _, preds = torch.max(outputs, dim=1) # Assuming logits is the output of your model\n",
312
+ " label = preds.item()\n",
313
+ "\n",
314
+ " all_predictions.append(label)\n",
315
+ "\n",
316
+ " positive_percentage = (sum(1 for label in all_predictions if label == 2) / len(all_predictions)) * 100\n",
317
+ " neutral_percentage = (sum(1 for label in all_predictions if label == 1) / len(all_predictions)) * 100\n",
318
+ " negative_percentage = (sum(1 for label in all_predictions if label == 0) / len(all_predictions)) * 100\n",
319
+ "\n",
320
+ " return positive_percentage, neutral_percentage, negative_percentage"
321
+ ]
322
+ },
323
+ {
324
+ "cell_type": "code",
325
+ "execution_count": null,
326
+ "metadata": {
327
+ "id": "in1DCI9BVaEJ"
328
+ },
329
+ "outputs": [],
330
+ "source": [
331
+ "# Set up parameters\n",
332
+ "bert_model_name = 'bert-base-uncased'\n",
333
+ "num_classes = 3\n",
334
+ "max_length = 128\n",
335
+ "batch_size = 16\n",
336
+ "num_epochs = 1\n",
337
+ "learning_rate = 2e-5"
338
+ ]
339
+ },
340
+ {
341
+ "cell_type": "code",
342
+ "execution_count": null,
343
+ "metadata": {
344
+ "id": "wAPXY-B5VdUQ"
345
+ },
346
+ "outputs": [],
347
+ "source": [
348
+ "train_texts, val_texts, train_labels, val_labels = train_test_split(texts, labels, test_size=0.2, random_state=42)"
349
+ ]
350
+ },
351
+ {
352
+ "cell_type": "code",
353
+ "execution_count": null,
354
+ "metadata": {
355
+ "colab": {
356
+ "base_uri": "https://localhost:8080/"
357
+ },
358
+ "id": "qNrconhaVjLw",
359
+ "outputId": "12d7a846-542b-42dc-8f7e-3bfae9c2a66c"
360
+ },
361
+ "outputs": [
362
+ {
363
+ "output_type": "execute_result",
364
+ "data": {
365
+ "text/plain": [
366
+ "[0, 2, 1, 1, 0, 2, 2, 1, 0]"
367
+ ]
368
+ },
369
+ "metadata": {},
370
+ "execution_count": 34
371
+ }
372
+ ],
373
+ "source": [
374
+ "random.sample(train_labels,9)"
375
+ ]
376
+ },
377
+ {
378
+ "cell_type": "code",
379
+ "execution_count": null,
380
+ "metadata": {
381
+ "id": "1mxmBNGbVf8L"
382
+ },
383
+ "outputs": [],
384
+ "source": [
385
+ "# Specify a cache directory for the tokenizer\n",
386
+ "tokenizer = BertTokenizer.from_pretrained(bert_model_name, cache_dir=\"/path/to/cache/directory\")\n",
387
+ "\n",
388
+ "# Rest of your code remains the same\n",
389
+ "train_dataset = TextClassificationDataset(train_texts, train_labels, tokenizer, max_length)\n",
390
+ "val_dataset = TextClassificationDataset(val_texts, val_labels, tokenizer, max_length)\n",
391
+ "train_dataloader = DataLoader(train_dataset, batch_size=batch_size, shuffle=True)\n",
392
+ "val_dataloader = DataLoader(val_dataset, batch_size=batch_size)\n"
393
+ ]
394
+ },
395
+ {
396
+ "cell_type": "code",
397
+ "execution_count": null,
398
+ "metadata": {
399
+ "id": "EM8AiMHnVnlh"
400
+ },
401
+ "outputs": [],
402
+ "source": [
403
+ "device = torch.device(\"cuda\" if torch.cuda.is_available() else \"cpu\")\n",
404
+ "model = BERTClassifier(bert_model_name, num_classes).to(device)"
405
+ ]
406
+ },
407
+ {
408
+ "cell_type": "code",
409
+ "execution_count": null,
410
+ "metadata": {
411
+ "colab": {
412
+ "base_uri": "https://localhost:8080/"
413
+ },
414
+ "id": "XHukmDqSVo0c",
415
+ "outputId": "cf8ca79c-9e3a-44c2-ca87-9be30b1ca42c"
416
+ },
417
+ "outputs": [
418
+ {
419
+ "output_type": "stream",
420
+ "name": "stderr",
421
+ "text": [
422
+ "/usr/local/lib/python3.10/dist-packages/transformers/optimization.py:411: FutureWarning: This implementation of AdamW is deprecated and will be removed in a future version. Use the PyTorch implementation torch.optim.AdamW instead, or set `no_deprecation_warning=True` to disable this warning\n",
423
+ " warnings.warn(\n"
424
+ ]
425
+ }
426
+ ],
427
+ "source": [
428
+ "optimizer = AdamW(model.parameters(), lr=learning_rate)\n",
429
+ "total_steps = len(train_dataloader) * num_epochs\n",
430
+ "scheduler = get_linear_schedule_with_warmup(optimizer, num_warmup_steps=0, num_training_steps=total_steps)"
431
+ ]
432
+ },
433
+ {
434
+ "cell_type": "code",
435
+ "execution_count": null,
436
+ "metadata": {
437
+ "colab": {
438
+ "base_uri": "https://localhost:8080/"
439
+ },
440
+ "id": "oDz6E1voVrlZ",
441
+ "outputId": "16c3d9b0-1982-482f-9739-c2b81b95e420"
442
+ },
443
+ "outputs": [
444
+ {
445
+ "output_type": "stream",
446
+ "name": "stdout",
447
+ "text": [
448
+ "Epoch 1/1\n",
449
+ "Validation Accuracy: 0.7180\n",
450
+ " precision recall f1-score support\n",
451
+ "\n",
452
+ " 0 0.61 0.55 0.58 465\n",
453
+ " 1 0.74 0.74 0.74 650\n",
454
+ " 2 0.76 0.78 0.77 885\n",
455
+ "\n",
456
+ " accuracy 0.72 2000\n",
457
+ " macro avg 0.70 0.69 0.70 2000\n",
458
+ "weighted avg 0.72 0.72 0.72 2000\n",
459
+ "\n"
460
+ ]
461
+ }
462
+ ],
463
+ "source": [
464
+ "for epoch in range(num_epochs):\n",
465
+ " print(f\"Epoch {epoch + 1}/{num_epochs}\")\n",
466
+ " train(model, train_dataloader, optimizer, scheduler, device)\n",
467
+ " accuracy, report = evaluate(model, val_dataloader, device)\n",
468
+ " print(f\"Validation Accuracy: {accuracy:.4f}\")\n",
469
+ " print(report)"
470
+ ]
471
+ },
472
+ {
473
+ "cell_type": "code",
474
+ "execution_count": null,
475
+ "metadata": {
476
+ "id": "u78uMbu2VslK"
477
+ },
478
+ "outputs": [],
479
+ "source": [
480
+ "torch.save(model.state_dict(), \"bert_classifier_three_labeled.pth\")"
481
+ ]
482
+ },
483
+ {
484
+ "cell_type": "code",
485
+ "source": [
486
+ "\n"
487
+ ],
488
+ "metadata": {
489
+ "id": "YQK0UZRdElRa"
490
+ },
491
+ "execution_count": null,
492
+ "outputs": []
493
+ },
494
+ {
495
+ "cell_type": "code",
496
+ "execution_count": null,
497
+ "metadata": {
498
+ "colab": {
499
+ "base_uri": "https://localhost:8080/"
500
+ },
501
+ "id": "uXZNj4pMVus0",
502
+ "outputId": "91bbb8fc-b29f-4bb3-ec83-686565deb849"
503
+ },
504
+ "outputs": [
505
+ {
506
+ "output_type": "stream",
507
+ "name": "stdout",
508
+ "text": [
509
+ "Positive Percentage: 40.00%\n",
510
+ "Neutral Percentage: 60.00%\n",
511
+ "Negative Percentage: 0.00%\n"
512
+ ]
513
+ }
514
+ ],
515
+ "source": [
516
+ "test_texts = [\n",
517
+ " \"PM Modi's unwavering dedication to economic development and his efforts to uplift the marginalized communities are truly commendable.\",\n",
518
+ " \"I'm not sure how I feel about this.\",\n",
519
+ " \"This is a negative statement about the situation.\",\n",
520
+ " \"Feeling positive about the upcoming event!\",\n",
521
+ " \"Neutral statement to test the model.\"\n",
522
+ "]\n",
523
+ "\n",
524
+ "positive_percent, neutral_percent, negative_percent = predict_sentiments(test_texts, model, tokenizer, device)\n",
525
+ "print(f\"Positive Percentage: {positive_percent:.2f}%\")\n",
526
+ "print(f\"Neutral Percentage: {neutral_percent:.2f}%\")\n",
527
+ "print(f\"Negative Percentage: {negative_percent:.2f}%\")"
528
+ ]
529
+ },
530
+ {
531
+ "cell_type": "code",
532
+ "source": [
533
+ "import joblib\n",
534
+ "from transformers import BertForSequenceClassification, BertTokenizer\n",
535
+ "\n",
536
+ "# Example: Load or initialize your BERT model\n",
537
+ "model = BertForSequenceClassification.from_pretrained('bert-base-uncased')\n",
538
+ "tokenizer = BertTokenizer.from_pretrained('bert-base-uncased')\n",
539
+ "\n",
540
+ "# Example: Train your BERT model (replace this with your actual training code)\n",
541
+ "\n",
542
+ "# Save the model and tokenizer using joblib\n",
543
+ "joblib.dump(model, 'bert_classifier_model.pkl')\n",
544
+ "joblib.dump(tokenizer, 'bert_classifier_tokenizer.pkl')\n"
545
+ ],
546
+ "metadata": {
547
+ "id": "Dene5QabGch6",
548
+ "outputId": "19708822-836f-46fa-8976-137274b33217",
549
+ "colab": {
550
+ "base_uri": "https://localhost:8080/",
551
+ "height": 185,
552
+ "referenced_widgets": [
553
+ "d9a25586dd834e42b99b5c274cd0935d",
554
+ "0303b03e9cab4a8b9ba2dddd87a4facd",
555
+ "e0b75fa139a64528ae9bc55fc06bc5ea",
556
+ "8cf0ca3cf5bd4b60b7a04f4118159fe2",
557
+ "cf9746188523473fa0dc39301e282340",
558
+ "d6906e77d9b14d278784e9cd9c3a6cf6",
559
+ "d043e4555bb849fc9f3c92da52603eda",
560
+ "563365543d6e4bbc9c28bf5bb4133790",
561
+ "f61ad0ff939d415e93e3d39e3e0097fb",
562
+ "0c7866fccea940f4b315d39520ca474f",
563
+ "893498ae4ec648b394d3784795432def",
564
+ "f671208d412746fe80ea07026ee3bc00",
565
+ "c95faa4e2a0343dc82194553d77bcd58",
566
+ "b74261eb3702403b854c587ea5911677",
567
+ "03260f0e829049d3bb5e56d4dbe46ad9",
568
+ "453838b6f94248bcba56a6f6c7000a2c",
569
+ "c160773d7d664ff4957cadefe7817980",
570
+ "92c2deca172940418a0451ef81b753e3",
571
+ "d7699394ab574c6d9375a413962dbbc6",
572
+ "23b9ac612d294d91b100b2520c824d9d",
573
+ "3614df9bd02548f09d9da169693a0373",
574
+ "b022cc0f17c54c5aaf8e9e0722a627b3",
575
+ "571644d3b69e416295335a4e0d71c846",
576
+ "9dbf2ecb4e41422d8e8647d55bfcaeb7",
577
+ "704509f29b4440b2a26f89810cbd0f93",
578
+ "7c9e12515b8c48578abe0870b99aa6c4",
579
+ "1d77c5ff1fb0427bbfa4d74d630b3440",
580
+ "8c27fdca2d954ac0b3bff48c4a21c9f4",
581
+ "e1af2c93d89c42b6af4f71c6221edaa2",
582
+ "50a2bc1e58b34de39493fcc99d7906d8",
583
+ "bc7ceea7d04e4511af7c923b4380702e",
584
+ "2c248b5e372e4eeca557dcfbca329c2f",
585
+ "d563e6343b564accb9c972bf6a573d74"
586
+ ]
587
+ }
588
+ },
589
+ "execution_count": null,
590
+ "outputs": [
591
+ {
592
+ "output_type": "stream",
593
+ "name": "stderr",
594
+ "text": [
595
+ "Some weights of BertForSequenceClassification were not initialized from the model checkpoint at bert-base-uncased and are newly initialized: ['classifier.weight', 'classifier.bias']\n",
596
+ "You should probably TRAIN this model on a down-stream task to be able to use it for predictions and inference.\n"
597
+ ]
598
+ },
599
+ {
600
+ "output_type": "display_data",
601
+ "data": {
602
+ "text/plain": [
603
+ "tokenizer_config.json: 0%| | 0.00/28.0 [00:00<?, ?B/s]"
604
+ ],
605
+ "application/vnd.jupyter.widget-view+json": {
606
+ "version_major": 2,
607
+ "version_minor": 0,
608
+ "model_id": "d9a25586dd834e42b99b5c274cd0935d"
609
+ }
610
+ },
611
+ "metadata": {}
612
+ },
613
+ {
614
+ "output_type": "display_data",
615
+ "data": {
616
+ "text/plain": [
617
+ "vocab.txt: 0%| | 0.00/232k [00:00<?, ?B/s]"
618
+ ],
619
+ "application/vnd.jupyter.widget-view+json": {
620
+ "version_major": 2,
621
+ "version_minor": 0,
622
+ "model_id": "f671208d412746fe80ea07026ee3bc00"
623
+ }
624
+ },
625
+ "metadata": {}
626
+ },
627
+ {
628
+ "output_type": "display_data",
629
+ "data": {
630
+ "text/plain": [
631
+ "tokenizer.json: 0%| | 0.00/466k [00:00<?, ?B/s]"
632
+ ],
633
+ "application/vnd.jupyter.widget-view+json": {
634
+ "version_major": 2,
635
+ "version_minor": 0,
636
+ "model_id": "571644d3b69e416295335a4e0d71c846"
637
+ }
638
+ },
639
+ "metadata": {}
640
+ },
641
+ {
642
+ "output_type": "execute_result",
643
+ "data": {
644
+ "text/plain": [
645
+ "['bert_classifier_tokenizer.pkl']"
646
+ ]
647
+ },
648
+ "metadata": {},
649
+ "execution_count": 42
650
+ }
651
+ ]
652
+ }
653
+ ],
654
+ "metadata": {
655
+ "colab": {
656
+ "provenance": [],
657
+ "gpuType": "T4"
658
+ },
659
+ "kernelspec": {
660
+ "display_name": "Python 3",
661
+ "name": "python3"
662
+ },
663
+ "language_info": {
664
+ "name": "python"
665
+ },
666
+ "widgets": {
667
+ "application/vnd.jupyter.widget-state+json": {
668
+ "d9a25586dd834e42b99b5c274cd0935d": {
669
+ "model_module": "@jupyter-widgets/controls",
670
+ "model_name": "HBoxModel",
671
+ "model_module_version": "1.5.0",
672
+ "state": {
673
+ "_dom_classes": [],
674
+ "_model_module": "@jupyter-widgets/controls",
675
+ "_model_module_version": "1.5.0",
676
+ "_model_name": "HBoxModel",
677
+ "_view_count": null,
678
+ "_view_module": "@jupyter-widgets/controls",
679
+ "_view_module_version": "1.5.0",
680
+ "_view_name": "HBoxView",
681
+ "box_style": "",
682
+ "children": [
683
+ "IPY_MODEL_0303b03e9cab4a8b9ba2dddd87a4facd",
684
+ "IPY_MODEL_e0b75fa139a64528ae9bc55fc06bc5ea",
685
+ "IPY_MODEL_8cf0ca3cf5bd4b60b7a04f4118159fe2"
686
+ ],
687
+ "layout": "IPY_MODEL_cf9746188523473fa0dc39301e282340"
688
+ }
689
+ },
690
+ "0303b03e9cab4a8b9ba2dddd87a4facd": {
691
+ "model_module": "@jupyter-widgets/controls",
692
+ "model_name": "HTMLModel",
693
+ "model_module_version": "1.5.0",
694
+ "state": {
695
+ "_dom_classes": [],
696
+ "_model_module": "@jupyter-widgets/controls",
697
+ "_model_module_version": "1.5.0",
698
+ "_model_name": "HTMLModel",
699
+ "_view_count": null,
700
+ "_view_module": "@jupyter-widgets/controls",
701
+ "_view_module_version": "1.5.0",
702
+ "_view_name": "HTMLView",
703
+ "description": "",
704
+ "description_tooltip": null,
705
+ "layout": "IPY_MODEL_d6906e77d9b14d278784e9cd9c3a6cf6",
706
+ "placeholder": "​",
707
+ "style": "IPY_MODEL_d043e4555bb849fc9f3c92da52603eda",
708
+ "value": "tokenizer_config.json: 100%"
709
+ }
710
+ },
711
+ "e0b75fa139a64528ae9bc55fc06bc5ea": {
712
+ "model_module": "@jupyter-widgets/controls",
713
+ "model_name": "FloatProgressModel",
714
+ "model_module_version": "1.5.0",
715
+ "state": {
716
+ "_dom_classes": [],
717
+ "_model_module": "@jupyter-widgets/controls",
718
+ "_model_module_version": "1.5.0",
719
+ "_model_name": "FloatProgressModel",
720
+ "_view_count": null,
721
+ "_view_module": "@jupyter-widgets/controls",
722
+ "_view_module_version": "1.5.0",
723
+ "_view_name": "ProgressView",
724
+ "bar_style": "success",
725
+ "description": "",
726
+ "description_tooltip": null,
727
+ "layout": "IPY_MODEL_563365543d6e4bbc9c28bf5bb4133790",
728
+ "max": 28,
729
+ "min": 0,
730
+ "orientation": "horizontal",
731
+ "style": "IPY_MODEL_f61ad0ff939d415e93e3d39e3e0097fb",
732
+ "value": 28
733
+ }
734
+ },
735
+ "8cf0ca3cf5bd4b60b7a04f4118159fe2": {
736
+ "model_module": "@jupyter-widgets/controls",
737
+ "model_name": "HTMLModel",
738
+ "model_module_version": "1.5.0",
739
+ "state": {
740
+ "_dom_classes": [],
741
+ "_model_module": "@jupyter-widgets/controls",
742
+ "_model_module_version": "1.5.0",
743
+ "_model_name": "HTMLModel",
744
+ "_view_count": null,
745
+ "_view_module": "@jupyter-widgets/controls",
746
+ "_view_module_version": "1.5.0",
747
+ "_view_name": "HTMLView",
748
+ "description": "",
749
+ "description_tooltip": null,
750
+ "layout": "IPY_MODEL_0c7866fccea940f4b315d39520ca474f",
751
+ "placeholder": "​",
752
+ "style": "IPY_MODEL_893498ae4ec648b394d3784795432def",
753
+ "value": " 28.0/28.0 [00:00&lt;00:00, 379B/s]"
754
+ }
755
+ },
756
+ "cf9746188523473fa0dc39301e282340": {
757
+ "model_module": "@jupyter-widgets/base",
758
+ "model_name": "LayoutModel",
759
+ "model_module_version": "1.2.0",
760
+ "state": {
761
+ "_model_module": "@jupyter-widgets/base",
762
+ "_model_module_version": "1.2.0",
763
+ "_model_name": "LayoutModel",
764
+ "_view_count": null,
765
+ "_view_module": "@jupyter-widgets/base",
766
+ "_view_module_version": "1.2.0",
767
+ "_view_name": "LayoutView",
768
+ "align_content": null,
769
+ "align_items": null,
770
+ "align_self": null,
771
+ "border": null,
772
+ "bottom": null,
773
+ "display": null,
774
+ "flex": null,
775
+ "flex_flow": null,
776
+ "grid_area": null,
777
+ "grid_auto_columns": null,
778
+ "grid_auto_flow": null,
779
+ "grid_auto_rows": null,
780
+ "grid_column": null,
781
+ "grid_gap": null,
782
+ "grid_row": null,
783
+ "grid_template_areas": null,
784
+ "grid_template_columns": null,
785
+ "grid_template_rows": null,
786
+ "height": null,
787
+ "justify_content": null,
788
+ "justify_items": null,
789
+ "left": null,
790
+ "margin": null,
791
+ "max_height": null,
792
+ "max_width": null,
793
+ "min_height": null,
794
+ "min_width": null,
795
+ "object_fit": null,
796
+ "object_position": null,
797
+ "order": null,
798
+ "overflow": null,
799
+ "overflow_x": null,
800
+ "overflow_y": null,
801
+ "padding": null,
802
+ "right": null,
803
+ "top": null,
804
+ "visibility": null,
805
+ "width": null
806
+ }
807
+ },
808
+ "d6906e77d9b14d278784e9cd9c3a6cf6": {
809
+ "model_module": "@jupyter-widgets/base",
810
+ "model_name": "LayoutModel",
811
+ "model_module_version": "1.2.0",
812
+ "state": {
813
+ "_model_module": "@jupyter-widgets/base",
814
+ "_model_module_version": "1.2.0",
815
+ "_model_name": "LayoutModel",
816
+ "_view_count": null,
817
+ "_view_module": "@jupyter-widgets/base",
818
+ "_view_module_version": "1.2.0",
819
+ "_view_name": "LayoutView",
820
+ "align_content": null,
821
+ "align_items": null,
822
+ "align_self": null,
823
+ "border": null,
824
+ "bottom": null,
825
+ "display": null,
826
+ "flex": null,
827
+ "flex_flow": null,
828
+ "grid_area": null,
829
+ "grid_auto_columns": null,
830
+ "grid_auto_flow": null,
831
+ "grid_auto_rows": null,
832
+ "grid_column": null,
833
+ "grid_gap": null,
834
+ "grid_row": null,
835
+ "grid_template_areas": null,
836
+ "grid_template_columns": null,
837
+ "grid_template_rows": null,
838
+ "height": null,
839
+ "justify_content": null,
840
+ "justify_items": null,
841
+ "left": null,
842
+ "margin": null,
843
+ "max_height": null,
844
+ "max_width": null,
845
+ "min_height": null,
846
+ "min_width": null,
847
+ "object_fit": null,
848
+ "object_position": null,
849
+ "order": null,
850
+ "overflow": null,
851
+ "overflow_x": null,
852
+ "overflow_y": null,
853
+ "padding": null,
854
+ "right": null,
855
+ "top": null,
856
+ "visibility": null,
857
+ "width": null
858
+ }
859
+ },
860
+ "d043e4555bb849fc9f3c92da52603eda": {
861
+ "model_module": "@jupyter-widgets/controls",
862
+ "model_name": "DescriptionStyleModel",
863
+ "model_module_version": "1.5.0",
864
+ "state": {
865
+ "_model_module": "@jupyter-widgets/controls",
866
+ "_model_module_version": "1.5.0",
867
+ "_model_name": "DescriptionStyleModel",
868
+ "_view_count": null,
869
+ "_view_module": "@jupyter-widgets/base",
870
+ "_view_module_version": "1.2.0",
871
+ "_view_name": "StyleView",
872
+ "description_width": ""
873
+ }
874
+ },
875
+ "563365543d6e4bbc9c28bf5bb4133790": {
876
+ "model_module": "@jupyter-widgets/base",
877
+ "model_name": "LayoutModel",
878
+ "model_module_version": "1.2.0",
879
+ "state": {
880
+ "_model_module": "@jupyter-widgets/base",
881
+ "_model_module_version": "1.2.0",
882
+ "_model_name": "LayoutModel",
883
+ "_view_count": null,
884
+ "_view_module": "@jupyter-widgets/base",
885
+ "_view_module_version": "1.2.0",
886
+ "_view_name": "LayoutView",
887
+ "align_content": null,
888
+ "align_items": null,
889
+ "align_self": null,
890
+ "border": null,
891
+ "bottom": null,
892
+ "display": null,
893
+ "flex": null,
894
+ "flex_flow": null,
895
+ "grid_area": null,
896
+ "grid_auto_columns": null,
897
+ "grid_auto_flow": null,
898
+ "grid_auto_rows": null,
899
+ "grid_column": null,
900
+ "grid_gap": null,
901
+ "grid_row": null,
902
+ "grid_template_areas": null,
903
+ "grid_template_columns": null,
904
+ "grid_template_rows": null,
905
+ "height": null,
906
+ "justify_content": null,
907
+ "justify_items": null,
908
+ "left": null,
909
+ "margin": null,
910
+ "max_height": null,
911
+ "max_width": null,
912
+ "min_height": null,
913
+ "min_width": null,
914
+ "object_fit": null,
915
+ "object_position": null,
916
+ "order": null,
917
+ "overflow": null,
918
+ "overflow_x": null,
919
+ "overflow_y": null,
920
+ "padding": null,
921
+ "right": null,
922
+ "top": null,
923
+ "visibility": null,
924
+ "width": null
925
+ }
926
+ },
927
+ "f61ad0ff939d415e93e3d39e3e0097fb": {
928
+ "model_module": "@jupyter-widgets/controls",
929
+ "model_name": "ProgressStyleModel",
930
+ "model_module_version": "1.5.0",
931
+ "state": {
932
+ "_model_module": "@jupyter-widgets/controls",
933
+ "_model_module_version": "1.5.0",
934
+ "_model_name": "ProgressStyleModel",
935
+ "_view_count": null,
936
+ "_view_module": "@jupyter-widgets/base",
937
+ "_view_module_version": "1.2.0",
938
+ "_view_name": "StyleView",
939
+ "bar_color": null,
940
+ "description_width": ""
941
+ }
942
+ },
943
+ "0c7866fccea940f4b315d39520ca474f": {
944
+ "model_module": "@jupyter-widgets/base",
945
+ "model_name": "LayoutModel",
946
+ "model_module_version": "1.2.0",
947
+ "state": {
948
+ "_model_module": "@jupyter-widgets/base",
949
+ "_model_module_version": "1.2.0",
950
+ "_model_name": "LayoutModel",
951
+ "_view_count": null,
952
+ "_view_module": "@jupyter-widgets/base",
953
+ "_view_module_version": "1.2.0",
954
+ "_view_name": "LayoutView",
955
+ "align_content": null,
956
+ "align_items": null,
957
+ "align_self": null,
958
+ "border": null,
959
+ "bottom": null,
960
+ "display": null,
961
+ "flex": null,
962
+ "flex_flow": null,
963
+ "grid_area": null,
964
+ "grid_auto_columns": null,
965
+ "grid_auto_flow": null,
966
+ "grid_auto_rows": null,
967
+ "grid_column": null,
968
+ "grid_gap": null,
969
+ "grid_row": null,
970
+ "grid_template_areas": null,
971
+ "grid_template_columns": null,
972
+ "grid_template_rows": null,
973
+ "height": null,
974
+ "justify_content": null,
975
+ "justify_items": null,
976
+ "left": null,
977
+ "margin": null,
978
+ "max_height": null,
979
+ "max_width": null,
980
+ "min_height": null,
981
+ "min_width": null,
982
+ "object_fit": null,
983
+ "object_position": null,
984
+ "order": null,
985
+ "overflow": null,
986
+ "overflow_x": null,
987
+ "overflow_y": null,
988
+ "padding": null,
989
+ "right": null,
990
+ "top": null,
991
+ "visibility": null,
992
+ "width": null
993
+ }
994
+ },
995
+ "893498ae4ec648b394d3784795432def": {
996
+ "model_module": "@jupyter-widgets/controls",
997
+ "model_name": "DescriptionStyleModel",
998
+ "model_module_version": "1.5.0",
999
+ "state": {
1000
+ "_model_module": "@jupyter-widgets/controls",
1001
+ "_model_module_version": "1.5.0",
1002
+ "_model_name": "DescriptionStyleModel",
1003
+ "_view_count": null,
1004
+ "_view_module": "@jupyter-widgets/base",
1005
+ "_view_module_version": "1.2.0",
1006
+ "_view_name": "StyleView",
1007
+ "description_width": ""
1008
+ }
1009
+ },
1010
+ "f671208d412746fe80ea07026ee3bc00": {
1011
+ "model_module": "@jupyter-widgets/controls",
1012
+ "model_name": "HBoxModel",
1013
+ "model_module_version": "1.5.0",
1014
+ "state": {
1015
+ "_dom_classes": [],
1016
+ "_model_module": "@jupyter-widgets/controls",
1017
+ "_model_module_version": "1.5.0",
1018
+ "_model_name": "HBoxModel",
1019
+ "_view_count": null,
1020
+ "_view_module": "@jupyter-widgets/controls",
1021
+ "_view_module_version": "1.5.0",
1022
+ "_view_name": "HBoxView",
1023
+ "box_style": "",
1024
+ "children": [
1025
+ "IPY_MODEL_c95faa4e2a0343dc82194553d77bcd58",
1026
+ "IPY_MODEL_b74261eb3702403b854c587ea5911677",
1027
+ "IPY_MODEL_03260f0e829049d3bb5e56d4dbe46ad9"
1028
+ ],
1029
+ "layout": "IPY_MODEL_453838b6f94248bcba56a6f6c7000a2c"
1030
+ }
1031
+ },
1032
+ "c95faa4e2a0343dc82194553d77bcd58": {
1033
+ "model_module": "@jupyter-widgets/controls",
1034
+ "model_name": "HTMLModel",
1035
+ "model_module_version": "1.5.0",
1036
+ "state": {
1037
+ "_dom_classes": [],
1038
+ "_model_module": "@jupyter-widgets/controls",
1039
+ "_model_module_version": "1.5.0",
1040
+ "_model_name": "HTMLModel",
1041
+ "_view_count": null,
1042
+ "_view_module": "@jupyter-widgets/controls",
1043
+ "_view_module_version": "1.5.0",
1044
+ "_view_name": "HTMLView",
1045
+ "description": "",
1046
+ "description_tooltip": null,
1047
+ "layout": "IPY_MODEL_c160773d7d664ff4957cadefe7817980",
1048
+ "placeholder": "​",
1049
+ "style": "IPY_MODEL_92c2deca172940418a0451ef81b753e3",
1050
+ "value": "vocab.txt: 100%"
1051
+ }
1052
+ },
1053
+ "b74261eb3702403b854c587ea5911677": {
1054
+ "model_module": "@jupyter-widgets/controls",
1055
+ "model_name": "FloatProgressModel",
1056
+ "model_module_version": "1.5.0",
1057
+ "state": {
1058
+ "_dom_classes": [],
1059
+ "_model_module": "@jupyter-widgets/controls",
1060
+ "_model_module_version": "1.5.0",
1061
+ "_model_name": "FloatProgressModel",
1062
+ "_view_count": null,
1063
+ "_view_module": "@jupyter-widgets/controls",
1064
+ "_view_module_version": "1.5.0",
1065
+ "_view_name": "ProgressView",
1066
+ "bar_style": "success",
1067
+ "description": "",
1068
+ "description_tooltip": null,
1069
+ "layout": "IPY_MODEL_d7699394ab574c6d9375a413962dbbc6",
1070
+ "max": 231508,
1071
+ "min": 0,
1072
+ "orientation": "horizontal",
1073
+ "style": "IPY_MODEL_23b9ac612d294d91b100b2520c824d9d",
1074
+ "value": 231508
1075
+ }
1076
+ },
1077
+ "03260f0e829049d3bb5e56d4dbe46ad9": {
1078
+ "model_module": "@jupyter-widgets/controls",
1079
+ "model_name": "HTMLModel",
1080
+ "model_module_version": "1.5.0",
1081
+ "state": {
1082
+ "_dom_classes": [],
1083
+ "_model_module": "@jupyter-widgets/controls",
1084
+ "_model_module_version": "1.5.0",
1085
+ "_model_name": "HTMLModel",
1086
+ "_view_count": null,
1087
+ "_view_module": "@jupyter-widgets/controls",
1088
+ "_view_module_version": "1.5.0",
1089
+ "_view_name": "HTMLView",
1090
+ "description": "",
1091
+ "description_tooltip": null,
1092
+ "layout": "IPY_MODEL_3614df9bd02548f09d9da169693a0373",
1093
+ "placeholder": "​",
1094
+ "style": "IPY_MODEL_b022cc0f17c54c5aaf8e9e0722a627b3",
1095
+ "value": " 232k/232k [00:00&lt;00:00, 2.40MB/s]"
1096
+ }
1097
+ },
1098
+ "453838b6f94248bcba56a6f6c7000a2c": {
1099
+ "model_module": "@jupyter-widgets/base",
1100
+ "model_name": "LayoutModel",
1101
+ "model_module_version": "1.2.0",
1102
+ "state": {
1103
+ "_model_module": "@jupyter-widgets/base",
1104
+ "_model_module_version": "1.2.0",
1105
+ "_model_name": "LayoutModel",
1106
+ "_view_count": null,
1107
+ "_view_module": "@jupyter-widgets/base",
1108
+ "_view_module_version": "1.2.0",
1109
+ "_view_name": "LayoutView",
1110
+ "align_content": null,
1111
+ "align_items": null,
1112
+ "align_self": null,
1113
+ "border": null,
1114
+ "bottom": null,
1115
+ "display": null,
1116
+ "flex": null,
1117
+ "flex_flow": null,
1118
+ "grid_area": null,
1119
+ "grid_auto_columns": null,
1120
+ "grid_auto_flow": null,
1121
+ "grid_auto_rows": null,
1122
+ "grid_column": null,
1123
+ "grid_gap": null,
1124
+ "grid_row": null,
1125
+ "grid_template_areas": null,
1126
+ "grid_template_columns": null,
1127
+ "grid_template_rows": null,
1128
+ "height": null,
1129
+ "justify_content": null,
1130
+ "justify_items": null,
1131
+ "left": null,
1132
+ "margin": null,
1133
+ "max_height": null,
1134
+ "max_width": null,
1135
+ "min_height": null,
1136
+ "min_width": null,
1137
+ "object_fit": null,
1138
+ "object_position": null,
1139
+ "order": null,
1140
+ "overflow": null,
1141
+ "overflow_x": null,
1142
+ "overflow_y": null,
1143
+ "padding": null,
1144
+ "right": null,
1145
+ "top": null,
1146
+ "visibility": null,
1147
+ "width": null
1148
+ }
1149
+ },
1150
+ "c160773d7d664ff4957cadefe7817980": {
1151
+ "model_module": "@jupyter-widgets/base",
1152
+ "model_name": "LayoutModel",
1153
+ "model_module_version": "1.2.0",
1154
+ "state": {
1155
+ "_model_module": "@jupyter-widgets/base",
1156
+ "_model_module_version": "1.2.0",
1157
+ "_model_name": "LayoutModel",
1158
+ "_view_count": null,
1159
+ "_view_module": "@jupyter-widgets/base",
1160
+ "_view_module_version": "1.2.0",
1161
+ "_view_name": "LayoutView",
1162
+ "align_content": null,
1163
+ "align_items": null,
1164
+ "align_self": null,
1165
+ "border": null,
1166
+ "bottom": null,
1167
+ "display": null,
1168
+ "flex": null,
1169
+ "flex_flow": null,
1170
+ "grid_area": null,
1171
+ "grid_auto_columns": null,
1172
+ "grid_auto_flow": null,
1173
+ "grid_auto_rows": null,
1174
+ "grid_column": null,
1175
+ "grid_gap": null,
1176
+ "grid_row": null,
1177
+ "grid_template_areas": null,
1178
+ "grid_template_columns": null,
1179
+ "grid_template_rows": null,
1180
+ "height": null,
1181
+ "justify_content": null,
1182
+ "justify_items": null,
1183
+ "left": null,
1184
+ "margin": null,
1185
+ "max_height": null,
1186
+ "max_width": null,
1187
+ "min_height": null,
1188
+ "min_width": null,
1189
+ "object_fit": null,
1190
+ "object_position": null,
1191
+ "order": null,
1192
+ "overflow": null,
1193
+ "overflow_x": null,
1194
+ "overflow_y": null,
1195
+ "padding": null,
1196
+ "right": null,
1197
+ "top": null,
1198
+ "visibility": null,
1199
+ "width": null
1200
+ }
1201
+ },
1202
+ "92c2deca172940418a0451ef81b753e3": {
1203
+ "model_module": "@jupyter-widgets/controls",
1204
+ "model_name": "DescriptionStyleModel",
1205
+ "model_module_version": "1.5.0",
1206
+ "state": {
1207
+ "_model_module": "@jupyter-widgets/controls",
1208
+ "_model_module_version": "1.5.0",
1209
+ "_model_name": "DescriptionStyleModel",
1210
+ "_view_count": null,
1211
+ "_view_module": "@jupyter-widgets/base",
1212
+ "_view_module_version": "1.2.0",
1213
+ "_view_name": "StyleView",
1214
+ "description_width": ""
1215
+ }
1216
+ },
1217
+ "d7699394ab574c6d9375a413962dbbc6": {
1218
+ "model_module": "@jupyter-widgets/base",
1219
+ "model_name": "LayoutModel",
1220
+ "model_module_version": "1.2.0",
1221
+ "state": {
1222
+ "_model_module": "@jupyter-widgets/base",
1223
+ "_model_module_version": "1.2.0",
1224
+ "_model_name": "LayoutModel",
1225
+ "_view_count": null,
1226
+ "_view_module": "@jupyter-widgets/base",
1227
+ "_view_module_version": "1.2.0",
1228
+ "_view_name": "LayoutView",
1229
+ "align_content": null,
1230
+ "align_items": null,
1231
+ "align_self": null,
1232
+ "border": null,
1233
+ "bottom": null,
1234
+ "display": null,
1235
+ "flex": null,
1236
+ "flex_flow": null,
1237
+ "grid_area": null,
1238
+ "grid_auto_columns": null,
1239
+ "grid_auto_flow": null,
1240
+ "grid_auto_rows": null,
1241
+ "grid_column": null,
1242
+ "grid_gap": null,
1243
+ "grid_row": null,
1244
+ "grid_template_areas": null,
1245
+ "grid_template_columns": null,
1246
+ "grid_template_rows": null,
1247
+ "height": null,
1248
+ "justify_content": null,
1249
+ "justify_items": null,
1250
+ "left": null,
1251
+ "margin": null,
1252
+ "max_height": null,
1253
+ "max_width": null,
1254
+ "min_height": null,
1255
+ "min_width": null,
1256
+ "object_fit": null,
1257
+ "object_position": null,
1258
+ "order": null,
1259
+ "overflow": null,
1260
+ "overflow_x": null,
1261
+ "overflow_y": null,
1262
+ "padding": null,
1263
+ "right": null,
1264
+ "top": null,
1265
+ "visibility": null,
1266
+ "width": null
1267
+ }
1268
+ },
1269
+ "23b9ac612d294d91b100b2520c824d9d": {
1270
+ "model_module": "@jupyter-widgets/controls",
1271
+ "model_name": "ProgressStyleModel",
1272
+ "model_module_version": "1.5.0",
1273
+ "state": {
1274
+ "_model_module": "@jupyter-widgets/controls",
1275
+ "_model_module_version": "1.5.0",
1276
+ "_model_name": "ProgressStyleModel",
1277
+ "_view_count": null,
1278
+ "_view_module": "@jupyter-widgets/base",
1279
+ "_view_module_version": "1.2.0",
1280
+ "_view_name": "StyleView",
1281
+ "bar_color": null,
1282
+ "description_width": ""
1283
+ }
1284
+ },
1285
+ "3614df9bd02548f09d9da169693a0373": {
1286
+ "model_module": "@jupyter-widgets/base",
1287
+ "model_name": "LayoutModel",
1288
+ "model_module_version": "1.2.0",
1289
+ "state": {
1290
+ "_model_module": "@jupyter-widgets/base",
1291
+ "_model_module_version": "1.2.0",
1292
+ "_model_name": "LayoutModel",
1293
+ "_view_count": null,
1294
+ "_view_module": "@jupyter-widgets/base",
1295
+ "_view_module_version": "1.2.0",
1296
+ "_view_name": "LayoutView",
1297
+ "align_content": null,
1298
+ "align_items": null,
1299
+ "align_self": null,
1300
+ "border": null,
1301
+ "bottom": null,
1302
+ "display": null,
1303
+ "flex": null,
1304
+ "flex_flow": null,
1305
+ "grid_area": null,
1306
+ "grid_auto_columns": null,
1307
+ "grid_auto_flow": null,
1308
+ "grid_auto_rows": null,
1309
+ "grid_column": null,
1310
+ "grid_gap": null,
1311
+ "grid_row": null,
1312
+ "grid_template_areas": null,
1313
+ "grid_template_columns": null,
1314
+ "grid_template_rows": null,
1315
+ "height": null,
1316
+ "justify_content": null,
1317
+ "justify_items": null,
1318
+ "left": null,
1319
+ "margin": null,
1320
+ "max_height": null,
1321
+ "max_width": null,
1322
+ "min_height": null,
1323
+ "min_width": null,
1324
+ "object_fit": null,
1325
+ "object_position": null,
1326
+ "order": null,
1327
+ "overflow": null,
1328
+ "overflow_x": null,
1329
+ "overflow_y": null,
1330
+ "padding": null,
1331
+ "right": null,
1332
+ "top": null,
1333
+ "visibility": null,
1334
+ "width": null
1335
+ }
1336
+ },
1337
+ "b022cc0f17c54c5aaf8e9e0722a627b3": {
1338
+ "model_module": "@jupyter-widgets/controls",
1339
+ "model_name": "DescriptionStyleModel",
1340
+ "model_module_version": "1.5.0",
1341
+ "state": {
1342
+ "_model_module": "@jupyter-widgets/controls",
1343
+ "_model_module_version": "1.5.0",
1344
+ "_model_name": "DescriptionStyleModel",
1345
+ "_view_count": null,
1346
+ "_view_module": "@jupyter-widgets/base",
1347
+ "_view_module_version": "1.2.0",
1348
+ "_view_name": "StyleView",
1349
+ "description_width": ""
1350
+ }
1351
+ },
1352
+ "571644d3b69e416295335a4e0d71c846": {
1353
+ "model_module": "@jupyter-widgets/controls",
1354
+ "model_name": "HBoxModel",
1355
+ "model_module_version": "1.5.0",
1356
+ "state": {
1357
+ "_dom_classes": [],
1358
+ "_model_module": "@jupyter-widgets/controls",
1359
+ "_model_module_version": "1.5.0",
1360
+ "_model_name": "HBoxModel",
1361
+ "_view_count": null,
1362
+ "_view_module": "@jupyter-widgets/controls",
1363
+ "_view_module_version": "1.5.0",
1364
+ "_view_name": "HBoxView",
1365
+ "box_style": "",
1366
+ "children": [
1367
+ "IPY_MODEL_9dbf2ecb4e41422d8e8647d55bfcaeb7",
1368
+ "IPY_MODEL_704509f29b4440b2a26f89810cbd0f93",
1369
+ "IPY_MODEL_7c9e12515b8c48578abe0870b99aa6c4"
1370
+ ],
1371
+ "layout": "IPY_MODEL_1d77c5ff1fb0427bbfa4d74d630b3440"
1372
+ }
1373
+ },
1374
+ "9dbf2ecb4e41422d8e8647d55bfcaeb7": {
1375
+ "model_module": "@jupyter-widgets/controls",
1376
+ "model_name": "HTMLModel",
1377
+ "model_module_version": "1.5.0",
1378
+ "state": {
1379
+ "_dom_classes": [],
1380
+ "_model_module": "@jupyter-widgets/controls",
1381
+ "_model_module_version": "1.5.0",
1382
+ "_model_name": "HTMLModel",
1383
+ "_view_count": null,
1384
+ "_view_module": "@jupyter-widgets/controls",
1385
+ "_view_module_version": "1.5.0",
1386
+ "_view_name": "HTMLView",
1387
+ "description": "",
1388
+ "description_tooltip": null,
1389
+ "layout": "IPY_MODEL_8c27fdca2d954ac0b3bff48c4a21c9f4",
1390
+ "placeholder": "​",
1391
+ "style": "IPY_MODEL_e1af2c93d89c42b6af4f71c6221edaa2",
1392
+ "value": "tokenizer.json: 100%"
1393
+ }
1394
+ },
1395
+ "704509f29b4440b2a26f89810cbd0f93": {
1396
+ "model_module": "@jupyter-widgets/controls",
1397
+ "model_name": "FloatProgressModel",
1398
+ "model_module_version": "1.5.0",
1399
+ "state": {
1400
+ "_dom_classes": [],
1401
+ "_model_module": "@jupyter-widgets/controls",
1402
+ "_model_module_version": "1.5.0",
1403
+ "_model_name": "FloatProgressModel",
1404
+ "_view_count": null,
1405
+ "_view_module": "@jupyter-widgets/controls",
1406
+ "_view_module_version": "1.5.0",
1407
+ "_view_name": "ProgressView",
1408
+ "bar_style": "success",
1409
+ "description": "",
1410
+ "description_tooltip": null,
1411
+ "layout": "IPY_MODEL_50a2bc1e58b34de39493fcc99d7906d8",
1412
+ "max": 466062,
1413
+ "min": 0,
1414
+ "orientation": "horizontal",
1415
+ "style": "IPY_MODEL_bc7ceea7d04e4511af7c923b4380702e",
1416
+ "value": 466062
1417
+ }
1418
+ },
1419
+ "7c9e12515b8c48578abe0870b99aa6c4": {
1420
+ "model_module": "@jupyter-widgets/controls",
1421
+ "model_name": "HTMLModel",
1422
+ "model_module_version": "1.5.0",
1423
+ "state": {
1424
+ "_dom_classes": [],
1425
+ "_model_module": "@jupyter-widgets/controls",
1426
+ "_model_module_version": "1.5.0",
1427
+ "_model_name": "HTMLModel",
1428
+ "_view_count": null,
1429
+ "_view_module": "@jupyter-widgets/controls",
1430
+ "_view_module_version": "1.5.0",
1431
+ "_view_name": "HTMLView",
1432
+ "description": "",
1433
+ "description_tooltip": null,
1434
+ "layout": "IPY_MODEL_2c248b5e372e4eeca557dcfbca329c2f",
1435
+ "placeholder": "​",
1436
+ "style": "IPY_MODEL_d563e6343b564accb9c972bf6a573d74",
1437
+ "value": " 466k/466k [00:00&lt;00:00, 1.79MB/s]"
1438
+ }
1439
+ },
1440
+ "1d77c5ff1fb0427bbfa4d74d630b3440": {
1441
+ "model_module": "@jupyter-widgets/base",
1442
+ "model_name": "LayoutModel",
1443
+ "model_module_version": "1.2.0",
1444
+ "state": {
1445
+ "_model_module": "@jupyter-widgets/base",
1446
+ "_model_module_version": "1.2.0",
1447
+ "_model_name": "LayoutModel",
1448
+ "_view_count": null,
1449
+ "_view_module": "@jupyter-widgets/base",
1450
+ "_view_module_version": "1.2.0",
1451
+ "_view_name": "LayoutView",
1452
+ "align_content": null,
1453
+ "align_items": null,
1454
+ "align_self": null,
1455
+ "border": null,
1456
+ "bottom": null,
1457
+ "display": null,
1458
+ "flex": null,
1459
+ "flex_flow": null,
1460
+ "grid_area": null,
1461
+ "grid_auto_columns": null,
1462
+ "grid_auto_flow": null,
1463
+ "grid_auto_rows": null,
1464
+ "grid_column": null,
1465
+ "grid_gap": null,
1466
+ "grid_row": null,
1467
+ "grid_template_areas": null,
1468
+ "grid_template_columns": null,
1469
+ "grid_template_rows": null,
1470
+ "height": null,
1471
+ "justify_content": null,
1472
+ "justify_items": null,
1473
+ "left": null,
1474
+ "margin": null,
1475
+ "max_height": null,
1476
+ "max_width": null,
1477
+ "min_height": null,
1478
+ "min_width": null,
1479
+ "object_fit": null,
1480
+ "object_position": null,
1481
+ "order": null,
1482
+ "overflow": null,
1483
+ "overflow_x": null,
1484
+ "overflow_y": null,
1485
+ "padding": null,
1486
+ "right": null,
1487
+ "top": null,
1488
+ "visibility": null,
1489
+ "width": null
1490
+ }
1491
+ },
1492
+ "8c27fdca2d954ac0b3bff48c4a21c9f4": {
1493
+ "model_module": "@jupyter-widgets/base",
1494
+ "model_name": "LayoutModel",
1495
+ "model_module_version": "1.2.0",
1496
+ "state": {
1497
+ "_model_module": "@jupyter-widgets/base",
1498
+ "_model_module_version": "1.2.0",
1499
+ "_model_name": "LayoutModel",
1500
+ "_view_count": null,
1501
+ "_view_module": "@jupyter-widgets/base",
1502
+ "_view_module_version": "1.2.0",
1503
+ "_view_name": "LayoutView",
1504
+ "align_content": null,
1505
+ "align_items": null,
1506
+ "align_self": null,
1507
+ "border": null,
1508
+ "bottom": null,
1509
+ "display": null,
1510
+ "flex": null,
1511
+ "flex_flow": null,
1512
+ "grid_area": null,
1513
+ "grid_auto_columns": null,
1514
+ "grid_auto_flow": null,
1515
+ "grid_auto_rows": null,
1516
+ "grid_column": null,
1517
+ "grid_gap": null,
1518
+ "grid_row": null,
1519
+ "grid_template_areas": null,
1520
+ "grid_template_columns": null,
1521
+ "grid_template_rows": null,
1522
+ "height": null,
1523
+ "justify_content": null,
1524
+ "justify_items": null,
1525
+ "left": null,
1526
+ "margin": null,
1527
+ "max_height": null,
1528
+ "max_width": null,
1529
+ "min_height": null,
1530
+ "min_width": null,
1531
+ "object_fit": null,
1532
+ "object_position": null,
1533
+ "order": null,
1534
+ "overflow": null,
1535
+ "overflow_x": null,
1536
+ "overflow_y": null,
1537
+ "padding": null,
1538
+ "right": null,
1539
+ "top": null,
1540
+ "visibility": null,
1541
+ "width": null
1542
+ }
1543
+ },
1544
+ "e1af2c93d89c42b6af4f71c6221edaa2": {
1545
+ "model_module": "@jupyter-widgets/controls",
1546
+ "model_name": "DescriptionStyleModel",
1547
+ "model_module_version": "1.5.0",
1548
+ "state": {
1549
+ "_model_module": "@jupyter-widgets/controls",
1550
+ "_model_module_version": "1.5.0",
1551
+ "_model_name": "DescriptionStyleModel",
1552
+ "_view_count": null,
1553
+ "_view_module": "@jupyter-widgets/base",
1554
+ "_view_module_version": "1.2.0",
1555
+ "_view_name": "StyleView",
1556
+ "description_width": ""
1557
+ }
1558
+ },
1559
+ "50a2bc1e58b34de39493fcc99d7906d8": {
1560
+ "model_module": "@jupyter-widgets/base",
1561
+ "model_name": "LayoutModel",
1562
+ "model_module_version": "1.2.0",
1563
+ "state": {
1564
+ "_model_module": "@jupyter-widgets/base",
1565
+ "_model_module_version": "1.2.0",
1566
+ "_model_name": "LayoutModel",
1567
+ "_view_count": null,
1568
+ "_view_module": "@jupyter-widgets/base",
1569
+ "_view_module_version": "1.2.0",
1570
+ "_view_name": "LayoutView",
1571
+ "align_content": null,
1572
+ "align_items": null,
1573
+ "align_self": null,
1574
+ "border": null,
1575
+ "bottom": null,
1576
+ "display": null,
1577
+ "flex": null,
1578
+ "flex_flow": null,
1579
+ "grid_area": null,
1580
+ "grid_auto_columns": null,
1581
+ "grid_auto_flow": null,
1582
+ "grid_auto_rows": null,
1583
+ "grid_column": null,
1584
+ "grid_gap": null,
1585
+ "grid_row": null,
1586
+ "grid_template_areas": null,
1587
+ "grid_template_columns": null,
1588
+ "grid_template_rows": null,
1589
+ "height": null,
1590
+ "justify_content": null,
1591
+ "justify_items": null,
1592
+ "left": null,
1593
+ "margin": null,
1594
+ "max_height": null,
1595
+ "max_width": null,
1596
+ "min_height": null,
1597
+ "min_width": null,
1598
+ "object_fit": null,
1599
+ "object_position": null,
1600
+ "order": null,
1601
+ "overflow": null,
1602
+ "overflow_x": null,
1603
+ "overflow_y": null,
1604
+ "padding": null,
1605
+ "right": null,
1606
+ "top": null,
1607
+ "visibility": null,
1608
+ "width": null
1609
+ }
1610
+ },
1611
+ "bc7ceea7d04e4511af7c923b4380702e": {
1612
+ "model_module": "@jupyter-widgets/controls",
1613
+ "model_name": "ProgressStyleModel",
1614
+ "model_module_version": "1.5.0",
1615
+ "state": {
1616
+ "_model_module": "@jupyter-widgets/controls",
1617
+ "_model_module_version": "1.5.0",
1618
+ "_model_name": "ProgressStyleModel",
1619
+ "_view_count": null,
1620
+ "_view_module": "@jupyter-widgets/base",
1621
+ "_view_module_version": "1.2.0",
1622
+ "_view_name": "StyleView",
1623
+ "bar_color": null,
1624
+ "description_width": ""
1625
+ }
1626
+ },
1627
+ "2c248b5e372e4eeca557dcfbca329c2f": {
1628
+ "model_module": "@jupyter-widgets/base",
1629
+ "model_name": "LayoutModel",
1630
+ "model_module_version": "1.2.0",
1631
+ "state": {
1632
+ "_model_module": "@jupyter-widgets/base",
1633
+ "_model_module_version": "1.2.0",
1634
+ "_model_name": "LayoutModel",
1635
+ "_view_count": null,
1636
+ "_view_module": "@jupyter-widgets/base",
1637
+ "_view_module_version": "1.2.0",
1638
+ "_view_name": "LayoutView",
1639
+ "align_content": null,
1640
+ "align_items": null,
1641
+ "align_self": null,
1642
+ "border": null,
1643
+ "bottom": null,
1644
+ "display": null,
1645
+ "flex": null,
1646
+ "flex_flow": null,
1647
+ "grid_area": null,
1648
+ "grid_auto_columns": null,
1649
+ "grid_auto_flow": null,
1650
+ "grid_auto_rows": null,
1651
+ "grid_column": null,
1652
+ "grid_gap": null,
1653
+ "grid_row": null,
1654
+ "grid_template_areas": null,
1655
+ "grid_template_columns": null,
1656
+ "grid_template_rows": null,
1657
+ "height": null,
1658
+ "justify_content": null,
1659
+ "justify_items": null,
1660
+ "left": null,
1661
+ "margin": null,
1662
+ "max_height": null,
1663
+ "max_width": null,
1664
+ "min_height": null,
1665
+ "min_width": null,
1666
+ "object_fit": null,
1667
+ "object_position": null,
1668
+ "order": null,
1669
+ "overflow": null,
1670
+ "overflow_x": null,
1671
+ "overflow_y": null,
1672
+ "padding": null,
1673
+ "right": null,
1674
+ "top": null,
1675
+ "visibility": null,
1676
+ "width": null
1677
+ }
1678
+ },
1679
+ "d563e6343b564accb9c972bf6a573d74": {
1680
+ "model_module": "@jupyter-widgets/controls",
1681
+ "model_name": "DescriptionStyleModel",
1682
+ "model_module_version": "1.5.0",
1683
+ "state": {
1684
+ "_model_module": "@jupyter-widgets/controls",
1685
+ "_model_module_version": "1.5.0",
1686
+ "_model_name": "DescriptionStyleModel",
1687
+ "_view_count": null,
1688
+ "_view_module": "@jupyter-widgets/base",
1689
+ "_view_module_version": "1.2.0",
1690
+ "_view_name": "StyleView",
1691
+ "description_width": ""
1692
+ }
1693
+ }
1694
+ }
1695
+ },
1696
+ "accelerator": "GPU"
1697
+ },
1698
+ "nbformat": 4,
1699
+ "nbformat_minor": 0
1700
+ }