The start and end position of BertForQuestionAnswering
# ❓ Questions & Help

<!-- The GitHub issue tracker is primarly intended for bugs, feature requests,
     new models and benchmarks, and migration questions. For all other questions,
     we direct you to Stack Overflow (SO) where a whole community of PyTorch and
     Tensorflow enthusiast can help you out. Make sure to tag your question with the
     right deep learning framework as well as the huggingface-transformers tag: 
     https://stackoverflow.com/questions/tagged/huggingface-transformers 
     
     If your question wasn't answered after a period of time on Stack Overflow, you
     can always open a question on GitHub. You should then link to the SO question 
     that you posted.
     -->

## Details
<!-- Description of your issue -->
I am confused with the start and end position of Bert for QA model because of wordpiece. My question is: what is the value of position based on? For example, if start_position=10, it means the 10th word of the input or the 10th subword of input after wordpiece? Also, is the position value contains the length of question?
<!-- You should first ask your question on SO, and only if
     you didn't get an answer ask it here on GitHub. -->
**A link to original question on Stack Overflow**:

The position is based on the tokens. So this means that if you have a context: 

"The dog runs in the park." and a question "Who runs in the park?" and the corresponding tokens (=`tokenizer("Who runs in the park?", "The dog runs in the park.",).input_ids`) are 

`[101, 2040, 3216, 1999, 1996, 2380, 1029, 102, 1996, 3899, 3216, 1999, 1996, 2380, 1012, 102]`, then the model will tell you at what start and end position **of the input_ids** the answer to the question will be located. To better understand how to correctly use QA you might want to take a look at the example under this model in the docs: https://huggingface.co/transformers/master/model_doc/bert.html#bertforquestionanswering