code: def _generate_examples(self, archive, directory):
      
      reg = re.compile(os.path.join("^%s" % directory, "(?P<label>neg|pos)", ""))
      for path, imdb_f in archive:
        res = reg.match(path)
        if not res:
          continue
        text = imdb_f.read().strip()
        yield {
            "text": text,
            "label": res.groupdict()["label"],
        }
docs: Generate IMDB examples.