question

thingamagig avatar image
thingamagig asked

Open source word combination intent generator

Ever have this problem?

"Alexa show me a large/big, photo/picture/image of a violet/purple boat/ship on the ocean/sea"

show me a picture of a violet boat
show me a picture of a violet ship
show me a picture of a purple boat
show me a picture of a purple ship
show me a photo of a violet boat
show me a photo of a violet ship
show me a photo of a purple boat
show me a photo of a purple ship
show me an image of a violet boat
show me an image of a violet ship
show me an image of a purple boat
show me an image of a purple ship
display a picture of a violet boat
display a picture of a violet ship
display a picture of a purple boat
display a picture of a purple ship
display a photo of a violet boat
display a photo of a violet ship
display a photo of a purple boat
display a photo of a purple ship
display an image of a violet boat
display an image of a violet ship
display an image of a purple boat
display an image of a purple ship

I wrote a script to generate these kinds of lists (which can easily get huge).

https://github.com/cyrusadkisson/alexa-intent-generator

Enjoy. And feel free to submit pull requests. There are a lot of improvements that could be made.


intentsinteraction model
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Andy Whitworth avatar image
Andy Whitworth answered

This seems odd.

Wouldn't you have picture/image/photo , purple/violet and ship/boat as slot values to an intent which could start with display/show me ?

The number of utterances you'd have to define in the interaction model would then be small.

I wouldn't design an interaction model in the manner you seem to be implying.

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

thingamagig avatar image
thingamagig answered

So I'm going to go ahead and admit that I didn't know custom slots were a thing. I've been developing this skill for months and they are NOT obvious in the interface. I knew about the built-ins, like AMAZON.Number, etc, but yeah. I wasn't aware of the ability to build customs. So thanks for making me aware, @AndyW.

That said and confirmation bias notwithstanding... I'm not *entirely* sure the slot method is always better. Pros and cons:

PROs for custom intent interface:

  • Slot values - The slot values carry through to the code. If your code needs to know if the user said "photo" vs "picture" vs "image", then you can get it this way. If these are synonyms, however, I can't imagine why your code would need to know. Maybe for analytics?
  • Synonym suggestions - Synonym suggestions in the interface
  • IDs - Assignment of an ID number

PROs for my script

  • Faster - You just type the words, hit go, and paste them in. Very little clicking around. And if you want to make wholesale changes to the intent utterances, you don't have to disassemble the slot structure you've already built.
  • BLANKS (this is actually a legit, undeniable advantage) - In many situations, you want to say "Show X" or "Show me X" or "Show the X". So the empty string in "Show EMPTY_STRING X" becomes one of the options. My script handles this with ["me, "the", ""]. There doesn't appear to be a way to do this in the Custom Slot interface.
  • Simpler - Creating custom slots makes another layer of complexity that can get fat-fingered and screw up your whole skill, especially if custom slots are used across multiple intents. You change it for intent X and intent Y breaks. My script allows compartmentalization of each intent.

Take this for example:

var bits = [

["show", "display", "print", "list", "show me"],

["some", "your", "some of your", ""],

["songs", "sessions", "music", "tunes"],

["in the", "from the"],

["{genre}"],

["category", "genre"]

];

Creating this level of flexibility in the custom intents interface is a huge, clicky pain in the ass. So much so that you or your developers *are going to get lazy about it* and leave holes. Would your developers really make a custom slot just for "some"/"your"/"some of your"/""? (and you can't even make a blank, btw) Seems like that would also make your intents harder to read which could lead to further missteps.

I don't know. Maybe I'm just trying to justify. But I think my method has some merit in at least some circumstances.

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.