mycroft-core: Tests for invalid phonemes fallbacks fail on latest pocketsphinx
I’m running the tests on Alpine Linux using system packages and Python 3.8.
I currently have all tests succeeding except for PocketSphinxTest.testInvalid and LocalRecognizerInitTest.testListenerConfig. It seems the fallback for invalid phonemes isn’t working.
============================================================= FAILURES ==============================================================
___________________________________________________ PocketSphinxTest.testInvalid ____________________________________________________
self = <test.unittests.client.test_hotword_factory.PocketSphinxTest testMethod=testInvalid>
def testInvalid(self):
config = {
'hey Zeds': {
'module': 'pocketsphinx',
'phonemes': 'ZZZZZZZZZ',
'threshold': 1e-90
}
}
p = HotWordFactory.create_hotword('hey Zeds', config)
> self.assertEqual(p.phonemes, 'HH EY . M AY K R AO F T')
E AssertionError: 'ZZZZZZZZZ' != 'HH EY . M AY K R AO F T'
E - ZZZZZZZZZ
E + HH EY . M AY K R AO F T
test/unittests/client/test_hotword_factory.py:43: AssertionError
------------------------------------------------------- Captured stdout call --------------------------------------------------------
2020-05-06 14:10:53.204 | INFO | 7488 | mycroft.client.speech.hotword_factory:load_module:386 | Loading "hey Zeds" wake word via pocketsphinx
____________________________________________ LocalRecognizerInitTest.testListenerConfig _____________________________________________
self = <test.unittests.client.test_local_recognizer.LocalRecognizerInitTest testMethod=testListenerConfig>
mock_config_get = <MagicMock name='get' id='139759354767968'>
@patch.object(Configuration, 'get')
def testListenerConfig(self, mock_config_get):
"""Ensure that the fallback method collecting phonemes etc.
from the listener config works.
"""
test_config = base_config()
mock_config_get.return_value = test_config
# Test "Hey Mycroft"
rl = RecognizerLoop()
self.assertEqual(rl.wakeword_recognizer.key_phrase, "hey mycroft")
# Test "Hey Victoria"
test_config['listener']['wake_word'] = 'hey victoria'
test_config['listener']['phonemes'] = 'HH EY . V IH K T AO R IY AH'
test_config['listener']['threshold'] = 1e-90
rl = RecognizerLoop()
self.assertEqual(rl.wakeword_recognizer.key_phrase, "hey victoria")
# Test Invalid"
test_config['listener']['wake_word'] = 'hey victoria'
test_config['listener']['phonemes'] = 'ZZZZZZZZZZZZ'
rl = RecognizerLoop()
> self.assertEqual(rl.wakeword_recognizer.key_phrase, "hey mycroft")
E AssertionError: 'hey victoria' != 'hey mycroft'
E - hey victoria
E + hey mycroft
test/unittests/client/test_local_recognizer.py:76: AssertionError
About this issue
- Original URL
- State: open
- Created 4 years ago
- Comments: 20 (11 by maintainers)
I haven’t gotten all the way through it. I may have a workaround half-done (if it works)
Cool, at least I now know where to look. I’ll investigate!
To be honest I’m amazed this is the only problem that comes with the newer versions, seeing how strict Mycroft normally keeps their dependencies
Did a quick test and upgraded pocketsphinx resulting in me getting the exact same issue so definitely the issue.