Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
R Deep Learning Projects

You're reading from   R Deep Learning Projects Master the techniques to design and develop neural network models in R

Arrow left icon
Product type Paperback
Published in Feb 2018
Publisher Packt
ISBN-13 9781788478403
Length 258 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Toc

Mining sentiment from Twitter


It's time to put our knowledge of different sentiment classification models in a more realistic scenario—Twitter sentiment analysis. 

As we mentioned in the introduction, sentiment analysis is of great interest for all companies that have a presence online (which is, well, lots of companies in many countries). It is also relevant for politicians, researchers, stock traders and others. 

Note

Before using any service or API, be sure to review their terms of service and follow them! We do not encourage unlawful behavior in any way.

Connecting to the Twitter API

Luckily for us, there is a nice package in R to retrieve our Tweets: The library twitteR. First, there are a number of steps you need to follow:

  1. If you do not have one, create a Twitter account to be able to access their API.
  2. Go to https://dev.twitter.com/apps and log in with your credentials. 
  3. Once logged in, click on Create New App.
  4. Put this as callback URL http://localhost:1410.
  5. Now go to Keys and Access 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 $15.99/month. Cancel anytime
Visually different images