23,99 €
Leverage the power of various Google Cloud AI Services by building a smart web application using MEAN Stack
Cognitive services are the new way of adding intelligence to applications and services. Now we can use Artificial Intelligence as a service that can be consumed by any application or other service, to add smartness and make the end result more practical and useful.
Google Cloud AI enables you to consume Artificial Intelligence within your applications, from a REST API. Text, video and speech analysis are among the powerful machine learning features that can be used. This book is the easiest way to get started with the Google Cloud AI services suite and open up the world of smarter applications.
This book will help you build a Smart Exchange, a forum application that will let you upload videos, images and perform text to speech conversions and translation services. You will use the power of Google Cloud AI Services to make our simple forum application smart by validating the images, videos, and text provided by users to Google Cloud AI Services and make sure the content which is uploaded follows the forum standards, without a human curator involvement.
You will learn how to work with the Vision API, Video Intelligence API, Speech Recognition API, Cloud Language Process, and Cloud Translation API services to make your application smarter.
By the end of this book, you will have a strong understanding of working with Google Cloud AI Services, and be well on the way to building smarter applications.
This book is ideal for data professionals and web developers who want to use the power of Google Cloud AI services in their projects, without the going through the pain of mastering machine learning for images, videos and text. Some familiarity with the Google Cloud Platform will be helpful.
Arvind Ravulavaru is a platform architect at Ubiconn IoT Solutions, with over 9 years of experience in software development and 2 years in hardware & product development. For the last 5 years, he has been working extensively on JavaScript, both on the server side and the client side. And for the last couple of years in IoT, building a platform for rapidly developing IoT solutions, named The IoT Suitcase. Prior to that, Arvind worked on big data, cloud computing, and orchestration.Sie lesen das E-Book in den Legimi-Apps auf:
Seitenzahl: 188
Veröffentlichungsjahr: 2018
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: Amey VarangaonkarAcquisition Editor: Reshma RamanContent Development Editor: Aditi GourTechnical Editor: Jinesh TopiwalaCopy Editor: Safis EditingProject Coordinator: Hardik BhindeProofreader: Safis EditingIndexer: Tejal Daruwale SoniGraphics: Jason MonteiroProduction Coordinator: Aparna Bhagat
First published: May 2018
Production reference: 1280518
Published by Packt Publishing Ltd. Livery Place 35 Livery Street Birmingham B3 2PB, UK.
ISBN 978-1-78862-661-3
www.packtpub.com
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.
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
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.
Arvind Ravulavaru is a platform architect at Ubiconn IoT Solutions, with over 9 years of experience in software development and 2 years in hardware and product development. For the last 5 years, he has been working extensively on JavaScript, both on the server side and the client side, and for the last couple of years he has working in IoT, building a platform for rapidly developing IoT solutions named The IoT Suitcase. Prior to that, Arvind worked on big data, cloud computing, and orchestration.
Chirag Nayyar helps organizations initiate their digital transformation using the public cloud. He has been actively working on cloud platforms since 2013, providing consultancy to many organizations ranging from SMB to Enterprises. He holds a wide range of certifications from all major public cloud platforms. He also runs meetups and is a regular speaker at various cloud events. He has also reviewed Hands-On Machine Learning on Google Cloud Platform and Google Cloud Platform Cookbook, by Packt.
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.
Title Page
Copyright and Credits
Google Cloud AI Services Quick Start Guide
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
Code in Action
Conventions used
Get in touch
Reviews
Introducing Google Cloud AI Services
Google Cloud Platform
Compute
Big data
Identity and security
Internet of Things (IoT)
Storage and databases
Data transfer
API platform and ecosystem
Management tools
Networking
Cloud AI
Developer tools
Cognition on cloud
Clients
Data types
Cognitive services
Why Cognition on Cloud?
How do machines achieve intelligence?
Cognitive accuracy and machine learning
Google Cloud AI
Cloud AutoML Alpha
Cloud TPU Beta
Cloud Machine Learning Engine
Cloud Job Discovery Private Beta
Dialogflow Enterprise Edition Beta
Cloud Natural Language
Cloud Speech API
Cloud Translation API
Cloud Vision API
Cloud Video Intelligence
Summary
Setting Up a Smart Forum App
Technical requirements
SmartExchange architecture
SmartExchange demo
Architecture overview
Database design
APIs 
Setting up the project
Installing Git
Installing Node.js
Installing MongoDB (optional)
Angular CLI
Yarn (optional)
Heroku Toolbelt (optional)
Text editors  (optional)
Setting up mLab
Test connection
Robo 3T connection (optional)
Setting up an authentication 
Creating the project
Setting up API key
Setting up service account key
Setting up code
Downloading base code 
App folder structure
Server code walk-through
Express and Mongoose
Routes
Security
Mongoose models
Controllers
Client code walk-through
Routing
Authentication
Services
Components
Running the app
Deploying to Heroku
Summary
Cloud Vision API
Cloud Vision API
Pricing
Enabling the API
Setting up a REST client
Setting up cURL
Setting up Postman
Exploring the Vision API
Face detection
Request structure
Constructing the request
Analyzing the response
Label detection
Request structure
Constructing the request
Analyzing the response
Safe search detection
Request structure
Constructing the request
Analyzing the response
API reference
Integrating Cloud Vision API with SmartExchange
Solution design
Setting up Cloudinary
Pricing
API reference
Signing up with Cloudinary
Managing the API key
Setting up the server code
Installing dependencies
Defining routes
Updating the message model
Defining the controller
Setting up the client code
Setting up the ng-bootstrap
Modifying the view thread component
Setting up the upload image modal component
Completing the view thread component
Creating  the Vision API service
Managing the helpers
Testing the app
Deploying to Heroku
Summary
Video Intelligence API
Video Intelligence API
Pricing
Enabling API
Exploring Video Intelligence API
Label detection
Label detection – request structure
Label detection – constructing the request
Label detection – analyze response
Operation status – request structure
Operation status – constructing the request
Operation status – analyze response
API reference
Integrating Video Intelligence API with SmartExchange
Solution design
Get a copy of code from Chapter 3
Setting up server code
Installing dependencies
Defining routes
Updating the message model
Updating the controller
Setting up client code
Setting up recordrtc
Modifying the view thread component
Setting up the upload video modal component
Completing the view thread component
Creating the video API service
Testing the app
Deploying to Heroku
Summary
Cloud Speech API
Cloud Speech API
Pricing
Enabling the API
Exploring the Cloud Speech API
Synchronous speech recognition
Asynchronous speech recognition
Streaming speech recognition
Audio to text using synchronous speech recognition
Request structure
Constructing the request
Analyse response
API reference
Integrating Cloud Speech API with SmartExchange
Solution design
Setting up the server code
Installing dependencies
Defining routes
Updating the message model
Updating the controller
Setting up the client code
Modifying the view thread component
Setting up the upload audio modal component
Completing the view thread component
Creating the audio API service
Testing the app
Deploying to Heroku
Summary
Cloud Natural Language
Cloud Natural Language API
Pricing
Enabling the API
Exploring the Cloud Natural Language API
Sentiment analysis
Request structure
Constructing the request
Analyse response
Entity analysis
Request structure
Constructing the request
Analyse response
API reference
Integrating the Natural Language API with SmartExchange
Solution design
Setting up the server code
Installing dependencies
Defining routes
Updating the message model
Updating the controller
Setting up the client code
Updating the POST API URL
Updating the view thread component
Testing the app
Deploying to Heroku
Summary
Cloud Translation
Cloud Translation API
Pricing
Enabling API
Exploring Cloud Translation API
Discovering supporting languages
Request structure
Constructing the request
Analysing response
Text translation
Request structure
Constructing the request
Analyse response
Integrating Translate API with SmartExchange
Solution design
Setting up the server code
Installing dependencies
Defining routes
Updating the message model
Updating the controller
Setting up the client code
Modifying the view thread component
Setting up the translate message modal component
Creating the Audio API service
Testing the app
Deploying to Heroku
Summary
Other Books You May Enjoy
Leave a review - let other readers know what you think
Cognition as a Service (CAAS) is the new kid on the block. No longer do engineers need to spend time building intelligence on top of their applications. Now, intelligence is borrowed from various services.
Welcome to Google Cloud AI Services Quick Start Guide, where we will explore the powerful Google Cloud AI services via a project-based approach. We will build a forum application named SmartExchange, similar to Discourse or stack overflow, where users start a discussion thread and other users comment on it. To administer the content that goes into the SmartExchange application, we will use Google Cloud AI services such as the Cloud Vision API and Video Intelligence API.
This book is ideal for any reader who would like to use the power of Google Cloud AI services in their projects without going through the pain of mastering machine learning for images, videos, and text. Any reader who would like to get acquainted with Cloud AI services provided by Google will also find this book interesting.
Readers need to have prior knowledge of working with REST API services and should have an idea of working with the MEAN application stack. Basic knowledge of TypeScript is also essential for successfully completing this book.
Chapter 1, Introducing Google Cloud AI Services, introduces you to the world of Google Cloud Platform (GCP). You will understand various services provided by GCP, and we will deep dive into all the services provided by Google Cloud AI services. You will understand the basics of machine learning and AI in this chapter and how they tie in with Cognition as a Service (CAAS).
Chapter 2, Setting Up a Smart Forum App, walks you through the architecture and design of the application (SmartExchange) we will build. We will understand the database schema and the application stack. We will then download the base application and set it up. We will also set up the required keys for accessing Google Cloud AI services.
Chapter 3, Cloud Vision API, explains how to work with the Cloud Vision API over REST API. We will explore various features that we can detect using this API. Finally, we will integrate the Cloud Vision API services with SmartExchange.
Chapter 4, Video Intelligence API, focuses on how to work with the Video Intelligence API over REST API. We will explore various features that we can detect using this API. Finally, we will integrate the Video Intelligence API services with SmartExchange.
Chapter 5, Cloud Speech API, looks at how to work with the Cloud Speech API over REST API. We will explore various features that we can detect using this API. Finally, we will integrate the Cloud Speech API with SmartExchange.
Chapter 6, Cloud Natural Language, outlines how to work with the Cloud Natural Language API over REST API. We will explore various features that we can detect using this API. Finally, we will integrate the Cloud Natural Language API with SmartExchange.
Chapter 7, Cloud Translation, explains how to work with the Cloud Translation API over REST API. We will explore how to translate a piece of text into other languages using this API. Finally, we will integrate the Cloud Translation API with SmartExchange.
To work with the content of the book, you will need knowledge of the following technologies:
MongoDB
Node.js
ExpressJS
Mongoose
Angular 5
TypeScript
REST API services
You need to have Node.js 6.13.1 installed on your machine to follow along with this book.
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/Google-Cloud-AI-Services-Quick-Start-Guide. 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!
We also provide a PDF file that has color images of the screenshots/diagrams used in this book. You can download it here: https://www.packtpub.com/sites/default/files/downloads/GoogleCloudAIServicesQuickStartGuide_ColorImages.pdf.
Visit the following link to check out videos of the code being run:
https://goo.gl/cViHRf.
There are a number of text conventions used throughout this book.
CodeInText: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: "This will install all the dependencies listed. Next, open the entire application in your favorite editor, and then open README.md."
A block of code is set as follows:
//SNIPP SNIPP{ "inputContent": "/9j/7QBEUGhvdG9zaG9...base64-encoded-video-content...fXNWzvDEeYxxxzj/Coa6Bax//Z", "features": ["LABEL_DETECTION"] }//SNIPP SNIPP
Any command-line input or output is written as follows:
$ yarn add @google-cloud/video-intelligence
Bold: Indicates a new term, an important word, or words that you see onscreen. For example, words in menus or dialog boxes appear in the text like this. Here is an example: "Click on New and then Request inside Postman."
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.
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.
Cognition as a Service (CAAS) is the new kid on the block. No longer do engineers need to spend time building intelligence on top of their applications. Now, intelligence is borrowed from various services.
Welcome to Google Cloud AI Services Quick Start Guide, where we are going to explore the powerful Google Cloud AI services via a project-based approach. We are going to build a forum application named SmartExchange, similar to Discourse or Stack Overflow, where users start a discussion thread and other users comment on it.
To manage the content that goes into the SmartExchange application, we are going to use Google Cloud AI services such as Cloud Vision API and Video Intelligence API.
In this chapter, we are going to cover the following:
What is Google Cloud Platform?
Cognition in the cloud
What is Google Cloud AI?
Overview of Google Cloud AI services