code: def __init__(
      self,
      doc,
      batch_size,
      args,
      pretrain=None,
      vocab=None,
      evaluation=False,
      preprocess_tags=True,
      bert_tokenizer=None,
      scheme=None,
  ):
      self.batch_size = batch_size
      self.args = args
      self.eval = evaluation
      self.shuffled = not self.eval
      self.doc = doc
      self.preprocess_tags = preprocess_tags
  
      data = self._load_doc(self.doc, scheme)
  
      # filter out the long sentences if bert is used
      if self.args.get("bert_model", False):
          data = filter_data(
              self.args["bert_model"], data, bert_tokenizer
          )
  
      self.tags = [[w[1] for w in sent] for sent in data]
      # handle vocab
      self.pretrain = pretrain
      if vocab is None:
          self.vocab = self.init_vocab(data)
      else:
          self.vocab = vocab
  
      # filter and sample data
      if args.get("sample_train", 1.0) < 1.0 and not self.eval:
          keep = int(args["sample_train"] * len(data))
          data = random.sample(data, keep)
          logger.debug(
              "Subsample training set with rate {:g}".format(
                  args["sample_train"]
              )
          )
  
      data = self.preprocess(data, self.vocab, args)
      # shuffle for training
      if self.shuffled:
          random.shuffle(data)
      self.num_examples = len(data)
  
      # chunk into batches
      self.data = self.chunk_batches(data)
      logger.debug("{} batches created.".format(len(self.data)))
  
imports: import random
  import logging
  import torch
  from stanza.models.common.bert_embedding import filter_data
  from stanza.models.common.data import map_to_ids, get_long_tensor, sort_all
  from stanza.models.common.vocab import PAD_ID, VOCAB_PREFIX
  from stanza.models.pos.vocab import CharVocab, CompositeVocab, WordVocab
  from stanza.models.ner.vocab import MultiVocab
  from stanza.models.common.doc import *
  from stanza.models.ner.utils import process_tags, normalize_empty_tags
label_desc: Use image node_id 1 to create a new DataLoader object  with example: obj = DataLoader(doc, batch_size, args, pretrain, vocab, evaluation, preprocess_tags, bert_tokenizer, scheme)