class_docstr: Creates a Dataset for BERT architecture based Exractive QA 
class_docstr_tok: ["Creates","a","Dataset","for","BERT","architecture","based","Exractive","QA"]
code: def __getitem__(self, idx: int):
      feature = self.features[idx]
      if self.mode == INFERENCE_MODE:
          return (
              np.array(feature.input_ids),
              np.array(
                  self.segment_mask_id_to_segment_mask[
                      feature.segment_ids
                  ]
              ),
              np.array(
                  self.input_mask_id_to_input_mask[feature.input_mask]
              ),
              np.array(feature.unique_id),
          )
      else:
          return (
              np.array(feature.input_ids),
              np.array(
                  self.segment_mask_id_to_segment_mask[
                      feature.segment_ids
                  ]
              ),
              np.array(
                  self.input_mask_id_to_input_mask[feature.input_mask]
              ),
              np.array(feature.unique_id),
              np.array(feature.start_position),
              np.array(feature.end_position),
          )
  
file_path: NeMo/nemo/collections/nlp/data/question_answering/dataset/qa_bert_dataset.py
imports: import os
  import numpy
  from tqdm import trange
  from nemo.collections.nlp.data.question_answering.data_processor.qa_processing import INFERENCE_MODE, TRAINING_MODE
  from nemo.collections.nlp.data.question_answering.dataset.qa_dataset import QADataset
  from nemo.collections.nlp.data.question_answering.input_example.qa_bert_input_example import BERTQAInputExample
  from nemo.utils import logging
label_desc: Use image node_id 4 for calling the BERTQADataset obj's underlying member method code with example usage: obj.__getitem__(idx) and returns: np,  np,  np,  np, np,  np,  np,  np,  np,  np