Latest news about Bitcoin and all cryptocurrencies. Your daily crypto news habit.
This blog is one of two blogs on the same topic wherein, I will show you how easy it is to make Alexa work for you. In this blog we will see how to use Alexa developer’s portal to configure any new skill that you might want to add to Alexa.
What is Amazon’s Alexa?
Alexa is Amazon’s cloud-based voice service available on tens of millions of devices from Amazon and third-party device manufacturers. With Alexa, you can build natural voice experiences that offer customers a more intuitive way to interact with the technology they use every day.
Aim
The skill that we want our Alexa to learn is a basic thesaurus skill of finding definition, antonyms and synonym of any word. Pretty useful and easy skill to start with.
Approach
We will be using Python 2.x as the programming language of our choice for this project. The approach is generic enough to work with any programming language. Right now, we will be using our laptop as the server that will serve request to user’s query.
Before we code anything, let’s understand the jargons and concepts on how does Alexa understand your speech.
Below are the 3 possible search queries that Alexa should understand if configured properly.
Definition SearchSynonym SearchAntonym Search
In the above-mentioned examples, Alexa first tries to understand the intent of what user is trying to say, thereafter locating the entities that fulfill that intent.
After the extraction of intent and slot entities from the user’s voice query is done, those values hit our server which are conditioned to handle those variables in a specific way and thereafter accordingly returning the desired output back to the user with Alexa’s voice output feature.
Alexa Developer Portal
So, we will be using flask-ask, a wrapper over flask for building Alexa skills easier and much more fun.
To start with, visit Alexa Developer’s Portal. The learn section is some pretty extensive resource for learning Alexa development. Since in the above example we talked about intent and entity slots, we will now see on how to configure Alexa so that it knows, what are the entities and intent possible with this specific skill. Click on Start Skill and you will be redirected to Alexa Skills Page. Now click on Create a Skill and after you give a name to your skill, select custom model from the screen following it thereafter, you will be redirected to model creation skill builder page which looks similar to as shown below.
Custom Model because we are building the skill from scratch.
Next, we will define the invocation name for our skill, listening to which Alexa will trigger our skill. You can locate it under build tab to the left side of the screen. There are various guidelines to how you should define invocation name which you can read under help section. For now, we will name our skill English Aunty.
So, the way we invoke our skill would be:
Alexa, ask english aunty synonym of unstoppable.
Brilliant, we are half way done. Let’s now build our intent and entity model.
Any skill by default is provided with 3 built-in intents — Amazon.CancelIntent, Amazon.HelpIntent, Amazon.StopIntent. We will be building 3 more intents by the name of DefSearch_Intent, AntSearch_Intent, SynSearch_Intent.
You will be asked to enter sample queries for each intent you define. For ex. I had defined below shown queries for the DefSearch_Intent intent.
You might be noticing {search_string_def} in all of the above queries. Those are the slots where in the word to search for fits in. There are multiple pre-trained slot types available to choose from. AMAZON.SearchQuery fits best for our use-case. You can refer Slot reference to look for other options.
Similarly, we follow this procedure for the remaining two intents. Click on Build Model to build the intent and entity model.
We are done with configuring all of the required things for our application to work. In the next blog, we will see how we can connect our code to fetch intent specific queries with Alexa to serve user’s request.
Feel free to comment and share your thoughts. Do share and clap if you ❤ it.
Alexa, I am your boss! was originally published in Hacker Noon on Medium, where people are continuing the conversation by highlighting and responding to this story.
Disclaimer
The views and opinions expressed in this article are solely those of the authors and do not reflect the views of Bitcoin Insider. Every investment and trading move involves risk - this is especially true for cryptocurrencies given their volatility. We strongly advise our readers to conduct their own research when making a decision.