Sub topic 6
Normalizing and matching names
This chapter covers how a firm prepares a customer's name for comparison with sanctions lists, PEP lists and its own records. It assumes you know what screening is for (the next chapter covers it in detail) and that you can read short Python programs.
Why names are a hard data problem
A name looks like simple text, but the same person appears under many spellings. The customer's passport, the application form and a sanctions list may each record the name differently. If screening only looks for identical strings, it misses real matches. If it is too loose, it floods analysts with false alerts.
Name matching sits between identification and screening because screening quality depends on it. A weak match step undermines the sanctions and PEP checks that follow, however good the lists are.
Common sources of variation:
| Source of variation | Example | Effect on exact matching |
|---|---|---|
| Case and spacing | `GARCIA Lopez` and `Garcia Lopez` | Mismatch |
| Accents and diacritics | `José García` and `Jose Garcia` | Mismatch |
| Hyphens and punctuation | `García-López` and `Garcia Lopez` | Mismatch |
| Name order | `Lopez, Jose` and `Jose Lopez` | Mismatch |
| Transliteration | `Mohammed`, `Muhammad`, `Mohamed` | Mismatch |
| Nicknames and short forms | `Alexander` and `Sasha` | Mismatch |
| Missing or extra parts | `Jose Garcia` and `Jose Garcia Lopez` | Mismatch |
| Typing errors | `Garcai` for `Garcia` | Mismatch |
Normalization removes the first three kinds of variation with fixed rules. Matching techniques then handle the rest by scoring how similar two names are.
Step 1: normalize
Normalization turns both names into one canonical form before comparison. Apply the same function to the customer name and to every list entry. If the two sides are processed differently, the comparison is meaningless.
A typical sequence:
- Decompose accented characters into a base letter plus a combining mark (Unicode form NFKD).
- Drop the combining marks.
- Convert to a case-insensitive form with
casefold. - Replace hyphens and other punctuation with spaces.
- Collapse repeated whitespace.
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 program prints jose garcia lopez.
casefold is stronger than lower. For example, it maps the German ß to ss, which helps when comparing across languages.
Limits of simple normalization
This function is a starting point, not a complete solution.
- It does not handle commas.
Lopez, Josekeeps its comma, so it will not equallopez jose. Real pipelines treat all punctuation as a separator. - NFKD does not decompose every letter.
ø,đandłhave no decomposition, soSørenstayssøren. Add an explicit mapping table for such letters. - It does not transliterate. Names in Arabic, Cyrillic or Chinese script pass through unchanged. Matching them against Latin-script list entries needs a transliteration step, and that step introduces its own spelling variants.
- It discards information. Removing accents can merge two genuinely different names. This is acceptable in screening, where the cost of missing a match is higher, but keep the original name for the record and for analyst review.
Step 2: make the comparison order-independent
Name order differs between cultures and between data sources. A simple fix is to split the normalized name into tokens (the words) and sort them. Lopez Garcia Jose and Jose Garcia Lopez then produce the same sorted token list.
Sorting loses the distinction between given name and family name. This is a deliberate trade: it accepts a few extra false alerts in return for fewer missed matches.
Step 3: score similarity
After normalization, compare the two strings with a similarity score between 0 and 1. The example below extends the earlier function. It treats any non-alphanumeric character as a separator, then sorts tokens and uses Python's difflib ratio.
import unicodedata
from difflib import SequenceMatcher
def normalize(name):
decomposed = unicodedata.normalize("NFKD", name)
stripped = "".join(c for c in decomposed if not unicodedata.combining(c))
folded = stripped.casefold()
return " ".join("".join(c if c.isalnum() else " " for c in folded).split())
def token_sort(name):
return " ".join(sorted(normalize(name).split()))
def similarity(a, b):
return SequenceMatcher(None, token_sort(a), token_sort(b)).ratio()
print(round(similarity("José García-López", "Lopez Garcia, Jose"), 2))
print(round(similarity("Mohammed Al-Rashid", "Muhammad Al Rashid"), 2))The first line prints 1.0. After normalization and sorting, both names become garcia jose lopez. The second line prints 0.89. The two transliterations differ by two letters, so the score is high but not perfect.
Whether 0.89 counts as a match depends on the threshold your firm sets.
Other matching techniques
Character-based similarity is one tool among several. Production systems usually combine them.
- Exact match on the normalized form. Fast and gives no false alerts from fuzziness. It catches only the variation that normalization removes.
- Edit distance. Counts the single-character insertions, deletions and substitutions between two strings. It handles typos well.
- Phonetic keys. Algorithms such as Soundex or Metaphone map names that sound alike to the same code. They help with transliteration variants but are tuned to English and perform poorly on many other languages.
- Alias and nickname tables. A lookup that expands
MohamedorAlexanderto known variants. Many sanctions lists already include aliases, so check both the primary name and every listed alias. - Token-level partial matching. Allows a match when most tokens agree and one is missing, such as a middle name.
Choosing and tuning thresholds
The threshold is a risk decision, not just a technical setting.
- A low threshold catches more true matches but produces many false positives. Analysts spend time on alerts that clear, and review quality can drop under volume.
- A high threshold produces fewer alerts but risks missing a genuine match. For sanctions, a miss can mean a breach of legal obligations, so firms generally accept more false positives.
Good practice:
- Test the setting with a sample of known matches and near-matches, and record the results.
- Document why the threshold was chosen and who approved it.
- Re-test when lists, systems or customer populations change.
- Do not set different thresholds for different customers without a documented, risk-based reason.
Reducing false positives with secondary identifiers
A name alone rarely proves identity. When a name alert fires, analysts compare other attributes from the customer profile against the list entry:
- date of birth or year of birth
- nationality and country of residence
- place of birth
- any identifying numbers on the list entry
A matching name with a clearly different date of birth is usually a false positive. A matching name with missing or partly matching data is not clearable on that basis. Treat it as unresolved and ask for more information or escalate. The analyst should record which attributes were compared and what the conclusion was, so a reviewer can follow the reasoning later.
Common errors
- Normalizing the customer name but not the list names, or the reverse.
- Matching only the primary list name and ignoring aliases.
- Assuming one transliteration is the "correct" one.
- Clearing an alert because a date of birth is absent, rather than because it differs.
- Changing thresholds to reduce alert volume without testing or approval.
- Discarding the original name after normalization.
Exercise
A customer's name is entered as "Søren Ødegård". Your normalize function from this chapter returns "søren ødegard". A list entry reads "Soren Odegard". Why does the match fail, and what are two ways to fix it?
Show answer
NFKD decomposition removes the accent from "å" (giving "a") but does not decompose "ø", so the letter stays as "ø" and differs from "o". Two fixes: add an explicit character mapping (for example "ø" to "o") to the normalization step, or add a fuzzy matching step with a threshold that tolerates a one-character difference. Using both is common, and the explicit mapping is more predictable. Whichever fix you choose, apply it to both the customer names and the list names, and keep the original spelling for the record.
Exercise
An alert shows a 0.93 name similarity between your customer and a sanctions list entry. The customer's date of birth is 1974, and the list entry has no date of birth. Can the analyst clear the alert? What should happen next?
Show answer
No. A missing date of birth on the list entry cannot show that the people differ, so the alert stays unresolved. The analyst should compare other available attributes such as nationality, place of birth and any identifiers, and request more information if needed. If the analyst cannot rule out a match, they escalate it under the firm's sanctions procedure and record what was checked.