def text2text_txt_iterator(source_txt_path, target_txt_path, auxiliary_tags):
  """Yield dicts for TranslateMultilingual.generate_samples from files."""
  for sources, targets in zip(
      txt_line_lang_iterator(source_txt_path),
      txt_line_lang_iterator(target_txt_path)):
    yield {
        "all_tags": auxiliary_tags,
        "inputs": sources[0],
        "input_tags": sources[1],
        "targets": targets[0],
        "target_tags": targets[1],
    }
Yield dicts for TranslateMultilingual.generate_samples from files.
language/labs/consistent_zero_shot_nmt/data_generators/translate_multilingual.py