class_docstr: Stanford Sentiment Treebank dataset.
  
  Each sample is the constituency tree of a sentence. The leaf nodes
  represent words. The word is a int value stored in the ``x`` feature field.
  The non-leaf node has a special value ``PAD_WORD`` in the ``x`` field.
  Each node also has a sentiment annotation: 5 classes (very negative,
  negative, neutral, positive and very positive). The sentiment label is a
  int value stored in the ``y`` feature field.
  Official site: `<http://nlp.stanford.edu/sentiment/index.html>`_
  
  Statistics:
  
  - Train examples: 8,544
  - Dev examples: 1,101
  - Test examples: 2,210
  - Number of classes for each node: 5
  
  Parameters
  ----------
  mode : str, optional
      Should be one of ['train', 'dev', 'test', 'tiny']
      Default: train
  glove_embed_file : str, optional
      The path to pretrained glove embedding file.
      Default: None
  vocab_file : str, optional
      Optional vocabulary file. If not given, the default vacabulary file is used.
      Default: None
  raw_dir : str
      Raw file directory to download/contains the input data directory.
      Default: ~/.dgl/
  force_reload : bool
      Whether to reload the dataset. Default: False
  verbose : bool
      Whether to print out progress information. Default: True.
  transform : callable, optional
      A transform that takes in a :class:`~dgl.DGLGraph` object and returns
      a transformed version. The :class:`~dgl.DGLGraph` object will be
      transformed before every access.
  
  Attributes
  ----------
  vocab : OrderedDict
      Vocabulary of the dataset
  num_classes : int
      Number of classes for each node
  pretrained_emb: Tensor
      Pretrained glove embedding with respect the vocabulary.
  vocab_size : int
      The size of the vocabulary
  
  Notes
  -----
  All the samples will be loaded and preprocessed in the memory first.
  
  Examples
  --------
  >>> # get dataset
  >>> train_data = SSTDataset()
  >>> dev_data = SSTDataset(mode='dev')
  >>> test_data = SSTDataset(mode='test')
  >>> tiny_data = SSTDataset(mode='tiny')
  >>>
  >>> len(train_data)
  8544
  >>> train_data.num_classes
  5
  >>> glove_embed = train_data.pretrained_emb
  >>> train_data.vocab_size
  19536
  >>> train_data[0]
  Graph(num_nodes=71, num_edges=70,
    ndata_schemes={'x': Scheme(shape=(), dtype=torch.int64), 'y': Scheme(shape=(), dtype=torch.int64), 'mask': Scheme(shape=(), dtype=torch.int64)}
    edata_schemes={})
  >>> for tree in train_data:
  ...     input_ids = tree.ndata['x']
  ...     labels = tree.ndata['y']
  ...     mask = tree.ndata['mask']
  ...     # your code here
code: def process(self):
      from nltk.corpus.reader import BracketParseCorpusReader
  
      # load vocab file
      self._vocab = OrderedDict()
      vocab_file = (
          self._vocab_file
          if self._vocab_file is not None
          else os.path.join(self.raw_path, "vocab.txt")
      )
      with open(vocab_file, encoding="utf-8") as vf:
          for line in vf.readlines():
              line = line.strip()
              self._vocab[line] = len(self._vocab)
  
      # filter glove
      if self._glove_embed_file is not None and os.path.exists(
          self._glove_embed_file
      ):
          glove_emb = {}
          with open(
              self._glove_embed_file, "r", encoding="utf-8"
          ) as pf:
              for line in pf.readlines():
                  sp = line.split(" ")
                  if sp[0].lower() in self._vocab:
                      glove_emb[sp[0].lower()] = np.asarray(
                          [float(x) for x in sp[1:]]
                      )
      files = ["{}.txt".format(self.mode)]
      corpus = BracketParseCorpusReader(self.raw_path, files)
      sents = corpus.parsed_sents(files[0])
  
      # initialize with glove
      pretrained_emb = []
      fail_cnt = 0
      for line in self._vocab.keys():
          if self._glove_embed_file is not None and os.path.exists(
              self._glove_embed_file
          ):
              if not line.lower() in glove_emb:
                  fail_cnt += 1
              pretrained_emb.append(
                  glove_emb.get(
                      line.lower(), np.random.uniform(-0.05, 0.05, 300)
                  )
              )
  
      self._pretrained_emb = None
      if self._glove_embed_file is not None and os.path.exists(
          self._glove_embed_file
      ):
          self._pretrained_emb = F.tensor(np.stack(pretrained_emb, 0))
          print(
              "Miss word in GloVe {0:.4f}".format(
                  1.0 * fail_cnt / len(self._pretrained_emb)
              )
          )
      # build trees
      self._trees = []
      for sent in sents:
          self._trees.append(self._build_tree(sent))
  
imports: from __future__ import absolute_import
  import os
  from collections import OrderedDict
  import networkx
  import numpy
  from ..None import backend
  from ..convert import from_networkx
  from .dgl_dataset import DGLBuiltinDataset
  from .utils import _get_dgl_url, deprecate_property, load_graphs, load_info, save_graphs, save_info
label_desc: Use image node_id 2 for calling the SSTDataset obj's underlying member method code with example usage: obj.process() without return types