Skip to content

Document retrieval scoring with a worked cosine example - #10

Open
biggdawg320 wants to merge 1 commit into
primeodin:mainfrom
biggdawg320:codex/scoring-walkthrough
Open

biggdawg320 wants to merge 1 commit into
primeodin:mainfrom
biggdawg320:codex/scoring-walkthrough

Conversation

@biggdawg320

Copy link
Copy Markdown

Closes #7.

Adds a short worked example showing how title/body tokenization, normalized term frequencies, dot products and norms produce the retrieval scores. Covers ranking, the positive-score cutoff and the effect of --k, with a link from the README.

Validation on Windows / Python 3.10, installed with pip install -e ".[dev]":

  • python -m pytest -q: 8 passed (pytest 9.1.1).
  • python -m notes_rag --mock "What is a git remote?": succeeds with citations.
  • Executed the two Markdown examples through load_notes and retrieve; checked scores against 3/sqrt(10) and 1/sqrt(2), ordering, k=1 and the zero-overlap query.
  • git diff --check: passes.

AI disclosure: prepared and checked using OpenAI Codex under the account owner’s direction. This is a documentation contribution; no runtime behavior changes.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

good first issue: docs/how-scoring-works.md (hand-worked bag-of-words cosine)

1 participant