Skip to Main Content
Apache Spark Deep Learning Cookbook
book

Apache Spark Deep Learning Cookbook

by Ahmed Sherif, Amrith Ravindra, Michal Malohlava, Adnan Masood
July 2018
Intermediate to advanced content levelIntermediate to advanced
474 pages
13h 37m
English
Packt Publishing
Content preview from Apache Spark Deep Learning Cookbook

How to do it...

Before beginning, it always helps to take a look at the data and analyze it. After looking at the data, we can see that there are a lot of punctuation marks, blank spaces, quotes, and uppercase as well as lowercase letters. We need to prepare the data first before performing any kind of analysis on it or feeding it into the LSTM network. We require a number of libraries that will make handling data easier :

  1. Import the necessary libraries by issuing the following commands:
from keras.preprocessing.text import Tokenizerfrom keras.utils import to_categoricalfrom keras.models import Sequentialfrom keras.layers import Dense, lSTM, Dropout, Embeddingimport numpy as npfrom pickle import dumpimport string
  1. The output to the preceding ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Apache Spark for Data Science Cookbook

Apache Spark for Data Science Cookbook

Padma Priya Chitturi
Learning Apache Spark 2

Learning Apache Spark 2

Muhammad Asif Abbasi

Publisher Resources

ISBN: 9781788474221Supplemental Content