Search and Retrieval, lesson 8
Measuring search with recall, MRR and NDCG
Score a ranked list, and pick the metric that matches the job.
"Reranking": recall for the first stage, precision for the second. This lesson turns them, and two more measures, into numbers you can track.
Part 1. One ranked list, scored
To measure a retriever you need questions where you already know the right passages. Take one: "How long do enterprise customers have to get a refund?" Someone reads the handbook and marks two passages. Enterprise refunds answers it. Annual refunds is related, and useful for contrast.
The retriever returns five passages, in this order: 1 kitchen rules, 2 enterprise refunds, 3 laptops, 4 travel, 5 annual refunds.
Relevance labels
The passages a person has marked as right for a question, sometimes with grades (here 2 for "answers it", 1 for "related"). A set of questions with labels is a test set, and every metric in this lesson compares a ranked list against it.
Your turn
Of the two marked passages, how many are in the top 3?
Part 2. Recall@k: did it make it in?
Keep going with Pro
You've done the first part. Pro opens the rest of this lesson, and every other one.
- Recall@k: did it make it in?
- MRR: how high is the first hit?
- NDCG: order and grades together
Search and Retrieval overviewSpotted a mistake? Tell us.