class_docstr: IMDB sentiment classification.
code: def doc_generator(self, imdb_dir, dataset, include_label=False):
      dirs = [
          (os.path.join(imdb_dir, dataset, "pos"), True),
          (os.path.join(imdb_dir, dataset, "neg"), False),
      ]
  
      for d, label in dirs:
          for filename in os.listdir(d):
              with tf.gfile.Open(os.path.join(d, filename)) as imdb_f:
                  doc = imdb_f.read().strip()
                  if include_label:
                      yield doc, label
                  else:
                      yield doc
  
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 6 for calling the SentimentIMDB obj's underlying member method code with example usage: obj.doc_generator(imdb_dir, dataset, include_label) without return types