Given a context paragraph and a question, find the sentence in the context that has the most keyword overlap with the question. Return that sentence as the answer.
Input format:
Keywords are all words (lowercased) except common stop words: {"the", "a", "an", "is", "are", "was", "were", "in", "on", "at", "to", "for", "of", "and", "or", "it", "this", "that", "what", "which", "who", "where", "when", "how", "do", "does", "did"}.
If there's a tie, return the first matching sentence.
Cats are popular pets. Dogs are loyal animals. Fish live in water. What animals are loyal
Dogs are loyal animals
Step 1: Extract question keywords (minus stop words) "what animals are loyal" → keywords: {"animals", "loyal"}
Step 2: Count keyword overlap per sentence "Cats are popular pets" → overlap: 0 "Dogs are loyal animals" → overlap: {"loyal", "animals"} = 2 "Fish live in water" → overlap: 0
Step 3: Return best match "Dogs are loyal animals" has highest overlap (2)