class_docstr: The implement of DialogReader.
code: def __init__(self, args):
      tokenizer_cls = getattr(tokenization, args.tokenizer)
      self.tokenizer = tokenizer_cls(args)
      self.vocab = self.tokenizer.vocab
      self.pad_id = args.pad_id = self.vocab["[PAD]"]
      self.bos_id = args.bos_id = self.vocab["[CLS]"]
      self.eos_id = args.eos_id = self.vocab["[SEP]"]
      self.unk_id = args.unk_id = self.vocab["[UNK]"]
      self.mask_id = args.mask_id = self.vocab["[MASK]"]
      self.vocab_size = args.get("vocab_size", 0)
      self.max_src_len = args.max_src_len
      self.max_tgt_len = args.max_tgt_len
      self.truncate_first_turn = args.truncate_first_turn
      self.file_format = args.file_format
      self.data_format = args.data_format
      self.in_tokens = args.in_tokens
      self.batch_size = args.batch_size
      self.continuous_position = args.continuous_position
      self.sort_pool_size = args.sort_pool_size
  
      # random_seed must be set for data slicing when using multi-gpu
      self.global_rng = np.random.RandomState(args.random_seed)
  
      # training progress
      self.current_example = 0
      self.current_epoch = 0
      self.num_examples = 0
  
      # model related
  
      self.fields = ["token_ids", "type_ids", "pos_ids"]
      self.num_numerical_fields = len(self.fields)
      self.fields += ["tgt_start_idx", "data_id"]
      self.sort_key = lambda record: [len(record.token_ids)]
  
      self.Record = namedtuple(
          "Record", self.fields, defaults=(None,) * len(self.fields)
      )
  
      self.features = {}
      return
  
imports: import csv
  from collections import namedtuple
  from contextlib import contextmanager
  import gzip
  import numpy
  from ..utils import pad_batch_data
  from ..utils.args import str2bool
  from ..utils.masking import mask
  from ..utils import tokenization
label_desc: Use image node_id 2 to create a new DialogReader object from inherited base classes: object with example: obj = DialogReader(args)