class_docstr: Dataset class for classifiers from Transformers Integration.
      
class_docstr_tok: ["Dataset","class","for","classifiers","from","Transformers","Integration","."]
docstr: Parameters
  ----------
  data : list of 3-tuples (text data [Tensor], mask [Tensor], labels [int or list of int])
      The single items constituting the dataset. For single-label datasets, unlabeled
      instances the label should be set to small_text.base.LABEL_UNLABELED`,
      and for multi-label datasets to an empty list.
  multi_label : bool, default=False
      Indicates if this is a multi-label dataset.
  target_labels : numpy.ndarray[int] or None, default=None
      This is a list of (integer) labels to be encountered within this dataset.
      This is important to set if your data does not contain some labels,
      e.g. due to dataset splits, where the labels should however be considered by
      entities such as the classifier. If `None`, the target labels will be inferred
      from the labels encountered in `self.data`.
docstr_tok: ["Parameters","--","--","--","--","--","data",":","list","of","3-tuples","(","text","data","[","Tensor","]",",","mask","[","Tensor","]",",","labels","[","int","or","list","of","int","]",")","The","single","items","constituting","the","dataset",".","For","single-label","datasets",",","unlabeled","instances","the","label","should","be","set","to","small_text.base.LABEL_UNLABELED","`",",","and","for","multi-label","datasets","to","an","empty","list",".","multi_label",":","bool",",","default=False","Indicates","if","this","is","a","multi-label","dataset",".","target_labels",":","numpy.ndarray","[","int","]","or","None",",","default=None","This","is","a","list","of","(","integer",")","labels","to","be","encountered","within","this","dataset",".","This","is","important","to","set","if","your","data","does","not","contain","some","labels",",","e.g",".","due","to","dataset","splits",",","where","the","labels","should","however","be","considered","by","entities","such","as","the","classifier",".","If","`","None","`",",","the","target","labels","will","be","inferred","from","the","labels","encountered","in","`","self.data","`","."]
code: def __init__(self, data, multi_label=False, target_labels=None):
      """
      Parameters
      ----------
      data : list of 3-tuples (text data [Tensor], mask [Tensor], labels [int or list of int])
          The single items constituting the dataset. For single-label datasets, unlabeled
          instances the label should be set to small_text.base.LABEL_UNLABELED`,
          and for multi-label datasets to an empty list.
      multi_label : bool, default=False
          Indicates if this is a multi-label dataset.
      target_labels : numpy.ndarray[int] or None, default=None
          This is a list of (integer) labels to be encountered within this dataset.
          This is important to set if your data does not contain some labels,
          e.g. due to dataset splits, where the labels should however be considered by
          entities such as the classifier. If `None`, the target labels will be inferred
          from the labels encountered in `self.data`.
      """
      check_target_labels(target_labels)
  
      self._data = data
      self.multi_label = multi_label
  
      if target_labels is not None:
          self.track_target_labels = False
          self._target_labels = np.array(target_labels)
      else:
          self.track_target_labels = True
          self._infer_target_labels()
  
imports: import numpy
  from scipy.sparse import csr_matrix
  from small_text.base import LABEL_UNLABELED
  from small_text.data.datasets import check_size, check_target_labels, get_updated_target_labels
  from small_text.integrations.pytorch.exceptions import PytorchNotFoundError
  from small_text.utils.annotations import experimental
  from small_text.utils.labels import csr_to_list, get_num_labels, list_to_csr
label_desc: Use image node_id 1 to create a new TransformersDataset object from inherited base classes: PytorchDataset with example: obj = TransformersDataset(data, multi_label, target_labels)