Skip to content

Select the highest-confidence Google speech alternative - #920

Open
emme1t wants to merge 1 commit into
Uberi:masterfrom
emme1t:fix/select-highest-confidence-829
Open

emme1t wants to merge 1 commit into
Uberi:masterfrom
emme1t:fix/select-highest-confidence-829

Conversation

@emme1t

@emme1t emme1t commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

The Google recognizer checked for the string confidence in the list of alternatives. That check always fell through to the first transcript, even when another alternative had a higher score.

Select the maximum over the individual confidence values. A reported score of zero ranks above an absent score. Ties and responses without any scores keep the first alternative, matching the API's response order.

Fixes #829.

The focused Google recognizer tests and doctests passed on Python 3.12 (13 passed). Two regression examples failed against the original implementation. I also checked the public recognize_google method with local FLAC conversion and recorded-shape response fixtures for scored, unscored, partially scored and tied alternatives, including raw and confidence-returning modes.

This branch has not been deployed

No deployments
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.

How to return one alternative (with highest confidence) without returning all the options?

1 participant