class_docstr: Implementation of the NER vocabulary
  
  Params:
      word_file_path: the path to the pre-trained word embedding model
      save_path: the folder path to save dictionary files
      load_path: the folder path from which the dictionary files are loaded
      char_level: the flag arg indicating the character vocabulary
class_docstr_tok: ["Implementation","of","the","NER","vocabulary","Params",":","word_file_path",":","the","path","to","the","pre-trained","word","embedding","model","save_path",":","the","folder","path","to","save","dictionary","files","load_path",":","the","folder","path","from","which","the","dictionary","files","are","loaded","char_level",":","the","flag","arg","indicating","the","character","vocabulary"]
docstr: Create padded batch of words, tags, chunk pos, even batch of characters
  
  Params:
      tokens: list of raw words, pos, chunk, or tags.
  
  Returns:
      the padded batch
docstr_tok: ["Create","padded","batch","of","words",",","tags",",","chunk","pos",",","even","batch","of","characters","Params",":","tokens",":","list","of","raw","words",",","pos",",","chunk",",","or","tags",".","Returns",":","the","padded","batch"]
code: def pad_batch(self, tokens: List[List[int]]):
      """Create padded batch of words, tags, chunk pos, even batch of characters
  
      Params:
          tokens: list of raw words, pos, chunk, or tags.
  
      Returns:
          the padded batch
      """
  
      batch_size = len(tokens)
  
      if not self.char_level:
          max_len = max([len(seq) for seq in tokens])
          padded_batch = np.full(
              (batch_size, max_len), self._t2i["<PAD>"]
          )
          for i, seq in enumerate(tokens):
              padded_batch[i, : len(seq)] = seq
      else:
          max_len_seq = max([len(seq) for seq in tokens])
          if max_len_seq == 0:
              max_len_sub_seq = 0
          else:
              max_len_sub_seq = max(
                  [len(sub_seq) for seq in tokens for sub_seq in seq]
              )
          padded_batch = np.full(
              (batch_size, max_len_seq, max_len_sub_seq),
              self._t2i["<PAD>"],
          )
          for i, seq in enumerate(tokens):
              for j, sub_seq in enumerate(seq):
                  padded_batch[i, j, : len(sub_seq)] = sub_seq
      return padded_batch
  
file_path: DeepPavlov/deeppavlov/models/preprocessors/ner_preprocessor.py
imports: import errno
  import os
  from logging import getLogger
  from typing import List
  import numpy
  from deeppavlov.core.common.registry import register
  from deeppavlov.core.models.estimator import Estimator
label_desc: Use image node_id 5 for calling the NerVocab obj's underlying member method code with example usage: obj.pad_batch(tokens) and returns: padded_batch