def write_to_files_np(features, tokenizer, max_seq_length,<EOL>max_predictions_per_seq, output_files):<EOL>
next_sentence_labels = []<EOL>valid_lengths = []<EOL>assert len(output_files) == <NUM_LIT:1>, '<STR_LIT>'<EOL>output_file = output_files[<NUM_LIT:0>]<EOL>(input_ids, segment_ids, masked_lm_positions, masked_lm_ids,<EOL>masked_lm_weights, next_sentence_labels, valid_lengths) = features<EOL>total_written = len(next_sentence_labels)<EOL>outputs = collections.OrderedDict()<EOL>outputs['<STR_LIT>'] = np.array(input_ids, dtype=object)<EOL>outputs['<STR_LIT>'] = np.array(segment_ids, dtype=object)<EOL>outputs['<STR_LIT>'] = np.array(masked_lm_positions, dtype=object)<EOL>outputs['<STR_LIT>'] = np.array(masked_lm_ids, dtype=object)<EOL>outputs['<STR_LIT>'] = np.array(masked_lm_weights, dtype=object)<EOL>outputs['<STR_LIT>'] = np.array(next_sentence_labels, dtype='<STR_LIT>')<EOL>outputs['<STR_LIT>'] = np.array(valid_lengths, dtype='<STR_LIT>')<EOL>np.savez_compressed(output_file, **outputs)<EOL>logging.info('<STR_LIT>', total_written)<EOL>
Write to numpy files from `TrainingInstance`s.