class_docstr: Defines an abstract text classification datasets.
  Currently, we only support the following datasets:
  
        - AG_NEWS
        - SogouNews
        - DBpedia
        - YelpReviewPolarity
        - YelpReviewFull
        - YahooAnswers
        - AmazonReviewPolarity
        - AmazonReviewFull
class_docstr_tok: ["Defines","an","abstract","text","classification","datasets",".","Currently",",","we","only","support","the","following","datasets",":","-","AG_NEWS","-","SogouNews","-","DBpedia","-","YelpReviewPolarity","-","YelpReviewFull","-","YahooAnswers","-","AmazonReviewPolarity","-","AmazonReviewFull"]
docstr: Initiate text-classification dataset.
  
  Args:
      vocab: Vocabulary object used for dataset.
      data: a list of label/tokens tuple. tokens are a tensor after
          numericalizing the string tokens. label is an integer.
          [(label1, tokens1), (label2, tokens2), (label2, tokens3)]
      label: a set of the labels.
          {label1, label2}
  
  Examples:
      See the examples in examples/text_classification/
docstr_tok: ["Initiate","text-classification","dataset",".","Args",":","vocab",":","Vocabulary","object","used","for","dataset",".","data",":","a","list","of","label\/tokens","tuple",".","tokens","are","a","tensor","after","numericalizing","the","string","tokens",".","label","is","an","integer",".","[","(","label1",",","tokens1",")",",","(","label2",",","tokens2",")",",","(","label2",",","tokens3",")","]","label",":","a","set","of","the","labels",".","{","label1",",","label2","}","Examples",":","See","the","examples","in","examples\/text_classification\/"]
code: def __init__(self, vocab, data, labels):
      """Initiate text-classification dataset.
  
      Args:
          vocab: Vocabulary object used for dataset.
          data: a list of label/tokens tuple. tokens are a tensor after
              numericalizing the string tokens. label is an integer.
              [(label1, tokens1), (label2, tokens2), (label2, tokens3)]
          label: a set of the labels.
              {label1, label2}
  
      Examples:
          See the examples in examples/text_classification/
  
      """
  
      super(TextClassificationDataset, self).__init__()
      self._data = data
      self._labels = labels
      self._vocab = vocab
  
imports: import csv
  import io
  import logging
  import torch
  from torchtext.data.utils import get_tokenizer, ngrams_iterator
  from torchtext.utils import download_from_url, extract_archive
  from tqdm import tqdm
  from ..vocab import build_vocab_from_iterator, Vocab
label_desc: Use image node_id 1 to create a new TextClassificationDataset object from inherited base classes: torch.utils.data with example: obj = TextClassificationDataset(vocab, data, labels)