Conversation
Mixed text/MathJax extraction stored the same math fragment twice in some titles (e.g. \gtrsim 100\times\gtrsim 100\times, z=1.37z=1.37). Add a conservative cleanup helper used at seed time and startup backfill, plus regressions for the issue aiming-lab#16 fixtures. Fixes aiming-lab#16 Co-authored-by: Xuanrui Li <xuanrui.li@se24.qmul.ac.uk>
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Some arXiv mirror titles were scraped with mixed text/MathJax extraction, so the same math fragment was stored twice (
\gtrsim 100\times\gtrsim 100\times,z=1.37z=1.37,\mathbb{P}^1\mathbb{P}^1, and similar).This change adds a conservative cleanup helper that only collapses clear adjacent duplicates. It does not rewrite unrelated titles, does not convert TeX to Unicode, and does not touch display templates.
sites/arxiv/metadata_cleaning.pyshared by seed-time import and startup backfillseed_database()cleans title/abstract/comments/journal-ref while importingpapers.jsonnormalize_paper_metadata()backfills already-packaged DB rows on startup (no-op commit when nothing changed)sites/arxiv/tests/Example (
/abs/2604.07983):becomes
Fixes #16
Lineage
Rebased onto current
aiming-lab/WebHarbormain(cb9a9b0) after syncing the Lxr-max fork. Supersedes the stale fork PR #119 (same approach, old base145b200). Distinct from #17, which also rewrites display templates to Unicode.Checklist
K_{11,11}, “Cone Conjecture”, “Command and Control”, …)^{\prime\prime}and\log \logis preserveddb.session.commit()when no fields change (byte-identical reset on an already-clean DB)sites/arxiv/tests/Test notes
Result: 10 tests, all OK (stdlib unittest; no extra deps).
Covered:
2604.07983,\mathbb{P}^1,\mathcal{N}=1,GL(d_1)\times GL(d_2),\mathrm{GL}_4, isotope/ion fragments)papers.jsontitles/abstracts/commentsseed_databaseandnormalize_paper_metadata()both call the helper; normalize runs beforebackfill_paper_gaps()papers.jsoncorpus (including\mathcal{F}\mathcal{F},(D+1)(D+1),WSe_2_2,^{173}^{173}Yb^+^+)Note: packaged
instance_seed/arxiv.dbrows stay dirty until the asset bundle is regenerated. Startup backfill rewrites those rows so the running site is clean; after a cleaned seed DB is shipped, the backfill becomes a no-op and reset byte-identity holds.Please close or supersede #119 once this lands so the stale September rebase is not merged on top of current main.