-1

I want to make a simple Q&A Alexa app similar to Alexa's custom Q&A blueprint app. I don't want to use blueprints because I need additional functionality. What is the best practice for creating the Alexa app? Should I create a separate intent for each question or should I somehow use utterances?

Bruce Wong
  • 25
  • 4

2 Answers2

2

The best way depends upon what the questions are and how it will be asked.

1. If the questions has a simple structure
Consider these examples:

what is a black hole
define supernova
tell me about milkyway
what is a dwarf star

then it can be configured like this in an intent:

what is a {space}
define {space}
tell me about {space}

and the slot {space} -> black hole, supernova, milkyway, dwarf star. From the slot value, you can understand what the question is and respond. Since Alexa will also fill slots with values other than those configured, you will be able to accommodate more questions which follows this sentence structure.

2. If the question structure is little complex

what is the temperature of sun
temperature to boil water
number of eyes of a spider 
what is the weight of an elephant

then it can be configured like this in an intent:

what is the {unit} of {item}
{unit} to boil {item}
{unit} of eyes of a {item}
what is the {unit} of an {item}

Here,

{unit} -> temperature, number, weight, height etc.
{item} -> sun, moon, water, spider etc

With proper validation of slots you will be able to provide the right answer to the user.

Also, you will be able to provide suggestions if the user asks a question partially.

Ex:

user: what is the temperature 
[slots filled: "unit"="temperature","item":""]

Now, you know that the user asked about temperature but the item is missing, so you respond back with a suggestion like this

"Sorry I didn't understand. Do you want to know the temperature of the sun?"

3. If the questions has totally different structure

How to deal with an annoying neighbor
What are the types of man made debris in space
Recommend few good Nickelback songs
Can I jump out of a running train

If your questions are like this, with total random structure, you can focus on certain keywords or crust of the question and group them. Even if you can't group them, find out the required fields or mandatory words.

IntentA: How to deal with an annoying {person}
IntentB: What are the types of man made {item} in {place}
IntentC: Recommend few good {person} songs
IntentD: Can I {action} out of a running {vehicle}

The advantage of using slots here is that even if the user asks a partial question and an associated intent is triggered, you will be able to identify it and respond back with an answer/suggestion or error message.

Ex:

user: what are the types of man made mangoes in space 
[IntentB will be triggered]

If you have configured this without a mandatory slot, your backend will be focusing on the intent triggered and will respond with the right answer (man made debris in space), which in this case won't make any sense to the user.

Now, with proper usage of slots and validation you can find that instead of debris your backend received "mangoes" which is not valid. And therefore you can respond back with a suggestion or error message like

"Sorry, I don't know that. Do you want to know about the man made debris found in space"

Grouping questions will help you to add other similar questions later with ease. You can use one intent per question if it is too difficult to group. But remember to validate it with a slot if you want to avoid the situation mentioned right above.

While naming question-intents use a prefix. This might help you to group handlers in your backend code depending on your backend design. This is not mandatory, just a suggestion.

Summary:

  1. Group questions with similar structure.
  2. Use slots appropriately and validate them.
  3. Use predefined slots wherever possible.
  4. Don't just depend on intents alone, because intents can be mapped if its the closest match. But the question might be entirely different or might not make any sense. So use slots appropriately and validate them.
  5. If possible provide suggestion for partial questions.
  6. Test thoroughly and make sure it wont break your interaction model.
johndoe
  • 4,387
  • 2
  • 25
  • 40
0

You should check Alexa Dialog Interface that allow you to make Q/A or QUIZZ.

https://developer.amazon.com/fr/docs/custom-skills/dialog-interface-reference.html

Nearyuk
  • 167
  • 2
  • 12