File size: 20,719 Bytes
c588f54
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6a04f01
c588f54
 
6a04f01
 
 
 
c588f54
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6a04f01
c588f54
 
6a04f01
 
 
 
c588f54
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6a04f01
c588f54
 
6a04f01
 
 
 
c588f54
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6a04f01
c588f54
 
6a04f01
 
 
 
c588f54
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6a04f01
c588f54
 
6a04f01
 
 
 
c588f54
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6a04f01
c588f54
 
6a04f01
 
 
 
c588f54
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6a04f01
c588f54
 
6a04f01
 
 
 
c588f54
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6a04f01
c588f54
 
6a04f01
 
 
 
c588f54
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6a04f01
c588f54
 
6a04f01
 
 
 
c588f54
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6a04f01
c588f54
 
6a04f01
 
 
 
c588f54
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6a04f01
c588f54
 
6a04f01
 
 
 
c588f54
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6a04f01
c588f54
 
6a04f01
 
 
 
c588f54
 
 
 
 
 
 
 
 
6a04f01
 
 
c588f54
 
 
6a04f01
 
 
c588f54
6a04f01
 
c588f54
6a04f01
 
c588f54
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6a04f01
c588f54
 
 
6a04f01
 
 
 
c588f54
 
 
6a04f01
c588f54
 
 
6a04f01
c588f54
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
2022-10-04 14:07:15,489 ----------------------------------------------------------------------------------------------------
2022-10-04 14:07:15,492 Model: "SequenceTagger(
  (embeddings): TransformerWordEmbeddings(
    (model): BertModel(
      (embeddings): BertEmbeddings(
        (word_embeddings): Embedding(119547, 768, padding_idx=0)
        (position_embeddings): Embedding(512, 768)
        (token_type_embeddings): Embedding(2, 768)
        (LayerNorm): LayerNorm((768,), eps=1e-12, elementwise_affine=True)
        (dropout): Dropout(p=0.1, inplace=False)
      )
      (encoder): BertEncoder(
        (layer): ModuleList(
          (0): BertLayer(
            (attention): BertAttention(
              (self): BertSelfAttention(
                (query): Linear(in_features=768, out_features=768, bias=True)
                (key): Linear(in_features=768, out_features=768, bias=True)
                (value): Linear(in_features=768, out_features=768, bias=True)
                (dropout): Dropout(p=0.1, inplace=False)
              )
              (output): BertSelfOutput(
                (dense): Linear(in_features=768, out_features=768, bias=True)
                (LayerNorm): LayerNorm((768,), eps=1e-12, elementwise_affine=True)
                (dropout): Dropout(p=0.1, inplace=False)
              )
            )
            (intermediate): BertIntermediate(
              (dense): Linear(in_features=768, out_features=3072, bias=True)
              (intermediate_act_fn): GELUActivation()
            )
            (output): BertOutput(
              (dense): Linear(in_features=3072, out_features=768, bias=True)
              (LayerNorm): LayerNorm((768,), eps=1e-12, elementwise_affine=True)
              (dropout): Dropout(p=0.1, inplace=False)
            )
          )
          (1): BertLayer(
            (attention): BertAttention(
              (self): BertSelfAttention(
                (query): Linear(in_features=768, out_features=768, bias=True)
                (key): Linear(in_features=768, out_features=768, bias=True)
                (value): Linear(in_features=768, out_features=768, bias=True)
                (dropout): Dropout(p=0.1, inplace=False)
              )
              (output): BertSelfOutput(
                (dense): Linear(in_features=768, out_features=768, bias=True)
                (LayerNorm): LayerNorm((768,), eps=1e-12, elementwise_affine=True)
                (dropout): Dropout(p=0.1, inplace=False)
              )
            )
            (intermediate): BertIntermediate(
              (dense): Linear(in_features=768, out_features=3072, bias=True)
              (intermediate_act_fn): GELUActivation()
            )
            (output): BertOutput(
              (dense): Linear(in_features=3072, out_features=768, bias=True)
              (LayerNorm): LayerNorm((768,), eps=1e-12, elementwise_affine=True)
              (dropout): Dropout(p=0.1, inplace=False)
            )
          )
          (2): BertLayer(
            (attention): BertAttention(
              (self): BertSelfAttention(
                (query): Linear(in_features=768, out_features=768, bias=True)
                (key): Linear(in_features=768, out_features=768, bias=True)
                (value): Linear(in_features=768, out_features=768, bias=True)
                (dropout): Dropout(p=0.1, inplace=False)
              )
              (output): BertSelfOutput(
                (dense): Linear(in_features=768, out_features=768, bias=True)
                (LayerNorm): LayerNorm((768,), eps=1e-12, elementwise_affine=True)
                (dropout): Dropout(p=0.1, inplace=False)
              )
            )
            (intermediate): BertIntermediate(
              (dense): Linear(in_features=768, out_features=3072, bias=True)
              (intermediate_act_fn): GELUActivation()
            )
            (output): BertOutput(
              (dense): Linear(in_features=3072, out_features=768, bias=True)
              (LayerNorm): LayerNorm((768,), eps=1e-12, elementwise_affine=True)
              (dropout): Dropout(p=0.1, inplace=False)
            )
          )
          (3): BertLayer(
            (attention): BertAttention(
              (self): BertSelfAttention(
                (query): Linear(in_features=768, out_features=768, bias=True)
                (key): Linear(in_features=768, out_features=768, bias=True)
                (value): Linear(in_features=768, out_features=768, bias=True)
                (dropout): Dropout(p=0.1, inplace=False)
              )
              (output): BertSelfOutput(
                (dense): Linear(in_features=768, out_features=768, bias=True)
                (LayerNorm): LayerNorm((768,), eps=1e-12, elementwise_affine=True)
                (dropout): Dropout(p=0.1, inplace=False)
              )
            )
            (intermediate): BertIntermediate(
              (dense): Linear(in_features=768, out_features=3072, bias=True)
              (intermediate_act_fn): GELUActivation()
            )
            (output): BertOutput(
              (dense): Linear(in_features=3072, out_features=768, bias=True)
              (LayerNorm): LayerNorm((768,), eps=1e-12, elementwise_affine=True)
              (dropout): Dropout(p=0.1, inplace=False)
            )
          )
          (4): BertLayer(
            (attention): BertAttention(
              (self): BertSelfAttention(
                (query): Linear(in_features=768, out_features=768, bias=True)
                (key): Linear(in_features=768, out_features=768, bias=True)
                (value): Linear(in_features=768, out_features=768, bias=True)
                (dropout): Dropout(p=0.1, inplace=False)
              )
              (output): BertSelfOutput(
                (dense): Linear(in_features=768, out_features=768, bias=True)
                (LayerNorm): LayerNorm((768,), eps=1e-12, elementwise_affine=True)
                (dropout): Dropout(p=0.1, inplace=False)
              )
            )
            (intermediate): BertIntermediate(
              (dense): Linear(in_features=768, out_features=3072, bias=True)
              (intermediate_act_fn): GELUActivation()
            )
            (output): BertOutput(
              (dense): Linear(in_features=3072, out_features=768, bias=True)
              (LayerNorm): LayerNorm((768,), eps=1e-12, elementwise_affine=True)
              (dropout): Dropout(p=0.1, inplace=False)
            )
          )
          (5): BertLayer(
            (attention): BertAttention(
              (self): BertSelfAttention(
                (query): Linear(in_features=768, out_features=768, bias=True)
                (key): Linear(in_features=768, out_features=768, bias=True)
                (value): Linear(in_features=768, out_features=768, bias=True)
                (dropout): Dropout(p=0.1, inplace=False)
              )
              (output): BertSelfOutput(
                (dense): Linear(in_features=768, out_features=768, bias=True)
                (LayerNorm): LayerNorm((768,), eps=1e-12, elementwise_affine=True)
                (dropout): Dropout(p=0.1, inplace=False)
              )
            )
            (intermediate): BertIntermediate(
              (dense): Linear(in_features=768, out_features=3072, bias=True)
              (intermediate_act_fn): GELUActivation()
            )
            (output): BertOutput(
              (dense): Linear(in_features=3072, out_features=768, bias=True)
              (LayerNorm): LayerNorm((768,), eps=1e-12, elementwise_affine=True)
              (dropout): Dropout(p=0.1, inplace=False)
            )
          )
          (6): BertLayer(
            (attention): BertAttention(
              (self): BertSelfAttention(
                (query): Linear(in_features=768, out_features=768, bias=True)
                (key): Linear(in_features=768, out_features=768, bias=True)
                (value): Linear(in_features=768, out_features=768, bias=True)
                (dropout): Dropout(p=0.1, inplace=False)
              )
              (output): BertSelfOutput(
                (dense): Linear(in_features=768, out_features=768, bias=True)
                (LayerNorm): LayerNorm((768,), eps=1e-12, elementwise_affine=True)
                (dropout): Dropout(p=0.1, inplace=False)
              )
            )
            (intermediate): BertIntermediate(
              (dense): Linear(in_features=768, out_features=3072, bias=True)
              (intermediate_act_fn): GELUActivation()
            )
            (output): BertOutput(
              (dense): Linear(in_features=3072, out_features=768, bias=True)
              (LayerNorm): LayerNorm((768,), eps=1e-12, elementwise_affine=True)
              (dropout): Dropout(p=0.1, inplace=False)
            )
          )
          (7): BertLayer(
            (attention): BertAttention(
              (self): BertSelfAttention(
                (query): Linear(in_features=768, out_features=768, bias=True)
                (key): Linear(in_features=768, out_features=768, bias=True)
                (value): Linear(in_features=768, out_features=768, bias=True)
                (dropout): Dropout(p=0.1, inplace=False)
              )
              (output): BertSelfOutput(
                (dense): Linear(in_features=768, out_features=768, bias=True)
                (LayerNorm): LayerNorm((768,), eps=1e-12, elementwise_affine=True)
                (dropout): Dropout(p=0.1, inplace=False)
              )
            )
            (intermediate): BertIntermediate(
              (dense): Linear(in_features=768, out_features=3072, bias=True)
              (intermediate_act_fn): GELUActivation()
            )
            (output): BertOutput(
              (dense): Linear(in_features=3072, out_features=768, bias=True)
              (LayerNorm): LayerNorm((768,), eps=1e-12, elementwise_affine=True)
              (dropout): Dropout(p=0.1, inplace=False)
            )
          )
          (8): BertLayer(
            (attention): BertAttention(
              (self): BertSelfAttention(
                (query): Linear(in_features=768, out_features=768, bias=True)
                (key): Linear(in_features=768, out_features=768, bias=True)
                (value): Linear(in_features=768, out_features=768, bias=True)
                (dropout): Dropout(p=0.1, inplace=False)
              )
              (output): BertSelfOutput(
                (dense): Linear(in_features=768, out_features=768, bias=True)
                (LayerNorm): LayerNorm((768,), eps=1e-12, elementwise_affine=True)
                (dropout): Dropout(p=0.1, inplace=False)
              )
            )
            (intermediate): BertIntermediate(
              (dense): Linear(in_features=768, out_features=3072, bias=True)
              (intermediate_act_fn): GELUActivation()
            )
            (output): BertOutput(
              (dense): Linear(in_features=3072, out_features=768, bias=True)
              (LayerNorm): LayerNorm((768,), eps=1e-12, elementwise_affine=True)
              (dropout): Dropout(p=0.1, inplace=False)
            )
          )
          (9): BertLayer(
            (attention): BertAttention(
              (self): BertSelfAttention(
                (query): Linear(in_features=768, out_features=768, bias=True)
                (key): Linear(in_features=768, out_features=768, bias=True)
                (value): Linear(in_features=768, out_features=768, bias=True)
                (dropout): Dropout(p=0.1, inplace=False)
              )
              (output): BertSelfOutput(
                (dense): Linear(in_features=768, out_features=768, bias=True)
                (LayerNorm): LayerNorm((768,), eps=1e-12, elementwise_affine=True)
                (dropout): Dropout(p=0.1, inplace=False)
              )
            )
            (intermediate): BertIntermediate(
              (dense): Linear(in_features=768, out_features=3072, bias=True)
              (intermediate_act_fn): GELUActivation()
            )
            (output): BertOutput(
              (dense): Linear(in_features=3072, out_features=768, bias=True)
              (LayerNorm): LayerNorm((768,), eps=1e-12, elementwise_affine=True)
              (dropout): Dropout(p=0.1, inplace=False)
            )
          )
          (10): BertLayer(
            (attention): BertAttention(
              (self): BertSelfAttention(
                (query): Linear(in_features=768, out_features=768, bias=True)
                (key): Linear(in_features=768, out_features=768, bias=True)
                (value): Linear(in_features=768, out_features=768, bias=True)
                (dropout): Dropout(p=0.1, inplace=False)
              )
              (output): BertSelfOutput(
                (dense): Linear(in_features=768, out_features=768, bias=True)
                (LayerNorm): LayerNorm((768,), eps=1e-12, elementwise_affine=True)
                (dropout): Dropout(p=0.1, inplace=False)
              )
            )
            (intermediate): BertIntermediate(
              (dense): Linear(in_features=768, out_features=3072, bias=True)
              (intermediate_act_fn): GELUActivation()
            )
            (output): BertOutput(
              (dense): Linear(in_features=3072, out_features=768, bias=True)
              (LayerNorm): LayerNorm((768,), eps=1e-12, elementwise_affine=True)
              (dropout): Dropout(p=0.1, inplace=False)
            )
          )
          (11): BertLayer(
            (attention): BertAttention(
              (self): BertSelfAttention(
                (query): Linear(in_features=768, out_features=768, bias=True)
                (key): Linear(in_features=768, out_features=768, bias=True)
                (value): Linear(in_features=768, out_features=768, bias=True)
                (dropout): Dropout(p=0.1, inplace=False)
              )
              (output): BertSelfOutput(
                (dense): Linear(in_features=768, out_features=768, bias=True)
                (LayerNorm): LayerNorm((768,), eps=1e-12, elementwise_affine=True)
                (dropout): Dropout(p=0.1, inplace=False)
              )
            )
            (intermediate): BertIntermediate(
              (dense): Linear(in_features=768, out_features=3072, bias=True)
              (intermediate_act_fn): GELUActivation()
            )
            (output): BertOutput(
              (dense): Linear(in_features=3072, out_features=768, bias=True)
              (LayerNorm): LayerNorm((768,), eps=1e-12, elementwise_affine=True)
              (dropout): Dropout(p=0.1, inplace=False)
            )
          )
        )
      )
      (pooler): BertPooler(
        (dense): Linear(in_features=768, out_features=768, bias=True)
        (activation): Tanh()
      )
    )
  )
  (dropout): Dropout(p=0.3, inplace=False)
  (word_dropout): WordDropout(p=0.05)
  (locked_dropout): LockedDropout(p=0.5)
  (linear): Linear(in_features=768, out_features=13, bias=True)
  (loss_function): CrossEntropyLoss()
)"
2022-10-04 14:07:15,510 ----------------------------------------------------------------------------------------------------
2022-10-04 14:07:15,510 Corpus: "Corpus: 70000 train + 15000 dev + 15000 test sentences"
2022-10-04 14:07:15,510 ----------------------------------------------------------------------------------------------------
2022-10-04 14:07:15,511 Parameters:
2022-10-04 14:07:15,511  - learning_rate: "0.010000"
2022-10-04 14:07:15,511  - mini_batch_size: "8"
2022-10-04 14:07:15,511  - patience: "3"
2022-10-04 14:07:15,512  - anneal_factor: "0.5"
2022-10-04 14:07:15,512  - max_epochs: "2"
2022-10-04 14:07:15,512  - shuffle: "True"
2022-10-04 14:07:15,512  - train_with_dev: "False"
2022-10-04 14:07:15,513  - batch_growth_annealing: "False"
2022-10-04 14:07:15,513 ----------------------------------------------------------------------------------------------------
2022-10-04 14:07:15,513 Model training base path: "c:\Users\Ivan\Documents\Projects\Yoda\NER\model\flair\src\..\models\trans_sm_flair"
2022-10-04 14:07:15,513 ----------------------------------------------------------------------------------------------------
2022-10-04 14:07:15,513 Device: cuda:0
2022-10-04 14:07:15,514 ----------------------------------------------------------------------------------------------------
2022-10-04 14:07:15,514 Embeddings storage mode: cpu
2022-10-04 14:07:15,514 ----------------------------------------------------------------------------------------------------
2022-10-04 14:08:50,056 epoch 1 - iter 875/8750 - loss 0.77736243 - samples/sec: 74.10 - lr: 0.010000
2022-10-04 14:10:25,613 epoch 1 - iter 1750/8750 - loss 0.58654474 - samples/sec: 73.31 - lr: 0.010000
2022-10-04 14:12:00,221 epoch 1 - iter 2625/8750 - loss 0.49473747 - samples/sec: 74.05 - lr: 0.010000
2022-10-04 14:13:35,035 epoch 1 - iter 3500/8750 - loss 0.43711232 - samples/sec: 73.87 - lr: 0.010000
2022-10-04 14:15:08,344 epoch 1 - iter 4375/8750 - loss 0.39713865 - samples/sec: 75.06 - lr: 0.010000
2022-10-04 14:16:41,989 epoch 1 - iter 5250/8750 - loss 0.36731971 - samples/sec: 74.80 - lr: 0.010000
2022-10-04 14:18:17,847 epoch 1 - iter 6125/8750 - loss 0.34209381 - samples/sec: 73.07 - lr: 0.010000
2022-10-04 14:19:52,115 epoch 1 - iter 7000/8750 - loss 0.32256861 - samples/sec: 74.30 - lr: 0.010000
2022-10-04 14:21:26,066 epoch 1 - iter 7875/8750 - loss 0.30596431 - samples/sec: 74.55 - lr: 0.010000
2022-10-04 14:23:00,059 epoch 1 - iter 8750/8750 - loss 0.29124524 - samples/sec: 74.51 - lr: 0.010000
2022-10-04 14:23:00,061 ----------------------------------------------------------------------------------------------------
2022-10-04 14:23:00,062 EPOCH 1 done: loss 0.2912 - lr 0.010000
2022-10-04 14:24:52,210 Evaluating as a multi-label problem: False
2022-10-04 14:24:52,424 DEV : loss 0.06397613137960434 - f1-score (micro avg)  0.973
2022-10-04 14:24:53,223 BAD EPOCHS (no improvement): 0
2022-10-04 14:24:54,431 saving best model
2022-10-04 14:24:55,749 ----------------------------------------------------------------------------------------------------
2022-10-04 14:26:31,875 epoch 2 - iter 875/8750 - loss 0.15239591 - samples/sec: 72.88 - lr: 0.010000
2022-10-04 14:28:12,311 epoch 2 - iter 1750/8750 - loss 0.15109719 - samples/sec: 69.74 - lr: 0.010000
2022-10-04 14:29:49,414 epoch 2 - iter 2625/8750 - loss 0.15017726 - samples/sec: 72.14 - lr: 0.010000
2022-10-04 14:31:22,789 epoch 2 - iter 3500/8750 - loss 0.14709937 - samples/sec: 75.01 - lr: 0.010000
2022-10-04 14:32:56,365 epoch 2 - iter 4375/8750 - loss 0.14490590 - samples/sec: 74.87 - lr: 0.010000
2022-10-04 14:34:29,769 epoch 2 - iter 5250/8750 - loss 0.14379219 - samples/sec: 75.00 - lr: 0.010000
2022-10-04 14:36:04,122 epoch 2 - iter 6125/8750 - loss 0.14272196 - samples/sec: 74.24 - lr: 0.010000
2022-10-04 14:37:40,084 epoch 2 - iter 7000/8750 - loss 0.14024151 - samples/sec: 73.00 - lr: 0.010000
2022-10-04 14:39:15,077 epoch 2 - iter 7875/8750 - loss 0.13892120 - samples/sec: 73.73 - lr: 0.010000
2022-10-04 14:40:48,611 epoch 2 - iter 8750/8750 - loss 0.13731836 - samples/sec: 74.89 - lr: 0.010000
2022-10-04 14:40:48,617 ----------------------------------------------------------------------------------------------------
2022-10-04 14:40:48,617 EPOCH 2 done: loss 0.1373 - lr 0.010000
2022-10-04 14:42:50,048 Evaluating as a multi-label problem: False
2022-10-04 14:42:50,277 DEV : loss 0.05747831612825394 - f1-score (micro avg)  0.9844
2022-10-04 14:42:51,053 BAD EPOCHS (no improvement): 0
2022-10-04 14:42:52,333 saving best model
2022-10-04 14:42:54,576 ----------------------------------------------------------------------------------------------------
2022-10-04 14:42:54,600 loading file c:\Users\Ivan\Documents\Projects\Yoda\NER\model\flair\src\..\models\trans_sm_flair\best-model.pt
2022-10-04 14:42:57,086 SequenceTagger predicts: Dictionary with 13 tags: O, S-size, B-size, E-size, I-size, S-brand, B-brand, E-brand, I-brand, S-color, B-color, E-color, I-color
2022-10-04 14:44:29,459 Evaluating as a multi-label problem: False
2022-10-04 14:44:29,668 0.9816	0.9857	0.9837	0.9679
2022-10-04 14:44:29,669 
Results:
- F-score (micro) 0.9837
- F-score (macro) 0.9843
- Accuracy 0.9679

By class:
              precision    recall  f1-score   support

        size     0.9820    0.9859    0.9839     17988
       brand     0.9773    0.9860    0.9817     11674
       color     0.9905    0.9840    0.9872      5070

   micro avg     0.9816    0.9857    0.9837     34732
   macro avg     0.9833    0.9853    0.9843     34732
weighted avg     0.9816    0.9857    0.9837     34732

2022-10-04 14:44:29,670 ----------------------------------------------------------------------------------------------------