@@ -155,7 +155,8 @@ def _train(self, loader):
155
155
156
156
bar , metric = progress_bar (loader ), AttachmentMetric ()
157
157
158
- for i , (words , texts , * feats , arcs , rels ) in enumerate (bar , 1 ):
158
+ for i , batch in enumerate (bar , 1 ):
159
+ words , texts , * feats , arcs , rels = batch
159
160
word_mask = words .ne (self .args .pad_index )
160
161
mask = word_mask if len (words .shape ) < 3 else word_mask .any (- 1 )
161
162
# ignore the first token of each sentence
@@ -186,7 +187,8 @@ def _evaluate(self, loader):
186
187
187
188
total_loss , metric = 0 , AttachmentMetric ()
188
189
189
- for words , texts , * feats , arcs , rels in loader :
190
+ for batch in loader :
191
+ words , texts , * feats , arcs , rels = batch
190
192
word_mask = words .ne (self .args .pad_index )
191
193
mask = word_mask if len (words .shape ) < 3 else word_mask .any (- 1 )
192
194
# ignore the first token of each sentence
@@ -210,7 +212,8 @@ def _predict(self, loader):
210
212
self .model .eval ()
211
213
212
214
preds = {'arcs' : [], 'rels' : [], 'probs' : [] if self .args .prob else None }
213
- for words , texts , * feats in progress_bar (loader ):
215
+ for batch in progress_bar (loader ):
216
+ words , texts , * feats = batch
214
217
word_mask = words .ne (self .args .pad_index )
215
218
mask = word_mask if len (words .shape ) < 3 else word_mask .any (- 1 )
216
219
# ignore the first token of each sentence
@@ -465,7 +468,8 @@ def _train(self, loader):
465
468
466
469
bar , metric = progress_bar (loader ), AttachmentMetric ()
467
470
468
- for i , (words , texts , * feats , arcs , rels ) in enumerate (bar , 1 ):
471
+ for i , batch in enumerate (bar , 1 ):
472
+ words , texts , * feats , arcs , rels = batch
469
473
word_mask = words .ne (self .args .pad_index )
470
474
mask = word_mask if len (words .shape ) < 3 else word_mask .any (- 1 )
471
475
# ignore the first token of each sentence
@@ -496,7 +500,8 @@ def _evaluate(self, loader):
496
500
497
501
total_loss , metric = 0 , AttachmentMetric ()
498
502
499
- for words , texts , * feats , arcs , rels in loader :
503
+ for batch in loader :
504
+ words , texts , * feats , arcs , rels = batch
500
505
word_mask = words .ne (self .args .pad_index )
501
506
mask = word_mask if len (words .shape ) < 3 else word_mask .any (- 1 )
502
507
# ignore the first token of each sentence
@@ -520,7 +525,8 @@ def _predict(self, loader):
520
525
self .model .eval ()
521
526
522
527
preds = {'arcs' : [], 'rels' : [], 'probs' : [] if self .args .prob else None }
523
- for words , texts , * feats in progress_bar (loader ):
528
+ for batch in progress_bar (loader ):
529
+ words , texts , * feats = batch
524
530
word_mask = words .ne (self .args .pad_index )
525
531
mask = word_mask if len (words .shape ) < 3 else word_mask .any (- 1 )
526
532
# ignore the first token of each sentence
@@ -681,7 +687,8 @@ def _train(self, loader):
681
687
682
688
bar , metric = progress_bar (loader ), AttachmentMetric ()
683
689
684
- for i , (words , texts , * feats , arcs , sibs , rels ) in enumerate (bar , 1 ):
690
+ for i , batch in enumerate (bar , 1 ):
691
+ words , texts , * feats , arcs , sibs , rels = batch
685
692
word_mask = words .ne (self .args .pad_index )
686
693
mask = word_mask if len (words .shape ) < 3 else word_mask .any (- 1 )
687
694
# ignore the first token of each sentence
@@ -712,7 +719,8 @@ def _evaluate(self, loader):
712
719
713
720
total_loss , metric = 0 , AttachmentMetric ()
714
721
715
- for words , texts , * feats , arcs , sibs , rels in loader :
722
+ for batch in loader :
723
+ words , texts , * feats , arcs , sibs , rels = batch
716
724
word_mask = words .ne (self .args .pad_index )
717
725
mask = word_mask if len (words .shape ) < 3 else word_mask .any (- 1 )
718
726
# ignore the first token of each sentence
@@ -736,7 +744,8 @@ def _predict(self, loader):
736
744
self .model .eval ()
737
745
738
746
preds = {'arcs' : [], 'rels' : [], 'probs' : [] if self .args .prob else None }
739
- for words , texts , * feats in progress_bar (loader ):
747
+ for batch in progress_bar (loader ):
748
+ words , texts , * feats = batch
740
749
word_mask = words .ne (self .args .pad_index )
741
750
mask = word_mask if len (words .shape ) < 3 else word_mask .any (- 1 )
742
751
# ignore the first token of each sentence
@@ -987,7 +996,8 @@ def _train(self, loader):
987
996
988
997
bar , metric = progress_bar (loader ), AttachmentMetric ()
989
998
990
- for i , (words , texts , * feats , arcs , rels ) in enumerate (bar , 1 ):
999
+ for i , batch in enumerate (bar , 1 ):
1000
+ words , texts , * feats , arcs , rels = batch
991
1001
word_mask = words .ne (self .args .pad_index )
992
1002
mask = word_mask if len (words .shape ) < 3 else word_mask .any (- 1 )
993
1003
# ignore the first token of each sentence
@@ -1018,7 +1028,8 @@ def _evaluate(self, loader):
1018
1028
1019
1029
total_loss , metric = 0 , AttachmentMetric ()
1020
1030
1021
- for words , texts , * feats , arcs , rels in loader :
1031
+ for batch in loader :
1032
+ words , texts , * feats , arcs , rels = batch
1022
1033
word_mask = words .ne (self .args .pad_index )
1023
1034
mask = word_mask if len (words .shape ) < 3 else word_mask .any (- 1 )
1024
1035
# ignore the first token of each sentence
@@ -1042,7 +1053,8 @@ def _predict(self, loader):
1042
1053
self .model .eval ()
1043
1054
1044
1055
preds = {'arcs' : [], 'rels' : [], 'probs' : [] if self .args .prob else None }
1045
- for words , texts , * feats in progress_bar (loader ):
1056
+ for batch in progress_bar (loader ):
1057
+ words , texts , * feats = batch
1046
1058
word_mask = words .ne (self .args .pad_index )
1047
1059
mask = word_mask if len (words .shape ) < 3 else word_mask .any (- 1 )
1048
1060
# ignore the first token of each sentence
0 commit comments