Sub topic 6
Normalizing and Matching Names
This chapter assumes you know what sanctions and watchlist screening is, and that you can read short Python. It covers the step before screening: making two spellings of a name comparable.
Why names need normalizing
A watchlist entry and a customer record often describe the same person in different ways. One system stores "José García-López". Another stores "JOSE GARCIA LOPEZ". A strict text comparison treats these as different people, so a real match is missed. Normalizing means converting names to one standard form before you compare them.
Common sources of variation include:
- Upper and lower case.
- Accents and other diacritics, such as é or ñ.
- Hyphens, apostrophes and extra spaces.
- Name order, such as "Garcia Lopez, Jose" and "Jose Garcia Lopez".
- Transliteration, which means writing a name from one alphabet in another. The same Arabic or Cyrillic name can have several Latin spellings.
A normalization function
The function below handles case, accents, hyphens and spacing.
import unicodedata
def normalize(name):
"""Lowercase a name, remove accents and hyphens, and collapse spaces."""
decomposed = unicodedata.normalize("NFKD", name)
stripped = "".join(c for c in decomposed if not unicodedata.combining(c))
return " ".join(stripped.casefold().replace("-", " ").split())
print(normalize("José García-López"))The printed result is jose garcia lopez. The steps work like this:
NFKDsplits an accented letter into a base letter plus a separate accent mark.- The generator expression drops the accent marks, which Unicode flags as "combining".
casefoldlowercases the text. It is stricter thanlowerfor some languages.- Replacing hyphens with spaces, then splitting and rejoining, removes repeated spaces.
Exact matching and its limits
After normalization, an exact comparison catches many true matches. It still misses others:
- Spelling variants, such as "Mohammed" and "Muhammad".
- Typing errors in the customer record.
- Reordered or missing name parts, such as a middle name that appears on only one side.
- Nicknames and short forms.
Screening systems therefore use fuzzy matching. This scores how similar two names are and flags pairs above a threshold. A low threshold produces more alerts, including many false positives, which are alerts about different people. A high threshold produces fewer alerts but raises the risk of a false negative, which is a real match that goes unflagged. The firm sets the threshold according to its risk appetite and documents the reason.
Using other data to decide
A name match alone rarely settles anything. When the system raises an alert, the reviewer compares other attributes with the watchlist entry:
| Attribute | What it tells you |
|---|---|
| Date of birth | Often rules out a different person with the same name |
| Nationality or country | Supports or weakens the match |
| Identifier numbers | A passport or ID number match is strong evidence |
| Aliases listed on the entry | Explains an unusual spelling |
Where this fits in screening
Common errors
- Normalizing in one system but not the other.
- Removing characters that matter. For example, stripping every non-Latin character from a name can leave an empty string.
- Clearing an alert without recording why. Keep the reasoning for the audit trail.
- Relying on a high threshold to reduce workload when the real problem is poor data quality.
Exercise
A customer is recorded as "Zoë O'Brien-Smith" and a watchlist lists "ZOE OBRIEN SMITH". Your normalize function removes accents, lowercases and turns hyphens into spaces, but does nothing with apostrophes. Will exact matching find the pair? What small change fixes it?
Show answer
No. The customer name becomes "zoe o'brien smith" and the watchlist entry becomes "zoe obrien smith", so the apostrophe makes them differ. Replace or delete apostrophes in the normalization step, for example by adding .replace("'", "") before splitting. Then both names become "zoe obrien smith".