Sub topic 2
Preparing Names for Comparison
Assume you understand AML, customer due diligence, onboarding, payment processing, and basic Python. This chapter focuses on turning names into comparable values and reviewing the matches that result.
Normalize the source data
Names arrive with different capitalization, accents, punctuation, spacing, and word order. Normalization is a repeatable transformation that reduces these differences before comparison.
A typical process is:
- Apply Unicode normalization and remove accents.
- Convert text with
casefold(), which handles case differences. - Replace punctuation with spaces.
- Collapse repeated whitespace.
- Preserve the original value for audit and review.
import re
import unicodedata
def normalize(name: str) -> str:
decomposed = unicodedata.normalize("NFKD", name)
plain = "".join(c for c in decomposed
if not unicodedata.combining(c))
plain = re.sub(r"[^\w\s]", " ", plain.casefold())
return " ".join(plain.split())
print(normalize(" José O'Brien-Smith "))Normalization improves comparison, but it can also remove useful distinctions. Keep the original spelling and the normalization rules used.
Compare names and produce a score
An exact comparison checks whether normalized strings are identical. A fuzzy comparison gives partial credit for small spelling differences. A token-based comparison splits a name into words, sorts the words, and compares the result. This helps with “Mohammed Al-Sayed” and “Al Sayed, Mohamed.”
Phonetic methods, such as Soundex-like algorithms, compare pronunciation. They can help with transliteration differences, but they may produce many unrelated matches. Use them as an additional signal, not as the sole decision rule.
| Method | Useful for | Main risk |
|---|---|---|
| Exact | Identical normalized values | Misses spelling and order differences |
| Fuzzy or token-based | Variants and reordered names | More false positives |
| Phonetic | Similar pronunciation | Language and transliteration bias |
Tune thresholds and resolve alerts
A threshold is the minimum score that creates an alert. A low threshold catches more possible matches but increases false positives. A high threshold reduces analyst workload but can miss true matches. Tune thresholds by list, language, customer population, and risk, then test them against known matches and sampled non-matches.
Use secondary identifiers to investigate an alert:
- Date of birth
- Nationality or country of residence
- Government ID details
- Address
- Entity registration or ownership information
A mismatch may lower priority, but it should not automatically close an alert. A confirmed match requires the documented escalation and response process.
Exercise
Why should a date-of-birth mismatch usually lower an alert's priority rather than close it automatically?
Show answer
Source data can be missing, incorrect, or unavailable. The mismatch is evidence for review, not proof that the person is different.