The Collective Supply: How we use Apache Spark to optimize Agoda's Inventory

Desmond Chay7 Feb 2023

Problem

Agoda sells rooms from its own contracts and from third-party suppliers. Each supplier names the same physical room differently, so one hotel page shows duplicates under unrelated names. Wrong merges are costly: a mismatch can make rooms unsellable. Photos are not always available and room size is recorded in different ways, so no single attribute is enough.

Example from the article: a boutique hotel in Singapore lists generic names (Standard, Superior, Deluxe) on Booking.com, a mix of generic and themed names such as "The Reading" on Agoda, and themed names on its own site. "Superior Double or Twin Room" and "The Reading" are the same room, as photos and size show.

Solution in brief

A supervised decision-tree model trained in Spark predicts which room (and hotel) pairs are likely the same. A hand-made regular-expression database removes pairs that break business rules. A "flatten" step then collapses chains of matches so each room appears once, with the rates of all matched rooms attached.

Questions this case answers
  • How to merge duplicate listings of the same physical item from many partners whose naming and attributes are inconsistent, when all-pairs comparison is too large to run
  • How to turn pairwise match predictions into one canonical record per entity when matches form chains
  • How to match the same hotel room sold by several suppliers under different names?
  • How to avoid showing duplicate room listings when third-party inventory is added to a marketplace?

Tools and methods

  • Apache Spark — distributed batch processing for the matching jobs
  • Decision-tree classifier — predicts which candidate pairs are the same room or hotel
  • Regular-expression rule database — vetoes pairs that break business rules
  • Manual verification loop — verified results retrain the model
  • Flatten (graph step) — resolves match chains into a single target per room
  • A/B test — measures the value of matching
Continue reading — it's free

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