← Quiz: Hybrid Search and BM25: all 10 questions
Quiz: Hybrid Search and BM25 · Question 6 of 10
What does this print? (code)
What does this print?
def rrf(rankings, k=60):
scores = {}
for ranking in rankings:
for rank, doc in enumerate(ranking, start=1):
scores[doc] = scores.get(doc, 0) + 1 / (k + rank)
return max(scores, key=scores.get)
print(rrf([["a", "b", "c"], ["c", "b", "a"], ["b", "c", "a"]]))
- A.a
- B.b
- C.c
- D.a tie error
Answer & explanation
Correct answer: b
b has ranks 2, 2, 1 (sum of 1/62 + 1/62 + 1/61), slightly ahead of c with ranks 3, 1, 2.
Can you get the rest right without peeking?
Take the timed Quiz: Hybrid Search and BM25 quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →