... a model on a SQuAD task, you may leverage the examples/pytorch/question-answering/run_squad.py script.
... """
```
This returns an answer extracted from the text, a confidence score, alongside "start" and "end" values, which are the
positions of the extracted answer in the text.
```py
result = question_answerer(question="What is extractive question answering?", context=context)
print(
...     f"Answer: '{result['answer']}', score: {round(result['score'], 4)}, start: {result['start']}, end: {result['end']}"
... )
Answer: 'the task of extracting an answer from a text given a question', score: 0.6177, start: 34, end: 95
result = question_answerer(question="What is a good example of a question answering dataset?", context=context)
print(
...     f"Answer: '{result['answer']}', score: {round(result['score'], 4)}, start: {result['start']}, end: {result['end']}"
