← all work
EARLY · 20212021 – 2022

Weekend Trendza from-scratch PyTorch support model, 2021

A 2021 e-commerce storefront whose support bot ran on a PyTorch intent classifier I built and trained from scratch.

PyTorch
model from scratch
118→8→9
feed-forward net
9 / 73
intents / patterns
2021
self-hosted NLP

Weekend Trendz is a women's-fashion storefront I built in 2021–2022 — the full shopping flow in Next.js 12: paginated category browsing, dynamic product pages, cart, cash-on-delivery orders, account pages, Google sign-in and Firestore behind it, plus a companion admin dashboard (wt-manage) for catalog and orders. I managed cart and user state with React context and custom hooks and lazy-loaded the Firebase SDK to keep the bundle small.

The part I'm proudest of is the support bot behind it. Instead of a hosted NLP service, I hand-built the entire intent-classification model in PyTorch: a 3-layer feed-forward network defined from scratch in nn.Module, fed by my own NLTK tokenization + Porter-stemming + bag-of-words pipeline, trained with a custom Adam/CrossEntropyLoss loop, then serialized with its vocabulary and served for real-time inference via Flask + gunicorn on Heroku. I designed and labeled my own intent dataset and gated inference on confidence so the bot declines rather than guesses on out-of-scope queries. The browser-side Web Speech voice/chat layer was a small optional add-on calling the same endpoint.

The hard part

Hand-building and shipping a PyTorch intent classifier

I wrote the whole ML stack for the support bot myself instead of reaching for a high-level library: a 118 → 8 → 8 → 9 feed-forward net (three nn.Linear layers, ReLU), an NLTK tokenize + Porter-stem + bag-of-words featurizer producing the 118-dim input, and a from-scratch training loop (Adam, lr 0.001, 800 epochs, CrossEntropyLoss). I saved the weights with the vocabulary and labels in data.pth so inference could rebuild the exact network, then gated responses on softmax confidence > 0.80 with a graceful fallback — served via Flask + gunicorn on Heroku.

Highlights

  • Hand-built and trained an NLP intent classifier from scratch in PyTorch — a 118 → 8 → 8 → 9 feed-forward nn.Module, a custom Adam/CrossEntropyLoss training loop (800 epochs, batch 8, lr 0.001), and the serialization, all written myself.
  • Authored the full feature pipeline by hand: NLTK word tokenization + Porter stemming + a custom bag-of-words vectorizer over a 118-token stemmed vocabulary.
  • Designed and labeled my own e-commerce support dataset — 9 intents, 73 patterns, 26 canned responses (items, payments, delivery, and more).
  • Shipped to production: packaged weights + vocabulary in data.pth and served real-time inference via Flask + gunicorn on Heroku (CPU-only torch wheels, nltk buildpack).
  • Built the full storefront in Next.js 12 (catalog, cart, COD orders, Google auth, Firestore) plus the wt-manage admin dashboard; a confidence-gated (softmax > 0.80) fallback and an optional Web Speech voice layer sat on top.

Stack

PythonPyTorch (CPU)NLTK (tokenize + PorterStemmer)NumPyFlask + gunicornHerokuNext.js 12React 17Firebase + FirestoreWeb Speech API (optional)