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: QuestionAnsweringPipeline leverages the [`SquadExample`] internally. This helper method encapsulate all the
  logic for converting question(s) and context(s) to [`SquadExample`].
  
  We currently support extractive question answering.
  
  Arguments:
      question (`str` or `List[str]`): The question(s) asked.
      context (`str` or `List[str]`): The context(s) in which we will look for the answer.
  
  Returns:
      One or a list of [`SquadExample`]: The corresponding [`SquadExample`] grouping question and context.
docstr_tok: ["QuestionAnsweringPipeline","leverages","the","[","`","SquadExample","`","]","internally",".","This","helper","method","encapsulate","all","the","logic","for","converting","question","(","s",")","and","context","(","s",")","to","[","`","SquadExample","`","]",".","We","currently","support","extractive","question","answering",".","Arguments",":","question","(","`","str","`","or","`","List","[","str","]","`",")",":","The","question","(","s",")","asked",".","context","(","`","str","`","or","`","List","[","str","]","`",")",":","The","context","(","s",")","in","which","we","will","look","for","the","answer",".","Returns",":","One","or","a","list","of","[","`","SquadExample","`","]",":","The","corresponding","[","`","SquadExample","`","]","grouping","question","and","context","."]
code: def create_sample(
      question: Union[str, List[str]], context: Union[str, List[str]]
  ) -> Union[SquadExample, List[SquadExample]]:
      """
      QuestionAnsweringPipeline leverages the [`SquadExample`] internally. This helper method encapsulate all the
      logic for converting question(s) and context(s) to [`SquadExample`].
  
      We currently support extractive question answering.
  
      Arguments:
          question (`str` or `List[str]`): The question(s) asked.
          context (`str` or `List[str]`): The context(s) in which we will look for the answer.
  
      Returns:
          One or a list of [`SquadExample`]: The corresponding [`SquadExample`] grouping question and context.
      """
      if isinstance(question, list):
          return [
              SquadExample(None, q, c, None, None, None)
              for q, c in zip(question, context)
          ]
      else:
          return SquadExample(None, question, context, None, None, None)
  
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 2 for calling the QuestionAnsweringPipeline obj's underlying member method code with example usage: obj.create_sample(question, context) and returns: unknown, SquadExample