Skip to content

fix(search): enable true semantic recall for hybrid/multi ranking - #419

Open
Mardi123 wants to merge 1 commit into
AmadeusITGroup:mainfrom
Mardi123:fix/semantic-search-upstream
Open

fix(search): enable true semantic recall for hybrid/multi ranking#419
Mardi123 wants to merge 1 commit into
AmadeusITGroup:mainfrom
Mardi123:fix/semantic-search-upstream

Conversation

@Mardi123

Copy link
Copy Markdown
Collaborator

Semantic ranking could only re-rank BM25 keyword hits: a primitive that was embedding-similar but shared no query token could never be retrieved, because the scoring candidate set was seeded only from BM25 term matches. Seed every filtered candidate when the query carries embeddings so the dense signal drives recall, not just re-ordering.

Also:

  • Clamp cosine contributions to [0, 1] so an unrelated (negative-cosine) embedding cannot penalise a hit below its BM25 score.
  • Unify -ies/-ied plurals with their -y singular in the stemmer (queries<->query, studied<->study), which previously never matched.

Adds focused tests for pure-semantic recall and stemmer unification.

Description

Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📝 Documentation update
  • ♻️ Code refactoring (no functional changes)
  • ⚡ Performance improvement
  • 🧪 Test coverage improvement
  • 🔧 Configuration/build changes

Related Issues

Closes #
Fixes #
Relates to #

Changes Made

Testing

Test Coverage

  • Unit tests added/updated
  • Integration tests added/updated
  • Manual testing completed
  • All existing tests pass

Manual Testing Steps

Tested On

  • macOS

  • Windows

  • Linux

  • VS Code Stable

  • VS Code Insiders

Screenshots

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings or errors
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Documentation

  • README.md updated
  • JSDoc comments added/updated
  • No documentation changes needed

Additional Notes

Reviewer Guidelines

Please pay special attention to:


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache License 2.0.

Semantic  ranking could only re-rank BM25 keyword hits: a
primitive that was embedding-similar but shared no query token could never
be retrieved, because the scoring candidate set was seeded only from BM25
term matches. Seed every filtered candidate when the query carries
embeddings so the dense signal drives recall, not just re-ordering.

Also:
- Clamp cosine contributions to [0, 1] so an unrelated (negative-cosine)
  embedding cannot penalise a hit below its BM25 score.
- Unify -ies/-ied plurals with their -y singular in the stemmer
  (queries<->query, studied<->study), which previously never matched.

Adds focused tests for pure-semantic recall and stemmer unification.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant