Finansiell sentimentanalys, utvärderad på aktiemarknaden

Sentiment analysis has emerged as a powerful tool for understanding public opinion in the financial domain. This thesis investigates whether Large Language Models (LLMs) can generate sentiment features that effectively predict next-day stock movements, comparing their efficacy against established state-of-the-art models. Data was retrieved by scraping social media platforms and news headlines. Sentiment scores were generated using three models: Gemini 1.5-flash, FinBERT, and DistilRoBERTa across four gathered datasets: X, Twitter, Reddit, and News headlines. These scores were then used as input features for three machine learning models: XGBoost, Multi-Layer Perceptron (MLP), and Long Short-Term Memory (LSTM) to predict the direction of next-day stock prices. The results show that sentiment-based features can effectively predict stock price direction, with the XGBoost model consistently achieving the highest predictive accuracy, exceeding 90% in some configurations. Among the sentiment analysis models, features generated by DistilRoBERTa most consistently led to the highest performing prediction models, indicating its superiority in generating meaningful sentiment signals for this task. FinBERT performed best on structured financial text, while Gemini demonstrated strong generalization on informal social media data. Overall, this work demonstrates the full stack of extracting, classifying, and engineering sentiment, and leveraging machine learning for financial forecasting and contributing to the development of more accessible tools for analyzing public opinion in stock markets.

Publication Details

Journal
KTH Publication Database DiVA (KTH Royal Institute of Technology)
Published
2025-01-01
Primary Topic
Stock Market Forecasting Methods
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Finansiell sentimentanalys, utvärderad på aktiemarknaden

KTH Publication Database DiVA (KTH Royal Institute of Technology)
Stock Market Forecasting Methods
article

Finansiell sentimentanalys, utvärderad på aktiemarknaden

article en

Abstract

Sentiment analysis has emerged as a powerful tool for understanding public opinion in the financial domain. This thesis investigates whether Large Language Models (LLMs) can generate sentiment features that effectively predict next-day stock movements, comparing their efficacy against established state-of-the-art models. Data was retrieved by scraping social media platforms and news headlines. Sentiment scores were generated using three models: Gemini 1.5-flash, FinBERT, and DistilRoBERTa across four gathered datasets: X, Twitter, Reddit, and News headlines. These scores were then used as input features for three machine learning models: XGBoost, Multi-Layer Perceptron (MLP), and Long Short-Term Memory (LSTM) to predict the direction of next-day stock prices. The results show that sentiment-based features can effectively predict stock price direction, with the XGBoost model consistently achieving the highest predictive accuracy, exceeding 90% in some configurations. Among the sentiment analysis models, features generated by DistilRoBERTa most consistently led to the highest performing prediction models, indicating its superiority in generating meaningful sentiment signals for this task. FinBERT performed best on structured financial text, while Gemini demonstrated strong generalization on informal social media data. Overall, this work demonstrates the full stack of extracting, classifying, and engineering sentiment, and leveraging machine learning for financial forecasting and contributing to the development of more accessible tools for analyzing public opinion in stock markets.

KTH Publication Database DiVA (KTH Royal Institute of Technology)
Decent work and economic growth
Openalex Percentile: Top 41%
Stock Market Forecasting Methods
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.