Skip to content

gururaser/qdrant-score-boosting-ecommerce

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Learning-to-Rank Felt Too Complex. So I Tried Something Else.

This repository demonstrates how to approximate Learning-to-Rank (LTR) behavior using Score Boosting formulas inside your vector database, specifically with Qdrant.

Full article: Learning-to-Rank Felt Too Complex. So I Tried Something Else.


🚀 Overview

Vector search is powerful for semantic relevance, but "most similar" doesn't always mean "most relevant." Traditional Learning-to-Rank (LTR) systems involve complex feature pipelines and model serving infrastructure.

This project shows a simpler way: using Qdrant's Score Boosting to combine:

  1. Semantic Score: Raw vector similarity.
  2. Payload Signals: Category, brand, and gender affinity.
  3. Dynamic Decay: Boosting results from sellers near the user (Gaussian Decay).

Final Score Formula:

final_score = $score + 0.30*(category_match) + 0.20*(brand_match) + 0.20*(gender_match) + gauss_decay(distance)

🛠️ Setup

Prerequisites

  • Docker (to run Qdrant)
  • Python 3.9+

1. Run Qdrant

docker run -p 6333:6333 qdrant/qdrant:v1.17.0

2. Install Dependencies

pip install qdrant-client sentence-transformers

3. Run the Demo

Open and run score_boosting_demo.ipynb. It will:

  1. Load 200 synthetic products from data.jsonl.
  2. Embed product titles using IBM's granite-embedding-small-english-r2.
  3. Create a Qdrant collection with Payload Indexes for performance.
  4. Run a side-by-side comparison between Plain Search and Personalized Search.

📊 Results Comparison

For a query "running shoes" and a user who prefers Nike/Adidas, Women's products, and is located in Istanbul:

Plain Semantic Search (No Personalization)

Standard search returns semantically close items, but ignores user identity:

  1. Adidas NMD_R1 Unisex (0.887)
  2. Puma Women's Better Foam (0.885)
  3. New Balance Men's Hierro (0.879)

Personalized Search (Score Boosting)

Results are re-ranked to match the user's profile perfectly:

  1. Adidas NMD_R1 Unisex (2.587) - Matches Brand, Category, Near User
  2. Adidas Women's Cloudfoam (2.575) - Matches Gender, Brand, Category, Near User
  3. Nike Air Zoom Pegasus 40 (2.571) - Matches Gender, Brand, Category, Near User

🔗 Connect With Me

About

How Qdrant's Score Boosting feature can personalize e-commerce search results without training data, complex pipelines, or Learning-to-Rank models.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors