Hi @bhadresh-savani, there’s a lot of tricky pre- and post-processing needed to get the question-answering working. For example, I think your implementation is missing the sliding window needed to chunk long documents into passages and the sorting of the predicted answers in the evaluation.
Sylvain Gugger has a nice Colab tutorial with all these details here 9, so my suggestion would be to compare his implementation against yours to see what you need to add.