Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Hands-On Deep Learning with R

You're reading from   Hands-On Deep Learning with R A practical guide to designing, building, and improving neural network models using R

Arrow left icon
Product type Paperback
Published in Apr 2020
Publisher Packt
ISBN-13 9781788996839
Length 330 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (2):
Arrow left icon
Rodger Devine Rodger Devine
Author Profile Icon Rodger Devine
Rodger Devine
Michael Pawlus Michael Pawlus
Author Profile Icon Michael Pawlus
Michael Pawlus
Arrow right icon
View More author details
Toc

Table of Contents (16) Chapters Close

Preface 1. Section 1: Deep Learning Basics
2. Machine Learning Basics FREE CHAPTER 3. Setting Up R for Deep Learning 4. Artificial Neural Networks 5. Section 2: Deep Learning Applications
6. CNNs for Image Recognition 7. Multilayer Perceptron for Signal Detection 8. Neural Collaborative Filtering Using Embeddings 9. Deep Learning for Natural Language Processing 10. Long Short-Term Memory Networks for Stock Forecasting 11. Generative Adversarial Networks for Faces 12. Section 3: Reinforcement Learning
13. Reinforcement Learning for Gaming 14. Deep Q-Learning for Maze Solving 15. Other Books You May Enjoy

Cleaning text to remove noise

The next step we will take to prepare for text analysis is doing some preliminary cleaning. This is a common way to get started, regardless of what machine learning method will be applied later. When working with text, there are several terms and patterns that will not provide meaningful information. Some of these terms are generally not useful and steps to remove these pieces of text data can be used every time, while others will be more context-dependent.

As previously noted, there are collections of terms referred to as stop words. These terms have no information value and can usually be removed. To remove stop words from our data, we use the following code:

word_tokens <- word_tokens %>%
filter(!word %in% stop_words$word)

After running the preceding code, our row count goes down from 3.5 million to 1.7 million. In effect, our data (word_tokens...

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 €18.99/month. Cancel anytime