TL;DR
A financial media and business intelligence firm wanted to know what social media was saying about listed companies, and whether it was worth paying attention to. Its analysts serve wealth managers and needed a consistent, daily measure they could rely on.
A pipeline was built that scored each tweet about a company as bullish, bearish or neutral with a finance-trained AI model. It filtered out bots and spam, flagged likely sarcasm, and combined everything into one sentiment score per company per day. A dashboard showed analysts how that score was moving, when it shifted sharply, and which tweets drove each shift.
Analysts got a daily, explainable read of social sentiment for each company, with no price quotes or trading calls. Testing showed the signal was better at warning that a stock was likely to make an unusually large move than at saying which way. Sarcasm remained the hardest problem, so likely sarcastic tweets were counted at a reduced weight, and their share was shown separately as a sign that a day's score was less reliable.
1. The problem
Investors talk about companies on social media all day. Some of it reacts to news, some of it runs ahead of news, and most of it is noise. Analysts serving wealth managers are regularly asked what the mood around a company is, and whether a sudden burst of chatter matters.
With thousands of tweets a day for a single large company, reading them is not feasible. Sampling a few gives an impression that can't be compared from one day to the next and is easily swayed by a handful of loud accounts.
What was needed was a daily measure of social sentiment for each company, an alert when it shifted sharply, and a way to see the tweets behind it. Equally important was an honest answer to whether that measure carried any useful information at all.
The options already available were:
- Social sentiment data feeds from financial data vendors provide ready-made scores for thousands of companies, often from several platforms, with history and bot filtering included. For many firms, these are the fastest and most complete option. The trade-off is a subscription cost and limited visibility into how the scores are built.
- Frontier AI models through an API (like GPT, Gemini or Claude) read tone, slang and sarcasm well, with good instructions. Each tweet is cheap to score, but the cost adds up at millions of tweets. Scores can also shift when a provider updates or retires a model, which matters when today's score is compared with last year's.
- Word-list scoring looks up each word in a dictionary of positive and negative words and adds up the result. It is free, fast and transparent, but misses sarcasm and the meaning words take on in finance (see 2.2.1).
The firm wanted a method it could see into and control, built on open-source models, before deciding whether to invest further or buy a feed.
2. The solution
A pipeline that took tweets mentioning a company, removed bots, spam and duplicates, and scored each remaining tweet as bullish, bearish or neutral. A second model flagged tweets that were likely sarcastic. The scores were then combined into one sentiment score per company per day, weighted by how much engagement each tweet got. A dashboard showed the score over time, highlighted sharp shifts and listed the tweets behind them. Separately, the score was tested against past market data to see what it could and couldn't tell analysts.
2.2 Implementation journey
2.2.1 Starting with a word list
The first version scored tweets with VADER, a well-known word-list tool built for social media. It was quick to set up and gave a baseline to beat.
It struggled with finance. Words like "short", "puts", "bear" and "dip" carry a market meaning that a general word list doesn't know, and "buying the dip" reads as positive to an investor but not to a dictionary. Sarcasm got through untouched. On the labelled sample, VADER often got the label wrong, especially on bearish tweets.
2.2.2 A model that speaks finance
Before any model could be compared, it needed an answer key, which was the labelled sample described in 2.1. Having a frontier model label a few thousand tweets once was cheap and fast, and checking its labels took far less time than labelling from scratch. Labelling millions of tweets the same way, every day, would not have been, so the frontier model built the answer key and an open-source model did the scoring.
Transformer models read a whole sentence at once, so they pick up context that word lists miss. Two open-source options were compared on the labelled sample. FinBERT, a widely used finance model (trained on financial news), was a clear step up from VADER but stumbled on tweet slang, symbols and emojis. FinTwitBERT-sentiment, trained on financial tweets, matched the labelled sample most closely, so it was the one used.
Its labels also suited the job. Bullish and bearish say what a tweet implies about the stock, which is what analysts care about. A tweet can be negative in tone ("shorts are going to get destroyed") and still be bullish.
2.2.3 Clearing out the bots
A large share of tweets about big companies weren't really about them. Research on stock tweets has shown that groups of bots attach the symbols of popular companies to tweets promoting unrelated, low-value stocks (cashtag piggybacking). These tweets added volume and distorted the score.
Three simple rules removed most of it. Tweets listing many stock symbols at once were dropped, exact and near-duplicate tweets were collapsed into one, and no single account could count for more than a few tweets per company per day. Tweets that mentioned two or three companies were kept but counted at a reduced weight, since one sentiment label can't always apply to all of them. Every filtered tweet was logged with the reason, so the rules could be checked.
2.2.4 "Great, another recall" (sarcasm)
Sarcasm was the hardest problem. "Great, another recall. Can't wait for earnings" is bearish, but it opens like a cheerful tweet. The finance-trained model handled some of these from context, but not reliably, and sarcastic tweets cluster around bad news, which is when an accurate score matters most.
The irony model was added to flag them. Used as it was, it flagged far too much. It had been trained on general tweets, so excited investor posts ("to the moon 🚀") often looked ironic to it. Its threshold was raised using the sarcastic tweets in the labelled sample until most flags were correct.
The first fix then backfired. Flipping the label of every flagged tweet, from bullish to bearish and back, made the scores agree less with the labelled sample, not more. The finance-trained model had often already read a sarcastic tweet correctly from its context, so flipping turned right answers into wrong ones. Some flags were also still wrong. So flagged tweets kept their label but counted at a reduced weight. The share of sarcastic tweets was shown separately for each day, so analysts knew when the score was resting on shaky ground.
2.2.5 One number per company per day
Each company got a daily score from −1 (all bearish) to +1 (all bullish). Tweets with more likes, retweets and replies counted for more, on a logarithmic scale, so one viral tweet couldn't outweigh hundreds of others. Low-confidence labels counted for less.
Two details mattered more than expected. Tweets posted after the US market closed at 4 pm New York time were counted towards the next trading day, since that is the first day they could affect trading. Counting them on the same day would have quietly let the score see the future. And a raw score meant little on its own, because some companies are always discussed more positively than others. So each day was also compared with the company's own last 30 trading days, and a shift was flagged when the score or the number of tweets moved well outside its usual range.
2.2.6 The forecast that copied yesterday
To test whether the score carried information, early versions forecast the next day's share price, with and without sentiment. The error looked impressively small. It wasn't. A forecast that simply repeats yesterday's price scored almost as well, because prices rarely move much in a day. Small errors on price levels say almost nothing about whether a model knows anything.
So the test was reframed around questions that a repeat-yesterday guess can't answer. Would the stock go up or down the next day, and would it move more than usual? Each question was tested with past market data alone, then with the sentiment score added, on 2020 data the models had never seen. That year included the market crash in spring, a tough test for any model.
The results were in line with long-standing research (message board activity predicts trading volume and volatility). Adding sentiment did little for predicting whether a stock would go up or down. It helped more with predicting whether it would make an unusually large move, in either direction. A sharp shift in the score or a burst of tweets showed that something was happening around a company, but not which way the market would take it, partly because prices tend to react to news faster than tweets can signal it. SHAP confirmed these were the sentiment inputs the models relied on. That shaped what the dashboard showed analysts, and what it didn't.
2.2.7 The analyst dashboard
The dashboard showed sentiment, not prices. Analysts picked a company and a date range and saw:
- The daily score as a line, with tweet volume as bars underneath.
- Flagged shifts, the days when the score or volume moved well outside the company's usual range.
- The tweets behind each day, the most-engaged bullish and bearish ones first, with sarcasm flags visible.
- Data quality for each day, covering how many tweets were filtered out as bots, spam or duplicates, and the share flagged as sarcastic.
- The test results from 2.2.6, in plain terms, so analysts knew how much weight the signal could carry.
New tweets could be uploaded as a CSV file. They were filtered, scored and combined in the same way, and the daily scores and flagged shifts could be downloaded. Some sources don't include engagement counts (the 2021 to 2022 dataset doesn't), so in that case every tweet counted equally.
From the first data pull to the working dashboard, the build took about three months, in two-week sprints.
3. Outcomes
Analysts got a daily, explainable read of social sentiment for each company, and an honest picture of what it could and couldn't tell them.
- Thousands of tweets became one number per company per day, comparable from one day to the next and between companies.
- Sharp shifts were flagged automatically, so analysts could look into unusual chatter early instead of finding it by chance.
- Every score could be traced to its tweets. Analysts could see what drove a shift before mentioning it to anyone.
- The signal was tested, not assumed. It was most useful as an early warning of unusual activity, not as a guide to which way a stock would go.
That gave the firm a clear basis for deciding whether to extend the pipeline to more companies and sources, or to buy a commercial feed.
What this added beyond the options already available:
| Social sentiment data feeds | Frontier model API | Word-list scoring | This pipeline |
|---|
| Understands finance language and slang | Varies, but mostly yes | Yes | Limited | Yes |
|---|
| Handles sarcasm | Varies | Often, with good instructions | Rarely | Partly, flagged and down-weighted |
|---|
| Filters bots and spam | Usually | Only if built around it | Only if built around it | Yes, with simple rules |
|---|
| Covers many companies and platforms | Yes, often their main strength | Depends on the data supplied | Depends on the data supplied | Not in this POC |
|---|
| Full view of how scores are made | Limited | Partly, prompts are visible | Yes | Yes |
|---|
| Ongoing cost | Subscription | Low per tweet, adds up at volume | Very low | Low, but needs upkeep |
|---|
| Ready to use without building | Yes | No, needs a pipeline around it | Mostly | No, needs building |
|---|