class_docstr: Question Answering pipeline using any `ModelForQuestionAnswering`. See the [question answering
  examples](../task_summary#question-answering) for more information.
  
  This question answering pipeline can currently be loaded from [`pipeline`] using the following task identifier:
  `"question-answering"`.
  
  The models that this pipeline can use are models that have been fine-tuned on a question answering task. See the
  up-to-date list of available models on
  [huggingface.co/models](https://huggingface.co/models?filter=question-answering).
class_docstr_tok: ["Question","Answering","pipeline","using","any","`","ModelForQuestionAnswering","`",".","See","the","[","question","answering","examples","]","(","..","\/task_summary","#","question-answering",")","for","more","information",".","This","question","answering","pipeline","can","currently","be","loaded","from","[","`","pipeline","`","]","using","the","following","task","identifier",":","`","``","question-answering","''","`",".","The","models","that","this","pipeline","can","use","are","models","that","have","been","fine-tuned","on","a","question","answering","task",".","See","the","up-to-date","list","of","available","models","on","[","huggingface.co\/models","]","(","https",":","\/\/huggingface.co\/models","?","filter=question-answering",")","."]
docstr: Answer the question(s) given as inputs by using the context(s).
  
  Args:
      args ([`SquadExample`] or a list of [`SquadExample`]):
          One or several [`SquadExample`] containing the question and context.
      X ([`SquadExample`] or a list of [`SquadExample`], *optional*):
          One or several [`SquadExample`] containing the question and context (will be treated the same way as if
          passed as the first positional argument).
      data ([`SquadExample`] or a list of [`SquadExample`], *optional*):
          One or several [`SquadExample`] containing the question and context (will be treated the same way as if
          passed as the first positional argument).
      question (`str` or `List[str]`):
          One or several question(s) (must be used in conjunction with the `context` argument).
      context (`str` or `List[str]`):
          One or several context(s) associated with the question(s) (must be used in conjunction with the
          `question` argument).
      topk (`int`, *optional*, defaults to 1):
          The number of answers to return (will be chosen by order of likelihood). Note that we return less than
          topk answers if there are not enough options available within the context.
      doc_stride (`int`, *optional*, defaults to 128):
          If the context is too long to fit with the question for the model, it will be split in several chunks
          with some overlap. This argument controls the size of that overlap.
      max_answer_len (`int`, *optional*, defaults to 15):
          The maximum length of predicted answers (e.g., only answers with a shorter length are considered).
      max_seq_len (`int`, *optional*, defaults to 384):
          The maximum length of the total sentence (context + question) in tokens of each chunk passed to the
          model. The context will be split in several chunks (using `doc_stride` as overlap) if needed.
      max_question_len (`int`, *optional*, defaults to 64):
          The maximum length of the question after tokenization. It will be truncated if needed.
      handle_impossible_answer (`bool`, *optional*, defaults to `False`):
          Whether or not we accept impossible as an answer.
      align_to_words (`bool`, *optional*, defaults to `True`):
          Attempts to align the answer to real words. Improves quality on space separated langages. Might hurt on
          non-space-separated languages (like Japanese or Chinese)
  
  Return:
      A `dict` or a list of `dict`: Each result comes as a dictionary with the following keys:
  
      - **score** (`float`) -- The probability associated to the answer.
      - **start** (`int`) -- The character start index of the answer (in the tokenized version of the input).
      - **end** (`int`) -- The character end index of the answer (in the tokenized version of the input).
      - **answer** (`str`) -- The answer to the question.
docstr_tok: ["Answer","the","question","(","s",")","given","as","inputs","by","using","the","context","(","s",")",".","Args",":","args","(","[","`","SquadExample","`","]","or","a","list","of","[","`","SquadExample","`","]",")",":","One","or","several","[","`","SquadExample","`","]","containing","the","question","and","context",".","X","(","[","`","SquadExample","`","]","or","a","list","of","[","`","SquadExample","`","]",",","*","optional","*",")",":","One","or","several","[","`","SquadExample","`","]","containing","the","question","and","context","(","will","be","treated","the","same","way","as","if","passed","as","the","first","positional","argument",")",".","data","(","[","`","SquadExample","`","]","or","a","list","of","[","`","SquadExample","`","]",",","*","optional","*",")",":","One","or","several","[","`","SquadExample","`","]","containing","the","question","and","context","(","will","be","treated","the","same","way","as","if","passed","as","the","first","positional","argument",")",".","question","(","`","str","`","or","`","List","[","str","]","`",")",":","One","or","several","question","(","s",")","(","must","be","used","in","conjunction","with","the","`","context","`","argument",")",".","context","(","`","str","`","or","`","List","[","str","]","`",")",":","One","or","several","context","(","s",")","associated","with","the","question","(","s",")","(","must","be","used","in","conjunction","with","the","`","question","`","argument",")",".","topk","(","`","int","`",",","*","optional","*",",","defaults","to","1",")",":","The","number","of","answers","to","return","(","will","be","chosen","by","order","of","likelihood",")",".","Note","that","we","return","less","than","topk","answers","if","there","are","not","enough","options","available","within","the","context",".","doc_stride","(","`","int","`",",","*","optional","*",",","defaults","to","128",")",":","If","the","context","is","too","long","to","fit","with","the","question","for","the","model",",","it","will","be","split","in","several","chunks","with","some","overlap",".","This","argument","controls","the","size","of","that","overlap",".","max_answer_len","(","`","int","`",",","*","optional","*",",","defaults","to","15",")",":","The","maximum","length","of","predicted","answers","(","e.g.",",","only","answers","with","a","shorter","length","are","considered",")",".","max_seq_len","(","`","int","`",",","*","optional","*",",","defaults","to","384",")",":","The","maximum","length","of","the","total","sentence","(","context","+","question",")","in","tokens","of","each","chunk","passed","to","the","model",".","The","context","will","be","split","in","several","chunks","(","using","`","doc_stride","`","as","overlap",")","if","needed",".","max_question_len","(","`","int","`",",","*","optional","*",",","defaults","to","64",")",":","The","maximum","length","of","the","question","after","tokenization",".","It","will","be","truncated","if","needed",".","handle_impossible_answer","(","`","bool","`",",","*","optional","*",",","defaults","to","`","False","`",")",":","Whether","or","not","we","accept","impossible","as","an","answer",".","align_to_words","(","`","bool","`",",","*","optional","*",",","defaults","to","`","True","`",")",":","Attempts","to","align","the","answer","to","real","words",".","Improves","quality","on","space","separated","langages",".","Might","hurt","on","non-space-separated","languages","(","like","Japanese","or","Chinese",")","Return",":","A","`","dict","`","or","a","list","of","`","dict","`",":","Each","result","comes","as","a","dictionary","with","the","following","keys",":","-","*","*","score","*","*","(","`","float","`",")","--","The","probability","associated","to","the","answer",".","-","*","*","start","*","*","(","`","int","`",")","--","The","character","start","index","of","the","answer","(","in","the","tokenized","version","of","the","input",")",".","-","*","*","end","*","*","(","`","int","`",")","--","The","character","end","index","of","the","answer","(","in","the","tokenized","version","of","the","input",")",".","-","*","*","answer","*","*","(","`","str","`",")","--","The","answer","to","the","question","."]
code: def __call__(self, *args, **kwargs):
      """
      Answer the question(s) given as inputs by using the context(s).
  
      Args:
          args ([`SquadExample`] or a list of [`SquadExample`]):
              One or several [`SquadExample`] containing the question and context.
          X ([`SquadExample`] or a list of [`SquadExample`], *optional*):
              One or several [`SquadExample`] containing the question and context (will be treated the same way as if
              passed as the first positional argument).
          data ([`SquadExample`] or a list of [`SquadExample`], *optional*):
              One or several [`SquadExample`] containing the question and context (will be treated the same way as if
              passed as the first positional argument).
          question (`str` or `List[str]`):
              One or several question(s) (must be used in conjunction with the `context` argument).
          context (`str` or `List[str]`):
              One or several context(s) associated with the question(s) (must be used in conjunction with the
              `question` argument).
          topk (`int`, *optional*, defaults to 1):
              The number of answers to return (will be chosen by order of likelihood). Note that we return less than
              topk answers if there are not enough options available within the context.
          doc_stride (`int`, *optional*, defaults to 128):
              If the context is too long to fit with the question for the model, it will be split in several chunks
              with some overlap. This argument controls the size of that overlap.
          max_answer_len (`int`, *optional*, defaults to 15):
              The maximum length of predicted answers (e.g., only answers with a shorter length are considered).
          max_seq_len (`int`, *optional*, defaults to 384):
              The maximum length of the total sentence (context + question) in tokens of each chunk passed to the
              model. The context will be split in several chunks (using `doc_stride` as overlap) if needed.
          max_question_len (`int`, *optional*, defaults to 64):
              The maximum length of the question after tokenization. It will be truncated if needed.
          handle_impossible_answer (`bool`, *optional*, defaults to `False`):
              Whether or not we accept impossible as an answer.
          align_to_words (`bool`, *optional*, defaults to `True`):
              Attempts to align the answer to real words. Improves quality on space separated langages. Might hurt on
              non-space-separated languages (like Japanese or Chinese)
  
      Return:
          A `dict` or a list of `dict`: Each result comes as a dictionary with the following keys:
  
          - **score** (`float`) -- The probability associated to the answer.
          - **start** (`int`) -- The character start index of the answer (in the tokenized version of the input).
          - **end** (`int`) -- The character end index of the answer (in the tokenized version of the input).
          - **answer** (`str`) -- The answer to the question.
      """
  
      # Convert inputs to features
  
      examples = self._args_parser(*args, **kwargs)
      if isinstance(examples, (list, tuple)) and len(examples) == 1:
          return super().__call__(examples[0], **kwargs)
      return super().__call__(examples, **kwargs)
  
imports: import types
  import warnings
  from collections.abc import Iterable
  from typing import TYPE_CHECKING, Dict, List, Optional, Tuple, Union
  import numpy
  from ..data import SquadExample, SquadFeatures, squad_convert_examples_to_features
  from ..modelcard import ModelCard
  from ..tokenization_utils import PreTrainedTokenizer
  from ..utils import PaddingStrategy, add_end_docstrings, is_tf_available, is_tokenizers_available, is_torch_available, logging
  from .base import PIPELINE_INIT_ARGS, ArgumentHandler, ChunkPipeline
label_desc: Use image node_id 4 for calling the QuestionAnsweringPipeline obj's underlying member method code with example usage: obj.__call__() and returns: super, super