docstr: Create an IMDB dataset instance given a path and fields.
  
  Args:
      path: Path to the dataset's highest level directory
      text_field: The field that will be used for text data.
      label_field: The field that will be used for label data.
      Remaining keyword arguments: Passed to the constructor of
          data.Dataset.
code: def __init__(self, path, text_field, label_field, **kwargs):
      """Create an IMDB dataset instance given a path and fields.
  
      Args:
          path: Path to the dataset's highest level directory
          text_field: The field that will be used for text data.
          label_field: The field that will be used for label data.
          Remaining keyword arguments: Passed to the constructor of
              data.Dataset.
      """
      fields = [("text", text_field), ("label", label_field)]
      examples = []
  
      for label in ["pos", "neg"]:
          for fname in glob.iglob(os.path.join(path, label, "*.txt")):
              with io.open(fname, "r", encoding="utf-8") as f:
                  text = f.readline()
              examples.append(
                  data.Example.fromlist([text, label], fields)
              )
  
      super(IMDB, self).__init__(examples, fields, **kwargs)
  
file_path: pytext/pytext/legacy/datasets/imdb.py
imports: import glob
  import io
  import os
  from ..None import data
label_desc: Use image node_id 2 to create a new IMDB object from inherited base classes: data with example: obj = IMDB(path, text_field, label_field)