Analyzing Sentiment of Political X Posts Using Transformer Architectures

The world is becoming increasingly digital, and as millions of users are joining social media platforms, their online actions can reveal their political sentiments and how they might vote. Historically, traditional voter polls have been exposed as slow, inaccurate, and too infrequent to track real-time changes in voter sentiment. As social media sites such as X (formerly Twitter) see hundreds of millions of user posts daily, this has presented an opportunity to identify voter stances on political issues, using machine learning models. Stance detection is a problem subset within natural language processing (NLP) that involves algorithmically identifying the stance of text regarding a given topic. With the recent rise in NLP model and architecture research, researchers have trained stance detection models to use sentiment analysis to predict the winners of national-level elections for political positions. However, predictions of state-level and local elections, specifically policy-based elections, have not been explored. In this paper, we train a transformer neural network architecture that analyzes posts from X related to California's 2020 Proposition 15 election, and classifies them based on sentiment. We created and annotated a dataset of all posts related to Prop 15, developing a novel framework to achieve this. To ensure we trained our primary model on only related and opinionated tweets, we trained a relevancy detector model to filter out unrelated and neutral tweets. Ultimately, we achieved an accuracy of 81%. Our model also accurately predicted the result of the Prop 15 election, showing the capabilities of stance detection in political analysis.

Authors

Institutions

Publication Details

Published
2025-03-17
DOI
https://doi.org/10.1109/ci-nlpsomecompanion65206.2025.10977894
Citations
1
Primary Topic
Sentiment Analysis and Opinion Mining
Type
article
Field-Weighted Citation Impact
2.48
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Analyzing Sentiment of Political X Posts Using Transformer Architectures

Amit Kumar Rana, Rudransh Singh, Harish Loghashankar
1 citations
Sentiment Analysis and Opinion Mining
2.48
article

Analyzing Sentiment of Political X Posts Using Transformer Architectures

Amit Kumar Rana, Rudransh Singh, Harish Loghashankar
article en
1 citations

Abstract

The world is becoming increasingly digital, and as millions of users are joining social media platforms, their online actions can reveal their political sentiments and how they might vote. Historically, traditional voter polls have been exposed as slow, inaccurate, and too infrequent to track real-time changes in voter sentiment. As social media sites such as X (formerly Twitter) see hundreds of millions of user posts daily, this has presented an opportunity to identify voter stances on political issues, using machine learning models. Stance detection is a problem subset within natural language processing (NLP) that involves algorithmically identifying the stance of text regarding a given topic. With the recent rise in NLP model and architecture research, researchers have trained stance detection models to use sentiment analysis to predict the winners of national-level elections for political positions. However, predictions of state-level and local elections, specifically policy-based elections, have not been explored. In this paper, we train a transformer neural network architecture that analyzes posts from X related to California's 2020 Proposition 15 election, and classifies them based on sentiment. We created and annotated a dataset of all posts related to Prop 15, developing a novel framework to achieve this. To ensure we trained our primary model on only related and opinionated tweets, we trained a relevancy detector model to filter out unrelated and neutral tweets. Ultimately, we achieved an accuracy of 81%. Our model also accurately predicted the result of the Prop 15 election, showing the capabilities of stance detection in political analysis.

Bellarmine University (US)
Sustainable cities and communities
Openalex Percentile: Top 11%
Sentiment Analysis and Opinion Mining
2.48
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.