change(web): rework traversalless prediction, add mild whitespace-correction 🚂 🔪#15920
Draft
jahorton wants to merge 5 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.
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?
a800a12 to
c12cef9
Compare
f377066 to
95f3df3
Compare
c12cef9 to
5f4d1ee
Compare
95f3df3 to
ae6030c
Compare
5f4d1ee to
7eb3030
Compare
ae6030c to
c647016
Compare
7eb3030 to
549b114
Compare
9dbd2b1 to
0441520
Compare
549b114 to
6374711
Compare
0441520 to
baca01f
Compare
581115f to
bc3691e
Compare
baca01f to
59f58ac
Compare
…rection Build-bot: skip build:web Test-bot: skip
Aims: - improve consistency between Traversal-based models and legacy/custom models without Traversals - improve ability to unit-test construction of the correction-sequence directly, as a smaller, individual unit
bc3691e to
b6ba677
Compare
…ion-sequence construction
59f58ac to
d4adfcb
Compare
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