How kushagra-1210/scifact-hybrid-retrieval works
This is a SciFact scientific-claim retrieval system with a Streamlit demo and an offline evaluation/tuning workflow. The principal user flow loads a claim, ranks abstracts with BM25 and dense retrieval, fuses the rankings, optionally reranks the top results, and displays abstracts and scores. Offline runs also tune fusion weights on training queries and evaluate retrieval quality. The README documents plotting and error analysis as additional capabilities. Edges follow shown calls or README descriptions; the batch orchestration and plotting implementations were not sampled.
Main entry points: app.py Streamlit interface · data.py SciFact loader · run_tune.py Weight tuning · dense.py Dense retrieval
Components 17
Retrieval
- SciFact loader
src/data.py - BM25 retrieval
src/bm25.py - Dense retrieval
src/dense.py - RRF fusion
src/fusion.py - Cross-encoder reranking
src/rerank.py - Document embeddings
artifacts/embeddings.npy - Fusion weights
config/fusion_weights.json
Claim-search demo
- Streamlit interface
app/app.py
Tuning and evaluation
- Weight tuning
run_tune.py - Run-file utilities
src/utils.py - Retrieval metrics
src/evaluate.py - Ablation workflow
src/run_all.py
Result analysis
- Metric plots
src/plots.py - Error analysis
src/errors.py - Run and analysis outputs
results
Other components
- Claim-search user
- Embedding and rerank models
Connections 25
- Claim-search user → Streamlit interface: enters claim
README.md - Streamlit interface → SciFact loader: loads corpus
app/app.py - Streamlit interface → BM25 retrieval: scores claim
app/app.py - Streamlit interface → Dense retrieval: retrieves densely
README.md - Streamlit interface → RRF fusion: fuses rankings
app/app.py - Streamlit interface → Cross-encoder reranking: reranks optionally
- Streamlit interface → Fusion weights: reads weights
app/app.py - Dense retrieval → Document embeddings: reads or writes
src/dense.py - Dense retrieval → Embedding and rerank models: encodes queries
src/dense.py - Cross-encoder reranking → Embedding and rerank models: scores candidates
src/rerank.py - BM25 retrieval → SciFact loader: uses document text
src/bm25.py - Dense retrieval → SciFact loader: uses document text
src/dense.py - Weight tuning → SciFact loader: loads splits
run_tune.py - Weight tuning → RRF fusion: sweeps weights
run_tune.py - Weight tuning → Run-file utilities: loads and saves runs
run_tune.py - Weight tuning → Fusion weights: writes tuned config
run_tune.py - Cross-encoder reranking → SciFact loader: loads query data
src/rerank.py - Cross-encoder reranking → Run-file utilities: loads and saves runs
src/rerank.py - Ablation workflow → Retrieval metrics: evaluates runs
README.md - Ablation workflow → Run-file utilities: uses run utilities
src/run_all.py - Retrieval metrics → Run and analysis outputs: reports metrics
- Metric plots → Run and analysis outputs: creates figures
README.md - Error analysis → Run-file utilities: loads retrieval runs
src/errors.py - Error analysis → SciFact loader: loads judgments
src/errors.py - Error analysis → Run and analysis outputs: writes error analysis
src/errors.py