Keep the model's capital on proper nouns mid-sentence - #916
Merged
Merged
Conversation
enaboapps
force-pushed
the
908-proper-nouns
branch
from
September 25, 2026 19:13
93b45f9 to
85ceee7
Compare
enaboapps
marked this pull request as ready for review
September 26, 2026 03:18
The display rule kept a spelling only when it had a capital after the first letter, which saved WhatsApp but lowercased London, Monday and English. The beam now tracks how much of each word's probability spells it with a capital. Mid-sentence, a word whose capitalised spellings carry nine tenths of its mass keeps the capital, which the model only prefers for a proper noun; a coin toss on a rare word stays lowercase. At a sentence start the model capitalises everything, so the lowercase key wins there and the sentence rule decides. The second word of a phrase follows the same rule. Closes #908 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
enaboapps
force-pushed
the
908-proper-nouns
branch
from
September 26, 2026 08:13
9ca53f9 to
b3e2dae
Compare
This was referenced Sep 27, 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.
Closes #908. Stacked on #915; part of the casing plan in #914.
What changed
model.rstracks, for each finished word, how much of its probability mass comes from spellings that capitalise the last word.displaynow takes the finished entry rather than just its best spelling.docs/word-prediction.mddescribes the rule.Sample output at the chosen threshold:
Validation
Node 24.13.0, Rust 1.97.1:
cargo fmt --checkandcargo clippy --all-targets -D warningspassed.cargo testprediction suite passed, including the bundled-model test. No frontend files changed; the full frontend suite runs on the top of the stack.🤖 Generated with Claude Code