I'm creating an Alexa skill with intents that supports, amongst others, the following utterances:
What lessons does {Mabel} have tomorrow?
Does {Mabel} have any homework?
where "Mabel" is a slot of type AMAZON.GB_FIRST_NAME.
In order to make the skill more conversational, I'd like to support the following:
What lessons does {Mabel} have tomorrow?
Does {she} have any homework?
where "she" is a custom slot that represents Pronoun.
This would require the response to the first question to store Mabel's Id in the session attributes so that when the user subsequently uses a pronoun, the skill could determine the subject of the question.
In theory, this should work. However, because the student-name and the pronoun slot are in the same position within the utterance, Alexa reports "she" as the name; the pronoun slot is never used or resolved.
Therefore, my question is, how can I encourage the pronoun-slot resolution without changing the utterance structure?
You can add additional slot values to the AMAZON.GB_FIRST_NAME built-in slot ("he", "she", etc) and do the pronoun detection and resolution yourself as you described. This will avoid the need for a new slot type.
Related
For example, I have a skill that tells the user about food interactions with medications. The user tells Alexa which medication they want to know about.
Each intent corresponds to a different medication interaction (e.g., grapefruit juice, antacids, etc.). Under the GrapefruitDrugs slot-type, I have several slot values (all of them are drug names). When the GrapefruitIntent is called, it gives the user a warning about this interaction. The problem is that I have other slot-types that share the same drugs and their warnings also need to be communicated to the user.
'Drug X', however, will interact with both grapefruit juice AND antacids. So the slot-type AntacidDrugs also has 'Drug X' listed as a slot value. I want both intents to be called.
How do I make sure that both intents get called? I've looked into chaining intents, however I have yet to see an example other than one that links an intent to the LaunchRequest.
Intents are here just to point out what kind of sentence you have received on your webhook. Webhook can be on lambda or can be your custom server (e.g. Java, PHP, NodeJs …). In any case, here is your code and logic. Here you know at what state your conversation is and how should given intent be interpreted.
So in some conversation states you will react the same for two intents, while in some cases you might interpret the same intent in two different ways.
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
I have implemented a multi-turn dialog for Alexa. The Help-Intent provides different Help-Texts depending on the state of the dialog. After the User has triggered the HelpIntent and was presented the Help-Text, I want to elicit a specific slot with the ElicitSlotDirective
Now this seems to be not supported, since you can only elicit slots of the current intent, and the HelpIntent does not have slots.
https://github.com/alexa/alexa-skills-kit-sdk-for-nodejs/issues/162
My question now is: How can I return to my multi-turn dialog and elicit a specific slot after the user triggered the HelpIntent?
You can now use intent chaining to elicit a slot from a different Intent. For example:
.addDirective({
type: 'Dialog.ElicitSlot',
slotToElicit: 'drink',
updatedIntent: {
name: 'OrderIntent',
confirmationStatus: 'NONE'
}
})
See this blog post.
The documentation states that:
Implementing the built-in intents is recommended, but optional.
I recommend that you define your own HelpIntent with overlapping utterances to the AMAZON.HelpIntent, but with your needed Slot types.
In this case, your service receives an IntentRequest for MyHelpIntent, even though these phrases overlap with the built-in AMAZON.HelpIntent.
The documentation also states, that this practice is not recommended, because the built-in intent may have a better coverage of sample utterances. It states that it is better practice to extend the built-in Intents. But (stupid enough from Amazon), the HelpIntent does not support Slots. So the only way would be a custom Help Intent.
I don't see a way to use Dialog Directives with the built-in Intents.
Here's a convoluted workaround that might work (there's no straight forward way right now, Nov 2018):
On every loop of the multi-turn dialog save your dialog based intent in the session attributes (the whole intent object, you can use the intent.name as key)
On every triggered intent (even HelpIntent) save the intent name in a lastIntent session attribute (to keep track of the previous intent name)
User triggers help and you're now in the HelpIntent. After you provide your help message append a question in the end that will cause the user to say something that will trigger your dialog based intent again
Do the following steps when you are in the dialog based intent and only if the lastIntent was HelpIntent (the one in the previous step):
Load the most recent intent data from the session attributes and, in it, delete the slot value and resolutions of the slot you want to elicitate (alternatively if you want to start from scratch you can delete the remaining slot values too, up to you)
Replace the current intent with the modified intent of the previous step
Emit a DialogDelegate with the current intent (your model needs to flag the slot you want to elicitate with elicitationRequired set to true)
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
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.