Sentimentanalys av finansiella nyhetsartiklar med Gemini 2.5: En komparativ studie om integrering av nyhetssentiment i Random Forest-modeller
2025 (Swedish)Independent thesis Basic level (degree of Bachelor), 180 HE credits
Student thesis
Abstract [en]
This study investigates whether the use of sentiment data from news articles, generated using the language model Gemini 2.5 Pro, can enhance the ability of Random Forest models to predict stock returns for the OMXS30 index. Using a quantitative approach, monthly data for stock prices (2021-2025) and news articles were analyzed, with Gemini 2.5 Pro employed to generate sentiment scores. Two Random Forest models were developed: one incorporating NLP-generated sentiment data and one without. Their predictive capabilities were evaluated by simulating long-short portfolio strategies.
The results indicated that the model integrating sentiment data achieved a statistically significant annualized risk-adjusted excess return (Jensen’s alpha) of 2.64 %, significantly outperforming the model without sentiment, which had an alpha close to zero. Although R2 values for predicting individual stock returns were generally low, the portfolio based on sentiment signals demonstrated improved performance. However, a paired t-test on the average monthly returns between the two portfolio strategies revealed no statistically significant difference (p=0.15).
The study concludes that sentiment data from advanced language models like Gemini 2.5 Pro can contribute to enhancing portfolio performance in terms of risk-adjusted returns on the Swedish stock market, although the effect on average monthly returns was not statistically established within the study’s scope.
Place, publisher, year, edition, pages
2025. , p. 30
Keywords [sv]
Maskininlärning, Språkmodeller, OMXS30, Random Forest, Sentiment, Hypotesen om Effektiva marknader
National Category
Computer Sciences
Identifiers
URN: urn:nbn:se:hig:diva-47641OAI: oai:DiVA.org:hig-47641DiVA, id: diva2:1976119
Subject / course
Computer science
Supervisors
Examiners
2025-06-262025-06-242025-10-02Bibliographically approved