Views
No views yet
BAAI/bge-reranker-v2-m3BCEWithLogitsLoss (Knowledge Distillation via Soft-labeling)| Metric | Score |
|---|---|
| MRR (Mean Reciprocal Rank) | 0.9625 |
| P@1 (Precision at 1) | 0.9260 |
| AUC-ROC | 0.9621 |
| F1 Score | 0.9172 |
sentence-transformers library:pip install -U sentence-transformers1from sentence_transformers import CrossEncoder
2
3# Load the model
4model = CrossEncoder("regtoy/bge-reranker-v2-m3-finetuned-v3", trust_remote_code=True)
5
6query = "erkek siyah koşu ayakkabısı"
7documents = [
8 "Title: Erkek Siyah Koşu Ayakkabısı | Brand: Nike | Category: Spor Ayakkabı", # Doğru Eşleşme
9 "Title: Kadın Kırmızı Yürüyüş Ayakkabısı | Brand: Adidas | Category: Spor Ayakkabı", # Yanlış Eşleşme
10 "Title: Erkek Siyah Deri Ceket | Brand: Koton | Category: Ceket" # Lexical Hard Negative
11]
12
13# Create pairs
14pairs = [[query, doc] for doc in documents]
15
16# Predict relevance scores
17scores = model.predict(pairs)
18
19# Rank documents
20ranked_results = sorted(zip(documents, scores), key=lambda x: x[1], reverse=True)
21for doc, score in ranked_results:
22 print(f"Score: {score:.4f} | Document: {doc}")|:
Title: [title] | Brand: [brand] | Category: [category] | Gender: [gender] | Attributes: [attributes]