feat(ml): Jeffreys log-odds vocab, better prompt, and fit_score calibration - #132
Merged
Merged
Conversation
…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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
approved these changes
Jul 30, 2026
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.
What
Replace TF-IDF
distinctive_vocabwith 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 fromfeat/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
Screenshots / output
Measured top-3 after re-seed (live DB):
Scores in [0, 1]. Style DNA bars scale relative to the top term. Rollback of DB rows is possible via
style_profileshistory (append-only).Checklist
pyteston vocabulary / style_profile / conditioner / fit_scorer / smoke / document_upload)make lint)docs/(prose only:DistinctiveTerm.scorerange [0, 1];type: numberunchanged).env.exampledocs/api_contract.yaml(DistinctiveTerm.scoredescription only)README.mdupdated