NumPy allowed · plain Python earns 10 bonus points
Cosine-like similarity scores ranked before context assembly
Implement a real, simple hallucination check: whether a generated sentence's words are actually supported by any retrieved source chunk.
Implement is_grounded(answer_sentence, source_chunks, min_overlap). Tokenize answer_sentence into lowercase words (split on whitespace). For each chunk, compute the fraction of the sentence's words that also appear (as whole words, case-insensitive) in that chunk. Return True if ANY chunk's overlap fraction is >= min_overlap.
is_grounded(answer_sentence: str, source_chunks: list[str], min_overlap: float) -> bool