Problem
A search system must return documents for a query with the most relevant first. Matching the query text is not enough: a document can contain the exact query and still be a poor result because of age, trustworthiness or format. Ranking also breaks the usual ML toolkit. The output is an ordered list per query, so accuracy, precision, recall and MSE do not apply. The usual ranking metric, NDCG, depends on sorting, which is not differentiable.
Example from the article: search engines such as Bing and Google, flight search (Expedia), job search (LinkedIn) and retail sites all return a ranked list of matching resources.
Solution in brief
Split the work in two steps. First retrieve candidates by query-document similarity (TF-IDF or embedding vectors with cosine similarity). Then rank them with a model trained on query, document and query-document features, choosing a pointwise, pairwise or listwise loss and judging it with a rank-aware metric such as NDCG.
Questions this case answers
- How to order a list of candidate items for each query so that the most relevant ones are at the top, when the quality metric depends on positions and cannot be optimized by gradient descent directly
- How to choose between pointwise, pairwise and listwise learning to rank for a search product?
- How to evaluate a search ranking when accuracy and MSE do not apply?
- How to find candidate documents for a query before ranking them?
Tools and methods
- TF-IDF and embedding cosine similarity — retrieve candidate documents for a query
- Fuzzy matching, edit distance — weaker matching baselines
- Pointwise, pairwise, listwise ranking — three ways to train a ranker
- RankNet, LambdaRank, LambdaMART, LambdaLoss — gradient-based pairwise and listwise methods
- SoftRank, AdaRank, Bayesian optimization — ways to optimize NDCG more directly
- NDCG, MRR, MAP, Precision@K, Recall@K, Hit Ratio — ranking metrics
Google or a one-time email code. No password.