in code/source/bert_preprocessing.py [0:0]
def convert_examples_to_features(tokenizer, examples, tag2int, max_seq_length=256):
"""
Convert a set of `InputExample`s to a list of `InputFeatures`.
:return: numpy arrays
"""
input_ids, input_masks, segment_ids, labels = [], [], [], []
for example in examples:
input_id, input_mask, segment_id, label = convert_single_example(
tokenizer, example, tag2int, max_seq_length
)
input_ids.append(input_id)
input_masks.append(input_mask)
segment_ids.append(segment_id)
labels.append(label)
return (
np.array(input_ids),
np.array(input_masks),
np.array(segment_ids),
np.array(labels),
)