How strong is Alexa NLP? - alexa

I have below utterances in my intent.
What is the parameter value for today ?
What's the parameter value for today ?
What is a parameter value ?
Whats a parameter value ?
Now, if I ask alexa "what was my parameter value for today ?", It cant understand.
So, I wonder do I need to add all possible utterances with all tense, verbs, phrases, articles in mind ?

Alexa's NLP is very good. From my experience, I can say that it's constantly improving. The utterances you mentioned above can be minimized to just one or two. Ideally, you should give some 10 to 15 variants or more which covers the specified user intention and not duplicates of the same utterances.
Anyway, I tried your utterances as it is and got the intent recognized.

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

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

Using apostrophes for Alexa slots

I am developing an Alexa skill, where I have a stop for names of fruits. However, if I speak something like "What is apple's cost" where the slot value has an apostrophe, Alexa does not seem to recognize the apostrophe. Workaround is to say something like "What is the cost of an apple" but that would not be the best customer experience.
How can I make Alexa understand slot value with apostrophes? Any help is appreciated.
I think this is what you are looking for.
Create Intents, Utterances, and Slots (Rules for Sample Utterances)
If the word for a slot value may have apostrophes indicating the
possessive, or any other similar punctuation (such as periods or
hyphens) include those within the brackets defining the slot. Do not
add 's after the closing bracket. For example: ...
My friend, the apostrophe could be parsed depending on the voice recognition system internally, but it will never understand in real time an apostrophe.
Good news though, you dont need the apostrophe, think about it, it is only recognizing what the custommer would say without capital letters and special characters. Meaning, if the custommer says "What is apple's cost", alexa would recognize as the following "what is apples cost". This is a problem that should be worked server-side, cause you only need to understand what the custommer meant. You should implement server side a string matching function using levenshtein's algorithm.

workaround for alexa not understanding the word 'postpaid' in my skill

Alexa just doesn't understand the word 'postpaid' and I've tried it a million times in my skill. I also tried "Alexa, Simon says postpaid" but it repeats something else other than postpaid, I don't know why. My sample utterance is like this "what is the {type} sales" and the type has custom slot values "postpaid",etc.
I've looked at AMAZON.LITERAL but didn't quite understand it if it will help me in my case. So any workaround will be helpful and thanks in advance.
What does Alexa think you said? Maybe you can use that in your intent also. Your code can check for and replace whatever that is to "postpaid".
This is a bit of a hack, but may work for you until Amazon provides us with a way to fine tune input.
Alexa will not always restrict the transcription the options in a slot to the given values, specially if you have a large list of possible values. Either using a list or AMAZON.LITERAL, in this case, your best bet may be to check wether the identified value is in fact one of the values in your list and use it, otherwise, you can use a phonetic matching/similarity algorithm to select the closest value.
Hit me up if you need example code (in Python in my case)
This feels simplistic but have you tried breaking postpaid into two words?
{type} == "post paid"
Slots can contain multi word utterances. Perhaps Alexa will recognize the two distinct morphemes.

alexa skill does not recognize my correct answer

i wrote a simple Q&A Alexa skill which ask the user to guess about the planet name based on its property.
questions are like "Which is the brightest planet in the solar system"
when user respond as Venus. Alexa says that the answer is incorrect. the correct answer is venus.
I am not sure why cant it recognize.
There are a few places things can be going wrong.
1) Just because the user said it, doesn't mean that's what Alexa heard. Did you confirm in the companion app that Alexa heard the word "venus"? Did you try the simulator and type in Venus? That would get past it parsing what you said.
2) How are you testing the answer? Alexa, typically, returns things in lower case, since there is no casing in spoken language. Venus is a proper name, so I'm not sure it would return it as upper case or lower case. Either way, if you are using a case sensitive string compare then you need to make sure the cases match, or else use a case insensitive string comparison. If you are using Javascript, tips on doing case insensitive comparisons are here.
3) How are you recognizing the answer? Do you have a separate intent for "Venus"? Do you have a slot for it? Do you use a LITERAL with multiple utterances for examples? Do you use a custom slot? Each of these will return the results in different ways. The best option is to use a custom slot.
4) Have you checked your log files? What is your code actually receiving from Alexa? If your code doesn't print it, add extra log statements to see what your code is getting, and what you are doing with it.
You have not given enough information in your question to answer it definitively. Hopefully the above will give you ideas how to work the answer out yourself, or will prompt you to update your question with better information.

Resources