Intranoggin

Blither, Blather, Web Content Management.
Blog » Alexa on Azure: Part 4 – New Utterances

Alexa on Azure: Part 4 – New Utterances

imageWhen I got my first version of the Ask Teenage Daughter skill pushed into the Amazon Developer Portal, it seemed to be working fine when testing through the browser. However, when I began testing it on the device, I found that I needed to adjust my utterances. Here are my previous utterances.

AskTeenageDaughterStatus What's up
AskTeenageDaughterStatus How's it going
AskTeenageDaughterStatus What's the word
AskTeenageDaughterStatus what's going on
AskTeenageDaughterStatus what are you doing
AskTeenageDaughterStatus how was your day
AskTeenageDaughterStatus how did you sleep
AskTeenageDaughterStatus good morning
AskTeenageDaughterStatus good night
 
AskTeenageDaughterParticipation Do you want to {Activity}
 
AskTeenageDaughterOpinion What do you think about {Subject}

That seems right, at least it did to me. It seems like the natural language one would use when speaking directly to another person.

  • “What are you doing?”
  • “How did you sleep?”
  • “Do you want to __?”
  • “What do you think about ___?”
  • “Good Morning”

What I failed to take into account was that I  won’t be saying any of these things directly to teenage daughter. Instead, I’ll be asking Alexa to relay the message or ask a question.

  • “Alexa, ask teenage daughter What are you doing?”
  • “Alexa, ask teenage daughter How did you sleep?”
  • “Alexa, ask teenage daughter Do you want to __?”
  • “Alexa, ask teenage daughter What do you think about ___?”

Those are all clunky and unnatural. (“Alexa, tell teenage daughter Good Morning.” still works though)

More natural interactions would be:

  • “Alexa, ask teenage daughter what she’s doing”
  • “Alexa, ask teenage daughter how she slept”
  • “Alexa, ask teenage daughter if she wants to __”
  • “Alexa, ask teenage daughter what she thinks about ___”

Another thing I found is that for the AskTeenageDaughterParticipation Intent, I was asking things about things with a verb+noun combination.

  • Alexa, ask teenage daughter if she wants to eat breakfast.
  • Alexa, ask teenage daughter if she wants to go jogging.
  • Alexa, ask teenage daughter if she wants to start homework.

Each of those resulted in a clunky response:

  • “eat breakfast sucks”
  • “go jogging sucks”
  • “start homework sucks”

I wanted a more natural response

  • breakfast sucks
  • jogging sucks
  • homework sucks

I added in a bunch of new utterances that included common verbs before the {Activity} slot.  Obviously, I can’t account for all situations with this method, but it’s getting better.

Attempt 1: FAIL

On the AskTeenageDaughterOpinion intent, I had just the one sample utterance “What do you think about?” That’s clunky too: “Alexa, ask teenage daughter what do you think about {Subject}. I had to make similar adjustments there to make it more natural and added an additional utterances that , eliminates but I also added one that is just “about {subject}” = “Alexa, ask teenage daughter about {subject}”

My adjusted SampleUtterances.txt file is

AskTeenageDaughterStatus What's up
AskTeenageDaughterStatus How's it going
AskTeenageDaughterStatus What's the word
AskTeenageDaughterStatus what's going on
AskTeenageDaughterStatus what are you doing
AskTeenageDaughterStatus how was your day
AskTeenageDaughterStatus how did you sleep
AskTeenageDaughterStatus good morning
AskTeenageDaughterStatus good night
AskTeenageDaughterStatus How she's doing
AskTeenageDaughterStatus what she's doing
AskTeenageDaughterStatus what she's up to
AskTeenageDaughterStatus how her day was
AskTeenageDaughterStatus how did she sleep
AskTeenageDaughterStatus how school was
 
AskTeenageDaughterParticipation Do you want to {Activity}
AskTeenageDaughterParticipation If she wants to {Activity}
AskTeenageDaughterParticipation If she wants to go {Activity}
AskTeenageDaughterParticipation If she wants to eat {Activity}
AskTeenageDaughterParticipation If she wants to do {Activity}
AskTeenageDaughterParticipation If she wants to be {Activity}
 
AskTeenageDaughterOpinion What do you think about {Subject}
AskTeenageDaughterOpinion What she thinks about {Subject}
AskTeenageDaughterOpinion about {Subject}

When testing that out, it almost always resolved to the AskTeenageDaughterStatus intent resulting in a growl. That was not the response I wanted, thus an accurate representation of an real teenage daughter. However there is a lot of stuff that sucks that I felt was being underrepresented in these responses.

Attempt 2

I didn’t want to go down the path of creating hundreds of sample utterances to account for every possible question. Besides, there are so many things that suck. How could I possibly cover them all? Plus it seemed unnecessary. Plus I eventually want to keep tabs on the different types of questions being asked so I could potentially create custom responses for some of them later on. To do that, I’ll need to get more from the utterance than just the subject or activity.

I came across this article: Why a Custom Slot is the Literal Solution. In it the  article, Michael Palermo discusses 3 scenarios: Collecting an arbitrary word, Instrumenting the Skill, and a Catch all option. These all hit home with what I was trying to do. After reading the article several times over and testing adjustments to my project, I ended up with a few more slots in my IntentsSchema, a very simple SampleUtterances file, and several more entries in my custom slots file.

My simplified SampleUtterances.txt

AskTeenageDaughterStatus {CatchAll}
 
AskTeenageDaughterParticipation {Query} {Activity}
 
AskTeenageDaughterOpinion {Question} {Subject}
AskTeenageDaughterOpinion {Question} {Subject} was
AskTeenageDaughterOpinion {Question} {Subject} is
AskTeenageDaughterOpinion {Question} {Subject} feels

New IntentSchema.json

{   "intents": [     {       "intent": "AskTeenageDaughterParticipation",       "slots": [         {           "name": "Query",           "type": "QUERY"         },         {           "name": "Activity",           "type": "ACTIVITY"         }       ]     },     {       "intent": "AskTeenageDaughterOpinion",       "slots": [         {           "name": "Question",           "type": "QUESTION"         },         {           "name": "Subject",           "type": "SUBJECT"         }       ]     },     {       "intent": "AskTeenageDaughterStatus",       "slots": [         {           "name": "CatchAll",           "type": "CATCHALL"         }       ]     }   ]
}

And my new custom slot values

QUERY
If she wants
If she wants to
If she wants to go for a
If she wants to go for an
If she wants to eat a
If she wants to eat an
If she wants to be a
If she wants to be an
If she wants to go
If she wants to eat
If she wants to do
If she wants to be
come eat
to go
to do
to be
go
do
be
eat
 
ACTIVITY
Dressed
Bed
dinner
homework
 
 
QUESTION
What she thinks about
What she wants for
What she likes
How was
How her
How
about
 
SUBJECTS
Math
English
Gym
Lunch
Dinner
Shopping
Class
School
Practice
 
 
CATCHALL
What's up
How's it going
What's the word
what's going on
good morning
good night
How she's doing
what she's doing
what she's up to
how her day was
how she slept
seed load
heap belong harmony true
imperfect towering momentous
iron premium icky creepy scent sneeze versed special
broad hilarious lamentable rare
wind unwieldy invite mellow bomb intelligent evanescent
scribble stretch statuesque flesh cut
ring orange profuse
imported cute tangible balance appreciate cheap ear steer women
notice rifle man purple discussion blink
peep abnormal tie subdued stereotyped yielding
explain numberless board
stretch fanatical
corn mammoth form dry land successful laborer vagabond
rescue shape thaw valuable
exciting parched pancake statement argument sheet

The random word generator method that Michael described works surprisingly well for the CatchAll slot. I added these to the bottom of some of the expected utterances, but I don’t think the expected utterances are actually needed any more.

One other change I made: I knew it would be a matter of minutes before my kids began asking teenage daughter what she thought of dad and mom, so I put in some special handling around them. Spoiler alert: teenage daughter thinks we’re the best!

Next steps: It would probably be a good idea to log all of these so they could be adjusted as needed over time. I’m not sure right now how difficult that would be.

I’m also toying with the idea of changing the responses to be as if Alexa is relaying a message back to me. Instead of replying just “School sucks” Alexa could reply “She says school sucks.” Could be fun.


Posted: 3/2/2017 7:00:00 AM by Ryan Miller | with 0 comments