TWITTER DAY 31 - 11/07/14 LING 3820 & 6820 Natural Language Processing Harry Howard Tulane University.

Slides:



Advertisements
Similar presentations
Login to Top Hat Password Log In Need a Top hat Account – sign up here. I forgot my password You must log in first Display error Messages here.
Advertisements

Overview of Twitter API Nathan Liu. Twitter API Essentials Twitter API is a Representational State Transfer(REST) style web services exposed over HTTP(S).
STUDENT INFORMATION SYSTEM (SIS) Course Approval Procedure.
Updating User Details and Password Tutorial 5. Step 1.1 From the Energy Infrastructure Portal Home Page, click the Enter Site link to access the Portal.
1SCBOE Technology Dept. - Nov
EDW647 Internet For Educators Setting Up a Gmail Account Roger W. Webster, Ph.D. Department of Computer Science Millersville University (717)
Completing GLACIER Tax Prep (GTP) This demonstration will walk you through the basic program. Depending on your personal information entered into the system.
TEXT STATISTICS 1 DAY /20/14 LING 3820 & 6820 Natural Language Processing Harry Howard Tulane University.
TEXT STATISTICS 7 DAY /05/14 LING 3820 & 6820 Natural Language Processing Harry Howard Tulane University.
REGISTER FOR CLASSES. USING THE STUDENT INFORMATION SYSTEM (SIS)
In the right place? This is Rutgers-Newark The course is Multimedia Journalism The class is My name is Prof. Brian Horton Prof. Brian Horton.
CLEW Basics Lorie Stolarchuk Learning Technology Trainer Centre for Teaching and Learning 1.
Blackbaud Web Purchasing Training Session 1. Agenda What is Blackbaud Web Purchasing? How to login to Blackbaud Web Purchasing Create a purchase requisition.
1 ETSU Banner Schedule Building Executive Aide Banner Schedule Building Training By Laine Howard Associate Registrar.
UNICODE & CONTROL DAY /24/14 LING 3820 & 6820 Natural Language Processing Harry Howard Tulane University.
+ Working in Your CCE Online Course Site. + Structure of CCE Online Course Sites CCE online courses use the document sharing and collaboration features.
IPAD Set Up. Gmail Account First, you need to set up a free gmail account with your name. If you have an existing one you may use that as long as: – A)
Blackbaud Web Purchasing Training Session 1. Agenda What is Blackbaud Web Purchasing? How to login to Blackbaud Web Purchasing Create a purchase requisition.
NLTK & BASIC TEXT STATS DAY /08/14 LING 3820 & 6820 Natural Language Processing Harry Howard Tulane University.
COMPUTATION WITH STRINGS 4 DAY 5 - 9/05/14 LING 3820 & 6820 Natural Language Processing Harry Howard Tulane University.
E-app Download & Agent Workspace. Laptop Presentation Training When an agent signs on e-app, if there are applications that he/she has completed and saved,
ON-LINE DOCUMENTS 3 DAY /17/14 LING 3820 & 6820 Natural Language Processing Harry Howard Tulane University.
UNICODE DAY /22/14 LING 3820 & 6820 Natural Language Processing Harry Howard Tulane University.
Parent Portal Also known as: The next best thing to being at school with your student!
Fall 2005 Using FrontPage to Enhance Blackboard - Darek Sady1 Using FrontPage to Enhance Blackboard 1.Introduction 2.Starting FrontPage 3.Creating Documents.
First App Bhanu Kishan. Note Before proceeding further, please go through the MIT App Inventor tutorials in Youtube for better understanding the slides.
User Training for Meals on Wheels Programs June 2014.
Basic Instructions on how to use One Drive and share files. ONE Drive Your LogoYour own footer.
© 2011 Amazon.com, Inc. or its Affiliates Sign-Up for CBA Select “Sign up for Checkout by Amazon”.
SCRIPTS & FUNCTIONS DAY /06/14 LING 3820 & 6820 Natural Language Processing Harry Howard Tulane University.
TWITTER 2 DAY /10/14 LING 3820 & 6820 Natural Language Processing Harry Howard Tulane University.
How to Use Facebook This guide will help you navigate around the social networking site, Facebook.
WEB TEXT DAY /14/14 LING 3820 & 6820 Natural Language Processing Harry Howard Tulane University.
EBC Flex Help Accessing the website and your account.
COMPUTATION WITH STRINGS 1 DAY 2 - 8/27/14 LING 3820 & 6820 Natural Language Processing Harry Howard Tulane University.
Navigating Selection Manager –
Morton Instructional Technology Team Edline Student Activation.
REGULAR EXPRESSIONS 1 DAY 6 - 9/08/14 LING 3820 & 6820 Natural Language Processing Harry Howard Tulane University.
External Study Credit Granting with SurveyGizmo Shepherd University Department of Psychology.
IT’S OUR FAVORITES!! Delicious: It’s What’s for Dinner.
How to set up an account- Non-Technical Aimee Lilley.
ON-LINE DOCUMENTS DAY /13/14 LING 3820 & 6820 Natural Language Processing Harry Howard Tulane University.
CONTROL 2 DAY /26/14 LING 3820 & 6820 Natural Language Processing Harry Howard Tulane University.
TWITTER 3 DAY /12/14 LING 3820 & 6820 Natural Language Processing Harry Howard Tulane University.
COMPUTATION WITH STRINGS 3 DAY 4 - 9/03/14 LING 3820 & 6820 Natural Language Processing Harry Howard Tulane University.
How to Complete FAFSA (Free Application for Federal Student Aid)
Clicker quiz 11/5/13 CSE 1102 Fall A. a FlowLayout B. a BorderLayout C. a GridGrouping D. a JSplitPane E. a GridLayout Suppose we want to to lay.
Tutorial Instructions for Completing the Online Certification Application © 2010 American Nurses Credentialing Center.
Lindsey Velez, Director of Instructional Technology Single Sign-On One Click.
CONTROL 3 DAY /29/14 LING 3820 & 6820 Natural Language Processing Harry Howard Tulane University.
Reporter Training for High School RIO TM
Setting up a One Drive Network Drive. Step 1- Account Creation Go to: /en-us/ /en-us/
Your Choices, Your Future A simple guide. All applications for 6 th form places, college courses and apprenticeships will be made through one website.
How To Master Levy County Tracey Wilkerson / Christopher Mollerup / Ethan Caren North East Florida.
Guide to Using MYIBS Online Course Repository System using Claroline For IBS Students Only.
How to set up a My Bookshelf account. In your web browser go to: Enter your school or library’s login.
Continuing Professional Development How to fill in your summary online
HOW TO MAKE TRANSFER ON BANK ACCOUNT
Flat text 2 Day 7 - 9/14/16 LING 3820 & 6820 Natural Language Processing Harry Howard Tulane University.
Testing REST IPA using POSTMAN
How to Apply for a Clara Abbott Foundation Scholarship Application Available: April 30 Application Deadline: May 30 Welcome to the 2018/2019 February.
Regular expressions 2 Day /23/16
control 4 Day /01/14 LING 3820 & 6820 Natural Language Processing
LING 3820 & 6820 Natural Language Processing Harry Howard
School Of Diabetes Website
Feature Extraction on Twitter Streaming data using Spark RDD
Regular expressions 3 Day /26/16
NEW! To meet the growing requirements for managing our courses and events, Olympic ESD 114 has partnered with a new program called pdEnroller. pdEnroller.
HOW TO PLACE MY ORDER ?.
Control 1 Day /30/16 LING 3820 & 6820 Natural Language Processing
Presentation transcript:

TWITTER DAY /07/14 LING 3820 & 6820 Natural Language Processing Harry Howard Tulane University

Course organization 07-Nov-2014NLP, Prof. Howard, Tulane University 2   The syllabus is under construction.   Chapter numbering  3.7. How to deal with non-English characters 3.7. How to deal with non-English characters  4.5. How to create a pattern with Unicode characters 4.5. How to create a pattern with Unicode characters  6. Control 6. Control

Open Spyder 07-Nov NLP, Prof. Howard, Tulane University

Conditional frequency distribution Review 07-Nov NLP, Prof. Howard, Tulane University

§10 Twitter 07-Nov NLP, Prof. Howard, Tulane University

What do you know about Twitter?  API = Application Programming Interface 07-Nov-2014NLP, Prof. Howard, Tulane University 6

Twitter ''' Go to and create a new Twitter account, if you haven't already done so. Now you need to set up this account so your script can make calls to Twitter’s API. Go to and sign in with the credentials of your new account. Click on “Create an App”, or just go directly to and fill in the details: I don’t think any of this info actually matters. You don’t need a callback URL. Click “Create your Twitter Application”. On the new app’s web page, and under “Application Type” click on the “Read, Write, and Access direct messages” radio button. Click “Update this Twitter Application’s settings”. Go back to the Details tab, and at the bottom of the screen click “Create my access token”. When the page reloads, you will need to copy the following four pieces of information, “Consumer Key”, “Consumer Secret”, “Access Token”, and “Access Token Secret” into the four places for it below. Be sure to save this information (for example, in this document) because you will have to enter it every time you want to code Twitter, and it is long and complicated.''' 07-Nov-2014NLP, Prof. Howard, Tulane University 7

How to access Twitter's API 07-Nov-2014NLP, Prof. Howard, Tulane University 8 REST (twitter-python) streaming (tweepy)

tweepy In the Terminal: $ pip install –U tweepy 07-Nov-2014NLP, Prof. Howard, Tulane University 9

Test tweepy put this into new script & save as tweepies.py import tweepy from tweepy.api import API CONSUMER_KEY = 'your_info_here' CONSUMER_SECRET = 'your_info_here' ACCESS_TOKEN = 'your_info_here' ACCESS_TOKEN_SECRET = 'your_info_here' key = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET) key.set_access_token(ACCESS_TOKEN, ACCESS_TOKEN_SECRET) # verify api = tweepy.API(key) print api.me().name # HLT Lab 07-Nov-2014NLP, Prof. Howard, Tulane University 10

A problem  Streaming does not stop …  but you will want to stop it at some point.  You will want to stop it when you have received a certain number of tweets.  How? 07-Nov-2014NLP, Prof. Howard, Tulane University 11

A counter >>> n = 0 >>> m = 20 >>> if n < m: n = n + 1 else: stop! 07-Nov-2014NLP, Prof. Howard, Tulane University 12

Classes in Python class NewStreamListener(tweepy.StreamListener): def __init__(self, api=None): self.api = api or API() def on_status(self, status): 07-Nov-2014NLP, Prof. Howard, Tulane University 13

How to tell StreamListener() to stop listening for tweets  Algorithm  upon initializing StreamListener() set the counter to 0 set the maximum to 20  when a relevant tweet is found if the counter is less than 20, add 1 to it and keep going otherwise, exit StreamListener() 07-Nov-2014NLP, Prof. Howard, Tulane University 14

The code class StopStreamListener(tweepy.StreamListener): def __init__(self, api=None): self.api = api or API() self.n = 0 self.m = 20 def on_status(self, status): self.n = self.n+1 if self.n < self.m: return True else: return False 07-Nov-2014NLP, Prof. Howard, Tulane University 15

Now make it send output to screen (after log-in in tweepies) class Stream2Screen(tweepy.StreamListener): def __init__(self, api=None): self.api = api or API() self.n = 0 self.m = 20 def on_status(self, status): print status.text.encode('utf8') self.n = self.n+1 if self.n < self.m: return True else: print 'tweets = '+str(self.n) return False 07-Nov-2014NLP, Prof. Howard, Tulane University 16

To invoke it (put at end) stream = tweepy.streaming.Stream(key, Stream2Screen()) stream.filter(track=['the,of'], languages=['en']) 07-Nov-2014NLP, Prof. Howard, Tulane University 17

Next quiz More twitter Next time 07-Nov-2014NLP, Prof. Howard, Tulane University 18