Instructions to use Sgupta02/code-search-reranker-finetuned with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use Sgupta02/code-search-reranker-finetuned with sentence-transformers:
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) - Notebooks
- Google Colab
- Kaggle
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
Model tree for Sgupta02/code-search-reranker-finetuned
Base model
answerdotai/ModernBERT-base