klin1 commited on
Commit
b8923cc
·
1 Parent(s): 47ee387

Delete moviesentiments.ipynb

Browse files
Files changed (1) hide show
  1. moviesentiments.ipynb +0 -1941
moviesentiments.ipynb DELETED
@@ -1,1941 +0,0 @@
1
- {
2
- "nbformat": 4,
3
- "nbformat_minor": 0,
4
- "metadata": {
5
- "colab": {
6
- "name": "moviesentiments.ipynb",
7
- "provenance": [],
8
- "collapsed_sections": []
9
- },
10
- "kernelspec": {
11
- "name": "python3",
12
- "display_name": "Python 3"
13
- },
14
- "language_info": {
15
- "name": "python"
16
- },
17
- "accelerator": "GPU",
18
- "widgets": {
19
- "application/vnd.jupyter.widget-state+json": {
20
- "b2c8869e01924bd3b30e1da599dc3cf6": {
21
- "model_module": "@jupyter-widgets/controls",
22
- "model_name": "HBoxModel",
23
- "model_module_version": "1.5.0",
24
- "state": {
25
- "_dom_classes": [],
26
- "_model_module": "@jupyter-widgets/controls",
27
- "_model_module_version": "1.5.0",
28
- "_model_name": "HBoxModel",
29
- "_view_count": null,
30
- "_view_module": "@jupyter-widgets/controls",
31
- "_view_module_version": "1.5.0",
32
- "_view_name": "HBoxView",
33
- "box_style": "",
34
- "children": [
35
- "IPY_MODEL_b78d7e8953af417d9fc04a346986c630",
36
- "IPY_MODEL_8472b0e321f04f05b114a3848fbed728",
37
- "IPY_MODEL_d129e68f8f164fdbaadd55ec4fedc62a"
38
- ],
39
- "layout": "IPY_MODEL_a468f4aef59c45079602e6c1823f4d52"
40
- }
41
- },
42
- "b78d7e8953af417d9fc04a346986c630": {
43
- "model_module": "@jupyter-widgets/controls",
44
- "model_name": "HTMLModel",
45
- "model_module_version": "1.5.0",
46
- "state": {
47
- "_dom_classes": [],
48
- "_model_module": "@jupyter-widgets/controls",
49
- "_model_module_version": "1.5.0",
50
- "_model_name": "HTMLModel",
51
- "_view_count": null,
52
- "_view_module": "@jupyter-widgets/controls",
53
- "_view_module_version": "1.5.0",
54
- "_view_name": "HTMLView",
55
- "description": "",
56
- "description_tooltip": null,
57
- "layout": "IPY_MODEL_a5699544148749c3a5ac06e8e2cf1eb0",
58
- "placeholder": "​",
59
- "style": "IPY_MODEL_8f65c0fb047e4eb1976715f116feaaa0",
60
- "value": "100%"
61
- }
62
- },
63
- "8472b0e321f04f05b114a3848fbed728": {
64
- "model_module": "@jupyter-widgets/controls",
65
- "model_name": "FloatProgressModel",
66
- "model_module_version": "1.5.0",
67
- "state": {
68
- "_dom_classes": [],
69
- "_model_module": "@jupyter-widgets/controls",
70
- "_model_module_version": "1.5.0",
71
- "_model_name": "FloatProgressModel",
72
- "_view_count": null,
73
- "_view_module": "@jupyter-widgets/controls",
74
- "_view_module_version": "1.5.0",
75
- "_view_name": "ProgressView",
76
- "bar_style": "success",
77
- "description": "",
78
- "description_tooltip": null,
79
- "layout": "IPY_MODEL_94c106408b8f467c951b02ef94d14455",
80
- "max": 3,
81
- "min": 0,
82
- "orientation": "horizontal",
83
- "style": "IPY_MODEL_de1d0c2f3cf241c8bdc0ae2ed93e7393",
84
- "value": 3
85
- }
86
- },
87
- "d129e68f8f164fdbaadd55ec4fedc62a": {
88
- "model_module": "@jupyter-widgets/controls",
89
- "model_name": "HTMLModel",
90
- "model_module_version": "1.5.0",
91
- "state": {
92
- "_dom_classes": [],
93
- "_model_module": "@jupyter-widgets/controls",
94
- "_model_module_version": "1.5.0",
95
- "_model_name": "HTMLModel",
96
- "_view_count": null,
97
- "_view_module": "@jupyter-widgets/controls",
98
- "_view_module_version": "1.5.0",
99
- "_view_name": "HTMLView",
100
- "description": "",
101
- "description_tooltip": null,
102
- "layout": "IPY_MODEL_1517628d17d648fd921559a46911e7d9",
103
- "placeholder": "​",
104
- "style": "IPY_MODEL_92076243b11644aca9d8a6b5e9a50474",
105
- "value": " 3/3 [00:00<00:00, 79.44it/s]"
106
- }
107
- },
108
- "a468f4aef59c45079602e6c1823f4d52": {
109
- "model_module": "@jupyter-widgets/base",
110
- "model_name": "LayoutModel",
111
- "model_module_version": "1.2.0",
112
- "state": {
113
- "_model_module": "@jupyter-widgets/base",
114
- "_model_module_version": "1.2.0",
115
- "_model_name": "LayoutModel",
116
- "_view_count": null,
117
- "_view_module": "@jupyter-widgets/base",
118
- "_view_module_version": "1.2.0",
119
- "_view_name": "LayoutView",
120
- "align_content": null,
121
- "align_items": null,
122
- "align_self": null,
123
- "border": null,
124
- "bottom": null,
125
- "display": null,
126
- "flex": null,
127
- "flex_flow": null,
128
- "grid_area": null,
129
- "grid_auto_columns": null,
130
- "grid_auto_flow": null,
131
- "grid_auto_rows": null,
132
- "grid_column": null,
133
- "grid_gap": null,
134
- "grid_row": null,
135
- "grid_template_areas": null,
136
- "grid_template_columns": null,
137
- "grid_template_rows": null,
138
- "height": null,
139
- "justify_content": null,
140
- "justify_items": null,
141
- "left": null,
142
- "margin": null,
143
- "max_height": null,
144
- "max_width": null,
145
- "min_height": null,
146
- "min_width": null,
147
- "object_fit": null,
148
- "object_position": null,
149
- "order": null,
150
- "overflow": null,
151
- "overflow_x": null,
152
- "overflow_y": null,
153
- "padding": null,
154
- "right": null,
155
- "top": null,
156
- "visibility": null,
157
- "width": null
158
- }
159
- },
160
- "a5699544148749c3a5ac06e8e2cf1eb0": {
161
- "model_module": "@jupyter-widgets/base",
162
- "model_name": "LayoutModel",
163
- "model_module_version": "1.2.0",
164
- "state": {
165
- "_model_module": "@jupyter-widgets/base",
166
- "_model_module_version": "1.2.0",
167
- "_model_name": "LayoutModel",
168
- "_view_count": null,
169
- "_view_module": "@jupyter-widgets/base",
170
- "_view_module_version": "1.2.0",
171
- "_view_name": "LayoutView",
172
- "align_content": null,
173
- "align_items": null,
174
- "align_self": null,
175
- "border": null,
176
- "bottom": null,
177
- "display": null,
178
- "flex": null,
179
- "flex_flow": null,
180
- "grid_area": null,
181
- "grid_auto_columns": null,
182
- "grid_auto_flow": null,
183
- "grid_auto_rows": null,
184
- "grid_column": null,
185
- "grid_gap": null,
186
- "grid_row": null,
187
- "grid_template_areas": null,
188
- "grid_template_columns": null,
189
- "grid_template_rows": null,
190
- "height": null,
191
- "justify_content": null,
192
- "justify_items": null,
193
- "left": null,
194
- "margin": null,
195
- "max_height": null,
196
- "max_width": null,
197
- "min_height": null,
198
- "min_width": null,
199
- "object_fit": null,
200
- "object_position": null,
201
- "order": null,
202
- "overflow": null,
203
- "overflow_x": null,
204
- "overflow_y": null,
205
- "padding": null,
206
- "right": null,
207
- "top": null,
208
- "visibility": null,
209
- "width": null
210
- }
211
- },
212
- "8f65c0fb047e4eb1976715f116feaaa0": {
213
- "model_module": "@jupyter-widgets/controls",
214
- "model_name": "DescriptionStyleModel",
215
- "model_module_version": "1.5.0",
216
- "state": {
217
- "_model_module": "@jupyter-widgets/controls",
218
- "_model_module_version": "1.5.0",
219
- "_model_name": "DescriptionStyleModel",
220
- "_view_count": null,
221
- "_view_module": "@jupyter-widgets/base",
222
- "_view_module_version": "1.2.0",
223
- "_view_name": "StyleView",
224
- "description_width": ""
225
- }
226
- },
227
- "94c106408b8f467c951b02ef94d14455": {
228
- "model_module": "@jupyter-widgets/base",
229
- "model_name": "LayoutModel",
230
- "model_module_version": "1.2.0",
231
- "state": {
232
- "_model_module": "@jupyter-widgets/base",
233
- "_model_module_version": "1.2.0",
234
- "_model_name": "LayoutModel",
235
- "_view_count": null,
236
- "_view_module": "@jupyter-widgets/base",
237
- "_view_module_version": "1.2.0",
238
- "_view_name": "LayoutView",
239
- "align_content": null,
240
- "align_items": null,
241
- "align_self": null,
242
- "border": null,
243
- "bottom": null,
244
- "display": null,
245
- "flex": null,
246
- "flex_flow": null,
247
- "grid_area": null,
248
- "grid_auto_columns": null,
249
- "grid_auto_flow": null,
250
- "grid_auto_rows": null,
251
- "grid_column": null,
252
- "grid_gap": null,
253
- "grid_row": null,
254
- "grid_template_areas": null,
255
- "grid_template_columns": null,
256
- "grid_template_rows": null,
257
- "height": null,
258
- "justify_content": null,
259
- "justify_items": null,
260
- "left": null,
261
- "margin": null,
262
- "max_height": null,
263
- "max_width": null,
264
- "min_height": null,
265
- "min_width": null,
266
- "object_fit": null,
267
- "object_position": null,
268
- "order": null,
269
- "overflow": null,
270
- "overflow_x": null,
271
- "overflow_y": null,
272
- "padding": null,
273
- "right": null,
274
- "top": null,
275
- "visibility": null,
276
- "width": null
277
- }
278
- },
279
- "de1d0c2f3cf241c8bdc0ae2ed93e7393": {
280
- "model_module": "@jupyter-widgets/controls",
281
- "model_name": "ProgressStyleModel",
282
- "model_module_version": "1.5.0",
283
- "state": {
284
- "_model_module": "@jupyter-widgets/controls",
285
- "_model_module_version": "1.5.0",
286
- "_model_name": "ProgressStyleModel",
287
- "_view_count": null,
288
- "_view_module": "@jupyter-widgets/base",
289
- "_view_module_version": "1.2.0",
290
- "_view_name": "StyleView",
291
- "bar_color": null,
292
- "description_width": ""
293
- }
294
- },
295
- "1517628d17d648fd921559a46911e7d9": {
296
- "model_module": "@jupyter-widgets/base",
297
- "model_name": "LayoutModel",
298
- "model_module_version": "1.2.0",
299
- "state": {
300
- "_model_module": "@jupyter-widgets/base",
301
- "_model_module_version": "1.2.0",
302
- "_model_name": "LayoutModel",
303
- "_view_count": null,
304
- "_view_module": "@jupyter-widgets/base",
305
- "_view_module_version": "1.2.0",
306
- "_view_name": "LayoutView",
307
- "align_content": null,
308
- "align_items": null,
309
- "align_self": null,
310
- "border": null,
311
- "bottom": null,
312
- "display": null,
313
- "flex": null,
314
- "flex_flow": null,
315
- "grid_area": null,
316
- "grid_auto_columns": null,
317
- "grid_auto_flow": null,
318
- "grid_auto_rows": null,
319
- "grid_column": null,
320
- "grid_gap": null,
321
- "grid_row": null,
322
- "grid_template_areas": null,
323
- "grid_template_columns": null,
324
- "grid_template_rows": null,
325
- "height": null,
326
- "justify_content": null,
327
- "justify_items": null,
328
- "left": null,
329
- "margin": null,
330
- "max_height": null,
331
- "max_width": null,
332
- "min_height": null,
333
- "min_width": null,
334
- "object_fit": null,
335
- "object_position": null,
336
- "order": null,
337
- "overflow": null,
338
- "overflow_x": null,
339
- "overflow_y": null,
340
- "padding": null,
341
- "right": null,
342
- "top": null,
343
- "visibility": null,
344
- "width": null
345
- }
346
- },
347
- "92076243b11644aca9d8a6b5e9a50474": {
348
- "model_module": "@jupyter-widgets/controls",
349
- "model_name": "DescriptionStyleModel",
350
- "model_module_version": "1.5.0",
351
- "state": {
352
- "_model_module": "@jupyter-widgets/controls",
353
- "_model_module_version": "1.5.0",
354
- "_model_name": "DescriptionStyleModel",
355
- "_view_count": null,
356
- "_view_module": "@jupyter-widgets/base",
357
- "_view_module_version": "1.2.0",
358
- "_view_name": "StyleView",
359
- "description_width": ""
360
- }
361
- },
362
- "c7ce86b66a054deca4b610724bfe26e7": {
363
- "model_module": "@jupyter-widgets/controls",
364
- "model_name": "HBoxModel",
365
- "model_module_version": "1.5.0",
366
- "state": {
367
- "_dom_classes": [],
368
- "_model_module": "@jupyter-widgets/controls",
369
- "_model_module_version": "1.5.0",
370
- "_model_name": "HBoxModel",
371
- "_view_count": null,
372
- "_view_module": "@jupyter-widgets/controls",
373
- "_view_module_version": "1.5.0",
374
- "_view_name": "HBoxView",
375
- "box_style": "",
376
- "children": [
377
- "IPY_MODEL_9509cbd89f29485e93645e858d1854bd",
378
- "IPY_MODEL_6058900f38044262b4a9c120e8163cc0",
379
- "IPY_MODEL_54ee1642c9854b0c99844c92d9078ea4"
380
- ],
381
- "layout": "IPY_MODEL_749f0330c5ab40a7a554b4bc356794fe"
382
- }
383
- },
384
- "9509cbd89f29485e93645e858d1854bd": {
385
- "model_module": "@jupyter-widgets/controls",
386
- "model_name": "HTMLModel",
387
- "model_module_version": "1.5.0",
388
- "state": {
389
- "_dom_classes": [],
390
- "_model_module": "@jupyter-widgets/controls",
391
- "_model_module_version": "1.5.0",
392
- "_model_name": "HTMLModel",
393
- "_view_count": null,
394
- "_view_module": "@jupyter-widgets/controls",
395
- "_view_module_version": "1.5.0",
396
- "_view_name": "HTMLView",
397
- "description": "",
398
- "description_tooltip": null,
399
- "layout": "IPY_MODEL_90038345ae5342d2a90e9867259465de",
400
- "placeholder": "​",
401
- "style": "IPY_MODEL_81f5ba6f4c884ddab69a728450778e46",
402
- "value": "100%"
403
- }
404
- },
405
- "6058900f38044262b4a9c120e8163cc0": {
406
- "model_module": "@jupyter-widgets/controls",
407
- "model_name": "FloatProgressModel",
408
- "model_module_version": "1.5.0",
409
- "state": {
410
- "_dom_classes": [],
411
- "_model_module": "@jupyter-widgets/controls",
412
- "_model_module_version": "1.5.0",
413
- "_model_name": "FloatProgressModel",
414
- "_view_count": null,
415
- "_view_module": "@jupyter-widgets/controls",
416
- "_view_module_version": "1.5.0",
417
- "_view_name": "ProgressView",
418
- "bar_style": "success",
419
- "description": "",
420
- "description_tooltip": null,
421
- "layout": "IPY_MODEL_82750a5a76d4478695c67fbe126af2c4",
422
- "max": 2,
423
- "min": 0,
424
- "orientation": "horizontal",
425
- "style": "IPY_MODEL_4182914b11d649e183fc5a8fbe48f736",
426
- "value": 2
427
- }
428
- },
429
- "54ee1642c9854b0c99844c92d9078ea4": {
430
- "model_module": "@jupyter-widgets/controls",
431
- "model_name": "HTMLModel",
432
- "model_module_version": "1.5.0",
433
- "state": {
434
- "_dom_classes": [],
435
- "_model_module": "@jupyter-widgets/controls",
436
- "_model_module_version": "1.5.0",
437
- "_model_name": "HTMLModel",
438
- "_view_count": null,
439
- "_view_module": "@jupyter-widgets/controls",
440
- "_view_module_version": "1.5.0",
441
- "_view_name": "HTMLView",
442
- "description": "",
443
- "description_tooltip": null,
444
- "layout": "IPY_MODEL_e766763d78334f1980ab87cce25a2647",
445
- "placeholder": "​",
446
- "style": "IPY_MODEL_07a34b10d63345ccb04d79e20696b3db",
447
- "value": " 2/2 [00:00<00:00, 7.57ba/s]"
448
- }
449
- },
450
- "749f0330c5ab40a7a554b4bc356794fe": {
451
- "model_module": "@jupyter-widgets/base",
452
- "model_name": "LayoutModel",
453
- "model_module_version": "1.2.0",
454
- "state": {
455
- "_model_module": "@jupyter-widgets/base",
456
- "_model_module_version": "1.2.0",
457
- "_model_name": "LayoutModel",
458
- "_view_count": null,
459
- "_view_module": "@jupyter-widgets/base",
460
- "_view_module_version": "1.2.0",
461
- "_view_name": "LayoutView",
462
- "align_content": null,
463
- "align_items": null,
464
- "align_self": null,
465
- "border": null,
466
- "bottom": null,
467
- "display": null,
468
- "flex": null,
469
- "flex_flow": null,
470
- "grid_area": null,
471
- "grid_auto_columns": null,
472
- "grid_auto_flow": null,
473
- "grid_auto_rows": null,
474
- "grid_column": null,
475
- "grid_gap": null,
476
- "grid_row": null,
477
- "grid_template_areas": null,
478
- "grid_template_columns": null,
479
- "grid_template_rows": null,
480
- "height": null,
481
- "justify_content": null,
482
- "justify_items": null,
483
- "left": null,
484
- "margin": null,
485
- "max_height": null,
486
- "max_width": null,
487
- "min_height": null,
488
- "min_width": null,
489
- "object_fit": null,
490
- "object_position": null,
491
- "order": null,
492
- "overflow": null,
493
- "overflow_x": null,
494
- "overflow_y": null,
495
- "padding": null,
496
- "right": null,
497
- "top": null,
498
- "visibility": null,
499
- "width": null
500
- }
501
- },
502
- "90038345ae5342d2a90e9867259465de": {
503
- "model_module": "@jupyter-widgets/base",
504
- "model_name": "LayoutModel",
505
- "model_module_version": "1.2.0",
506
- "state": {
507
- "_model_module": "@jupyter-widgets/base",
508
- "_model_module_version": "1.2.0",
509
- "_model_name": "LayoutModel",
510
- "_view_count": null,
511
- "_view_module": "@jupyter-widgets/base",
512
- "_view_module_version": "1.2.0",
513
- "_view_name": "LayoutView",
514
- "align_content": null,
515
- "align_items": null,
516
- "align_self": null,
517
- "border": null,
518
- "bottom": null,
519
- "display": null,
520
- "flex": null,
521
- "flex_flow": null,
522
- "grid_area": null,
523
- "grid_auto_columns": null,
524
- "grid_auto_flow": null,
525
- "grid_auto_rows": null,
526
- "grid_column": null,
527
- "grid_gap": null,
528
- "grid_row": null,
529
- "grid_template_areas": null,
530
- "grid_template_columns": null,
531
- "grid_template_rows": null,
532
- "height": null,
533
- "justify_content": null,
534
- "justify_items": null,
535
- "left": null,
536
- "margin": null,
537
- "max_height": null,
538
- "max_width": null,
539
- "min_height": null,
540
- "min_width": null,
541
- "object_fit": null,
542
- "object_position": null,
543
- "order": null,
544
- "overflow": null,
545
- "overflow_x": null,
546
- "overflow_y": null,
547
- "padding": null,
548
- "right": null,
549
- "top": null,
550
- "visibility": null,
551
- "width": null
552
- }
553
- },
554
- "81f5ba6f4c884ddab69a728450778e46": {
555
- "model_module": "@jupyter-widgets/controls",
556
- "model_name": "DescriptionStyleModel",
557
- "model_module_version": "1.5.0",
558
- "state": {
559
- "_model_module": "@jupyter-widgets/controls",
560
- "_model_module_version": "1.5.0",
561
- "_model_name": "DescriptionStyleModel",
562
- "_view_count": null,
563
- "_view_module": "@jupyter-widgets/base",
564
- "_view_module_version": "1.2.0",
565
- "_view_name": "StyleView",
566
- "description_width": ""
567
- }
568
- },
569
- "82750a5a76d4478695c67fbe126af2c4": {
570
- "model_module": "@jupyter-widgets/base",
571
- "model_name": "LayoutModel",
572
- "model_module_version": "1.2.0",
573
- "state": {
574
- "_model_module": "@jupyter-widgets/base",
575
- "_model_module_version": "1.2.0",
576
- "_model_name": "LayoutModel",
577
- "_view_count": null,
578
- "_view_module": "@jupyter-widgets/base",
579
- "_view_module_version": "1.2.0",
580
- "_view_name": "LayoutView",
581
- "align_content": null,
582
- "align_items": null,
583
- "align_self": null,
584
- "border": null,
585
- "bottom": null,
586
- "display": null,
587
- "flex": null,
588
- "flex_flow": null,
589
- "grid_area": null,
590
- "grid_auto_columns": null,
591
- "grid_auto_flow": null,
592
- "grid_auto_rows": null,
593
- "grid_column": null,
594
- "grid_gap": null,
595
- "grid_row": null,
596
- "grid_template_areas": null,
597
- "grid_template_columns": null,
598
- "grid_template_rows": null,
599
- "height": null,
600
- "justify_content": null,
601
- "justify_items": null,
602
- "left": null,
603
- "margin": null,
604
- "max_height": null,
605
- "max_width": null,
606
- "min_height": null,
607
- "min_width": null,
608
- "object_fit": null,
609
- "object_position": null,
610
- "order": null,
611
- "overflow": null,
612
- "overflow_x": null,
613
- "overflow_y": null,
614
- "padding": null,
615
- "right": null,
616
- "top": null,
617
- "visibility": null,
618
- "width": null
619
- }
620
- },
621
- "4182914b11d649e183fc5a8fbe48f736": {
622
- "model_module": "@jupyter-widgets/controls",
623
- "model_name": "ProgressStyleModel",
624
- "model_module_version": "1.5.0",
625
- "state": {
626
- "_model_module": "@jupyter-widgets/controls",
627
- "_model_module_version": "1.5.0",
628
- "_model_name": "ProgressStyleModel",
629
- "_view_count": null,
630
- "_view_module": "@jupyter-widgets/base",
631
- "_view_module_version": "1.2.0",
632
- "_view_name": "StyleView",
633
- "bar_color": null,
634
- "description_width": ""
635
- }
636
- },
637
- "e766763d78334f1980ab87cce25a2647": {
638
- "model_module": "@jupyter-widgets/base",
639
- "model_name": "LayoutModel",
640
- "model_module_version": "1.2.0",
641
- "state": {
642
- "_model_module": "@jupyter-widgets/base",
643
- "_model_module_version": "1.2.0",
644
- "_model_name": "LayoutModel",
645
- "_view_count": null,
646
- "_view_module": "@jupyter-widgets/base",
647
- "_view_module_version": "1.2.0",
648
- "_view_name": "LayoutView",
649
- "align_content": null,
650
- "align_items": null,
651
- "align_self": null,
652
- "border": null,
653
- "bottom": null,
654
- "display": null,
655
- "flex": null,
656
- "flex_flow": null,
657
- "grid_area": null,
658
- "grid_auto_columns": null,
659
- "grid_auto_flow": null,
660
- "grid_auto_rows": null,
661
- "grid_column": null,
662
- "grid_gap": null,
663
- "grid_row": null,
664
- "grid_template_areas": null,
665
- "grid_template_columns": null,
666
- "grid_template_rows": null,
667
- "height": null,
668
- "justify_content": null,
669
- "justify_items": null,
670
- "left": null,
671
- "margin": null,
672
- "max_height": null,
673
- "max_width": null,
674
- "min_height": null,
675
- "min_width": null,
676
- "object_fit": null,
677
- "object_position": null,
678
- "order": null,
679
- "overflow": null,
680
- "overflow_x": null,
681
- "overflow_y": null,
682
- "padding": null,
683
- "right": null,
684
- "top": null,
685
- "visibility": null,
686
- "width": null
687
- }
688
- },
689
- "07a34b10d63345ccb04d79e20696b3db": {
690
- "model_module": "@jupyter-widgets/controls",
691
- "model_name": "DescriptionStyleModel",
692
- "model_module_version": "1.5.0",
693
- "state": {
694
- "_model_module": "@jupyter-widgets/controls",
695
- "_model_module_version": "1.5.0",
696
- "_model_name": "DescriptionStyleModel",
697
- "_view_count": null,
698
- "_view_module": "@jupyter-widgets/base",
699
- "_view_module_version": "1.2.0",
700
- "_view_name": "StyleView",
701
- "description_width": ""
702
- }
703
- },
704
- "7c5c49fb2cf145a4bc810796fd65c562": {
705
- "model_module": "@jupyter-widgets/controls",
706
- "model_name": "VBoxModel",
707
- "model_module_version": "1.5.0",
708
- "state": {
709
- "_dom_classes": [],
710
- "_model_module": "@jupyter-widgets/controls",
711
- "_model_module_version": "1.5.0",
712
- "_model_name": "VBoxModel",
713
- "_view_count": null,
714
- "_view_module": "@jupyter-widgets/controls",
715
- "_view_module_version": "1.5.0",
716
- "_view_name": "VBoxView",
717
- "box_style": "",
718
- "children": [
719
- "IPY_MODEL_468d65d5b83c43ab98ce67d67b0a40db",
720
- "IPY_MODEL_bc1b9bd452a7421383c3be4624664f3b",
721
- "IPY_MODEL_9050bbfe7e254cbe97d5b2c325a40020",
722
- "IPY_MODEL_44178aa1b5094162924343143f96b3df",
723
- "IPY_MODEL_36736e8bb1044e3196054ef0051d3aaf"
724
- ],
725
- "layout": "IPY_MODEL_f81d06c54ab24ac5bccbf33a674b6861"
726
- }
727
- },
728
- "468d65d5b83c43ab98ce67d67b0a40db": {
729
- "model_module": "@jupyter-widgets/controls",
730
- "model_name": "HTMLModel",
731
- "model_module_version": "1.5.0",
732
- "state": {
733
- "_dom_classes": [],
734
- "_model_module": "@jupyter-widgets/controls",
735
- "_model_module_version": "1.5.0",
736
- "_model_name": "HTMLModel",
737
- "_view_count": null,
738
- "_view_module": "@jupyter-widgets/controls",
739
- "_view_module_version": "1.5.0",
740
- "_view_name": "HTMLView",
741
- "description": "",
742
- "description_tooltip": null,
743
- "layout": "IPY_MODEL_5a638757395543afbdacdd4b6050a907",
744
- "placeholder": "​",
745
- "style": "IPY_MODEL_6cbc7fbac75f4e3bb2ab1b95adda9537",
746
- "value": "<center> <img\nsrc=https://huggingface.co/front/assets/huggingface_logo-noborder.svg\nalt='Hugging Face'> <br> Copy a token from <a\nhref=\"https://huggingface.co/settings/tokens\" target=\"_blank\">your Hugging Face\ntokens page</a> and paste it below. <br> Immediately click login after copying\nyour token or it might be stored in plain text in this notebook file. </center>"
747
- }
748
- },
749
- "bc1b9bd452a7421383c3be4624664f3b": {
750
- "model_module": "@jupyter-widgets/controls",
751
- "model_name": "PasswordModel",
752
- "model_module_version": "1.5.0",
753
- "state": {
754
- "_dom_classes": [],
755
- "_model_module": "@jupyter-widgets/controls",
756
- "_model_module_version": "1.5.0",
757
- "_model_name": "PasswordModel",
758
- "_view_count": null,
759
- "_view_module": "@jupyter-widgets/controls",
760
- "_view_module_version": "1.5.0",
761
- "_view_name": "PasswordView",
762
- "continuous_update": true,
763
- "description": "Token:",
764
- "description_tooltip": null,
765
- "disabled": false,
766
- "layout": "IPY_MODEL_166f8f382d4747149dcafd6e783793c1",
767
- "placeholder": "​",
768
- "style": "IPY_MODEL_6a0bcc7faeb74b039fb08867b178b5b0",
769
- "value": ""
770
- }
771
- },
772
- "9050bbfe7e254cbe97d5b2c325a40020": {
773
- "model_module": "@jupyter-widgets/controls",
774
- "model_name": "ButtonModel",
775
- "model_module_version": "1.5.0",
776
- "state": {
777
- "_dom_classes": [],
778
- "_model_module": "@jupyter-widgets/controls",
779
- "_model_module_version": "1.5.0",
780
- "_model_name": "ButtonModel",
781
- "_view_count": null,
782
- "_view_module": "@jupyter-widgets/controls",
783
- "_view_module_version": "1.5.0",
784
- "_view_name": "ButtonView",
785
- "button_style": "",
786
- "description": "Login",
787
- "disabled": false,
788
- "icon": "",
789
- "layout": "IPY_MODEL_80258fcebfdd47128678d8d78583229f",
790
- "style": "IPY_MODEL_4d82511f744f4769a04b084d9d661199",
791
- "tooltip": ""
792
- }
793
- },
794
- "44178aa1b5094162924343143f96b3df": {
795
- "model_module": "@jupyter-widgets/controls",
796
- "model_name": "HTMLModel",
797
- "model_module_version": "1.5.0",
798
- "state": {
799
- "_dom_classes": [],
800
- "_model_module": "@jupyter-widgets/controls",
801
- "_model_module_version": "1.5.0",
802
- "_model_name": "HTMLModel",
803
- "_view_count": null,
804
- "_view_module": "@jupyter-widgets/controls",
805
- "_view_module_version": "1.5.0",
806
- "_view_name": "HTMLView",
807
- "description": "",
808
- "description_tooltip": null,
809
- "layout": "IPY_MODEL_3c3c7d2e327b41e8be80f5862d39567a",
810
- "placeholder": "​",
811
- "style": "IPY_MODEL_932f21e57e804560b21535d78286f6d3",
812
- "value": "\n<b>Pro Tip:</b> 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. <br> <i>Logging in with your username and password is deprecated and\nwon't be possible anymore in the near future. You can still use them for now by\nclicking below.</i> </center>"
813
- }
814
- },
815
- "36736e8bb1044e3196054ef0051d3aaf": {
816
- "model_module": "@jupyter-widgets/controls",
817
- "model_name": "ButtonModel",
818
- "model_module_version": "1.5.0",
819
- "state": {
820
- "_dom_classes": [],
821
- "_model_module": "@jupyter-widgets/controls",
822
- "_model_module_version": "1.5.0",
823
- "_model_name": "ButtonModel",
824
- "_view_count": null,
825
- "_view_module": "@jupyter-widgets/controls",
826
- "_view_module_version": "1.5.0",
827
- "_view_name": "ButtonView",
828
- "button_style": "",
829
- "description": "Use password",
830
- "disabled": false,
831
- "icon": "",
832
- "layout": "IPY_MODEL_60c8669178d041e5a7bafea98a889e91",
833
- "style": "IPY_MODEL_d8f25f94560f4d059118aac87b59e57e",
834
- "tooltip": ""
835
- }
836
- },
837
- "f81d06c54ab24ac5bccbf33a674b6861": {
838
- "model_module": "@jupyter-widgets/base",
839
- "model_name": "LayoutModel",
840
- "model_module_version": "1.2.0",
841
- "state": {
842
- "_model_module": "@jupyter-widgets/base",
843
- "_model_module_version": "1.2.0",
844
- "_model_name": "LayoutModel",
845
- "_view_count": null,
846
- "_view_module": "@jupyter-widgets/base",
847
- "_view_module_version": "1.2.0",
848
- "_view_name": "LayoutView",
849
- "align_content": null,
850
- "align_items": "center",
851
- "align_self": null,
852
- "border": null,
853
- "bottom": null,
854
- "display": "flex",
855
- "flex": null,
856
- "flex_flow": "column",
857
- "grid_area": null,
858
- "grid_auto_columns": null,
859
- "grid_auto_flow": null,
860
- "grid_auto_rows": null,
861
- "grid_column": null,
862
- "grid_gap": null,
863
- "grid_row": null,
864
- "grid_template_areas": null,
865
- "grid_template_columns": null,
866
- "grid_template_rows": null,
867
- "height": null,
868
- "justify_content": null,
869
- "justify_items": null,
870
- "left": null,
871
- "margin": null,
872
- "max_height": null,
873
- "max_width": null,
874
- "min_height": null,
875
- "min_width": null,
876
- "object_fit": null,
877
- "object_position": null,
878
- "order": null,
879
- "overflow": null,
880
- "overflow_x": null,
881
- "overflow_y": null,
882
- "padding": null,
883
- "right": null,
884
- "top": null,
885
- "visibility": null,
886
- "width": "50%"
887
- }
888
- },
889
- "5a638757395543afbdacdd4b6050a907": {
890
- "model_module": "@jupyter-widgets/base",
891
- "model_name": "LayoutModel",
892
- "model_module_version": "1.2.0",
893
- "state": {
894
- "_model_module": "@jupyter-widgets/base",
895
- "_model_module_version": "1.2.0",
896
- "_model_name": "LayoutModel",
897
- "_view_count": null,
898
- "_view_module": "@jupyter-widgets/base",
899
- "_view_module_version": "1.2.0",
900
- "_view_name": "LayoutView",
901
- "align_content": null,
902
- "align_items": null,
903
- "align_self": null,
904
- "border": null,
905
- "bottom": null,
906
- "display": null,
907
- "flex": null,
908
- "flex_flow": null,
909
- "grid_area": null,
910
- "grid_auto_columns": null,
911
- "grid_auto_flow": null,
912
- "grid_auto_rows": null,
913
- "grid_column": null,
914
- "grid_gap": null,
915
- "grid_row": null,
916
- "grid_template_areas": null,
917
- "grid_template_columns": null,
918
- "grid_template_rows": null,
919
- "height": null,
920
- "justify_content": null,
921
- "justify_items": null,
922
- "left": null,
923
- "margin": null,
924
- "max_height": null,
925
- "max_width": null,
926
- "min_height": null,
927
- "min_width": null,
928
- "object_fit": null,
929
- "object_position": null,
930
- "order": null,
931
- "overflow": null,
932
- "overflow_x": null,
933
- "overflow_y": null,
934
- "padding": null,
935
- "right": null,
936
- "top": null,
937
- "visibility": null,
938
- "width": null
939
- }
940
- },
941
- "6cbc7fbac75f4e3bb2ab1b95adda9537": {
942
- "model_module": "@jupyter-widgets/controls",
943
- "model_name": "DescriptionStyleModel",
944
- "model_module_version": "1.5.0",
945
- "state": {
946
- "_model_module": "@jupyter-widgets/controls",
947
- "_model_module_version": "1.5.0",
948
- "_model_name": "DescriptionStyleModel",
949
- "_view_count": null,
950
- "_view_module": "@jupyter-widgets/base",
951
- "_view_module_version": "1.2.0",
952
- "_view_name": "StyleView",
953
- "description_width": ""
954
- }
955
- },
956
- "166f8f382d4747149dcafd6e783793c1": {
957
- "model_module": "@jupyter-widgets/base",
958
- "model_name": "LayoutModel",
959
- "model_module_version": "1.2.0",
960
- "state": {
961
- "_model_module": "@jupyter-widgets/base",
962
- "_model_module_version": "1.2.0",
963
- "_model_name": "LayoutModel",
964
- "_view_count": null,
965
- "_view_module": "@jupyter-widgets/base",
966
- "_view_module_version": "1.2.0",
967
- "_view_name": "LayoutView",
968
- "align_content": null,
969
- "align_items": null,
970
- "align_self": null,
971
- "border": null,
972
- "bottom": null,
973
- "display": null,
974
- "flex": null,
975
- "flex_flow": null,
976
- "grid_area": null,
977
- "grid_auto_columns": null,
978
- "grid_auto_flow": null,
979
- "grid_auto_rows": null,
980
- "grid_column": null,
981
- "grid_gap": null,
982
- "grid_row": null,
983
- "grid_template_areas": null,
984
- "grid_template_columns": null,
985
- "grid_template_rows": null,
986
- "height": null,
987
- "justify_content": null,
988
- "justify_items": null,
989
- "left": null,
990
- "margin": null,
991
- "max_height": null,
992
- "max_width": null,
993
- "min_height": null,
994
- "min_width": null,
995
- "object_fit": null,
996
- "object_position": null,
997
- "order": null,
998
- "overflow": null,
999
- "overflow_x": null,
1000
- "overflow_y": null,
1001
- "padding": null,
1002
- "right": null,
1003
- "top": null,
1004
- "visibility": null,
1005
- "width": null
1006
- }
1007
- },
1008
- "6a0bcc7faeb74b039fb08867b178b5b0": {
1009
- "model_module": "@jupyter-widgets/controls",
1010
- "model_name": "DescriptionStyleModel",
1011
- "model_module_version": "1.5.0",
1012
- "state": {
1013
- "_model_module": "@jupyter-widgets/controls",
1014
- "_model_module_version": "1.5.0",
1015
- "_model_name": "DescriptionStyleModel",
1016
- "_view_count": null,
1017
- "_view_module": "@jupyter-widgets/base",
1018
- "_view_module_version": "1.2.0",
1019
- "_view_name": "StyleView",
1020
- "description_width": ""
1021
- }
1022
- },
1023
- "80258fcebfdd47128678d8d78583229f": {
1024
- "model_module": "@jupyter-widgets/base",
1025
- "model_name": "LayoutModel",
1026
- "model_module_version": "1.2.0",
1027
- "state": {
1028
- "_model_module": "@jupyter-widgets/base",
1029
- "_model_module_version": "1.2.0",
1030
- "_model_name": "LayoutModel",
1031
- "_view_count": null,
1032
- "_view_module": "@jupyter-widgets/base",
1033
- "_view_module_version": "1.2.0",
1034
- "_view_name": "LayoutView",
1035
- "align_content": null,
1036
- "align_items": null,
1037
- "align_self": null,
1038
- "border": null,
1039
- "bottom": null,
1040
- "display": null,
1041
- "flex": null,
1042
- "flex_flow": null,
1043
- "grid_area": null,
1044
- "grid_auto_columns": null,
1045
- "grid_auto_flow": null,
1046
- "grid_auto_rows": null,
1047
- "grid_column": null,
1048
- "grid_gap": null,
1049
- "grid_row": null,
1050
- "grid_template_areas": null,
1051
- "grid_template_columns": null,
1052
- "grid_template_rows": null,
1053
- "height": null,
1054
- "justify_content": null,
1055
- "justify_items": null,
1056
- "left": null,
1057
- "margin": null,
1058
- "max_height": null,
1059
- "max_width": null,
1060
- "min_height": null,
1061
- "min_width": null,
1062
- "object_fit": null,
1063
- "object_position": null,
1064
- "order": null,
1065
- "overflow": null,
1066
- "overflow_x": null,
1067
- "overflow_y": null,
1068
- "padding": null,
1069
- "right": null,
1070
- "top": null,
1071
- "visibility": null,
1072
- "width": null
1073
- }
1074
- },
1075
- "4d82511f744f4769a04b084d9d661199": {
1076
- "model_module": "@jupyter-widgets/controls",
1077
- "model_name": "ButtonStyleModel",
1078
- "model_module_version": "1.5.0",
1079
- "state": {
1080
- "_model_module": "@jupyter-widgets/controls",
1081
- "_model_module_version": "1.5.0",
1082
- "_model_name": "ButtonStyleModel",
1083
- "_view_count": null,
1084
- "_view_module": "@jupyter-widgets/base",
1085
- "_view_module_version": "1.2.0",
1086
- "_view_name": "StyleView",
1087
- "button_color": null,
1088
- "font_weight": ""
1089
- }
1090
- },
1091
- "3c3c7d2e327b41e8be80f5862d39567a": {
1092
- "model_module": "@jupyter-widgets/base",
1093
- "model_name": "LayoutModel",
1094
- "model_module_version": "1.2.0",
1095
- "state": {
1096
- "_model_module": "@jupyter-widgets/base",
1097
- "_model_module_version": "1.2.0",
1098
- "_model_name": "LayoutModel",
1099
- "_view_count": null,
1100
- "_view_module": "@jupyter-widgets/base",
1101
- "_view_module_version": "1.2.0",
1102
- "_view_name": "LayoutView",
1103
- "align_content": null,
1104
- "align_items": null,
1105
- "align_self": null,
1106
- "border": null,
1107
- "bottom": null,
1108
- "display": null,
1109
- "flex": null,
1110
- "flex_flow": null,
1111
- "grid_area": null,
1112
- "grid_auto_columns": null,
1113
- "grid_auto_flow": null,
1114
- "grid_auto_rows": null,
1115
- "grid_column": null,
1116
- "grid_gap": null,
1117
- "grid_row": null,
1118
- "grid_template_areas": null,
1119
- "grid_template_columns": null,
1120
- "grid_template_rows": null,
1121
- "height": null,
1122
- "justify_content": null,
1123
- "justify_items": null,
1124
- "left": null,
1125
- "margin": null,
1126
- "max_height": null,
1127
- "max_width": null,
1128
- "min_height": null,
1129
- "min_width": null,
1130
- "object_fit": null,
1131
- "object_position": null,
1132
- "order": null,
1133
- "overflow": null,
1134
- "overflow_x": null,
1135
- "overflow_y": null,
1136
- "padding": null,
1137
- "right": null,
1138
- "top": null,
1139
- "visibility": null,
1140
- "width": null
1141
- }
1142
- },
1143
- "932f21e57e804560b21535d78286f6d3": {
1144
- "model_module": "@jupyter-widgets/controls",
1145
- "model_name": "DescriptionStyleModel",
1146
- "model_module_version": "1.5.0",
1147
- "state": {
1148
- "_model_module": "@jupyter-widgets/controls",
1149
- "_model_module_version": "1.5.0",
1150
- "_model_name": "DescriptionStyleModel",
1151
- "_view_count": null,
1152
- "_view_module": "@jupyter-widgets/base",
1153
- "_view_module_version": "1.2.0",
1154
- "_view_name": "StyleView",
1155
- "description_width": ""
1156
- }
1157
- },
1158
- "60c8669178d041e5a7bafea98a889e91": {
1159
- "model_module": "@jupyter-widgets/base",
1160
- "model_name": "LayoutModel",
1161
- "model_module_version": "1.2.0",
1162
- "state": {
1163
- "_model_module": "@jupyter-widgets/base",
1164
- "_model_module_version": "1.2.0",
1165
- "_model_name": "LayoutModel",
1166
- "_view_count": null,
1167
- "_view_module": "@jupyter-widgets/base",
1168
- "_view_module_version": "1.2.0",
1169
- "_view_name": "LayoutView",
1170
- "align_content": null,
1171
- "align_items": null,
1172
- "align_self": null,
1173
- "border": null,
1174
- "bottom": null,
1175
- "display": null,
1176
- "flex": null,
1177
- "flex_flow": null,
1178
- "grid_area": null,
1179
- "grid_auto_columns": null,
1180
- "grid_auto_flow": null,
1181
- "grid_auto_rows": null,
1182
- "grid_column": null,
1183
- "grid_gap": null,
1184
- "grid_row": null,
1185
- "grid_template_areas": null,
1186
- "grid_template_columns": null,
1187
- "grid_template_rows": null,
1188
- "height": null,
1189
- "justify_content": null,
1190
- "justify_items": null,
1191
- "left": null,
1192
- "margin": null,
1193
- "max_height": null,
1194
- "max_width": null,
1195
- "min_height": null,
1196
- "min_width": null,
1197
- "object_fit": null,
1198
- "object_position": null,
1199
- "order": null,
1200
- "overflow": null,
1201
- "overflow_x": null,
1202
- "overflow_y": null,
1203
- "padding": null,
1204
- "right": null,
1205
- "top": null,
1206
- "visibility": null,
1207
- "width": null
1208
- }
1209
- },
1210
- "d8f25f94560f4d059118aac87b59e57e": {
1211
- "model_module": "@jupyter-widgets/controls",
1212
- "model_name": "ButtonStyleModel",
1213
- "model_module_version": "1.5.0",
1214
- "state": {
1215
- "_model_module": "@jupyter-widgets/controls",
1216
- "_model_module_version": "1.5.0",
1217
- "_model_name": "ButtonStyleModel",
1218
- "_view_count": null,
1219
- "_view_module": "@jupyter-widgets/base",
1220
- "_view_module_version": "1.2.0",
1221
- "_view_name": "StyleView",
1222
- "button_color": null,
1223
- "font_weight": ""
1224
- }
1225
- }
1226
- }
1227
- }
1228
- },
1229
- "cells": [
1230
- {
1231
- "cell_type": "code",
1232
- "execution_count": 1,
1233
- "metadata": {
1234
- "colab": {
1235
- "base_uri": "https://localhost:8080/"
1236
- },
1237
- "id": "rOrtDdvN7bEU",
1238
- "outputId": "6eca586b-2f48-4f14-9e4c-5b22a816d88d"
1239
- },
1240
- "outputs": [
1241
- {
1242
- "output_type": "stream",
1243
- "name": "stdout",
1244
- "text": [
1245
- "Requirement already satisfied: datasets in /usr/local/lib/python3.7/dist-packages (2.1.0)\n",
1246
- "Requirement already satisfied: transformers[sentencepiece] in /usr/local/lib/python3.7/dist-packages (4.18.0)\n",
1247
- "Requirement already satisfied: fsspec[http]>=2021.05.0 in /usr/local/lib/python3.7/dist-packages (from datasets) (2022.3.0)\n",
1248
- "Requirement already satisfied: pandas in /usr/local/lib/python3.7/dist-packages (from datasets) (1.3.5)\n",
1249
- "Requirement already satisfied: aiohttp in /usr/local/lib/python3.7/dist-packages (from datasets) (3.8.1)\n",
1250
- "Requirement already satisfied: packaging in /usr/local/lib/python3.7/dist-packages (from datasets) (21.3)\n",
1251
- "Requirement already satisfied: pyarrow>=5.0.0 in /usr/local/lib/python3.7/dist-packages (from datasets) (6.0.1)\n",
1252
- "Requirement already satisfied: responses<0.19 in /usr/local/lib/python3.7/dist-packages (from datasets) (0.18.0)\n",
1253
- "Requirement already satisfied: huggingface-hub<1.0.0,>=0.1.0 in /usr/local/lib/python3.7/dist-packages (from datasets) (0.5.1)\n",
1254
- "Requirement already satisfied: xxhash in /usr/local/lib/python3.7/dist-packages (from datasets) (3.0.0)\n",
1255
- "Requirement already satisfied: multiprocess in /usr/local/lib/python3.7/dist-packages (from datasets) (0.70.12.2)\n",
1256
- "Requirement already satisfied: numpy>=1.17 in /usr/local/lib/python3.7/dist-packages (from datasets) (1.21.5)\n",
1257
- "Requirement already satisfied: importlib-metadata in /usr/local/lib/python3.7/dist-packages (from datasets) (4.11.3)\n",
1258
- "Requirement already satisfied: tqdm>=4.62.1 in /usr/local/lib/python3.7/dist-packages (from datasets) (4.64.0)\n",
1259
- "Requirement already satisfied: requests>=2.19.0 in /usr/local/lib/python3.7/dist-packages (from datasets) (2.23.0)\n",
1260
- "Requirement already satisfied: dill in /usr/local/lib/python3.7/dist-packages (from datasets) (0.3.4)\n",
1261
- "Requirement already satisfied: pyyaml in /usr/local/lib/python3.7/dist-packages (from huggingface-hub<1.0.0,>=0.1.0->datasets) (6.0)\n",
1262
- "Requirement already satisfied: typing-extensions>=3.7.4.3 in /usr/local/lib/python3.7/dist-packages (from huggingface-hub<1.0.0,>=0.1.0->datasets) (4.1.1)\n",
1263
- "Requirement already satisfied: filelock in /usr/local/lib/python3.7/dist-packages (from huggingface-hub<1.0.0,>=0.1.0->datasets) (3.6.0)\n",
1264
- "Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in /usr/local/lib/python3.7/dist-packages (from packaging->datasets) (3.0.8)\n",
1265
- "Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /usr/local/lib/python3.7/dist-packages (from requests>=2.19.0->datasets) (1.25.11)\n",
1266
- "Requirement already satisfied: chardet<4,>=3.0.2 in /usr/local/lib/python3.7/dist-packages (from requests>=2.19.0->datasets) (3.0.4)\n",
1267
- "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.7/dist-packages (from requests>=2.19.0->datasets) (2021.10.8)\n",
1268
- "Requirement already satisfied: idna<3,>=2.5 in /usr/local/lib/python3.7/dist-packages (from requests>=2.19.0->datasets) (2.10)\n",
1269
- "Requirement already satisfied: asynctest==0.13.0 in /usr/local/lib/python3.7/dist-packages (from aiohttp->datasets) (0.13.0)\n",
1270
- "Requirement already satisfied: frozenlist>=1.1.1 in /usr/local/lib/python3.7/dist-packages (from aiohttp->datasets) (1.3.0)\n",
1271
- "Requirement already satisfied: charset-normalizer<3.0,>=2.0 in /usr/local/lib/python3.7/dist-packages (from aiohttp->datasets) (2.0.12)\n",
1272
- "Requirement already satisfied: yarl<2.0,>=1.0 in /usr/local/lib/python3.7/dist-packages (from aiohttp->datasets) (1.7.2)\n",
1273
- "Requirement already satisfied: async-timeout<5.0,>=4.0.0a3 in /usr/local/lib/python3.7/dist-packages (from aiohttp->datasets) (4.0.2)\n",
1274
- "Requirement already satisfied: aiosignal>=1.1.2 in /usr/local/lib/python3.7/dist-packages (from aiohttp->datasets) (1.2.0)\n",
1275
- "Requirement already satisfied: attrs>=17.3.0 in /usr/local/lib/python3.7/dist-packages (from aiohttp->datasets) (21.4.0)\n",
1276
- "Requirement already satisfied: multidict<7.0,>=4.5 in /usr/local/lib/python3.7/dist-packages (from aiohttp->datasets) (6.0.2)\n",
1277
- "Requirement already satisfied: zipp>=0.5 in /usr/local/lib/python3.7/dist-packages (from importlib-metadata->datasets) (3.8.0)\n",
1278
- "Requirement already satisfied: python-dateutil>=2.7.3 in /usr/local/lib/python3.7/dist-packages (from pandas->datasets) (2.8.2)\n",
1279
- "Requirement already satisfied: pytz>=2017.3 in /usr/local/lib/python3.7/dist-packages (from pandas->datasets) (2018.9)\n",
1280
- "Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.7/dist-packages (from python-dateutil>=2.7.3->pandas->datasets) (1.15.0)\n",
1281
- "Requirement already satisfied: regex!=2019.12.17 in /usr/local/lib/python3.7/dist-packages (from transformers[sentencepiece]) (2019.12.20)\n",
1282
- "Requirement already satisfied: sacremoses in /usr/local/lib/python3.7/dist-packages (from transformers[sentencepiece]) (0.0.49)\n",
1283
- "Requirement already satisfied: tokenizers!=0.11.3,<0.13,>=0.11.1 in /usr/local/lib/python3.7/dist-packages (from transformers[sentencepiece]) (0.12.1)\n",
1284
- "Requirement already satisfied: sentencepiece!=0.1.92,>=0.1.91 in /usr/local/lib/python3.7/dist-packages (from transformers[sentencepiece]) (0.1.96)\n",
1285
- "Requirement already satisfied: protobuf in /usr/local/lib/python3.7/dist-packages (from transformers[sentencepiece]) (3.17.3)\n",
1286
- "Requirement already satisfied: joblib in /usr/local/lib/python3.7/dist-packages (from sacremoses->transformers[sentencepiece]) (1.1.0)\n",
1287
- "Requirement already satisfied: click in /usr/local/lib/python3.7/dist-packages (from sacremoses->transformers[sentencepiece]) (7.1.2)\n"
1288
- ]
1289
- }
1290
- ],
1291
- "source": [
1292
- "!pip install datasets transformers[sentencepiece]"
1293
- ]
1294
- },
1295
- {
1296
- "cell_type": "code",
1297
- "source": [
1298
- "from datasets import load_dataset\n",
1299
- "\n",
1300
- "raw_datasets = load_dataset(\"rotten_tomatoes\")\n",
1301
- "raw_datasets"
1302
- ],
1303
- "metadata": {
1304
- "colab": {
1305
- "base_uri": "https://localhost:8080/",
1306
- "height": 347,
1307
- "referenced_widgets": [
1308
- "b2c8869e01924bd3b30e1da599dc3cf6",
1309
- "b78d7e8953af417d9fc04a346986c630",
1310
- "8472b0e321f04f05b114a3848fbed728",
1311
- "d129e68f8f164fdbaadd55ec4fedc62a",
1312
- "a468f4aef59c45079602e6c1823f4d52",
1313
- "a5699544148749c3a5ac06e8e2cf1eb0",
1314
- "8f65c0fb047e4eb1976715f116feaaa0",
1315
- "94c106408b8f467c951b02ef94d14455",
1316
- "de1d0c2f3cf241c8bdc0ae2ed93e7393",
1317
- "1517628d17d648fd921559a46911e7d9",
1318
- "92076243b11644aca9d8a6b5e9a50474"
1319
- ]
1320
- },
1321
- "id": "TthqPvv99WCm",
1322
- "outputId": "11361e7e-6144-470c-f266-8bb3dc2e43a7"
1323
- },
1324
- "execution_count": 2,
1325
- "outputs": [
1326
- {
1327
- "output_type": "stream",
1328
- "name": "stderr",
1329
- "text": [
1330
- "Using custom data configuration default\n",
1331
- "Reusing dataset rotten_tomatoes_movie_review (/root/.cache/huggingface/datasets/rotten_tomatoes_movie_review/default/1.0.0/40d411e45a6ce3484deed7cc15b82a53dad9a72aafd9f86f8f227134bec5ca46)\n"
1332
- ]
1333
- },
1334
- {
1335
- "output_type": "display_data",
1336
- "data": {
1337
- "text/plain": [
1338
- " 0%| | 0/3 [00:00<?, ?it/s]"
1339
- ],
1340
- "application/vnd.jupyter.widget-view+json": {
1341
- "version_major": 2,
1342
- "version_minor": 0,
1343
- "model_id": "b2c8869e01924bd3b30e1da599dc3cf6"
1344
- }
1345
- },
1346
- "metadata": {}
1347
- },
1348
- {
1349
- "output_type": "execute_result",
1350
- "data": {
1351
- "text/plain": [
1352
- "DatasetDict({\n",
1353
- " train: Dataset({\n",
1354
- " features: ['text', 'label'],\n",
1355
- " num_rows: 8530\n",
1356
- " })\n",
1357
- " validation: Dataset({\n",
1358
- " features: ['text', 'label'],\n",
1359
- " num_rows: 1066\n",
1360
- " })\n",
1361
- " test: Dataset({\n",
1362
- " features: ['text', 'label'],\n",
1363
- " num_rows: 1066\n",
1364
- " })\n",
1365
- "})"
1366
- ]
1367
- },
1368
- "metadata": {},
1369
- "execution_count": 2
1370
- }
1371
- ]
1372
- },
1373
- {
1374
- "cell_type": "code",
1375
- "source": [
1376
- "raw_train_dataset = raw_datasets[\"train\"]\n",
1377
- "\n",
1378
- "raw_train_dataset[0]\n",
1379
- "\n",
1380
- "raw_train_dataset.features\n",
1381
- "\n",
1382
- "\"\"\"\n",
1383
- "{'label': ClassLabel(num_classes=2, names=['neg', 'pos'], id=None),\n",
1384
- " 'text': Value(dtype='string', id=None)}\n",
1385
- "\"\"\"\n"
1386
- ],
1387
- "metadata": {
1388
- "colab": {
1389
- "base_uri": "https://localhost:8080/",
1390
- "height": 35
1391
- },
1392
- "id": "tBtBW_v2v-2u",
1393
- "outputId": "4490c217-6795-423d-ef40-34dc0f41b3b9"
1394
- },
1395
- "execution_count": 3,
1396
- "outputs": [
1397
- {
1398
- "output_type": "execute_result",
1399
- "data": {
1400
- "text/plain": [
1401
- "\"\\n{'label': ClassLabel(num_classes=2, names=['neg', 'pos'], id=None),\\n 'text': Value(dtype='string', id=None)}\\n\""
1402
- ],
1403
- "application/vnd.google.colaboratory.intrinsic+json": {
1404
- "type": "string"
1405
- }
1406
- },
1407
- "metadata": {},
1408
- "execution_count": 3
1409
- }
1410
- ]
1411
- },
1412
- {
1413
- "cell_type": "code",
1414
- "source": [
1415
- "from transformers import AutoTokenizer\n",
1416
- "\n",
1417
- "checkpoint = \"bert-base-uncased\"\n",
1418
- "tokenizer = AutoTokenizer.from_pretrained(checkpoint)\n",
1419
- "tokenized_sentences = tokenizer(raw_datasets[\"train\"][\"text\"])"
1420
- ],
1421
- "metadata": {
1422
- "id": "FR2UqTGrwc9Q"
1423
- },
1424
- "execution_count": 4,
1425
- "outputs": []
1426
- },
1427
- {
1428
- "cell_type": "code",
1429
- "source": [
1430
- "testinput = tokenizer(\"This was such a great movie. I love the Rock!\")\n",
1431
- "\n",
1432
- "testinput"
1433
- ],
1434
- "metadata": {
1435
- "colab": {
1436
- "base_uri": "https://localhost:8080/"
1437
- },
1438
- "id": "lfdW00_0w34X",
1439
- "outputId": "7797d31c-4808-4f3d-961c-24158546b433"
1440
- },
1441
- "execution_count": 5,
1442
- "outputs": [
1443
- {
1444
- "output_type": "execute_result",
1445
- "data": {
1446
- "text/plain": [
1447
- "{'input_ids': [101, 2023, 2001, 2107, 1037, 2307, 3185, 1012, 1045, 2293, 1996, 2600, 999, 102], 'token_type_ids': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 'attention_mask': [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]}"
1448
- ]
1449
- },
1450
- "metadata": {},
1451
- "execution_count": 5
1452
- }
1453
- ]
1454
- },
1455
- {
1456
- "cell_type": "code",
1457
- "source": [
1458
- "tokenizer.convert_ids_to_tokens(testinput[\"input_ids\"])"
1459
- ],
1460
- "metadata": {
1461
- "colab": {
1462
- "base_uri": "https://localhost:8080/"
1463
- },
1464
- "id": "4IH99a3lxYST",
1465
- "outputId": "88a7288b-e6db-4c1c-dc69-19449b5ff234"
1466
- },
1467
- "execution_count": 6,
1468
- "outputs": [
1469
- {
1470
- "output_type": "execute_result",
1471
- "data": {
1472
- "text/plain": [
1473
- "['[CLS]',\n",
1474
- " 'this',\n",
1475
- " 'was',\n",
1476
- " 'such',\n",
1477
- " 'a',\n",
1478
- " 'great',\n",
1479
- " 'movie',\n",
1480
- " '.',\n",
1481
- " 'i',\n",
1482
- " 'love',\n",
1483
- " 'the',\n",
1484
- " 'rock',\n",
1485
- " '!',\n",
1486
- " '[SEP]']"
1487
- ]
1488
- },
1489
- "metadata": {},
1490
- "execution_count": 6
1491
- }
1492
- ]
1493
- },
1494
- {
1495
- "cell_type": "code",
1496
- "source": [
1497
- "def tokenize_function(example):\n",
1498
- " return tokenizer(example[\"text\"], truncation=True)"
1499
- ],
1500
- "metadata": {
1501
- "id": "EtyUDfwJx1n1"
1502
- },
1503
- "execution_count": 7,
1504
- "outputs": []
1505
- },
1506
- {
1507
- "cell_type": "code",
1508
- "source": [
1509
- "tokenized_datasets = raw_datasets.map(tokenize_function, batched=True)\n",
1510
- "tokenized_datasets"
1511
- ],
1512
- "metadata": {
1513
- "colab": {
1514
- "base_uri": "https://localhost:8080/",
1515
- "height": 347,
1516
- "referenced_widgets": [
1517
- "c7ce86b66a054deca4b610724bfe26e7",
1518
- "9509cbd89f29485e93645e858d1854bd",
1519
- "6058900f38044262b4a9c120e8163cc0",
1520
- "54ee1642c9854b0c99844c92d9078ea4",
1521
- "749f0330c5ab40a7a554b4bc356794fe",
1522
- "90038345ae5342d2a90e9867259465de",
1523
- "81f5ba6f4c884ddab69a728450778e46",
1524
- "82750a5a76d4478695c67fbe126af2c4",
1525
- "4182914b11d649e183fc5a8fbe48f736",
1526
- "e766763d78334f1980ab87cce25a2647",
1527
- "07a34b10d63345ccb04d79e20696b3db"
1528
- ]
1529
- },
1530
- "id": "8nrUw_ymyP5A",
1531
- "outputId": "a432aeaa-4c64-4977-e458-54162e7d3390"
1532
- },
1533
- "execution_count": 8,
1534
- "outputs": [
1535
- {
1536
- "output_type": "stream",
1537
- "name": "stderr",
1538
- "text": [
1539
- "Loading cached processed dataset at /root/.cache/huggingface/datasets/rotten_tomatoes_movie_review/default/1.0.0/40d411e45a6ce3484deed7cc15b82a53dad9a72aafd9f86f8f227134bec5ca46/cache-ceebcef5f295ef0f.arrow\n"
1540
- ]
1541
- },
1542
- {
1543
- "output_type": "display_data",
1544
- "data": {
1545
- "text/plain": [
1546
- " 0%| | 0/2 [00:00<?, ?ba/s]"
1547
- ],
1548
- "application/vnd.jupyter.widget-view+json": {
1549
- "version_major": 2,
1550
- "version_minor": 0,
1551
- "model_id": "c7ce86b66a054deca4b610724bfe26e7"
1552
- }
1553
- },
1554
- "metadata": {}
1555
- },
1556
- {
1557
- "output_type": "stream",
1558
- "name": "stderr",
1559
- "text": [
1560
- "Loading cached processed dataset at /root/.cache/huggingface/datasets/rotten_tomatoes_movie_review/default/1.0.0/40d411e45a6ce3484deed7cc15b82a53dad9a72aafd9f86f8f227134bec5ca46/cache-770deedb5b2d9165.arrow\n"
1561
- ]
1562
- },
1563
- {
1564
- "output_type": "execute_result",
1565
- "data": {
1566
- "text/plain": [
1567
- "DatasetDict({\n",
1568
- " train: Dataset({\n",
1569
- " features: ['text', 'label', 'input_ids', 'token_type_ids', 'attention_mask'],\n",
1570
- " num_rows: 8530\n",
1571
- " })\n",
1572
- " validation: Dataset({\n",
1573
- " features: ['text', 'label', 'input_ids', 'token_type_ids', 'attention_mask'],\n",
1574
- " num_rows: 1066\n",
1575
- " })\n",
1576
- " test: Dataset({\n",
1577
- " features: ['text', 'label', 'input_ids', 'token_type_ids', 'attention_mask'],\n",
1578
- " num_rows: 1066\n",
1579
- " })\n",
1580
- "})"
1581
- ]
1582
- },
1583
- "metadata": {},
1584
- "execution_count": 8
1585
- }
1586
- ]
1587
- },
1588
- {
1589
- "cell_type": "code",
1590
- "source": [
1591
- "from transformers import DataCollatorWithPadding\n",
1592
- "\n",
1593
- "\n",
1594
- "data_collator = DataCollatorWithPadding(tokenizer=tokenizer, return_tensors=\"tf\")"
1595
- ],
1596
- "metadata": {
1597
- "id": "m9rIneKryojU"
1598
- },
1599
- "execution_count": 9,
1600
- "outputs": []
1601
- },
1602
- {
1603
- "cell_type": "code",
1604
- "source": [
1605
- "#testing stuff\n",
1606
- "samples = tokenized_datasets[\"train\"][:8]\n",
1607
- "samples = {k: v for k, v in samples.items() if k not in [\"text\"]}\n",
1608
- "[len(x) for x in samples[\"input_ids\"]]"
1609
- ],
1610
- "metadata": {
1611
- "colab": {
1612
- "base_uri": "https://localhost:8080/"
1613
- },
1614
- "id": "a9MtJ7-XysT_",
1615
- "outputId": "97581a4c-121a-4885-c215-edca3cecd01c"
1616
- },
1617
- "execution_count": 10,
1618
- "outputs": [
1619
- {
1620
- "output_type": "execute_result",
1621
- "data": {
1622
- "text/plain": [
1623
- "[47, 52, 10, 24, 28, 32, 11, 22]"
1624
- ]
1625
- },
1626
- "metadata": {},
1627
- "execution_count": 10
1628
- }
1629
- ]
1630
- },
1631
- {
1632
- "cell_type": "code",
1633
- "source": [
1634
- "#testing stuff\n",
1635
- "\n",
1636
- "batch = data_collator(samples)\n",
1637
- "{k: v.shape for k, v in batch.items()}"
1638
- ],
1639
- "metadata": {
1640
- "colab": {
1641
- "base_uri": "https://localhost:8080/"
1642
- },
1643
- "id": "r52HTH-FzCaL",
1644
- "outputId": "ebcf18f1-0329-4508-c401-5fe30cb6c997"
1645
- },
1646
- "execution_count": 11,
1647
- "outputs": [
1648
- {
1649
- "output_type": "execute_result",
1650
- "data": {
1651
- "text/plain": [
1652
- "{'attention_mask': TensorShape([8, 52]),\n",
1653
- " 'input_ids': TensorShape([8, 52]),\n",
1654
- " 'labels': TensorShape([8]),\n",
1655
- " 'token_type_ids': TensorShape([8, 52])}"
1656
- ]
1657
- },
1658
- "metadata": {},
1659
- "execution_count": 11
1660
- }
1661
- ]
1662
- },
1663
- {
1664
- "cell_type": "code",
1665
- "source": [
1666
- "tf_train_dataset = tokenized_datasets[\"train\"].to_tf_dataset(\n",
1667
- " columns=[\"attention_mask\", \"input_ids\", \"token_type_ids\"],\n",
1668
- " label_cols=[\"labels\"],\n",
1669
- " shuffle=True,\n",
1670
- " collate_fn=data_collator,\n",
1671
- " batch_size=8,\n",
1672
- ")\n",
1673
- "\n",
1674
- "tf_validation_dataset = tokenized_datasets[\"validation\"].to_tf_dataset(\n",
1675
- " columns=[\"attention_mask\", \"input_ids\", \"token_type_ids\"],\n",
1676
- " label_cols=[\"labels\"],\n",
1677
- " shuffle=False,\n",
1678
- " collate_fn=data_collator,\n",
1679
- " batch_size=8,\n",
1680
- ")"
1681
- ],
1682
- "metadata": {
1683
- "id": "31OzmHYxzSqp"
1684
- },
1685
- "execution_count": 12,
1686
- "outputs": []
1687
- },
1688
- {
1689
- "cell_type": "code",
1690
- "source": [
1691
- "from transformers import TFAutoModelForSequenceClassification\n",
1692
- "\n",
1693
- "model = TFAutoModelForSequenceClassification.from_pretrained(checkpoint, num_labels=2)"
1694
- ],
1695
- "metadata": {
1696
- "colab": {
1697
- "base_uri": "https://localhost:8080/"
1698
- },
1699
- "id": "x_La1cFMzo8-",
1700
- "outputId": "6a39ed6b-0795-4a1f-d03b-e88a7b98e32d"
1701
- },
1702
- "execution_count": 13,
1703
- "outputs": [
1704
- {
1705
- "output_type": "stream",
1706
- "name": "stderr",
1707
- "text": [
1708
- "All model checkpoint layers were used when initializing TFBertForSequenceClassification.\n",
1709
- "\n",
1710
- "Some layers of TFBertForSequenceClassification were not initialized from the model checkpoint at bert-base-uncased and are newly initialized: ['classifier']\n",
1711
- "You should probably TRAIN this model on a down-stream task to be able to use it for predictions and inference.\n"
1712
- ]
1713
- }
1714
- ]
1715
- },
1716
- {
1717
- "cell_type": "code",
1718
- "source": [
1719
- "from tensorflow.keras.optimizers.schedules import PolynomialDecay\n",
1720
- "\n",
1721
- "batch_size = 8\n",
1722
- "num_epochs = 3\n",
1723
- "# The number of training steps is the number of samples in the dataset, divided by the batch size then multiplied\n",
1724
- "# by the total number of epochs. Note that the tf_train_dataset here is a batched tf.data.Dataset,\n",
1725
- "# not the original Hugging Face Dataset, so its len() is already num_samples // batch_size.\n",
1726
- "num_train_steps = len(tf_train_dataset) * num_epochs\n",
1727
- "lr_scheduler = PolynomialDecay(\n",
1728
- " initial_learning_rate=5e-5, end_learning_rate=0.0, decay_steps=num_train_steps\n",
1729
- ")\n",
1730
- "from tensorflow.keras.optimizers import Adam\n",
1731
- "\n",
1732
- "opt = Adam(learning_rate=lr_scheduler)"
1733
- ],
1734
- "metadata": {
1735
- "id": "ci4MrtN52Ha2"
1736
- },
1737
- "execution_count": 14,
1738
- "outputs": []
1739
- },
1740
- {
1741
- "cell_type": "code",
1742
- "source": [
1743
- "import tensorflow as tf\n",
1744
- "\n",
1745
- "model = TFAutoModelForSequenceClassification.from_pretrained(checkpoint, num_labels=2)\n",
1746
- "loss = tf.keras.losses.SparseCategoricalCrossentropy(from_logits=True)\n",
1747
- "model.compile(optimizer=opt, loss=loss, metrics=[\"accuracy\"])"
1748
- ],
1749
- "metadata": {
1750
- "colab": {
1751
- "base_uri": "https://localhost:8080/"
1752
- },
1753
- "id": "voYz7Uh52QFN",
1754
- "outputId": "bb779057-6564-4011-e393-e6528f038113"
1755
- },
1756
- "execution_count": 17,
1757
- "outputs": [
1758
- {
1759
- "output_type": "stream",
1760
- "name": "stderr",
1761
- "text": [
1762
- "All model checkpoint layers were used when initializing TFBertForSequenceClassification.\n",
1763
- "\n",
1764
- "Some layers of TFBertForSequenceClassification were not initialized from the model checkpoint at bert-base-uncased and are newly initialized: ['classifier']\n",
1765
- "You should probably TRAIN this model on a down-stream task to be able to use it for predictions and inference.\n"
1766
- ]
1767
- }
1768
- ]
1769
- },
1770
- {
1771
- "cell_type": "code",
1772
- "source": [
1773
- "from huggingface_hub import notebook_login\n",
1774
- "\n",
1775
- "notebook_login()"
1776
- ],
1777
- "metadata": {
1778
- "colab": {
1779
- "base_uri": "https://localhost:8080/",
1780
- "height": 387,
1781
- "referenced_widgets": [
1782
- "7c5c49fb2cf145a4bc810796fd65c562",
1783
- "468d65d5b83c43ab98ce67d67b0a40db",
1784
- "bc1b9bd452a7421383c3be4624664f3b",
1785
- "9050bbfe7e254cbe97d5b2c325a40020",
1786
- "44178aa1b5094162924343143f96b3df",
1787
- "36736e8bb1044e3196054ef0051d3aaf",
1788
- "f81d06c54ab24ac5bccbf33a674b6861",
1789
- "5a638757395543afbdacdd4b6050a907",
1790
- "6cbc7fbac75f4e3bb2ab1b95adda9537",
1791
- "166f8f382d4747149dcafd6e783793c1",
1792
- "6a0bcc7faeb74b039fb08867b178b5b0",
1793
- "80258fcebfdd47128678d8d78583229f",
1794
- "4d82511f744f4769a04b084d9d661199",
1795
- "3c3c7d2e327b41e8be80f5862d39567a",
1796
- "932f21e57e804560b21535d78286f6d3",
1797
- "60c8669178d041e5a7bafea98a889e91",
1798
- "d8f25f94560f4d059118aac87b59e57e"
1799
- ]
1800
- },
1801
- "id": "g_TTz5gQ_jED",
1802
- "outputId": "bd5c4a76-0bc1-4553-d06e-f1ac908cedae"
1803
- },
1804
- "execution_count": 18,
1805
- "outputs": [
1806
- {
1807
- "output_type": "stream",
1808
- "name": "stdout",
1809
- "text": [
1810
- "Login successful\n",
1811
- "Your token has been saved to /root/.huggingface/token\n",
1812
- "\u001b[1m\u001b[31mAuthenticated through git-credential store but this isn't the helper defined on your machine.\n",
1813
- "You might have to re-authenticate when pushing to the Hugging Face Hub. Run the following command in your terminal in case you want to set this credential helper as the default\n",
1814
- "\n",
1815
- "git config --global credential.helper store\u001b[0m\n"
1816
- ]
1817
- }
1818
- ]
1819
- },
1820
- {
1821
- "cell_type": "code",
1822
- "source": [
1823
- "!pwd"
1824
- ],
1825
- "metadata": {
1826
- "colab": {
1827
- "base_uri": "https://localhost:8080/"
1828
- },
1829
- "id": "dMwP8qKYAv-w",
1830
- "outputId": "0990fcd9-8b33-4eca-c15b-31287ac2a2a9"
1831
- },
1832
- "execution_count": 21,
1833
- "outputs": [
1834
- {
1835
- "output_type": "stream",
1836
- "name": "stdout",
1837
- "text": [
1838
- "/content\n"
1839
- ]
1840
- }
1841
- ]
1842
- },
1843
- {
1844
- "cell_type": "code",
1845
- "source": [
1846
- "model.fit(tf_train_dataset, validation_data=tf_validation_dataset, epochs=3)"
1847
- ],
1848
- "metadata": {
1849
- "colab": {
1850
- "base_uri": "https://localhost:8080/",
1851
- "height": 346
1852
- },
1853
- "id": "61iWNecS2WtZ",
1854
- "outputId": "524ad8ae-131e-4a38-82c1-c44d7a26a3c8"
1855
- },
1856
- "execution_count": 16,
1857
- "outputs": [
1858
- {
1859
- "output_type": "stream",
1860
- "name": "stdout",
1861
- "text": [
1862
- "Epoch 1/3\n",
1863
- " 561/1066 [==============>...............] - ETA: 54s - loss: 0.4711 - accuracy: 0.7774"
1864
- ]
1865
- },
1866
- {
1867
- "output_type": "error",
1868
- "ename": "KeyboardInterrupt",
1869
- "evalue": "ignored",
1870
- "traceback": [
1871
- "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
1872
- "\u001b[0;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)",
1873
- "\u001b[0;32m<ipython-input-16-f386944e68f4>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mmodel\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mfit\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtf_train_dataset\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mvalidation_data\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mtf_validation_dataset\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mepochs\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m3\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
1874
- "\u001b[0;32m/usr/local/lib/python3.7/dist-packages/keras/utils/traceback_utils.py\u001b[0m in \u001b[0;36merror_handler\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m 62\u001b[0m \u001b[0mfiltered_tb\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 63\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 64\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mfn\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 65\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mException\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0me\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0;31m# pylint: disable=broad-except\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 66\u001b[0m \u001b[0mfiltered_tb\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0m_process_traceback_frames\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0me\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__traceback__\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
1875
- "\u001b[0;32m/usr/local/lib/python3.7/dist-packages/keras/engine/training.py\u001b[0m in \u001b[0;36mfit\u001b[0;34m(self, x, y, batch_size, epochs, verbose, callbacks, validation_split, validation_data, shuffle, class_weight, sample_weight, initial_epoch, steps_per_epoch, validation_steps, validation_batch_size, validation_freq, max_queue_size, workers, use_multiprocessing)\u001b[0m\n\u001b[1;32m 1382\u001b[0m _r=1):\n\u001b[1;32m 1383\u001b[0m \u001b[0mcallbacks\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mon_train_batch_begin\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mstep\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1384\u001b[0;31m \u001b[0mtmp_logs\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtrain_function\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0miterator\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1385\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mdata_handler\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mshould_sync\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1386\u001b[0m \u001b[0mcontext\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0masync_wait\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
1876
- "\u001b[0;32m/usr/local/lib/python3.7/dist-packages/tensorflow/python/util/traceback_utils.py\u001b[0m in \u001b[0;36merror_handler\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m 148\u001b[0m \u001b[0mfiltered_tb\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 149\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 150\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mfn\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 151\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mException\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0me\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 152\u001b[0m \u001b[0mfiltered_tb\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0m_process_traceback_frames\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0me\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__traceback__\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
1877
- "\u001b[0;32m/usr/local/lib/python3.7/dist-packages/tensorflow/python/eager/def_function.py\u001b[0m in \u001b[0;36m__call__\u001b[0;34m(self, *args, **kwds)\u001b[0m\n\u001b[1;32m 913\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 914\u001b[0m \u001b[0;32mwith\u001b[0m \u001b[0mOptionalXlaContext\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_jit_compile\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 915\u001b[0;31m \u001b[0mresult\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_call\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwds\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 916\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 917\u001b[0m \u001b[0mnew_tracing_count\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mexperimental_get_tracing_count\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
1878
- "\u001b[0;32m/usr/local/lib/python3.7/dist-packages/tensorflow/python/eager/def_function.py\u001b[0m in \u001b[0;36m_call\u001b[0;34m(self, *args, **kwds)\u001b[0m\n\u001b[1;32m 945\u001b[0m \u001b[0;31m# In this case we have created variables on the first call, so we run the\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 946\u001b[0m \u001b[0;31m# defunned version which is guaranteed to never create variables.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 947\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_stateless_fn\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwds\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;31m# pylint: disable=not-callable\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 948\u001b[0m \u001b[0;32melif\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_stateful_fn\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 949\u001b[0m \u001b[0;31m# Release the lock early so that multiple threads can perform the call\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
1879
- "\u001b[0;32m/usr/local/lib/python3.7/dist-packages/tensorflow/python/eager/function.py\u001b[0m in \u001b[0;36m__call__\u001b[0;34m(self, *args, **kwargs)\u001b[0m\n\u001b[1;32m 2955\u001b[0m filtered_flat_args) = self._maybe_define_function(args, kwargs)\n\u001b[1;32m 2956\u001b[0m return graph_function._call_flat(\n\u001b[0;32m-> 2957\u001b[0;31m filtered_flat_args, captured_inputs=graph_function.captured_inputs) # pylint: disable=protected-access\n\u001b[0m\u001b[1;32m 2958\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 2959\u001b[0m \u001b[0;34m@\u001b[0m\u001b[0mproperty\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
1880
- "\u001b[0;32m/usr/local/lib/python3.7/dist-packages/tensorflow/python/eager/function.py\u001b[0m in \u001b[0;36m_call_flat\u001b[0;34m(self, args, captured_inputs, cancellation_manager)\u001b[0m\n\u001b[1;32m 1852\u001b[0m \u001b[0;31m# No tape is watching; skip to running the function.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1853\u001b[0m return self._build_call_outputs(self._inference_function.call(\n\u001b[0;32m-> 1854\u001b[0;31m ctx, args, cancellation_manager=cancellation_manager))\n\u001b[0m\u001b[1;32m 1855\u001b[0m forward_backward = self._select_forward_and_backward_functions(\n\u001b[1;32m 1856\u001b[0m \u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
1881
- "\u001b[0;32m/usr/local/lib/python3.7/dist-packages/tensorflow/python/eager/function.py\u001b[0m in \u001b[0;36mcall\u001b[0;34m(self, ctx, args, cancellation_manager)\u001b[0m\n\u001b[1;32m 502\u001b[0m \u001b[0minputs\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 503\u001b[0m \u001b[0mattrs\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mattrs\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 504\u001b[0;31m ctx=ctx)\n\u001b[0m\u001b[1;32m 505\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 506\u001b[0m outputs = execute.execute_with_cancellation(\n",
1882
- "\u001b[0;32m/usr/local/lib/python3.7/dist-packages/tensorflow/python/eager/execute.py\u001b[0m in \u001b[0;36mquick_execute\u001b[0;34m(op_name, num_outputs, inputs, attrs, ctx, name)\u001b[0m\n\u001b[1;32m 53\u001b[0m \u001b[0mctx\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mensure_initialized\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 54\u001b[0m tensors = pywrap_tfe.TFE_Py_Execute(ctx._handle, device_name, op_name,\n\u001b[0;32m---> 55\u001b[0;31m inputs, attrs, num_outputs)\n\u001b[0m\u001b[1;32m 56\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mcore\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_NotOkStatusException\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0me\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 57\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mname\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
1883
- "\u001b[0;31mKeyboardInterrupt\u001b[0m: "
1884
- ]
1885
- }
1886
- ]
1887
- },
1888
- {
1889
- "cell_type": "code",
1890
- "source": [
1891
- ""
1892
- ],
1893
- "metadata": {
1894
- "id": "1lZfs7dP9kEN"
1895
- },
1896
- "execution_count": null,
1897
- "outputs": []
1898
- },
1899
- {
1900
- "cell_type": "code",
1901
- "source": [
1902
- "# testing stuff\n",
1903
- "\n",
1904
- "preds = model.predict(tf_validation_dataset)[\"logits\"]"
1905
- ],
1906
- "metadata": {
1907
- "id": "aq3amorq4Dkr"
1908
- },
1909
- "execution_count": 25,
1910
- "outputs": []
1911
- },
1912
- {
1913
- "cell_type": "code",
1914
- "source": [
1915
- "# testing stuff\n",
1916
- "\n",
1917
- "import numpy as np\n",
1918
- "\n",
1919
- "class_preds = np.argmax(preds, axis=1)\n",
1920
- "print(preds.shape, class_preds.shape)"
1921
- ],
1922
- "metadata": {
1923
- "colab": {
1924
- "base_uri": "https://localhost:8080/"
1925
- },
1926
- "id": "8nttkY0Z4JaU",
1927
- "outputId": "74943ac7-6558-4e7a-a7f6-a567b516ab86"
1928
- },
1929
- "execution_count": 26,
1930
- "outputs": [
1931
- {
1932
- "output_type": "stream",
1933
- "name": "stdout",
1934
- "text": [
1935
- "(1066, 2) (1066,)\n"
1936
- ]
1937
- }
1938
- ]
1939
- }
1940
- ]
1941
- }