Merge pull request #1734 from orena1/patch-1

add progress bar to convert_examples_to_features
This commit is contained in:
Thomas Wolf 2019-11-05 11:34:20 +01:00 committed by GitHub
commit e99071f105
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -23,6 +23,7 @@ import logging
import math
import collections
from io import open
from tqdm import tqdm
from transformers.tokenization_bert import BasicTokenizer, whitespace_tokenize
@ -202,7 +203,7 @@ def convert_examples_to_features(examples, tokenizer, max_seq_length,
# f = np.zeros((max_N, max_M), dtype=np.float32)
features = []
for (example_index, example) in enumerate(examples):
for (example_index, example) in enumerate(tqdm(examples)):
# if example_index % 100 == 0:
# logger.info('Converting %s/%s pos %s neg %s', example_index, len(examples), cnt_pos, cnt_neg)