Skip to content

Add an ORCID surname table to the group suggester (#1364) - #1484

Merged
derek73 merged 2 commits into
masterfrom
claude/issue-1364-suggester-surname-table-8f9bbc
Nov 19, 2026
Merged

derek73 merged 2 commits into
masterfrom
claude/issue-1364-suggester-surname-table-8f9bbc

Conversation

@derek73

@derek73 derek73 commented Nov 19, 2026

Copy link
Copy Markdown
Owner

Closes #1364

Option (B) from #1364: a mirror of the given-name table built from ORCID's family-name boxes. It is a private table that only the group suggester reads. No parse moves, and the snapshot and agreement records are byte-identical.

What changes

Recipe figures

Measured over the orcid-researchers cache (ORCID 2025-10-17 file, sha256 b95ffd68…):

Step Words
Family-box words with ≥100 uses 1,812
…with two or more letters and no full stop 1,783
…with a given-box share ≤5% 578
…less 14 romanized surnames (no given names) 564
…less the refusals: den, der, 김, 이, кызы (shipped) 559

The issue measured 1,776, 578 and 565 on 2026-11-12, under an earlier spelling and given-name table. At 12% the table is 942 words.

Measured

Command: tools/differential/suggest_measure.py --wrong-words 12, one --json run per arm (master 6560abd via --tree, this branch, and the 12% table via --tree). 300 groups a size, seed 20261110. Two sets of sizes: the default 2–200, and 2–2,000.

1. Same-order rows (the anti-goal).

  • At 5%, no cell outside the standing exceptions falls below 99.0% at any size.
  • orcid-byline given-first under a given-first base rises: 95.3 → 98.7% at 100 names, so it is no longer an exception.
  • orcid-byline-joined (94.7 / 93.3% at 50 / 100 names) and orcid-givcaps read exactly as on master.
  • At 12% the lowest such cell is 98.0% (PatentsView Brazilian, family first under a family-first base).
  • New exception, pv-listed-given: a list of nothing but given names that the table lists as surnames (606 names, mostly US inventors named Clarke, Cooper, Burke, Murphy, plus Spanish surnames typed into the given box). It fails both same-order rows at every size, and reads 0% from 5 names. This is the cost the issue's option text accepted. In mixed lists it does not show: PatentsView's US inventors cast 13 wrong surname votes in 3,000 names, both on master and at 5%, and their same-order rows read 100%.
  • I looked for given-first lists moved by given names that are surnames elsewhere (Santiago, Cruz, Alonso). pv-surname-given was added to hold them, and its same-order rows read 99.7% or more at 5%.

2. Spanish lists written family first under a given-first base, at 2 / 3 / 4 / 5 names

Population master 5% 12%
PSC Spanish 35 / 58 / 82 / 84 44 / 68 / 86 / 90 45 / 71 / 87 / 91
PV Spanish 36 / 63 / 78 / 85 49 / 71 / 84 / 90 50 / 72 / 84 / 90
PV Mexican 31 / 52 / 73 / 84 47 / 66 / 80 / 90 48 / 69 / 84 / 93
PV Colombian 40 / 75 / 83 / 94 59 / 83 / 88 / 93 62 / 85 / 90 / 97
PV Argentine 40 / 69 / 85 / 94 46 / 74 / 87 / 94 ≈ 5%

Portuguese and Brazilian lists.

  • At 5%, they stay within a point or two of master everywhere.
  • At 12%, lists written given first under a family-first base rise sharply. PSC Brazilian at 2–5 names goes from 41 / 74 / 79 / 90 to 63 / 89 / 94 / 99%.
  • At 12%, lists written family first under a given-first base fall at 10 and 20 names. PV Brazilian goes from 86 / 98 to 82 / 90, so it is read right from 50 names, not 20.

3. Indian, Nigerian, Turkish, Bangladeshi, Pakistani and Filipino lists. At 5% they move within a point, mostly up. Japanese lists and PSC's Filipino filers are now read right from 10 names, not 20.

Size from which a row written against its base reads ≥95% (master → 5% → 12%), where it moves:

  • orcid-byline given first under a family-first base: 2,000 → 500 → 200.
  • orcid-byline-joined family first under a given-first base: 200 → 100 → 50.
  • PSC Filipino and Romanian: 20 → 10 → 10.
  • PSC Spanish (given first) and PV Argentine (family first): 10 → 5 → 5.
  • Japanese (both ways): 20 → 10 → 10.
  • PV Brazilian, family first under a given-first base: 20 → 20 → 50.

Per name (237,268 names, all populations, both writings, pv-listed-given apart):

  • Right surname votes: 26,339 → 37,881 at 5% (+11,542), and 50,283 at 12%.
  • Wrong surname votes: 1,192 → 1,807 at 5% (+615, 5.1% of the added votes), and 2,748 at 12%.

Whole names (given and family against the boxes; 21 populations × both writings × three bases, at 2 / 5 / 20 names): every same-order cell is within 1.0 point of master at 5%, and within 2.5 points at 12%.

Parliaments: no list's order, rule or capitals decision moves under any of the three bases, and the TURKIC table is unchanged.

4. Harness proof. With --set _MIN_VOTES=1000000 --set _MIN_PATRONYMIC_VOTES=1000000 --set _MIN_RUN_NAMES=1000000, all 86 rows written against their base read 0%, all 86 written in it read 100%, and no parliament order is decided.

Cutoff: 5%, and why

12% helps Portuguese and Brazilian lists written given first, and Indian lists (sharma, patel and gupta enter the table). But it costs Brazilian and Portuguese lists written family first at 10 and 20 names, and pushes PV Brazilian's size from 20 to 50. Those losses may be an artifact: PatentsView's and PSC's boxes put the first of two surnames in the given box (Ramirez Ismael Ortiz), a writing no real list uses, and the listed second surname then votes against it. That is reasoning, not a measurement, so I shipped the tighter cutoff and recorded 12% as open.

Open questions

  • The 12% share. Is the family-first loss a real cost or only how the boxes are composed?
  • pv-listed-given's cost: English given names that ORCID's holders rarely type as given names (Cooper, Burke). Only a given-name source cleared for use could take them out of the table.
  • The census table for English (option A) stays held until a real family-first list without commas is found.
  • A typographic apostrophe (O’Brien) is counted under its own spelling, as in the given names.

For #1452

COMMON_SURNAMES can serve the future two_family_names vote (a listed surname second-to-last, with another name word after it), with three cautions:

  • Use COMMON_SURNAMES, not SURNAMES: in a Chinese name the second-to-last word is a given-name syllable.
  • The table counts a family word anywhere in the box, so it holds second surnames (lopez beside garcia). But it also holds surnames from many languages, so a listed word is not evidence of a Spanish list on its own.
  • The tool's populations put the first surname in the given box for some Spanish-language records, which a measurement of that vote has to account for.

Checks

uv run pytest (50,979 passed), uv run pytest -n0 -m serial, uv run mypy, uv run ruff check, and uv run sphinx-build -b doctest docs <tmp> all pass, on the head rebased onto master d12af9d. Every new test row was run against the pre-change code to see it fail where it should.

Review aspects run

  • pr-review-toolkit:code-reviewer: first build; then the fix commits; then the last fix commits. Each round found something; the FAMILY_FIRST_GIVEN_LAST regression and the over-narrow fix to it are both fixed.
  • pr-review-toolkit:silent-failure-hunter: population filters, box swaps, the base reading the tree's table, per-spelling counts. All fixed.
  • pr-review-toolkit:pr-test-analyzer: edge rows for the veto, full stop, comma, post-nominal, NFD, the filter edges, the fold and the swap. All added.
  • pr-review-toolkit:comment-analyzer: 14 findings, fixed.
  • design-docs-reviewer: stale pointers, head notes, the floor count, the recipe's flags. All fixed.
  • Not run: type-design-analyzer (no new types) and code-simplifier.

🤖 Generated with Claude Code

COMMON_SURNAMES: every word ORCID's holders typed in the family-name box
100 times or more and in the given-name box in at most 5% of their uses,
less the other tables' words, the titles and suffixes the given names
refuse, the lexicon's particles, conjunctions, bound given names, maiden
markers and Hangul surnames, and the Turkic patronymic markers: 559 words,
mostly Spanish. It votes with the romanized table as SURNAMES, under the
surname signal's rules. Where a decided East Slavic rule meets a
family-first order the votes decide, a FAMILY_FIRST_GIVEN_LAST base gets
FAMILY_FIRST, whose reading leaves the patronymic where it is written.

suggest_measure.py gains Spanish-, Portuguese- and Filipino-language
populations and two of given names that are surnames (pv-surname-given,
pv-listed-given). Measured at 5% and 12%; 5% ships, 12% is open
(decisions/group-suggestion, 2026-11-19 #1364). No parse moves.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@derek73 derek73 added this to the 3.2 milestone Nov 19, 2026
@derek73 derek73 added vocabulary Fixed by a word-list entry: per-word vocabulary and language packs name-order Name order, family-first and two family names (rules/O) suggester The group suggester: Parser.suggest() and its signals labels Nov 19, 2026
@derek73 derek73 self-assigned this Nov 19, 2026
…a checkout (#1364)

_script_tables loads nameparser/config/_order_names.py by its checkout
path, which the installed-package layout does not hold.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@derek73
derek73 merged commit c5e58aa into master Nov 19, 2026
14 checks passed
@derek73
derek73 deleted the claude/issue-1364-suggester-surname-table-8f9bbc branch November 19, 2026 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

name-order Name order, family-first and two family names (rules/O) suggester The group suggester: Parser.suggest() and its signals vocabulary Fixed by a word-list entry: per-word vocabulary and language packs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Should the group suggester read common surnames outside East Asia? (Smith John, Jones David, Brown James gets no suggestion in either order)

1 participant