CoolFace
Modelpublic

ramitha2002/genieai-product-reranker

sourceHugging Faceapache-2.0updated 25d agoView on Hugging Face
1likes40downloads
Model Card

GenieAI Gift Product Reranker

This CrossEncoder reranks ecommerce products for English gift-shopping queries. It scores each (query, product text) pair; a higher score means the product should rank higher.

Model Details

ItemValue
Repositoryramitha2002/genieai-product-reranker
Base modelcross-encoder/ms-marco-MiniLM-L6-v2
ArchitectureMiniLM CrossEncoder
LanguageEnglish
Maximum input length384 tokens
LicenseApache 2.0

Training Data

The model was fine-tuned on the public tasksource/esci mirror of Amazon's Shopping Queries Dataset. Only English/US Task 1 query groups matching these gift categories were selected:

text
cakes and desserts
flower bouquets
chocolates and candy
perfume and fragrance
jewelry
fashion and accessories
gift baskets and hampers
skincare and beauty sets
personalized gifts
home decor and candles

All candidates belonging to each selected query were retained, including irrelevant negatives.

SplitPairs
Train20,486
Validation8,677
Validation query groups424

Training-category distribution:

CategoryPairs
Fashion and accessories6,608
Jewelry6,551
Flower bouquets1,707
Chocolates and candy1,602
Home decor and candles1,328
Cakes and desserts1,194
Perfume and fragrance834
Gift baskets and hampers240
Skincare and beauty sets222
Personalized gifts200

ESCI labels were converted to numeric relevance targets:

text
Exact       = 1.00
Substitute  = 0.70
Complement  = 0.35
Irrelevant  = 0.00

Training Settings

SettingValue
Epochs2
Train batch size32
Evaluation batch size64
Learning rate2e-5
LossBinary cross-entropy
Train loss0.5644
Final evaluation loss0.5207

Evaluation

Evaluation used complete, grouped ESCI validation queries.

MetricResult
NDCG@100.8796
MRR0.9591
Hit Rate@40.9906

These results measure the filtered ESCI validation set and do not guarantee the same performance on GenieAI's live catalog.

Usage

python
from sentence_transformers import CrossEncoder

model = CrossEncoder("ramitha2002/genieai-product-reranker")

query = "birthday flowers for mother"
products = [
    "Title: Pink rose bouquet\nDescription: Fresh roses for birthdays",
    "Title: Wireless gaming mouse\nDescription: RGB computer mouse",
]

scores = model.predict([(query, product) for product in products])
ranked = sorted(zip(products, scores), key=lambda item: item[1], reverse=True)
print(ranked)

Raw outputs are ranking scores, not calibrated probabilities. Compare scores only among products evaluated for the same query.

Intended Use

  • Rerank approximately 30 products retrieved by RAG or search.
  • Apply hard stock, delivery, and budget filters before or after retrieval.
  • Return the best four products after reranking.
  • Fall back to the original retrieval order if model inference fails.

Limitations

  • Optimized for English gift-product searches.
  • Fashion and jewelry are overrepresented in the training set.
  • Weaker performance is expected for skincare, personalized gifts, and hampers.
  • The dataset does not represent GenieAI's live prices, stock, delivery rules, or complete catalog.
  • Validate the model on real GenieAI queries before production use.

Data and Base Model

  • Dataset: https://huggingface.co/datasets/tasksource/esci
  • Original ESCI source: https://github.com/amazon-science/esci-data
  • Base model: https://huggingface.co/cross-encoder/ms-marco-MiniLM-L6-v2