-
Notifications
You must be signed in to change notification settings - Fork 247
Examples and tutorials
Nandan Thakur edited this page Jun 4, 2025
·
3 revisions
To easily understand and get your hands dirty with BEIR, we invite you to try our tutorials out π π
| Name | Link |
|---|---|
| How to evaluate pre-trained models on BEIR datasets |
I highly recommend looking into Pyserini for reproducible & reliable BM25 implementations.
| Name | Link | Upto Date |
|---|---|---|
| Pyserini 2CR for BEIR π | Homepage | β |
| BM25 Retrieval with Elasticsearch (Old) | evaluate_bm25.py | β |
| Anserini-BM25 (Pyserini) Retrieval with Docker (Old) | evaluate_anserini_bm25.py | β |
| Multilingual BM25 Retrieval with Elasticsearch (Old) | evaluate_multilingual_bm25.py | β |
| Name | Link | Upto Date |
|---|---|---|
| Exact-search retrieval using Cohere Embed v4.0 π | evaluate_cohere.py | β |
| Exact-search retrieval using VoyageAI π | evaluate_voyage.py | β |
| Name | Link | Upto Date |
|---|---|---|
| Exact-search retrieval using any LoRA LLM retriever & VLLM π | evaluate_lora_vllm.py | β |
| Exact-search retrieval by saving embeddings and searching π | evaluate_huggingface_pkl_embs.py | β |
| Exact-search retrieval using HuggingFace π | evaluate_huggingface.py | β |
| Exact-search retrieval using LLM2Vec π | evaluate_llm2vec.py | β |
| Exact-search retrieval using NV-Embed (v2) π | evaluate_nvembed.py | β |
| Exact-search retrieval using any Sentence-BERT model π | evaluate_sbert.py | β |
| Exact-search retrieval using (dense) ANCE (Old) | evaluate_ance.py | β |
| Exact-search retrieval using (dense) DPR (Old) | evaluate_dpr.py | β |
| ANN and Exact-search using Faiss (Old) | evaluate_faiss_dense.py | β |
| Retrieval using Binary Passage Retriver (BPR) (Old) | evaluate_bpr.py | β |
| Dimension Reduction using PCA (Old) | evaluate_dim_reduction.py | β |
| Name | Link | Upto Date |
|---|---|---|
| Hybrid sparse retrieval using SPARTA (Old) | evaluate_sparta.py | β |
| Sparse retrieval using docT5query and Pyserini (Old) | evaluate_anserini_docT5query.py | β |
| Sparse retrieval using docT5query (MultiGPU) and Pyserini (Old) | evaluate_anserini_docT5query_parallel.py | β |
| Sparse retrieval using DeepCT and Pyserini (outdated) | evaluate_deepct.py | β |
I highly recommend for reranking models, please look into Tevatron or Sentence-Transformers.
| Name | Link | Upto Date |
|---|---|---|
| Reranking top-100 BM25 results with SBERT CE | evaluate_bm25_ce_reranking.py | β |
| Reranking top-100 BM25 results with Dense Retriever | evaluate_bm25_sbert_reranking.py | β |
I highly recommend for training state-of-the-art retrieval models, please look into Tevatron or Sentence-Transformers.
| Name | Link | Upto Date |
|---|---|---|
| Train SBERT with Inbatch negatives | train_sbert.py | β |
| Train SBERT with BM25 hard negatives | train_sbert_BM25_hardnegs.py | β |
| Train MSMARCO SBERT with BM25 Negatives | train_msmarco_v2.py | β |
| Train (SOTA) MSMARCO SBERT with Mined Hard Negatives | train_msmarco_v3.py | β |
| Train (SOTA) MSMARCO BPR with Mined Hard Negatives | train_msmarco_v3_bpr.py | β |
| Train (SOTA) MSMARCO SBERT with Mined Hard Negatives (Margin-MSE) | train_msmarco_v3_margin_MSE.py | β |
I highly recommend using state-of-the-art LLMs for question generation these days using vLLM.
| Name | Link | Upto Date |
|---|---|---|
| Synthetic Query Generation using T5-model | query_gen.py | β |
| (GenQ) Synthetic QG using T5-model + fine-tuning SBERT | query_gen_and_train.py | β |
| Synthetic Query Generation using Multiple GPU and T5 | query_gen_multi_gpu.py | β |
| Name | Link | Upto Date |
|---|---|---|
| Benchmark BM25 (Inference speed) | benchmark_bm25.py | β |
| Benchmark Cross-Encoder Reranking (Inference speed) | benchmark_bm25_ce_reranking.py | β |
| Benchmark Dense Retriever (Inference speed) | benchmark_sbert.py | β |
If you use the BEIR benchmark in your research, please cite the BEIR paper: https://openreview.net/forum?id=wCu6T5xFjeJ.