Skip to content

A Semantic Search Engine that solves the "Vocabulary Mismatch" problem. Uses Transformers (BERT) to match User Intent rather than Keywords. Features an AI Happiness Score for quality-first ranking.

Notifications You must be signed in to change notification settings

Muhamad-Shahan/AI-Smart-Shop-Assistant

Repository files navigation

🛍️ StyleAI: Semantic Fashion Search Engine

Streamlit App Transformer Model Python

🚀 The Problem: "Traditional Search is Dumb"

Standard e-commerce search engines rely on SQL Keyword Matching. If a user searches for "attire for a hot day", a database looks for the words "hot" or "day". It often fails (returning zero results) because the actual products are labeled "breathable" or "summer wear".

StyleAI solves this Vocabulary Mismatch Problem by moving beyond keywords to Intent Matching.

🔴 Live Demo: Click here to launch StyleAI

💡 Key Engineering Innovations

1. 🧠 Solving the Vocabulary Mismatch (Vector Search)

I implemented Semantic Search using the all-MiniLM-L6-v2 Transformer model.

  • How it works: The system converts user intent into mathematical vectors. It understands that "hot day" and "breathable fabric" are semantically close in vector space, even if they share zero words.
  • Impact: Increases product discovery and conversion rates by finding what users mean, not just what they type.

2. 📉 Quality-First Ranking (The "AI Happiness Score")

High star ratings are misleading. A product can have 4.5 stars, but recent reviews might complain about "fake material."

  • My Solution: I engineered a custom AI Happiness Score. Instead of trusting raw stars, I aggregated thousands of reviews using NLP to score products from 0 (Negative) to 1 (Positive).
  • Defense: This acts as a risk-mitigation layer, prioritizing products customers actually love right now, not just ones that sold well 2 years ago.

3. ⚡ Hybrid Filtering Architecture

Pure AI search can be too broad (hallucinating irrelevant items), while pure database filtering is too rigid.

  • My Solution: A Hybrid System.
    1. Discovery Phase (Deep Learning): Finds semantically relevant items (e.g., "summer vibes").
    2. Refinement Phase (Deterministic Logic): Applies rigid business rules (Price < $50, Rating > 4.0).
  • Result: Users get the inspiration of AI with the precision of a database.

4. 🚀 Low-Latency Micro-App Architecture

Many data science projects die in Jupyter Notebooks.

  • My Solution: I encapsulated the entire pipeline into a deployable Streamlit Micro-App.
  • Optimization: To ensure sub-second latency, I utilized @st.cache_resource to keep the heavy Transformer model in memory and pre-computed all vector embeddings (clothing_search_engine.csv). This minimizes compute time during live searches.

🛠️ Tech Stack

  • Core Logic: Python, Pandas, NumPy
  • Deep Learning: sentence-transformers (Hugging Face), PyTorch
  • Frontend: Streamlit
  • Data: Custom-built Index (clothing_search_engine.csv) containing product metadata, image links, and pre-computed sentiment scores.

💻 Installation (Run Locally)

To run this locally, you need a GPU-compatible environment (optional but recommended for speed).

# 1. Clone the repo
git clone [https://github.com/Muhammad-Shahan/StyleAI-Fashion-Search.git](https://github.com/Muhammad-Shahan/StyleAI-Fashion-Search.git)

# 2. Install dependencies
pip install -r requirements.txt

# 3. Run the App
streamlit run app.py

About

A Semantic Search Engine that solves the "Vocabulary Mismatch" problem. Uses Transformers (BERT) to match User Intent rather than Keywords. Features an AI Happiness Score for quality-first ranking.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published