ai-coding-minesIndexGitHub

Name matching without a score causes incidents where money is involved

Python and databases

Three in a row

  1. Searched by Korean product name, matched the wrong product → a different item was delivered
  2. Variants matched to each other → recommended prices off by 5×
  3. Similarity fallback at 0.80 matched sibling products → an item priced around ₩100,000 got a target price around ₩900,000

Signal of mismatch

The same target value repeating 5+ times is a mismatch. One value actually repeated 15 times.

Fix

Warning: raise the threshold and the other side blows up

Raising 0.80 → 0.92 to stop mismatches exploded the unmatched count (over half of 3,000 came back "cost unknown"). The real cause wasn't the threshold; it was that there was no direct lookup path at all. An indexed direct path comes before similarity matching.

★ If the direct-lookup index doesn't auto-include new registrations, switching to the direct path returns the same result. Refresh the index before switching paths.

Unlinked beats mislinked. Unlinked means "I don't know." Mislinked means "I believe a wrong thing is known."

Why this bites non-ASCII users

Fuzzy-matching libraries and their default thresholds are tuned on Latin-script data. Korean product names are short, dense, often written without spaces, and the same product appears with mixed Hangul / Latin / digits across sellers. Edit distance behaves differently on syllable blocks than on letters, so a threshold that is "safe" for English is loose for Korean. Calibrate on your own script; don't borrow the number.

Partial matching feeding a metric shown on screen turns a wrong value into a wrong decision

A shipping bot attached cost by partial name match, and a margin of -101% landed on screen as-is. Margin is a number a person acts on where they see it, so a wrong value is a wrong decision.