lkurakht commited on
Commit
e5851e3
1 Parent(s): 1f936e9

data processing and training

Browse files
Files changed (1) hide show
  1. pt_br_classifier.ipynb +2092 -0
pt_br_classifier.ipynb ADDED
@@ -0,0 +1,2092 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "nbformat": 4,
3
+ "nbformat_minor": 0,
4
+ "metadata": {
5
+ "colab": {
6
+ "provenance": []
7
+ },
8
+ "kernelspec": {
9
+ "name": "python3",
10
+ "display_name": "Python 3"
11
+ },
12
+ "language_info": {
13
+ "name": "python"
14
+ },
15
+ "accelerator": "GPU",
16
+ "gpuClass": "standard",
17
+ "widgets": {
18
+ "application/vnd.jupyter.widget-state+json": {
19
+ "79e7afed6f204ced8012f9853e8ce153": {
20
+ "model_module": "@jupyter-widgets/controls",
21
+ "model_name": "HBoxModel",
22
+ "model_module_version": "1.5.0",
23
+ "state": {
24
+ "_dom_classes": [],
25
+ "_model_module": "@jupyter-widgets/controls",
26
+ "_model_module_version": "1.5.0",
27
+ "_model_name": "HBoxModel",
28
+ "_view_count": null,
29
+ "_view_module": "@jupyter-widgets/controls",
30
+ "_view_module_version": "1.5.0",
31
+ "_view_name": "HBoxView",
32
+ "box_style": "",
33
+ "children": [
34
+ "IPY_MODEL_92e3b0a9ee344022b0bf16a6617239b3",
35
+ "IPY_MODEL_09fa538b6a05498282c2438a6c854fd1",
36
+ "IPY_MODEL_3b905f68919049608a3eb3c48da12032"
37
+ ],
38
+ "layout": "IPY_MODEL_eee35ecb15c84ee994f9ffa479feeaaf"
39
+ }
40
+ },
41
+ "92e3b0a9ee344022b0bf16a6617239b3": {
42
+ "model_module": "@jupyter-widgets/controls",
43
+ "model_name": "HTMLModel",
44
+ "model_module_version": "1.5.0",
45
+ "state": {
46
+ "_dom_classes": [],
47
+ "_model_module": "@jupyter-widgets/controls",
48
+ "_model_module_version": "1.5.0",
49
+ "_model_name": "HTMLModel",
50
+ "_view_count": null,
51
+ "_view_module": "@jupyter-widgets/controls",
52
+ "_view_module_version": "1.5.0",
53
+ "_view_name": "HTMLView",
54
+ "description": "",
55
+ "description_tooltip": null,
56
+ "layout": "IPY_MODEL_c17b6f3b3436490e923835add11f8d74",
57
+ "placeholder": "​",
58
+ "style": "IPY_MODEL_4d5a02eb385d470f8b3c68a8db60561c",
59
+ "value": "Map: 100%"
60
+ }
61
+ },
62
+ "09fa538b6a05498282c2438a6c854fd1": {
63
+ "model_module": "@jupyter-widgets/controls",
64
+ "model_name": "FloatProgressModel",
65
+ "model_module_version": "1.5.0",
66
+ "state": {
67
+ "_dom_classes": [],
68
+ "_model_module": "@jupyter-widgets/controls",
69
+ "_model_module_version": "1.5.0",
70
+ "_model_name": "FloatProgressModel",
71
+ "_view_count": null,
72
+ "_view_module": "@jupyter-widgets/controls",
73
+ "_view_module_version": "1.5.0",
74
+ "_view_name": "ProgressView",
75
+ "bar_style": "",
76
+ "description": "",
77
+ "description_tooltip": null,
78
+ "layout": "IPY_MODEL_7946964d5e8741ba86b2662397ccb891",
79
+ "max": 18000,
80
+ "min": 0,
81
+ "orientation": "horizontal",
82
+ "style": "IPY_MODEL_5624c10fc93943dda1e0c93c1fc2fbba",
83
+ "value": 18000
84
+ }
85
+ },
86
+ "3b905f68919049608a3eb3c48da12032": {
87
+ "model_module": "@jupyter-widgets/controls",
88
+ "model_name": "HTMLModel",
89
+ "model_module_version": "1.5.0",
90
+ "state": {
91
+ "_dom_classes": [],
92
+ "_model_module": "@jupyter-widgets/controls",
93
+ "_model_module_version": "1.5.0",
94
+ "_model_name": "HTMLModel",
95
+ "_view_count": null,
96
+ "_view_module": "@jupyter-widgets/controls",
97
+ "_view_module_version": "1.5.0",
98
+ "_view_name": "HTMLView",
99
+ "description": "",
100
+ "description_tooltip": null,
101
+ "layout": "IPY_MODEL_101f117dfb0a441e807757524b857350",
102
+ "placeholder": "​",
103
+ "style": "IPY_MODEL_77819fe20f514982b8547abff9361b2d",
104
+ "value": " 18000/18000 [00:03<00:00, 5372.46 examples/s]"
105
+ }
106
+ },
107
+ "eee35ecb15c84ee994f9ffa479feeaaf": {
108
+ "model_module": "@jupyter-widgets/base",
109
+ "model_name": "LayoutModel",
110
+ "model_module_version": "1.2.0",
111
+ "state": {
112
+ "_model_module": "@jupyter-widgets/base",
113
+ "_model_module_version": "1.2.0",
114
+ "_model_name": "LayoutModel",
115
+ "_view_count": null,
116
+ "_view_module": "@jupyter-widgets/base",
117
+ "_view_module_version": "1.2.0",
118
+ "_view_name": "LayoutView",
119
+ "align_content": null,
120
+ "align_items": null,
121
+ "align_self": null,
122
+ "border": null,
123
+ "bottom": null,
124
+ "display": null,
125
+ "flex": null,
126
+ "flex_flow": null,
127
+ "grid_area": null,
128
+ "grid_auto_columns": null,
129
+ "grid_auto_flow": null,
130
+ "grid_auto_rows": null,
131
+ "grid_column": null,
132
+ "grid_gap": null,
133
+ "grid_row": null,
134
+ "grid_template_areas": null,
135
+ "grid_template_columns": null,
136
+ "grid_template_rows": null,
137
+ "height": null,
138
+ "justify_content": null,
139
+ "justify_items": null,
140
+ "left": null,
141
+ "margin": null,
142
+ "max_height": null,
143
+ "max_width": null,
144
+ "min_height": null,
145
+ "min_width": null,
146
+ "object_fit": null,
147
+ "object_position": null,
148
+ "order": null,
149
+ "overflow": null,
150
+ "overflow_x": null,
151
+ "overflow_y": null,
152
+ "padding": null,
153
+ "right": null,
154
+ "top": null,
155
+ "visibility": "hidden",
156
+ "width": null
157
+ }
158
+ },
159
+ "c17b6f3b3436490e923835add11f8d74": {
160
+ "model_module": "@jupyter-widgets/base",
161
+ "model_name": "LayoutModel",
162
+ "model_module_version": "1.2.0",
163
+ "state": {
164
+ "_model_module": "@jupyter-widgets/base",
165
+ "_model_module_version": "1.2.0",
166
+ "_model_name": "LayoutModel",
167
+ "_view_count": null,
168
+ "_view_module": "@jupyter-widgets/base",
169
+ "_view_module_version": "1.2.0",
170
+ "_view_name": "LayoutView",
171
+ "align_content": null,
172
+ "align_items": null,
173
+ "align_self": null,
174
+ "border": null,
175
+ "bottom": null,
176
+ "display": null,
177
+ "flex": null,
178
+ "flex_flow": null,
179
+ "grid_area": null,
180
+ "grid_auto_columns": null,
181
+ "grid_auto_flow": null,
182
+ "grid_auto_rows": null,
183
+ "grid_column": null,
184
+ "grid_gap": null,
185
+ "grid_row": null,
186
+ "grid_template_areas": null,
187
+ "grid_template_columns": null,
188
+ "grid_template_rows": null,
189
+ "height": null,
190
+ "justify_content": null,
191
+ "justify_items": null,
192
+ "left": null,
193
+ "margin": null,
194
+ "max_height": null,
195
+ "max_width": null,
196
+ "min_height": null,
197
+ "min_width": null,
198
+ "object_fit": null,
199
+ "object_position": null,
200
+ "order": null,
201
+ "overflow": null,
202
+ "overflow_x": null,
203
+ "overflow_y": null,
204
+ "padding": null,
205
+ "right": null,
206
+ "top": null,
207
+ "visibility": null,
208
+ "width": null
209
+ }
210
+ },
211
+ "4d5a02eb385d470f8b3c68a8db60561c": {
212
+ "model_module": "@jupyter-widgets/controls",
213
+ "model_name": "DescriptionStyleModel",
214
+ "model_module_version": "1.5.0",
215
+ "state": {
216
+ "_model_module": "@jupyter-widgets/controls",
217
+ "_model_module_version": "1.5.0",
218
+ "_model_name": "DescriptionStyleModel",
219
+ "_view_count": null,
220
+ "_view_module": "@jupyter-widgets/base",
221
+ "_view_module_version": "1.2.0",
222
+ "_view_name": "StyleView",
223
+ "description_width": ""
224
+ }
225
+ },
226
+ "7946964d5e8741ba86b2662397ccb891": {
227
+ "model_module": "@jupyter-widgets/base",
228
+ "model_name": "LayoutModel",
229
+ "model_module_version": "1.2.0",
230
+ "state": {
231
+ "_model_module": "@jupyter-widgets/base",
232
+ "_model_module_version": "1.2.0",
233
+ "_model_name": "LayoutModel",
234
+ "_view_count": null,
235
+ "_view_module": "@jupyter-widgets/base",
236
+ "_view_module_version": "1.2.0",
237
+ "_view_name": "LayoutView",
238
+ "align_content": null,
239
+ "align_items": null,
240
+ "align_self": null,
241
+ "border": null,
242
+ "bottom": null,
243
+ "display": null,
244
+ "flex": null,
245
+ "flex_flow": null,
246
+ "grid_area": null,
247
+ "grid_auto_columns": null,
248
+ "grid_auto_flow": null,
249
+ "grid_auto_rows": null,
250
+ "grid_column": null,
251
+ "grid_gap": null,
252
+ "grid_row": null,
253
+ "grid_template_areas": null,
254
+ "grid_template_columns": null,
255
+ "grid_template_rows": null,
256
+ "height": null,
257
+ "justify_content": null,
258
+ "justify_items": null,
259
+ "left": null,
260
+ "margin": null,
261
+ "max_height": null,
262
+ "max_width": null,
263
+ "min_height": null,
264
+ "min_width": null,
265
+ "object_fit": null,
266
+ "object_position": null,
267
+ "order": null,
268
+ "overflow": null,
269
+ "overflow_x": null,
270
+ "overflow_y": null,
271
+ "padding": null,
272
+ "right": null,
273
+ "top": null,
274
+ "visibility": null,
275
+ "width": null
276
+ }
277
+ },
278
+ "5624c10fc93943dda1e0c93c1fc2fbba": {
279
+ "model_module": "@jupyter-widgets/controls",
280
+ "model_name": "ProgressStyleModel",
281
+ "model_module_version": "1.5.0",
282
+ "state": {
283
+ "_model_module": "@jupyter-widgets/controls",
284
+ "_model_module_version": "1.5.0",
285
+ "_model_name": "ProgressStyleModel",
286
+ "_view_count": null,
287
+ "_view_module": "@jupyter-widgets/base",
288
+ "_view_module_version": "1.2.0",
289
+ "_view_name": "StyleView",
290
+ "bar_color": null,
291
+ "description_width": ""
292
+ }
293
+ },
294
+ "101f117dfb0a441e807757524b857350": {
295
+ "model_module": "@jupyter-widgets/base",
296
+ "model_name": "LayoutModel",
297
+ "model_module_version": "1.2.0",
298
+ "state": {
299
+ "_model_module": "@jupyter-widgets/base",
300
+ "_model_module_version": "1.2.0",
301
+ "_model_name": "LayoutModel",
302
+ "_view_count": null,
303
+ "_view_module": "@jupyter-widgets/base",
304
+ "_view_module_version": "1.2.0",
305
+ "_view_name": "LayoutView",
306
+ "align_content": null,
307
+ "align_items": null,
308
+ "align_self": null,
309
+ "border": null,
310
+ "bottom": null,
311
+ "display": null,
312
+ "flex": null,
313
+ "flex_flow": null,
314
+ "grid_area": null,
315
+ "grid_auto_columns": null,
316
+ "grid_auto_flow": null,
317
+ "grid_auto_rows": null,
318
+ "grid_column": null,
319
+ "grid_gap": null,
320
+ "grid_row": null,
321
+ "grid_template_areas": null,
322
+ "grid_template_columns": null,
323
+ "grid_template_rows": null,
324
+ "height": null,
325
+ "justify_content": null,
326
+ "justify_items": null,
327
+ "left": null,
328
+ "margin": null,
329
+ "max_height": null,
330
+ "max_width": null,
331
+ "min_height": null,
332
+ "min_width": null,
333
+ "object_fit": null,
334
+ "object_position": null,
335
+ "order": null,
336
+ "overflow": null,
337
+ "overflow_x": null,
338
+ "overflow_y": null,
339
+ "padding": null,
340
+ "right": null,
341
+ "top": null,
342
+ "visibility": null,
343
+ "width": null
344
+ }
345
+ },
346
+ "77819fe20f514982b8547abff9361b2d": {
347
+ "model_module": "@jupyter-widgets/controls",
348
+ "model_name": "DescriptionStyleModel",
349
+ "model_module_version": "1.5.0",
350
+ "state": {
351
+ "_model_module": "@jupyter-widgets/controls",
352
+ "_model_module_version": "1.5.0",
353
+ "_model_name": "DescriptionStyleModel",
354
+ "_view_count": null,
355
+ "_view_module": "@jupyter-widgets/base",
356
+ "_view_module_version": "1.2.0",
357
+ "_view_name": "StyleView",
358
+ "description_width": ""
359
+ }
360
+ },
361
+ "8f76ba596bdc427aa868685b151f51d8": {
362
+ "model_module": "@jupyter-widgets/controls",
363
+ "model_name": "HBoxModel",
364
+ "model_module_version": "1.5.0",
365
+ "state": {
366
+ "_dom_classes": [],
367
+ "_model_module": "@jupyter-widgets/controls",
368
+ "_model_module_version": "1.5.0",
369
+ "_model_name": "HBoxModel",
370
+ "_view_count": null,
371
+ "_view_module": "@jupyter-widgets/controls",
372
+ "_view_module_version": "1.5.0",
373
+ "_view_name": "HBoxView",
374
+ "box_style": "",
375
+ "children": [
376
+ "IPY_MODEL_a14ec2755a2a477aa654287af8a463a3",
377
+ "IPY_MODEL_cb82b162aae342888f353ea2fe507015",
378
+ "IPY_MODEL_ebb3365ce29e476ab28201e9b825e302"
379
+ ],
380
+ "layout": "IPY_MODEL_31e7fabdde2f4129ab38d49b5c5b1d50"
381
+ }
382
+ },
383
+ "a14ec2755a2a477aa654287af8a463a3": {
384
+ "model_module": "@jupyter-widgets/controls",
385
+ "model_name": "HTMLModel",
386
+ "model_module_version": "1.5.0",
387
+ "state": {
388
+ "_dom_classes": [],
389
+ "_model_module": "@jupyter-widgets/controls",
390
+ "_model_module_version": "1.5.0",
391
+ "_model_name": "HTMLModel",
392
+ "_view_count": null,
393
+ "_view_module": "@jupyter-widgets/controls",
394
+ "_view_module_version": "1.5.0",
395
+ "_view_name": "HTMLView",
396
+ "description": "",
397
+ "description_tooltip": null,
398
+ "layout": "IPY_MODEL_b2fb5695afd04756975281c5a04fbcaf",
399
+ "placeholder": "​",
400
+ "style": "IPY_MODEL_6e358ea9a32a486db0c81a5f54a112e9",
401
+ "value": "Map: 100%"
402
+ }
403
+ },
404
+ "cb82b162aae342888f353ea2fe507015": {
405
+ "model_module": "@jupyter-widgets/controls",
406
+ "model_name": "FloatProgressModel",
407
+ "model_module_version": "1.5.0",
408
+ "state": {
409
+ "_dom_classes": [],
410
+ "_model_module": "@jupyter-widgets/controls",
411
+ "_model_module_version": "1.5.0",
412
+ "_model_name": "FloatProgressModel",
413
+ "_view_count": null,
414
+ "_view_module": "@jupyter-widgets/controls",
415
+ "_view_module_version": "1.5.0",
416
+ "_view_name": "ProgressView",
417
+ "bar_style": "",
418
+ "description": "",
419
+ "description_tooltip": null,
420
+ "layout": "IPY_MODEL_647a42b85a8044229d71fd1e7318878b",
421
+ "max": 2000,
422
+ "min": 0,
423
+ "orientation": "horizontal",
424
+ "style": "IPY_MODEL_f439095945fb413e916059f01f67bc79",
425
+ "value": 2000
426
+ }
427
+ },
428
+ "ebb3365ce29e476ab28201e9b825e302": {
429
+ "model_module": "@jupyter-widgets/controls",
430
+ "model_name": "HTMLModel",
431
+ "model_module_version": "1.5.0",
432
+ "state": {
433
+ "_dom_classes": [],
434
+ "_model_module": "@jupyter-widgets/controls",
435
+ "_model_module_version": "1.5.0",
436
+ "_model_name": "HTMLModel",
437
+ "_view_count": null,
438
+ "_view_module": "@jupyter-widgets/controls",
439
+ "_view_module_version": "1.5.0",
440
+ "_view_name": "HTMLView",
441
+ "description": "",
442
+ "description_tooltip": null,
443
+ "layout": "IPY_MODEL_fece699d83854b5e876164da8a3b6f3a",
444
+ "placeholder": "​",
445
+ "style": "IPY_MODEL_814444ea270d4739aa8588937801800b",
446
+ "value": " 2000/2000 [00:00<00:00, 5993.97 examples/s]"
447
+ }
448
+ },
449
+ "31e7fabdde2f4129ab38d49b5c5b1d50": {
450
+ "model_module": "@jupyter-widgets/base",
451
+ "model_name": "LayoutModel",
452
+ "model_module_version": "1.2.0",
453
+ "state": {
454
+ "_model_module": "@jupyter-widgets/base",
455
+ "_model_module_version": "1.2.0",
456
+ "_model_name": "LayoutModel",
457
+ "_view_count": null,
458
+ "_view_module": "@jupyter-widgets/base",
459
+ "_view_module_version": "1.2.0",
460
+ "_view_name": "LayoutView",
461
+ "align_content": null,
462
+ "align_items": null,
463
+ "align_self": null,
464
+ "border": null,
465
+ "bottom": null,
466
+ "display": null,
467
+ "flex": null,
468
+ "flex_flow": null,
469
+ "grid_area": null,
470
+ "grid_auto_columns": null,
471
+ "grid_auto_flow": null,
472
+ "grid_auto_rows": null,
473
+ "grid_column": null,
474
+ "grid_gap": null,
475
+ "grid_row": null,
476
+ "grid_template_areas": null,
477
+ "grid_template_columns": null,
478
+ "grid_template_rows": null,
479
+ "height": null,
480
+ "justify_content": null,
481
+ "justify_items": null,
482
+ "left": null,
483
+ "margin": null,
484
+ "max_height": null,
485
+ "max_width": null,
486
+ "min_height": null,
487
+ "min_width": null,
488
+ "object_fit": null,
489
+ "object_position": null,
490
+ "order": null,
491
+ "overflow": null,
492
+ "overflow_x": null,
493
+ "overflow_y": null,
494
+ "padding": null,
495
+ "right": null,
496
+ "top": null,
497
+ "visibility": "hidden",
498
+ "width": null
499
+ }
500
+ },
501
+ "b2fb5695afd04756975281c5a04fbcaf": {
502
+ "model_module": "@jupyter-widgets/base",
503
+ "model_name": "LayoutModel",
504
+ "model_module_version": "1.2.0",
505
+ "state": {
506
+ "_model_module": "@jupyter-widgets/base",
507
+ "_model_module_version": "1.2.0",
508
+ "_model_name": "LayoutModel",
509
+ "_view_count": null,
510
+ "_view_module": "@jupyter-widgets/base",
511
+ "_view_module_version": "1.2.0",
512
+ "_view_name": "LayoutView",
513
+ "align_content": null,
514
+ "align_items": null,
515
+ "align_self": null,
516
+ "border": null,
517
+ "bottom": null,
518
+ "display": null,
519
+ "flex": null,
520
+ "flex_flow": null,
521
+ "grid_area": null,
522
+ "grid_auto_columns": null,
523
+ "grid_auto_flow": null,
524
+ "grid_auto_rows": null,
525
+ "grid_column": null,
526
+ "grid_gap": null,
527
+ "grid_row": null,
528
+ "grid_template_areas": null,
529
+ "grid_template_columns": null,
530
+ "grid_template_rows": null,
531
+ "height": null,
532
+ "justify_content": null,
533
+ "justify_items": null,
534
+ "left": null,
535
+ "margin": null,
536
+ "max_height": null,
537
+ "max_width": null,
538
+ "min_height": null,
539
+ "min_width": null,
540
+ "object_fit": null,
541
+ "object_position": null,
542
+ "order": null,
543
+ "overflow": null,
544
+ "overflow_x": null,
545
+ "overflow_y": null,
546
+ "padding": null,
547
+ "right": null,
548
+ "top": null,
549
+ "visibility": null,
550
+ "width": null
551
+ }
552
+ },
553
+ "6e358ea9a32a486db0c81a5f54a112e9": {
554
+ "model_module": "@jupyter-widgets/controls",
555
+ "model_name": "DescriptionStyleModel",
556
+ "model_module_version": "1.5.0",
557
+ "state": {
558
+ "_model_module": "@jupyter-widgets/controls",
559
+ "_model_module_version": "1.5.0",
560
+ "_model_name": "DescriptionStyleModel",
561
+ "_view_count": null,
562
+ "_view_module": "@jupyter-widgets/base",
563
+ "_view_module_version": "1.2.0",
564
+ "_view_name": "StyleView",
565
+ "description_width": ""
566
+ }
567
+ },
568
+ "647a42b85a8044229d71fd1e7318878b": {
569
+ "model_module": "@jupyter-widgets/base",
570
+ "model_name": "LayoutModel",
571
+ "model_module_version": "1.2.0",
572
+ "state": {
573
+ "_model_module": "@jupyter-widgets/base",
574
+ "_model_module_version": "1.2.0",
575
+ "_model_name": "LayoutModel",
576
+ "_view_count": null,
577
+ "_view_module": "@jupyter-widgets/base",
578
+ "_view_module_version": "1.2.0",
579
+ "_view_name": "LayoutView",
580
+ "align_content": null,
581
+ "align_items": null,
582
+ "align_self": null,
583
+ "border": null,
584
+ "bottom": null,
585
+ "display": null,
586
+ "flex": null,
587
+ "flex_flow": null,
588
+ "grid_area": null,
589
+ "grid_auto_columns": null,
590
+ "grid_auto_flow": null,
591
+ "grid_auto_rows": null,
592
+ "grid_column": null,
593
+ "grid_gap": null,
594
+ "grid_row": null,
595
+ "grid_template_areas": null,
596
+ "grid_template_columns": null,
597
+ "grid_template_rows": null,
598
+ "height": null,
599
+ "justify_content": null,
600
+ "justify_items": null,
601
+ "left": null,
602
+ "margin": null,
603
+ "max_height": null,
604
+ "max_width": null,
605
+ "min_height": null,
606
+ "min_width": null,
607
+ "object_fit": null,
608
+ "object_position": null,
609
+ "order": null,
610
+ "overflow": null,
611
+ "overflow_x": null,
612
+ "overflow_y": null,
613
+ "padding": null,
614
+ "right": null,
615
+ "top": null,
616
+ "visibility": null,
617
+ "width": null
618
+ }
619
+ },
620
+ "f439095945fb413e916059f01f67bc79": {
621
+ "model_module": "@jupyter-widgets/controls",
622
+ "model_name": "ProgressStyleModel",
623
+ "model_module_version": "1.5.0",
624
+ "state": {
625
+ "_model_module": "@jupyter-widgets/controls",
626
+ "_model_module_version": "1.5.0",
627
+ "_model_name": "ProgressStyleModel",
628
+ "_view_count": null,
629
+ "_view_module": "@jupyter-widgets/base",
630
+ "_view_module_version": "1.2.0",
631
+ "_view_name": "StyleView",
632
+ "bar_color": null,
633
+ "description_width": ""
634
+ }
635
+ },
636
+ "fece699d83854b5e876164da8a3b6f3a": {
637
+ "model_module": "@jupyter-widgets/base",
638
+ "model_name": "LayoutModel",
639
+ "model_module_version": "1.2.0",
640
+ "state": {
641
+ "_model_module": "@jupyter-widgets/base",
642
+ "_model_module_version": "1.2.0",
643
+ "_model_name": "LayoutModel",
644
+ "_view_count": null,
645
+ "_view_module": "@jupyter-widgets/base",
646
+ "_view_module_version": "1.2.0",
647
+ "_view_name": "LayoutView",
648
+ "align_content": null,
649
+ "align_items": null,
650
+ "align_self": null,
651
+ "border": null,
652
+ "bottom": null,
653
+ "display": null,
654
+ "flex": null,
655
+ "flex_flow": null,
656
+ "grid_area": null,
657
+ "grid_auto_columns": null,
658
+ "grid_auto_flow": null,
659
+ "grid_auto_rows": null,
660
+ "grid_column": null,
661
+ "grid_gap": null,
662
+ "grid_row": null,
663
+ "grid_template_areas": null,
664
+ "grid_template_columns": null,
665
+ "grid_template_rows": null,
666
+ "height": null,
667
+ "justify_content": null,
668
+ "justify_items": null,
669
+ "left": null,
670
+ "margin": null,
671
+ "max_height": null,
672
+ "max_width": null,
673
+ "min_height": null,
674
+ "min_width": null,
675
+ "object_fit": null,
676
+ "object_position": null,
677
+ "order": null,
678
+ "overflow": null,
679
+ "overflow_x": null,
680
+ "overflow_y": null,
681
+ "padding": null,
682
+ "right": null,
683
+ "top": null,
684
+ "visibility": null,
685
+ "width": null
686
+ }
687
+ },
688
+ "814444ea270d4739aa8588937801800b": {
689
+ "model_module": "@jupyter-widgets/controls",
690
+ "model_name": "DescriptionStyleModel",
691
+ "model_module_version": "1.5.0",
692
+ "state": {
693
+ "_model_module": "@jupyter-widgets/controls",
694
+ "_model_module_version": "1.5.0",
695
+ "_model_name": "DescriptionStyleModel",
696
+ "_view_count": null,
697
+ "_view_module": "@jupyter-widgets/base",
698
+ "_view_module_version": "1.2.0",
699
+ "_view_name": "StyleView",
700
+ "description_width": ""
701
+ }
702
+ },
703
+ "00047affc56f494c82268e7a8bc2c53c": {
704
+ "model_module": "@jupyter-widgets/controls",
705
+ "model_name": "HBoxModel",
706
+ "model_module_version": "1.5.0",
707
+ "state": {
708
+ "_dom_classes": [],
709
+ "_model_module": "@jupyter-widgets/controls",
710
+ "_model_module_version": "1.5.0",
711
+ "_model_name": "HBoxModel",
712
+ "_view_count": null,
713
+ "_view_module": "@jupyter-widgets/controls",
714
+ "_view_module_version": "1.5.0",
715
+ "_view_name": "HBoxView",
716
+ "box_style": "",
717
+ "children": [
718
+ "IPY_MODEL_dd7a5a0c04fa4b66a0b5078b0a3e59e0",
719
+ "IPY_MODEL_eeaf71899a6743a081f79552dfc1672b",
720
+ "IPY_MODEL_23f2d28b36c84ea78422ef020d0d5e4b"
721
+ ],
722
+ "layout": "IPY_MODEL_02a6351920ba4a0689b19bb9531dc8df"
723
+ }
724
+ },
725
+ "dd7a5a0c04fa4b66a0b5078b0a3e59e0": {
726
+ "model_module": "@jupyter-widgets/controls",
727
+ "model_name": "HTMLModel",
728
+ "model_module_version": "1.5.0",
729
+ "state": {
730
+ "_dom_classes": [],
731
+ "_model_module": "@jupyter-widgets/controls",
732
+ "_model_module_version": "1.5.0",
733
+ "_model_name": "HTMLModel",
734
+ "_view_count": null,
735
+ "_view_module": "@jupyter-widgets/controls",
736
+ "_view_module_version": "1.5.0",
737
+ "_view_name": "HTMLView",
738
+ "description": "",
739
+ "description_tooltip": null,
740
+ "layout": "IPY_MODEL_2859d235432e4d12a78f55412ba8c569",
741
+ "placeholder": "​",
742
+ "style": "IPY_MODEL_7a8e9cb5072b47fa9a5cee174d29bc47",
743
+ "value": "Downloading pytorch_model.bin: 100%"
744
+ }
745
+ },
746
+ "eeaf71899a6743a081f79552dfc1672b": {
747
+ "model_module": "@jupyter-widgets/controls",
748
+ "model_name": "FloatProgressModel",
749
+ "model_module_version": "1.5.0",
750
+ "state": {
751
+ "_dom_classes": [],
752
+ "_model_module": "@jupyter-widgets/controls",
753
+ "_model_module_version": "1.5.0",
754
+ "_model_name": "FloatProgressModel",
755
+ "_view_count": null,
756
+ "_view_module": "@jupyter-widgets/controls",
757
+ "_view_module_version": "1.5.0",
758
+ "_view_name": "ProgressView",
759
+ "bar_style": "success",
760
+ "description": "",
761
+ "description_tooltip": null,
762
+ "layout": "IPY_MODEL_b6f515df241e44f7ba04114423fc1f7e",
763
+ "max": 265629392,
764
+ "min": 0,
765
+ "orientation": "horizontal",
766
+ "style": "IPY_MODEL_7fad565b40de40c2b3d8d72d8c50111e",
767
+ "value": 265629392
768
+ }
769
+ },
770
+ "23f2d28b36c84ea78422ef020d0d5e4b": {
771
+ "model_module": "@jupyter-widgets/controls",
772
+ "model_name": "HTMLModel",
773
+ "model_module_version": "1.5.0",
774
+ "state": {
775
+ "_dom_classes": [],
776
+ "_model_module": "@jupyter-widgets/controls",
777
+ "_model_module_version": "1.5.0",
778
+ "_model_name": "HTMLModel",
779
+ "_view_count": null,
780
+ "_view_module": "@jupyter-widgets/controls",
781
+ "_view_module_version": "1.5.0",
782
+ "_view_name": "HTMLView",
783
+ "description": "",
784
+ "description_tooltip": null,
785
+ "layout": "IPY_MODEL_0c271f3f91314bd094d8db4834c90e41",
786
+ "placeholder": "​",
787
+ "style": "IPY_MODEL_243a2bc40dbd48d2910616fa0e1a01a6",
788
+ "value": " 266M/266M [00:15<00:00, 18.8MB/s]"
789
+ }
790
+ },
791
+ "02a6351920ba4a0689b19bb9531dc8df": {
792
+ "model_module": "@jupyter-widgets/base",
793
+ "model_name": "LayoutModel",
794
+ "model_module_version": "1.2.0",
795
+ "state": {
796
+ "_model_module": "@jupyter-widgets/base",
797
+ "_model_module_version": "1.2.0",
798
+ "_model_name": "LayoutModel",
799
+ "_view_count": null,
800
+ "_view_module": "@jupyter-widgets/base",
801
+ "_view_module_version": "1.2.0",
802
+ "_view_name": "LayoutView",
803
+ "align_content": null,
804
+ "align_items": null,
805
+ "align_self": null,
806
+ "border": null,
807
+ "bottom": null,
808
+ "display": null,
809
+ "flex": null,
810
+ "flex_flow": null,
811
+ "grid_area": null,
812
+ "grid_auto_columns": null,
813
+ "grid_auto_flow": null,
814
+ "grid_auto_rows": null,
815
+ "grid_column": null,
816
+ "grid_gap": null,
817
+ "grid_row": null,
818
+ "grid_template_areas": null,
819
+ "grid_template_columns": null,
820
+ "grid_template_rows": null,
821
+ "height": null,
822
+ "justify_content": null,
823
+ "justify_items": null,
824
+ "left": null,
825
+ "margin": null,
826
+ "max_height": null,
827
+ "max_width": null,
828
+ "min_height": null,
829
+ "min_width": null,
830
+ "object_fit": null,
831
+ "object_position": null,
832
+ "order": null,
833
+ "overflow": null,
834
+ "overflow_x": null,
835
+ "overflow_y": null,
836
+ "padding": null,
837
+ "right": null,
838
+ "top": null,
839
+ "visibility": null,
840
+ "width": null
841
+ }
842
+ },
843
+ "2859d235432e4d12a78f55412ba8c569": {
844
+ "model_module": "@jupyter-widgets/base",
845
+ "model_name": "LayoutModel",
846
+ "model_module_version": "1.2.0",
847
+ "state": {
848
+ "_model_module": "@jupyter-widgets/base",
849
+ "_model_module_version": "1.2.0",
850
+ "_model_name": "LayoutModel",
851
+ "_view_count": null,
852
+ "_view_module": "@jupyter-widgets/base",
853
+ "_view_module_version": "1.2.0",
854
+ "_view_name": "LayoutView",
855
+ "align_content": null,
856
+ "align_items": null,
857
+ "align_self": null,
858
+ "border": null,
859
+ "bottom": null,
860
+ "display": null,
861
+ "flex": null,
862
+ "flex_flow": null,
863
+ "grid_area": null,
864
+ "grid_auto_columns": null,
865
+ "grid_auto_flow": null,
866
+ "grid_auto_rows": null,
867
+ "grid_column": null,
868
+ "grid_gap": null,
869
+ "grid_row": null,
870
+ "grid_template_areas": null,
871
+ "grid_template_columns": null,
872
+ "grid_template_rows": null,
873
+ "height": null,
874
+ "justify_content": null,
875
+ "justify_items": null,
876
+ "left": null,
877
+ "margin": null,
878
+ "max_height": null,
879
+ "max_width": null,
880
+ "min_height": null,
881
+ "min_width": null,
882
+ "object_fit": null,
883
+ "object_position": null,
884
+ "order": null,
885
+ "overflow": null,
886
+ "overflow_x": null,
887
+ "overflow_y": null,
888
+ "padding": null,
889
+ "right": null,
890
+ "top": null,
891
+ "visibility": null,
892
+ "width": null
893
+ }
894
+ },
895
+ "7a8e9cb5072b47fa9a5cee174d29bc47": {
896
+ "model_module": "@jupyter-widgets/controls",
897
+ "model_name": "DescriptionStyleModel",
898
+ "model_module_version": "1.5.0",
899
+ "state": {
900
+ "_model_module": "@jupyter-widgets/controls",
901
+ "_model_module_version": "1.5.0",
902
+ "_model_name": "DescriptionStyleModel",
903
+ "_view_count": null,
904
+ "_view_module": "@jupyter-widgets/base",
905
+ "_view_module_version": "1.2.0",
906
+ "_view_name": "StyleView",
907
+ "description_width": ""
908
+ }
909
+ },
910
+ "b6f515df241e44f7ba04114423fc1f7e": {
911
+ "model_module": "@jupyter-widgets/base",
912
+ "model_name": "LayoutModel",
913
+ "model_module_version": "1.2.0",
914
+ "state": {
915
+ "_model_module": "@jupyter-widgets/base",
916
+ "_model_module_version": "1.2.0",
917
+ "_model_name": "LayoutModel",
918
+ "_view_count": null,
919
+ "_view_module": "@jupyter-widgets/base",
920
+ "_view_module_version": "1.2.0",
921
+ "_view_name": "LayoutView",
922
+ "align_content": null,
923
+ "align_items": null,
924
+ "align_self": null,
925
+ "border": null,
926
+ "bottom": null,
927
+ "display": null,
928
+ "flex": null,
929
+ "flex_flow": null,
930
+ "grid_area": null,
931
+ "grid_auto_columns": null,
932
+ "grid_auto_flow": null,
933
+ "grid_auto_rows": null,
934
+ "grid_column": null,
935
+ "grid_gap": null,
936
+ "grid_row": null,
937
+ "grid_template_areas": null,
938
+ "grid_template_columns": null,
939
+ "grid_template_rows": null,
940
+ "height": null,
941
+ "justify_content": null,
942
+ "justify_items": null,
943
+ "left": null,
944
+ "margin": null,
945
+ "max_height": null,
946
+ "max_width": null,
947
+ "min_height": null,
948
+ "min_width": null,
949
+ "object_fit": null,
950
+ "object_position": null,
951
+ "order": null,
952
+ "overflow": null,
953
+ "overflow_x": null,
954
+ "overflow_y": null,
955
+ "padding": null,
956
+ "right": null,
957
+ "top": null,
958
+ "visibility": null,
959
+ "width": null
960
+ }
961
+ },
962
+ "7fad565b40de40c2b3d8d72d8c50111e": {
963
+ "model_module": "@jupyter-widgets/controls",
964
+ "model_name": "ProgressStyleModel",
965
+ "model_module_version": "1.5.0",
966
+ "state": {
967
+ "_model_module": "@jupyter-widgets/controls",
968
+ "_model_module_version": "1.5.0",
969
+ "_model_name": "ProgressStyleModel",
970
+ "_view_count": null,
971
+ "_view_module": "@jupyter-widgets/base",
972
+ "_view_module_version": "1.2.0",
973
+ "_view_name": "StyleView",
974
+ "bar_color": null,
975
+ "description_width": ""
976
+ }
977
+ },
978
+ "0c271f3f91314bd094d8db4834c90e41": {
979
+ "model_module": "@jupyter-widgets/base",
980
+ "model_name": "LayoutModel",
981
+ "model_module_version": "1.2.0",
982
+ "state": {
983
+ "_model_module": "@jupyter-widgets/base",
984
+ "_model_module_version": "1.2.0",
985
+ "_model_name": "LayoutModel",
986
+ "_view_count": null,
987
+ "_view_module": "@jupyter-widgets/base",
988
+ "_view_module_version": "1.2.0",
989
+ "_view_name": "LayoutView",
990
+ "align_content": null,
991
+ "align_items": null,
992
+ "align_self": null,
993
+ "border": null,
994
+ "bottom": null,
995
+ "display": null,
996
+ "flex": null,
997
+ "flex_flow": null,
998
+ "grid_area": null,
999
+ "grid_auto_columns": null,
1000
+ "grid_auto_flow": null,
1001
+ "grid_auto_rows": null,
1002
+ "grid_column": null,
1003
+ "grid_gap": null,
1004
+ "grid_row": null,
1005
+ "grid_template_areas": null,
1006
+ "grid_template_columns": null,
1007
+ "grid_template_rows": null,
1008
+ "height": null,
1009
+ "justify_content": null,
1010
+ "justify_items": null,
1011
+ "left": null,
1012
+ "margin": null,
1013
+ "max_height": null,
1014
+ "max_width": null,
1015
+ "min_height": null,
1016
+ "min_width": null,
1017
+ "object_fit": null,
1018
+ "object_position": null,
1019
+ "order": null,
1020
+ "overflow": null,
1021
+ "overflow_x": null,
1022
+ "overflow_y": null,
1023
+ "padding": null,
1024
+ "right": null,
1025
+ "top": null,
1026
+ "visibility": null,
1027
+ "width": null
1028
+ }
1029
+ },
1030
+ "243a2bc40dbd48d2910616fa0e1a01a6": {
1031
+ "model_module": "@jupyter-widgets/controls",
1032
+ "model_name": "DescriptionStyleModel",
1033
+ "model_module_version": "1.5.0",
1034
+ "state": {
1035
+ "_model_module": "@jupyter-widgets/controls",
1036
+ "_model_module_version": "1.5.0",
1037
+ "_model_name": "DescriptionStyleModel",
1038
+ "_view_count": null,
1039
+ "_view_module": "@jupyter-widgets/base",
1040
+ "_view_module_version": "1.2.0",
1041
+ "_view_name": "StyleView",
1042
+ "description_width": ""
1043
+ }
1044
+ }
1045
+ }
1046
+ }
1047
+ },
1048
+ "cells": [
1049
+ {
1050
+ "cell_type": "markdown",
1051
+ "source": [
1052
+ "Задача - определить диалект португальского языка по фразе.\n",
1053
+ "\n",
1054
+ "Данные взяты из субтитров кофнеренции TED"
1055
+ ],
1056
+ "metadata": {
1057
+ "id": "qF-Rki_SBT7-"
1058
+ }
1059
+ },
1060
+ {
1061
+ "cell_type": "markdown",
1062
+ "source": [
1063
+ "### Подготовка данных"
1064
+ ],
1065
+ "metadata": {
1066
+ "id": "gjsF2U3a9_HR"
1067
+ }
1068
+ },
1069
+ {
1070
+ "cell_type": "code",
1071
+ "source": [
1072
+ "!wget https://object.pouta.csc.fi/OPUS-TED2020/v1/mono/pt.txt.gz\n",
1073
+ "!wget https://object.pouta.csc.fi/OPUS-TED2020/v1/mono/pt_br.txt.gz\n",
1074
+ "!gunzip pt.txt.gz\n",
1075
+ "!gunzip pt_br.txt.gz\n"
1076
+ ],
1077
+ "metadata": {
1078
+ "colab": {
1079
+ "base_uri": "https://localhost:8080/"
1080
+ },
1081
+ "id": "XwRRwPFp9-JV",
1082
+ "outputId": "acfbaa31-8efd-45ed-cc42-8b124fac681e"
1083
+ },
1084
+ "execution_count": 2,
1085
+ "outputs": [
1086
+ {
1087
+ "output_type": "stream",
1088
+ "name": "stdout",
1089
+ "text": [
1090
+ "--2023-04-15 10:19:27-- https://object.pouta.csc.fi/OPUS-TED2020/v1/mono/pt.txt.gz\n",
1091
+ "Resolving object.pouta.csc.fi (object.pouta.csc.fi)... 86.50.254.19\n",
1092
+ "Connecting to object.pouta.csc.fi (object.pouta.csc.fi)|86.50.254.19|:443... connected.\n",
1093
+ "HTTP request sent, awaiting response... 200 OK\n",
1094
+ "Length: 11610902 (11M) [application/gzip]\n",
1095
+ "Saving to: ‘pt.txt.gz’\n",
1096
+ "\n",
1097
+ "pt.txt.gz 100%[===================>] 11.07M 4.32MB/s in 2.6s \n",
1098
+ "\n",
1099
+ "2023-04-15 10:19:31 (4.32 MB/s) - ‘pt.txt.gz’ saved [11610902/11610902]\n",
1100
+ "\n",
1101
+ "--2023-04-15 10:19:31-- https://object.pouta.csc.fi/OPUS-TED2020/v1/mono/pt_br.txt.gz\n",
1102
+ "Resolving object.pouta.csc.fi (object.pouta.csc.fi)... 86.50.254.19\n",
1103
+ "Connecting to object.pouta.csc.fi (object.pouta.csc.fi)|86.50.254.19|:443... connected.\n",
1104
+ "HTTP request sent, awaiting response... 200 OK\n",
1105
+ "Length: 14802314 (14M) [application/gzip]\n",
1106
+ "Saving to: ‘pt_br.txt.gz’\n",
1107
+ "\n",
1108
+ "pt_br.txt.gz 100%[===================>] 14.12M 4.94MB/s in 2.9s \n",
1109
+ "\n",
1110
+ "2023-04-15 10:19:35 (4.94 MB/s) - ‘pt_br.txt.gz’ saved [14802314/14802314]\n",
1111
+ "\n"
1112
+ ]
1113
+ }
1114
+ ]
1115
+ },
1116
+ {
1117
+ "cell_type": "code",
1118
+ "source": [
1119
+ "import pandas as pd\n",
1120
+ "\n",
1121
+ "pt = pd.read_csv('pt.txt', sep='\\t', names=['text'])\n",
1122
+ "pt['target'] = 'pt'\n",
1123
+ "pt_br = pd.read_csv('pt_br.txt', sep='\\t', names=['text'])\n",
1124
+ "pt_br['target'] = 'pt_br'\n",
1125
+ "data = pd.concat([pt[:10000], pt_br[:10000]], ignore_index=True)"
1126
+ ],
1127
+ "metadata": {
1128
+ "id": "DIZD8gBB-6mo"
1129
+ },
1130
+ "execution_count": 35,
1131
+ "outputs": []
1132
+ },
1133
+ {
1134
+ "cell_type": "code",
1135
+ "source": [
1136
+ "data"
1137
+ ],
1138
+ "metadata": {
1139
+ "colab": {
1140
+ "base_uri": "https://localhost:8080/",
1141
+ "height": 423
1142
+ },
1143
+ "id": "FQdiHJihD46w",
1144
+ "outputId": "5de3ab8d-032a-4ed9-dab5-8961ad3b19e3"
1145
+ },
1146
+ "execution_count": 4,
1147
+ "outputs": [
1148
+ {
1149
+ "output_type": "execute_result",
1150
+ "data": {
1151
+ "text/plain": [
1152
+ " text target\n",
1153
+ "0 Em meados do século XVI, os italianos eram cat... pt\n",
1154
+ "1 Porém, este dom tinha um alto preço. pt\n",
1155
+ "2 Para impedir a alteração da voz, esses cantore... pt\n",
1156
+ "3 Conhecidos por \"castrati\", estas vozes agudas ... pt\n",
1157
+ "4 Embora o crescimento vocal retardado possa pro... pt\n",
1158
+ "... ... ...\n",
1159
+ "49995 Como você acha que seria o mundo se você fosse... pt_br\n",
1160
+ "49996 Bem, a resposta é nada. pt_br\n",
1161
+ "49997 A razão por que você não consegue enxergar no ... pt_br\n",
1162
+ "49998 Para ver uma maçã, a luz tem que atingir a maç... pt_br\n",
1163
+ "49999 Então, as retinas em seus olhos recebem o refl... pt_br\n",
1164
+ "\n",
1165
+ "[50000 rows x 2 columns]"
1166
+ ],
1167
+ "text/html": [
1168
+ "\n",
1169
+ " <div id=\"df-f5ef419f-52cd-4661-92e3-493f6c907f3e\">\n",
1170
+ " <div class=\"colab-df-container\">\n",
1171
+ " <div>\n",
1172
+ "<style scoped>\n",
1173
+ " .dataframe tbody tr th:only-of-type {\n",
1174
+ " vertical-align: middle;\n",
1175
+ " }\n",
1176
+ "\n",
1177
+ " .dataframe tbody tr th {\n",
1178
+ " vertical-align: top;\n",
1179
+ " }\n",
1180
+ "\n",
1181
+ " .dataframe thead th {\n",
1182
+ " text-align: right;\n",
1183
+ " }\n",
1184
+ "</style>\n",
1185
+ "<table border=\"1\" class=\"dataframe\">\n",
1186
+ " <thead>\n",
1187
+ " <tr style=\"text-align: right;\">\n",
1188
+ " <th></th>\n",
1189
+ " <th>text</th>\n",
1190
+ " <th>target</th>\n",
1191
+ " </tr>\n",
1192
+ " </thead>\n",
1193
+ " <tbody>\n",
1194
+ " <tr>\n",
1195
+ " <th>0</th>\n",
1196
+ " <td>Em meados do século XVI, os italianos eram cat...</td>\n",
1197
+ " <td>pt</td>\n",
1198
+ " </tr>\n",
1199
+ " <tr>\n",
1200
+ " <th>1</th>\n",
1201
+ " <td>Porém, este dom tinha um alto preço.</td>\n",
1202
+ " <td>pt</td>\n",
1203
+ " </tr>\n",
1204
+ " <tr>\n",
1205
+ " <th>2</th>\n",
1206
+ " <td>Para impedir a alteração da voz, esses cantore...</td>\n",
1207
+ " <td>pt</td>\n",
1208
+ " </tr>\n",
1209
+ " <tr>\n",
1210
+ " <th>3</th>\n",
1211
+ " <td>Conhecidos por \"castrati\", estas vozes agudas ...</td>\n",
1212
+ " <td>pt</td>\n",
1213
+ " </tr>\n",
1214
+ " <tr>\n",
1215
+ " <th>4</th>\n",
1216
+ " <td>Embora o crescimento vocal retardado possa pro...</td>\n",
1217
+ " <td>pt</td>\n",
1218
+ " </tr>\n",
1219
+ " <tr>\n",
1220
+ " <th>...</th>\n",
1221
+ " <td>...</td>\n",
1222
+ " <td>...</td>\n",
1223
+ " </tr>\n",
1224
+ " <tr>\n",
1225
+ " <th>49995</th>\n",
1226
+ " <td>Como você acha que seria o mundo se você fosse...</td>\n",
1227
+ " <td>pt_br</td>\n",
1228
+ " </tr>\n",
1229
+ " <tr>\n",
1230
+ " <th>49996</th>\n",
1231
+ " <td>Bem, a resposta é nada.</td>\n",
1232
+ " <td>pt_br</td>\n",
1233
+ " </tr>\n",
1234
+ " <tr>\n",
1235
+ " <th>49997</th>\n",
1236
+ " <td>A razão por que você não consegue enxergar no ...</td>\n",
1237
+ " <td>pt_br</td>\n",
1238
+ " </tr>\n",
1239
+ " <tr>\n",
1240
+ " <th>49998</th>\n",
1241
+ " <td>Para ver uma maçã, a luz tem que atingir a maç...</td>\n",
1242
+ " <td>pt_br</td>\n",
1243
+ " </tr>\n",
1244
+ " <tr>\n",
1245
+ " <th>49999</th>\n",
1246
+ " <td>Então, as retinas em seus olhos recebem o refl...</td>\n",
1247
+ " <td>pt_br</td>\n",
1248
+ " </tr>\n",
1249
+ " </tbody>\n",
1250
+ "</table>\n",
1251
+ "<p>50000 rows × 2 columns</p>\n",
1252
+ "</div>\n",
1253
+ " <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-f5ef419f-52cd-4661-92e3-493f6c907f3e')\"\n",
1254
+ " title=\"Convert this dataframe to an interactive table.\"\n",
1255
+ " style=\"display:none;\">\n",
1256
+ " \n",
1257
+ " <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n",
1258
+ " width=\"24px\">\n",
1259
+ " <path d=\"M0 0h24v24H0V0z\" fill=\"none\"/>\n",
1260
+ " <path d=\"M18.56 5.44l.94 2.06.94-2.06 2.06-.94-2.06-.94-.94-2.06-.94 2.06-2.06.94zm-11 1L8.5 8.5l.94-2.06 2.06-.94-2.06-.94L8.5 2.5l-.94 2.06-2.06.94zm10 10l.94 2.06.94-2.06 2.06-.94-2.06-.94-.94-2.06-.94 2.06-2.06.94z\"/><path d=\"M17.41 7.96l-1.37-1.37c-.4-.4-.92-.59-1.43-.59-.52 0-1.04.2-1.43.59L10.3 9.45l-7.72 7.72c-.78.78-.78 2.05 0 2.83L4 21.41c.39.39.9.59 1.41.59.51 0 1.02-.2 1.41-.59l7.78-7.78 2.81-2.81c.8-.78.8-2.07 0-2.86zM5.41 20L4 18.59l7.72-7.72 1.47 1.35L5.41 20z\"/>\n",
1261
+ " </svg>\n",
1262
+ " </button>\n",
1263
+ " \n",
1264
+ " <style>\n",
1265
+ " .colab-df-container {\n",
1266
+ " display:flex;\n",
1267
+ " flex-wrap:wrap;\n",
1268
+ " gap: 12px;\n",
1269
+ " }\n",
1270
+ "\n",
1271
+ " .colab-df-convert {\n",
1272
+ " background-color: #E8F0FE;\n",
1273
+ " border: none;\n",
1274
+ " border-radius: 50%;\n",
1275
+ " cursor: pointer;\n",
1276
+ " display: none;\n",
1277
+ " fill: #1967D2;\n",
1278
+ " height: 32px;\n",
1279
+ " padding: 0 0 0 0;\n",
1280
+ " width: 32px;\n",
1281
+ " }\n",
1282
+ "\n",
1283
+ " .colab-df-convert:hover {\n",
1284
+ " background-color: #E2EBFA;\n",
1285
+ " box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
1286
+ " fill: #174EA6;\n",
1287
+ " }\n",
1288
+ "\n",
1289
+ " [theme=dark] .colab-df-convert {\n",
1290
+ " background-color: #3B4455;\n",
1291
+ " fill: #D2E3FC;\n",
1292
+ " }\n",
1293
+ "\n",
1294
+ " [theme=dark] .colab-df-convert:hover {\n",
1295
+ " background-color: #434B5C;\n",
1296
+ " box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
1297
+ " filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
1298
+ " fill: #FFFFFF;\n",
1299
+ " }\n",
1300
+ " </style>\n",
1301
+ "\n",
1302
+ " <script>\n",
1303
+ " const buttonEl =\n",
1304
+ " document.querySelector('#df-f5ef419f-52cd-4661-92e3-493f6c907f3e button.colab-df-convert');\n",
1305
+ " buttonEl.style.display =\n",
1306
+ " google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
1307
+ "\n",
1308
+ " async function convertToInteractive(key) {\n",
1309
+ " const element = document.querySelector('#df-f5ef419f-52cd-4661-92e3-493f6c907f3e');\n",
1310
+ " const dataTable =\n",
1311
+ " await google.colab.kernel.invokeFunction('convertToInteractive',\n",
1312
+ " [key], {});\n",
1313
+ " if (!dataTable) return;\n",
1314
+ "\n",
1315
+ " const docLinkHtml = 'Like what you see? Visit the ' +\n",
1316
+ " '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
1317
+ " + ' to learn more about interactive tables.';\n",
1318
+ " element.innerHTML = '';\n",
1319
+ " dataTable['output_type'] = 'display_data';\n",
1320
+ " await google.colab.output.renderOutput(dataTable, element);\n",
1321
+ " const docLink = document.createElement('div');\n",
1322
+ " docLink.innerHTML = docLinkHtml;\n",
1323
+ " element.appendChild(docLink);\n",
1324
+ " }\n",
1325
+ " </script>\n",
1326
+ " </div>\n",
1327
+ " </div>\n",
1328
+ " "
1329
+ ]
1330
+ },
1331
+ "metadata": {},
1332
+ "execution_count": 4
1333
+ }
1334
+ ]
1335
+ },
1336
+ {
1337
+ "cell_type": "markdown",
1338
+ "source": [
1339
+ "### Файнтюн модели"
1340
+ ],
1341
+ "metadata": {
1342
+ "id": "u-03LX5EBtED"
1343
+ }
1344
+ },
1345
+ {
1346
+ "cell_type": "code",
1347
+ "execution_count": 5,
1348
+ "metadata": {
1349
+ "colab": {
1350
+ "base_uri": "https://localhost:8080/"
1351
+ },
1352
+ "id": "kgsVl04L9r0o",
1353
+ "outputId": "1933d7b0-0ea1-485c-a1b9-05066786f448"
1354
+ },
1355
+ "outputs": [
1356
+ {
1357
+ "output_type": "stream",
1358
+ "name": "stdout",
1359
+ "text": [
1360
+ "Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/\n",
1361
+ "Collecting transformers\n",
1362
+ " Downloading transformers-4.28.1-py3-none-any.whl (7.0 MB)\n",
1363
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m7.0/7.0 MB\u001b[0m \u001b[31m98.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
1364
+ "\u001b[?25hCollecting tokenizers!=0.11.3,<0.14,>=0.11.1\n",
1365
+ " Downloading tokenizers-0.13.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (7.8 MB)\n",
1366
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m7.8/7.8 MB\u001b[0m \u001b[31m102.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
1367
+ "\u001b[?25hCollecting huggingface-hub<1.0,>=0.11.0\n",
1368
+ " Downloading huggingface_hub-0.13.4-py3-none-any.whl (200 kB)\n",
1369
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m200.1/200.1 kB\u001b[0m \u001b[31m12.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
1370
+ "\u001b[?25hRequirement already satisfied: filelock in /usr/local/lib/python3.9/dist-packages (from transformers) (3.11.0)\n",
1371
+ "Requirement already satisfied: requests in /usr/local/lib/python3.9/dist-packages (from transformers) (2.27.1)\n",
1372
+ "Requirement already satisfied: pyyaml>=5.1 in /usr/local/lib/python3.9/dist-packages (from transformers) (6.0)\n",
1373
+ "Requirement already satisfied: numpy>=1.17 in /usr/local/lib/python3.9/dist-packages (from transformers) (1.22.4)\n",
1374
+ "Requirement already satisfied: tqdm>=4.27 in /usr/local/lib/python3.9/dist-packages (from transformers) (4.65.0)\n",
1375
+ "Requirement already satisfied: regex!=2019.12.17 in /usr/local/lib/python3.9/dist-packages (from transformers) (2022.10.31)\n",
1376
+ "Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.9/dist-packages (from transformers) (23.0)\n",
1377
+ "Requirement already satisfied: typing-extensions>=3.7.4.3 in /usr/local/lib/python3.9/dist-packages (from huggingface-hub<1.0,>=0.11.0->transformers) (4.5.0)\n",
1378
+ "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.9/dist-packages (from requests->transformers) (2022.12.7)\n",
1379
+ "Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/local/lib/python3.9/dist-packages (from requests->transformers) (1.26.15)\n",
1380
+ "Requirement already satisfied: charset-normalizer~=2.0.0 in /usr/local/lib/python3.9/dist-packages (from requests->transformers) (2.0.12)\n",
1381
+ "Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.9/dist-packages (from requests->transformers) (3.4)\n",
1382
+ "Installing collected packages: tokenizers, huggingface-hub, transformers\n",
1383
+ "Successfully installed huggingface-hub-0.13.4 tokenizers-0.13.3 transformers-4.28.1\n"
1384
+ ]
1385
+ }
1386
+ ],
1387
+ "source": [
1388
+ "!pip install transformers\n",
1389
+ "import transformers"
1390
+ ]
1391
+ },
1392
+ {
1393
+ "cell_type": "code",
1394
+ "source": [
1395
+ "!pip install datasets"
1396
+ ],
1397
+ "metadata": {
1398
+ "colab": {
1399
+ "base_uri": "https://localhost:8080/"
1400
+ },
1401
+ "id": "D8OtthEoJ-jJ",
1402
+ "outputId": "aea9ef62-08cd-40c5-8d26-4590fb87de8b"
1403
+ },
1404
+ "execution_count": 6,
1405
+ "outputs": [
1406
+ {
1407
+ "output_type": "stream",
1408
+ "name": "stdout",
1409
+ "text": [
1410
+ "Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/\n",
1411
+ "Collecting datasets\n",
1412
+ " Downloading datasets-2.11.0-py3-none-any.whl (468 kB)\n",
1413
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m468.7/468.7 kB\u001b[0m \u001b[31m5.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
1414
+ "\u001b[?25hCollecting dill<0.3.7,>=0.3.0\n",
1415
+ " Downloading dill-0.3.6-py3-none-any.whl (110 kB)\n",
1416
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m110.5/110.5 kB\u001b[0m \u001b[31m14.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
1417
+ "\u001b[?25hRequirement already satisfied: fsspec[http]>=2021.11.1 in /usr/local/lib/python3.9/dist-packages (from datasets) (2023.4.0)\n",
1418
+ "Requirement already satisfied: pyyaml>=5.1 in /usr/local/lib/python3.9/dist-packages (from datasets) (6.0)\n",
1419
+ "Requirement already satisfied: numpy>=1.17 in /usr/local/lib/python3.9/dist-packages (from datasets) (1.22.4)\n",
1420
+ "Requirement already satisfied: packaging in /usr/local/lib/python3.9/dist-packages (from datasets) (23.0)\n",
1421
+ "Requirement already satisfied: huggingface-hub<1.0.0,>=0.11.0 in /usr/local/lib/python3.9/dist-packages (from datasets) (0.13.4)\n",
1422
+ "Requirement already satisfied: tqdm>=4.62.1 in /usr/local/lib/python3.9/dist-packages (from datasets) (4.65.0)\n",
1423
+ "Collecting responses<0.19\n",
1424
+ " Downloading responses-0.18.0-py3-none-any.whl (38 kB)\n",
1425
+ "Collecting xxhash\n",
1426
+ " Downloading xxhash-3.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (212 kB)\n",
1427
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m212.2/212.2 kB\u001b[0m \u001b[31m28.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
1428
+ "\u001b[?25hCollecting aiohttp\n",
1429
+ " Downloading aiohttp-3.8.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.0 MB)\n",
1430
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.0/1.0 MB\u001b[0m \u001b[31m51.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
1431
+ "\u001b[?25hRequirement already satisfied: pyarrow>=8.0.0 in /usr/local/lib/python3.9/dist-packages (from datasets) (9.0.0)\n",
1432
+ "Collecting multiprocess\n",
1433
+ " Downloading multiprocess-0.70.14-py39-none-any.whl (132 kB)\n",
1434
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m132.9/132.9 kB\u001b[0m \u001b[31m13.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
1435
+ "\u001b[?25hRequirement already satisfied: pandas in /usr/local/lib/python3.9/dist-packages (from datasets) (1.5.3)\n",
1436
+ "Requirement already satisfied: requests>=2.19.0 in /usr/local/lib/python3.9/dist-packages (from datasets) (2.27.1)\n",
1437
+ "Collecting yarl<2.0,>=1.0\n",
1438
+ " Downloading yarl-1.8.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (264 kB)\n",
1439
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m264.6/264.6 kB\u001b[0m \u001b[31m23.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
1440
+ "\u001b[?25hCollecting aiosignal>=1.1.2\n",
1441
+ " Downloading aiosignal-1.3.1-py3-none-any.whl (7.6 kB)\n",
1442
+ "Requirement already satisfied: attrs>=17.3.0 in /usr/local/lib/python3.9/dist-packages (from aiohttp->datasets) (22.2.0)\n",
1443
+ "Collecting async-timeout<5.0,>=4.0.0a3\n",
1444
+ " Downloading async_timeout-4.0.2-py3-none-any.whl (5.8 kB)\n",
1445
+ "Collecting multidict<7.0,>=4.5\n",
1446
+ " Downloading multidict-6.0.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (114 kB)\n",
1447
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m114.2/114.2 kB\u001b[0m \u001b[31m15.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
1448
+ "\u001b[?25hRequirement already satisfied: charset-normalizer<4.0,>=2.0 in /usr/local/lib/python3.9/dist-packages (from aiohttp->datasets) (2.0.12)\n",
1449
+ "Collecting frozenlist>=1.1.1\n",
1450
+ " Downloading frozenlist-1.3.3-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (158 kB)\n",
1451
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m158.8/158.8 kB\u001b[0m \u001b[31m7.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
1452
+ "\u001b[?25hRequirement already satisfied: filelock in /usr/local/lib/python3.9/dist-packages (from huggingface-hub<1.0.0,>=0.11.0->datasets) (3.11.0)\n",
1453
+ "Requirement already satisfied: typing-extensions>=3.7.4.3 in /usr/local/lib/python3.9/dist-packages (from huggingface-hub<1.0.0,>=0.11.0->datasets) (4.5.0)\n",
1454
+ "Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/local/lib/python3.9/dist-packages (from requests>=2.19.0->datasets) (1.26.15)\n",
1455
+ "Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.9/dist-packages (from requests>=2.19.0->datasets) (3.4)\n",
1456
+ "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.9/dist-packages (from requests>=2.19.0->datasets) (2022.12.7)\n",
1457
+ "Requirement already satisfied: python-dateutil>=2.8.1 in /usr/local/lib/python3.9/dist-packages (from pandas->datasets) (2.8.2)\n",
1458
+ "Requirement already satisfied: pytz>=2020.1 in /usr/local/lib/python3.9/dist-packages (from pandas->datasets) (2022.7.1)\n",
1459
+ "Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.9/dist-packages (from python-dateutil>=2.8.1->pandas->datasets) (1.16.0)\n",
1460
+ "Installing collected packages: xxhash, multidict, frozenlist, dill, async-timeout, yarl, responses, multiprocess, aiosignal, aiohttp, datasets\n",
1461
+ "Successfully installed aiohttp-3.8.4 aiosignal-1.3.1 async-timeout-4.0.2 datasets-2.11.0 dill-0.3.6 frozenlist-1.3.3 multidict-6.0.4 multiprocess-0.70.14 responses-0.18.0 xxhash-3.2.0 yarl-1.8.2\n"
1462
+ ]
1463
+ }
1464
+ ]
1465
+ },
1466
+ {
1467
+ "cell_type": "code",
1468
+ "source": [
1469
+ "from sklearn.model_selection import train_test_split\n",
1470
+ "from transformers import AutoModelForSequenceClassification, AutoTokenizer, TrainingArguments, Trainer, IntervalStrategy\n",
1471
+ "from datasets import load_metric, Dataset, ClassLabel\n",
1472
+ "\n",
1473
+ "\n",
1474
+ "X_train, X_test, y_train, y_test = train_test_split(\n",
1475
+ " data,\n",
1476
+ " data['target'],\n",
1477
+ " test_size=0.1,\n",
1478
+ " random_state=42\n",
1479
+ ")\n",
1480
+ "\n",
1481
+ "tokenizer = AutoTokenizer.from_pretrained('adalbertojunior/distilbert-portuguese-cased', do_lower_case=False)\n",
1482
+ "\n",
1483
+ "class_label = ClassLabel(names=['pt','pt_br'])\n",
1484
+ "\n",
1485
+ "def tokenize(text):\n",
1486
+ " tokens = tokenizer(text['text'], padding=True, truncation=True, max_length=256, add_special_tokens = True)\n",
1487
+ " tokens['label'] = class_label.str2int(text['target'])\n",
1488
+ " return tokens\n",
1489
+ "\n",
1490
+ "train_ds = Dataset.from_pandas(X_train).map(tokenize, batched=True)\n",
1491
+ "test_ds = Dataset.from_pandas(X_test).map(tokenize, batched=True)\n",
1492
+ "\n",
1493
+ "train_ds.set_format('torch', columns=['input_ids', 'attention_mask', 'label'])\n",
1494
+ "test_ds.set_format('torch', columns=['input_ids', 'attention_mask', 'label'])"
1495
+ ],
1496
+ "metadata": {
1497
+ "colab": {
1498
+ "base_uri": "https://localhost:8080/",
1499
+ "height": 17,
1500
+ "referenced_widgets": [
1501
+ "79e7afed6f204ced8012f9853e8ce153",
1502
+ "92e3b0a9ee344022b0bf16a6617239b3",
1503
+ "09fa538b6a05498282c2438a6c854fd1",
1504
+ "3b905f68919049608a3eb3c48da12032",
1505
+ "eee35ecb15c84ee994f9ffa479feeaaf",
1506
+ "c17b6f3b3436490e923835add11f8d74",
1507
+ "4d5a02eb385d470f8b3c68a8db60561c",
1508
+ "7946964d5e8741ba86b2662397ccb891",
1509
+ "5624c10fc93943dda1e0c93c1fc2fbba",
1510
+ "101f117dfb0a441e807757524b857350",
1511
+ "77819fe20f514982b8547abff9361b2d",
1512
+ "8f76ba596bdc427aa868685b151f51d8",
1513
+ "a14ec2755a2a477aa654287af8a463a3",
1514
+ "cb82b162aae342888f353ea2fe507015",
1515
+ "ebb3365ce29e476ab28201e9b825e302",
1516
+ "31e7fabdde2f4129ab38d49b5c5b1d50",
1517
+ "b2fb5695afd04756975281c5a04fbcaf",
1518
+ "6e358ea9a32a486db0c81a5f54a112e9",
1519
+ "647a42b85a8044229d71fd1e7318878b",
1520
+ "f439095945fb413e916059f01f67bc79",
1521
+ "fece699d83854b5e876164da8a3b6f3a",
1522
+ "814444ea270d4739aa8588937801800b"
1523
+ ]
1524
+ },
1525
+ "id": "Nf7Cew2HLKi6",
1526
+ "outputId": "f107d518-4016-4d4a-d3b8-161f4724bce4"
1527
+ },
1528
+ "execution_count": 46,
1529
+ "outputs": [
1530
+ {
1531
+ "output_type": "display_data",
1532
+ "data": {
1533
+ "text/plain": [
1534
+ "Map: 0%| | 0/18000 [00:00<?, ? examples/s]"
1535
+ ],
1536
+ "application/vnd.jupyter.widget-view+json": {
1537
+ "version_major": 2,
1538
+ "version_minor": 0,
1539
+ "model_id": "79e7afed6f204ced8012f9853e8ce153"
1540
+ }
1541
+ },
1542
+ "metadata": {}
1543
+ },
1544
+ {
1545
+ "output_type": "display_data",
1546
+ "data": {
1547
+ "text/plain": [
1548
+ "Map: 0%| | 0/2000 [00:00<?, ? examples/s]"
1549
+ ],
1550
+ "application/vnd.jupyter.widget-view+json": {
1551
+ "version_major": 2,
1552
+ "version_minor": 0,
1553
+ "model_id": "8f76ba596bdc427aa868685b151f51d8"
1554
+ }
1555
+ },
1556
+ "metadata": {}
1557
+ }
1558
+ ]
1559
+ },
1560
+ {
1561
+ "cell_type": "code",
1562
+ "source": [
1563
+ "from transformers import BertForSequenceClassification, AdamW, BertConfig\n",
1564
+ "\n",
1565
+ "model = BertForSequenceClassification.from_pretrained(\n",
1566
+ " 'adalbertojunior/distilbert-portuguese-cased',\n",
1567
+ " num_labels = 2,\n",
1568
+ " output_attentions = False, \n",
1569
+ " output_hidden_states = False,\n",
1570
+ ")"
1571
+ ],
1572
+ "metadata": {
1573
+ "colab": {
1574
+ "base_uri": "https://localhost:8080/",
1575
+ "height": 105,
1576
+ "referenced_widgets": [
1577
+ "00047affc56f494c82268e7a8bc2c53c",
1578
+ "dd7a5a0c04fa4b66a0b5078b0a3e59e0",
1579
+ "eeaf71899a6743a081f79552dfc1672b",
1580
+ "23f2d28b36c84ea78422ef020d0d5e4b",
1581
+ "02a6351920ba4a0689b19bb9531dc8df",
1582
+ "2859d235432e4d12a78f55412ba8c569",
1583
+ "7a8e9cb5072b47fa9a5cee174d29bc47",
1584
+ "b6f515df241e44f7ba04114423fc1f7e",
1585
+ "7fad565b40de40c2b3d8d72d8c50111e",
1586
+ "0c271f3f91314bd094d8db4834c90e41",
1587
+ "243a2bc40dbd48d2910616fa0e1a01a6"
1588
+ ]
1589
+ },
1590
+ "id": "xe7ooV6LXHrm",
1591
+ "outputId": "f4e0e785-ce91-4be3-cb19-675f94dc3f46"
1592
+ },
1593
+ "execution_count": 12,
1594
+ "outputs": [
1595
+ {
1596
+ "output_type": "display_data",
1597
+ "data": {
1598
+ "text/plain": [
1599
+ "Downloading pytorch_model.bin: 0%| | 0.00/266M [00:00<?, ?B/s]"
1600
+ ],
1601
+ "application/vnd.jupyter.widget-view+json": {
1602
+ "version_major": 2,
1603
+ "version_minor": 0,
1604
+ "model_id": "00047affc56f494c82268e7a8bc2c53c"
1605
+ }
1606
+ },
1607
+ "metadata": {}
1608
+ },
1609
+ {
1610
+ "output_type": "stream",
1611
+ "name": "stderr",
1612
+ "text": [
1613
+ "Some weights of BertForSequenceClassification were not initialized from the model checkpoint at adalbertojunior/distilbert-portuguese-cased and are newly initialized: ['classifier.bias', 'classifier.weight']\n",
1614
+ "You should probably TRAIN this model on a down-stream task to be able to use it for predictions and inference.\n"
1615
+ ]
1616
+ }
1617
+ ]
1618
+ },
1619
+ {
1620
+ "cell_type": "code",
1621
+ "source": [
1622
+ "import torch\n",
1623
+ "\n",
1624
+ "device = 'cuda' if torch.cuda.is_available() else 'cpu'\n",
1625
+ "model.to(device)\n",
1626
+ "device"
1627
+ ],
1628
+ "metadata": {
1629
+ "colab": {
1630
+ "base_uri": "https://localhost:8080/",
1631
+ "height": 36
1632
+ },
1633
+ "id": "0PZkmqv9br7j",
1634
+ "outputId": "8710153b-357e-4116-93d7-ced770ef137b"
1635
+ },
1636
+ "execution_count": 14,
1637
+ "outputs": [
1638
+ {
1639
+ "output_type": "execute_result",
1640
+ "data": {
1641
+ "text/plain": [
1642
+ "'cuda'"
1643
+ ],
1644
+ "application/vnd.google.colaboratory.intrinsic+json": {
1645
+ "type": "string"
1646
+ }
1647
+ },
1648
+ "metadata": {},
1649
+ "execution_count": 14
1650
+ }
1651
+ ]
1652
+ },
1653
+ {
1654
+ "cell_type": "code",
1655
+ "source": [
1656
+ "params = list(model.named_parameters())\n",
1657
+ "\n",
1658
+ "print('The BERT model has {:} different named parameters.\\n'.format(len(params)))\n",
1659
+ "\n",
1660
+ "print('==== Embedding Layer ====\\n')\n",
1661
+ "\n",
1662
+ "for p in params[0:5]:\n",
1663
+ " print(\"{:<55} {:>12} {}\".format(p[0], str(tuple(p[1].size())), p[1].requires_grad))\n",
1664
+ "\n",
1665
+ "print('\\n==== First Transformer ====\\n')\n",
1666
+ "\n",
1667
+ "for p in params[5:21]:\n",
1668
+ " print(\"{:<55} {:>12} {}\".format(p[0], str(tuple(p[1].size())), p[1].requires_grad))\n",
1669
+ "\n",
1670
+ "print('\\n==== Output Layer ====\\n')\n",
1671
+ "\n",
1672
+ "for p in params[-4:]:\n",
1673
+ " print(\"{:<55} {:>12} {}\".format(p[0], str(tuple(p[1].size())), p[1].requires_grad))"
1674
+ ],
1675
+ "metadata": {
1676
+ "colab": {
1677
+ "base_uri": "https://localhost:8080/"
1678
+ },
1679
+ "id": "6KDOKbGCXHuQ",
1680
+ "outputId": "5d4cd088-3a0e-4be8-e7a4-427f3ba087c7"
1681
+ },
1682
+ "execution_count": 33,
1683
+ "outputs": [
1684
+ {
1685
+ "output_type": "stream",
1686
+ "name": "stdout",
1687
+ "text": [
1688
+ "The BERT model has 105 different named parameters.\n",
1689
+ "\n",
1690
+ "==== Embedding Layer ====\n",
1691
+ "\n",
1692
+ "bert.embeddings.word_embeddings.weight (29794, 768) False\n",
1693
+ "bert.embeddings.position_embeddings.weight (512, 768) False\n",
1694
+ "bert.embeddings.token_type_embeddings.weight (2, 768) False\n",
1695
+ "bert.embeddings.LayerNorm.weight (768,) False\n",
1696
+ "bert.embeddings.LayerNorm.bias (768,) False\n",
1697
+ "\n",
1698
+ "==== First Transformer ====\n",
1699
+ "\n",
1700
+ "bert.encoder.layer.0.attention.self.query.weight (768, 768) False\n",
1701
+ "bert.encoder.layer.0.attention.self.query.bias (768,) False\n",
1702
+ "bert.encoder.layer.0.attention.self.key.weight (768, 768) False\n",
1703
+ "bert.encoder.layer.0.attention.self.key.bias (768,) False\n",
1704
+ "bert.encoder.layer.0.attention.self.value.weight (768, 768) False\n",
1705
+ "bert.encoder.layer.0.attention.self.value.bias (768,) False\n",
1706
+ "bert.encoder.layer.0.attention.output.dense.weight (768, 768) False\n",
1707
+ "bert.encoder.layer.0.attention.output.dense.bias (768,) False\n",
1708
+ "bert.encoder.layer.0.attention.output.LayerNorm.weight (768,) False\n",
1709
+ "bert.encoder.layer.0.attention.output.LayerNorm.bias (768,) False\n",
1710
+ "bert.encoder.layer.0.intermediate.dense.weight (3072, 768) False\n",
1711
+ "bert.encoder.layer.0.intermediate.dense.bias (3072,) False\n",
1712
+ "bert.encoder.layer.0.output.dense.weight (768, 3072) False\n",
1713
+ "bert.encoder.layer.0.output.dense.bias (768,) False\n",
1714
+ "bert.encoder.layer.0.output.LayerNorm.weight (768,) False\n",
1715
+ "bert.encoder.layer.0.output.LayerNorm.bias (768,) False\n",
1716
+ "\n",
1717
+ "==== Output Layer ====\n",
1718
+ "\n",
1719
+ "bert.pooler.dense.weight (768, 768) False\n",
1720
+ "bert.pooler.dense.bias (768,) False\n",
1721
+ "classifier.weight (2, 768) True\n",
1722
+ "classifier.bias (2,) True\n"
1723
+ ]
1724
+ }
1725
+ ]
1726
+ },
1727
+ {
1728
+ "cell_type": "code",
1729
+ "source": [
1730
+ "for parameter in model.parameters():\n",
1731
+ " parameter.requires_grad = False\n",
1732
+ "for parameter in model.classifier.parameters():\n",
1733
+ " parameter.requires_grad = True"
1734
+ ],
1735
+ "metadata": {
1736
+ "id": "9DOy7eY5Y_px"
1737
+ },
1738
+ "execution_count": 16,
1739
+ "outputs": []
1740
+ },
1741
+ {
1742
+ "cell_type": "code",
1743
+ "source": [
1744
+ "import numpy as np\n",
1745
+ "\n",
1746
+ "training_args = TrainingArguments(\n",
1747
+ " output_dir=\"./trainer_out\",\n",
1748
+ " learning_rate=2e-4,\n",
1749
+ " per_device_train_batch_size=256,\n",
1750
+ " per_device_eval_batch_size=256,\n",
1751
+ " num_train_epochs=5,\n",
1752
+ " weight_decay=0.01,\n",
1753
+ " evaluation_strategy=IntervalStrategy.EPOCH,\n",
1754
+ ")\n",
1755
+ "\n",
1756
+ "metric = load_metric('accuracy')\n",
1757
+ "\n",
1758
+ "def compute_metrics(eval_pred):\n",
1759
+ " logits, labels = eval_pred\n",
1760
+ " predictions = np.argmax(logits, axis=-1)\n",
1761
+ " return metric.compute(predictions=predictions, references=labels)\n",
1762
+ "\n",
1763
+ "# # transfer learning\n",
1764
+ "# for module in list(model.modules())[:-3]:\n",
1765
+ "# for param in module.parameters():\n",
1766
+ "# param.requires_grad = False\n",
1767
+ "\n",
1768
+ "trainer = Trainer(\n",
1769
+ " model=model,\n",
1770
+ " args=training_args,\n",
1771
+ " train_dataset=train_ds,\n",
1772
+ " eval_dataset=test_ds,\n",
1773
+ " tokenizer=tokenizer,\n",
1774
+ " compute_metrics=compute_metrics,\n",
1775
+ ")\n",
1776
+ "\n",
1777
+ "trainer.train()"
1778
+ ],
1779
+ "metadata": {
1780
+ "colab": {
1781
+ "base_uri": "https://localhost:8080/",
1782
+ "height": 362
1783
+ },
1784
+ "id": "WiAQCmLZXHzy",
1785
+ "outputId": "a9f508ae-3eb8-4b7d-d333-193f2d236796"
1786
+ },
1787
+ "execution_count": 47,
1788
+ "outputs": [
1789
+ {
1790
+ "output_type": "stream",
1791
+ "name": "stderr",
1792
+ "text": [
1793
+ "/usr/local/lib/python3.9/dist-packages/transformers/optimization.py:391: 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",
1794
+ " warnings.warn(\n",
1795
+ "You're using a BertTokenizerFast tokenizer. Please note that with a fast tokenizer, using the `__call__` method is faster than using a method to encode the text followed by a call to the `pad` method to get a padded encoding.\n"
1796
+ ]
1797
+ },
1798
+ {
1799
+ "output_type": "display_data",
1800
+ "data": {
1801
+ "text/plain": [
1802
+ "<IPython.core.display.HTML object>"
1803
+ ],
1804
+ "text/html": [
1805
+ "\n",
1806
+ " <div>\n",
1807
+ " \n",
1808
+ " <progress value='355' max='355' style='width:300px; height:20px; vertical-align: middle;'></progress>\n",
1809
+ " [355/355 12:02, Epoch 5/5]\n",
1810
+ " </div>\n",
1811
+ " <table border=\"1\" class=\"dataframe\">\n",
1812
+ " <thead>\n",
1813
+ " <tr style=\"text-align: left;\">\n",
1814
+ " <th>Epoch</th>\n",
1815
+ " <th>Training Loss</th>\n",
1816
+ " <th>Validation Loss</th>\n",
1817
+ " <th>Accuracy</th>\n",
1818
+ " </tr>\n",
1819
+ " </thead>\n",
1820
+ " <tbody>\n",
1821
+ " <tr>\n",
1822
+ " <td>1</td>\n",
1823
+ " <td>No log</td>\n",
1824
+ " <td>0.634915</td>\n",
1825
+ " <td>0.663500</td>\n",
1826
+ " </tr>\n",
1827
+ " <tr>\n",
1828
+ " <td>2</td>\n",
1829
+ " <td>No log</td>\n",
1830
+ " <td>0.628911</td>\n",
1831
+ " <td>0.670500</td>\n",
1832
+ " </tr>\n",
1833
+ " <tr>\n",
1834
+ " <td>3</td>\n",
1835
+ " <td>No log</td>\n",
1836
+ " <td>0.625601</td>\n",
1837
+ " <td>0.669000</td>\n",
1838
+ " </tr>\n",
1839
+ " <tr>\n",
1840
+ " <td>4</td>\n",
1841
+ " <td>No log</td>\n",
1842
+ " <td>0.623909</td>\n",
1843
+ " <td>0.664000</td>\n",
1844
+ " </tr>\n",
1845
+ " <tr>\n",
1846
+ " <td>5</td>\n",
1847
+ " <td>No log</td>\n",
1848
+ " <td>0.623280</td>\n",
1849
+ " <td>0.664500</td>\n",
1850
+ " </tr>\n",
1851
+ " </tbody>\n",
1852
+ "</table><p>"
1853
+ ]
1854
+ },
1855
+ "metadata": {}
1856
+ },
1857
+ {
1858
+ "output_type": "execute_result",
1859
+ "data": {
1860
+ "text/plain": [
1861
+ "TrainOutput(global_step=355, training_loss=0.6338723196110255, metrics={'train_runtime': 724.7707, 'train_samples_per_second': 124.177, 'train_steps_per_second': 0.49, 'total_flos': 5961032939520000.0, 'train_loss': 0.6338723196110255, 'epoch': 5.0})"
1862
+ ]
1863
+ },
1864
+ "metadata": {},
1865
+ "execution_count": 47
1866
+ }
1867
+ ]
1868
+ },
1869
+ {
1870
+ "cell_type": "code",
1871
+ "source": [
1872
+ "trainer.train()"
1873
+ ],
1874
+ "metadata": {
1875
+ "colab": {
1876
+ "base_uri": "https://localhost:8080/",
1877
+ "height": 287
1878
+ },
1879
+ "id": "ounT1oDOniUI",
1880
+ "outputId": "50d5bd72-eab2-4be8-9f1d-04120b97cce9"
1881
+ },
1882
+ "execution_count": 53,
1883
+ "outputs": [
1884
+ {
1885
+ "output_type": "display_data",
1886
+ "data": {
1887
+ "text/plain": [
1888
+ "<IPython.core.display.HTML object>"
1889
+ ],
1890
+ "text/html": [
1891
+ "\n",
1892
+ " <div>\n",
1893
+ " \n",
1894
+ " <progress value='355' max='355' style='width:300px; height:20px; vertical-align: middle;'></progress>\n",
1895
+ " [355/355 12:01, Epoch 5/5]\n",
1896
+ " </div>\n",
1897
+ " <table border=\"1\" class=\"dataframe\">\n",
1898
+ " <thead>\n",
1899
+ " <tr style=\"text-align: left;\">\n",
1900
+ " <th>Epoch</th>\n",
1901
+ " <th>Training Loss</th>\n",
1902
+ " <th>Validation Loss</th>\n",
1903
+ " <th>Accuracy</th>\n",
1904
+ " </tr>\n",
1905
+ " </thead>\n",
1906
+ " <tbody>\n",
1907
+ " <tr>\n",
1908
+ " <td>1</td>\n",
1909
+ " <td>No log</td>\n",
1910
+ " <td>0.623280</td>\n",
1911
+ " <td>0.664500</td>\n",
1912
+ " </tr>\n",
1913
+ " <tr>\n",
1914
+ " <td>2</td>\n",
1915
+ " <td>No log</td>\n",
1916
+ " <td>0.623280</td>\n",
1917
+ " <td>0.664500</td>\n",
1918
+ " </tr>\n",
1919
+ " <tr>\n",
1920
+ " <td>3</td>\n",
1921
+ " <td>No log</td>\n",
1922
+ " <td>0.623280</td>\n",
1923
+ " <td>0.664500</td>\n",
1924
+ " </tr>\n",
1925
+ " <tr>\n",
1926
+ " <td>4</td>\n",
1927
+ " <td>No log</td>\n",
1928
+ " <td>0.623280</td>\n",
1929
+ " <td>0.664500</td>\n",
1930
+ " </tr>\n",
1931
+ " <tr>\n",
1932
+ " <td>5</td>\n",
1933
+ " <td>No log</td>\n",
1934
+ " <td>0.623280</td>\n",
1935
+ " <td>0.664500</td>\n",
1936
+ " </tr>\n",
1937
+ " </tbody>\n",
1938
+ "</table><p>"
1939
+ ]
1940
+ },
1941
+ "metadata": {}
1942
+ },
1943
+ {
1944
+ "output_type": "execute_result",
1945
+ "data": {
1946
+ "text/plain": [
1947
+ "TrainOutput(global_step=355, training_loss=0.6281896456866197, metrics={'train_runtime': 723.41, 'train_samples_per_second': 124.411, 'train_steps_per_second': 0.491, 'total_flos': 5961032939520000.0, 'train_loss': 0.6281896456866197, 'epoch': 5.0})"
1948
+ ]
1949
+ },
1950
+ "metadata": {},
1951
+ "execution_count": 53
1952
+ }
1953
+ ]
1954
+ },
1955
+ {
1956
+ "cell_type": "code",
1957
+ "source": [
1958
+ "trainer.save_model('./pt_br_model')"
1959
+ ],
1960
+ "metadata": {
1961
+ "id": "Bp7qkdjkXH2j"
1962
+ },
1963
+ "execution_count": 54,
1964
+ "outputs": []
1965
+ },
1966
+ {
1967
+ "cell_type": "code",
1968
+ "source": [
1969
+ "!tar jcpvf model.tar.bz2 pt_br_model"
1970
+ ],
1971
+ "metadata": {
1972
+ "colab": {
1973
+ "base_uri": "https://localhost:8080/"
1974
+ },
1975
+ "id": "Wmu5JQSue0Hb",
1976
+ "outputId": "54dae7e4-0c29-46ad-e304-04ab5703f1aa"
1977
+ },
1978
+ "execution_count": 55,
1979
+ "outputs": [
1980
+ {
1981
+ "output_type": "stream",
1982
+ "name": "stdout",
1983
+ "text": [
1984
+ "pt_br_model/\n",
1985
+ "pt_br_model/tokenizer_config.json\n",
1986
+ "pt_br_model/training_args.bin\n",
1987
+ "pt_br_model/vocab.txt\n",
1988
+ "pt_br_model/pytorch_model.bin\n",
1989
+ "pt_br_model/tokenizer.json\n",
1990
+ "pt_br_model/config.json\n",
1991
+ "pt_br_model/special_tokens_map.json\n"
1992
+ ]
1993
+ }
1994
+ ]
1995
+ },
1996
+ {
1997
+ "cell_type": "code",
1998
+ "source": [
1999
+ "!ls -al ./pt_br_model/*"
2000
+ ],
2001
+ "metadata": {
2002
+ "colab": {
2003
+ "base_uri": "https://localhost:8080/"
2004
+ },
2005
+ "id": "evbwLlLIi3QK",
2006
+ "outputId": "c1736d23-8d93-4597-ed76-3428d8d75e82"
2007
+ },
2008
+ "execution_count": 42,
2009
+ "outputs": [
2010
+ {
2011
+ "output_type": "stream",
2012
+ "name": "stdout",
2013
+ "text": [
2014
+ "-rw-r--r-- 1 root root 752 Apr 15 10:51 ./pt_br_model/config.json\n",
2015
+ "-rw-r--r-- 1 root root 265629621 Apr 15 10:51 ./pt_br_model/pytorch_model.bin\n",
2016
+ "-rw-r--r-- 1 root root 125 Apr 15 10:51 ./pt_br_model/special_tokens_map.json\n",
2017
+ "-rw-r--r-- 1 root root 395 Apr 15 10:51 ./pt_br_model/tokenizer_config.json\n",
2018
+ "-rw-r--r-- 1 root root 678043 Apr 15 10:51 ./pt_br_model/tokenizer.json\n",
2019
+ "-rw-r--r-- 1 root root 3579 Apr 15 10:51 ./pt_br_model/training_args.bin\n",
2020
+ "-rw-r--r-- 1 root root 209528 Apr 15 10:51 ./pt_br_model/vocab.txt\n"
2021
+ ]
2022
+ }
2023
+ ]
2024
+ },
2025
+ {
2026
+ "cell_type": "code",
2027
+ "source": [
2028
+ "!ls -al"
2029
+ ],
2030
+ "metadata": {
2031
+ "colab": {
2032
+ "base_uri": "https://localhost:8080/"
2033
+ },
2034
+ "id": "y68jWdM5jJJD",
2035
+ "outputId": "f9910474-5a0b-44da-b88d-ecaed8fae13a"
2036
+ },
2037
+ "execution_count": 44,
2038
+ "outputs": [
2039
+ {
2040
+ "output_type": "stream",
2041
+ "name": "stdout",
2042
+ "text": [
2043
+ "total 317924\n",
2044
+ "drwxr-xr-x 1 root root 4096 Apr 15 10:51 .\n",
2045
+ "drwxr-xr-x 1 root root 4096 Apr 15 10:18 ..\n",
2046
+ "drwxr-xr-x 4 root root 4096 Apr 13 13:29 .config\n",
2047
+ "-rw-r--r-- 1 root root 252222673 Apr 15 10:52 model.tar.bz2\n",
2048
+ "drwxr-xr-x 2 root root 4096 Apr 15 10:51 pt_br_model\n",
2049
+ "-rw-r--r-- 1 root root 41144160 Dec 3 2020 pt_br.txt\n",
2050
+ "-rw-r--r-- 1 root root 32155453 Dec 3 2020 pt.txt\n",
2051
+ "drwxr-xr-x 1 root root 4096 Apr 13 13:30 sample_data\n",
2052
+ "drwxr-xr-x 3 root root 4096 Apr 15 10:25 trainer_out\n"
2053
+ ]
2054
+ }
2055
+ ]
2056
+ },
2057
+ {
2058
+ "cell_type": "code",
2059
+ "source": [
2060
+ "!cp model.tar.bz2 /content/drive/MyDrive"
2061
+ ],
2062
+ "metadata": {
2063
+ "id": "_4BB3YnvRHZw"
2064
+ },
2065
+ "execution_count": 56,
2066
+ "outputs": []
2067
+ },
2068
+ {
2069
+ "cell_type": "code",
2070
+ "source": [
2071
+ "print(transformers.__version__)"
2072
+ ],
2073
+ "metadata": {
2074
+ "colab": {
2075
+ "base_uri": "https://localhost:8080/"
2076
+ },
2077
+ "id": "K-B-mwGryWOw",
2078
+ "outputId": "1742e546-04d3-47d7-e1bf-34da07ef35b8"
2079
+ },
2080
+ "execution_count": 58,
2081
+ "outputs": [
2082
+ {
2083
+ "output_type": "stream",
2084
+ "name": "stdout",
2085
+ "text": [
2086
+ "4.28.1\n"
2087
+ ]
2088
+ }
2089
+ ]
2090
+ }
2091
+ ]
2092
+ }