google-transcribe: numerals support via digit-sequence class token - #99
Merged
Merged
Conversation
…ocument rejected re-ranking
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.
Why
Spoken numbers ("nine four one two") are transcribed as words ("nine four one two") instead of digits ("9412") by Google Speech-to-Text V2. Applications that need numeric output (dial pads, quantities, prices) have to post-process every transcript. Google offers speech adaptation class tokens exactly for this, and the service had no way to use them.
Summary
numeralsparameter to the Google transcribe service. When set, an inlinePhraseSetwith the$OOV_CLASS_DIGIT_SEQUENCEclass token (boost 20.0, taken over from the internal FreeSWITCH-parameterized setup) is sent asRecognitionConfig.adaptation(ADR 0005).google_transcribe::Paramsintoregion+ flattenedTranscribeParams(model, language, diarization, numerals) so recognition parameters can be passed through to the client; all new fields default, so existing configs keep working.confidenceon the top alternative, so the previous confidence-based re-ranking compared unknown values.max_alternativesis hardcoded to 1 accordingly. The rejected re-ranking approach is documented in ADR 0005.--numeralsfor the Google provider.Validation
cargo test -p context-switch -p google-transcribepasses (4 passed, 1 ignored).cargo fmt -- --checkclean.AI disclosure
This pull request was developed with assistance from GitHub Copilot (GLM-5.3-Flash). All code was reviewed and approved by the human author before submission.