Skip to content

bm25 parity: query-term de-duplication vs upstream query-frequency weighting #97

Description

@amondnet

Context

Follow-up from #84 / #91, recorded as an open parity gap in ADR-0005. csp's Bm25Index::get_scores de-duplicates query terms before scoring, while upstream semble weights each term by its query frequency (query_tf). A query that repeats a term (e.g. "error error handler") therefore ranks differently from upstream. This is a ranking divergence, not a bug: the fix must also keep the Lucene (k1+1) numerator csp intentionally uses.

Proposal

  • Decide: adopt upstream query-frequency weighting (parity) or document csp's dedup as intentional in .please/docs/references/semble.md §6.3.
  • If adopting: multiply each term's contribution by its query count; add a test with a repeated query term whose expected ranks are derived from the upstream Python.

Acceptance

  • ADR-0005 "open parity gaps" entry closed either way.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions