class_docstr: Dataset as used by the SpellcheckingAsrCustomizationModel for training and validation pipelines.
  
  Args:
      input_file (str): path to tsv-file with data
      example_builder: instance of BertExampleBuilder
class_docstr_tok: ["Dataset","as","used","by","the","SpellcheckingAsrCustomizationModel","for","training","and","validation","pipelines",".","Args",":","input_file","(","str",")",":","path","to","tsv-file","with","data","example_builder",":","instance","of","BertExampleBuilder"]
docstr: collate batch of items
  Args:
      batch:  A list of tuples of (input_ids, input_mask, segment_ids, input_ids_for_subwords, input_mask_for_subwords, segment_ids_for_subwords, character_pos_to_subword_pos, labels_mask, labels, spans).
docstr_tok: ["collate","batch","of","items","Args",":","batch",":","A","list","of","tuples","of","(","input_ids",",","input_mask",",","segment_ids",",","input_ids_for_subwords",",","input_mask_for_subwords",",","segment_ids_for_subwords",",","character_pos_to_subword_pos",",","labels_mask",",","labels",",","spans",")","."]
code: def _collate_fn(self, batch):
      """collate batch of items
      Args:
          batch:  A list of tuples of (input_ids, input_mask, segment_ids, input_ids_for_subwords, input_mask_for_subwords, segment_ids_for_subwords, character_pos_to_subword_pos, labels_mask, labels, spans).
      """
      return collate_train_dataset(
          batch, pad_token_id=self.pad_token_id
      )
  
imports: import pickle
  from io import BytesIO
  from typing import Dict, List, Optional, Tuple
  import braceexpand
  import numpy
  import torch
  import webdataset
  from nemo.collections.nlp.data.spellchecking_asr_customization.bert_example import BertExampleBuilder
  from nemo.core.classes.dataset import Dataset, IterableDataset
  from nemo.core.neural_types import ChannelType, IntType, LabelsType, MaskType, NeuralType
  from nemo.utils import logging
label_desc: Use image node_id 5 for calling the SpellcheckingAsrCustomizationDataset obj's underlying member method code with example usage: obj._collate_fn(batch) and returns: collate_train_dataset