regtoy/bge-reranker-v2-m3-finetuned-v2
BGE-Reranker-v2-M3 (E-Commerce Finetuned v2 - Curriculum Learning)
This model is a fine-tuned version of BAAI/bge-reranker-v2-m3 specifically optimized for E-Commerce Product Search and Relevance. It has been trained using a sophisticated Curriculum Learning pipeline with highly curated hard negatives (Brand, Category, and Lexical similarity).
🚀 Model Details
- Base Model:
BAAI/bge-reranker-v2-m3 - Architecture: Cross-Encoder (Sentence Transformers)
- Task: Text Classification / Ranking
- Language: Multilingual (Optimized for Turkish/English E-commerce items)
- Training Strategy: Curriculum Learning (Easy -> Hard -> Mastery)
- Loss Function:
BCEWithLogitsLoss(Knowledge Distillation via Soft-labeling)
📊 Training Pipeline (Curriculum Learning)
The model was trained on a meticulously constructed dataset of 123,510 query-product pairs.
- Phase 1 (Epoch 1): Easy negatives & Random negatives.
- Phase 2 (Epoch 2): Highly confusing hard negatives (Same Brand, Same Category, Lexically similar but different items) mined via TF-IDF Sparse Matrix Multiplication.
- Phase 3 (Epoch 3): Combined dataset for mastery and stabilization.
📈 Evaluation Metrics
Tested on a held-out benchmark dataset of 10,000 human-annotated and hard-mined query-product pairs:
Note: This V2 model sacrifices a tiny amount of calibration accuracy (F1) in exchange for a massive boost in structural Ranking success (MRR & P@1), making it exceptionally robust against keyword spamming and brand confusion.
💻 Usage
You can use this model easily with the sentence-transformers library:
pip install -U sentence-transformersfrom sentence_transformers import CrossEncoder
# Load the model
model = CrossEncoder("regtoy/bge-reranker-v2-m3-finetuned-v2", trust_remote_code=True)
query = "erkek siyah koşu ayakkabısı"
documents = [
"Title: Erkek Siyah Koşu Ayakkabısı | Brand: Nike | Category: Spor Ayakkabı", # Doğru Eşleşme
"Title: Kadın Kırmızı Yürüyüş Ayakkabısı | Brand: Adidas | Category: Spor Ayakkabı", # Yanlış Eşleşme
"Title: Erkek Siyah Deri Ceket | Brand: Koton | Category: Ceket" # Lexical Hard Negative
]
# Create pairs
pairs = [[query, doc] for doc in documents]
# Predict relevance scores
scores = model.predict(pairs)
# Rank documents
ranked_results = sorted(zip(documents, scores), key=lambda x: x[1], reverse=True)
for doc, score in ranked_results:
print(f"Score: {score:.4f} | Document: {doc}")🛠️ Input Format (Structured Input)
For maximum performance, format your product data exactly as it was formatted during training by joining attributes with | : Title: [title] | Brand: [brand] | Category: [category] | Gender: [gender] | Attributes: [attributes]
