class_docstr: ## Function to load data into batches
class_docstr_tok: ["#","#","Function","to","load","data","into","batches"]
docstr: * `tokenizer` is the tokenizer function
  * `vocab` is the vocabulary
  * `seq_len` is the length of the sequence
  * `padding_token` is the token used for padding when the `seq_len` is larger than the text length
  * `classifier_token` is the `[CLS]` token which we set at end of the input
docstr_tok: ["*","`","tokenizer","`","is","the","tokenizer","function","*","`","vocab","`","is","the","vocabulary","*","`","seq_len","`","is","the","length","of","the","sequence","*","`","padding_token","`","is","the","token","used","for","padding","when","the","`","seq_len","`","is","larger","than","the","text","length","*","`","classifier_token","`","is","the","`","[","CLS","]","`","token","which","we","set","at","end","of","the","input"]
code: def __init__(
      self,
      tokenizer,
      vocab: Vocab,
      seq_len: int,
      padding_token: int,
      classifier_token: int,
  ):
      """
      * `tokenizer` is the tokenizer function
      * `vocab` is the vocabulary
      * `seq_len` is the length of the sequence
      * `padding_token` is the token used for padding when the `seq_len` is larger than the text length
      * `classifier_token` is the `[CLS]` token which we set at end of the input
      """
      self.classifier_token = classifier_token
      self.padding_token = padding_token
      self.seq_len = seq_len
      self.vocab = vocab
      self.tokenizer = tokenizer
  
imports: from collections import Counter
  from typing import Callable
  import torch
  import torchtext
  from torch import nn
  from torch.utils.data import DataLoader
  import torchtext.vocab
  from torchtext.vocab import Vocab
  from labml import lab, tracker, monit
  from labml.configs import option
  from labml_helpers.device import DeviceConfigs
  from labml_helpers.metrics.accuracy import Accuracy
  from labml_helpers.module import Module
  from labml_helpers.train_valid import TrainValidConfigs, hook_model_outputs, BatchIndex
  from labml_nn.optimizers.configs import OptimizerConfigs
label_desc: Use image node_id 1 to create a new CollateFunc object  with example: obj = CollateFunc(tokenizer, vocab, seq_len, padding_token, classifier_token)