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 __init__(
      self,
      data_file: str,
      processor: object,
      tokenizer: object,
      keep_doc_spans: str = False,
      doc_stride: int = 128,
      max_query_length: int = 64,
      max_seq_length: int = 512,
      version_2_with_negative: bool = False,
      num_samples: int = -1,
      mode: str = TRAINING_MODE,
      use_cache: bool = False,
  ):
      super().__init__(
          data_file=data_file,
          processor=processor,
          tokenizer=tokenizer,
          mode=mode,
          num_samples=num_samples,
      )
  
      self.keep_doc_spans = keep_doc_spans
      self.doc_stride = doc_stride
      self.max_query_length = max_query_length
      self.max_seq_length = max_seq_length
      self.version_2_with_negative = version_2_with_negative
      self.num_samples = num_samples
      self.mode = mode
      self.use_cache = use_cache
  
      # structures for hashing to reduce memory use
      self.input_mask_id = 0
      self.input_mask_id_to_input_mask = {}
      self.input_mask_to_input_mask_id = {}
  
      self.segment_mask_id = 0
      self.segment_mask_id_to_segment_mask = {}
      self.segment_mask_to_segment_mask_id = {}
  
      self._set_cached_features_filename()
      if use_cache and os.path.exists(self.cached_features_file):
          if self.mode == TRAINING_MODE:
              del self.examples
              del self.processor
          (
              self.features,
              self.input_mask_id_to_input_mask,
              self.input_mask_to_input_mask_id,
              self.segment_mask_id_to_segment_mask,
              self.segment_mask_to_segment_mask_id,
          ) = QADataset.load_features_from_cache(
              self.cached_features_file
          )
      else:
          self._convert_examples_to_features()
          if use_cache:
              items_to_pickle = [
                  self.features,
                  self.input_mask_id_to_input_mask,
                  self.input_mask_to_input_mask_id,
                  self.segment_mask_id_to_segment_mask,
                  self.segment_mask_to_segment_mask_id,
              ]
              QADataset.dump_features_to_cache(
                  self.cached_features_file, items_to_pickle
              )
  
      logging.info("Converting dict features into object features")
      for i in trange(len(self.features)):
          self.features[i] = BERTQAInputExample(**self.features[i])
  
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 1 to create a new BERTQADataset object from inherited base classes: QADataset with example: obj = BERTQADataset(data_file, processor, tokenizer, keep_doc_spans, doc_stride, max_query_length, max_seq_length, version_2_with_negative, num_samples, mode, use_cache)