Innovative Sentiment Analysis and Prediction of Stock Price Using FinBERT, GPT-4 and Logistic Regression: A Data-Driven Approach

This study explores the comparative performance of cutting-edge AI models, i.e., Finaance Bidirectional Encoder representations from Transsformers (FinBERT), Generatice Pre-trained Transformer GPT-4, and Logistic Regression, for sentiment analysis and stock index prediction using financial news and...

Full description

Saved in:
Bibliographic Details
Main Authors: Olamilekan Shobayo, Sidikat Adeyemi-Longe, Olusogo Popoola, Bayode Ogunleye
Format: Article
Language:English
Published: MDPI AG 2024-10-01
Series:Big Data and Cognitive Computing
Subjects:
Online Access:https://www.mdpi.com/2504-2289/8/11/143
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1846154347320180736
author Olamilekan Shobayo
Sidikat Adeyemi-Longe
Olusogo Popoola
Bayode Ogunleye
author_facet Olamilekan Shobayo
Sidikat Adeyemi-Longe
Olusogo Popoola
Bayode Ogunleye
author_sort Olamilekan Shobayo
collection DOAJ
description This study explores the comparative performance of cutting-edge AI models, i.e., Finaance Bidirectional Encoder representations from Transsformers (FinBERT), Generatice Pre-trained Transformer GPT-4, and Logistic Regression, for sentiment analysis and stock index prediction using financial news and the NGX All-Share Index data label. By leveraging advanced natural language processing models like GPT-4 and FinBERT, alongside a traditional machine learning model, Logistic Regression, we aim to classify market sentiment, generate sentiment scores, and predict market price movements. This research highlights global AI advancements in stock markets, showcasing how state-of-the-art language models can contribute to understanding complex financial data. The models were assessed using metrics such as accuracy, precision, recall, F1 score, and ROC AUC. Results indicate that Logistic Regression outperformed the more computationally intensive FinBERT and predefined approach of versatile GPT-4, with an accuracy of 81.83% and a ROC AUC of 89.76%. The GPT-4 predefined approach exhibited a lower accuracy of 54.19% but demonstrated strong potential in handling complex data. FinBERT, while offering more sophisticated analysis, was resource-demanding and yielded a moderate performance. Hyperparameter optimization using Optuna and cross-validation techniques ensured the robustness of the models. This study highlights the strengths and limitations of the practical applications of AI approaches in stock market prediction and presents Logistic Regression as the most efficient model for this task, with FinBERT and GPT-4 representing emerging tools with potential for future exploration and innovation in AI-driven financial analytics.
format Article
id doaj-art-b4502fd7a00f45e389992b3223fb54c7
institution Kabale University
issn 2504-2289
language English
publishDate 2024-10-01
publisher MDPI AG
record_format Article
series Big Data and Cognitive Computing
spelling doaj-art-b4502fd7a00f45e389992b3223fb54c72024-11-26T17:51:09ZengMDPI AGBig Data and Cognitive Computing2504-22892024-10-0181114310.3390/bdcc8110143Innovative Sentiment Analysis and Prediction of Stock Price Using FinBERT, GPT-4 and Logistic Regression: A Data-Driven ApproachOlamilekan Shobayo0Sidikat Adeyemi-Longe1Olusogo Popoola2Bayode Ogunleye3School of Computing and Digital Technologies, Sheffield Hallam University, Sheffield S1 2NU, UKSchool of Computing and Digital Technologies, Sheffield Hallam University, Sheffield S1 2NU, UKSchool of Computing and Digital Technologies, Sheffield Hallam University, Sheffield S1 2NU, UKDepartment of Computing & Mathematics, University of Brighton, Brighton BN2 4GJ, UKThis study explores the comparative performance of cutting-edge AI models, i.e., Finaance Bidirectional Encoder representations from Transsformers (FinBERT), Generatice Pre-trained Transformer GPT-4, and Logistic Regression, for sentiment analysis and stock index prediction using financial news and the NGX All-Share Index data label. By leveraging advanced natural language processing models like GPT-4 and FinBERT, alongside a traditional machine learning model, Logistic Regression, we aim to classify market sentiment, generate sentiment scores, and predict market price movements. This research highlights global AI advancements in stock markets, showcasing how state-of-the-art language models can contribute to understanding complex financial data. The models were assessed using metrics such as accuracy, precision, recall, F1 score, and ROC AUC. Results indicate that Logistic Regression outperformed the more computationally intensive FinBERT and predefined approach of versatile GPT-4, with an accuracy of 81.83% and a ROC AUC of 89.76%. The GPT-4 predefined approach exhibited a lower accuracy of 54.19% but demonstrated strong potential in handling complex data. FinBERT, while offering more sophisticated analysis, was resource-demanding and yielded a moderate performance. Hyperparameter optimization using Optuna and cross-validation techniques ensured the robustness of the models. This study highlights the strengths and limitations of the practical applications of AI approaches in stock market prediction and presents Logistic Regression as the most efficient model for this task, with FinBERT and GPT-4 representing emerging tools with potential for future exploration and innovation in AI-driven financial analytics.https://www.mdpi.com/2504-2289/8/11/143FinBERT modellogistic regressionFinBERTOptunatime series cross-validation
spellingShingle Olamilekan Shobayo
Sidikat Adeyemi-Longe
Olusogo Popoola
Bayode Ogunleye
Innovative Sentiment Analysis and Prediction of Stock Price Using FinBERT, GPT-4 and Logistic Regression: A Data-Driven Approach
Big Data and Cognitive Computing
FinBERT model
logistic regression
FinBERT
Optuna
time series cross-validation
title Innovative Sentiment Analysis and Prediction of Stock Price Using FinBERT, GPT-4 and Logistic Regression: A Data-Driven Approach
title_full Innovative Sentiment Analysis and Prediction of Stock Price Using FinBERT, GPT-4 and Logistic Regression: A Data-Driven Approach
title_fullStr Innovative Sentiment Analysis and Prediction of Stock Price Using FinBERT, GPT-4 and Logistic Regression: A Data-Driven Approach
title_full_unstemmed Innovative Sentiment Analysis and Prediction of Stock Price Using FinBERT, GPT-4 and Logistic Regression: A Data-Driven Approach
title_short Innovative Sentiment Analysis and Prediction of Stock Price Using FinBERT, GPT-4 and Logistic Regression: A Data-Driven Approach
title_sort innovative sentiment analysis and prediction of stock price using finbert gpt 4 and logistic regression a data driven approach
topic FinBERT model
logistic regression
FinBERT
Optuna
time series cross-validation
url https://www.mdpi.com/2504-2289/8/11/143
work_keys_str_mv AT olamilekanshobayo innovativesentimentanalysisandpredictionofstockpriceusingfinbertgpt4andlogisticregressionadatadrivenapproach
AT sidikatadeyemilonge innovativesentimentanalysisandpredictionofstockpriceusingfinbertgpt4andlogisticregressionadatadrivenapproach
AT olusogopopoola innovativesentimentanalysisandpredictionofstockpriceusingfinbertgpt4andlogisticregressionadatadrivenapproach
AT bayodeogunleye innovativesentimentanalysisandpredictionofstockpriceusingfinbertgpt4andlogisticregressionadatadrivenapproach