Sentiment Analysis of Tweets and the Web for the USA Midterm Election.

We all know the USA midterms are approaching. I did this analysis in 2016 as well, analyzing tweets downloaded from Twitter (now X). So here we are lets see if the new AI (SI) can do the sentiment analysis of Tweets and Truths.

Summary of article: We can run this analysis through custom X APIs to collect the data and compute sentiments. Right now, the AI/SI did an overview. Grok didn’t even do an overview; it just analyzed limited tweets. Gemini did a better job. This is basic, and the data sources can’t be verified. Let’s download the data, run the sentiment analysis, and then have an LLM work on it. In 2016, I coded to compute the average positive sentiment of Trump vs. Hillary. Now we need to see how LLMs would do it. That was a computer algorithm; this is LLM AI/SI! Looking forward to more work on it via APIs to scrape the data from the internet. If I can do it before you, I’ll share the Python code with you. Let’s see who does it faster, me or you? Till then let’s see what LLM can predict?

Lets give AI the following command:

“Provide results from last month’s tweets (from X.com), read Truth Social and the web, and determine their sentiment using SentiWordNet. Add all sentiments, determine the total positive sentiment toward Trump, and determine the total positive sentiment toward Democrats. Provide sentiment toward President Donald Trump winning the midterms versus Democrats winning the House.”

Here is what Grok gave me:

But this isn’t what I want; it is too little to generalize.

So I ran it on Gemini. Here is the result.

Applying SentiWordNet lexical sentiment analysis — which calculates synset-level positive ($Pos$), negative ($Neg$), and objective ($Obj$) — across high-frequency terminology, trending themes, and public polling discourse from September reveals sharp divergences across digital ecosystems.

1. SentiWordNet Platform Breakdown (September)

Truth Social

  • Dominant Lexical Synsets: Loyal ($Pos \approx 0.625$), patriot ($Pos \approx 0.50$), rigged/fraud ($Neg \approx 0.625$), defend ($Pos \approx 0.25, Obj \approx 0.75$), fight ($Neg \approx 0.375, Pos \approx 0.25$).
  • Discourse Focus: High in-group mobilization, rally coverage, defense of executive orders and judicial picks, and framing Republican congressional control as essential to prevent House committee investigations.

X (formerly Twitter)

  • Dominant Lexical Synsets: Disaster ($Neg \approx 0.75$), backlash ($Neg \approx 0.50$), lead/advantage ($Pos \approx 0.50$), wave ($Obj \approx 0.75$), unpopular ($Neg \approx 0.50$), turnout ($Obj \approx 0.875$).
  • Discourse Focus: Split along ideological lines, but high-engagement viral cycles skew heavily toward criticism of federal policy, cost-of-living concerns, and polling releases showing Democratic momentum. Conservative accounts counter with seat-level battleground maps, incumbent retirements, and redistricting dynamics.

Web News, Editorial, & Polling Media

  • Dominant Lexical Synsets: Disapprove ($Neg \approx 0.625$), reversal($Obj \approx 0.75$), referendum ($Obj \approx 0.875$), edge ($Pos \approx 0.25$), drag ($Neg \approx 0.375$).
  • Empirical Polling Anchor: Major national surveys (ActiVote, Emerson College, NPR/PBS/Marist, RealClearPolitics aggregate) show generic congressional ballots favoring Democrats by +5.6 to +9.0 points(averaging ~52%–53% D vs. 42%–44% R). President Trump’s approval rating sits around 39% with disapproval at 56%–58%.

2. Total Positives: Trump vs. Democrats

Summing and averaging the positive lexical scores across all three channels (Truth Social, X, and Web Media) yields the following overall positive distribution:

Why the Total Positive Scores Are Close

  • Trump’s High Concentration on Truth Social: Because Truth Social is an overwhelmingly pro-Trump environment, its positive score for Trump ($0.62$) pulls up his cross-platform positive average.
  • Negative SentiWordNet Polarity vs. Raw Positive: While Trump and Democrats have roughly comparable gross positive weights (~37% vs. ~35%), their net polarity ($Pos — Neg$) diverges significantly due to negative volume.

3. Net Polarity: Trump Midterm Victory vs. Democrats Winning the House

Takeaway

  • Positive Sentiment Toward Trump remains dense and intense, but largely confined to allied digital silos (Truth Social and conservative networks on X). Across the broader web and general electorate, it faces a steep negative wall driven by high presidential disapproval.
  • Positive Sentiment Toward Democrats Winning the House is more broadly distributed across neutral news aggregators, mainstream social media, and independent voters. Discourse positions a Democratic takeover as the statistically favored outcome in national generic polling, though subject to district-level battleground dynamics and candidate retirements.

How AI/SI did it?

It did not ingest or count an individual tally of raw tweets, Truth Social posts, or web documents.

It does not have direct API access or backend firehose connections to private social media feeds like X (Twitter) or Truth Social to stream and parse raw post counts. Instead, the analysis it provided is an NLP-modeled approximation:

  1. No raw counts: It did not calculate an exact sample size (such as $N = 50,000$ tweets or $N = 10,000$ Truths).
  2. How the SentiWordNet scores were generated: It applied SentiWordNet lexical scoring principles to the dominant, high-frequency keywords, core political narratives, and public polling data (such as generic congressional ballot trackers and approval polling) that define the current political discourse.
  3. Web synthesis: The web component reflects synthesized public polling data (e.g., aggregates from Quinnipiac, Marist, Emerson, and ActiVote) and major news reporting rather than an algorithmic batch scrape of discrete HTML files.
  4. If you are looking for an empirical study with a specific document count (e.g., scraping $N$ thousands of posts via the X API and running a Python script with NLTK/SentiWordNet), that requires running custom data-collection scripts outside this chat interface.

Summary and More work to be done:

We can run this analysis through custom X APIs to collect the data and compute sentiments. Right now, the AI/SI did an overview. Grok didn’t even do an overview; it just analyzed limited tweets. Gemini did a better job.

This is basic, and the data sources can’t be verified. Let’s download the data and then run the sentiment analysis on it and let LLM work on it. In 2016 I coded to compute the average positive sentiment. Now we need to see how LLMs would do it? That was computer algorithm this is LLMs AI/SI!

Why just sentiwordnet? Why not run other sentiment analysis algorithms too?

Looking forward to more work on it via APIs to scrape the data from the internet.

If I can do it before you, I’ll share the Python code with you. Let’s see who does it faster, me or you?

Thank you for reading.

Subscribe for updates.

Published by Nidhika

In the Futuristic with AI and Tech blog, Nidhika Yadav covers topics of and related to Future of World with Artificial Intelligence. She primarily talks about AI applications for good. She also talks about how AI can become harmful. She manages two independent blogs here, and one is hobby blog you can subscribe one or all of them. 1. Blog on Artificial Intelligence and future. https://nidhikayadav.org 2. In Blog on Global Issues and future, she covers important international issues and their future implications. https://nidhikayadav.com/ 3. Blog on cooking. This is a hobby blog. Here she describes some delicious innovations and nutritious food. https://nidhikasrecipes.com/ Do subscribe to one or all of them.

Leave a comment