feat: Improve ranking diversity - #23
Merged
Merged
Conversation
…enalty Reduce _FILE_SATURATION_THRESHOLD from 2 to 1 so the second chunk from the same file is penalised immediately. Since search results are evaluated at the file level, duplicate chunks from the same file waste ranking slots that could surface different target files. This is the dominant failure mode across all languages in the benchmark. Also add a moderate penalty for package-info.java (Java package documentation metadata), matching the existing __init__.py treatment. Benchmark (main's 29-repo suite): NDCG@10 0.867 → 0.882 (+0.015). All 12 languages improved or held steady (Kotlin +0.048, Python +0.024, JavaScript +0.022, Swift +0.020, TypeScript +0.020).
NDCG@10: 0.882 (baseline 0.867, +0.015)
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.
This PR improves ranking diversity by penalizing chunks from the same file sooner. This boosts the benchmark score from 0.867 to 0.882. It also generalizes re-export files and adds a java specific file that we can safely ignore.