Log inBook a Demo
BuildSeniorData / MLAuto-graded

Catch duplicate customer records that aren't exact matches

The same customer typed two ways stays as two records, and loosening the threshold makes matching stricter. Make similar records merge and put each one in exactly one group.The customer-records deduper should merge the same person or company typed in different ways. In production, Jon Smith and jon smith stay two customers while unrelated companies get merged, a change meant to loosen matching made it stricter, and one record showed up in two groups at once. Fix dedup(records, threshold) in dedup.py so near-duplicates merge, distinct records stay apart and every record lands in exactly one group. The team's similarity metric and clustering rule are documented at the top of the file.
45 min
python

You're done when

  • Every record appears in exactly one group.
  • Case, punctuation and spacing variants of the same name end up in one group.
  • Accented spellings and small typos join their plain counterparts.
  • Records connected only through an intermediate spelling end up in one group.
  • A pair scoring below the threshold stays apart.
  • Records that match nothing stay in their own group.
  • The full grouping matches the expected result on the reference dataset.

What it measures

Data qualityTelling when two messy records are the same customer, and when merging them would lose information.
Data preparation and preprocessingNormalising case, punctuation and accents so records are compared on like-for-like text.
Data structures and algorithmsBuilding clusters through chains of matches while keeping each record in exactly one group.

Your environment

Terminal + editorA full shell in the browser
Coding agentAlready signed in, no API key to set up
Isolated workspaceOnly yours, wiped when you finish

Start this lab

45 min
Start labYou'll need to sign in to Anthropos first. The lab opens in a private cloud workspace with your coding agent ready to use.
AI Labs is part of Anthropos Workforce. Not on your plan yet? Book a demo