class_docstr: The dataset class which is fit for all datatset of text classification.
class_docstr_tok: ["The","dataset","class","which","is","fit","for","all","datatset","of","text","classification","."]
code: def __getitem__(self, idx):
      record = self.records[idx]
      if isinstance(self.tokenizer, PretrainedTokenizer):
          input_ids = np.array(record["input_ids"])
          if Version(paddlenlp.__version__) >= Version("2.0.0rc5"):
              token_type_ids = np.array(record["token_type_ids"])
          else:
              token_type_ids = np.array(record["segment_ids"])
  
          if "label" in record.keys():
              return (
                  input_ids,
                  token_type_ids,
                  np.array(record["label"], dtype=np.int64),
              )
          else:
              return input_ids, token_type_ids
  
      elif isinstance(self.tokenizer, JiebaTokenizer):
          if "label" in record.keys():
              return np.array(record["text"]), np.array(
                  record["label"], dtype=np.int64
              )
          else:
              return np.array(record["text"])
      else:
          raise RuntimeError(
              "Unknown type of self.tokenizer: {}, it must be an instance of  PretrainedTokenizer or JiebaTokenizer".format(
                  type(self.tokenizer)
              )
          )
  
imports: import csv
  import io
  import os
  from typing import Dict, List, Optional, Union, Tuple
  import numpy
  import paddle
  import paddlenlp
  from packaging.version import Version
  from paddlehub.env import DATA_HOME
  from paddlenlp.transformers import PretrainedTokenizer
  from paddlenlp.data import JiebaTokenizer
  from paddlehub.utils.log import logger
  from paddlehub.utils.utils import download, reseg_token_label, pad_sequence, trunc_sequence
  from paddlehub.utils.xarfile import is_xarfile, unarchive
label_desc: Use image node_id 4 for calling the TextClassificationDataset obj's underlying member method code with example usage: obj.__getitem__(idx) and returns: input_ids,  token_type_ids,  np, input_ids,  token_type_ids, np,  np, np