Book Image

Artificial Intelligence with Python

Book Image

Artificial Intelligence with Python

Overview of this book

Artificial Intelligence is becoming increasingly relevant in the modern world. By harnessing the power of algorithms, you can create apps which intelligently interact with the world around you, building intelligent recommender systems, automatic speech recognition systems and more. Starting with AI basics you'll move on to learn how to develop building blocks using data mining techniques. Discover how to make informed decisions about which algorithms to use, and how to apply them to real-world scenarios. This practical book covers a range of topics including predictive analytics and deep learning.
Table of Contents (23 chapters)
Artificial Intelligence with Python
Credits
About the Author
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface

Visualizing characters in an Optical Character Recognition database


Artificial neural networks can use optical character recognition. It is perhaps one of the most commonly sited examples. Optical Character Recognition (OCR) is the process of recognizing handwritten characters in images. Before we jump into building that model, we need to familiarize ourselves with the dataset. We will be using the dataset available at  http://ai.stanford.edu/~btaskar/ocr . You will be downloading a file called letter.data. For convenience, this file has been provided to you in the code bundle. Let's see how to load that data and visualize the characters.

Create a new python file and import the following packages:

import os 
import sys 
 
import cv2 
import numpy as np 

Define the input file containing the OCR data:

# Define the input file  
input_file = 'letter.data'  

Define the visualization and other parameters required to load the data from that file:

# Define the visualization...