class_docstr: IMDB movie reviews dataset.
docstr: Generate aclImdb examples.
docstr_tok: ["Generate","aclImdb","examples","."]
code: def _generate_examples(self, files, split, labeled=True):
      """Generate aclImdb examples."""
      # For labeled examples, extract the label from the path.
      if labeled:
          label_mapping = {"pos": 1, "neg": 0}
          for path, f in files:
              if path.startswith(f"aclImdb/{split}"):
                  label = label_mapping.get(path.split("/")[2])
                  if label is not None:
                      yield path, {
                          "text": f.read().decode("utf-8"),
                          "label": label,
                      }
      else:
          for path, f in files:
              if path.startswith(f"aclImdb/{split}"):
                  if path.split("/")[2] == "unsup":
                      yield path, {
                          "text": f.read().decode("utf-8"),
                          "label": -1,
                      }
  
file_path: fastNLP/tests/core/controllers/imdb.py
imports: import datasets
  from datasets.tasks import TextClassification
label_desc: Use image node_id 3 for calling the Imdb obj's underlying member method code with example usage: obj._generate_examples(files, split, labeled) without return types