Skip to content
Aabha AI Academy

All courses · Course overview · Lesson sequence

Skip to lesson text

Answers and explanations · Compare semantic and hybrid retrieval

A. The query length is sqrt(2) and each non-zero document has length 1. A and B each score 1/sqrt(2)≈0.707107. C is a zero vector, for which our convention returns 0; it is excluded from positive-score results. The tie resolves by ID, so A precedes B. The vectors were manually supplied; no function transformed question text into them.

B. A gets 1/11+1/12≈0.174242; C gets 1/11≈0.090909; B gets 1/12≈0.083333. A wins. D has no occurrence and therefore no score; fusion cannot recover it. Check with:

from methods import reciprocal_rank_fusion
print(reciprocal_rank_fusion([["a", "b"], ["c", "a"]], constant=10))

A rank-fusion value measures agreement/position under the chosen rule, not probability of truth.

C. books passes. book rejects because the tokenizer does not stem plurals. laptop rejects because the token is absent. A useful passage can be rejected by a singular/plural mismatch or by synonyms such as wireless versus wifi. The term to require was chosen manually; the code does not infer that choice or evaluate entailment. It is an explicit filter, not BERT or another learned reranker.

D. One acceptable proposal: “Freeze corpus version X and label the needed evidence for a set of library questions before tuning. Record the actual dense encoder/tokenizer versions, input formatting, vector normalization and similarity metric. Retrieve lexical and dense results at the same cutoff and compare per-question recall and rank metrics. Examine missed paraphrases, wrong objects and condition-bearing policies, not only an average. Reserve new questions that have not influenced settings and keep duplicate/paraphrase families together to reduce leakage. The present package has run only lexical retrieval and manual-vector simulation, so it supplies no neural quality result.”

Return to this lesson