Hands-On Artificial Intelligence for Search
Building intelligent applications and perform
enterprise searches
Devangini Patel
BIRMINGHAM - MUMBAI
Hands-On Artificial Intelligence for Search
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: Sunith Shetty
Acquisition Editor: Akshay Jethani
Content Development Editor: Abhishek Jadhav
Technical Editor: Swathy Mohan
Copy Editor: Safis Editing
Project Coordinator: Jagdish Prabhu
Proofreader: Safis Editing
Indexer: Tejal Daruwale Soni
Graphics: Tom Scaria
Production Coordinator: Shantanu Zagade
First published: August 2018
Production reference: 1290818
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham
B3 2PB, UK.
ISBN 978-1-78961-115-1
www.packtpub.com
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 service@packtpub.com 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
Devangini Patel is a PhD student at the National University of Singapore, Singapore. Her research interests include deep learning, computer vision, machine learning, and artificial intelligence. She has completed a master's in artificial intelligence at the University of Southampton, UK. She has over 5 years, experience in the field of AI and has worked on various industrial and research projects in AI, including facial expression analysis, robotics, virtual try-on, object recognition and detection, and advertisement ranking.
About the reviewer
Nisarg Vyas is the CEO, founder, and principal engineer at InFoCusp, a consultancy firm in Ahmedabad specializing in AI projects. For the past 12 years, he has been associated with introducing AI and automated systems into mainstream products for domains such as physiological monitoring and healthcare, wearable computing, finance, recruitment and HR, e-commerce, law, defense, graphics, gaming, pharmaceuticals, and fishing. His contribution to AI for physiological monitoring was featured in the prestigious AI Magazine and acknowledged by the Association for the Advancement of AI (AAAI) as an innovative application of AI. He is the holder of several US patents, and the author of several peer-reviewed journal and conference publications.
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.
Preface
With the emergence of big data and modern technologies, artificial intelligence (AI) has acquired a lot of relevance in many domains. The increase in demand for automation has generated many applications for AI in fields such as robotics, predictive analytics, and finance.
This book will give you an understanding of what AI is. It explains basic search methods in detail: Depth-First Search (DFS), Breadth-First Search (BFS), and A* Search, which can be used to make intelligent decisions when the initial state, end state, and possible actions are known. Random solutions or greedy solutions can be found for such problems, but they are not optimal in terms of either space or time, and efficient approaches to space and time will be explored. We will also look at how to formulate a problem, which involves identifying its initial state, goal state, and the actions that are possible in each state. We also need to understand the data structures involved while implementing these search algorithms, because they form the basis of search exploration. Finally, we will look into what a heuristic is, because this decides the suitability of one sub-solution over another and helps you decide which step to take.
Who this book is for
This book is for developers who are keen to get started with AI and develop practical AI-based applications. Developers who want to upgrade their normal applications to smart and intelligent versions will find this book useful. A basic knowledge and understanding of Python are assumed.
What this book covers
, Understanding the Depth-First Search Algorithm , practically explains the DFS algorithm with the help of a search tree. The chapter also delves into recursion, which eliminates the need to have an explicit stack.
, Understanding the Breadth-First Search Algorithm , teaches you how to traverse a graph layer-wise using a LinkedIn connection feature as an example.
, Understanding the Heuristic Search Algorithm , takes you through the priority queue data structure and explains how to visualize search trees. The chapter also covers problems related to greedy best-first search, and how A* solves that problem.
Next page