class_docstr: Class that defines data loader
class_docstr_tok: ["Class","that","defines","data","loader"]
docstr: Initialize class
  Args:
      word_dict: PTBDictionary object
      seq_len: int, sequence length of data
      data_dir: str, location of corpus data
      dataset: str, name of corpus
      batch_size: int, batch size
      skip: int, number of words to skip over while generating batches
      split_type: str, train/test/valid
      loop: boolean, whether or not to loop over data when it runs out
docstr_tok: ["Initialize","class","Args",":","word_dict",":","PTBDictionary","object","seq_len",":","int",",","sequence","length","of","data","data_dir",":","str",",","location","of","corpus","data","dataset",":","str",",","name","of","corpus","batch_size",":","int",",","batch","size","skip",":","int",",","number","of","words","to","skip","over","while","generating","batches","split_type",":","str",",","train\/test\/valid","loop",":","boolean",",","whether","or","not","to","loop","over","data","when","it","runs","out"]
code: def __init__(
      self,
      word_dict,
      seq_len=100,
      data_dir=os.path.expanduser("~/data"),
      dataset="WikiText-103",
      batch_size=32,
      skip=30,
      split_type="train",
      loop=True,
  ):
      """
      Initialize class
      Args:
          word_dict: PTBDictionary object
          seq_len: int, sequence length of data
          data_dir: str, location of corpus data
          dataset: str, name of corpus
          batch_size: int, batch size
          skip: int, number of words to skip over while generating batches
          split_type: str, train/test/valid
          loop: boolean, whether or not to loop over data when it runs out
      """
      self.seq_len = seq_len
      self.dataset = dataset
  
      self.loop = loop
      self.skip = skip
  
      self.word2idx = word_dict.word2idx
      self.idx2word = word_dict.idx2word
  
      self.data = self.load_series(
          os.path.join(
              data_dir,
              FILENAME[self.dataset],
              FILES[self.dataset](split_type),
          )
      )
      self.random_index = np.random.permutation(
          np.arange(0, self.data.shape[0] - self.seq_len, self.skip)
      )
      self.n_train = self.random_index.shape[0]
  
      self.batch_size = batch_size
      self.sample_count = 0
  
file_path: nlp-architect/nlp_architect/data/ptb.py
imports: import os
  import sys
  import numpy
  import urllib.request
label_desc: Use image node_id 1 to create a new PTBDataLoader object  with example: obj = PTBDataLoader(word_dict, seq_len, data_dir, dataset, batch_size, skip, split_type, loop)