All projects

Category recommender v2

Replacing a FastText classifier with LLM classification

ContractAbearApr 2024 – Jun 20243 mos

Context

The feature suggests a category when a seller lists a product — a follow-up to the v1 I had built earlier.

The FastText-based recommender had hit its ceiling on both accuracy and extensibility.

How I solved it

  1. More data and another training run would have fixed accuracy alone, but the deeper constraint was a taxonomy that keeps changing
  2. So I removed training from the loop entirely, replacing the FastText classifier with LLM-based classification

Result

  • Classification accuracy went from 90% to 92%
  • An average of 8,000 categories per marketplace now extend without retraining
    • each new marketplace used to cost 70 minutes of it
Retraining time to onboard one marketplace
FastText v170 min
LLM v2None

Tech

PythonFastAPILangchainLLM