Graduation Year

2025

Date of Submission

4-2025

Document Type

Open Access Senior Thesis

Degree Name

Bachelor of Arts

Department

Mathematics

Reader 1

Mark Huber

Rights Information

© 2025 Ava Grey

Abstract

This paper explores the trends in sentiment towards U.S. presidential candidates Kamala Harris and Donald Trump through micro-blogging social media text during the five months leading up to the election. Two datasets of varying sizes and origins were used to contextualize and validate analysis findings. The analyses include both a lexicon-based approach and a machine learning predictive method. Common sentiment analysis techniques like term frequency, term frequency inverse, various lexicons, and n-grams were utilized during the lexicon approach. During the modeling, a random forest was utilized in addition to the methods used during the lexicon approach. Results showed that overall sentiment toward Harris was more negative and exhibited greater polarization. These trends intensified as the election neared. Comparatively, sentiment towards Trump was more positive and lacked personal criticism. Also, over the five months leading to the election, sentiment towards the Republican candidate took on a gentler tone. These trends were identified during the lexicon phase and validated throughout emotion mining and modeling. This exploration highlights the value of using sentiment analysis to capture public opinion especially in political discourse.

Share

COinS