class_docstr: Yelp dataset.
docstr: Generate examples.
docstr_tok: ["Generate","examples","."]
code: def generate_samples(self, data_dir, tmp_dir, dataset_split):
      """Generate examples."""
      # Download and extract
      compressed_filename = os.path.basename(self.URL)
      download_path = generator_utils.maybe_download(
          tmp_dir, compressed_filename, self.URL
      )
      yelp_dir = os.path.join(tmp_dir, "yelp_review_full_csv")
      if not tf.gfile.Exists(yelp_dir):
          with tarfile.open(download_path, "r:gz") as tar:
              tar.extractall(tmp_dir)
  
      # Generate examples
      train = dataset_split == problem.DatasetSplit.TRAIN
      dataset = "train" if train else "test"
      for doc, label in self.doc_generator(
          yelp_dir, dataset, include_label=True
      ):
          yield {
              "inputs": doc,
              "label": int(label),
          }
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  import tarfile
  from tensor2tensor.data_generators import generator_utils
  from tensor2tensor.data_generators import problem
  from tensor2tensor.data_generators import text_problems
  from tensor2tensor.utils import registry
  import tensorflow.compat.v1
label_desc: Use image node_id 7 for calling the SentimentYelpFull obj's underlying member method code with example usage: obj.generate_samples(data_dir, tmp_dir, dataset_split) without return types