Advanced Alexa Skill NLU Tutorial

Introduction

In the previous tutorial, we implemented the Wise Guy skill with ChatFlow. Everything was smooth except one thing - creating the Speech Assets.

This still be a painful process, but luckily we have a solution - NLU.

In this tutorial, we will teach you how to use ChatFlow’s companion AI engine NLU to easily generate the Intent Schema and Sample Utterances needed for Speech Assets.

Create an NLU Project

The following video shows how to quickly create an NLU project for Wise Guy. It’s 6 minutes long and we hope you enjoy Kevin MacLeod’s Firebrand as background music.




You can also quickly reproduce this project by importing this JSON file in NLU.

Exporting to Alexa Format

  1. Click “Export” then “Alexa Skills”, a pop up with the three speech assets will appear.

Note

The three fields follow the format of ASK Custom Interaction Model.

  1. Copy all three sections into their respective sections in the Alexa Skill Kit developer.

Below is an example of what you should expect as the output of the Export/Alexa feature.

Intent Schema

The Intent Schema will contain only user-defined intent and slot. If you need any Amazon default intent, please manually add them.

{
    "intents": [
        {
            "intent": "SetupNameWhoIntent",
            "slots": [
                {
                    "name": "SetupName",
                    "type": "LIST_OF_SetupName"
                }
            ]
        },
        {
            "intent": "TellMeAJokeIntent"
        },
        {
            "intent": "WhosThereIntent"
        }
    ]
}

Custom Slots

Custom Slots are list of phrases for slots (entities). NLU also supports list of regular expressions to match entities. The Alexa console does not support it.

LIST_OF_SetupName:
to
beets
little Old Lady
a broken pencil
snow
boo
woo
spell
atch
owls
berry

Sample Utterances

Sample utterances are all utterances in the project, with intents and slots (entities) marked within utterances. It follows the old verbose style, and you can migrate to new improved interfaces.

WhosThereIntent who is there
WhosThereIntent whos there
WhosThereIntent who there
WhosThereIntent who is this
WhosThereIntent whos this
TellMeAJokeIntent tell me a joke
TellMeAJokeIntent tell a joke
TellMeAJokeIntent say a joke
TellMeAJokeIntent give me a joke
TellMeAJokeIntent tell me a knock knock joke
TellMeAJokeIntent tell a knock knock joke
TellMeAJokeIntent say a knock knock joke
TellMeAJokeIntent make a knock knock joke
TellMeAJokeIntent give me a knock knock joke
TellMeAJokeIntent a joke
TellMeAJokeIntent a knock knock joke
TellMeAJokeIntent the joke
TellMeAJokeIntent the knock knock joke
TellMeAJokeIntent whats a joke
TellMeAJokeIntent what is a joke
TellMeAJokeIntent if it can tell a joke
TellMeAJokeIntent will it tell me a joke
TellMeAJokeIntent call it tell me a joke
TellMeAJokeIntent to tell me a joke
TellMeAJokeIntent whats a knock knock joke
TellMeAJokeIntent what is knock knock joke
TellMeAJokeIntent if it can tell me knock knock joke
TellMeAJokeIntent will it tell me a knock knock joke
TellMeAJokeIntent can it tell me a knock knock joke
TellMeAJokeIntent to tell me a knock knock joke
SetupNameWhoIntent {to|SetupName} who
SetupNameWhoIntent {beets|SetupName} who
SetupNameWhoIntent {snow|SetupName} who
SetupNameWhoIntent {boo|SetupName} who
SetupNameWhoIntent {woo|SetupName} who
SetupNameWhoIntent {spell|SetupName} who
SetupNameWhoIntent atch who
SetupNameWhoIntent {owls|SetupName} who
SetupNameWhoIntent {berry|SetupName} who
SetupNameWhoIntent {little old lady|SetupName} who
SetupNameWhoIntent {a broken pencil|SetupName} who

Finally, copy these exports and fill them in the Interaction Model following Step Sample Utterances in the basic Alexa tutorial:

_images/wise-guy-interaction-model.png

Summary

In this tutorial, we have shown you how to quickly build an NLU project and incorporate it into an Alexa Skill. KITT.AI NLU provides an interactive interface for you to quickly bootstrap an NLU engine with minimal data. You can immediately observe system’s performance, mark and correct inaccurate predictions, and improve the NLU engine on the fly. It’s a great assistant to building an Alexa skill.

Happy Alexa skills building!!!