A Reader is a Haystack question-answering component that extracts an answer from the retrieved document context.
A Reader is the question-answering component that extracts an answer from document context selected by a Retriever. Semantic search finds likely documents; the Reader identifies the relevant answer within them. section 10.3.9
Configure a Reader
reader = TransformersReader(model_name_or_path="deepset/roberta-base-squad2") pairs a QA-fine-tuned transformer with an EmbeddingRetriever. Connecting Retriever output to Reader input produces a Haystack question-answering pipeline.
How Natural Language Processing in Action, Second Edition covers it
How deep it goes
Explains the Reader’s pipeline role and model selection, but does not descend into transformer inference internals.
Examples
Uses TransformersReader with roberta-base-squad2 and connects it to EmbeddingRetriever in Haystack.
What it assumes
Assumes a document store, retrieved context, and a query; distinguishes retrieval from answer extraction.
What you can do after
Apply it via Haystack to build an extractive QA pipeline over documents retrieved by semantic search.
How it connects
Connects extractive question answering with Retriever components, semantic search, embeddings, and BERT-based QA models.
Retrieverconfigures · A retriever is a software component that searches or queries an information source and returns items relevant to a query for use by downstream processes.
solutionproduces · A solution is an answer, approach, or assignment intended to address a problem or meet specified objectives or requirements.
answer spanproduces · An answer span is a contiguous segment of text selected or proposed as an answer to a question within a source document.
question answeringpart of · Question answering is the computational task of producing, selecting, or extracting an answer to a natural-language question using available information or knowledge.
This explainer was generated by Manning's knowledge graph from the text of Natural Language Processing in Action, Second Edition. The section links point to the parts of the book it draws on.