The code in this repo can be used to extract information about relevant events from relevant newspapers in GDELT data files. This is can be done by putting the relevant GDELT csv files in the data folder, editing the newspaper_regex and ai_regex regular expressions in csv_saver.py to the newspaper and subject of your choosing and then running
- python csv_saver.py to extract the contents of relevant articles;
- python cut_data.py to reformat the article content strings for sentiment analysis;
- (i) python google_sentiment_analysis.py to have Google's api analyse the articles sentiment or (ii) python textblob_sentiment_analysis and then
- python grapher.py to create and plot the articles' monthly average's rolling average per newspaper.