Infomax-Reranker / README.md
Angshul's picture
Upload 14 files
d3fd67f verified
|
Raw History Blame Contribute Delete
2.11 kB
metadata
title: InfoMax Reranker
emoji: 🔎
colorFrom: indigo
colorTo: blue
sdk: gradio
sdk_version: 6.31.0
app_file: app.py
pinned: false
license: apache-2.0
short_description: Entropy-minimising passage reranker vs MS MARCO CE

InfoMax Reranker

A greedy, information-maximising selector over a retrieved candidate pool, compared with the standard cross-encoder/ms-marco-MiniLM-L6-v2 reranker. Neural scoring runs on ZeroGPU; selection runs on CPU.

  • app.py: Gradio app. Paste a query and passages separated by blank lines.
  • infomax_rerank.py: the selectors: infomax, plus the baselines mmr, fused/zfuse and by_score.
  • METHOD.md: the model and the selection rule.
  • results/: BEIR test results (beir_results.md, beir_results.json).
  • benchmark/: the scripts that produced them (see below).

Hardware

Create the Space with the Gradio SDK and select ZeroGPU as hardware. Hosting a ZeroGPU Space needs a PRO or Enterprise account. The @spaces.GPU decorator has no effect elsewhere, so the app also runs on CPU hardware and locally:

pip install -r requirements.txt gradio
python app.py

Reproducing the BEIR numbers

The datasets are the standard BEIR zips (scifact, nfcorpus, fiqa, scidocs, trec-covid), unzipped into $BEIR_DATA. Outputs go to $EXP_OUT. Models are loaded from local folders or Hub ids.

cd benchmark
export BEIR_DATA=/path/to/beir EXP_OUT=/path/to/out
python bm25_pools.py                                   # BM25 top-100 pools: test splits + 200-query dev samples
python dense_stage.py sentence-transformers/all-MiniLM-L6-v2 50
python ce_stage.py cross-encoder/ms-marco-MiniLM-L6-v2 50
python build_scores.py 50
python run_eval.py            # tune every method on dev splits only -> best_params.json
python run_eval.py --test     # nDCG / Recall on the test splits + paired bootstrap CIs
python mrr_recall.py          # MRR@10, Recall@3/5/10

As a check on the setup, BM25 nDCG@10 is within about 0.01 of the published BEIR BM25 numbers on all five datasets. all-MiniLM-L6-v2 scores 0.648 nDCG@10 on SciFact over the full corpus.