Skip to content

Conversation

@gabe-l-hart
Copy link
Contributor

In the STT recognize_listener, the clause that handles 'results' or 'speaker_labels' was prone to index errors when the 'results' object returned by the service was empty. This can happen, so this change makes that logic safe to empty (or otherwise malformed) results.

In the STT recognize_listener, the clause that handles 'results' or 'speaker_labels'
was prone to index errors when the 'results' object returned by the service was
empty. This can happen, so this change makes that logic safe to empty (or otherwise
malformed) results.
@CLAassistant
Copy link

CLAassistant commented Dec 22, 2020

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@mamoonraja mamoonraja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall @gabe-l-hart , left a small comment. You will need to sign the CLA before we merge though.

@stale
Copy link

stale bot commented Jun 9, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Jun 9, 2021
@mediumTaj
Copy link
Contributor

@apaparazzi0329 can you take a look

@stale stale bot removed the wontfix label Jun 9, 2021
@apaparazzi0329
Copy link
Contributor

Sure thing

@apaparazzi0329
Copy link
Contributor

@gabe-l-hart We are looking to merge in this PR and would like to give you credit for this contribution. Would you be able to sign the CLA agreement? Everything is looking good although I have a concern over one line.

self.callback.on_transcription(transcripts)
if hypothesis:
self.callback.on_hypothesis(hypothesis)
self.callback.on_hypothesis(hypothesis)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any reason this self.callback.on_hypothesis(hypothesis) line is kept here? The hypothesis variable is not in scope here and would throw an error if alternatives or transcript did not exist as well as send duplicate data to on_hypothesis()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yikes! It's been a good long time since I looked at this, but it sure looks buggy here. I'll remove this line.

@codecov-commenter
Copy link

codecov-commenter commented Jun 22, 2021

Codecov Report

Merging #768 (c9f5352) into master (a23a745) will decrease coverage by 0.00%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #768      +/-   ##
==========================================
- Coverage   91.43%   91.42%   -0.01%     
==========================================
  Files          25       25              
  Lines       31752    31755       +3     
==========================================
  Hits        29032    29032              
- Misses       2720     2723       +3     
Impacted Files Coverage Δ
ibm_watson/websocket/recognize_listener.py 26.12% <0.00%> (-0.73%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a23a745...c9f5352. Read the comment docs.

@apaparazzi0329 apaparazzi0329 self-requested a review July 6, 2021 17:10
Copy link
Contributor

@apaparazzi0329 apaparazzi0329 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this PR! Everything is looking good 👍

@apaparazzi0329 apaparazzi0329 merged commit 264807d into watson-developer-cloud:master Jul 6, 2021
watson-github-bot pushed a commit that referenced this pull request Jul 6, 2021
## [5.2.2](v5.2.1...v5.2.2) (2021-07-06)

### Bug Fixes

* robustify the STT streaming results handling ([#768](#768)) ([264807d](264807d))
@watson-github-bot
Copy link
Collaborator

🎉 This PR is included in version 5.2.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

7 participants