Question-Answering Systems
QA System Types
1. Extractive QA Find and extract answer from text.
2. Generative QA Generate answer based on context.
3. Open-Domain QA Answer any question (uses retrieval).
4. Closed-Domain QA Answer within specific domain.
Building a QA Pipeline
1. Question Understanding - Parse the question - Identify key entities and intent
2. Context Retrieval - Find relevant documents - Rank by relevance
3. Answer Generation - Generate answer from context - Cite sources
4. Answer Validation - Check for hallucination - Verify against source
Handling "I Don't Know"
Critical for trustworthy QA:
Prompt Template
"Based on the following context, answer the question. If the answer is not in the context, say 'I don't have information about that.'
Context: [CONTEXT] Question: [QUESTION] Answer:"