Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Alexa Skills Projects
Alexa Skills Projects

Alexa Skills Projects: Build exciting projects with Amazon Alexa and integrate it with Internet of Things

By Madhur Bhargava
$15.99 per month
Book Jun 2018 250 pages 1st Edition
eBook
$35.99
Print
$43.99
Subscription
$15.99 Monthly
eBook
$35.99
Print
$43.99
Subscription
$15.99 Monthly

What do you get with a Packt Subscription?

Free for first 7 days. $15.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing
Table of content icon View table of contents Preview book icon Preview Book

Alexa Skills Projects

Chapter 1. What is Alexa?

"I definitely saw some power in voice. It's a very powerful form of storytelling."

– Akilah Bolden-Monifa

For our human ancestors, as their brains evolved, so did their language, from signs and sounds to a more sophisticated form of oral speech, which made them capable of having complex conversations to form the social ties required for their survival. Unlike written communication, oral speech leaves no traces of its own, hence it was hard for historians to calculate an exact date for the origin of speech. However, using various methods, historians have speculated that speech was developed 300,000 years ago, symbols 30,000 and writing 7,000 years ago. Ever since then, humans have been putting speech and voice to various creative uses.

In this chapter, we shall explore one such use of our voice, the ability to command interactive voice-based personal assistants to perform specific tasks at will. Also before that, we will also understand what an intelligent voice-based personal assistant is, what needs it fulfills, and what voice-based personal assistants are available (including Alexa) in the current market by going through the following topics:

  • The Need for Voice-Based Personal Assistants
  • Applications of Voice-Based Personal Assistants
  • A Comparison of Various Voice-Based Personal Assistants

So, let's move on to our first topic.

The Need for Voice-Based Personal Assistants


To understand the evolution of voice-based personal assistants, we will have to go back in time and see some of the important events that led to their advent. One of these many events was the evolution of computers. Although not directly related to the voice revolution, the evolution of computers played a key role in the evolution of voice-based personal assistants because it marked the invention of the internet, which is the backbone of most voice-based personal assistants. The computer revolution also introduced critical changes concerning hardware and integrated circuits, which we shall discuss next.

The computer revolution began in the 19th century when Charles Babbage invented the first analytical engine, which earned him the nickname the Father of Computers. The 1950s and 1960s were interesting times, which introduced some tremendous advances in the field of computer science with a groundbreaking invention, integrated circuits. Integrated circuits replaced diodes and vacuum tubes, which led to tremendous form factor changes in existing computers, in turn leading to smaller, more compact sizes. It was also the time when Gordon Moore introduced his famous observation that the number of transistors in an integrated circuit doubles every two years; roughly speaking, we would be able to pack more and more processing power into an integrated circuit while the size of the circuit would shrink every two years. Moore's observation already foresaw the future of our technology and hardware, and by following it we could have easily predicted at least one thing, that we would be seeing our computers getting smaller, a lot smaller, and voilà, today nearly everyone has a small computer in his/her hands, their smartphone.

The late '60s and early '70s also saw the advent of the Advanced Research Projects Agency Network (ARPANET), which eventually evolved to become the internet as we came to know it in the '80s. All this sounds trivial at first, before you realize that all these were the key factors that, had they not been invented, we would have never seen voice-based personal assistants in action.

Prior to voice-based personal assistants, the traditional way of sending commands to a computer system was either through the GUI using a mouse or through the terminal using a keyboard. As the form factor of traditional computing systems reduced, the input methods evolved too and initial handheld devices/mobile phones introduced a stylus in addition to the traditional keyboard to leverage the touchscreen capabilities of the device:

Figure 1.1: A smartphone with a stylus, captured in the year 2010

The evolution continued and the place of the stylus was taken by, as pointed out by Steve Jobs,"the best pointing device in the world," our fingers.

Note

Steve Jobs introduced touch on the iPhone by using the term "best pointing device in the world" for a user's fingers in 2007 during the MacWorld Conference in San Francisco. The highlights of this conference are available on YouTube at https://www.youtube.com/watch?v=P-a_R6ewrmM.

As the interface between computers and humans grew thinner, it was only natural that voice was the next medium that could act as an input tool to computing devices, and hence there has been the advent of voice-based personal assistants.

Note

The idea of having voice as an input medium for computing devices was not new; parallel to the computer revolution, there was also the voice revolution, many important discoveries of which are shown in the link: https://voicebot.ai/2017/07/14/timeline-voice-assistants-short-history-voice-revolution/

Of the many milestones of the voice revolution, almost every reader will be familiar with at least a few of the latest ones, namely Siri, Google Now, Cortana, and Amazon's Alexa. The most popular ones are Apple's Siri and Google's Google Now, which initially appeared integrated with iOS and Android mobile devices, respectively.

Apple's Siri initially appeared as an app on Apple's App Store, but was later acquired by Apple and became much more closely integrated with iOS devices. Siri uses a natural language interface to listen to commands from the user and perform the necessary actions. Also, with the coming of macOS Sierra, its capabilities were no longer limited to iOS devices:

Figure 1.3: The capabilities of Siri also extend to desktops in addition to iPhones

Google closely followed in the footsteps of Apple and, shortly after the introduction of Siri in 2011, introduced Google Now in 2012. Unlike Siri, Google Now was available natively for Android and also as a separate app for iOS devices. Google Now seamlessly integrated with other Android/Google features such as Gmail, Google Calendar, and the mighty Google Search itself:

Figure 1.4: Google Now is available on iOS as part of a native app (Google and the Google logo are registered trademarks of Google Inc., used with permission.)

Closely behind Google was Microsoft with its own intelligent voice-based assistant, Cortana, which it introduced in 2014 for desktop and mobile devices:

Figure 1.5: Microsoft's Cortana was initially introduced for Microsoft's mobile and desktop computing systems 

As time passed, it became evident that voice-based personal assistants were here to stay and needed exclusive hardware and space of their own. This was something that Amazon took the lead on with the introduction of its brand Amazon Echo, which was a device family of smart speakers, specifically designed and developed by Amazon Inc. to enable its users touse the services of an interactive voice-based personal assistant called Alexa (hence the title of the chapter):

Figure 1.6: The Amazon Echo device family

The complete Echo family and their functionalities are described in the following table:

Device

Use

Amazon Echo

Original flagship smart speaker.

Echo Dot

Smaller and cheaper version of Echo without the amplified speaker, so the sound quality is also inferior to Echo.

Echo Plus

Latest version of Echo with Zigbee integration.

Echo Show

Alexa-enabled device with a large touchscreen so that a user's interaction with Alexa is not just auditory but also visual.

Echo Spot

Show+Dot=Spot. All the basic functionality of Show and Dot devices with the much lesser form factor.

Amazon Tap

Alexa-enabled Bluetooth speaker.

The Echo family marked Amazon's second foray into the hardware domain, the first being its introduction of the popular ebook reader, Kindle. Google also recognized the fact that interactive voice assistants can do much more by specifically leveraging the smart home concept and closely followed behind Amazon with its Google Home Smart Speaker, which contained Google Assistant as Alexa's counterpart:

Figure 1.7: Launch timeline for various voice-based personal assistants (source: www.citiusminds.com)

Please note that the preceding diagram does not include Google Now, which was introduced in 2012.

We have discussed the evolution of voice-based interactive personal assistants and how they developed from just another app on the user's smartphone to the user's smart home.

In the next section, we shall discuss some of the popular uses of voice-based interactive personal assistants.

Applications of Voice-Based Personal Assistants


We discussed the evolution of voice-based personal assistants in the previous section. In this section, we shall extend that discussion to some of the popular uses of each of the interactive voice-based personal assistants, irrespective of whether the assistant in question is desktop, smartphone, or smart home-based. We shall begin with one of the earliest and most well-known ones, Apple's Siri.

Siri

As indicated earlier, Siri started as a separate smartphone app in 2011 for iOS, which was later on acquired by Apple. Initially, the capabilities of Siri were limited to smartphones and simple functions such as:

  • Looking up contacts
  • Messaging (SMS)
  • Fetching weather updates on user demand, plus other simple queries as mentioned in the previous section

However, Apple's roadmap also extended the capabilities of Siri by closely integrating it with third-party apps and, true to their promise, with the coming of iOS 10, Apple also released SiriKit.

Note

To know more about SiriKit, please visit https://developer.apple.com/sirikit/.

If the user has the following third-party apps installed, he/she can request a ride using Siri:

  • Uber
  • Lyft

If the user has the following third-party apps installed, he/she can set those to send a message (and not just an SMS) using Siri:

  • WhatsApp
  • LinkedIn
  • WeChat
  • Slack

A user can also make VoIP calls using the following apps via Siri:

  • Skype
  • Viber

Note

Please note that the preceding lists are not exhaustive. However, third-party integrations were not the only thing on Apple's roadmap to extend the capabilities of Siri. The launch of macOS Sierra also brought the capabilities of Siri to the desktop. To know more about Siri's desktop capabilities, please visit https://support.apple.com/en-us/HT206993.

Siri can also help a user to:

  • Search files on his/her Mac
  • Notify the user about their storage space
  • Send requests to FaceTime with Contacts, and many others as shown here:

Figure 1.8: List of things Siri can help with (non-exhaustive) (source: www.osxdaily.com)

With a fair idea about Siri's desktop and smartphone capabilities, let's now move on to another popular voice assistant.

Google Now

We are going to discuss the Android and Google Now next, which at the time of writing is the biggest player in the smartphone market and also the home of Google Now, the voice assistant introduced by Google for Android smartphones in 2012.

In early 2010, the smartphone market was dominated by many players. Over the years, this has filtered down and only two major players remain in the market as depicted as follows:

Figure 1.9: Smartphone market share distribution comparison between the years 2010 and 2016 (Data sourced from Gartner)

Google Now can do pretty much all that Siri can accomplish; however, it has better integration with the web and web-based queries, since the web is Google's main forte. Some of the things that a user can ask Google Now are:

Figure 1.10: Some of the things that Google Now can do (Data source: www.cnet.com)

Apart from Google Now, Google also has introduced Google Assistant, which is a more evolved version of Google Now, given the fact that the user can hold full-length conversations with Google Assistant, which is not possible with Google Now.

It is very likely that Google Now will be phased out and Google Assistant will take its place; however, Google Assistant is currently only available on Google Home, which is Google's smart home speaker; the Android Pixel 2 smartphone; and for Android Wear:

Figure 1.11: Devices on which Google Assistant is available (Google and the Google logo are registered trademarks of Google Inc., used with permission.)

Now, moving on from the smartphone market to the desktop market:

Figure 1.12: Desktop market share as of January 2017 (Data source: www.windowscentral.com)

As shown in the preceding graph, as of January 2017, the desktop market had Windows, Linux, and Mac OS X as major players, with Microsoft being the dominant force, which brings us to our next personal assistant.

Cortana

With Microsoft's clear dominance of the desktop market, we cannot ignore Cortana, which is Microsoft's answer to Siri and Google Assistant, but focused on desktop and Windows Mobile:

Figure 1.13: List of some things that Cortana can help with

Not just limited to Windows 10, Windows 10 Mobile, and Windows Phone 8.1, Cortana is also available for:

  • iOS (as a separate app)
  • Android (as a separate app)
  • Xbox One
  • Invoke smart Bluetooth speaker by Harman Kardon

Some of the many things that Cortana can accomplish are:

  • Web-based queries using Bing Search (for example, "Who is the President of the United States?")
  • Launch apps and turn on/off Wi-Fi/Bluetooth
  • Ask about weather
  • Manage appointments, reminders, and events

With that, we come to discuss the Star of this book.

Alexa

Alexa, the whole center point of this chapter and the book, is the interactive voice-based personal assistant by Amazon, originally introduced with its family of Echo devices. Alexa as an assistant is oriented towards a smart home concept, hence most of its use comes from Amazon Echo, a smart speaker designed and developed to be kept in the living room of the user's home so that the user can ask it day-to-day queries about weather, food recipes, and jokes, or play interactive trivia games, set alarms, shop for day-to-day items, and much more. The following diagram shows some of the things that a user can ask Alexa:

Figure 1.14: List of some things that Alexa can help with 

The capabilities of Alexa can also be extended by installing third-party skills (similar to Google Home's third-party apps). Each third-party skill is meant to serve a specific purpose. For example, the Uber skill allows you to order a ride, the Domino's skill allows you to order a pizza—all from the comfort of your home and through the magic of your voice working together with Alexa.

As of the time of writing this, there are more than 15,000 skills available for Alexa with Uber and Lyft being the most used ones in the travel category, Pandora and Spotify for music streaming, and multiple other skills being utilized in home automation.

A Comparison of Various Voice-Based Personal Assistants


Due to our previous discussions, we already know that each market, whether it is desktop, smartphones, or smart homes, has a steady supply of interactive voice-based personal assistants. Almost every assistant can do whatever its counterparts can accomplish, but this leads to the question, where do the actual differences lie? Is there something that Alexa can do better than Google Assistant or vice versa?

This book is based on Alexa, which is a Smart-Home basedpersonal assistant, so in this section, we shall compare Alexa and Google Assistant to understand the finer differences between the two:

Alexa

Google Assistant

Uses the invocation phrase, "Alexa"

Uses the invocation phrase, "OK, Google"

Flagship hardware—Amazon Echo device family

   Flagship hardware—Google Home, Pixel 2, Android Wear

Responds slightly better to e-commerce/shopping-related queries, since that is Amazon's main forte

Responds slightly better to web-based queries since Google's major forte is web searching

Slightly inferior contextual awareness

Better contextual awareness, hence conversations seem a little more natural

Capabilities of Alexa can be extended by installing third-party "skills"

Capabilities of Google Assistant can be extended by installing third-party apps; however, it has fewer apps currently available for it in the market than Alexa has skills

A wider range of integration with smart home devices such as smart lights, smart locks, smart switches, and smart thermostats

Slightly narrower range of integration with smart home devices

In a nutshell, both Google and Alexa are very skilled voice-based assistants and accomplish a lot for their users; however, since Google Assistant is fairly new to the market, its integration and compatibility with third-party apps and hardware is still evolving, albeit at a very rapid pace. However, even being the newer of the two, Google Home still fares better in terms of web integration and contextual awareness.

It would be really interesting to see what the evolution of AI and Machine Learning brings to the table in the coming era and how these assistants are able to leverage that.

Summary


In this chapter, we covered the evolution of interactive voice-based personal assistants and the various factors involved in their move from a user's smartphone to their smart home. We also saw the various interactive voice-based personal assistants in the smartphone, desktop, and smart home markets, and the capabilities of each.

Our goal was to get the reader familiar with the history of interactive voice-based personal assistants so that over the course of the book, we can direct our focus onto Alexa, the interactive personal assistant bundled with Amazon Echo. The next chapter will enable the reader to understand the anatomy of an Alexa Skill and to hands-on program an Amazon Echo so that Alexa can learn to say one of the oldest phrases in computer programming, "Hello, World."

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • • Gain hands-on experience of working with Amazon Echo and Alexa
  • • Build exciting IoT projects using Amazon Echo
  • • Learn about voice-enabled smart devices

Description

Amazon Echo is a smart speaker developed by Amazon, which connects to Amazon’s Alexa Voice Service and is entirely controlled by voice commands. Amazon Echo is currently being used for a variety of purposes such as home automation, asking generic queries, and even ordering a cab or pizza. Alexa Skills Projects starts with a basic introduction to Amazon Alexa and Echo. You will then deep dive into Alexa Programming concepts such as Intents, Slots, Lambdas and maintaining your skill’s state using DynamoDB. You will get a clear understanding of how some of the most popular Alexa Skills work, and gain experience of working with real-world Amazon Echo applications. In the concluding chapters, you will explore the future of voice-enabled applications and their coverage with respect to the Internet of Things. By the end of the book, you will have learned to design Alexa Skills for specific purposes and interact with Amazon Echo to execute these skills.

What you will learn

• Understand how Amazon Echo is already being used in various domains • Discover how an Alexa Skill is architected • Get a clear understanding of how some of the most popular Alexa Skills work • Design Alexa Skills for specific purposes and interact with Amazon Echo to execute them • Gain experience of programming for Amazon Echo • Explore future applications of Amazon Echo and other voice-activated devices

Product Details

Country selected

Publication date : Jun 29, 2018
Length 250 pages
Edition : 1st Edition
Language : English
ISBN-13 : 9781788997256
Category :

What do you get with a Packt Subscription?

Free for first 7 days. $15.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

Product Details


Publication date : Jun 29, 2018
Length 250 pages
Edition : 1st Edition
Language : English
ISBN-13 : 9781788997256
Category :

Table of Contents

14 Chapters
Title Page Chevron down icon Chevron up icon
Dedication Chevron down icon Chevron up icon
Packt Upsell Chevron down icon Chevron up icon
Contributors Chevron down icon Chevron up icon
Preface Chevron down icon Chevron up icon
1. What is Alexa? Chevron down icon Chevron up icon
2. Hello World, Alexa! Chevron down icon Chevron up icon
3. Hands-Free Experience with Alexa Chevron down icon Chevron up icon
4. Let's Play Factly with Alexa Chevron down icon Chevron up icon
5. Making Alexa Talk About CryptoCurrencies Chevron down icon Chevron up icon
6. Home Automation with Alexa Chevron down icon Chevron up icon
7. The Future of Voice-Based Personal Assistants Chevron down icon Chevron up icon
1. Other Books You May Enjoy Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Empty star icon Empty star icon Empty star icon Empty star icon Empty star icon 0
(0 Ratings)
5 star 0%
4 star 0%
3 star 0%
2 star 0%
1 star 0%
Top Reviews
No reviews found
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is included in a Packt subscription? Chevron down icon Chevron up icon

A subscription provides you with full access to view all Packt and licnesed content online, this includes exclusive access to Early Access titles. Depending on the tier chosen you can also earn credits and discounts to use for owning content

How can I cancel my subscription? Chevron down icon Chevron up icon

To cancel your subscription with us simply go to the account page - found in the top right of the page or at https://subscription.packtpub.com/my-account/subscription - From here you will see the ‘cancel subscription’ button in the grey box with your subscription information in.

What are credits? Chevron down icon Chevron up icon

Credits can be earned from reading 40 section of any title within the payment cycle - a month starting from the day of subscription payment. You also earn a Credit every month if you subscribe to our annual or 18 month plans. Credits can be used to buy books DRM free, the same way that you would pay for a book. Your credits can be found in the subscription homepage - subscription.packtpub.com - clicking on ‘the my’ library dropdown and selecting ‘credits’.

What happens if an Early Access Course is cancelled? Chevron down icon Chevron up icon

Projects are rarely cancelled, but sometimes it's unavoidable. If an Early Access course is cancelled or excessively delayed, you can exchange your purchase for another course. For further details, please contact us here.

Where can I send feedback about an Early Access title? Chevron down icon Chevron up icon

If you have any feedback about the product you're reading, or Early Access in general, then please fill out a contact form here and we'll make sure the feedback gets to the right team. 

Can I download the code files for Early Access titles? Chevron down icon Chevron up icon

We try to ensure that all books in Early Access have code available to use, download, and fork on GitHub. This helps us be more agile in the development of the book, and helps keep the often changing code base of new versions and new technologies as up to date as possible. Unfortunately, however, there will be rare cases when it is not possible for us to have downloadable code samples available until publication.

When we publish the book, the code files will also be available to download from the Packt website.

How accurate is the publication date? Chevron down icon Chevron up icon

The publication date is as accurate as we can be at any point in the project. Unfortunately, delays can happen. Often those delays are out of our control, such as changes to the technology code base or delays in the tech release. We do our best to give you an accurate estimate of the publication date at any given time, and as more chapters are delivered, the more accurate the delivery date will become.

How will I know when new chapters are ready? Chevron down icon Chevron up icon

We'll let you know every time there has been an update to a course that you've bought in Early Access. You'll get an email to let you know there has been a new chapter, or a change to a previous chapter. The new chapters are automatically added to your account, so you can also check back there any time you're ready and download or read them online.

I am a Packt subscriber, do I get Early Access? Chevron down icon Chevron up icon

Yes, all Early Access content is fully available through your subscription. You will need to have a paid for or active trial subscription in order to access all titles.

How is Early Access delivered? Chevron down icon Chevron up icon

Early Access is currently only available as a PDF or through our online reader. As we make changes or add new chapters, the files in your Packt account will be updated so you can download them again or view them online immediately.

How do I buy Early Access content? Chevron down icon Chevron up icon

Early Access is a way of us getting our content to you quicker, but the method of buying the Early Access course is still the same. Just find the course you want to buy, go through the check-out steps, and you’ll get a confirmation email from us with information and a link to the relevant Early Access courses.

What is Early Access? Chevron down icon Chevron up icon

Keeping up to date with the latest technology is difficult; new versions, new frameworks, new techniques. This feature gives you a head-start to our content, as it's being created. With Early Access you'll receive each chapter as it's written, and get regular updates throughout the product's development, as well as the final course as soon as it's ready.We created Early Access as a means of giving you the information you need, as soon as it's available. As we go through the process of developing a course, 99% of it can be ready but we can't publish until that last 1% falls in to place. Early Access helps to unlock the potential of our content early, to help you start your learning when you need it most. You not only get access to every chapter as it's delivered, edited, and updated, but you'll also get the finalized, DRM-free product to download in any format you want when it's published. As a member of Packt, you'll also be eligible for our exclusive offers, including a free course every day, and discounts on new and popular titles.