class_docstr: SimpleQA: Question-Answering on a list of texts
class_docstr_tok: ["SimpleQA",":","Question-Answering","on","a","list","of","texts"]
docstr: ```
  SimpleQA constructor
  Args:
    index_dir(str):  path to index directory created by SimpleQA.initialze_index
    model_name(str): name of Question-Answering model (e.g., BERT SQUAD) to use
    bert_squad_model(str): alias for model_name (deprecated)
    bert_emb_model(str): BERT model to use to generate embeddings for semantic similarity
    framework(str): 'tf' for TensorFlow or 'pt' for PyTorch
    device(str): Torch device to use (e.g., 'cuda', 'cpu'). Ignored if framework=='tf'.
                 If framework=='tf', use CUDA_VISIBLE_DEVICES environment variable
                 to select device.
    quantize(bool): If True and framework=='pt' and device != 'cpu', then faster quantized inference is used.
                Ignored if framework=="tf".
  ```
docstr_tok: ["``","`","SimpleQA","constructor","Args",":","index_dir","(","str",")",":","path","to","index","directory","created","by","SimpleQA.initialze_index","model_name","(","str",")",":","name","of","Question-Answering","model","(","e.g.",",","BERT","SQUAD",")","to","use","bert_squad_model","(","str",")",":","alias","for","model_name","(","deprecated",")","bert_emb_model","(","str",")",":","BERT","model","to","use","to","generate","embeddings","for","semantic","similarity","framework","(","str",")",":","'tf","'","for","TensorFlow","or","'pt","'","for","PyTorch","device","(","str",")",":","Torch","device","to","use","(","e.g.",",","'cuda","'",",","'cpu","'",")",".","Ignored","if","framework=='tf","'",".","If","framework=='tf","'",",","use","CUDA_VISIBLE_DEVICES","environment","variable","to","select","device",".","quantize","(","bool",")",":","If","True","and","framework=='pt","'","and","device","!","=","'cpu","'",",","then","faster","quantized","inference","is","used",".","Ignored","if","framework==","''","tf","''",".","``","`"]
code: def __init__(
      self,
      index_dir,
      model_name=DEFAULT_MODEL,
      bert_squad_model=None,  # deprecated
      bert_emb_model="bert-base-uncased",
      framework="tf",
      device=None,
      quantize=False,
  ):
      """
      ```
      SimpleQA constructor
      Args:
        index_dir(str):  path to index directory created by SimpleQA.initialze_index
        model_name(str): name of Question-Answering model (e.g., BERT SQUAD) to use
        bert_squad_model(str): alias for model_name (deprecated)
        bert_emb_model(str): BERT model to use to generate embeddings for semantic similarity
        framework(str): 'tf' for TensorFlow or 'pt' for PyTorch
        device(str): Torch device to use (e.g., 'cuda', 'cpu'). Ignored if framework=='tf'.
                     If framework=='tf', use CUDA_VISIBLE_DEVICES environment variable
                     to select device.
        quantize(bool): If True and framework=='pt' and device != 'cpu', then faster quantized inference is used.
                    Ignored if framework=="tf".
      ```
      """
  
      self.index_dir = index_dir
      try:
          ix = index.open_dir(self.index_dir)
      except:
          raise ValueError(
              'index_dir has not yet been created - please call SimpleQA.initialize_index("%s")'
              % (self.index_dir)
          )
      super().__init__(
          model_name=model_name,
          bert_squad_model=bert_squad_model,
          bert_emb_model=bert_emb_model,
          framework=framework,
          device=device,
          quantize=quantize,
      )
  
imports: from transformers import AutoModelForQuestionAnswering, AutoTokenizer, TFAutoModelForQuestionAnswering
  from whoosh import index, qparser
  from whoosh.fields import *
  from whoosh.qparser import QueryParser
  from ...None import utils
  from ...imports import *
  from ...torch_base import TorchBase
  from ..None import preprocessor
  from ..None import textutils
  from itertools import chain, zip_longest
label_desc: Use image node_id 1 to create a new SimpleQA object from inherited base classes: ExtractiveQABase with example: obj = SimpleQA(index_dir, model_name, bert_squad_model, bert_emb_model, framework, device, quantize)