def text2text_txt_iterator_with_label(source_txt_path, target_txt_path):
  """Yield dicts for Text2TextProblem.generate_samples from lines of files."""
  for inputs, (targets, extra_label) in zip(
      txt_line_iterator(source_txt_path),
      txt_and_label_iterator(target_txt_path)):
    yield {"inputs": inputs, "targets": targets, "extra_label": [extra_label]}
Yield dicts for Text2TextProblem.generate_samples from lines of files.
tensor2tensor/data_generators/text_problems.py