|
25 | 25 | "\n",
|
26 | 26 | "from mindnlp.engine import Trainer, Evaluator\n",
|
27 | 27 | "from mindnlp.engine.callbacks import CheckpointCallback, BestModelCallback\n",
|
28 |
| - "from mindnlp.metrics import Accuracy\n", |
29 |
| - "from mindnlp.dataset.transforms import PadTransform" |
| 28 | + "from mindnlp.metrics import Accuracy" |
30 | 29 | ]
|
31 | 30 | },
|
32 | 31 | {
|
|
73 | 72 | "name": "stdout",
|
74 | 73 | "output_type": "stream",
|
75 | 74 | "text": [
|
76 |
| - "--2023-11-16 23:33:04-- https://baidu-nlp.bj.bcebos.com/emotion_detection-dataset-1.0.0.tar.gz\n", |
| 75 | + "--2023-11-30 16:11:36-- https://baidu-nlp.bj.bcebos.com/emotion_detection-dataset-1.0.0.tar.gz\n", |
77 | 76 | "Resolving baidu-nlp.bj.bcebos.com (baidu-nlp.bj.bcebos.com)... 36.110.192.178, 2409:8c04:1001:1002:0:ff:b001:368a\n",
|
78 | 77 | "Connecting to baidu-nlp.bj.bcebos.com (baidu-nlp.bj.bcebos.com)|36.110.192.178|:443... connected.\n",
|
79 | 78 | "HTTP request sent, awaiting response... 200 OK\n",
|
80 | 79 | "Length: 1710581 (1.6M) [application/x-gzip]\n",
|
81 | 80 | "Saving to: ‘emotion_detection.tar.gz’\n",
|
82 | 81 | "\n",
|
83 |
| - "emotion_detection.t 100%[===================>] 1.63M 2.29MB/s in 0.7s \n", |
| 82 | + "emotion_detection.t 100%[===================>] 1.63M 6.36MB/s in 0.3s \n", |
84 | 83 | "\n",
|
85 |
| - "2023-11-16 23:33:05 (2.29 MB/s) - ‘emotion_detection.tar.gz’ saved [1710581/1710581]\n", |
| 84 | + "2023-11-30 16:11:37 (6.36 MB/s) - ‘emotion_detection.tar.gz’ saved [1710581/1710581]\n", |
86 | 85 | "\n",
|
87 | 86 | "data/\n",
|
88 | 87 | "data/test.tsv\n",
|
|
239 | 238 | "name": "stderr",
|
240 | 239 | "output_type": "stream",
|
241 | 240 | "text": [
|
242 |
| - "Epoch 0: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 302/302 [00:41<00:00, 7.20it/s, loss=0.3326994]\n" |
| 241 | + "Epoch 0: 100%|███████████████████████████████████████| 302/302 [00:38<00:00, 7.85it/s, loss=0.35258844]\n" |
243 | 242 | ]
|
244 | 243 | },
|
245 | 244 | {
|
|
253 | 252 | "name": "stderr",
|
254 | 253 | "output_type": "stream",
|
255 | 254 | "text": [
|
256 |
| - "Evaluate: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 34/34 [00:02<00:00, 14.57it/s]\n" |
| 255 | + "Evaluate: 100%|█████████████████████████████████████████████████████████| 34/34 [00:02<00:00, 15.66it/s]\n" |
257 | 256 | ]
|
258 | 257 | },
|
259 | 258 | {
|
260 | 259 | "name": "stdout",
|
261 | 260 | "output_type": "stream",
|
262 | 261 | "text": [
|
263 |
| - "Evaluate Score: {'Accuracy': 0.937962962962963}\n", |
| 262 | + "Evaluate Score: {'Accuracy': 0.9046296296296297}\n", |
264 | 263 | "---------------Best Model: 'bert_emotect_best.ckpt' has been saved in epoch: 0.---------------\n"
|
265 | 264 | ]
|
266 | 265 | },
|
267 | 266 | {
|
268 | 267 | "name": "stderr",
|
269 | 268 | "output_type": "stream",
|
270 | 269 | "text": [
|
271 |
| - "Epoch 1: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 302/302 [00:39<00:00, 7.64it/s, loss=0.1856075]\n" |
| 270 | + "Epoch 1: 100%|████████████████████████████████████████| 302/302 [00:35<00:00, 8.48it/s, loss=0.1903949]\n" |
272 | 271 | ]
|
273 | 272 | },
|
274 | 273 | {
|
|
282 | 281 | "name": "stderr",
|
283 | 282 | "output_type": "stream",
|
284 | 283 | "text": [
|
285 |
| - "Evaluate: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 34/34 [00:02<00:00, 15.27it/s]\n" |
| 284 | + "Evaluate: 100%|█████████████████████████████████████████████████████████| 34/34 [00:01<00:00, 17.63it/s]\n" |
286 | 285 | ]
|
287 | 286 | },
|
288 | 287 | {
|
289 | 288 | "name": "stdout",
|
290 | 289 | "output_type": "stream",
|
291 | 290 | "text": [
|
292 |
| - "Evaluate Score: {'Accuracy': 0.962037037037037}\n", |
| 291 | + "Evaluate Score: {'Accuracy': 0.9537037037037037}\n", |
293 | 292 | "---------------Best Model: 'bert_emotect_best.ckpt' has been saved in epoch: 1.---------------\n"
|
294 | 293 | ]
|
295 | 294 | },
|
296 | 295 | {
|
297 | 296 | "name": "stderr",
|
298 | 297 | "output_type": "stream",
|
299 | 298 | "text": [
|
300 |
| - "Epoch 2: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 302/302 [00:38<00:00, 7.88it/s, loss=0.12356275]\n" |
| 299 | + "Epoch 2: 100%|███████████████████████████████████████| 302/302 [00:36<00:00, 8.39it/s, loss=0.13147199]\n" |
301 | 300 | ]
|
302 | 301 | },
|
303 | 302 | {
|
|
312 | 311 | "name": "stderr",
|
313 | 312 | "output_type": "stream",
|
314 | 313 | "text": [
|
315 |
| - "Evaluate: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 34/34 [00:02<00:00, 16.79it/s]\n" |
| 314 | + "Evaluate: 100%|█████████████████████████████████████████████████████████| 34/34 [00:01<00:00, 17.65it/s]\n" |
316 | 315 | ]
|
317 | 316 | },
|
318 | 317 | {
|
319 | 318 | "name": "stdout",
|
320 | 319 | "output_type": "stream",
|
321 | 320 | "text": [
|
322 |
| - "Evaluate Score: {'Accuracy': 0.9861111111111112}\n", |
| 321 | + "Evaluate Score: {'Accuracy': 0.9601851851851851}\n", |
323 | 322 | "---------------Best Model: 'bert_emotect_best.ckpt' has been saved in epoch: 2.---------------\n"
|
324 | 323 | ]
|
325 | 324 | },
|
326 | 325 | {
|
327 | 326 | "name": "stderr",
|
328 | 327 | "output_type": "stream",
|
329 | 328 | "text": [
|
330 |
| - "Epoch 3: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 302/302 [00:39<00:00, 7.73it/s, loss=0.08384681]\n" |
| 329 | + "Epoch 3: 100%|██████████████████████████████████████| 302/302 [00:35<00:00, 8.39it/s, loss=0.096015364]\n" |
331 | 330 | ]
|
332 | 331 | },
|
333 | 332 | {
|
|
342 | 341 | "name": "stderr",
|
343 | 342 | "output_type": "stream",
|
344 | 343 | "text": [
|
345 |
| - "Evaluate: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 34/34 [00:02<00:00, 16.15it/s]\n" |
| 344 | + "Evaluate: 100%|█████████████████████████████████████████████████████████| 34/34 [00:01<00:00, 17.74it/s]\n" |
346 | 345 | ]
|
347 | 346 | },
|
348 | 347 | {
|
349 | 348 | "name": "stdout",
|
350 | 349 | "output_type": "stream",
|
351 | 350 | "text": [
|
352 |
| - "Evaluate Score: {'Accuracy': 0.9888888888888889}\n", |
| 351 | + "Evaluate Score: {'Accuracy': 0.9907407407407407}\n", |
353 | 352 | "---------------Best Model: 'bert_emotect_best.ckpt' has been saved in epoch: 3.---------------\n"
|
354 | 353 | ]
|
355 | 354 | },
|
356 | 355 | {
|
357 | 356 | "name": "stderr",
|
358 | 357 | "output_type": "stream",
|
359 | 358 | "text": [
|
360 |
| - "Epoch 4: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 302/302 [00:36<00:00, 8.27it/s, loss=0.05979367]\n" |
| 359 | + "Epoch 4: 100%|███████████████████████████████████████| 302/302 [00:36<00:00, 8.23it/s, loss=0.06472951]\n" |
361 | 360 | ]
|
362 | 361 | },
|
363 | 362 | {
|
|
372 | 371 | "name": "stderr",
|
373 | 372 | "output_type": "stream",
|
374 | 373 | "text": [
|
375 |
| - "Evaluate: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 34/34 [00:02<00:00, 16.09it/s]\n" |
| 374 | + "Evaluate: 100%|█████████████████████████████████████████████████████████| 34/34 [00:01<00:00, 17.69it/s]\n" |
376 | 375 | ]
|
377 | 376 | },
|
378 | 377 | {
|
379 | 378 | "name": "stdout",
|
380 | 379 | "output_type": "stream",
|
381 | 380 | "text": [
|
382 |
| - "Evaluate Score: {'Accuracy': 0.9879629629629629}\n", |
383 |
| - "Loading best model from 'checkpoint' with '['Accuracy']': [0.9888888888888889]...\n", |
| 381 | + "Evaluate Score: {'Accuracy': 0.9953703703703703}\n", |
| 382 | + "---------------Best Model: 'bert_emotect_best.ckpt' has been saved in epoch: 4.---------------\n", |
| 383 | + "Loading best model from 'checkpoint' with '['Accuracy']': [0.9953703703703703]...\n", |
384 | 384 | "---------------The model is already load the best model from 'bert_emotect_best.ckpt'.---------------\n"
|
385 | 385 | ]
|
386 | 386 | }
|
|
401 | 401 | "name": "stderr",
|
402 | 402 | "output_type": "stream",
|
403 | 403 | "text": [
|
404 |
| - "Evaluate: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 33/33 [00:02<00:00, 16.08it/s]" |
| 404 | + "Evaluate: 100%|█████████████████████████████████████████████████████████| 33/33 [00:01<00:00, 17.01it/s]" |
405 | 405 | ]
|
406 | 406 | },
|
407 | 407 | {
|
408 | 408 | "name": "stdout",
|
409 | 409 | "output_type": "stream",
|
410 | 410 | "text": [
|
411 |
| - "Evaluate Score: {'Accuracy': 0.9083011583011583}\n" |
| 411 | + "Evaluate Score: {'Accuracy': 0.8841698841698842}\n" |
412 | 412 | ]
|
413 | 413 | },
|
414 | 414 | {
|
|
0 commit comments