class_docstr: ```
  Wrapper for Transformer datasets.
  ```
class_docstr_tok: ["``","`","Wrapper","for","Transformer","datasets",".","``","`"]
code: def __init__(self, x, y, batch_size=1, use_token_type_ids=True):
      if type(x) not in [list, np.ndarray]:
          raise ValueError("x must be list or np.ndarray")
      if type(y) not in [list, np.ndarray]:
          raise ValueError("y must be list or np.ndarray")
      if type(x) == list:
          x = np.array(x)
      if type(y) == list:
          y = np.array(y)
      self.x = x
      self.y = y
      self.batch_size = batch_size
      self.use_token_type_ids = use_token_type_ids
  
file_path: ktrain/ktrain/text/dataset.py
imports: from ..dataset import SequenceDataset
  from ..imports import *
label_desc: Use image node_id 1 to create a new TransformerDataset object from inherited base classes: SequenceDataset with example: obj = TransformerDataset(x, y, batch_size, use_token_type_ids)