This is a set of notebooks that will teach you the basics of pulling in news data and analysing sentiment from tweets using language models specialized for the task. Please follow the installation instructions in each notebook to ensure you can run these scripts out of the box.
In order to collect the data, you will need to provide a set of API keys and access tokens from your own Twitter Developer Account.
Contributions are very welcome for expanding on this tutorial. Please see the example code for the Twitter API v2 to learn more about the available endpoint.
This codebase is adapted from a set of scripts for data collection, preprocessing, and sentiment analysis for our research in the paper "Analyzing Responses to Political News Articles on Social Media" by William Opich and Swapneel Mehta.