question

Tristan avatar image
Tristan asked

problems submitting large custom slots

I'm trying to take advantage of the new 600000 character limit on custom slots, but when I try to save my interaction mode in the web UI, I get "Error: There was a failure saving the intent schema or sample utterances, please try again. " after it processes for a while. Is there a CLI or other way to upload my custom slots?
alexa skills kitvoice-user interface
10 |5000

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

Tristan avatar image
Tristan answered
Just to clarify, I'm trying to add a custom slot that has 29756 lines (599933 characters). Based on the docs, this should be supported as it's well under the 50000 value limit (I assume this is lines) and under the 600000 character limit. Message was edited by: Tristan
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
You probably want to re-think your approach. Once you get past a few dozen entries in a custom slot, it doesn't really matter that much. Custom slots are definitive, they are just examples. Alexa will still quite happy return you values not in your custom list to your slot. So adding thousands (or hundreds of thousands?) of examples really isn't going to improve the quality of your skill very much. If you don't believe me, go ahead and try it. Enter, say, a hundred values. Try out your skill with examples on your list and off your list. Then go and add as many as you can squeeze in. Try the same tests again. I think you will find it really doesn't make any difference. [Tonight during testing Alexa decided when I said "go to" that I really mean "grubbe". O_o]
10 |5000

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

Tristan avatar image
Tristan answered
Maybe you can provide some insight into a better approach... Here's a simplified case of what I'm trying to solve: In my app, users can customize a field (made up of one or more words) and after some rudimentary filtering, there are ~100K unique values for this field. I'd like the user to be able to invoke Alexa based on the value in this field, so I was planning on making an utterance like "load data in {field}". I was hoping to upload a subset of the unique fields as a custom slot in hopes to be able to get a better experience for most users, so that I'm not constantly re-prompting them.
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
>Maybe you can provide some insight into a better approach... A few suggestions... 1) Just pick a couple dozen to start with. That's as good as it's going to get, recognition wise. 2) Engineer your input system to do fuzzy matching against your list of fields. You are going to have to do this anyway, since Alexa doesn't guarantee returning a value in your custom slot. DoubleMetaphone has been reasonably popular on the list. Although, for that number of fields, it may not be suitable. 3) Log everything you hear, and everything the user does. Get a feel for how Alexa decides to hear your users. Add in an "alias" system to your list of fields. If Alexa consistently hears "guppe" for a "goto" field, add that as an alias for the field. Change your match to also factor in aliases. 4) Accept that you are going to have to do lots of constant reprompting. Alexa is not good at generic text entry. 100K values is, pretty much, asking it to input generic text. You might take the text, do your fuzzy match, and if too many come up too high, repeat them back to the users and ask them to clarify. (Use numbers to list the options, since it's going to be just as hard to distinguish between like sounding words!) 5) See what you can do to reduce or categorize your input set. Do you really need 100K entries? Or, can you reduce that to 10 categories with 10 sub-categories with less entries? If you let the user drill down through subsets, it will be easier. Although, if you put each of the overall total in, you will still have the distinguishing problem. 6) Consider a web interface to let each user pick their "favorite" field entries. This will reduce the problem space for matching. Your mileage will vary depending the specifics of your skill. Many of the above things require non-trivial effort. But that's the thing. Alexa isn't magic. If you want to take it out of the home-automation-toy field, you have to put some work into it. So, what I'll say lastly, is to reconsider your business model. If you are doing this for fun, calculate that it's going to require more effort than you thought. I may cease to be fun. If you are trying to make money, you are going to want to factor in the extra time, and also consider if the state of the art will even get you to the user experience you want. Best of 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.

Tristan avatar image
Tristan answered
Thanks jjaquinta! I'm currently doing something similar to #6. Of all the total unique fields, each user has about 20. I've been experimenting with using a Double Metaphone and the Levenshtein distance in order to figure out what field they're talking about. This was where I believed that the custom slot would come into play (this is prefered to AMAZON.LITERAL, right?).
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
>I've been experimenting with using a Double Metaphone and the Levenshtein distance I experimented with this too, but then dropped it. (Wrote a pre-processor to analyze utterance files and find terms that were too phonetically similar.) The problem you will find is that once a term has been Double Metaphoned, it's only 4 characters long. The Levenshtein distance between any two four character strings is, at most, 4. Over half the terms in my problem set had a distance of 1 or 2. If you compute the distance before you Metaphone, you aren't comparing things linguistically. It just wasn't helpful. I did some further trials with Caverphone, which maintains word length. But the results were still too ambiguous to be helpful. >This was where I believed that the custom slot would come into play (this is prefered to AMAZON.LITERAL, right?). Amazon recommend custom slots over literals. To be honest, I've found no evidence that they are any better. I've been bitched at in certification for using utterances instead of custom slots. The problem is that you only have to be at this for a month or two before you have more development experience than most of the people doing certification. So there are frequent circumstances where you know more about it than they do. (Personally, I think they both end up being treated the same on the back end.) I would suggest trying both. Then seeing if you can find a test that notes any difference. Personally, I have my own interaction model format. It's one (JSON) file that is easy to maintain, and check in and out of source control. I then have a utility I have that parses it, and splits it into the several different files Amazon insists on. If you adopt a similar approach, then you can flip between utterances and custom slots by just adjusting the tooling. I would be interested in your results, as another data point.
10 |5000

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

Galactoise avatar image
Galactoise answered
Jo, we actually did some interesting work on this for a PoC a while back, before we started developing skills meant for release to the skill store. One of the other guys was supposed to write a blog post about how we got past the DoubleMetaphone + Levenshtein ambiguity - we ended up with an algorithm that was actually very effective. Maybe I'll go poke him and get him to write that article.
10 |5000

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

memo@amazon avatar image
memo@amazon answered
Hi, Your friendly neighborhood DA here. Thanks for design considerations Jo and Galactoise! Tristan, what you're attempting to do should work from a technical standpoint, since you brought this up, we've identified an issue and are actively working to get it resolved. I'll update this thread as soon as we have a confirm fix in prod.
10 |5000

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

memo@amazon avatar image
memo@amazon answered
Memo here again The issue that Tristan reported has been fixed. Hurray!
10 |5000

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