Category Prediction for Search Query Understanding

music and waves21 Apr 2024

Problem

An e-commerce search box receives short, vague queries such as "winter upper wear" or "whey". The engine must decide which categories the user means. Categories overlap: kurtas are sold alone and inside kurta sets, and loafers can sit under formal or casual shoes but not sports shoes. Queries also contain regional words and misspellings that do not match category names. The system must cover every plausible intent without cluttering the results.

Example from the article: a user types "winter upper wear" and gets irrelevant results with little interaction, then retypes "Fleece jackets" and clicks jackets.

Solution in brief

Train a multi-label neural classifier that maps a query to a set of product categories. Training pairs (query, categories) are generated automatically from search-session reformulations and from catalog attribute combinations. fastText embeddings handle noisy spelling, and an interaction layer between words and class vectors produces the multi-label output.

Questions this case answers
  • How to classify short, ambiguous and misspelled text queries into several overlapping classes when no labeled set exists and click logs cover only the popular classes
  • How to bootstrap supervised training data for a multi-label text classifier from behavioral logs and structured item attributes
  • How to map short, vague or misspelled search queries to the right product categories?
  • How to build training data for a query-to-category classifier without manual labeling?

Tools and methods

  • Reformulation mining — stitches queries of one session to the products clicked after the final query, giving labels for tail queries.
  • Catalog-based synthetic queries — attribute and brand-category-gender combinations paired with product categories, for categories with little traffic.
  • fastText — skip-gram word embeddings with character n-grams, trained on a custom e-commerce corpus.
  • Bidirectional GRU — turns word embeddings into contextual ones.
  • EXAM-style interaction layer — cosine interaction between contextual word embeddings and class embeddings, sigmoid output.
Continue reading — it's free

Google or a one-time email code. No password.