An answer span is a contiguous sequence of tokens selected from a document as the answer to a question. Extractive question answering searches a supplied context rather than generating an answer independently. section 14.1.1
The context is divided into smaller spans, and the model assigns each token a probability of being the answer's start and another probability of being its end. These two discrete probability mass functions reduce span selection to two token predictions. section 14.1.1
Minimalist shoes
Given the question “What are minimalist shoes?” and a context containing “Minimalist shoes are shoes intended to closely approximate barefoot running conditions,” the selected answer span is “shoes intended to closely approximate barefoot running conditions.” section 14.1.1
A practical extraction pipeline follows these steps:
- Tokenize the question and retrieved context, then encode them into model inputs. section 14.1.1
- Normalize the start and end scores, identify the highest-scoring boundary tokens, and slice the token sequence between them. section 14.1.1
- At query time, retrieve top-k documents, predict top-n answer spans, and let a reranker sort them by probability before displaying the highest-ranked answer. section 14.1.2
Figure 14.4 Retriever-reader pattern for extractive question answering
Use the architecture diagram to trace how a user question moves through retrieval, reading, answer-span scoring, and reranking. section 14.1.2
