Scope
- Lesson:
docs/projects/reranking-pipeline/index.md (no-LLM skeleton per the codebase-knowledge-graph template) + _category_.json (label RerankingPipeline, position 24)
- Example:
examples/reranking-pipeline/ with a single CLI main.py, pyproject.toml, uv.lock, .gitignore, .python-version, README.md, and a notebook.ipynb (14 cells, corpus embedded inline, pandas benchmark table)
- Bundled data:
data/corpus/*.txt (25 short passages with deliberate same-word-different-meaning traps) + data/test_queries.json (12 labeled test queries)
- Registration: first entry in
src/data/projects.ts, docs/projects/index.mdx, and the homepage card in src/pages/index.tsx
- Badges (Colab/Kaggle/Binder) pointing at the
main notebook path + ready-made notebook paragraph, per house style
Framing note
A two-stage retrieval demo with an honest benchmark: a milliseconds-fast pure-Python keyword stage retrieves a top-5 shortlist, then a sentence-transformers cross-encoder (cross-encoder/ms-marco-MiniLM-L-6-v2, ~80MB one-time download) re-ranks it. Measures whether re-ranking actually improves precision@1/@3 and prints the timing cost (~2 orders of magnitude). No API key, no .env, no LLM. Lesson makes the compute/quality tradeoff and the 're-ranking can only fix ordering, not retrieval misses' limitation explicit.
Scope
docs/projects/reranking-pipeline/index.md(no-LLM skeleton per the codebase-knowledge-graph template) +_category_.json(labelRerankingPipeline, position 24)examples/reranking-pipeline/with a single CLImain.py,pyproject.toml,uv.lock,.gitignore,.python-version,README.md, and anotebook.ipynb(14 cells, corpus embedded inline, pandas benchmark table)data/corpus/*.txt(25 short passages with deliberate same-word-different-meaning traps) +data/test_queries.json(12 labeled test queries)src/data/projects.ts,docs/projects/index.mdx, and the homepage card insrc/pages/index.tsxmainnotebook path + ready-made notebook paragraph, per house styleFraming note
A two-stage retrieval demo with an honest benchmark: a milliseconds-fast pure-Python keyword stage retrieves a top-5 shortlist, then a sentence-transformers cross-encoder (
cross-encoder/ms-marco-MiniLM-L-6-v2, ~80MB one-time download) re-ranks it. Measures whether re-ranking actually improves precision@1/@3 and prints the timing cost (~2 orders of magnitude). No API key, no .env, no LLM. Lesson makes the compute/quality tradeoff and the 're-ranking can only fix ordering, not retrieval misses' limitation explicit.