Restaurant linking

With the data fully labeled by LLMs, a surprisingly difficult challenge emerged, which was linking restaurants. In other words, I have a ton of posts and comments, many of which mention the same restaurants. How do I group mentions of the same restaurant together, so they point to the same object in the database?

I ended up putting an ad-hoc solution together for this. Considering I had over 47,000 restaurant mentions, there was no way I could review each one by hand. The following is the set of steps I followed to match restaurants to comments/posts, and group them together:

  1. Deterministic grouping. I started with a simple string matching algorithm, to find common variants, normalizing across lowercase, accents, apostrophe/quotes, etc. For example: L'industrie vs Lindustrie vs L'industrie's etc.
  2. Review floor. Due to volume and to ensure accurate matches, I ignored any matched groups with < 10 mentions, reducing the number of groups from 47,000 to 7,000. Much easier!
  3. Agent proposals with human review. I used further fuzzy matching to merge more pairs together, and then relied on Opus agents (via Claude Code CLI) to review them.
  4. Ambiguous name clarification. I knew right off the bat a lot of these matches were incorrect. For example, take a restaurant like "Joe's". There's probably many restaurants with this name, and many variations such as "Joe's Diner" or "Joe's Pizza", etc. that incorrectly got matched with other Joe's. For these, I used agents to examine individual mentions, and make educated guesses as to which were referring to the same restaurant, and which would be referring to others with a similar enough name.
The restaurant triage app: 47,653 candidate restaurants from 554,893 raw mentions, with a mention-count histogram, search and status filters, and per-restaurant approve/reject controls showing variant spellings and mention counts

The triage app over the full 3-year corpus: 47,653 candidate restaurant names from 554,893 raw mentions, each grouped with its variant spellings (L'Industrie alone has 42) and post/comment mention counts, awaiting approve/reject review.

Triage search for 'katz' returning 16 separate candidate groups for the same restaurant: Katz's with 3,501 mentions and 12 variants, Katz's Deli with 617, Katz Deli with 179, Katz Delicatessen with 35, plus a tail of one- and two-mention fragments like Katz DeKalb and A Taste of Katz's

The fragmentation problem: a search for "katz" surfaces 16 separate groups that are all (almost all) the same restaurant — Katz's (3,501 mentions), Katz's Deli (617), Katz Deli (179), Katz Delicatessen (35), and a long tail of one- and two-mention fragments.

Once I had these, I exported them and then used another Opus based agent along with the Google maps API to make accurate guesses about what the restaurant would link to.

The audit round

This alone was not enough, since there were still a lot of mentions in our database linked to the wrong restaurant. As a result, I had an audit round to identify these, mostly by feeding EVERY mention into Claude Code along with the corresponding context and restaurant information. Below are the following steps:

  • Pin census: every one of the ~5,100 pins was checked against the restaurant's actual Reddit quotes ("do these comments describe this listing?"). 95% verified clean; the ~195 contradictions went through a repair pass.
  • Ambiguous-name sweep: the ~230 restaurants with genuinely confusable names (Joe's, Patsy's, Lucia, Tatiana) got a mention-level re-read — 48,000 in-context judgments. About 1% of their mentions were credited to the wrong same-named restaurant; those were individually re-reviewed and corrected.
  • Shared-address pass: restaurants whose pins landed at the same street address surfaced duplicates to merge (Veselka / Vaselka) and dead predecessors still wearing their successor's pin (the Four Seasons space is The Grill now; Prosperity Dumpling's is King Dumpling's).