- Mastering Machine Learning on AWS
- Dr. Saket S.R. Mengle Maximo Gurmendez
- 125字
- 2021-06-24 14:23:15
Collecting the tweets
We will start by using the Twython library to access the Twitter API and collect a series of tweets, labeling them with the originating political party.
The details of the implementation can be found in our GitHub repository in the following Jupyter Notebook:
chapter2/collect_tweets.ipynb
We need to invoke the following method in the Twython library to save tweets from @GOP and @TheDemocrats into two text files, gop.txt and dems.txt:
twitter.get_user_timeline(screen_name='GOP', tweet_mode='extended', count=500)
Each file contains 200 tweets. The following are some excerpts from the dems.txt file:
- This cannot be who we are as a country. We need to find out what happened and ensure it never happens again.
- RT @AFLCIO: Scott Walker. Forever a national disgrace.
推薦閱讀
- 24小時學(xué)會電腦組裝與維護(hù)
- 用“芯”探核:龍芯派開發(fā)實(shí)戰(zhàn)
- Learning Cocos2d-x Game Development
- 電腦組裝與維修從入門到精通(第2版)
- 數(shù)字道路技術(shù)架構(gòu)與建設(shè)指南
- 電腦組裝、維護(hù)、維修全能一本通(全彩版)
- 數(shù)字邏輯(第3版)
- 計算機(jī)維修與維護(hù)技術(shù)速成
- 電腦軟硬件維修從入門到精通
- Creating Flat Design Websites
- Machine Learning with Go Quick Start Guide
- Internet of Things Projects with ESP32
- Blender Game Engine:Beginner's Guide
- 觸摸屏應(yīng)用技術(shù)從入門到精通
- The Machine Learning Workshop