Skip to content

Commit

Permalink
fix creating object of data
Browse files Browse the repository at this point in the history
  • Loading branch information
king-menin committed Feb 13, 2019
1 parent 8052aea commit fae5047
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions modules/data/bert_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,11 @@ def create(cls,
valid_dl = DataLoaderForTrain(
valid_f, batch_size=batch_size, cuda=use_cuda, shuffle=False)

idx2label = sorted(label2idx, key=lambda x: label2idx[x])
if meta2idx:
idx2meta = sorted(idx2meta, key=lambda x: idx2meta[x])
if cls2idx:
idx2cls = sorted(idx2cls, key=lambda x: idx2cls[x])
data = cls(bert_vocab_file, idx2label, config_path, train_path, valid_path,
train_dl, valid_dl, tokenizer,
bert_model_type, idx2cls, idx2meta, max_seq_len,
Expand Down

0 comments on commit fae5047

Please sign in to comment.