class_docstr: Question-Answering-based Information Extraction
class_docstr_tok: ["Question-Answering-based","Information","Extraction"]
docstr: ```
  Extracts information from documents using Question-Answering.
  
    model_name(str): name of Question-Answering model (e.g., BERT SQUAD) to use
    bert_squad_model(str): alias for model_name (deprecated)
    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: ["``","`","Extracts","information","from","documents","using","Question-Answering",".","model_name","(","str",")",":","name","of","Question-Answering","model","(","e.g.",",","BERT","SQUAD",")","to","use","bert_squad_model","(","str",")",":","alias","for","model_name","(","deprecated",")","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,
      model_name=DEFAULT_MODEL,
      bert_squad_model=None,
      framework="tf",
      device=None,
      quantize=False,
  ):
      """
      ```
      Extracts information from documents using Question-Answering.
  
        model_name(str): name of Question-Answering model (e.g., BERT SQUAD) to use
        bert_squad_model(str): alias for model_name (deprecated)
        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.qa = _QAExtractor(
          model_name=model_name,
          bert_squad_model=bert_squad_model,
          framework=framework,
          device=device,
          quantize=quantize,
      )
      return
  
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 AnswerExtractor object  with example: obj = AnswerExtractor(model_name, bert_squad_model, framework, device, quantize)