Problem
Zomato needed customer embeddings built from order history to power restaurant recommendations. GraphSAGE, a graph neural network, took about 20 hours to train on the National Capital Region (NCR) data alone, so every experiment is slow. A graph embedding of customers and restaurants is also hard to use directly: the two node types land in separate regions, so a customer-to-restaurant dot product cannot rank restaurants.
Illustrative example: a customer who ordered from two restaurants needs a single vector that can score every other restaurant, with recent orders counting more than orders from a few months ago.
Solution in brief
Cleora, an unsupervised graph embedding that averages neighbour vectors, produces restaurant embeddings in under 5 minutes. EMDE then hashes each restaurant embedding into a fixed-size sketch, sums a customer's sketches into one vector, and a feed-forward network learns to predict the sketch of the next ordered item. Candidates are ranked by their score against the predicted sketch.
Questions this case answers
- How to represent a user as one fixed-size vector from a variable-length list of interacted items so that items can be ranked against it
- How to learn embeddings on a large bipartite interaction graph when graph neural networks are too slow to train
- How to build customer embeddings from order history that can rank restaurants for a recommendation feed?
- How to embed a customer-restaurant graph in minutes instead of hours?
Tools and methods
- Cleora — unsupervised node embeddings on the customer-restaurant graph, from graph structure alone
- EMDE (Efficient Manifold Density Estimator) — compresses a customer's item embeddings into one sparse vector
- Locality-sensitive hashing (LSH) — builds the item sketches
- Feed-forward neural network — maps the customer sketch plus customer features to the next-item sketch
Google or a one-time email code. No password.