Skip to content

Conversation

@daspecster
Copy link
Contributor

When max_alternitives > 1, the confidence field is omitted entirely. So Transcript needs to set confidence to None.

{
 "results": [
  {
   "alternatives": [
    {
     "transcript": "hello thank you for using Google Cloud platform",
     "confidence": 0.95869493
    },
    {
     "transcript": "thank you for using Google Cloud platform"
    },
    {
     "transcript": "hello thank you for using Google Cloud platforms"
    }
   ]
  }
 ]
}

@daspecster daspecster added type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. api: speech Issues related to the Speech-to-Text API. labels Oct 31, 2016
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Oct 31, 2016
:returns: Instance of ``Transcript``.
"""
return cls(transcript['transcript'], transcript['confidence'])
return cls(transcript.get('transcript'), transcript.get('confidence'))

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@daspecster daspecster merged commit e1fd690 into googleapis:master Oct 31, 2016
@daspecster daspecster deleted the fix-transcript-confidence-missing-bug branch October 31, 2016 14:01
richkadel pushed a commit to richkadel/google-cloud-python that referenced this pull request May 6, 2017
…fidence-missing-bug

Allow Transcript to handle missing 'confidence' fields
atulep pushed a commit that referenced this pull request Apr 3, 2023
…ssing-bug

Allow Transcript to handle missing 'confidence' fields
atulep pushed a commit that referenced this pull request Apr 18, 2023
…ssing-bug

Allow Transcript to handle missing 'confidence' fields
parthea pushed a commit that referenced this pull request Oct 22, 2023
…ssing-bug

Allow Transcript to handle missing 'confidence' fields
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: speech Issues related to the Speech-to-Text API. cla: yes This human has signed the Contributor License Agreement. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants