class_docstr: En-Fr translation with added French data, back-translated.
class_docstr_tok: ["En-Fr","translation","with","added","French","data",",","back-translated","."]
code: def generate_samples(self, data_dir, tmp_dir, dataset_split):
      datasets = self.source_data_files(dataset_split)
      tag = (
          "train"
          if dataset_split == problem.DatasetSplit.TRAIN
          else "dev"
      )
      data_path = translate.compile_data(
          tmp_dir, datasets, "%s-compiled-%s" % (self.name, tag)
      )
      # For eval, use authentic data.
      if dataset_split != problem.DatasetSplit.TRAIN:
          for example in text_problems.text2text_txt_iterator(
              data_path + ".lang1", data_path + ".lang2"
          ):
              yield example
      else:  # For training, mix synthetic and authentic data as follows.
          for file1, file2 in self.backtranslate_data_filenames:
              path1 = os.path.join(tmp_dir, file1)
              path2 = os.path.join(tmp_dir, file2)
              # Synthetic data first.
              for example in text_problems.text2text_txt_iterator(
                  path1, path2
              ):
                  yield example
              # Now authentic data.
              for example in text_problems.text2text_txt_iterator(
                  data_path + ".lang1", data_path + ".lang2"
              ):
                  yield example
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  from tensor2tensor.data_generators import problem
  from tensor2tensor.data_generators import text_encoder
  from tensor2tensor.data_generators import text_problems
  from tensor2tensor.data_generators import translate
  from tensor2tensor.data_generators import wiki_lm
  from tensor2tensor.utils import registry
label_desc: Use image node_id 6 for calling the TranslateEnfrWmt32kWithBacktranslateFr obj's underlying member method code with example usage: obj.generate_samples(data_dir, tmp_dir, dataset_split) without return types