Case study · Solo project

Onoma Trace

Ranks the likely countries of origin for a romanized name across 104 countries — and is loud about why that guess is weak.

scikit-learnTF-IDFGradioMatplotlib
Onoma Trace — Product shot — ranked country output

01 — Problem

The source data is aggregated frequency counts of name tokens per country — roughly 12.4M forename rows and 21.1M surname rows — with no full-name records anywhere in it. Training a classifier that takes 'First Last' at inference therefore needs full names that do not exist in the input, and the task itself is genuinely ambiguous: 'ali ali' legitimately appears in 30 of the 104 countries.

02 — Approach

Five runnable pipeline stages — EDA, preprocess, train, evaluate, predict — each invokable on its own and chained by one entry point. Preprocessing synthesises realistic full names by sampling forenames and surnames weighted by their real per-country counts, so name popularity is preserved while matching the inference contract. Names are NFD-decomposed, accent-stripped and reduced to a-z before char n-gram TF-IDF feeds three linear classifiers. Evaluation reports a set-lenient score alongside the strict one to separate real model error from irreducible name ambiguity.

03 — My role

Solo. Built the full pipeline and the Gradio Space, including the name-synthesis step and the ethics notice that fronts the demo.

Solo project

Results

Logistic Regression is the served model at 0.500 macro-F1 and 51.1% top-1, rising to 69.3% top-3 and 77.1% top-5 — the ranked output is where the model is actually useful, not the single best guess. Set-lenient scoring adds about 4 points, which bounds how much of the error is just names that honestly belong to several countries. Easiest countries are the linguistically isolated ones (Iceland, South Korea, Cambodia); hardest are high-immigration and shared-script countries where names cross borders freely. The Space doubles as a walkthrough, replaying each pipeline stage's logs and plots.

104

Countries

69.3%

Top-3 accuracy

0.500

Macro-F1

Demo recording

Screen recording — the Gradio Space ranking a name

Next projectAirBlocks