How to return entire sentence with AutoModelForQuestionAnswering?

I’ve built a question answering pipeline based on Roberta SQUaDv2 and I am curious if it would be possible to retrieve the entire sentence that an answer was retrieved from instead of just the answer itself?

For example, given context = “Washington D.C. is the capitol of the United States of America” and the question “What is the capitol of the USA”, instead of responding with answer = “Washington D.C.” would it be possible to fetch the entire span of the sentence?

Thanks in advance :slight_smile: