text: 
  
  TITLE
  Documentation error in question-answering pipeline
  
  COMMENTS
  4
  
  REACTIONS
  +1: 0
  -1: 0
  laugh: 0
  hooray: 0
  heart: 0
  rocket: 0
  eyes: 0
  
  BODY
  Hi,
  The [QuestionAnsweringPipeline](https://huggingface.co/transformers/main_classes/pipelines.html?highlight=pipelines#transformers.QuestionAnsweringPipeline.__call__) is returning the start and end position of the context string and not according to "the tokenized version of the input." as mentioned in the doc.
  
  ```python
  from transformers import AutoTokenizer, AutoModelForQuestionAnswering, pipeline
  tokenizer = AutoTokenizer.from_pretrained("bert-large-uncased-whole-word-masking-finetuned-squad")
  qa_pipeline = pipeline("question-answering")
  text = r"""
  🤗 Transformers (formerly known as pytorch-transformers and pytorch-pretrained-bert) provides general-purpose
  architectures (BERT, GPT-2, RoBERTa, XLM, DistilBert, XLNet…) for Natural Language Understanding (NLU) and Natural
  Language Generation (NLG) with over 32+ pretrained models in 100+ languages and deep interoperability between
  TensorFlow 2.0 and PyTorch.
  """
  
  questions = [
      "How many pretrained models?"
  ]
  
  result = qa_pipeline(question=questions, context=text)
  print(result)
  
  #this is the correct answer
  print(text[int(result["start"]):int(result["end"])])
  
  #this is not correct
  print(tokenizer.tokenize(text[int(result["start"]):int(result["end"])))
  ```
  
  Sorry if I misunderstood the doc