University of Stavanger — Information Retrieval and Text Mining (DAT640)
Built a multi-stage retrieval pipeline on the MS MARCO corpus (8.8M passages) combining BM25 for initial candidate retrieval, MonoT5 for neural re-ranking, and hybrid T5 query rewriting for conversational context. Improved NDCG@3 from 0.098 to 0.274 over the BM25 baseline.
Query → T5 Query Rewriting → BM25 (First-stage Retrieval) → MonoT5 Re-ranking → Ranked Results
| Method | NDCG@3 |
|---|---|
| BM25 Baseline | 0.098 |
| BM25 + MonoT5 Re-ranking | 0.274 |
| Improvement | +180% |
- Python
- BM25 (
rank_bm25) - MonoT5 (Hugging Face Transformers —
castorini/pygaggle) - T5 Query Rewriting (
castorini/t5-base-canard) - SQLite (inverted index)
- NLTK
- Pandas
MS MARCO Passage Ranking dataset (8.8M passages) — available at microsoft.github.io/msmarco.
Dataset not included due to size. Download
collection.tsvand place in the project root.
| File | Description |
|---|---|
Baseline Code.py |
BM25 baseline retrieval implementation |
Advanced Method Code.py |
Full pipeline — BM25 + MonoT5 re-ranking |
Query ReWriting.py |
T5-based query rewriting for conversational context |
queries_train.csv |
Training queries |
TREC_RUNFILE.txt |
TREC-format evaluation output |
Final_DAT640___Group_1.pdf |
Full project report |
Note:
Advanced Method Code.pyandQuery ReWriting.pywere developed in Google Colab and contain Colab-specific commands (e.g.,pip install,drive.mount). They are best run in a Colab environment.
Upload the .py files to Google Colab, mount your Drive with the dataset, and run cell by cell.
pip install -r requirements.txt
python "Baseline Code.py"Note on
pygaggle: The MonoT5 re-ranker depends oncastorini/pygaggle, which is not inrequirements.txtbecause it requires a manual Git clone and is only practical in a Colab/GPU environment. SeeAdvanced Method Code.pyfor the full install steps.
For the full MonoT5 pipeline, use Colab with GPU for reasonable performance.