Reranking

From VectorSpaceLab/AREX-Skill · View interactive version

Reranking is an AI agent skill from the GitHub repository VectorSpaceLab/AREX-Skill. Rerank BEIR retrieval results with cross-encoder, MonoT5, SBERT, or custom pair-scoring models and re-evaluate top-k changes.

How to use this skill

Skill file

BEIR Reranking

Use this sub-skill when you already have BEIR-style corpus, queries, and retrieval results, and need to rescore a candidate set with a pair-scoring model.

Route Here

Route Elsewhere

Start Points

Minimal Pattern

from beir.reranking import Rerank
from beir.reranking.models import CrossEncoder
from beir.retrieval.evaluation import EvaluateRetrieval

reranker = Rerank(CrossEncoder("cross-encoder/ms-marco-MiniLM-L-6-v2"), batch_size=128)
rerank_results = reranker.rerank(corpus, queries, results, top_k=100)
ndcg, _map, recall, precision = EvaluateRetrieval.evaluate(qrels, rerank_results, k_values)

rerank_results contains only the candidates passed into reranking, scored by the reranker; it is not merged back with non-reranked retrieval hits.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.