Announcement: The Alexa Skills Community Is Moving To Stack Overflow

For improved usability and experience, Alexa skills related forum support will be transitioned to Stack Overflow. Effective January 10, 2024, the Amazon Developer Forums will no longer be available. For continued Alexa skills support you can reach out to us on Stack Overflow or via Contact Us.

question

Julio Salamanca avatar image
Julio Salamanca asked

Help with combination of words and numbers in utterances

Hey everyone, I just got my echo this week and loving it so far. Decided to try and develop some skills. I have a question on how I can get my utterances to behave like i want. I am looking to get a combination of Number type and Literal type side by side. for example "My answer is Two Broke Girls" I want to be a able to get the number two to be returned as a Number along with the rest of the text. I have tried it like this: Answer My answer is {Number} {broke girls|Show} but i only get the number 2 and no value in the Show slot here is my intent schema. any help is appreciated. { "intents": [ { "intent": "Answer", "slots": [ { "name": "Show", "type": "AMAZON.LITERAL" }, { "name": "Number", "type": "AMAZON.NUMBER" } ] }
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.

Galactoise avatar image
Galactoise answered
I doubt this will solve it, but I think it's just "LITERAL", not "AMAZON.LITERAL". Beyond that, however, your utterance looks good to me. Do you have other sample utterances, or is that the only one? There's this vague problem people on the forums have been seeing where the end of an utterance gets clipped, and nobody can really pin down exactly why it happens, but one thing we noticed is that the other utterances you have set up are a possible factor.
10 |5000

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

Julio Salamanca avatar image
Julio Salamanca answered
i did have other utterances but i just tried it with the single one and still no getting what i need. these are the values i get when i say " the answer is ten broke girls" with only this utterances: "the answer is {Number} {one | Show}" i get this result {u'Number': {u'name': u'Number', u'value': u'?'}, u'Show': {u'name': u'Show', u'value': u'girls'}} when i say the same sentence with this utterances: "the answer is {Number} {one two | Show}" i get this result {u'Number': {u'name': u'Number', u'value': u'?'}, u'Show': {u'name': u'Show'}} what does '?' mean? also do you know if i am doing it write by adding extra words to the Show slot like this {one two | Show} when i expect 2 words in that slot? if i expect 3 words do i add another word to the slot like so ? {one two three | Show}
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
Bear in mind that Alexa is extremely poor at multiple slots next to each other with no hard coded word inbetween. I have a similar intents in Starlanes of the form: drop <10> pick <20> It is woeful at recognizing this. I have all sorts of complicated workflow so when it misses values it goes back and asks just for the bits missing. If you can, try to restructure your inputs. If you can say "word word ", it will work MUCH better.
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
So, you are correct in adding two words to your sample utterance's slot definition if you expect a two word answer. Generally you need a bunch of utterances that match what is essentially the cadence of the answer you expect. So, if you had an intent that asked a Jeopardy-style question about Luke skywalker, you'd probably want a few utterances for the response: LUKE who is {Luke|myVal} LUKE who is {Luke Skywalker|myVal} LUKE who is {Jedi Knight Luke Skywalker|myVal} That said, if you can at all use a custom slot type, that tends to clean up your utterances quite a bit. I'm wondering if there's a way you can combine your two slots into a single slot - that would most likely help you match more effectively
10 |5000

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

Julio Salamanca avatar image
Julio Salamanca answered
Thanks for the suggestions. I decided to just create a dictionary with key being shows titles that have numbers spelled out with the value being the title with a number in it. This is would obviously only work in my case since i just googled shows with numbers in title. Hopefully, the software improves, seems like there is a lot of potential with the echo.
10 |5000

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

Levon@Amazon avatar image
Levon@Amazon answered
Hi Julio, I'm not sure if you were able to resolve this, but if you are still experiencing any issues, we could look into that if you provide the skill-id and the name of the skill. If you prefer to contact us privately rather than on these public forums, you can use the Contact Us link in your Distribution Portal account: https://developer.amazon.com/help/contact-us.html
10 |5000

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

newuser-d5bb8890-dcb3-4175-9bab-e8aa7bdce231 avatar image
newuser-d5bb8890-dcb3-4175-9bab-e8aa7bdce231 answered

I noticed some sample utterances fail to fill the slot when there are multiple slots. This was using the Alexa console to test where you type in the test utterances where I would expect no missed recognition. (is this a totally wrong assumption?) This works all the time: "mycoloris{Color}andmypetis{Pet}andmynumberis{Number}" but this often fails to fill the number slot "mycoloris{Color}and{Pet}and{Number}" Do I have to add more words between slots to get better recognition accuracy??? Seems strange to me. Thank you.

10 |5000

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