Chapter 3
Parameterizing Intents with Slots

Much of human communication is made up of sentences that have parameters. Someone might say, “The weather is cold today.” But on a different day, they may say, “The weather is warm today.” The only difference between these two sentences is the words “cold” and “warm.” They change the meaning of the sentence, but the purpose is the same with both: to describe the weather.

The same holds true when talking to Alexa. You might ask her to play Mozart. Or you might ask her to play Van Halen. Either way, the objective is the same (to play some music) although the specifics are different (Mozart vs. Van Halen).

The main thing that Star Port 75 Travel wants to offer to their clientele through their Alexa skill is the ability to schedule a trip to one of their several planetary destinations. For example, one potential space traveler might say something like “Schedule a trip to Mercury leaving Friday and returning next Thursday.” Another user may have a different trip in mind and say, “Plan a trip between June 9th and June 17th to visit Mars.”

Although these two requests are worded differently, their purpose is the same: to schedule a trip. The specifics—the destination, departure date, and return date—are parameters that define the trip that is to be scheduled. When handling such requests in an Alexa skill, these parameters are known as slots. We’re going to use slots in this chapter to handle parameters in the utterances spoken by the skill’s users.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset