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: Creates a list of [`~data.processors.squad.SquadExample`] using a TFDS dataset.
  
  Args:
      dataset: The tfds dataset loaded from *tensorflow_datasets.load("squad")*
      evaluate: Boolean specifying if in evaluation mode or in training mode
  
  Returns:
      List of SquadExample
  
  Examples:
  
  ```python
  >>> import tensorflow_datasets as tfds
  
  >>> dataset = tfds.load("squad")
  
  >>> training_examples = get_examples_from_dataset(dataset, evaluate=False)
  >>> evaluation_examples = get_examples_from_dataset(dataset, evaluate=True)
  ```
docstr_tok: ["Creates","a","list","of","[","`","~data.processors.squad.SquadExample","`","]","using","a","TFDS","dataset",".","Args",":","dataset",":","The","tfds","dataset","loaded","from","*","tensorflow_datasets.load","(","``","squad","''",")","*","evaluate",":","Boolean","specifying","if","in","evaluation","mode","or","in","training","mode","Returns",":","List","of","SquadExample","Examples",":","``","`","python",">",">",">","import","tensorflow_datasets","as","tfds",">",">",">","dataset","=","tfds.load","(","``","squad","''",")",">",">",">","training_examples","=","get_examples_from_dataset","(","dataset",",","evaluate=False",")",">",">",">","evaluation_examples","=","get_examples_from_dataset","(","dataset",",","evaluate=True",")","``","`"]
code: def get_examples_from_dataset(self, dataset, evaluate=False):
      """
      Creates a list of [`~data.processors.squad.SquadExample`] using a TFDS dataset.
  
      Args:
          dataset: The tfds dataset loaded from *tensorflow_datasets.load("squad")*
          evaluate: Boolean specifying if in evaluation mode or in training mode
  
      Returns:
          List of SquadExample
  
      Examples:
  
      ```python
      >>> import tensorflow_datasets as tfds
  
      >>> dataset = tfds.load("squad")
  
      >>> training_examples = get_examples_from_dataset(dataset, evaluate=False)
      >>> evaluation_examples = get_examples_from_dataset(dataset, evaluate=True)
      ```"""
  
      if evaluate:
          dataset = dataset["validation"]
      else:
          dataset = dataset["train"]
  
      examples = []
      for tensor_dict in tqdm(dataset):
          examples.append(
              self._get_example_from_tensor_dict(
                  tensor_dict, evaluate=evaluate
              )
          )
  
      return examples
  
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 2 for calling the SquadProcessor obj's underlying member method code with example usage: obj.get_examples_from_dataset(dataset, evaluate) and returns: examples