How to use from the
Use from the
sentence-transformers library
from sentence_transformers import CrossEncoder

model = CrossEncoder("Sgupta02/code-search-reranker-finetuned")

query = "Which planet is known as the Red Planet?"
passages = [
	"Venus is often called Earth's twin because of its similar size and proximity.",
	"Mars, known for its reddish appearance, is often referred to as the Red Planet.",
	"Jupiter, the largest planet in our solar system, has a prominent red spot.",
	"Saturn, famous for its rings, is sometimes mistaken for the Red Planet."
]

scores = model.predict([(query, passage) for passage in passages])
print(scores)

Fine-tuned reranker (best checkpoint, step 300)

Fine-tuned version of Alibaba-NLP/gte-reranker-modernbert-base on hard-negative-mined query/document pairs from scikit-learn's API documentation.

Honest result: this does not beat the pretrained base model. Best checkpoint (step 300 of 1194, learning rate 2e-6) scored 0.534 nDCG@10 on a 26-query eval set, versus 0.556 for the untouched pretrained model. Included here as the actual artifact from a real fine-tuning attempt, not as a recommended model to use.

Full pipeline, evaluation methodology, and the stage-by-stage ablation (dense retrieval to hybrid search to reranking) that this was built on top of: https://github.com/sgupta2346/Code-Search-Finetuned-Reranker

Downloads last month
21
Safetensors
Model size
0.1B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for Sgupta02/code-search-reranker-finetuned

Finetuned
(20)
this model