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.
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.
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.
Pure AI search can be too broad (hallucinating irrelevant items), while pure database filtering is too rigid.
- My Solution: A Hybrid System.
- Discovery Phase (Deep Learning): Finds semantically relevant items (e.g., "summer vibes").
- 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.
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_resourceto keep the heavy Transformer model in memory and pre-computed all vector embeddings (clothing_search_engine.csv). This minimizes compute time during live searches.
- 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.
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