Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle STT fallback when streaming plugins return nothing #232

Closed
wants to merge 2 commits into from

Conversation

NeonDaniel
Copy link
Member

No description provided.

@NeonDaniel NeonDaniel requested a review from a team November 22, 2022 19:49
@codecov
Copy link

codecov bot commented Nov 22, 2022

Codecov Report

Merging #232 (e374a2c) into dev (6ceb058) will increase coverage by 4.46%.
The diff coverage is 43.45%.

@@            Coverage Diff             @@
##              dev     #232      +/-   ##
==========================================
+ Coverage   50.35%   54.81%   +4.46%     
==========================================
  Files         119      156      +37     
  Lines       10077     9313     -764     
==========================================
+ Hits         5074     5105      +31     
+ Misses       5003     4208     -795     
Impacted Files Coverage Δ
mycroft/audio/__main__.py 0.00% <0.00%> (ø)
mycroft/client/enclosure/__main__.py 0.00% <0.00%> (ø)
mycroft/client/enclosure/mark1/arduino.py 0.00% <0.00%> (ø)
mycroft/client/enclosure/mark1/eyes.py 0.00% <0.00%> (ø)
mycroft/client/enclosure/mark1/mouth.py 0.00% <0.00%> (ø)
mycroft/client/speech/__main__.py 0.00% <0.00%> (ø)
mycroft/client/speech/hotword_factory.py 0.00% <0.00%> (-88.89%) ⬇️
mycroft/client/speech/service.py 0.00% <0.00%> (ø)
mycroft/client/speech/silence.py 0.00% <0.00%> (-42.86%) ⬇️
mycroft/client/text/__init__.py 0.00% <0.00%> (ø)
... and 150 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@@ -199,6 +199,8 @@ def send_unknown_intent():
with self.loop.lock:
try:
text = self.loop.stt.execute(audio, language=lang)
if text is None:
Copy link
Member

Choose a reason for hiding this comment

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

should we handle empty strings to? maybe use if not text and catch all falsy values

Copy link
Member Author

Choose a reason for hiding this comment

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

makes sense; I think None is the default in plugins when nothing sets self.text, but its ultimately up to the plugin author what they return. No reason not to fall back if the base STT didn't recognize anything, it can't hurt..

Copy link
Member Author

@NeonDaniel NeonDaniel Nov 23, 2022

Choose a reason for hiding this comment

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

On another read, the check right after this will handle an empty string as valid STT, is this part of the API or should that check also be reversed to:

if not text:
    send_unknown_intent()
else:
    ...

Copy link
Member

Choose a reason for hiding this comment

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

if both fallback and main stt return an empty string i think that means silent audio and is a valid transcription no?
i want fallback to try a new transcript if main return empty string, but if both return empty then i think the old logic is valid

Copy link
Member

Choose a reason for hiding this comment

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

re-reading code, i think that change makes sense in the below lines

@JarbasAl JarbasAl added the bug Something isn't working label Jan 26, 2023
@JarbasAl JarbasAl mentioned this pull request Jan 26, 2023
23 tasks
@JarbasAl JarbasAl added this to the 0.0.7 milestone Jan 30, 2023
@JarbasAl JarbasAl mentioned this pull request Jan 30, 2023
93 tasks
@JarbasAl JarbasAl mentioned this pull request Feb 8, 2023
@JarbasAl JarbasAl closed this May 2, 2023
@JarbasAl JarbasAl deleted the FEAT_FallbackForStreamingSTTFailures branch August 8, 2023 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants