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

grammar precedence doesn't seem to work correctly on Kaldi #812

Open
kendonB opened this issue May 7, 2020 · 6 comments
Open

grammar precedence doesn't seem to work correctly on Kaldi #812

kendonB opened this issue May 7, 2020 · 6 comments
Labels
Investigation Required Issue needs to be investigated. Kaldi Related to Kaldi speech recognition backend

Comments

@kendonB
Copy link
Collaborator

kendonB commented May 7, 2020

Describe the bug
Two bugs I believe caused by the same thing.

  1. Trying to cancel a mouse grid does not work when using Kaldi
  2. Using squat and bench do not work when using Douglas on Kaldi

To Reproduce
Steps to reproduce the behavior (be sure to include the exact command phrase you are using):

  1. Run Caster with Kaldi
  2. Say 'Douglas'
  3. Say '8 by 4'
  4. Say 'squat'

Caster runs the Navigation squat command not the Douglas one.

Expected behavior
Douglas records that you have squatted.

Comments
If I recall correctly, Caster doesn't currently have a formal process for dealing with conflicts between rules. However, when using Dragon Naturallyspeaking, these sorts of "knockout" behaviours just seemed to work correctly. As in, Dragon/Natlink/Caster correctly knew to use the mouse grammar and not the navigation grammar. Any help from @synkarius would be very welcome!

System:

  • OS: Windows 10
@kendonB kendonB added the Bug Unexpected behavior from existing features. label May 7, 2020
@LexiconCode LexiconCode added the Investigation Required Issue needs to be investigated. label May 7, 2020
@LexiconCode
Copy link
Member

LexiconCode commented May 7, 2020

Good catch. The behavior working correctly with DNS is related to something within Natlink.

@daanzu
Copy link
Contributor

daanzu commented May 8, 2020

Yeah, different engines handle ambiguous grammars differently. The current recommended way to handle this in Kaldi is to set a weight on one of them, to determine which should take precedence. Technically, "priority" and "weight" are slightly different concepts, but in the interest of simplicity, I think weight suffices. Any weight set will be simply ignored by engines that don't support it.

@kendonB
Copy link
Collaborator Author

kendonB commented May 8, 2020

I also just noticed that this is actually not consistent. So i guess there is some amount of randomness as well? It also rarely will choose the Legion one but not never.

@kendonB
Copy link
Collaborator Author

kendonB commented May 8, 2020

Awesome. Just added weight=1000 and it just seems to work perfectly! Thanks @daanzu

@daanzu
Copy link
Contributor

daanzu commented May 8, 2020

FWIW, I usually just add a weight=10 to my "special mode" grammars, but I haven't done much testing of it.

@LexiconCode
Copy link
Member

LexiconCode commented May 9, 2020

Awesome. Just added weight=1000 and it just seems to work perfectly!

As you find other issues like this don't hesitate to open up a pull request as setting weights shouldn't affect other engines.

@LexiconCode LexiconCode added the Kaldi Related to Kaldi speech recognition backend label May 25, 2020
@LexiconCode LexiconCode changed the title grammar precedence doesn't seem to work correctly for mouse grids on Kaldi grammar precedence doesn't seem to work correctly on Kaldi Jul 21, 2020
@LexiconCode LexiconCode removed the Bug Unexpected behavior from existing features. label Jul 25, 2020
@LexiconCode LexiconCode reopened this Oct 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Investigation Required Issue needs to be investigated. Kaldi Related to Kaldi speech recognition backend
Projects
None yet
Development

No branches or pull requests

3 participants