- 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.
推薦閱讀
- Learning AngularJS Animations
- Applied Unsupervised Learning with R
- The Applied AI and Natural Language Processing Workshop
- Manage Partitions with GParted How-to
- Apple Motion 5 Cookbook
- Large Scale Machine Learning with Python
- OpenGL Game Development By Example
- 面向對象分析與設計(第3版)(修訂版)
- LPC1100系列處理器原理及應用
- 單片機原理及應用:基于C51+Proteus仿真
- USB應用分析精粹:從設備硬件、固件到主機端程序設計
- Learning Less.js
- 計算機組裝、維護與維修項目教程
- 筆記本電腦現場維修實錄
- 微服務架構實戰:基于Spring Boot、Spring Cloud、Docker