Skip to content

feat(ml): Jeffreys log-odds vocab, better prompt, and fit_score calibration - #132

Merged
Davisuco28 merged 4 commits into
mainfrom
feat/style-profile-and-fit-score-improvements
Jul 30, 2026
Merged

feat(ml): Jeffreys log-odds vocab, better prompt, and fit_score calibration#132
Davisuco28 merged 4 commits into
mainfrom
feat/style-profile-and-fit-score-improvements

Conversation

@PabloVc-77

@PabloVc-77 PabloVc-77 commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

What

Replace TF-IDF distinctive_vocab with Jeffreys log-odds-ratio (α=0.5, scores normalized to [0, 1]) plus a NOUN/ADJ/ADV lemma filter; port the improved conditioner prompt, fit_score calibration, and backend upload/recompute path from feat/better-response; strip Gutenberg [Illustration] markup; update Style DNA labels/docs.

Why

TF-IDF collapses to raw frequency with only 3 author documents (measured 3-way top-10 overlap of 5). Jeffreys log-odds + POS filtering produces juror-readable signature vocab (0 pairwise overlap) and the ported prompt/fit_score path is what drove the better measured generations in testing.
Closes #100
Closes #86

How IBM Bob helped

  • Custom Mode used: none
  • Bob session export: n/a

Screenshots / output

Measured top-3 after re-seed (live DB):

  • Austen: madam, regiment, surprize
  • Dickens: trooper, convict, beadle
  • Poe: color, thicket, gray
    Scores in [0, 1]. Style DNA bars scale relative to the top term. Rollback of DB rows is possible via style_profiles history (append-only).

Checklist

  • Tests pass locally (pytest on vocabulary / style_profile / conditioner / fit_scorer / smoke / document_upload)
  • Lint passes (make lint)
  • If schema changed (StyleProfile / Passport) → bumped version + updated docs/ (prose only: DistinctiveTerm.score range [0, 1]; type: number unchanged)
  • If new env var → added to .env.example
  • If new/changed endpoint → updated docs/api_contract.yaml (DistinctiveTerm.score description only)
  • Documentation in the relevant README.md updated
  • At least one teammate reviewed

…ration

Replace TF-IDF distinctive_vocab with Jeffreys log-odds (NOUN/ADJ/ADV filter),
port the improved conditioner/fit_scorer/backend upload path from feat/better-response,
and keep Illustration cleanup plus Style DNA UI score labels in sync.
@vercel

vercel Bot commented Jul 30, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
author-ai Ready Ready Preview Jul 30, 2026 5:34pm

Make the average-length ceiling explicit and keep heavy-subordination authors from run-on sentences while matching measured generation behaviour.
Lock the prompt phrases and ensure dialogue_ratio is read from stylistic, not syntactic.
Replace ambiguous unicode in vocabulary docstrings, drop trailing whitespace, and apply black formatting so CI lint gates pass.
@Davisuco28
Davisuco28 merged commit 592f484 into main Jul 30, 2026
8 checks passed
@PabloVc-77
PabloVc-77 deleted the feat/style-profile-and-fit-score-improvements branch July 30, 2026 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants