This project analyses the evolution of sentiment in news headlines over time, utilising Python and Pandas for data manipulation, and Hugging Face Transformers models for sentiment analysis, emotion analysis, and keyword analysis. For more details, you can view the Project Proposal, Final Presentation, and Final Report.
The dataset comprises of news headlines spanning from 2007 to 2021, sourced from Kaggle:
-
Australia: ABC News
-
Ireland: The Irish Times
-
India: Times of India
-
England: Daily Mail
-
United States: The New York Times
- Run
python filterGBandUS.py
to filter data specific to the United Kingdom and the United States. - Run
python filterAll.py
to filter data in the whole dataset.
- Run
python sentiment/analysis.py
for sentiment analysis. - Run
python sentiment/graph.py
to generate visualisations based on the sentiment data.
- Run
python emotion/analysis.py
for emotion analysis. - Run
python emotion/graph.py
to visualise the emotion analysis results.
- Run
python keywords/analysis.py
,python keywords/analysis2.py
, andpython keywords/combine.py
for keyword analysis. - Run
python keywords/graph.py
to visualise the keyword analysis results.