class_docstr: Ags:
      base_path (:obj:`str`): The directory to the whole dataset.
      tokenizer (:obj:`PretrainedTokenizer` or :obj:`JiebaTokenizer`):
          It tokenizes the text and encodes the data as model needed.
      max_seq_len (:obj:`int`, `optional`, defaults to :128):
          If set to a number, will limit the total sequence returned so that it has a maximum length.
      mode (:obj:`str`, `optional`, defaults to `train`):
          It identifies the dataset mode (train, test or dev).
      data_file(:obj:`str`, `optional`, defaults to :obj:`None`):
          The data file name, which is relative to the base_path.
      label_file(:obj:`str`, `optional`, defaults to :obj:`None`):
          The label file name, which is relative to the base_path.
          It is all labels of the dataset, one line one label.
      label_list(:obj:`List[str]`, `optional`, defaults to :obj:`None`):
          The list of all labels of the dataset
      split_char(:obj:`str`, `optional`, defaults to :obj:``):
          The symbol used to split chars in text and labels
      no_entity_label(:obj:`str`, `optional`, defaults to :obj:`O`):
          The label used to mark no entities
      ignore_label(:obj:`int`, `optional`, defaults to :-100):
          If one token's label == ignore_label, it will be ignored when
          calculating loss
      is_file_with_header(:obj:bool, `optional`, default to :obj: False) :
          Whether or not the file is with the header introduction.
class_docstr_tok: ["Ags",":","base_path","(",":","obj",":","`","str","`",")",":","The","directory","to","the","whole","dataset",".","tokenizer","(",":","obj",":","`","PretrainedTokenizer","`","or",":","obj",":","`","JiebaTokenizer","`",")",":","It","tokenizes","the","text","and","encodes","the","data","as","model","needed",".","max_seq_len","(",":","obj",":","`","int","`",",","`","optional","`",",","defaults","to",":128",")",":","If","set","to","a","number",",","will","limit","the","total","sequence","returned","so","that","it","has","a","maximum","length",".","mode","(",":","obj",":","`","str","`",",","`","optional","`",",","defaults","to","`","train","`",")",":","It","identifies","the","dataset","mode","(","train",",","test","or","dev",")",".","data_file","(",":","obj",":","`","str","`",",","`","optional","`",",","defaults","to",":","obj",":","`","None","`",")",":","The","data","file","name",",","which","is","relative","to","the","base_path",".","label_file","(",":","obj",":","`","str","`",",","`","optional","`",",","defaults","to",":","obj",":","`","None","`",")",":","The","label","file","name",",","which","is","relative","to","the","base_path",".","It","is","all","labels","of","the","dataset",",","one","line","one","label",".","label_list","(",":","obj",":","`","List","[","str","]","`",",","`","optional","`",",","defaults","to",":","obj",":","`","None","`",")",":","The","list","of","all","labels","of","the","dataset","split_char","(",":","obj",":","`","str","`",",","`","optional","`",",","defaults","to",":","obj",":","`","\u0002","`",")",":","The","symbol","used","to","split","chars","in","text","and","labels","no_entity_label","(",":","obj",":","`","str","`",",","`","optional","`",",","defaults","to",":","obj",":","`","O","`",")",":","The","label","used","to","mark","no","entities","ignore_label","(",":","obj",":","`","int","`",",","`","optional","`",",","defaults","to",":","-100",")",":","If","one","token","'s","label","==","ignore_label",",","it","will","be","ignored","when","calculating","loss","is_file_with_header","(",":","obj",":","bool",",","`","optional","`",",","default","to",":","obj",":","False",")",":","Whether","or","not","the","file","is","with","the","header","introduction","."]
code: def __getitem__(self, idx):
      record = self.records[idx]
      if isinstance(self.tokenizer, PretrainedTokenizer):
          input_ids = np.array(record["input_ids"])
          seq_lens = np.array(record["seq_len"])
          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,
                  seq_lens,
                  np.array(record["label"], dtype=np.int64),
              )
          else:
              return input_ids, token_type_ids, seq_lens
  
      elif isinstance(self.tokenizer, JiebaTokenizer):
          if "label" in record.keys():
              return (
                  np.array(record["text"]),
                  np.array(record["seq_len"]),
                  np.array(record["label"], dtype=np.int64),
              )
          else:
              return np.array(record["text"]), np.array(
                  record["seq_len"]
              )
      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 SeqLabelingDataset obj's underlying member method code with example usage: obj.__getitem__(idx) and returns: input_ids,  token_type_ids,  seq_lens,  np, input_ids,  token_type_ids,  seq_lens, np,  np,  np, np,  np