dictation-toolbox / Caster

Dragonfly-Based Voice Programming and Accessibility Toolkit
Other
339 stars 121 forks source link

kaldi status output is too noisy #799

Open kendonB opened 4 years ago

kendonB commented 4 years ago

Describe the bug In the status window when running Kaldi, there is too much output.

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

  1. Follow the instructions to install kaldi
  2. Say 'sauce.'
*- Starting Caster v 1.6.16 -*
INFO:engine:Listening...
DEBUG:action.exec:Executing action: RegisteredAction() ({'direction': 'up', 'textnv': '', 'nnavi50': 1, 'big': False, '_grammar': Grammar(ccr-1), 'spacing': 0, 'mtn_dir': 'right', 'nnavi10': 1, 'npunc': 1, 'extreme': None, 'modifier': '', 'nnavi3': 1, 'capitalization': 0, 'npunc100': 1, '_rule': PreparedRule(PreparedRule), '_node': Node: Alternative(...), [u'sauce'], 'long': '', 'mtn_mode': None, 's': '', 'n': 1, 'nnavi500': 1, 'splatdir': 'backspace'})
arrow keys
DEBUG:action.exec:Executing action: ['%(direction)s'] ({'direction': 'up', 'textnv': '', 'nnavi50': 1, 'big': False, '_grammar': Grammar(ccr-1), 'spacing': 0, 'mtn_dir': 'right', 'nnavi10': 1, 'npunc': 1, 'extreme': None, 'modifier': '', 'nnavi3': 1, 'capitalization': 0, 'npunc100': 1, '_rule': PreparedRule(PreparedRule), '_node': Node: Alternative(...), [u'sauce'], 'long': '', 'mtn_mode': None, 's': '', 'n': 1, 'nnavi500': 1, 'splatdir': 'backspace'})
DEBUG:action.exec:['%(direction)s']: Parsing dynamic spec: 'up'

Expected behavior Some concise output along the lines of what shows up in the Natlink status window with DNS.

Screenshots If applicable, add screenshots to help explain your problem.

System:

LexiconCode commented 4 years ago

Looks like you're running in debug mode. I'm away from my computer at the moment but check for in the command line -l DEBUG

LexiconCode commented 4 years ago

should be something like the following for the .bat file. https://github.com/dictation-toolbox/Caster/blob/master/Run_Caster_Kaldi.bat

LexiconCode commented 4 years ago

Actually I will have to double check this, debug should be even more verbose.

LexiconCode commented 4 years ago

@kendonB The verbose output is most likely due to the following workaround in https://github.com/dictation-toolbox/dragonfly/pull/235

kendonB commented 4 years ago

@Danesprite @daanzu do you have thoughts on how to go about addressing this one? I'm a bit out of my depth here.

daanzu commented 4 years ago

@kendonB You can read the background at https://github.com/dictation-toolbox/dragonfly/issues/182 and https://github.com/dictation-toolbox/Caster/issues/774. I currently can't reproduce it myself. I welcome any help trying to track it down. Apparently, removing or disabling that action logging may cause the problems, but I don't really have a good/actionable idea as to why. Alternatively, in lieu of a fix, maybe there is a less conspicuous/annoying hack solution than the logging, but that was all I found before I lost reproducibility.

kendonB commented 4 years ago

@daanzu when you say you can't reproduce it, you mean on your regular system or using caster?

daanzu commented 4 years ago

@kendonB I can't reproduce it on my dev system currently, although it was happening in the past, both without caster.

kendonB commented 4 years ago

I tried reinstalling dragonfly changing the text of the message in this line: https://github.com/dictation-toolbox/dragonfly/blob/d572df964ea6e65a82d95ca9861ec370af01e341/dragonfly/actions/action_base.py#L96

and I was still finding that the messages came through the same as before - no change.

Does the kaldi model code package up some of the dragonfly code? Or am I just installing the package wrong? To install dragonfly locally I clone the repo then run

python setup.py install

replacing python with the hard coded paths of all three of my python installations to be double sure.

kendonB commented 4 years ago

If kaldi is packaging up the dragonfly code, the kaldi releases might just need an update if you are not seeing it on your development system @daanzu?

LexiconCode commented 4 years ago

@kendonB

python setup.py install

try the following python -m pip install -e .[kaldi]

kendonB commented 4 years ago

@LexiconCode I tried doing it that way and I still see the same message without my change.

kendonB commented 4 years ago

OK worked it out - just had to delete stuff manually in the packages folder

kendonB commented 4 years ago

OK I am trying commenting out the logging line in dragonfly. I'll see if it ruins other things for me over the coming days. Now like this:

arrow keys
DEBUG:action.exec:['%(direction)s']: Parsing dynamic spec: 'up'
arrow keys
DEBUG:action.exec:['%(direction)s']: Parsing dynamic spec: 'down'
daanzu commented 4 years ago

@kendonB I should have been clearer. To "re-enable" the problem, you should only need to do one of (although your way should work too, modulo the craziness of this bug in the first place):

kendonB commented 4 years ago

@daanzu your first bullet point means changing this line:

https://github.com/dictation-toolbox/dragonfly/blob/d572df964ea6e65a82d95ca9861ec370af01e341/dragonfly/engines/backend_kaldi/engine.py#L94

to:

logging.getLogger('action.exec').setLevel(logging.WARN)

?

daanzu commented 4 years ago

@kendonB No, just add that line somewhere in your loader file or a grammar file, as long as it is executed after the logging initialization. But I am not experienced with Caster.

kendonB commented 4 years ago

I haven't noticed any trouble yet after quieting down the debug messages using:

logging.getLogger('action.exec').setLevel(logging.WARN)

This may have fixed it: https://github.com/dictation-toolbox/dragonfly/issues/182#issuecomment-589483348

daanzu commented 4 years ago

This may have fixed it: dictation-toolbox/dragonfly#182 (comment)

I don't think that fixed it, because I think I still had it happen after that change, and reverting that change didn't allow me to reproduce it. But with this bug, not sure about anything šŸ¤· .