class_docstr: Dataset class for classifiers from Transformers Integration.
      
class_docstr_tok: ["Dataset","class","for","classifiers","from","Transformers","Integration","."]
code: def target_labels(self, target_labels):
      encountered_labels = np.unique(self._get_flattened_labels())
      if np.setdiff1d(encountered_labels, target_labels).shape[0] > 0:
          raise ValueError(
              "Cannot remove existing labels from target_labels as long as they "
              "still exists in the data. Create a new dataset instead."
          )
      self._target_labels = 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 11 for calling the TransformersDataset obj's underlying member method code with example usage: obj.target_labels(target_labels) without return types