Documents
Home>Documents>AI>LLM>Train & Tune

LLM-Powered Automatic Product Category Mapping for E-Commerce

5 min readNov 26, 2024Feb 22, 2026

Project Overview

prj_category_llm is a project that automatically classifies e-commerce products into categories using an LLM. It ran from November to December 2024 — roughly one month — across 48 commits.

Problem Definition

graph TD
    A[신규 상품 등록] --> B{카테고리 미분류}
    B -->|수동| C[운영자가 하나씩 분류]
    B -->|자동| D[LLM 기반 분류]

    C -->|문제| E[시간 소요]
    C -->|문제| F[일관성 부족]

    D -->|장점| G[즉시 분류]
    D -->|장점| H[일관된 기준]
    D -->|장점| I[학습 가능]

E-Commerce Category Structure

Large e-commerce platforms organize categories into 4–5 levels: top-level → mid-level → sub-level → detailed. For example: Fashion → Men's Clothing → Outerwear → Puffer Jackets.

Development Timeline

11/26: Project initialization, data collection
11/27–29: Base classification model development (10 commits)
12/02–05: Model improvements and prompt engineering (10 commits)
12/10–13: Evaluation and tuning (6 commits)
12/16–17: Additional optimization (5 commits)
12/20–26: Final version and performance evaluation (6 commits)

Approach

  1. Zero-shot: Classify using only the product name and description
  2. Few-shot: Provide examples of similar products alongside the input
  3. RAG-based: Retrieve and reference the category manual at inference time

Key Results

  • Top-level category accuracy: 95%+
  • Detailed category accuracy: 82%+
  • Average processing time: ~2 seconds per product

Throughout the 48 commits, continuous prompt tuning and model comparisons were carried out. The commit messages are mostly just dates (1126, 1127, …), which is unfortunate, but incremental improvements were made every day under the hood.

Tags
category classificatione-commerceLLMprompt engineeringauto-classification