question

newuser-032a4ca9-c6ba-4b3e-a716-d40db2e800bf avatar image

What's the point in accessing any API to get information back when you have to hard code all possible values in a custom slot type?

I must be missing something here but I fail to see the point in making API calls to get publicly available info when you have to hard code those same values as lists within the custom slot in order to get it to recognize them.

For example; I'm writing a skill that will access a companies API, which holds medical terminology, and returns the requested term or medical code. Example: "Alexa, ask MyMed what is the medCode for heart Attack?" or "Alexa, ask MyMed what does medCode 112234 represent?"

In the Amazon Developer Console, I cannot get passed the Interaction Model because it wants me to define my custom types. medCodes and terms

So my question is; Why even access an API if you have to manually enter all possible values of a slot in the custom slot types? There are thousands of these medCodes and growing. The examples I've reviewed involve static types like Horoscope Signs, or Airport codes. These are rarely going to expand.

alexa skills kitalexaecho
1 comment
10 |5000

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

geekgirl avatar image geekgirl commented ·

Hello, have you considered hosting a custom Skill as a web service? I have attached some documentation for your reference.

https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/developing-an-alexa-skill-as-a-web-service

0 Likes 0 ·
crafty_geek avatar image
crafty_geek answered

Looks like you might wanna look into the clunky-but-powerful Amazon.LITERAL slot type. Passes the voice input along to your lambda function for backend parsing.

For the numeric med codes, I believe Amazon.NUMBER will parse for you successfully.

Built-in slots are quite useful, I wish they were listed on the Interaction Model screen itself as hover-able links that give a summary of each built-in slot type, rather than having to flip back and forth between tabs... actually, think I'm going to put my Alexa skills on hold and write a "Rubber Duck" skill for Alexa coders to install, which can include listing/reading blurbs about schemas.

10 |5000

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

jjaquinta avatar image
jjaquinta answered

What's the point in writing a skill that no one can invoke correctly because the vocabulary is too large to be recognized consistently?

You can't have it both ways. You can either support a broad vocabulary with a low accuracy, or a constrained vocabulary to a high accuracy. As Alexa is a consumer device, Amazon have chosen the latter. To be successful on Alexa you need to design skills that make use of what Alexa is good at. If you don't, you won't end up with a quality skill.

If you want a broad vocabulary, you need to use something other than Alexa. Try Watson Speech To Text on IBM's BlueMix.

10 |5000

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

Rod R Ellison avatar image
Rod R Ellison answered

I'll share what I did, and by no means claim to be correct. It is my first, and slightly painful skill.. .. but for the most part it works as I'm intending.

As @crafty_geek mentions.. the Amazon.Literal works - and yes, it is clunky.. There should be no hardcoding needed, but you do have to account for the permutations of words you may expect in the literal slot..

For my Music Man skill heres some examples.. and there are literally a hundred more that look very similar to these to account for other ways people may ask a question. It is not perfect, and I don't know that i'd create another Literal driven skill in the future..

MusicManArtistIntent where is {Rihanna|artist} playing

MusicManArtistIntent where is {Iron Maiden|artist} playing

MusicManArtistIntent where is {The Rolling Stones|artist} playing

MusicManArtistIntent where is {Five Finger Death Punch|artist} playing

MusicManArtistIntent where is {Tom Petty and the Heartbreakers|artist} playing

MusicManArtistIntent where is {Tom Petty and the Heart breakers|artist} playing

,,, effectively, each line adding an additional count of words that someone might say between 'where is' and 'playing'..

The schema looks like this:

{ "intents": [ { "intent": "MusicManArtistIntent", "slots": [ { "name": "artist", "type": "AMAZON.LITERAL" } ] },...

So you may have:

MedcodeIntent what is the code for { stroke | medCode }

MedcodeIntent what is the code for { heart attack | medCode }

MedcodeIntent what is the code for { some medical thing | medCode }

etc... 1 word example, 2 word example, 3 word example..maybe more..

and a schema that looks like this:

{ "intents": [ { "intent": "MedcodeIntent", "slots": [ { "name": "medCode", "type": "AMAZON.LITERAL" } ] },...

Good luck!

10 |5000

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