class_docstr: Lambada as reading comprehension task.
class_docstr_tok: ["Lambada","as","reading","comprehension","task","."]
docstr: Generates samples.
  
  Args:
    data_dir: data directory
    tmp_dir: temp directory
    dataset_split: dataset split
  
  Returns:
    sample generator
code: def generate_samples(self, data_dir, tmp_dir, dataset_split):
      """Generates samples.
  
      Args:
        data_dir: data directory
        tmp_dir: temp directory
        dataset_split: dataset split
  
      Returns:
        sample generator
  
      """
      _prepare_lambada_data(
          tmp_dir, data_dir, self.vocab_size, self.vocab_filename
      )
      files = get_dataset_split(
          tmp_dir, dataset_split, self.use_control_set
      )
  
      def _generate_samples():
          """sample generator.
  
          Yields:
            A dict.
  
          """
          for filepath in files:
              with tf.gfile.GFile(filepath, "r") as f:
                  for line in f:
                      input_target = line.split()
                      yield {
                          "inputs": " ".join(input_target[:-1]),
                          "label": input_target[-1],
                      }
  
      return _generate_samples()
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import csv
  import os
  import tarfile
  from tensor2tensor.data_generators import generator_utils
  from tensor2tensor.data_generators import problem
  from tensor2tensor.data_generators import text_encoder
  from tensor2tensor.data_generators import text_problems
  from tensor2tensor.layers import modalities
  from tensor2tensor.utils import registry
  import tensorflow.compat.v1
label_desc: Use image node_id 8 for calling the LambadaRc obj's underlying member method code with example usage: obj.generate_samples(data_dir, tmp_dir, dataset_split) and returns: _generate_samples