class_docstr: Prepare NER data for the model specified by "prefix".
docstr: Collate multimodal features into a batch.
  This function will be used when creating Pytorch DataLoader.
  
  Returns
  -------
  A dictionary containing one model's collator function for multimodal data.
docstr_tok: ["Collate","multimodal","features","into","a","batch",".","This","function","will","be","used","when","creating","Pytorch","DataLoader",".","Returns","--","--","--","-","A","dictionary","containing","one","model","'s","collator","function","for","multimodal","data","."]
code: def collate_fn(
      self, text_column_names: Optional[List] = None
  ) -> Dict:
      """
      Collate multimodal features into a batch.
      This function will be used when creating Pytorch DataLoader.
  
      Returns
      -------
      A dictionary containing one model's collator function for multimodal data.
      """
      fn = {}
      if self.prefix == NER_TEXT:
          fn.update(
              {
                  self.text_token_ids_key: PadCollator(
                      pad_val=self.tokenizer.pad_token_id
                  ),
                  self.text_valid_length_key: StackCollator(),
                  self.text_segment_ids_key: PadCollator(pad_val=0),
                  self.text_token_word_mapping_key: PadCollator(
                      pad_val=0
                  ),
                  self.text_word_offsets_key: PadCollator(pad_val=0),
                  self.label_key: StackCollator(),
              }
          )
      return fn
  
file_path: autogluon/multimodal/src/autogluon/multimodal/data/process_ner.py
imports: import logging
  import os
  import warnings
  from typing import Any, Dict, List, Optional, Union
  import numpy
  from nptyping import NDArray
  from omegaconf import DictConfig
  from torch import nn
  from ..constants import AUTOMM, NER_ANNOTATION, NER_TEXT, TEXT, TEXT_NER
  from .collator import PadCollator, StackCollator
  from .utils import process_ner_annotations, tokenize_ner_text
label_desc: Use image node_id 2 for calling the NerProcessor obj's underlying member method code with example usage: obj.collate_fn(text_column_names) and returns: fn