How to add custom naming to Alexa Custom Skill? - alexa

I have intent CreateNewDogIntent.
The following is the dialog flow that I would like to implement.
U: Alexa, tell Dog Creator to create a new medium dog named Barky.
U: Alexa, tell Dog Creator to create a new large dog named Barky.
or
U: Alexa, tell Dog Creator to create a new dog.
A: What would you like your dog to be named?
U: Barky
I want the name to be any possible value.
Is this possible to implement with Alexa custom skills kit?
From what I understand, I would need to create a slot type for name value, but there is no option to create a "catch all" type, with exception of SearchQuery which can only be used without any other slot type.

There is no "catch all" slot type.
I faced a similar problem when implementing some word games, I needed a slot type where every word would be caught.
What I did is to put together a slot type with 20 thousands words.
If the user says one of them, all good.
If the word is not in the slot type but it is considered similar to those in the slot type, it will go to your backend with a flag ER_SUCCESS_NO_MATCH. You might want to keep those to enhance your slop type.
On top of that, the FallbackIntent will allow you to respond gracefully to "uncatchable" words.

Related

Alexa having trouble understanding my voice input

I am working on an Alexa Skill and am having trouble for Alexa to understand my voice input. Therefore the utterances are not properly matched with the required slots... and alexa is always re asking or getting stuck.
Here are some examples:
affirm: f.m., a from
Speedbird: Speedboard, speaker, speed but, speed bird, spirit, speedbath
wind: windies (wind is), when is home (wind is calm)
runway 03: runway sarah three
takeoff: the cough
Any solution to training Alexa to properly understand me? Or should I just write as utterance all these "false" utterances so alexa will match my intents properly?
Thanks for any help!
There is no chance to train the language understanding itself of Alexa.
Yes, as you wrote: I would just take these false utterances as matches for your intent.
This seems also what is recommended by amazon:
...might show you that sometimes Alexa misunderstands the word "mocha" as
"milk." To mitigate this issue, you can map an utterance directly to
an Alexa intent to help improve Alexa's understanding within your
skill. ....
two common ways to improve ASR accuracy are to map an intent value or
a slot value to a failing utterance
Maybe give an other person a try to see if it's recognized the same way as your speech.
Word-Only Slots
If you're still struggling with this, you should try adding more variations to your slot values (synonyms are an option if you have specific interpretations that keep repeating). Consider adding synonyms like speed bird for Speedbird (and take off for takeoff). Non-standard word slots will not resolve as accurately as common words. By breaking Speedbird into two words, Alexa should more successfully recognize the slot. Information about synonyms are here:
https://developer.amazon.com/en-US/docs/alexa/custom-skills/define-synonyms-and-ids-for-slot-type-values-entity-resolution.html#sample-slot-type-definition-and-intentrequest
Once you've done this, you'll want to grab the canonical value of the slot, not the interpreted value (e.g. you want Speedbird not speedboard).
To see an example, scroll to the very last JSON code block. The scenario described in this request is that the user said the word track with is a synonym for the slot value song in their request. You'll see the MediaType value is track (what the user said) but if you take a look at the resolutions object, inside the values array, the first value object is the actual slot value song (what you want) associated with the synonym.
This StackOverflow goes a little more into the details on how you get that value:
How do I get the canonical slot value out of an Alexa request
Word and Number Slots
In the case of the "runway 03" example, consider breaking this into two different slots, e.g. {RunwaySlot : Custom} {Number : Amazon.Number}. You'll have better luck with these more complex slots. The same is true for an example like "red airplane," you'll want to break it into two slots: {Color : Amazon.Color} {VehicleSlot : Custom}
.
https://developer.amazon.com/en-US/docs/alexa/custom-skills/slot-type-reference.html#number

Alexa Skill - Programmatically Enable/Disable Slot Matching

I have an Alexa skill that at one point asks for names, and at another point asks for numbers. The names are being mapped to a slot of type AMAZON.FirstName and the numbers to a slot of type AMAZON.NUMBER. The problem is that Alexa is aggressively interpreting even number values as names. (e.g. Saying "eight" is likely to be cast as the name "Tate.")
From what I can tell, Dialog Delegation is useful only if you know exactly how many of each type you need to capture. But in my case there are a variable number of times I will need to capture a name, so I can't just fill that slot once and be done with it.
Ideally I would like a way to programmatically turn the slots on and off. So when I prompt the user for a name, any utterance CAN ONLY BE MAPPED TO A NAME or else rejected (obviously HELP and EXIT, etc would still work). And then when I ask for a number, any utterance WILL ONLY BE MAPPED TO A NUMBER, it won't even try to cast it into the type AMAZON.FirstName.
Is there any way to achieve that? Or are there any other workarounds for scenarios like this?
I'd change the approach you're taking. You have a great tool for validation before even getting to code itself. Click the slot you're trying to validate, then click on the "validations" tab.
Right there, you can add either one or two rules. If you do one, you can add the "not within a set of values" and you can type "one", "two", etc. in order to avoid getting those numeric values inside your name slot.
If you take the two rule validation, you will need to add a "Value within slot types' slot values". That way, you will only accept values inside the AMAZON.FirstName slot type.
You don't really need to enable/disable a slot, you can simply take both in the same utterance. Just make sure you're validating your slots properly and that way you'll avoid unvalid data from getting into your skill :)
Read more: https://developer.amazon.com/es-mx/docs/custom-skills/validate-slot-values.html

Alexa - Using a slot right after the invocation for skill-internal routing

I have skill with an Invocation like this: "Alexa, ask SuperDuperEvent".
But I want to be able to do this: "Alexa, ask SuperDuperEvent location". Where location is going to be a city.
Because my Skill is heavily location based I need to know the location that is requested before anything else happens. Is this possible?
Is it possible to start the skill with a location, too? Like so: "Alexa, start SuperDuperEvent location".
Is this at all possible with creating a new skill for every location?
I want to avoid using this type of dialog:
User: "Alexa, start SuperDuperEvent"
Alexa: "What location do you want to know about?"
User: "Brussels"
Alexa: "What do you want to know about the SuperDuperEvent in Brussels?"
This is probably the way to go, but it does not feel fluid or engaging.
Cheers
Yes, you can do it if you have the intent location defined. You can find more information at https://developer.amazon.com/docs/custom-skills/understanding-custom-skills.html
The only problem that I see is that the invocation name is only one word. Surely it will not pass the certification process.
As you can see in the developer console:
Invocation name requirements
Your invocation name should be two or more words, and can contain only lower-case alphabetic characters, spaces between words, possessive apostrophes (for example, "sam's science trivia"), or periods used in abbreviations (for example, "a. b. c."). Other characters like numbers must be spelled out. For example, "twenty one".
Invocation names cannot contain any of the Alexa skill launch phrases such as "launch", "ask", "tell", "load", "begin", and "enable". Wake words including "Alexa", "Amazon", "Echo", "Computer", or the words "skill" or "app" are not allowed. Learn more about invocation names for custom skills.
Changes to your skill's invocation name will not take effect until you have built your skill's interaction model. In order to successfully build, your skill's interaction model must contain an intent with at least one sample utterance. Learn more about creating interaction models for custom skills.

I need slot type of intent for my Alexa skill

I am creating a skill but I need a slot type for my intent (which takes a complete sentence as input) but it should be in Indian.
Like: AMAZON.LITERAL
It only supports English(U.K) and English(US).
I need any slot type which takes a complete sentence as input but supports English(Indian). Thanks.
I'm also seraching for this one for last 2 weeks. And also i email to support team of alexa. After that i got confirmation from support team that AMAZON.LITERAL slot type is not support feature in english(india).
You can only fake it:
create your own slot type
for this slot type give a lot of different utterances in different length (like "one", "this is a sentence.." and so on)
use your slot with custom slot type in your utterances
I also needed it for a simple echo skill in GERMAN which just reply.
See the dialogue model here:
https://gitlab.com/timguy/alexa-wiederhall/blob/master/src/main/java/github/timguy/wiederhall/speechAssets/IntentSchemaSlotsUtterances_SkillBuilder.json
instead of samples "{slotOne}" you could use " save the text I say {slotOne}"
UPDATE
I didn't tried it but just read it now. Now you could use AMAZON.SearchQuery
https://developer.amazon.com/de/blogs/alexa/post/a2716002-0f50-4587-b038-31ce631c0c07/enhance-speech-recognition-of-your-alexa-skills-with-phrase-slots-and-amazon-searchquery
Amazon.Literal is deprecated and if you are changing the skill to en-Us then it won't be available in any other locale which i think you never want.
Moreover as per my interaction with amazon development team it is not a good option to have a free text in terms of Amazon.Literal as it would add more ambiguity in their NLP for resolving intent and slot than addressing the underlying issue. Since Alexa doesn't provide you any confidence factor in intent/slot then it would be a big problem to your skill as any random word/sentence would match to Amazon.Literal.
It's always good to restrict your user input as you are developing the skill especially when it involves AI/NLP.
Update
You can use the new slot type Amazon.SearchQuery that would suit your problem

Custom slot for StartOverIntent

How to set up slots with AMAZON.StartOverIntent utterance?
Ex: I want to start the skill with a custom slot value as in Alexa, ask <my skill> the definition of <custom value>
I read that AMAZON.StartOverIntent cannot have custom slot so I broke it like this:
DefIntent {Term}
AMAZON.StartOverIntent the definition of
AMAZON.StartOverIntent define
AMAZON.StartOverIntent what is
That doesn't seem to work when I test it with Echo. How do you go about declaring such utterance?
Why are you trying to override StarOverIntent? The normal way to do things is to use your own intents. You only need to use the built in intents if you want to. And, even then, it is just a short cut. You still have to implement them. They don't actually come with in built in functionality.
For what you want, you can declare the following intent:
{
"intents":[
{
"intent":"DefIntent",
"slots":[
{
"name":"term",
"type":"TERM"
}
]
}
]
}
This creates one intent with one slot which is a custom type TERM. You can create the list of terms you want to look up in plan text file and upload it as the values for that custom type. You can then declare utterances:
DefIntent the definition of {term}
DefIntent define {term}
DefIntent what is {term}
That should give you what you want.
Or close to what you want. I imagine you want the user to be able to say anything at all for {term}. But Alexa is not a dictation machine. It doesn't work that way. It expects a moderately restrictive vocabulary in order to produce the highest quality recognition.
You can fake it out, by providing a custom list with a hundred thousand words in it. Or other techniques to create a "generic slot". But it will not perform with a high quality of recognition. You are better off re-thinking your design so that you don't need generic dictation.
For a fully worked, complex example of an Alexa skill, with nearly an hour of video, see SubWar.

Resources