Abstract:
Forecasting the stock market has also been an enduring problem with its sentiment-driven,
unstable nature based upon historical price action and unpredictable external influences such
as news and social media opinion. Traditional models are in large part based upon quantitative
data, bypassing the most important contributor to stock action in contemporaneous popular
opinion. The “black box” nature of deep learning models provides another layer of difficulty
in achieving trust-building along with stakeholders' adoption, with stakeholders requiring
accuracy along with traceable causes for forecasted systems.
In response to such problems, this work proposes an integrated solution that combines real-
time sentiment analysis with time series prediction. It uses sentiment scores from VADER,
which is a light-weight lexicon-based model, in conjunction with historical stock prices. It used
a Gated Recurrent Unit (GRU) neural network due to it being efficient with smaller parameter
requirements compared to LSTM. It further incorporated LIME (Local Interpretable Model-
agnostic Explanations), which made the model more transparent by determining the
contributing features to predictions. It uses Python and React in designing the system and Flask
as the backend API.
It was tested with standard prediction metrics like Mean Absolute Error (MAE), Mean Squared
Error (MSE), Root Mean Squared Error (RMSE), Adjusted R², and Mean Absolute Percentage
Error (MAPE). Out of numerous deep learning models that were benchmarked—the LSTM,
CNN, RNN, and MLP—the best performance was achieved by the GRU model, with an MAE
of 1.3362 and an R² score of 0.9961. These validate that sentiment analysis with deep learning
is a highly effective combination, with the addition of explainability via LIME meaning that
not only are the model’s predictions accurate, but also easily understandable.