Posts

DSC_0013 Zach Doty Cover Photo for Introduction to Machine Learning

An Introduction to Machine Learning

Howdy! This is an abrupt interruption to our regularly scheduled programming of SQL lessons, Amazon Alexa Skill development and Algorithmic trading. For those readers who don’t personally know me, I’m on a quest/streak to level up as a technologist.

Getting around to the point, I’ve been taking self-paced courses in varying forms to learn, apply and share new skills. However, I’ve heard the Coursera Stanford class in Machine Learning taught by Andrew Ng recommended so widely, I’m just going to doggedly sprint a marathon. I’m starting almost a week behind, working a busy job, trying to have a social life, and many other things…but darnit, I’m going to give this class my best shot. Hopefully I finish. 🙂

Okay, over-sharing complete. Let’s jump into a brief introduction of Machine Learning.

Machine learning, according to Andrew Ng (Chief Scientist at Baidu), is the science of getting computers to learn without being explicitly programmed.

Where is machine learning used in our lives?

Machine learning is employed a large number of actors. Here are a few examples:

  • Search engines, such as Bing, use machine learning to process MASSIVE amounts of data to quickly rank web pages in order of relevance, with limited human intervention.
  • Social networks, such as Facebook, use machine learning to recognize your friend’s faces for auto-tagging capabilities.
  • Email providers such as Apple Mail may employ spam filters that continuously learn to protect your inbox, your computer, and most importantly, your sanity.
  • Tech companies such as Amazon use natural language processing (NLP) to create conversational experiences and transactions with skills and services.
  • Entertainment companies such as Netflix use self-learning algorithms to recommend compelling new films and TV shows for those of you who binge watch

Where did machine learning come from?

Machine learning originated from a computer science field known as artificial intelligence. Long seen as a pipe dream from Star Trek (crass and careless reference, I know), machine learning is a practical and attainable segue to artificial intelligence, or machines and programs that contain some degree of self awareness.

This capability is a relatively new, yet a rapidly exploding field that grows as mathematical, statistical, hardware and software capabilities continue to compound and improve.

What follows is a better question still.

Where is machine learning headed?

Machine Learning in the future could look like a few different things (but not limited to this list, obviously!):

  • Predictive and preventative applications in engineering, medicine, and security
  • “Load bearing” performance in complex tasks, such as architecting, coding and programming self-driving cars
  • Coordinate machines and programs that study our behavior at our request and perform tasks, such as performing spring cleaning
  • Assistants or programs that are intelligent – able to optimize and independently solve problems on our behalf

Wrap-Up on the Machine Learning Introduction

That wasn’t so bad was it? We’ll follow soon with a more formal definition of Machine Learning and its various tranches of study. Cheers all.

Building an Interactive Alexa Quiz Skill, Part 2

Disclaimer: this was typed late at night on a tired mind. Please excuse typos, convention errors, and generally poor writing. 🙂

Howdy, Alexa nerds! Welcome back to our journey in learning Amazon Alexa Skill Development. Quick funny aside, would you care to guess my most common use of the Echo? It’s to play looong Spotify playlists that are basically background noise to help our new dog when Hannah & go to the gym or meet friends. Anyway!

Let’s jump back in. The previous article covered setting up an AWS Lambda function for the Alexa Skill Service. Now, we’ll be working more with the Skill interface. See below for the conceptual overview, or an early article on building Alexa skill interfaces for a basic fact skill.

2017-03-07-001-Alexa-Skill-Interface-Develpoment-Framework

 

Working in the Amazon Developer Console: Alexa Skills Kit

You probably know the drill now, log in to the Amazon Developer console. Once you’ve logged in, select the “Alexa” menu item from the home screen, then choose the “Alexa Skills Kit” Option.

2017-03-27-B-001-Alexa-Quiz-Skill-Create-Alexa-Skill-Interface-Start

If you’ve previously published or started development of skills, you should see them listed on this screen. Now, click, “Add a New Skill”. We should be looking at a very familiar screen here. 🙂

Add/edit the following:

  • Language (assuming you’ll leave the English US default here)
  • Name of the Skill displayed in the Alexa app and store
  • Invocation name users will speak to start your skill

Click Save and Next to proceed.

2017-03-27-B-002-Alexa-Quiz-Skill-Create-Alexa-Skill-Information

 

Working with the Interaction Model

Here comes the tough part, more copy and paste! Okay, sarcasm and humor doesn’t always translate well via text. We’re going to continue to lean fairly heavily on Amazon’s examples here to get ourselves familiarized with the more advanced concepts of intent schema and slot types.

That caveat aside, head back to the files we originally downloaded, but this time, we’re interested in the speechAssets folder and its contents:

  • json
  • Sample utterances (text document)

First, let’s open up the Intent Schema JSON file in our text editor of choice. Below, a look at what you should approximately be seeing. Copy and paste the entirety of the JSON file into the Intent Schema field of the Interaction Model tab.

2017-03-27-B-003-Alexa-Quiz-Skill-Create-Alexa-Skill-Intent-Schema-JSON

Audible: Our First Encounter with Custom Slot Types

Alright, no smooth segue here. We’re having the first encounter with what’s known as custom slot types.

If you were to try and save the skill progress so far, you’ll receive an error message from the developer console that says something like, “Error: There was a problem with your request: Unknown slot type ‘LIST_OF_ANSWERS’ for slot ‘Answer’. Why is that?

2017-03-27-B-004-Alexa-Quiz-Skill-Create-Alexa-Skill-Custom-Slot

If you take a closer look at the Intent Schema JSON file, you’ll notice that  most of the intents are built-in Amazon intents. E.g., “intent”: “AMAZON.RepeatIntent”. The “AnswerIntent” looks nothing like the built-in Amazon intents. Instead, we see a name, “Answer” and type, “LIST_OF_ANSWERS” that was so delicately referenced in the error message.

So how do we remedy this situation? We use the information presented to us in the error message and the JSON file to work our way over this issue. You’ll likely note under the custom slot types mentions “Enter Type”.

2017-03-27-B-005-Alexa-Quiz-Skill-Create-Alexa-Skill-Custom-Slot-Values

Match that information up with our error message and the JSON code, and we’ll enter, “LIST_OF_ANSWERS”. In the values section, we’ll enter on separate lines: 1, 2, 3, and 4. I’ll note here for clarity, that this essentially corresponds to the A/B/C/D multiple choice functionality of the quiz. We’ll see this in greater detail in a bit.

Okay, click “Add” as highlighted above, then click “Save”. Next, return to your files and open up the Sample Utterances text file. You should see something like the below.

2017-03-27-B-006-Alexa-Quiz-Skill-Create-Alexa-Skill-Sample-Utterances

You’ll note it’s quite a bit different than the previous, simple, fact-dispensing Skill we previously built. Take note of the {Answer} sample utterance. These are the pieces of dynamic input and interaction coming together into an Alexa Skill. We’ve defined a custom interaction outside of Amazon’s standard functions, and specified a range of acceptable answers the user can give us. That whole structure meets the user experience here, called in by the {Answer} slot name and custom slot type.

Enough conceptual babble. Copy and paste the sample utterances text into the developer console! Click Save beneath the sample utterances, and click Next.

2017-03-27-B-007-Alexa-Quiz-Skill-Create-Alexa-Skill-Sample-Utterances-List

 

Continuing the Skill Interface Build-out

Alright, so far, we’ve accomplished the following:

  • Provided basic skill information about our new skill
  • Specified details about the interaction model, including;
    • Intent Schema
    • Custom Slot Type
    • Acceptable/specified values for the custom slot type
    • Sample utterances

Next, we need to fill in some simple but crucial configuration details. Remember the ARN we generated by setting up the AWS Lambda function in the previous article? You need it here. Below you can see:

  1. I’ve selected the recommended endpoint type of AWS Lambda ARN
  2. Selected my geographic region of North America and,
  3. Pasted in the full ARN

I’m not going to work with account linking yet, because honestly, it looks really darn complicated and its well past midnight as I type this. Soon. 🙂 Click next and proceed to the testing tab!

In the testing tab, you should first see that the skill is enabled for testing on your account. You can:

  • play back responses from Alexa in the voice simulator to test pronunciation, etc
  • More importantly, use the service simulator to run a sample utterance, and see if your skill actually works.

2017-03-27-B-008-Alexa-Quiz-Skill-Testing-Alexa-Skill

Above, we can see the response to our sample utterance asking SEO Quiz returns as expected. Woohoo! Also, did you know the Alexa voice simulator automatically bleeps out most curse words? Did you know you can kind of work around that by putting extra vowels in the word? I digress. (It’s almost 1 am writing this now, productivity on the rise!) When you’re satisfied, click Next.

We’re getting close! Time to enter some publishing information. I’ll leave the first few sections to you: Category, Sub-Category, Testing Instructions, Country/Region availability, Short and Full skill descriptions.

Now, in the example phrases, I provided some updates to the sample utterances, namely to the starting Intent. Below, see the example phrases of “Alexa open SEO Quiz” and so forth. The “gotcha” here that set me back on my first skill is that the example phrases must be derived from your sample utterances.

2017-03-27-B-009-Alexa-Quiz-Skill-Testing-Alexa-Skill

Upload your 108×108 and 512×512 pixel icon images, click Next and submit the requisite privacy & compliance information. Done!

 

Wrap-Up

So, we’re mostly done, not completely done. The part for usto do now is customizing the template code in your AWS index.js file. Ideally, I would prefer a more eloquent closing, but it’s late, will have to wait for another time. Look after each other.

 

DSC_0002 Zach Doty Cover Photo for Interactive Alexa Quiz Skill Development

Building an Interactive Quiz Alexa Skill, Part 1

Hello Alexa geeks! Welcome back to our journey of learning how to develop Amazon Alexa Skills for the Echo and more. Last time, we completed the build process for our first simple “fact-dispensing” Alexa Skill.

In this article, we’ll start the process for a skill that accepts user input in the form of a quiz, fun! If you recall from our first skill, there are two parts to skill development:

  1. The Skill service development, in AWS (Lambda)
  2. The Alexa Skill interface details through the Amazon / Alexa Developer Console

 

2017-03-01-001-Alexa-Skill-Develpoment-Framework

 

Getting Started in AWS Lambda

You’ll notice as we progress from our early articles, there will be less detail paid to more basic instructions, such as our first! First, log in to the Amazon AWS portal.

Navigate to the Lambda service. If you’re the casual developer just working in this course, odds are the Lambda link will be near the top of screen under “Recently Visited Services”. Once you’ve clicked through, click, “Create a Lambda Function”.

2017-03-27-001-Alexa-Quiz-Skill-Create-AWS-Lambda-Function

On the next screen, you should see something like “Select blueprint” (Note: at the rate of change Amazon has been pursuing, this screen could change, even in a matter of weeks!) Click the “Blank Function” option, we’re starting this one from scratch!

2017-03-27-002-Alexa-Quiz-Skill-Create-Blank-AWS-Lambda-Function

The next screen should be, “Configure triggers”. Click inside the gray dash-outlined box, and select, “Alexa Skills Kit” from the dropdown menu. Click next!

2017-03-27-003-Alexa-Quiz-Skill-Configure-Alexa-Skills-Kit-Trigger

 

AWS Lambda Function Configuration for Alexa

Now we should be able to configure the basics of our function. Enter the following:

  • Function name
  • Description

The default runtime environment should be Node.js 4.3. If not, change it to Node.js 4.3.

(Note: Amazon just introduced support for Node.js 6.10, so that may be the preferred format going forward!) Will try to provide an article update, should that be the case.

2017-03-27-004-Alexa-Quiz-Skill-Configure-Alexa-Function

Onward! Now, we need to upload some code to this burgeoning success. Throwback time, do you remember the files we downloaded in one of the first articles? Time to go back to them again. In your folder of numbered skill templates, go to “2-reindeerGames”, “src” folder and safely open the index.js file in your text editor of choice.

2017-03-27-005-Alexa-Quiz-Skill-Lambda-Function-Code

Copy and paste (replacing all previous code) into the code window that should appear.  This assumes you’ve selected the Code entry type of “Edit code inline” for the Lambda function code. As we work on more increasingly more advanced skills, we will likely use the zip upload feature to accommodate additional code resources. The astute will note we’ve merely copied and pasted code here. Yes, we’ll go back and customize soon. 🙂

Beneath the code window, leave the index.handler intact, select an existing role option in the Role dropdown menu, and use the role we previously created. Leave the other settings as-is, click the “Next” button to review details, and click, “Create Function”!

2017-03-27-006-Alexa-Quiz-Skill-Lambda-Function-Creation

Be sure you take note / record the ARN in the upper right-hand corner, as we’ll need that in our forthcoming Skill Interface development section.

Wrap-Up

That’s the first part! I don’t know about you, but this is getting easier as I go. We’ll next cover the skill interface and customization to make it your own skill. If this is your first article, be sure to check out the running stable of articles on how to learn Amazon Alexa skill development. Also, there’s a growing body of work on how to learn PostgreSQL, and some fledgling articles on learning algorithmic trading, for good measure.

Share your experience, thoughts and feedback in the comments below. Don’t be a stranger, help your friends along in Alexa Skill development and share with them. Cheers!

 

 

 

 

 

 

How to Build Your First Amazon Alexa Skill, Pt. 2: Skill Interface

Welcome back, Alexa geeks! In the last article, we laid the groundwork for making our first Amazon Alexa skill. We covered the concepts and frameworks in Alexa skill development. We also did some work in AWS Lambda to prepare for voice requests  being made to our service.

 

Quick Recap on The Alexa Skill Service / AWS

We’ve slept a few times since covering the concepts and AWS framework, so let’s quickly recap.

2017-03-01-002-Alexa-Skill-Process-Framework

Whenever we use an Alexa skill , our voice data is processed through the hardware device, through the skill interface (what we’re looking at today) for language processing, then converted into text for a program to execute against, and back again. Simple enough, right?

In the last article, we looked at the “last” leg of this process, the skill service and AWS Lambda. Now, we’ll be working with that and the skill interface portion.

2017-03-07-001-Alexa-Skill-Interface-Develpoment-Framework

 

Setting Up the Basic Skill Information

Alright, log into the Amazon Developer Portal and Select the Alexa menu option. Once there, you should have a choice between the Alexa Skills Kit or the Alexa Voice Service. Click on the Alexa Skills Kit link to continue. You’ll want to click, “Add a New Skill”. Because I’ve already developed a skill, Silly Marketing Strategies is already there. However,  most of y’all will probably not have anything else on screen.

2017-03-07-002-Alexa-Skill-Interface-Develpoment-Framework

To start, you’ll want to select Custom Interaction Model, leave the default language to US (unless you’re developing in Espanol?). Type out the name and invocation name for your skill. The name isn’t necessarily important this moment. However, the invocation name will be extremely important!! This will be how users will call your Skill into service.

Note: the astute will notice I’ve deviated from the Space Geek example of the last article. More on that later. 🙂

When you’re ready, click next to proceed, and we’ll tackle the interaction model.

2017-03-07-003-Alexa-Skill-Interface-Develpoment-Framework

 

Setting up the Skill’s Interaction Model

Alright, time for some important things here. For the purposes of the factoid-based game, we’ll only be looking at the Intent Schema and Sample Utterances fields.

First, we need to look at the Intent Schema. Remember the files you downloaded in the first article? You’ll need to go into the SpaceGeek folder, Speech Assets sub folder and open the IntentSchema.json file. I’ve opened it up in Sublime Text 2 briefly, so we can take a quick look at the file. So this is JSON, with intent pairs. Below, we’ve got a pretty simple set, intents for retrieving a fact from the skill, getting help, stopping and cancelling a function. It’s easy right? Ha.

2017-03-07-004-Alexa-Skill-Interface-Develpoment-Intent-Schemas

Quick note: because these intents are proceeded by Amazon – it means they’re built in for Amazon. Enough babbling, copy and paste the contents of this file into the Intent Schema section of Amazon Developer Console.

2017-03-15-005-Alexa-Skill-Interface-Develpoment-Intent-Schemas-Utterances

Above, we’ve pasted in the Intent Schema. Next, we need to provide some sample utterances. Sample utterances are what you think users might say to engage your Alexa Skill. Below, we’ve provided such examples as, “Tell me a Weimaraner fact”.

Next, we need to hook up the Alexa Skill interface we’ve put together with some computing power. Specifically, we need to hook it up to AWS Lambda! (Remember the first article where we did a bunch of Lambda setup?)

If you recall, there was an Amazon Resource Name (ARN) string that we copied and saved to a text file. Retrieve it now and paste into the “Configuration” screen of the Skill interface setup.

2017-03-15-006-Alexa-Skill-Interface-Develpoment-Intent-Schemas-Utterances

Providing the ARN you’ve provided is valid, you should be able to proceed to the next step. Note: we are ignoring the account linking functionality for now. This functionality allows you, for example, to integrate Twitter sharing functionality into your skill by sharing a Tweet.

Next, we’ll move on to the Test tab. Three things (below) to take note of:

  1. Ensure you’ve completed the Interaction Model tab, so you can complete the testing in this tab.
  2. Try / type out key phrases in your skill to hear how they’ll be pronounced, via the Voice Simulator.
  3. Enter some utterances into the Service Simulator to A) make sure your skill is functioning as intended and B) Get a feel for how the end user experience will happen

2017-03-18-006-Alexa-Skill-Interface-Develpoment-Testing-Tab

Once you’ve tested your Skill, proceed to Publishing Information. Here, you’ll need to include the following:

  • Category of your Alexa SKill
  • The relevant Sub Category
  • Optional: testing instructions if your skill requires credentials or other unusual needs. You probably don’t need to include anything for this example
  • Country & Region targeting
  • Short Skill Description
  • Full Skill Description
  • Example Phrases, drawn from your sample utterances, and preceded by the Alexa wake word and skill invocation name
  • Optional: keywords that will help Alexa users find your skill in search
  • Images in 108 and 512 pixel squared dimensions

Below are a couple of screenshots for how I’ve filled out these fields.

2017-03-18-007-Alexa-Skill-Interface-Develpoment-Publishing-Information

2017-03-18-008-Alexa-Skill-Interface-Develpoment-Publishing-Information

Alright, we’re so close! The last field is Privacy & Compliance. For this example, you should be checking “No” to all the radio buttons:

  • No, skill doesn’t allow users to make purchases or spend real money
  • No, skill does not collect personal information from users
  • No, skill does not target children under the age of 13

However, do note that some of these things (except for child targeting) may change as we progress in our Alexa Skill development capabilities.

If desired (or later required by more advanced capabilities) you may specify privacy policy and terms of use URLs.

If you’ve completed the above, you should be good to Save & Submit for Certification!

 

Wrap Up

This is a deceivingly involved process. You will note that neither in the previous article, nor this article, have we changed the original source code for the SpaceGeek / Weimaraner Facts Skill. We’ll cover this in more detail in the next article. Until next time, check out my journey in learning NoSQL and keep an eye out for more content soon!

 

How to Build Your First Amazon Alexa Skill, Part 1 – The Skill Service

Introductory Disclaimer: AWS is changing, and changing fast! Between developing my first skill in mid-January 2017 and now going back to learn more / teach, quite a lot has changed in the AWS developer areas. All that to say is that I’ve already had to cobble screen shots together to make this article work, and the details could quickly become outdated. I don’t really intend to update this frequently, once I’ve completed my learnings. Apologies!

Welcome back, Amazon Alexa geeks! First, thanks for both your patience and kind feedback on the process of building your own Alexa and testing your DIY Alexa. Honestly, that was one of the hardest challenges I’ve had since first learning HTML / CSS coding back in college. (Thanks Raspian / Linux command line…)

Today, we’re getting back into actual Alexa skill development. We’ll be building your first (my second) Amazon Alexa skill for use on Echo and other devices.

Side note: I have previously developed an unremarkable skill, Silly Marketing Strategies, but I want to start fresh to:

  1. A) do it better, and,
  2. B) take a first stab at incorporating analytics capabilities into Alexa skills.

Without further ado, let’s get started with a conceptual overview to how Alexa skills work, and where developers (us!) play.

Quick Concept Introduction

First, let’s look at a simplified process of you using an Alexa skill:

2017-03-01-002-Alexa-Skill-Process-Framework

  • You’ll say something like, “Alexa, play Road Trip Country Playlist on Spotify”
  • The Echo, Fire TV, Raspberry Pi or other hardware takes in the audio and routes it into software/programs
  • The Alexa Skills Kit Interface employs speech recognition and natural language processing/understanding to convert your speech into text strings, then to code
  • The Skill service, facilitated by AWS Lambda processes the text strings against it’s suite of skills and programs, and outputs code,
  • Which is fed back through the programs to hardware and to a lovely voice response, something like, “Resuming your queue…”

That’s the front end experience. As a developer, we’ll hone in toward the “last” two parts of user experience. In that frame of reference, we start at the logic of our program, working “backwards” to handling user input, and the desired result.

2017-03-01-001-Alexa-Skill-Develpoment-Framework

Setting up AWS Lambda

Are we there yet? Okay, for real this time, let’s hop into code…by pulling up 2 URLs and logging in:

  1. https://aws.amazon.com
  2. https://developer.amazon.com/public/solutions/alexa

In the AWS console, you should see a screen like the below. First, update your region (top right) to US East, N. Virgnia. Why, you might ask? It’s the only region (currently, Mar. 2017) that supports Alexa.

2017-03-01-003-Alexa-Skill-Logging-In-AWS-Choose-Region

Next you need to select Lambda from the list of AWS services. It should be readily available on your screen. Mine will likely look a bit different from having used it already. 🙂

If you’re a first-time Lambda user, you’ll likely see a welcome/splash screen that resembles the following:

You’ll have the option to select a blueprint (optional). You should be able to click next, or, there should be an Alexa skills kit SDK fact skill option you can select.

Moving along, when you launch Lambda for the first time, you’ll need to configure triggers. Below, you’ll want to select the Amazon Skills kit, and click, “Next”. Why are we configuring triggers for functions? Because our Alexa Skill is event-based, and only triggers when an event pertaining to it occurs.

2017-03-01-005-Alexa-Skill-AWS-Triggers

You should now land on a Configure Function screen. These are the baby steps to making a skill! Give the skill a name and description. We’ve used SpaceGeek as values below, since we’ll be using the SpaceGeek template at first. Also, always select Node.js 4.3 for Alexa Skill Development.

2017-03-01-006-Alexa-Skill-AWS-Lambda-Functions

Beneath the basic naming and settings is a Lambda function code section. Choose the “Upload a .ZIP file” option. Remember all the files we downloaded in our first article? You’ll need to go the SpaceGeek folder, src subfolder and zip the contents (shown below) and upload accordingly.

2017-03-01-007-Alexa-Skill-AWS-Lambda-Alexa-Skill-Sample-Files

(You can download the sample files again if needed from here.

Note: It’s March 2017, I started in Jan. 2017 and the original tree /Github URL has already been deprecated. Zoinks, it’s moving fast!)

After you’ve uploaded the file, you need to create a new role from templates (beneath the file upload you just completed.) Feel free to name the role whatever you like, but the important detail here is that you select the S3 object read-only permission option under the policy templates dropdown selection.

2017-03-01-008-Alexa-Skill-AWS-Lambda-Settings

Finally! You should be able to click, “Next” and clear this screen. You should see a review screen confirming the selections you’ve made. Click, “Create Function” and proceed! You should land within the Function itself. Since my new experience was already spent, here’s what the equivalent screen looks like, for Silly Marketing Strategies.

2017-03-01-009-Alexa-Skill-AWS-Lambda-SMS-Function

Last thing you’ll want to do is copy the ARN into a text file, word document, etc. for safekeeping down the line. You’ll need it soon.

Wrap Up

Alright, we made a ton of progress in today’s article! I was hoping to make more progress, but the process of organizing, documenting, processing and writing is quite time consuming. It’s now 1 a.m. local time for me, and I need sleep for a long day at work tomorrow! We’ll be back very soon on how to work on the Skills Interface (utterances, logic, etc.) in more detail to publish your first skill! If you’re new or need a refresh, here’s our running list of articles on how to learn Amazon Alexa Skill development.

Update: Testing Your DIY Amazon Alexa / Echo Device (Raspberry Pi)

Hey there folks, happy weekend! Hope this post finds you well. This is a follow up to my previous post on how to make your own Amazon Alexa / Echo device from a Raspberry Pi.

First, an Apology for the Cliff Hanger

I left you hanging at the end of that post, and I’m very sorry about that. It was a Friday morning at almost 4 a.m., and I was ready for bed. So, here we are on the weekend! I’ve now had the chance to do some further validation and documentation in testing our DIY Amazon Alexa / Echo from a Raspberry Pi.

The samples I’ve provided aren’t super in depth, but serve as proof of concept.

Recap: Where We Left Off

Here’s where we were at the end of the last article:

The first terminal will set Alexa up to be listening on port 3000 (remember the local host URLs from earlier?) The second window deals with setting up a Java client and logging into Amazon with the Security profile we set up. Logging in and confirming will enable you to initiate the connection to Alexa, paving the way for the third terminal, which enables the wake word detection and actual running of the Alexa service. Woohoo! I’ll update with examples later.

I’ve booted up our trusty Raspberry Pi back up, and opened 3 command line terminals.

Preparing for Test

1. Companion Service

First item of business, is to run the companion service, first command line terminal. Type the below:

cd Desktop/alexa-avs-sample-app/samples/companion service && npm start

After returning the above line of code, successful output should end with, “Listening on Port 3000” and “Successfully retrieved registration code for xxxxxxx / xxxxxxx ”

Below, steps 1 & 2 combined since I was a bit slow on thinking to photograph in the moment. 🙂

2017-02-26-001-Running-Alexa-AVS-Companion-Service

2. Java Client / Authorizing Device

The second piece for testing here is the Java client and authorizing the device with Amazon. (Remember the security profile setup from the previous How to Build Article?) In the second command line terminal, type the following:

cd Desktop/alexa-avs-sample-app/samples/javaclient && mvn exec:exec

A few things should happen here, outside of Matrix-like code waterfalls. First, a window prompting you to login to Amazon to enable the security profile for your device should appear. Second, after you click through to the browser (or paste URL into browser), you should see a log-in screen like the below. Enter your credentials, approve access, and close the window after you see a screen that displays the message, “device tokens ready”

2017-02-26-002-Verify-Raspberry-Pi-Alexa-Voice-Service

After you’ve completed the above steps, you should have a window (slightly hidden in the center, photo above) with a bearer token and a button to listen. At this point, I just ran a simple test saying, “hello” and Alexa said, “hello” back. We’re almost there!

3. Wake Word Detection / Connecting to AVS Client

The final piece is connecting to the AVS client and enabling wake word detection, which means we don’t have to press the “Listen” button every time we want to do something. Last piece of command line!

cd Desktop/alexa-avs-sample-app/samples/wakeWordAgent/src && ./wakeWordAgent -e kitt_ai

After the script runs, the last line of code output should read, “Connected to AVS Client”. You’re now ready to use Alexa.

2017-02-26-004-AVS-Client-Connected-Wake-Word-Detection-On

Testing!

Below is one of the quick tests I ran on Pi Alexa. Si

mple time check and request for a joke. Now we’re cooking with gas!

 

Wrap Up

Building an Alexa has been a very instructive process. I don’t know about you, but I’m ready for actual skill development now. Stay tuned as I recap the changes through my first Alexa skill, a remix of the Space Geek sample, and begin working through more advanced skills and concepts such as analytics integration. Cheers!

Getting Started with Alexa Development 02: Signing Up to Alexa Development Portal

Welcome back to our journey in learning how to program Amazon Alexa Skills via Echo voice search. In the previous article, we walked through the process of setting up an Amazon Web Services (AWS) account. Today, we’ll set up an account at the Alexa Development portal, a distinct entity from the AWS portal.

 

Without further ado, let’s jump in. Go to https://developer.amazon.com/public/solutions/alexa.

2017-02-03-001-Alexa-Developer-Home-Screen

You should land on something like the above screen. Click on the “Sign In” button, you can create a new account from this screen if you need.

Important Note: If you already have an Amazon.com account (regular old Amazon shopping account), use those credentials to log in.

Obviously, if you’re a returning Alexa Development Portal user, you can skip the account creation process shown below. If you’re creating a new account, you’ll need to fill out a screen that will likely resemble the below, and click “Save and Continue” when you’ve finished.

2017-02-03-002-Alexa-Developer-Account-Creation

Next, you should be presented with an App Distribution and Services Agreement screen. Be sure to give it a quick read. If you want to use the services, then you’ll need to agree by clicking save and continue. 🙂

The final registration step addresses payments and whether you plan to monetize the apps you develop. For the purposes of my usage, and this learning, I checked “No” to both options before proceeding.

2017-02-03-003-Alexa-Developer-Account-Creation-Monetization

Once you finish that step, you should find yourself in the Amazon Developer Console! Good thing we got the hard material out of the way first, huh?

This should wrap up a pretty quick introductory section for setups. Feel free to visit my previous article on getting set up with AWS, or go to my learning home page on how to start developing Alexa Skills. Thanks and see you at the next article!

DSC_0071 Zach Doty Cover Photo for Amazon Alexa Skill Development AWS Account Setup

Getting Started with Amazon Alexa Development: Signing Up To Amazon Web Services (AWS)

Welcome back, folks, to our foray into Amazon Alexa Skill Development. If you’ve visited the blog recently, you’ll notice I’ve been juggling a few subjects for a minute, including SQL. For context, here’s our first article, starting Amazon Alexa skill development from the absolute beginning. (Following my haphazard skill development of Silly Marketing Strategies at the beginning of the year.)

In the previous article, we prepared ourselves for skill development by downloading public sample materials from Amazon’s Alexa Skills Kit Github page. Now, we’ll look at Amazon Web Services, one of the world’s largest (is it the largest?) public cloud computing platforms.

First, navigate to https://aws.amazon.com/. Click on “Create an AWS Account”, or equivalent, if you’re seeing something different. Note: this sign-up shouldn’t incur cost for you today, unless you choose otherwise. (Quick disclaimer, I’ll obviously try to supply the most accurate information possible. However, I cannot ultimately guarantee its accuracy. That you must do for yourself.)

2017-01-30-001-AWS-Home-Screen

Here, you’ll sign up and create a new account or log in. Note: if you have a regular Amazon login, I believe you can use that here. Because I have an existing Amazon account, most of my steps will follow accordingly, however, I’ll try to recreate where I can, like below.

2017-01-30-002-AWS-Signup-Login-Screen

If you’re creating a new account, then you’ll be prompted to choose between a company account and a personal account. Below is a preview of what the personal account signup page might look like.

2017-01-30-003-AWS-Account-Creation

Next, you’ll be prompted to set up payment options. (Obviously, we’re s electing a free account for the purposes of this educational exploration.)

2017-01-30-004-AWS-Payment-Information

You’ll next be asked to verify your phone number via a call requesting a PIN shown on screen. From there, you should be able to proceed  to the support plan selection screen, upon which I recommend choosing the free Basic version. After selecting all the appropriate options, you should be able to create your account!

2017-01-30-005-AWS-Account-Creation-Confirmation

Now that you’ve created an account, click “Sign In to the Console” or “Complete Sign Up”. You’ll re-enter your login credentials and proceed. You should now land on the Developer Console root page. (Note: Amazon, like Google, runs a ton of UI tests, so what you see may be slightly different than the below.)

2017-01-30-006-AWS-Developer-Console-Landing

The first order of business in our new account is to secure it. Click on your name in the top right and in the resulting dropdown menu, select “My Security Credentials”.

2017-01-30-007-AWS-Security-Preferences

Manage / Activate your MFA, and select a virtual device. This means you’ll need to perform some setup so you can scan a QR code with your phone (via Google QR code scanner app). I’ve skipped some illustrations and details here, because I’m not sharing my details, nor should you. What a somber ending to the article! In the next post, we’ll cover signing up for the Alexa Developer Portal, as we get move toward becoming proficient Amazon Alexa Skill Developers.

 

The Absolute Beginning for Amazon Alexa Voice Skill Development

An Introduction to this Alexa Learning Journey

So if you’ve visited my site at all in the past, you’ll notice this is the most blogging I’ve done in…ever? Put another way, a significant confluence of factors has dialed up my motivation to doggedly pursue learning and growth. So, here we are at learning Alexa skills!

A few weeks ago, I was suckered by the cheap promise of a free hoodie from Amazon, in exchange for building and publishing my first Amazon skill. You can experience the equally cheap output of that effort by saying, “Alexa, start silly marketing strategies” (again and again.)

Is it a good skill? No! Nor am I going to pull a Dollar Shave Club here either. It’s a bad skill! It’s not interactive. You just have to keep asking it over and over for some dumb buzzword-laden sentences. I promise I only account for 75% of the utterances. 🙂

2017-01-25-001-Silly-Marketing-Strategies

Honestly, I’m thrilled to have published an Alexa skill. But there’s so much more out there! Thus, I’m embarking on yet another educational journey, this one into Amazon Alexa Voice Skill Development.

Getting Set Up with Resources You Need for Alexa Skill Development

The instructions below are for PC only. Apologies, Mac users!

  1. You need to create a folder directory in which we’ll be housing our various materials and code.
  2. Visit the Alexa Skills Kit JS Git Hub page and download all materials as a ZIP.
    1. 2017-01-25-002-Alexa-Skills-Kit-JS-Git-Hub
  3. Once you’ve downloaded the ZIP file, move it from your default Downloads directory, and into the folder you created in Step 1.
  4. Extract the ZIP file. The unzipped folder should be named, by default, “alexa-skills-kit-js-master”. Within the unzipped folder is yet another folder of the same name.
  5. Take the all the contents within the two folders described above, and move them into the “Alexa” directory, higher up.
    1. Move the contents from the “samples” folder into the main “Alexa” directory, so the skill folders (spaceGeek, reindeerGames, etc.) are in the umbrella directory.
  6. When you’ve completed Step 5, you should be left with A) Three text files, and a bunch of skill folders, B) an empty “samples” folder [A&B you moved up two directories into the “Alexa” umbrella folder], C) an empty “alexa-skills-kit-js-master” folder and D) the original zip file.
  7. Delete items B, C, and D from step 6.
  8. Download and install a code/text editor. I personally prefer Sublime Text 2, but a lot of folks prefer Notepad++ as well.
    1. A dedicated code/text editor is highly preferable here, as much of the code for the Alexa skills in JS – Node.JS in particular, I believe.
  9. After you’ve muddled your way through this folder architecture, go into the README file and not the order of Skills. Number the skill folders accordingly in the umbrella directory, excluding helloWorld. (You should have skills 1-9, starting with spaceGeek and ending with ChemistryFlashCards.)

2017-01-25-003-Alexa-Folder-Structure

Alright, that’s it for now! Next, we’ll look at setting up access to Amazon Developer and Amazon Web Services.