class_docstr: Question Answering pipeline using any `ModelForQuestionAnswering`. See the [question answering
  examples](../task_summary#question-answering) for more information.
  
  Example:
  
  ```python
  >>> from transformers import pipeline
  
  >>> oracle = pipeline(model="deepset/roberta-base-squad2")
  >>> oracle(question="Where do I live?", context="My name is Wolfgang and I live in Berlin")
  {'score': 0.9191, 'start': 34, 'end': 40, 'answer': 'Berlin'}
  ```
  
  Learn more about the basics of using a pipeline in the [pipeline tutorial](../pipeline_tutorial)
  
  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",".","Example",":","``","`","python",">",">",">","from","transformers","import","pipeline",">",">",">","oracle","=","pipeline","(","model=","''","deepset\/roberta-base-squad2","''",")",">",">",">","oracle","(","question=","''","Where","do","I","live","?","``",",","context=","''","My","name","is","Wolfgang","and","I","live","in","Berlin","''",")","{","'score","'",":","0.9191",",","'start","'",":","34",",","'end","'",":","40",",","'answer","'",":","'Berlin","'","}","``","`","Learn","more","about","the","basics","of","using","a","pipeline","in","the","[","pipeline","tutorial","]","(","..","\/pipeline_tutorial",")","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",")","."]
code: def get_indices(
      self,
      enc: "tokenizers.Encoding",
      s: int,
      e: int,
      sequence_index: int,
      align_to_words: bool,
  ) -> Tuple[int, int]:
      if align_to_words:
          try:
              start_word = enc.token_to_word(s)
              end_word = enc.token_to_word(e)
              start_index = enc.word_to_chars(
                  start_word, sequence_index=sequence_index
              )[0]
              end_index = enc.word_to_chars(
                  end_word, sequence_index=sequence_index
              )[1]
          except Exception:
              # Some tokenizers don't really handle words. Keep to offsets then.
              start_index = enc.offsets[s][0]
              end_index = enc.offsets[e][1]
      else:
          start_index = enc.offsets[s][0]
          end_index = enc.offsets[e][1]
      return start_index, end_index
  
imports: import inspect
  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 8 for calling the QuestionAnsweringPipeline obj's underlying member method code with example usage: obj.get_indices(enc, s, e, sequence_index, align_to_words) and returns: start_index,  end_index