4

I'd like Alexa to be able to accept a variable-length list of English letters to my custom skill. It will allow users to search based on a string.

There's two steps to this:

  1. Getting good representation for individual letters that Alexa can understand
  2. Enumerating sample utterances with variable number of letters

For the first, one way would be to define a custom slot that has as its enumerated values of the English alphabet:

SLOT_LETTER

ay
bee
see
dee
ee
eff
gee
... etc

but that feels hacky. Does Amazon support any way to do this or is there a cleverer way?

I'd really rather not use NATO phonetic ("alpha bravo charlie" for "A-B-C") because it's a terrible user experience and very few people actually know them.

For the second issue (sample utterances), for AMAZON.LITERAL I want to define something like:

SpellIntent find me things starting with {first second|SLOT_LETTER}   
SpellIntent find me things starting with {first second third|SLOT_LETTER}
SpellIntent find me things starting with {first second third fourth|SLOT_LETTER}

But I don't think Amazon will let you define a variable length LITERAL using a custom slot (since they are different "types")?

lollercoaster
  • 15,969
  • 35
  • 115
  • 173

2 Answers2

8

It isn't very well documented, but you can use "a.", "b.", "c." etc to represent the letter, as opposed to the sound. Create a custom slot and use these as the values. That should do you for the slot.

For the intent, create an intent with, say, five slots, all with the same slot type. Create five utterances against the intent, with one, two, three, four and five slots filled. When the user spells something, the intent will be invoked. Any slots the user did not specify will be null.

Having two slots in one intent not separated by a word often does not perform well. But try it and see. With a restricted vocabulary like this, it could do OK.

Lastly, if it has trouble distinguishing, say, "b." and "v.", you might try adding NATO call codes to your list. Alpha, Bravo, Charlie, etc. Then, in your processing, just take the first character of whatever value comes in for the slot.

You might enable the "Star Lanes" skill and experiment with the "Set Call Sign to X Y Z" intent. I do the above in that skill and it works fairly well.

Joseph Jaquinta
  • 2,118
  • 17
  • 15
  • are you saying to put "a.", "b." (WITH period) in the *value* of the custom slot, *or* in the synonyms and having regular "a", "b" in the value? – Don Cheadle Sep 29 '20 at 17:24
  • @DonCheadle - there were no synonyms when I wrote the above comment. :-) "a." is more specific than "a" I would just put it in the normal slot to start with. But experiment with both and see if one performs better. – Joseph Jaquinta Sep 29 '20 at 21:09
  • so did that ever work decently for you? Do you have more info/screenshots of what worked? I'm not in Alexa Skills Kit territory, just in "Amazon Lex" but it's similar. And in my tries with Lex, it's barely ever working. – Don Cheadle Sep 29 '20 at 21:45
  • As above, you can try the Star Lanes skill on Alexa and see how it works there. I've generally not had a problem with it. Users have been quite, er, "inventive" in their use. Mind you, I also add in the NATO call codes, and the code also will take any values in the slot and take the first letter of what is returned. – Joseph Jaquinta Sep 30 '20 at 21:03
  • thanks Joseph. Unfortunately I'm working within Amazon Lex (not Alexa) in conjunction with Amazon Connect IVR. So I don't think I have access to "Star Lanes" within Lex. https://stackoverflow.com/questions/64130127/amazon-lex-receive-spoken-spelled-out-word-what-slot-type-should-i-use – Don Cheadle Sep 30 '20 at 21:08
1

I would avoid this kind of interface because it can be difficult for users to spell things, and difficult for Alexa to differentiate letters (b or v, perhaps). But if you want to try this, consider using the literal type and asking for letters in groups of three or four.

AV: "Spell the first four letters now"

User: "see ay are tee"

AV: "You spelled C, H, R, T. Would you like to add more letters, make a correction or search now?"

User: "Cancel. I'll just use my damn phone."

Mike3d0g
  • 277
  • 2
  • 12
  • ok, but my question was how I can use a set enumeration of letters (custom slot variable) and a literal at the same time - can you shed some light on that? – lollercoaster Sep 08 '16 at 21:36
  • I agree with @Mike3d0g on the recognition problem. I don't believe you can't create the slot the way you desire. And, let me add another problem. I am increasingly seeing ASK returning values that aren't defined in the custom slot list. I have a music play list that only has 7 items. I can say all sorts of other playlist names and they are recognized and returned in the slot. – Jim Rush Sep 09 '16 at 14:57