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"]
code: def __getitem__(self, idx: int):
      example = self.examples[idx]
      input_ids = np.array(
          example.features["input_ids"], dtype=np.int16
      )
      input_mask = np.array(
          example.features["input_mask"], dtype=np.int8
      )
      segment_ids = np.array(
          example.features["segment_ids"], dtype=np.int8
      )
      input_ids_for_subwords = np.array(
          example.features["input_ids_for_subwords"], dtype=np.int16
      )
      input_mask_for_subwords = np.array(
          example.features["input_mask_for_subwords"], dtype=np.int8
      )
      segment_ids_for_subwords = np.array(
          example.features["segment_ids_for_subwords"], dtype=np.int8
      )
      character_pos_to_subword_pos = np.array(
          example.features["character_pos_to_subword_pos"],
          dtype=np.int16,
      )
      labels_mask = np.array(
          example.features["labels_mask"], dtype=np.int8
      )
      labels = np.array(example.features["labels"], dtype=np.int8)
      spans = np.array(example.features["spans"], dtype=np.int16)
      return (
          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,
      )
  
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 4 for calling the SpellcheckingAsrCustomizationDataset obj's underlying member method code with example usage: obj.__getitem__(idx) and returns: 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