Alexa Skills Projects - Madhur Bhargava - E-Book

Alexa Skills Projects E-Book

Madhur Bhargava

0,0
31,19 €

-100%
Sammeln Sie Punkte in unserem Gutscheinprogramm und kaufen Sie E-Books und Hörbücher mit bis zu 100% Rabatt.

Mehr erfahren.
Beschreibung

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.

Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:

EPUB
MOBI

Seitenzahl: 163

Veröffentlichungsjahr: 2018

Bewertungen
0,0
0
0
0
0
0
Mehr Informationen
Mehr Informationen
Legimi prüft nicht, ob Rezensionen von Nutzern stammen, die den betreffenden Titel tatsächlich gekauft oder gelesen/gehört haben. Wir entfernen aber gefälschte Rezensionen.



Alexa Skills Projects

 

 

 

 

 

 

 

 

 

 

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

 

 

 

 

 

 

 

 

 

Madhur Bhargava

 

 

 

 

 

 

 

 

 

 

 

 

 

 

BIRMINGHAM - MUMBAI

Alexa Skills Projects

Copyright © 2018 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.

Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book.

Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.

Commissioning Editor: Gebin GeorgeAcquisition Editor:Divya PoojariContent Development Editor:Eisha DsouzaTechnical Editor:Sneha HanchateCopy Editor:SafisProject Coordinator:Shweta H BirwatkarProofreader: Safis EditingIndexer:Rekha NairGraphics:Jisha ChirayilProduction Coordinator: Nilesh Mohite

First published: June 2016

Production reference: 1290618

Published by Packt Publishing Ltd. Livery Place 35 Livery Street Birmingham B3 2PB, UK.

ISBN 978-1-78899-725-6

www.packtpub.com

 

Dedicated to everyone who is taking their first steps in learning about voice computing. May the force be with you.
mapt.io

Mapt is an online digital library that gives you full access to over 5,000 books and videos, as well as industry leading tools to help you plan your personal development and advance your career. For more information, please visit our website.

Why subscribe?

Spend less time learning and more time coding with practical eBooks and Videos from over 4,000 industry professionals

Improve your learning with Skill Plans built especially for you

Get a free eBook or video every month

Mapt is fully searchable

Copy and paste, print, and bookmark content

PacktPub.com

Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at [email protected] for more details.

At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters, and receive exclusive discounts and offers on Packt books and eBooks.

Contributors

About the author

Madhur Bhargava is specialized in Wireless and Mobile Computing from CDAC ACTS Pune, India. He started his career at Electronic Arts as a software engineer working on mobile games. He later addressed problems in personalized healthcare, leveraging the power of mobile and voice computing. He is proficient in various mobile/embedded technologies and strives to be a software generalist. He believes that good software is a result of talented individuals working together as a communicative team in an Agile manner. He likes to spend time with his family, read, and watch movies.

I would like to thank my family and the team of amazing people I am working with. They are the reason that made this book happen.

About the reviewer

Srini Janarthanam is an expert in Chatbots, NLP and AI technologies with over 10 years of experience. He got his Ph.D. from The University of Edinburgh. He worked as a researcher at Edinburgh and Heriot-Watt Universities where he worked on several research projects and authored over 50 conference/journal publications. He runs a chatbot and AI solutions agency - Chatomate. He recently authored the book Hands On - Chatbots and Conversational UI Development published by Packt.

 

 

 

Packt is searching for authors like you

If you're interested in becoming an author for Packt, please visit authors.packtpub.com and apply today. We have worked with thousands of developers and tech professionals, just like you, to help them share their insight with the global tech community. You can make a general application, apply for a specific hot topic that we are recruiting an author for, or submit your own idea.

Table of Contents

Title Page

Copyright and Credits

Alexa Skills Projects

Dedication

Packt Upsell

Why subscribe?

PacktPub.com

Contributors

About the author

About the reviewer

Packt is searching for authors like you

Preface

Who this book is for

What this book covers

To get the most out of this book

Download the example code files

Download the color images

Conventions used

Get in touch

Reviews

What is Alexa?

The Need for Voice-Based Personal Assistants

Applications of Voice-Based Personal Assistants

Siri

Google Now

Cortana

Alexa

A Comparison of Various Voice-Based Personal Assistants

Summary

Hello World, Alexa!

An Introduction to Amazon Echo

Amazon Echo – First Generation

Amazon Echo – Second Generation

Anatomy of an Alexa Skill

Invocation Name

Intents and Slots

Lambda

Hello Alexa – Building a Hello World Alexa Skill

Summary

Hands-Free Experience with Alexa

Overview of the Handsfree Messenger Skill

Configuring the Twilio Messaging Backend

Configuring the Handsfree Messenger Skill

Coding the Lambda function

Testing the Skill

Summary

Let's Play Factly with Alexa

Motivation for Designing Factly

Designing the Factly Skill

Building the Factly Skill

Configuring the Lambda function

Coding the Lambda function

Adding Persistence to Factly

Updating the Factly Lambda Code to Introduce Persistence

Testing the skill

Summary

Making Alexa Talk About CryptoCurrencies

A Brief Introduction to Cryptocurrencies

Designing the CryptoOracle skill

Building the CryptoOracle skill

Configuring the Lambda function

Coding the Lambda function

Testing the skill

Summary

Home Automation with Alexa

Introduction to Home Automation and Ambient Sensors

Designing the Ambience Manager Skill

Developing the Mobile App

Setting up Firebase

Developing the Ambience Manager Skill

Configuring the Lambda function

Coding the Lambda function

Testing and debugging the Skill

Summary

The Future of Voice-Based Personal Assistants

Popular Alexa Skills

Games and Trivia

News

Music and Audio

Education and Reference

Lifestyle

Comparing Various Voice-Based Assistants

Amazon Echo

Google Home

Apple HomePod

Future of Voice-Based Assistants

Summary

Other Books You May Enjoy

Leave a review - let other readers know what you think

Preface

The advent of voice computing in recent years has caused a tectonic shift, with the result being that interactive voice-based personal assistants no longer lurk in the shadows, and Amazon Alexa, Siri, and Google Now have become common household names. Apart from their traditional abodes of mobile devices, these assistants can also be found in the center of our living and dining rooms in the form of Amazon Echo, Google Home, and Apple HomePod devices.

This book focuses on harnessing the power of voice computing by studying Alexa, which is the interactive voice-based personal assistant used in Amazon Echo. Over the course of this book, we will embark on a journey to understand the internals of Alexa and how it works under the hood, while creating five unique Alexa Skills, each of which will be designed to address a specific purpose and a real-world use case.

I hope you enjoy the journey!

Who this book is for

This book is aimed at everyone who is interested in learning about the underlying voice computing technology on which Amazon Echo and Alexa are based, and also learning how we can leverage that technology to create skills for Alexa oriented towards home automation, the Internet of Things, and various other domains.

What this book covers

Chapter 1, What Is Alexa?, is an introductory chapter that does not require any coding skills. We discuss how intelligent voice-activated personal assistants are evolving from just being passively present in mobile phones to becoming a permanent fixture in common households in the form of dedicated hardware devices.

Chapter 2, Hello World, Alexa!, will introduce the reader to the process of creating skills for Alexa and will explain how to create a basic Hello World Alexa skill.

Chapter 3, Hands-Free Experience with Alexa, will introduce a new way of sending messages using Alexa, that is, the hands-free way.

Chapter 4, Let’s Play Factly with Alexa, will create a game called Factly as an Alexa skill. We will also add persistence to it using DynamoDB.

Chapter 5, Making Alexa Talk about CryptoCurrencies, will demonstrate how Alexa can provide the latest cryptocurrency updates. The user will create an Alexa skill that can fetch the current prices of the latest cryptocurrencies, such as Bitcoin and Ethereum.

Chapter 6, Home Automation with Alexa, will demonstrate how Alexa can integrate with other IoT devices and create the foundation of a smart home. The user will create a Weather Monitor Alexa skill that can inform the user about the climate (temperature/humidity/light) in the home.

Chapter 7, Future of Voice-Based Personal Assistants, will talk about the future of the intelligent voice-based personal assistants.

To get the most out of this book

The following are the prerequisites to get the most out of this book:

Basic familiarity with a modern programming language such as JavaScript. All of the code that we'll write for the Lambdas is based on Node.js.

Free Tier Amazon AWS Developer account.

Basic familiarity with code editors.

Not mandatory, but recommended is an Amazon Alexa-enabled device, such as an Amazon Echo.

Over the course of this book, we will be making many configuration changes via the Amazon Developer Portal. We recommend that you follow these steps as described, so a good Internet connection is highly recommended.

Download the example code files

You can download the example code files for this book from your account at www.packtpub.com. If you purchased this book elsewhere, you can visit www.packtpub.com/support and register to have the files emailed directly to you.

You can download the code files by following these steps:

Log in or register at

www.packtpub.com

.

Select the

SUPPORT

tab.

Click on

Code Downloads & Errata

.

Enter the name of the book in the

Search

box and follow the onscreen instructions.

Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:

WinRAR/7-Zip for Windows

Zipeg/iZip/UnRarX for Mac

7-Zip/PeaZip for Linux

The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/Alexa-Skills-Projects. In case there's an update to the code, it will be updated on the existing GitHub repository.

We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Download the color images

We also provide a PDF file that has color images of the screenshots/diagrams used in this book. You can download it here: http://www.packtpub.com/sites/default/files/downloads/AlexaSkillsProjects_ColorImages.pdf.

Get in touch

Feedback from our readers is always welcome.

General feedback: Email [email protected] and mention the book title in the subject of your message. If you have questions about any aspect of this book, please email us at [email protected].

Errata: Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you have found a mistake in this book, we would be grateful if you would report this to us. Please visit www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details.

Piracy: If you come across any illegal copies of our works in any form on the Internet, we would be grateful if you would provide us with the location address or website name. Please contact us at [email protected] with a link to the material.

If you are interested in becoming an author: If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, please visit authors.packtpub.com.

Reviews

Please leave a review. Once you have read and used this book, why not leave a review on the site that you purchased it from? Potential readers can then see and use your unbiased opinion to make purchase decisions, we at Packt can understand what you think about our products, and our authors can see your feedback on their book. Thank you!

For more information about Packt, please visit packtpub.com.

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.

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.

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: