A tool for analyzing possible relationships between news and tweet sentiments.
Sapienza, University of Rome
Master of Science in Engineering in Computer Science
Project made with β€ by:
You can find the related presentation on Slideshare.
You can find the related tutorial on YouTube.
Install python packages:
pip install -r requirements.txt --user
python -c "import nltk; nltk.download('stopwords')"
cp config.py.example config.pyEdit the config.py file by adding you Twitter API key; if you want you can also customize the other parameters.
In order to properly collect the data, we suggest to set the following contab entries.
0 */6 * * * /usr/bin/env python collect_news.py >/dev/null 2>&1
0 */6 * * * /usr/bin/env python collect_tweets.py >/dev/null 2>&1
0 */6 * * * /usr/bin/env python preprocess.py >/dev/null 2>&1
In alternative execute manually the scripts. A time interval of 6 hours is recommended.
To run the Search Engine or the Pearson Correlation scripts, first setup the environment with the command:
python setup.pyThe script setup.pywill create the inverted index from the tweets file (previously collected).
Now, you can run the Search Engine to manually find similar tweets to a given query:
python SearchEngine.pyThe web interface will open in your default browser.
Instead, if want to use the Pearson Correlation script, use the following command:
python PearsonCorrelation.py