class_docstr: Processor for the SQuAD data set. overridden by SquadV1Processor and SquadV2Processor, used by the version 1.1 and
  version 2.0 of SQuAD, respectively.
class_docstr_tok: ["Processor","for","the","SQuAD","data","set",".","overridden","by","SquadV1Processor","and","SquadV2Processor",",","used","by","the","version","1.1","and","version","2.0","of","SQuAD",",","respectively","."]
docstr: Returns the training examples from the data directory.
  
  Args:
      data_dir: Directory containing the data files used for training and evaluating.
      filename: None by default, specify this if the training file has a different name than the original one
          which is `train-v1.1.json` and `train-v2.0.json` for squad versions 1.1 and 2.0 respectively.
docstr_tok: ["Returns","the","training","examples","from","the","data","directory",".","Args",":","data_dir",":","Directory","containing","the","data","files","used","for","training","and","evaluating",".","filename",":","None","by","default",",","specify","this","if","the","training","file","has","a","different","name","than","the","original","one","which","is","`","train-v1.1.json","`","and","`","train-v2.0.json","`","for","squad","versions","1.1","and","2.0","respectively","."]
code: def get_train_examples(self, data_dir, filename=None):
      """
      Returns the training examples from the data directory.
  
      Args:
          data_dir: Directory containing the data files used for training and evaluating.
          filename: None by default, specify this if the training file has a different name than the original one
              which is `train-v1.1.json` and `train-v2.0.json` for squad versions 1.1 and 2.0 respectively.
  
      """
      if data_dir is None:
          data_dir = ""
  
      if self.train_file is None:
          raise ValueError(
              "SquadProcessor should be instantiated via SquadV1Processor or SquadV2Processor"
          )
  
      with open(
          os.path.join(
              data_dir,
              self.train_file if filename is None else filename,
          ),
          "r",
          encoding="utf-8",
      ) as reader:
          input_data = json.load(reader)["data"]
      return self._create_examples(input_data, "train")
  
imports: import json
  import os
  from functools import partial
  from multiprocessing import Pool, cpu_count
  import numpy
  from tqdm import tqdm
  from ...models.bert.tokenization_bert import whitespace_tokenize
  from ...tokenization_utils_base import BatchEncoding, PreTrainedTokenizerBase, TruncationStrategy
  from ...utils import is_tf_available, is_torch_available, logging
  from .utils import DataProcessor
label_desc: Use image node_id 3 for calling the SquadProcessor obj's underlying member method code with example usage: obj.get_train_examples(data_dir, filename) and returns: self