Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Keras 2.x Projects

You're reading from  Keras 2.x Projects

Product type Book
Published in Dec 2018
Publisher Packt
ISBN-13 9781789536645
Pages 394 pages
Edition 1st Edition
Languages
Author (1):
Giuseppe Ciaburro Giuseppe Ciaburro
Profile icon Giuseppe Ciaburro
Toc

Table of Contents (13) Chapters close

Preface 1. Getting Started with Keras 2. Modeling Real Estate Using Regression Analysis 3. Heart Disease Classification with Neural Networks 4. Concrete Quality Prediction Using Deep Neural Networks 5. Fashion Article Recognition Using Convolutional Neural Networks 6. Movie Reviews Sentiment Analysis Using Recurrent Neural Networks 7. Stock Volatility Forecasting Using Long Short-Term Memory 8. Reconstruction of Handwritten Digit Images Using Autoencoders 9. Robot Control System Using Deep Reinforcement Learning 10. Reuters Newswire Topics Classifier in Keras 11. What is Next? 12. Other Books You May Enjoy

Implementing a DNN to label sentences

To labeling sentences, we'll use the Reuters newswire topics dataset. This is a dataset of 11,228 newswires from Reuters, labeled over 46 topics, published by Reuters in 1986. As with the IMDB dataset used in Chapter 6, Movie Reviews Sentiment Analysis Using Recurrent Neural Network, each wire is encoded as a sequence of word indexes.

Just as MNIST, Fashion-MNIST, and IMDB already used in the previous chapters, the Reuters dataset comes packaged as part of the Keras distribution, where there's also a detailed description of its content, as shown at the following link: https://keras.io/datasets/.

To import the Reuters dataset in the Python environment, the following code must be used:

from keras.datasets import reuters
(XTrain, YTrain), (XTest, YTest) = reuters.load_data(path="reuters.npz",
...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime