Feat/prefilter logic v2 335#339
Open
ZohaibHassan16 wants to merge 2 commits intoHawksight-AI:mainfrom
Open
Conversation
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.
Description
This PR implements Two-Stage Scoring to fast-fail weak candidate pairs before they reach the computationally expensive multi-factor semantic scoring logic.
Type of Change
Related Issues
Changes Made
1. Prefilter Gates
Added
_prefilter_pairto evaluate type mismatch, name length-ratios, and token overlaps instantly.2. Scoring Orchestration
Updated
calculate_similarityto respect theprefilter_enabledconfiguration and bypass string/property/embedding checks if the prefilter fails.3. Explainability
Added opt-in
score_breakdownto the metadata output for better debugging and transparency.Benchmark Results
V1 Candidate Gen vs. V2 Prefilter
Testing & Quality Assurance
python -m buildsuccessful.Falseto preserve legacy behavior.Additional Notes
This PR is part of a stacked sequence for the Deduplication v2 Epic. Please note the following for review:
main, this PR currently displays the combined changes of both Sub-Issue 1 and Sub-Issue 2.mainso that it only displays the unique changes for Sub-Issue 2 ([Sub-Issue 2] Two-Stage Scoring: Fast Prefilter + Full Semantic Score #335).