liveBook · Manning

Reader

As explained in Natural Language Processing in Action, Second Edition

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.

Also explained in

Compare how 2 books explain reader →

Related concepts

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.