TWITTER 3 DAY 33 - 11/12/14 LING 3820 & 6820 Natural Language Processing Harry Howard Tulane University.

Slides:



Advertisements
Similar presentations
Overview of Twitter API Nathan Liu. Twitter API Essentials Twitter API is a Representational State Transfer(REST) style web services exposed over HTTP(S).
Advertisements

Programming for Linguists
Def f(n): if (n == 0): return else: print(“*”) return f(n-1) f(3)
21 Recipes for Mining Twitter [Social Network Analysis] Hoon-Young Jung.
Handle] [Person Handle 1] [Person Handle 2] [Person Handle 3] [###] Handle] [Description.
Strings and regular expressions Day 10 LING Computational Linguistics Harry Howard Tulane University.
TEXT STATISTICS 1 DAY /20/14 LING 3820 & 6820 Natural Language Processing Harry Howard Tulane University.
Finite-state automata 2 Day 13 LING Computational Linguistics Harry Howard Tulane University.
TEXT STATISTICS 7 DAY /05/14 LING 3820 & 6820 Natural Language Processing Harry Howard Tulane University.
Quiz 9 Chapter 13 Note the two versions A & B Nov
Python Control of Flow.
UNICODE & CONTROL DAY /24/14 LING 3820 & 6820 Natural Language Processing Harry Howard Tulane University.
ELN – Natural Language Processing Giuseppe Attardi
TEXT STATISTICS 5 DAY /29/14 LING 3820 & 6820 Natural Language Processing Harry Howard Tulane University.
A data retrieval workflow using NCBI E-Utils + Python Part II: Jinja2 / Flask John Pinney Tech talk Tue 19 th Nov.
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.
Structured programming 4 Day 34 LING Computational Linguistics Harry Howard Tulane University.
ON-LINE DOCUMENTS 3 DAY /17/14 LING 3820 & 6820 Natural Language Processing Harry Howard Tulane University.
Invitation to Computer Science, Java Version, Second Edition.
UNICODE DAY /22/14 LING 3820 & 6820 Natural Language Processing Harry Howard Tulane University.
Structured programming 3 Day 33 LING Computational Linguistics Harry Howard Tulane University.
COMPUTATION WITH STRINGS 2 DAY 2 - 8/29/14 LING 3820 & 6820 Natural Language Processing Harry Howard Tulane University.
SCRIPTS & FUNCTIONS DAY /06/14 LING 3820 & 6820 Natural Language Processing Harry Howard Tulane University.
SYNTAX 6 ON-LINE PROCESSING DAY 35 – NOV 18, 2013 Brain & Language LING NSCI Harry Howard Tulane University.
TWITTER DAY /07/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.
WEB TEXT DAY /14/14 LING 3820 & 6820 Natural Language Processing Harry Howard Tulane University.
Public service announcement What is a Ponzi scheme? How is the passive voice formed? (someone) ended the Ponzi scheme quickly. AGENT THEME The Ponzi scheme.
REGULAR EXPRESSIONS 3 DAY 8 - 9/12/14 LING 3820 & 6820 Natural Language Processing Harry Howard Tulane University.
REGULAR EXPRESSIONS 4 DAY 9 - 9/15/14 LING 3820 & 6820 Natural Language Processing Harry Howard Tulane University.
COMPUTATION WITH STRINGS 1 DAY 2 - 8/27/14 LING 3820 & 6820 Natural Language Processing Harry Howard Tulane University.
Semantics Day 38 LING Computational Linguistics Harry Howard Tulane University.
REGULAR EXPRESSIONS 2 DAY 7 - 9/10/14 LING 3820 & 6820 Natural Language Processing Harry Howard Tulane University.
NLTK & Python Day 6 LING Computational Linguistics Harry Howard Tulane University.
REGULAR EXPRESSIONS 1 DAY 6 - 9/08/14 LING 3820 & 6820 Natural Language Processing Harry Howard Tulane University.
TEXT STATISTICS 3 DAY /24/14 LING 3820 & 6820 Natural Language Processing Harry Howard Tulane University.
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.
Download class materials onto your desktop… as usual.
COMPUTATION WITH STRINGS 3 DAY 4 - 9/03/14 LING 3820 & 6820 Natural Language Processing Harry Howard Tulane University.
Biology or Social studies: individual vs. collective movement Day 11 COLQ 201 Multiagent modeling Harry Howard Tulane University.
Social studies: traffic Day 10 COLQ 201 Multiagent modeling Harry Howard Tulane University.
Winter 2016CISC101 - Prof. McLeod1 CISC101 Reminders Quiz 3 next week. See next slide. Both versions of assignment 3 are posted. Due today.
Quiz 3 Topics Functions – using and writing. Lists: –operators used with lists. –keywords used with lists. –BIF’s used with lists. –list methods. Loops.
CONTROL 3 DAY /29/14 LING 3820 & 6820 Natural Language Processing Harry Howard Tulane University.
Notices Assn 2 is due tomorrow, 7pm. Moodle quiz next week – written in the lab as before. Everything up to and including today’s lecture: Big Topics are.
Lists 1 Day /17/14 LING 3820 & 6820 Natural Language Processing
LING 3820 & 6820 Natural Language Processing Harry Howard
Twitter Data Mining and Sentiment Analysis
Lists 2 Day /19/14 LING 3820 & 6820 Natural Language Processing
Computation with strings 2 Day 3 - 9/02/16
Flat text 2 Day 7 - 9/14/16 LING 3820 & 6820 Natural Language Processing Harry Howard Tulane University.
Flat text 3 Day 8 - 9/16/16 LING 3820 & 6820 Natural Language Processing Harry Howard Tulane University.
Computation with strings 3 Day 4 - 9/07/16
Regular expressions 2 Day /23/16
LING 3820 & 6820 Natural Language Processing Harry Howard
control 4 Day /01/14 LING 3820 & 6820 Natural Language Processing
LING 3820 & 6820 Natural Language Processing Harry Howard
CISC101 Reminders Assn 3 due tomorrow, 7pm.
Control 3 Day /05/16 LING 3820 & 6820 Natural Language Processing
NLP 2 Day /07/16 LING 3820 & 6820 Natural Language Processing
Feature Extraction on Twitter Streaming data using Spark RDD
Regular expressions 3 Day /26/16
Computation with strings 4 Day 5 - 9/09/16
21 Recipes for Mining Twitter
Quiz Questions Iterative Synchronous Pattern
CISC101 Reminders Assignment 3 due today.
Quiz Questions Iterative Synchronous Pattern
Control 1 Day /30/16 LING 3820 & 6820 Natural Language Processing
Presentation transcript:

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

Course organization 10-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 10-Nov NLP, Prof. Howard, Tulane University

Twitter Review 10-Nov NLP, Prof. Howard, Tulane University

logon() 1. def logon(): 2. import tweepy 3. API_KEY = 'your_info_here' 4. API_SECRET = 'your_info_here' 5. ACCESS_TOKEN = 'your_info_here' 6. ACCESS_TOKEN_SECRET = 'your_info_here' 7. key = tweepy.OAuthHandler(API_KEY, API_SECRET) 8. key.set_access_token(ACCESS_TOKEN, ACCESS_TOKEN_SECRET) 9. return key 10-Nov-2014NLP, Prof. Howard, Tulane University 5

The other functions of tweepies.py 1. stream2screen(num, terms) 2. stream2var(num, terms) 3. stream2file(num, terms) 4. json2screen(num, terms) 5. json2screenpretty(num, terms) 6. dict2screen(num, terms) 7. dict2var(num, terms) 10-Nov-2014NLP, Prof. Howard, Tulane University 6

Quiz  Task: can you find a group of words that will distinguish two Twitter topics?  How to do it  Collect 500+ tweets from two trending topics into different variables.  Run each through a FreqDist to find frequent words that may be unique to each topic (filter out the stop words).  Use these key words in a ConditionalFreqDist to show how well they would work in identifying or classifying each topic. 10-Nov-2014NLP, Prof. Howard, Tulane University 7

tweepy's REST API 10-Nov NLP, Prof. Howard, Tulane University

How to access Twitter's APIs 07-Nov-2014NLP, Prof. Howard, Tulane University 9 streamingREST representational state transfer tweepy

New version of tweepies  New functions  timeline(num, userName)  trends()  localTrends(WOEID)  srch(num, query) 10-Nov-2014NLP, Prof. Howard, Tulane University 10

Usage 1. >>> from tweepies import timeline 2. >>> timeline(1,'JustinBieber') 3. >>> from tweepies import trends 4. >>> world = trends() 5. >>> for t in world: print t['name'], t['countryCode'], t['woeid'] 10-Nov-2014NLP, Prof. Howard, Tulane University 11

Usage, cont >>> from tweepies import localTrends 3. >>> import pprint 4. >>> nola = localTrends(' ') 5. >>> pprint.pprint(nola) 6. [{u'as_of': u' T19:36:01Z', 7. u'created_at': u' T19:29:32Z', 8. u'locations': [{u'name': u'New Orleans', u'woeid': }], 9. u'trends': [{u'name': u'Veterans Day', 10. u'promoted_content': None, 11. u'query': u'%22Veterans+Day%22', 12. u'url': u' 10-Nov-2014NLP, Prof. Howard, Tulane University 12

Usage, cont 1. >>> from tweepies import srch 2. >>> VD = srch(20, 'Verterans Day') 3. >>> pprint.pprint(VD) 10-Nov-2014NLP, Prof. Howard, Tulane University 13

something else Next time 10-Nov-2014NLP, Prof. Howard, Tulane University 14