def text2real_txt_iterator(source_txt_path, target_txt_path):
  """Yield dicts for Text2RealProblem.generate_samples from lines of files.

  Args:
    source_txt_path: txt file with record per line.
    target_txt_path: txt file with float (or space-separated float list for
      multitask) per line.
  Yields:
    {"inputs": inputs, "targets": targets}
  """
  for inputs, targets in zip(
      txt_line_iterator(source_txt_path), txt_line_iterator(target_txt_path)):
    targets = [float(x) for x in targets.split(" ")]
    yield {"inputs": inputs, "targets": targets}
Yield dicts for Text2RealProblem.generate_samples from lines of files.

  Args:
    source_txt_path: txt file with record per line.
    target_txt_path: txt file with float (or space-separated float list for
      multitask) per line.
  Yields:
    {"inputs": inputs, "targets": targets}
  
tensor2tensor/data_generators/text_problems.py