synesthesiam / rhasspy

Rhasspy voice assistant for offline home automation
https://rhasspy.readthedocs.io
MIT License
950 stars 101 forks source link

STT output casing #170

Closed NullEnt1ty closed 4 years ago

NullEnt1ty commented 4 years ago

I'm using Rhasspy with Google Cloud STT which is called by the command handler. My question is: Does Rhasspy expect the output of the command to be all lowercase / uppercase? Google STT capitalizes some words. The capitalized words are filtered out because they're unknown words and thus the intent recognition fails.

Lowercasing all words in my STT script would be a quick fix but I'm wondering if this is necessary.

Calling /api/text-to-intent with capitalized words seems to work though because Rhasspy is fixing the casing in this case (pun intended).

https://github.com/synesthesiam/rhasspy/blob/f405b827f40309844335e9321ab4ac50020fed9d/rhasspy/core.py#L218-L223

synesthesiam commented 4 years ago

Rhasspy shouldn't assume anything about the casing coming out of the STT process. It's the intent recognizer's responsibility to handle casing, and I can see that my "fix casing" in the recognize_intent method won't help in your case (pun :cake: ) because the action is happening in dialogue.py instead.

I'll take a look and see where I can apply a fix :)

This is fixable, and is in fact already fixed in the

NullEnt1ty commented 4 years ago

Thanks for your response! I'm looking forward to the fix. For now I'll force lowercase output in my STT script.

and is in fact already fixed in the

It is fixed in the...? 😄

synesthesiam commented 4 years ago

In the next version :/

synesthesiam commented 4 years ago

Fixed (hopefully) in 2.4.18