Add adaptive topN selection based on document length#32
Closed
Add adaptive topN selection based on document length#32
topN selection based on document length#32Conversation
|
这是来自QQ邮箱的假期自动回复邮件。您好,邮件已收到,我会尽快给您回复。
|
Co-authored-by: yanyiwu <2162645+yanyiwu@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update keyword count settings for file similarity
Add adaptive Mar 5, 2026
topN selection based on document length
Owner
yanyiwu
approved these changes
Mar 13, 2026
Owner
|
@copilot 测试没有全通过 |
Contributor
Author
All 5 tests pass (100%) — confirmed both locally and in CI. The CI dashboard shows 21/21 completed jobs as Could you share the specific test output or CI run URL that shows the failure? That would help narrow down the environment issue. |
This was referenced Mar 13, 2026
Owner
|
PR #35 has been merged on top of the current master and carries the same adaptive topN feature set, so I am closing this older branch as superseded. |
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.
Users have no guidance on how many keywords (
topN) to extract for documents of varying sizes — too few keywords for long documents reduces fingerprint accuracy; too many for short ones is wasteful.Changes
Simhasher::getTopN(text)— new static helper that returns a recommendedtopNclamped to[5, 200]using the heuristictext.size() / 120. For Chinese UTF-8 (~3 bytes/char, ~2 chars/word), this scales to roughly one keyword per 20 estimated words.Simhasher::make(text, v64)— new overload that callsmake(text, getTopN(text), v64), removing the need to manually picktopN.README — added guidance table and example code for both the adaptive and explicit APIs.
Usage
topNOriginal prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.