NumPy allowed · plain Python earns 10 bonus points
Cosine-like similarity scores ranked before context assembly
Implement weighted score fusion between dense (embedding) and sparse (BM25-style) retrieval, the real backbone of hybrid search.
Implement fuse_scores(dense_scores, sparse_scores, alpha). For every doc id in either dict, fused score is alpha*dense_scores.get(id,0) + (1-alpha)*sparse_scores.get(id,0). Return a dict of id -> fused score.
fuse_scores(dense_scores: dict[str, float], sparse_scores: dict[str, float], alpha: float) -> dict[str, float]