Repository navigation
Seed images: ship the LTR retrained with image pages, and cap images at 2 per list - #636
Open
daoudclarke wants to merge 3 commits into
Open
daoudclarke wants to merge 3 commits into
daoudclarke wants to merge 3 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
daoudclarke
changed the base branch from
seed-images-prod-index
to
seed-images-prod-standard-display
November 11, 2026 11:01
daoudclarke
force-pushed
the
seed-images-prod-ltr
branch
from
November 11, 2026 11:01
d5a5122 to
bb0c420
Compare
…per list The model is #626's images_relevance arm: the deployed recipe plus the image rows, on the relevance >= 2 label (sha256 ea9ab57c...aa83). Cross-validation put it at +0.006 pass-3 NDCG@10 over today's recipe, and the holistic judge preferred a cap of 2 images per list to a cap of 1 or none. ImageCapRanker drops every Commons file page after the first MAX_IMAGES_PER_RESULT_LIST from the final order, after the LTR and MMR, so web results move up. Combined Search's ranker gets the same cap for consistency. Merge with or after PR 9's serving-time store lookup: the model scores Commons file pages higher than today's, and only that lookup keeps unchecked crawled ones out. No functional changes to the crawler. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
No functional changes to the crawler. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The cap now wraps ServedImagesRanker, so a Commons file the store doesn't vouch for is dropped before it can take one of the two slots. Super Search's merged list gets the same cap after its MMR. Tests that stub the inner ranker reach one level further in. No functional changes to the crawler. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
daoudclarke
force-pushed
the
seed-images-prod-ltr
branch
from
November 11, 2026 11:33
bb0c420 to
3b75bff
Compare
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.
From Claude:
Stack: PR 8 of the #610 plan, the production half. It builds on #637 (
seed-images-prod-standard-display, PR 9), which builds on #635. The evidence is the evaluation PR #626.Merge order: merge this after #637, which it is stacked on. The new model gives Commons file pages a higher score than today's model does. #637's serving-time store lookup (
ServedImagesRanker) is what stops a crawled Commons file page that the NSFW judge never checked from getting that boost: it drops every CommonsFile:URL that isn't approved in the store. Without it, a crawled, unchecked Commons page could rank higher than it does today.What changed
mwmbl/resources/model.xgb, whichRUST_MODEL_PATHpoints at, is now Seed images: evaluate retraining the LTR with image pages, and a per-list image cap #626'simages_relevancemodel.ea9ab57c784fdac735327d0b321795afa7507bd49d7ece7846bc91caeaacaa83(it wasb6f81657…5d84).relevance ≥ 2in place ofoverall ≥ 6. The feature set is the same 50 features, with nois_imagefeature, so the Rust extension is unchanged.DATABASE_URL="postgres://daoud@" DJANGO_SETTINGS_MODULE=mwmbl.settings_dev uv run python -m mwmbl.rankeval.seed_images.ltr_retrain train images_relevancesearch_setup.ltr_model), so its ranking moves too.mwmbl/tinysearchengine/image_cap.pyaddscap_imagesand anImageCapRankerdecorator.commons.commons_file_keyrecognises as a Commons file page, which covers the mobile site,index.php?title=andImage:URLs. Other Commons pages, such as categories, don't count.MAX_IMAGES_PER_RESULT_LISTfiles (a new setting, 2) and drops the rest, so the web results below them move up. A second URL for a file already kept is dropped as well, so one picture can't take both slots.ServedImagesRanker, which wrapsMMRRanker:ImageCapRanker(ServedImagesRanker(MMRRanker(LTRRanker(…))), cap). So it runs after the LTR, MMR and the store's check, and a file the store doesn't vouch for is dropped before it can use a slot. It keeps theImageDocuments that the store's check returns as they are. No server code cuts the list to ten; callers take the top ten from it, so the cap applies before that cut. It covers the v1 and v2 search APIs, the web page and Super Search'smwmbl_indexsource. Super Search's merged final list gets the same cap too, after its MMR and Show indexed Commons files in search only as the image store vouches for them #637's check./rawis left uncapped.ServedImagesRanker(JevRanker(…))), for consistency. The cap there runs before the strip's images are removed from the web results. So a web list can show at most 2 images, and fewer when the strip already shows them. The cap was not evaluated for Combined Search. Seed images: evaluate retraining the LTR with image pages, and a per-list image cap #626 evaluated it with standard search's ranker only, and Combined Search keeps its own, unchanged model. It is there for consistency only.Why
#626's recommendation was the
images_relevancemodel with at most 2 images per list.Checks
test_the_configured_model_loads_and_scoresloadsRUST_MODEL_PATHand scores documents throughRustXGBPipeline.mwmbl.crawlimports. The release check still countsmwmbl/resources/andsettings_common.pyas crawler files, so the commit saysNo functional changes to the crawler.rather than raisingCRAWLER_VERSION.Verification
make checkpasses, andmake testpasses on the rebased branch (1991 passed, 10 skipped).test/test_image_cap.py:index.php,Image:), while a category page doesn'tsearchandsearch_retrievedand passes the other calls throughServedImagesRankertest/test_image_serving.py:test_combined_search.py,test_image_serving.py) now reach one level further in./raw.is_imagefeature. The model's view of image pages comes from generic text, URL and domain features, so a non-Commons page with the same profile, such as an SEO page with a keyword-stuffed URL slug, might share some of the lift. The web-only cross-validation (+0.004) shows no loss. A look at score changes on a spam sample would settle it.File:pages on other wikis (en.wikipedia.org/wiki/File:…), andSpecial:FilePathandMedia:URLs, aren't counted as images.Part of #610
🤖 Generated with Claude Code