def text2text_txt_sharded_iterator(source_txt_pattern, target_txt_pattern):
  """Yield dicts for Text2TextProblem.generate_samples from lines of files.

  Args:
    source_txt_pattern: path to the sharded source file
    target_txt_pattern: path to the sharded target file

  Yields:
    {"inputs": inputs, "targets": targets}

  """
  for inputs, targets in zip(
      txt_line_sharded_iterator(source_txt_pattern),
      txt_line_sharded_iterator(target_txt_pattern)):
    yield {"inputs": inputs, "targets": targets}
Yield dicts for Text2TextProblem.generate_samples from lines of files.

  Args:
    source_txt_pattern: path to the sharded source file
    target_txt_pattern: path to the sharded target file

  Yields:
    {"inputs": inputs, "targets": targets}

  
tensor2tensor/data_generators/text_problems.py