Repository navigation
fix(dictation): cleanup v2.2 run-on punctuation rescue, mixed-dot email ITN, and function-word stutter collapse - #3076
Merged
Conversation
…il ITN, and function-word stutter collapse
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.
Cleanup v2.2 post-processing fixes for long unpunctuated run-ons, mixed-dot spoken emails, and immediate closed-class function-word stutters.
Before
.?!) emitted as a single punctuation-less run-on even when thepunct_afterhead predictedPERIOD/QUESTIONwith high confidence, becauserenderignoredpunct_afterunlessapply_case_punctwas enabled.atspoken (Alex.smith at example.com) stayed unformatted when not tagged as anEMAILspan.the the,we we,and and,I'm I'm) survived into output when the tagger kept both copies.After
decode.rs,render.rs):Tagcarriespunct_prob_bpsfromsoftmax(punct_logits). Strictly inside contiguous runs of>= 15kept words with zero sentence-ending punctuation, high-confidence (>= 0.85)PERIODandQUESTIONpredictions are inserted (skipping URLs, paths, emails, dotted tokens, abbreviations, and already-punctuated words) and the next kept word is capitalized while respectingPATH_LIKE. Short and already-punctuated dictations stay untouched; frozenrender::renderparity stays unchanged.post.rs,mod.rs):normalize_mixed_dot_emailsconverts<dotted_local> at <domain.tld>(and spoken-dot domains) to lowercaselocal@domain.tldbeforealign_email_handles, strictly guarded against prose, source file extensions, versions, abbreviations, and non-email TLDs.render.rs):collapse_immediate_function_stuttersdrops the first copy of verbatim adjacent closed-class function words (the,a,an,and,but,or, pure subject pronouns/contractions, non-object possessives) while leaving grammatical/emphatic/quoted repetitions (had had,that that,is is,no, no,very, very,to to) untouched.Verification
scripts/check dictation::cleanup: 108/108 passed (including 600 render parity + 40 model parity cases)cargo clippy --locked --bin hex -- -D warnings: passpython3 scripts/code-shape.py: pass