Skip to content

Add an MMR (diversity) reranker #7

Description

@AshwinUgale

The problem / use case

Context: Rerankers live in src/retrieval_lab/scoring.py (LexicalReranker,
CrossEncoderReranker, plus none). MMR is a classic, dependency-free reranker.

What: Add an MMRReranker(lambda_) that reorders candidates by
λ·relevance − (1−λ)·max_sim_to_selected, wired into the CLI --rerank parser
(e.g. --rerank mmr).

Acceptance:

  • --rerank mmr runs in the sweep and shows up in the HTML report
  • a test comparing MMR vs none on a small set with near-duplicate candidates
  • deterministic given a seed; CHANGELOG.md updated

Pointers: follow LexicalReranker; keep it numpy-only (no new deps).

Proposed idea

Add a Maximal Marginal Relevance reranker that trades relevance against diversity, so the sweep can measure whether de-duplicating near-identical candidates helps recall@k.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions