Repository navigation
Backfill HF author claims, split namesakes and merge provable duplicates - #868
Conversation
Legacy imports bound every arXiv byline of a common name to the first HF account that claimed it, and paper_authors.claimed was only backfilled from HF's daily-papers list. Ingestion now never matches HF-linked rows by name, so the same person can also end up on two rows (e.g. /authors/181986 and /authors/251936, both Vik Paruchuri). backend/scripts/backfill_hf_author_claims.py fetches each affected paper's HF author list into a resumable JSON-lines cache (read-only, rate-limited), then replays it in phases that are rolled back unless --apply, reporting every change: - claims: replay through the daily claim sync - doubles: one link per byline slot (claimed, else name-only); same-name links at different positions are reported, never touched - split: unclaimed links of claimed accounts without a shared coauthor move to the byline name's name-only author; unsure names are skipped - merge: a name-only link moves to the only account with that name only on hard evidence (shared official repo, a coauthor with certain identity on both papers, or two distinctive name-only coauthors) - empty: delete paper-less name-only rows, aliasing their URL Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Applied to production on 2026-11-03 at 10:10 UTC, from commit 6c2d1f1, with phases
Verified live: /authors/251936 resolves to /authors/181986 (Vik Paruchuri), and /authors/266 (Yann LeCun) gained 2 papers from /authors/240744. Backup taken before the apply: Still open: finish the HF fetch, re-run the same four phases on the full cache, tune |
|
Second production apply, full HF cache (2026-11-03 17:30 UTC, same commit 6c2d1f1, phases The cache now holds 92,656 papers, all of them fetched.
The apply matched the dry run exactly. Smoke checks pass. Split not applied. The dry run would move 101,398 links off 12,177 rows:
Awaiting a decision on the split scope. |
A name with a single HF account may be that person's own unclaimed papers; the ungated rule would have stripped distinctive prolific authors such as Philip Torr and Yann LeCun. A second account proves namesakes exist. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Split applied in production (2026-11-03 18:21 UTC, commit 8391823, phases The split now moves only bylines that two or more HF accounts publish under. A name with a single account stays, since those may be that person's own unclaimed papers.
Example: Yang Liu ( Every phase of this PR has now been applied. It is a one-off backfill CLI, so merging it changes no running service. |
Why
hao-li, with 306 papers here against 19 on HF.paper_authors.claimedwas only backfilled from HF's daily-papers list. In a 300-link sample, a third of "unclaimed" links were in fact claimed by that account on HF.What
backend/scripts/backfill_hf_author_claims.pyis a one-off job with two steps.fetchcaches the HF author list of every latest paper that has an unclaimed link on an HF-linked row (about 92.6k papers) into a JSON-lines file. It is read-only on the database, rate-limited, backs off on 429, and resumes on rerun.runreplays the cache in phases. It rolls back unless--applyis passed, and every change goes to a--reportJSON-lines file:AuthorHfProfileSyncService.sync_paper, the same logic as the daily sync.author_aliasesentry pointing to the row that took their papers, else to a same-name author.Status
cavanloyandliuziwei7. The full fetch is running./authors/251936's paper tovikp(evidence: official repo) and aliases 251936 to 181986.Validation
uv run pytest backend/tests/test_author_claim_backfill_service.pypasses 12 tests.test_author_hf_profile_sync_service.pypasses 11.🤖 Generated with Claude Code
Note
High Risk
Bulk mutations to authors, paper links, and deletions with heuristic split/merge rules; PR notes split tuning still needed before production apply.
Overview
Adds a one-off migration to fix legacy Hugging Face author linkage: papers tied to the wrong HF account, missing
paper_authors.claimedflags, and duplicate name-only vs HF rows.backfill_hf_author_claimsexposes two steps:fetch(DB read-only) appends HF author lists for papers with unclaimed HF-linked links into a resumable JSON-lines cache, with pacing and 429/5xx backoff;runreplays the cache through ordered phases—claims via existingAuthorHfProfileSyncService.sync_paper, doubles (dedupe same-name links), split (move unclaimed namesake papers off HF rows), merge (move name-only links when repo/coauthor evidence is strong), empty (delete orphan name-only authors and wireauthor_aliases). Default is rollback (dry run);--applycommits per phase; every action is logged to--report.author_claim_backfill_serviceholds the HF client, SQL-heavy merge logic, andAuthorClaimCleanup. 12 unit tests cover claims, split/merge edge cases, doubles, empty cleanup, and fetch resume behavior.Reviewed by Cursor Bugbot for commit 8391823. Bugbot is set up for automated code reviews on this repo. Configure here.