class_docstr: Base class for QA
class_docstr_tok: ["Base","class","for","QA"]
code: def __init__(
      self,
      model_name=DEFAULT_MODEL,
      bert_squad_model=None,
      bert_emb_model="bert-base-uncased",
      framework="tf",
      device=None,
      quantize=False,
  ):
      model_name = (
          bert_squad_model
          if bert_squad_model is not None
          else model_name
      )
      if bert_squad_model:
          warnings.warn(
              "The bert_squad_model argument is deprecated - please use model_name instead.",
              DeprecationWarning,
              stacklevel=2,
          )
      self.model_name = model_name
      self.framework = framework
      if framework == "tf":
          try:
              import tensorflow as tf
          except ImportError:
              raise Exception(
                  'If framework=="tf", TensorFlow must be installed.'
              )
          try:
              self.model = (
                  TFAutoModelForQuestionAnswering.from_pretrained(
                      self.model_name
                  )
              )
          except:
              warnings.warn(
                  "Could not load supplied model as TensorFlow checkpoint - attempting to load using from_pt=True"
              )
              self.model = (
                  TFAutoModelForQuestionAnswering.from_pretrained(
                      self.model_name, from_pt=True
                  )
              )
      else:
          bert_emb_model = None  # set to None and ignore since we only want to use PyTorch
          super().__init__(device=device, quantize=quantize)
          self.model = AutoModelForQuestionAnswering.from_pretrained(
              self.model_name
          ).to(self.torch_device)
          if quantize:
              self.model = self.quantize_model(self.model)
  
      self.tokenizer = AutoTokenizer.from_pretrained(self.model_name)
      self.maxlen = 512
      self.te = (
          tpp.TransformerEmbedding(bert_emb_model, layers=[-2])
          if bert_emb_model is not None
          else None
      )
  
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 ExtractiveQABase object from inherited base classes: ABC, TorchBase with example: obj = ExtractiveQABase(model_name, bert_squad_model, bert_emb_model, framework, device, quantize)