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
Optional slots? #133
Comments
This is what I'm doing right now, though adding extra optional keywords explode in complexity. I think I could do it on my end and post-processed export yaml... but I think the issue here is that this is mere annoyance, and not a show stopper to add that step to working with console.
I could use a single intent like this:
|
I wish slot expression would support aliasing as well... So that multiple values could be used, but they would match to one. I.e. if I used Unlike the filed issue this can not be handled with preprocessor of yaml, but need to be post-processed by whatever accepts intents. Which is also solvable, but it would be convenient if done in console |
good suggestions. We keep them here and try to incorporate them into the roadmap. |
I wrote a small pre-processor that can expand expressions like this:
with some slot aliasing:
into like... couple hundred expressions :D Though the speed of UI, training and recognition is superb. The size of the model is 100kb. I think doing aliasing of values by introducing a separate slot for each group of aliased values is not the best idea in terms of performance and model size. But the benefit was that I didn't have to have any knowledge of yaml file to produce clean results. I.e. the slots jsin would look like Even though if this experiment was quite stupid, I can attest that the syntax becomes very expressive with optional/alternative keywords and slot aliases, and optional slot names. I really think it's a cheap way on your end to boost the power and conciseness of expressions |
I'm happy to say that we've implemented two additional features that should help with some of your concerns. Firstly, the addition of "Macros", and secondly the ability to use both Macros and Slots in Optional and choice constructs. Full documentation is coming but in the meantime, some examples should be enough to get you started. For the example you provided in the issue: You can now reduce it to something like: context:
expressions:
myIntent:
- "@openOptions (the, a) $zone:zone (@terms) (@stateMax)"
slots:
zone:
- zone one
- zone two
- zone three
macros:
openOptions:
- open
- extend
- slide out
terms:
- hydraulic
- slide outs
- room
- section
stateMax:
- completely
- entirely
- fully
- to the max Macros and Slots can be mixed and matched within the Optional and Choice constructs:
These changes are live and hopefully this should help with more complex grammers like you have mentioned here. As usual, if you you run into any additional problems please feel free to open another issue. |
Amazing work! thank you. I'm curious to see what does output json looks like for cases where aliases are used (i.e. can i tell if it recognized |
Oh yes... Optional slots and macros work perfectly, but it looks like macros are not represented in recognized object... that is unfortunately a bit limiting, as it only enables picovoice not to choke on extra words, but it doesn't allow making a decision on them. But i guess it makes sense to use slots instead. Now with optional and alternative slots, we can use Again, many thanks for your work. It is very smooth and complete. Good design! |
Yes that is correct,
|
Is your feature request related to a problem? Please describe.
I'm super impressed by your product. Really amazing offering, and great experience.
My question: is it possible to make slot optional for matching? I.e. allow the expression to be matched even if slot was not matched? My example
[open, extend, slide out] (the, a) $zone:zone (hydraulic, hydraulics, slide out, slide outs, room, section, slide, slides, cylinder, cylinders, areas, areas) (completely, entirely, fully, to the max, hundred percent, to the limit, as much as possible)
So I have only one meaningful $zone slot here, but also I have a set of words that I don't care that much for, but they can be in the command. Because i have a bunch of intents and commands reusing those sets, i'd love to turn them into slots for reuse, while basically ignoring them later. The problem is that I'd like the command to work even if they are not matched.,
Describe the solution you'd like
($zone:zone)
type syntax for optional slotsDescribe alternatives you've considered
I can use multiple separate commands with or without slots, but there's combinatorial complexity to support them all. I can also keep listing them as is which makes commands hard to parse visually
The text was updated successfully, but these errors were encountered: