M3
Ranking
BM25 scorer
A BM25 scorer that ranks documents by relevance to a query
Available
Cohort
- Effort
- 4-5 hours
- Prerequisite
- M2
- Core concept
- Term weighting and document length normalization
What you have
An inverted index that returns unranked postings
What you gain
Ranked search results with relevance scores
What you build
This module turns unranked postings into a ranked result list with traceable scoring signals.
- A compute_idf() function for corpus-level term weighting
- A score_bm25() function that scores one document against a query
- A search() function that returns ranked results with numeric scores
What you learn
- Why BM25 weights rare terms differently from common ones
- How document length normalization changes the final rank order
- How query terms combine into one relevance score
- How to inspect ranked outputs instead of trusting the formula blindly
Artifact and workload
Primary artifact: compute_idf(), score_bm25(), and search() functions
Tests27
Assessments5
Estimated time4-5 hours
Access
This module is part of the cohort. Join the guided path for reviews, deadlines, and the workshop sequence after the ranking modules.