Possibly stupid idea



My interaction model contains a number of synonymous terms – for example, “show”, “episode”, and “broadcast”.

When an intent phrase contains more than one term with synonyms, this results in a combinatoric explosion of the number of examples I need to provide.

It occurs to me that a cleaner solution might be to make each synonym a custom slot type, and then simply not use the value from that slot. Theoretically, the language model should then accept all the possible combinations.

So far, it does seem to work on Alexa. Conceptually it ought to work on other platforms. Guess I’ll find out…

((The other thing I’m wrestling with at the moment is the question of whether ordinal values – “the third” – get matched as dates or numbers. Current evidence is that Alexa is preferring to understand it as a date, when the grammar doesn’t make clear which was intended… so I’m going to have to define my expected phrases a bit more carefully to allow for that. Not Jovo’s fault, just the nature of NLP.))


I’ve seen some people use that in the past. I haven’t seen that solution in a while and it’s also not always clear if something like this leads to better results or not because of the black box that the Alexa model is


Understood. It does make the model much easier to read and maintain, though. … Worth noting as something to experiment with, anyway.

There are skill-development tools folks have written which will take a phrase list with variables and expand all the combinations for you – I believe folks at WNYC wrote one of them – but the ones I’ve seen then require you copy-paste the generated lists into your model. We could write one that’s specifically aware of Jovo model files and acts as a preprocessor for jovo build, if the slot approach turns out to have issues.


That sounds interesting and could make for a great CLI plugin! https://www.jovo.tech/docs/cli-plugins


This is exactly what I do in a similar case - use slots for performer type (performer, group, artist…) or track, song, etc. I don’t actually use the slot in my code, but it saves a lot of copy and pasting.


Thanks, @CraigH. I was worrying that this might interfere with any built-in attempts Alexa et al might be making to support synonyms; I’ve never been sure what kinds of fuzziness these NLP systems are willing to deal with; clearly they’re trying to guess when words are missing or unexpected but Amazon only knows how well that does or doesn’t work.

Now I need to figure out why the NLP is directing some of my phrases to the wrong skills. It seems to mostly be affecting phrases with an AMAZON.Cardinal slot type (“the sixth show”). I wouldn’t entirely blame it for confusing those with my Date intent (“the show broadcast on the Sixth”)… but it’s matching them up with my Latest intent, which doesn’t have any kind of numbers in its example phrases, and I really don’t see why so I’m not sure how to fix it.

“The impressive thing is not how well the bear dances, but that it dances at all.”
(But take my word for it, you do not want to know how bears were taught to dance.)