change(web): rework traversalless prediction, add mild whitespace-correction 🚂#15920
Draft
jahorton wants to merge 4 commits into
Draft
Conversation
User Test ResultsTest specification and instructions User tests are not required Test Artifacts
|
7539b3e to
6c1170d
Compare
f8a1e49 to
daea6e5
Compare
jahorton
commented
May 14, 2026
| // ContextTokenization pattern due to the model's lack of LexiconTraversal | ||
| // support, though. | ||
|
|
||
| const tokenizedCorrection = mapWhitespacedTokenization(tokenization.left.map((t) => { return {exampleInput: t.text} }), lexicalModel, correction.sample).tokenizedTransform; |
Contributor
Author
There was a problem hiding this comment.
Self-note: crossreference with changes in #15851 - there's a lot of overlap here. Might be best to DRY it out, especially since we may not actually want to stick with the "empty context" solution.
…rection Build-bot: skip build:web Test-bot: skip
da7359e to
a800a12
Compare
dacfc13 to
8227b81
Compare
jahorton
commented
May 15, 2026
| }); | ||
|
|
||
| const predictions = predictFromCorrections(model, correctionDistribution, context); | ||
| const predictions = correctAndEnumerateWithoutTraversals(model, correctionDistribution, context); |
Contributor
Author
There was a problem hiding this comment.
TODO: heavy cleanup needed here - we probably need tests for both predictFromCorrections AND for correctAndEnumerateWithoutTraversals.
jahorton
commented
May 15, 2026
| const predictions: CorrectionPredictionTuple[] = tailPredictions.map((p) => { | ||
| // Concat corrections + predictions for their components. | ||
| const predictionSequence = [...predictionPrefixSequence, p]; | ||
| const fullPrediction: ProbabilityMass<Suggestion> = predictionSequence.reduce((prev, curr) => { |
Contributor
Author
There was a problem hiding this comment.
See #15907 - this is somewhat similar to the compositeIntermediatePredictions function defined therein. May be worth hoisting, then polishing up later in the PR chain?
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.
🚧
Build-bot: skip build:web
Test-bot: skip