Skip to content

w2l gen2 won't recognize/parse list elements that have another as prefix #169

Closed
@rntz

Description

@rntz

Talon v0.1.2-111, Ubuntu 20.04.1 LTS, w2l gen2.1.

magic-wand.talon:

magic {user.wand1}: insert("{wand1}")
wizard {user.wand2}: insert("{wand2}")

magic-wand.py:

from talon import Context, Module
mod = Module()
ctx = Context()
mod.list("wand1", desc="")
mod.list("wand2", desc="")
# With a small list, gen2 refuses to decode
ctx.lists["self.wand1"] = {
    "small": "small",
    "small whatever": "whatever", # <-- refuses to recognize!
}
# If we make the list larger, we get "failed to parse phrase"
ctx.lists["self.wand2"] = {
    "this is just padding": "whee",
    "small": "small",
    "small whatever": "whatever", # <-- fails to parse!
    # Shared prefixes are not a problem, these are ok.
    "hello red": "hello red",
    "hello green": "hello green",
}

To reproduce: Using w2l gen2.1, say "magic small whatever" or "wizard small whatever".

Expected behavior of both cases: Talon types "whatever".

Actual behavior of magic small whatever: Fails to recognize, nothing happens, log output:

2020-12-05 18:40:55    IO EMIT ['magic', 'smal', 'whatever']
2020-12-05 18:40:55    IO DECODING
detecting in viterbi toks: ||||||||||||||||||||||||||||||||mmaaagggiiiccc|||sssmmaallll||whaateeevvveerr|||||||||||||
-299475 ||||||||||||||||||||||||||||||||mmaaagggiiiccc|||sssmmaallll||whaleeee|||||rrrrrrrrrrrred|
2020-12-05 18:40:55    IO [audio]=1320.000ms  [emit]=25.235ms (0.02x)  [decode]=3.347ms (0.00x)  [total]=28.582ms (0.02x)
2020-12-05 18:40:55    IO 

Actual behavior of wizard small whatever: Recognizes but parsing fails:

2020-12-05 18:39:15    IO 
2020-12-05 18:39:17    IO EMIT ['wizard', 'smal', 'whatever']
2020-12-05 18:39:17    IO DECODING
detecting in viterbi toks: ||||||||||||||||||||||||||||||||wiiizzzaarrddd||||||sssmmaallll|||whaatteeevvveerr||||||||||||||
621.634 ||||||||||||||||||||||||||||||||wiiizzzaarrddd||||||sssmmaallll|||whaatteeevvveerr||||||||||||||
  result: @wizard @smal @whatever

2020-12-05 18:39:17    IO DECODED ['@wizard', '@smal', '@whatever']
2020-12-05 18:39:17 ERROR cb error topic="phrase" cb=<bound method SpeechSystem.engine_event of <talon.scripting.speech_system.SpeechSystem object at 0x7efd7e3164f0>>
   24:       lib/python3.8/threading.py:890| 
   23:       lib/python3.8/threading.py:932| 
   22:       lib/python3.8/threading.py:870| 
   21:                    talon/cron.py:112| 
   20: ------------------------------------# cron thread
   19:                    talon/cron.py:77 | 
   18:          talon/scripting/rctx.py:200| 
   17: ------------------------------------# 'cron' main:<lambda>()
   16:                     talon/vad.py:16 | 
   15:             talon/engines/w2l.py:746| 
   14:      talon/scripting/dispatch.py:98 | 
   13:      talon/scripting/dispatch.py:133| 
   12:      talon/scripting/dispatch.py:124| 
   11:          talon/scripting/rctx.py:200| 
   10: ------------------------------------# 'phrase' user.engines:_redispatch()
    9: talon/scripting/speech_system.py:42 | 
    8:      talon/scripting/dispatch.py:98 | 
    7:      talon/scripting/dispatch.py:133| 
    6:      talon/scripting/dispatch.py:124| 
    5:          talon/scripting/rctx.py:202| 
    4: ------------------------------------# 'phrase' user.engines:engine_event()
    3: ------------------------------------# stack splice
    2:          talon/scripting/rctx.py:200| 
    1: talon/scripting/speech_system.py:303| 
talon.engines.EngineError: failed to parse phrase: ['@wizard', '@smal', '@whatever']
2020-12-05 18:39:17    IO [audio]=1440.000ms  [emit]=23.075ms (0.02x)  [decode]=4.336ms (0.00x)  [total]=27.412ms (0.02x)
2020-12-05 18:39:17    IO 

Other observations: Works as expected on sconv-b6.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions