Skip to content

fix(dictation): cleanup v2.2 run-on punctuation rescue, mixed-dot email ITN, and function-word stutter collapse - #3076

Merged
kitlangton merged 1 commit into
devfrom
fix-cleanup-v22-punct-email
Nov 28, 2026
Merged

kitlangton merged 1 commit into
devfrom
fix-cleanup-v22-punct-email

Conversation

@kitlangton

Copy link
Copy Markdown
Collaborator

Cleanup v2.2 post-processing fixes for long unpunctuated run-ons, mixed-dot spoken emails, and immediate closed-class function-word stutters.

Before

  • Long unpunctuated dictations (15+ words without .?!) emitted as a single punctuation-less run-on even when the punct_after head predicted PERIOD / QUESTION with high confidence, because render ignored punct_after unless apply_case_punct was enabled.
  • Mixed-dot spoken emails where ASR wrote dots into the local part (and domain) while leaving at spoken (Alex.smith at example.com) stayed unformatted when not tagged as an EMAIL span.
  • Immediate side-by-side closed-class function-word stutters (the the, we we, and and, I'm I'm) survived into output when the tagger kept both copies.

After

  • Run-on punctuation rescue (decode.rs, render.rs): Tag carries punct_prob_bps from softmax(punct_logits). Strictly inside contiguous runs of >= 15 kept words with zero sentence-ending punctuation, high-confidence (>= 0.85) PERIOD and QUESTION predictions are inserted (skipping URLs, paths, emails, dotted tokens, abbreviations, and already-punctuated words) and the next kept word is capitalized while respecting PATH_LIKE. Short and already-punctuated dictations stay untouched; frozen render::render parity stays unchanged.
  • Mixed-dot email ITN (post.rs, mod.rs): normalize_mixed_dot_emails converts <dotted_local> at <domain.tld> (and spoken-dot domains) to lowercase local@domain.tld before align_email_handles, strictly guarded against prose, source file extensions, versions, abbreviations, and non-email TLDs.
  • Immediate closed-class stutter collapse (render.rs): collapse_immediate_function_stutters drops 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: pass
  • python3 scripts/code-shape.py: pass

@kitlangton
kitlangton merged commit d5ba195 into dev Nov 28, 2026
4 checks passed
@kitlangton
kitlangton deleted the fix-cleanup-v22-punct-email branch November 28, 2026 23:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant