Next Article in Journal
Fine-Grained Dismantling Decision-Making for Distribution Transformers Based on Knowledge Graph Subgraph Contrast and Multimodal Fusion Perception
Previous Article in Journal
A Rule-Based Method for Enhancing Burst Tolerance in Stateful Microservices
Previous Article in Special Issue
Federated Learning: Navigating the Landscape of Collaborative Intelligence
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

A Hybrid Long Short-Term Memory with a Sentiment Analysis System for Stock Market Forecasting

by
Konstantinos Liagkouras
* and
Konstantinos Metaxiotis
Department of Informatics, University of Piraeus, 185 34 Pireas, Greece
*
Author to whom correspondence should be addressed.
Electronics 2025, 14(14), 2753; https://doi.org/10.3390/electronics14142753
Submission received: 9 May 2025 / Revised: 4 July 2025 / Accepted: 8 July 2025 / Published: 8 July 2025

Abstract

Addressing the stock market forecasting as a classification problem, where the model predicts the direction of stock price movement, is crucial for both traders and investors, as it can help them to allocate limited resources to the most promising investment opportunities. In this study, we propose a hybrid system that uses a Long Short-Term Memory (LSTM) network and sentiment analysis for predicting the direction of the movement of the stock price. The proposed hybrid system is fed with historical stock data and regulatory news announcements for producing more reliable responses. LSTM networks are well suited to handling time series data with long-term dependencies, while the sentiment analyser provides insights into how news impacts stock price movements by classifying business news into classes. By integrating both the LSTM network and the sentiment classifier, the proposed hybrid system delivers more accurate forecasts. Our experiments demonstrate that the proposed hybrid system outperforms other competing configurations.

1. Introduction

Stock market forecasting involves predicting the future price of a company’s shares listed on an exchange. Over time, different techniques [1] have been devised to address this challenge. Technical analysis methods, including the Relative Strength Index (RSI), Moving Average Convergence and Divergence (MACD), and a range of moving average strategies, are commonly implemented for addressing this important problem.
We begin our analysis with an introduction to the Relative Strength Index (RSI). Developed by J. Welles Wilder Jr. in 1978, the RSI [2] measures the magnitude of recent price movements on a scale from 0 to 100. Traders commonly interpret values above 70 as overbought [3], suggesting a potential price pullback and values below 30 as oversold, indicating a possible rebound. The RSI [4] is straightforward to understand and apply across different markets and is especially good at revealing divergences in stock prices. However, RSI can produce unreliable signals. During strong upward or downward trends, RSI may remain above 70 or below 30 for extended periods, falsely signalling a reversal.
Many studies [5] recommend that RSI should not be used alone but combined with other techniques such as the Moving Average Convergence and Divergence (MACD) to enhance forecasting accuracy. As Xiao [5] notes, the RSI indicator is designed to quickly reflect short-term price changes and can sometimes trigger misleading early reversal signals. As Xiao [5] suggests, RSI should be combined with the MACD (Moving Average Convergence Divergence) for more reliable trading signals. The MACD [6] can be explained in terms of a simple subtraction between a short and a long moving average. A positive MACD indicates recent price increases, while a negative MACD signals recent declines. Another popular family of predictive models uses moving-average strategies with crossing rules [7]. One common strategy is that when the short-term MA crosses above the long-term MA from below, a buy signal is generated; conversely, when the short-term MA crosses below the long-term MA from above, a sell signal is triggered. Shintani et al. [8] demonstrated that moving average strategies such as the golden cross and dead cross can effectively predict future stock prices. According to another study [9], investors who follow technical trading rules, such as MA-based trading strategies, are likely to produce positive returns.
ARIMA (Autoregressive Integrated Moving Average) models [10] are also widely used in stock market forecasting. ARIMA combines autoregression and moving average components and applies differencing or transformations to stabilise non-stationary time series. Finding the optimal orders p, d, and q, can be challenging (Farsi et al. [11]). Kobiela et al. [12] conducted an experimental comparison using NASDAQ data and found that, under certain conditions, the LSTM deep learning model outperformed ARIMA in accuracy. Similar results have been reported in multiple studies [13,14], further supporting the superior performance of LSTM for stock price forecasting.
ARIMA [15,16] can be quite effective for short-term forecasting and stable market conditions [17]; however, when market conditions are unstable, due to economic crises, political events and sudden shifts in investor sentiment the ARIMA [18] struggles to maintain accuracy. This is because ARIMA relies on past values and assumes that future stock prices will follow similar patterns. However, in volatile markets, price movements become highly unpredictable, and relationships between past and future values weaken.
Deep learning techniques offer advantages in stock market forecasting, as they can identify sequential and spatial patterns in data. Long Short-Term Memory (LSTM) networks [19], in particular, excel at modelling long-term dependencies in stock data enhancing prediction accuracy. Unlike traditional neural networks, LSTMs are designed to capture long-range dependencies in sequential data, while mitigating the vanishing gradient problem, making them suitable for analysing historical stock prices and detecting trends.
Below is a review of studies evaluating the effectiveness of LSTM in stock market forecasting. Liu et al. [20] note that the main contribution of LSTM is the self-loop design, which sustains the gradient across many time steps; the weight of the self-loop is updated in each iteration, thus solving the gradient-vanishing problem typical of RNNs. Dioubi et al. [21] suggest that given the nonlinear and non-stationary nature of stock prices, LSTM models effectively capture temporal dependencies. Kristiyanti et al. [22] report that LSTM is a suitable option for time-series analysis and forecasting due to its capacity for long-term memory. Huang et al. [23] demonstrate that LSTM addresses both gradient-explosion and gradient-vanishing issues encountered in standard RNNs, owing to a unit-state that runs through the entire chain with linear interactions and constant information flow. According to Zhang et al. [24] LSTM has a memory that enables it to remember important events that happened many time steps in the past, thanks to a set of recurrently connected subnets, which are called memory blocks. Park et al. [25] further affirm that LSTM, a form of RNN, is more effective than basic RNNs for time-series data because its memory cells and gates overcome vanishing-gradient problems, as its gating mechanisms regulate information retention at each time step.
Despite LSTM’s effectiveness in capturing long-range dependencies in sequential data, other approaches have also gained popularity. In particular, sentiment analysis is becoming increasingly popular for stock market forecasting because it offers valuable insights into the public’s perception. According to several studies the public’s perception can influence market movements more than traditional financial indicators alone. Below, we review studies that discuss the impact and challenges of sentiment analysis in stock market forecasting. According to Nguyen et al. [26] extracting sentiment from social media data is difficult, because the text is usually short and contains many misspellings. As the authors [26] suggest, extracting sentiment from social media for stock price predictions is still an open problem. The authors [26] propose a ‘topic-sentiment’ to improve the performance of stock market prediction. Zhen et al. [27] argue that sentiment indicators reflect the emotional fluctuations of market participants, which often influence collective market behaviour and, in turn, impact stock price movements. The authors [27] suggest that sentiment analysis can capture the irrational volatility of the market, improving prediction accuracy. Deng et al. [28] find that investors’ sentiment, when integrated with deep learning, significantly improves crash prediction and supports informed decision-making in volatile markets. Table 1 summarises key studies in this field.
Jing et al. [29] propose a hybrid model that employs a Convolutional Neural Network for classifying the investors’ hidden sentiment from a major stock forum, followed by a Long Short-Term Memory (LSTM) network to analyse technical market indicators. Huang et al. [30] use sentiment variables from social media as input for an LSTM prediction model, reporting that their hybrid system notably improves prediction accuracy. John and Latha [31] propose a hybrid system for forecasting stock prices that mix the sentiments of financial news with the features of stocks as input to the model. The input variables are analysed by using a Bidirectional Long Short-Term Memory (Bi-LSTM) on top of the Gated Recurrent Unit (GRU) and stacked Long Short-Term Memory (sLSTM). Bogle and Potter [32] analyse Twitter sentiment and its predictive impact on the Jamaica Stock Exchange using a hybrid model that integrates sentiment analysis with decision trees, neural networks, and support vector machines. Ko and Chang [33] propose a hybrid system that uses BERT to extract sentiment from online forums and Long Short-Term Memory neural network, to forecast the stock prices. As input the model uses stock historical transaction data and textual sentiment. Jin [34] applies LSTM to analyse public sentiment in China’s banking sector using Shanghai Stock Exchange data.
Sreyash et al. [35] integrate LSTM and Twitter-based sentiment analysis to identify correlations between public mood and future stock prices, concluding that people’s emotions affect stock futures. Ouf et al. [36] develop a deep-learning LSTM system incorporating Twitter sentiment alongside historical data to assess how public opinion influences market movements.
As shown in Table 1, most of the aforementioned studies have focused on extracting sentiment from social media platforms such as twitter (now known as X since 2023). However, social media is plagued by fake news, personal opinions, and unverified content [37]. The trustworthiness of news sources is essential, for making informed investment decisions. In this study we resolve the problem of credibility of news sources by using regulatory news announcements. RNAs are officially verified business news resources from the regulatory authorities of the London’s Stock Exchange. By using regulatory news announcements, we ensure the trustworthiness of news resources. In this article, we propose a hybrid system for stock market forecasting that combines a deep learning LSTM network with sentiment analysis. First, we use an LSTM network to predict one-day-ahead closing prices. We then perform sentiment analysis by using regulatory news announcements from the same time period. Our objective is the create a more accurate hybrid system by integrating price prediction and sentiment signals.
The remainder of the paper is organised as follows. Section 2 introduces the hybrid system, detailing both the deep-learning LSTM network and the sentiment-analysis component. Section 3 presents the performance metrics for evaluating model’s results. Section 4, presents the experimental results, followed by discussion, analysis, and limitations of the proposed approach. Section 5 provides an evaluation of the standalone sentiment classifier against state-of-the-art sentiment analysis models. Finally, Section 6 concludes the article and outlines directions for future research.

2. The Proposed Hybrid LSTM and Sentiment Analysis System for Stock Market Forecasting

In this paper, we propose a hybrid prediction system that combines a LSTM network with a sentiment analyser. This hybrid system is composed of three main components: (1) pre-processing the regulatory news announcements, (2) extracting sentiment from the regulatory news announcements, and (3) training an LSTM network using historical stock prices. Finally, the hybrid system integrates outputs from the LSTM network and the sentiment analyser to predict the direction of future closing prices.

2.1. Dataset Preparation

During dataset preparation, we must follow all necessary steps to create a structured dataset suitable for further analysis. First, we perform web scraping on relevant corporate webpages to extract key details for each RNA, such as date, time, title, category, and body text. Next, we link each RNA to the corresponding historical stock prices based on the announcement timestamp. If an RNA is released after 16:34 London time, it should be associated with the next trading day’s stock prices. This cutoff is important because the London Stock Exchange accepts new orders up to 16:34; any announcement made afterward will only impact prices on the following trading day. Creating a structured dataset that links each RNA’s content to the appropriate historical stock prices—based on the exact date and time—is crucial to ensure the validity of the experimental results.

2.2. Pre-Processing the Regulatory News Announcements

Text pre-processing is a necessary step in sentiment analysis for transforming the original text into a format that is easier to work with, by removing unnecessary elements such as HTML tags, stop words, punctuation, numbers, or special characters [37]. Table 2 illustrates the stages of text pre-processing.
As shown in Table 2, text pre-processing involves cleaning and transforming raw text data into a structured format suitable for analysis. This typically includes converting all text to lowercase, removing punctuation marks, tokenization (breaking text into words), eliminating stop words, performing stemming (reducing words to their root form), and removing numbers or special characters such as html tags. These steps reduce noise, standardise the input, and improve the performance of sentiment analyser by focusing on the most meaningful features of the text.

2.3. Extracting Features Using Bag of Words

Text pre-processing is an essential step as it cleans and standardises the raw text, before applying the Bag of Words (BoW). The Bag of Words [38] model transforms text into numerical representations by counting the frequency of each word in the text. In scikit-learn, the CountVectorizer converts a collection of text documents into a matrix of token counts. Each row of this matrix represents a document, while each column corresponds to a unique word [39]. Table 3 demonstrates the Bag of Words (BoW) representation of three (3) different regulatory news announcements (RNAs).

2.4. Building a Predictive Model for Sentiment Analysis

After transforming the regulatory news announcements (RNAs) into numerical feature vectors using the Bag of Words (BoW), the next stages involve preparing the data for applying a machine learning model. As shown in Table 4, first, the dataset is split into training and testing subsets to evaluate model’s performance objectively. Then, a machine learning classification algorithm, such as Naive Bayes, Logistic Regression, or Support Vector Machine, is selected and trained on the Bag of Words (BoW) vectors to learn patterns in the text. After training, the model is evaluated using performance metrics to assess its effectiveness. Finally, the trained model can be used to predict the sentiment of a new or unseen regulatory news announcement.

2.5. Predicting Stock Prices with LSTM a Time Series Approach

Long Short-Term Memory (LSTM) networks are a type of recurrent neural network (RNN) particularly well-suited for time series forecasting tasks, such as stock market prediction. LSTMs are capable of learning long-term dependencies in sequential data, making them suitable for capturing patterns in historical stock data. LSTM models use three gates to maintain long-term dependencies in time series data: an input gate (it), a forget gate (ft), and an output gate (ot), along with the previous hidden state (ht−1) and current input (xt). The entire process is described by the following set of relationships:
gt = tanh(Wght−1 + Ugxt + bg)
it = σ(Wiht−1 + Uixt + bi)
ft = σ(Wfht−1 + Ufxt + bf)
ot = σ(Woht−1 + Uoxt + bo)
ct = ftct−1 + itgt
ht = ot ⊙ tanh(ct)
where gt is the candidate hidden state, σ is the sigmoid function, ⊙ is the element-wise product, Ug, i, f and o are the input weights, Wg, i, f and o are the recurrent weights and bg, i, f and o are the biases. Figure 1 illustrates a LSTM network.

2.6. A Hybrid LSTM and Sentiment Analysis System for Stock Market Forecasting

In this study, we propose a hybrid prediction system that combines a LSTM network with a sentiment analyser. This hybrid system comprises three main components: (1) pre-processing the regulatory news announcements, (2) extracting sentiment from the regulatory news announcements, and (3) training an LSTM network using historical stock price data. The hybrid system then integrates the directional signals from both subsystems to predict the direction of future closing prices. The first component processes regulatory news announcements to standardise the input and improve the performance of the sentiment analyser by focusing on the most meaningful textual features. The second component uses a sentiment analysis model based on Naive Bayes to extract sentiment from the regulatory news announcements (RNAs). The third component uses historical stock price data to train an LSTM network for price prediction. Finally, by combining the directional signals from both the sentiment analyser and the LSTM, the hybrid system generates a more reliable signal for the direction of future closing prices. As shown in Figure 2, the hybrid system generates a trading signal only when the directional signals of the two subsystems, the sentiment analyser and the LSTM, are in the same direction (exclusive nor logical operator). When the directional signals of the two subsystems conflict, for example, one indicating ‘up’ and the other ‘down’, the hybrid system does not generate any trading signal, as there is no clear direction for the future closing prices.

3. Performance Metrics for Classification Problems

The proposed hybrid system outputs a binary directional signal (up or down) that indicates the expected direction of future closing prices. Therefore, the following performance metrics for classification problems will be used to assess the model’s performance.

Confusion Matrix

As shown in Figure 3, a confusion matrix provides a detailed breakdown of correct and incorrect predictions [30], for evaluating the performance of a classification algorithm. The matrix includes four key components: true positives (TP), true negatives (TN), false positives (FP), and false negatives (FN).
  • Accuracy
Accuracy shows the proportion of the number of correct observations to the total observations:
A c c u r a c y = T P + T N T P + F P + F N + T N
  • Precision
Precision is the proportion of positive observations that correctly estimates the model divided by the total number of positive predictions:
P r e c i s i o n = T P T P + F P
  • Recall
Recall refers to the proportion of actual positive observations that are identified correctly:
R e c a l l = T P T P + F N
  • F1 Score
The F1 Score is the harmonic mean of the model’s precision and recall values:
F 1 = 2 × R e c a l l × P r e c i s i o n R e c a l l + P r e c i s i o n

4. Experimental Results and Discussion

To evaluate the proposed hybrid system, this paper follows the experimental procedure outlined below. Firstly, we test a standalone LSTM model using only historical stock prices to predict the direction of the future closing prices. Three additional configurations based on Logistic Regression, SVM, and Simple RNN are trained using the same historical stock prices and tested for comparison. Finally, we compare the forecasting performance of the proposed hybrid system with the aforementioned standalone models.
The evaluation uses historical data from two FTSE 100 companies: AstraZeneca and Rio Tinto, covering the period from 2 January 2019 to 28 May 2021. The selection of both companies and timeframe was deliberate, as this period includes the COVID-19 pandemic. AstraZeneca played a major role in combating the crisis by developing one of the first widely used vaccines, the Oxford–AstraZeneca vaccine, in collaboration with the University of Oxford. Rio Tinto is one of the largest metals and mining corporations. Rio Tinto’s mining and operational activities were also affected during the pandemic. Our objective is to assess model performance during this turbulent period. Table 5 presents analytical details for the two datasets.
Figure 4 and Figure 5 illustrate, respectively, the fluctuations in AstraZeneca’s and Rio Tinto’s closing prices over the examined period.
First, we test standalone models trained only on historical stock prices to predict the direction of future closing prices. Four (4) different configurations based on Long Short-Term Memory (LSTM) networks, Logistic Regression, Support Vector Machine (SVM) [40], and Simple Recurrent Neural Network (RNN) are trained using the same historical stock prices and tested for comparison. Table 6 presents AstraZeneca’s experimental results for these standalone models. We use Monte Carlo cross-validation: in each iteration, the data are randomly split into training (70%) and test (30%) sets; performance metrics are then reported per iteration, with results aggregated across all iterations. Monte Carlo cross-validation, also known as repeated random subsampling, improves the robustness of performance estimates by averaging across multiple random splits, overcoming the limitations of single train-test divisions. Among the standalone configurations, the LSTM model achieved the highest mean directional accuracy at 55%. The LSTM network remembers long-term dependencies in sequential data, making it more capable in tasks, such as stock market forecasting.
The actual number of usable samples for the LSTM and RNN models is 168 data points, which is smaller than the 183 data points available for Logistic Regression and Support Vector Machine (SVM), even though the testing set corresponds to 30% of the dataset in all cases. This reduction is due to the requirement of LSTM and Simple RNN models to receive input in the form of fixed-length sequences, determined by a specified window size, which is 15 data points in this case. That means that, during the sequence generation process, the first 15 data points of the testing set cannot be used, as there are not enough preceding values to form a complete input sequence. As a result, the effective number of test samples for the case of LSTM and Simple RNN model is reduced by the window size, leading to fewer data points being passed to the model.
Table 7 provides AstraZeneca’s experimental results of the proposed hybrid system. The proposed hybrid system, which uses a Long Short-Term Memory (LSTM) network and sentiment analysis to predict the direction of future closing price movements, outperforms all competing configurations and achieves a mean directional accuracy of 63%.
As shown in Figure 6, the hybrid system provides the highest directional accuracy (65%) among all competing configurations.
Table 8 provides Rio Tinto’s experimental results of the competing standalone models. In Table 8, we use Monte Carlo cross-validation: in each iteration, we randomly split the data into training (70%) and test (30%) sets, report the metrics per iteration, and then present aggregated results. As shown in Table 8 among the standalone models the LSTM model is the best model due to its higher mean directional accuracy 54%.
Table 9 provides Rio Tinto’s experimental results of the proposed hybrid system. The proposed hybrid system, which uses a Long Short-Term Memory (LSTM) network and sentiment analysis to predict the direction of future closing price movements, outperforms all competing configurations and achieves a mean directional accuracy of 62%.
Figure 7 illustrates AstraZeneca’s confusion matrices for the first iteration of the standalone models.
Figure 8 illustrates AstraZeneca’s and Rio Tinto’s confusion matrices for the first iteration of the hybrid systems.
The experimental results indicate that the proposed hybrid system significantly outperforms all competing standalone models The enhanced performance of the hybrid system can be attributed to the fact that it generates a trading signal only when the directional outputs of the two subsystems, namely, the sentiment analyser and the LSTM, are aligned (exclusive nor logical operator). When the directional signals of the two subsystems conflict, for example, one indicating ‘up’ and the other ‘down’, the hybrid system does not generate any trading signal, as there is no clear direction for the future closing prices.
Despite the advantages of the proposed hybrid system, there are certain limitations in the present study. First, in order for the hybrid system to generate predictions regarding the direction of future closing prices, it requires input from both historical stock prices and regulatory news announcements (RNAs). As shown in Table 5, during the examined period from 2 January 2019 to 28 May 2021, there were 609 trading days. However, for AstraZeneca’s RNAs were available on only 212 of those days. Consequently, the hybrid system could only be used on these 212 trading days where RNAs existed. These 212 days were divided into a training set (70%) and a testing set (30%), resulting in a testing set of 64 elements (i.e., 212 × 30% = 64). Furthermore, since the LSTM network requires a specific window size of 15 data points, the first 15 entries are used for initialization, leaving 49 data points for actual testing (i.e., 64 − 15 = 49). In order to produce a trading signal, the proposed hybrid system requires the directional outputs of both subsystems, namely, the sentiment analyser and the LSTM, to be aligned (i.e., based on an exclusive NOR logical operator). However, this condition is met in only 23 of the examined cases. Finally, out of the 23 times the hybrid system produced a trading signal, it was correct 15 times, resulting in a directional accuracy for AstraZeneca of 65% for the first iteration. With respect to the second examined dataset, there were 575 Regulatory News Announcements (RNAs) for Rio Tinto, distributed over 325 trading days. Consequently, the hybrid system could only be used on these 325 trading days where RNAs existed. These 325 days were divided into a training set (70%) and a testing set (30%), resulting in a testing set of 97 elements (i.e., 325 × 30% = 98). Furthermore, since the LSTM network requires a specific window size of 15 data points, the first 15 entries are used for initialization, leaving 82 data points for actual testing (i.e., 98 − 15 = 83). In order to produce a trading signal, the proposed hybrid system requires the directional outputs of both subsystems, namely, the sentiment analyser and the LSTM, to be aligned (i.e., based on an exclusive NOR logical operator). However, this condition is met in only 47 of the examined cases. Finally, out of the 47 times the hybrid system produced a trading signal, it was correct 29 times, resulting in a mean directional accuracy for Rio Tinto of 0.62% for the first iteration.
To conclude, although the proposed hybrid system demonstrates significantly higher directional accuracy in predicting future closing prices, several prerequisites must be met to generate a valid trading signal, which may limit its practical applicability in everyday trading.

5. Standalone Sentiment Classifier Evaluation Against State-of-the-Art Sentiment Analysis Models

In this section we experiment with different techniques for performing sentiment analysis. Sentiment analysis is one of the two main components of the proposed hybrid system and, therefore, using the appropriate type of sentiment analyser is crucial for the performance of the proposed system. For that reason, we test state-of-the-art (SOTA) transformer-based models like BERT [41] for sentiment analysis. In particular we employ DeBERTa v3 [42] that is built on the BERT [43] architecture and incorporates enhancements from both DeBERTa and ELECTRA. DeBERTa v3 is a transformer encoder-based model with a smarter attention design and a more efficient pre-training regimen. DistilBERT [44] is a lightweight version of BERT [45] that reduces the number of transformer layers from 12 to 6 while maintaining the same hidden size, resulting in a model that is approximately 40% smaller and 60% faster than BERT-base. We also consider a weighted fusion ensemble of two models, a bag-of-words Naïve Bayes and a basic neural network, and we evaluate the results using accuracy score and confusion matrix.
Table 10 presents the average performance, over five iterations, of the four competing models in extracting sentiment from AstraZeneca’s regulatory news announcements (RNAs). It is worth noting that all four competing sentiment analysis models perform slightly better on Rio Tinto’s dataset, as shown in Table 11, compared with AstraZeneca’s in Table 10. This small but consistent difference can be explained by the fact that Rio Tinto’s dataset contains around 98% more textual data in the form of RNAs than AstraZeneca’s. All else being equal, including data quality and diversity, the larger the dataset, the better one can expect the performance of the sentiment analysers to be. Furthermore, as shown in Table 10 and Table 11, Bag of Words and Naive Bayes (BoW + NB) achieves an accuracy approximately 2–3% higher than DeBERTa v3.
Typically, BERT outperforms BoW + NB on sentiment tasks, especially on informal or longer texts, because it captures context and semantics more effectively. However, Liy [46] argues that BoW + NB may outperform BERT on shorter, structured, formal texts with little ambiguity. We believe our results confirm Liy’s finding. This is a plausible explanation for the superior performance of BoW + NB as we apply sentiment analysis to structured, domain-specific RNAs that contain unambiguous content. Finally, the weighted fusion ensemble approach obtains results very close to the ones obtained by the configuration with the BoW + NB.
As shown in Table 10 (AstraZeneca’s experimental results), the first three models (rows 1–3) exhibit almost similar accuracy (~0.53–0.55) with precision and recall values closely aligned, indicating balanced performance on the “Up” class. However, recall of the last model (DistilBERT) is very high (0.83), while precision is much lower (0.50), suggesting that the model predicts “Up” frequently, but about half of those predictions are false positives. To rectify this, we applied random oversampling, which addresses class imbalance by increasing the number of samples in the under-represented class until class counts are equal. Table 12 shows the corrected results averaged over five iterations for DistilBERT model after applying random oversampling [47].
With reference to Rio Tinto’s experimental results in Table 11, the Weighted Fusion Ensemble model stands out as it demonstrates high recall (0.76) but relatively low precision (0.57). This suggests that the model frequently predicts “Up,” but many of these predictions are false positives. Such a pattern often indicates class imbalance. Table 13 presents the adjusted results for the Weighted Fusion Ensemble model after applying random oversampling.

6. Discussion and Conclusions

In this paper, we propose a hybrid system that use a Long Short-Term Memory (LSTM) network and sentiment analysis for predicting the direction of the movement of the future closing prices. The proposed hybrid system is fed with historical stock data and regulatory news announcements (RNAs) for producing more reliable responses. LSTM networks are suitable for handling time series data with long-term dependencies. Respectively, the sentiment analyser provides insights on how news affects stock price movements by classifying the business news into classes. We evaluate the performance of the proposed hybrid system in comparison to four standalone models: Long Short-Term Memory (LSTM) networks, logistic regression, support vector machine (SVM), and simple recurrent neural network (RNN).
The experimental results indicate that the proposed hybrid system significantly outperforms all competing standalone models The enhanced performance of the hybrid system can be attributed to the fact that it generates a trading signal only when the directional outputs of the two subsystems, namely, the sentiment analyser and the LSTM, are aligned (exclusive nor logical operator). When the directional signals of the two subsystems conflict, for example, one indicating ‘up’ and the other ‘down’, the hybrid system does not generate any trading signal, as there is no clear direction for the future closing prices.
The contributions of this article can be summarised as follows: (1) to the best of our knowledge, this is the first study to use regulatory news announcements (RNAs) for developing a hybrid LSTM–sentiment analysis system to forecast stock-market movements. (2) While most prior studies extract sentiment from social media—where fake news, personal opinions, and unverified reports abound—our approach leverages the trustworthiness of RNAs. RNAs are officially verified business-news resources issued by the regulatory authorities of the London Stock Exchange. (3) To ensure analytical rigour, we built structured datasets. First, we scraped relevant corporate web pages to extract key details for each RNA (date, time, title, category, and body text). We then aligned each RNA with the corresponding historical stock prices based on its timestamp. If an RNA is released after 16:34 London time, it is linked to the next trading day’s prices, since no new orders can be accepted after that time. This cut-off ensures that our analysis uses correctly timed data. (4) The trading signal decision criterion is intuitive and easy to implement. Our hybrid system generates a signal only when both the sentiment analyser and the LSTM model produce signals in the same direction (using an exclusive-nor logical operator). (5) Thanks to the structured datasets and preprocessing, sentiment extraction is simplified. We therefore use a lightweight, computationally efficient method—namely Bag-of-Words combined with a Naive Bayes classifier—instead of heavier large language models, which are typically employed for vast, unstructured datasets.
Despite the notable advantages and superior directional accuracy demonstrated by the proposed hybrid system, some limitations affect its practical implementation and scalability. First, the system’s predictive capability relies on the availability of two data sources: historical stock prices and regulatory news announcements (RNAs). To generate directional predictions of future closing prices, both types of input are required to feed the hybrid model. A further limitation concerns the decision logic of the hybrid system. For the model to generate a trading signal, the directional outputs of both subsystems, namely, the sentiment analyser and the LSTM, must be aligned. This condition is based on the application of an exclusive NOR (XNOR) logical operator. Therefore, while the hybrid system demonstrates enhanced directional prediction performance, its dependency on specific input data availability and strict logical alignment criteria reduces the number of applicable trading instances.
To enhance the practical applicability and scalability of the proposed hybrid system, future research should explore methods to relax the strict input data requirements. Therefore, a potential direction for future research would be the integration of alternative trustworthy data sources, such as macroeconomic indicators, or earnings reports, to compensate for the occasional unavailability of RNAs.

Author Contributions

K.L. conceived of the presented idea, developed the proposed hybrid system, analysed the experimental results, and drafted the first draft. K.M. supervised the findings of this work. Both authors discussed the results and contributed to the final manuscript. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Data Availability Statement

The datasets supporting the findings of this study is openly available in https://drive.google.com/drive/folders/1qYAE7O-FyT9tCDqGLjxnAOyFsNCmp0QX?usp=sharing (accessed on 7 July 2025).

Conflicts of Interest

The authors declare no conflicts of interest.

Abbreviations

The following abbreviations are used in this manuscript:
ANNArtificial Neural Network
Bi-LSTMBidirectional Long Short-Term Memory
BERTBidirectional Encoder Representations from Transformers
BoWBag of Words
FNFalse Negatives
FPFalse Positives
FTSEFinancial Times Stock Exchange
GRUGated Recurrent Unit
JSEJamaica Stock Exchange
LSTMLong Short-Term Memory
RNNRecurrent Neural Network
RNARegulatory News Announcement
TNTrue Negatives
TPTrue Positives
SVMSupport Vector Machine

References

  1. Kirkpatrick, C.D., II; Dahlquist, J.R. Technical Analysis: The Complete Resource for Financial Market Technicians; FT Press: Upper Saddle River, NJ, USA, 2010. [Google Scholar]
  2. Choudhuri, S. A Research on Trading of Sensex Stocks by Using RSI. Int. J. Innov. Technol. Explor. Eng. (IJITEE) 2019, 8, 14–22. [Google Scholar]
  3. Rodríguez-González, A.; García-Crespo, A.; Colomo-Palacios, R.; Guldrís Iglesias, F.; Gómez-Berbís, J.M. CAST: Using neural networks to improve trading systems based on technical analysis by means of the RSI financial indicator. Expert Syst. Appl. 2011, 38, 11489–11500. [Google Scholar] [CrossRef]
  4. Taran-Moroan, A. The relative strength index revisited. Afr. J. Bus. Manag. 2011, 5, 5855–5862. [Google Scholar]
  5. Xiao, H. RSI and MACD indicators integrated: Evidence from S&P 500 and Li-Ning as an example. BCP Bus. Manag. 2023, 38, 255–261. [Google Scholar]
  6. Dan, I.G. Anghel Stock market efficiency and the MACD. Evidence from countries around the world. Procedia Econ. Financ. 2015, 32, 1414–1431. [Google Scholar]
  7. Huang, P.; Ni, Y. Board structure and stock price informativeness in terms of moving average rules. Q. Rev. Econ. Financ. 2017, 63, 161–169. [Google Scholar] [CrossRef]
  8. Shintani, M.; Yabu, T.; Nagakura, D. Spurious regressions in technical trading. J. Econom. 2012, 169, 301–309. [Google Scholar] [CrossRef]
  9. Heng, F.T.K.; Azizan, N.A.; Yeap, L.W. Technical trading systems as crys tal balls in reducing risk: The Malaysian stock market. Int. Bus. Manag. 2012, 6, 140–146. [Google Scholar] [CrossRef]
  10. Spulbar, C.M.; Ene, C.C. Predictive analytics in finance using the ARIMA model: Application for Bucharest Stock Exchange financial companies closing prices. Stud. Bus. Econ. 2024, 19, 30–49. [Google Scholar] [CrossRef]
  11. Farsi, M.; Hosahalli, D.; Manjunatha, B.R.; Gad, I.; Atlam, E.S.; Ahmed, A.; Elmarhomy, G.; Elmarhoumy, M.; Ghoneim, O.A. Parallel genetic algorithms for optimising the SARIMA model for better forecasting of the NCDC weather data. Alex. Eng. J. 2021, 60, 1299–1316. [Google Scholar] [CrossRef]
  12. Kobiela, D.; Krefta, D.; Krol, W.; Weichbroth, P. ARIMA vs LSTM on NASDAQ stock exchange data. Procedia Comput. Sci. 2022, 207, 3830–3839. [Google Scholar] [CrossRef]
  13. Zhang, Z. Comparison of LSTM and ARIMA in Price Forecasting: Evidence from Five Indexes. In Proceedings of the 2023 2nd International Conference on Economics, Smart Finance and Contemporary Trade (ESFCT 2023), Dali, China, 28–30 July 2023; Atlantis Press: Dordrecht, The Netherlands, 2023; pp. 40–46. [Google Scholar] [CrossRef]
  14. Kuang, S. A Comparison of Linear Regression, LSTM model and ARIMA model in Predicting Stock Price: A Case Study of HSBC’s Stock Price. BCP Bus. Manag. 2023, 44, 478–488. [Google Scholar] [CrossRef]
  15. Sen, P.; Roy, M.; Pal, P. Application of ARIMA for forecasting energy consumption and GHG emission: A case study of an Indian pig iron manufacturing organization. Energy 2016, 116, 1031–1038. [Google Scholar] [CrossRef]
  16. Ospina, R.; Gondim, J.A.M.; Leiva, V.; Castro, C. An Overview of Forecast Analysis with ARIMA Models during the COVID-19 Pandemic: Methodology and Case Study in Brazil. Mathematics 2023, 11, 3069. [Google Scholar] [CrossRef]
  17. Sirisha, U.M.; Belavagi, M.C.; Attigeri, G. Profit Prediction Using ARIMA, SARIMA and LSTM Models in Time Series Forecasting: A Comparison. IEEE Access 2022, 10, 124715–124727. [Google Scholar] [CrossRef]
  18. Dar, A.A.; Jain, A.; Malhotra, M.; Farooqi, A.R.; Albalawi, O.; Khan, M.S. Time Series analysis with ARIMA for historical stock data and future projections. Soft Comput. 2024, 28, 12531–12542. [Google Scholar] [CrossRef]
  19. Pokou, F.; Kamdem, J.S.; Benhmad, F. Hybridization of ARIMA with Learning Models for Forecasting of Stock Market Time Series. Comput. Econ. 2024, 63, 1349–1399. [Google Scholar] [CrossRef]
  20. Liu, K.; Zhou, J.; Dong, D. Improving stock price prediction using the long short-term memory model combined with online social networks. J. Behav. Exp. Financ. 2021, 30, 100507. [Google Scholar] [CrossRef]
  21. Dioubi, F.; Hundera, N.W.; Xu, H.; Zhu, X. Enhancing stock market predictions via hybrid external trend and internal components analysis and long short term memory model. J. King Saud Univ.-Comput. Inf. Sci. 2024, 36, 102252. [Google Scholar] [CrossRef]
  22. Kristiyanti, D.A.; Nova Pramudya, W.B.; Sanjaya, S.A. How can we predict transportation stock prices using artificial intelligence? Findings from experiments with Long Short-Term Memory based algorithms. Int. J. Inf. Manag. Data Insights 2024, 4, 100293. [Google Scholar] [CrossRef]
  23. Huang, X.; Wu, C.; Du, X.; Wang, H.; Ye, M. A novel stock trading utilizing long short term memory prediction and evolutionary operating-weights strategy. Expert Syst. Appl. 2024, 246, 123146. [Google Scholar] [CrossRef]
  24. Zhang, Y.; Chu, G.; Shen, D. The role of investor attention in predicting stock prices: The long short-term memory networks perspective. Financ. Res. Lett. 2021, 38, 101484. [Google Scholar] [CrossRef]
  25. Park, H.J.; Kim, Y.; Kim, H.Y. Stock market forecasting using a multi-task approach integrating long short-term memory and the random forest framework. Appl. Soft Comput. 2022, 114, 108106. [Google Scholar] [CrossRef]
  26. Nguyen, T.H.; Shirai, K.; Velcin, J. Sentiment analysis on social media for stock movement prediction. Expert Syst. Appl. 2015, 42, 9603–9611. [Google Scholar] [CrossRef]
  27. Zhen, K.; Xie, D.; Hu, X. A multi-feature selection fused with investor sentiment for stock price prediction. Expert Syst. Appl. 2025, 278, 127381. [Google Scholar] [CrossRef]
  28. Deng, S.; Luo, Q.; Zhu, Y.; Ning, H.; Yu, Y.; Gao, Y.; Shen, Q.; Shimada, T. Multi-sentiment fusion for stock price crash risk prediction using an interpretable ensemble learning method. Eng. Appl. Artif. Intell. 2024, 135, 108842. [Google Scholar] [CrossRef]
  29. Jing, N.; Wu, Z.; Wang, H. A hybrid model integrating deep learning with investor sentiment analysis for stock price prediction. Expert Syst. Appl. 2021, 178, 115019. [Google Scholar] [CrossRef]
  30. Huang, J.Y.; Tung, C.L.; Lin, W.Z. Using Social Network Sentiment Analysis and Genetic Algorithm to Improve the Stock Prediction Accuracy of the Deep Learning-Based Approach. Int. J. Comput. Intell. Syst. 2023, 16, 93. [Google Scholar] [CrossRef]
  31. John, A.; Latha, Τ. Stock market prediction based on deep hybrid RNN model and sentiment analysis. Automatica 2023, 64, 981–995. [Google Scholar] [CrossRef]
  32. Bogle, S.A.; Potter, W.D. SentAMaL—A Sentiment Analysis Machine Learning Stock Predictive Model. In Proceedings of the International Conference on Artificial Intelligence (ICAI), The Steering Committee of The World Congress in Computer Science, Computer Engineering and Applied Computing (WorldComp), Las Vegas, NV, USA, 22–25 July 2015; pp. 610–615. [Google Scholar]
  33. Ko, C.; Chang, H. LSTM-based sentiment analysis for stock price forecast. PeerJ Comput. Sci. 2021, 7, e408. [Google Scholar] [CrossRef]
  34. Jin, S. Sentiment-Driven Forecasting LSTM Neural Networks for Stock Prediction-Case of China Bank Sector. Int. J. Adv. Comput. Sci. Appl. 2023, 14, 1. [Google Scholar] [CrossRef]
  35. Sreyash, U.; Bijit, G.; Suresh, A. Stock Market Prediction Using LSTM and Sentiment Analysis.  Turk. J. Comput. Math. Educ. 2021, 12, 4653–4658. [Google Scholar]
  36. Ouf, S.; El Hawary, M.; Aboutabl, A.; Adel, S. A Deep Learning-Based LSTM for Stock Price Prediction Using Twitter Sentiment Analysis. (IJACSA) Int. J. Adv. Comput. Sci. Appl. 2024, 15, 207. [Google Scholar] [CrossRef]
  37. Liagkouras, K.; Metaxiotis, K. Extracting Sentiment from Business News Announcements for More Efficient Decision Making. In Advances in Artificial Intelligence-Empowered Decision Support Systems. Learning and Analytics in Intelligent Systems; Tsihrintzis, G.A., Virvou, M., Doukas, H., Jain, L.C., Eds.; Springer: Cham, Switzerland, 2024; Volume 39. [Google Scholar] [CrossRef]
  38. Ghalyan, I.F. Capacitive empirical risk function-based bag-of-words and pattern classification processes. Pattern Recognit. 2023, 139, 109482. [Google Scholar] [CrossRef]
  39. Dey, A.; Jenamani, M.; Thakkar, J.J. Senti-N-Gram: An n-gram lexicon for sentiment analysis. Expert Syst. Appl. 2018, 103, 92–105. [Google Scholar] [CrossRef]
  40. Liagkouras, K.; Metaxiotis, K. Stock Market Forecasting by Using Support Vector Machines. In Machine Learning Paradigms. Learning and Analytics in Intelligent Systems; Tsihrintzis, G., Jain, L., Eds.; Springer: Cham, Switzerland, 2020; Volume 18. [Google Scholar] [CrossRef]
  41. Aftan, S.; Shah, H. A survey on BERT and its applications. In Proceedings of the 20th Learning and Technology Conference (L&T), Jeddah, Saudi Arabia, 26 January 2023; IEEE: Piscataway, NJ, USA, 2023. [Google Scholar] [CrossRef]
  42. He, P.; Gao, J.; Chen, W. DeBERTaV3: Improving DeBERTa Using ELECTRA-Style Pre-Training with Gradient-Disentangled Embedding Sharing. arXiv 2021, arXiv:2111.09543. [Google Scholar]
  43. Devlin, J.; Chang, M.-W.; Lee, K.; Toutanova, K. BERT: Pre-training of deep bidirectional transformers for language understanding. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Minneapolis, MN, USA, 2–7 June 2019; Association for Computational Linguistics: Stroudsburg, PA, USA, 2019; pp. 4171–4186. [Google Scholar] [CrossRef]
  44. Sanh, V.; Debut, L.; Chaumond, J.; Wolf, T. DistilBERT, a distilled version of BERT: Smaller, faster, cheaper and lighter. In Proceedings of the NeurIPS EMC Workshop, Vancouver, BC, Canada, 13 December 2019. [Google Scholar]
  45. Rogers, A.; Kovaleva, O.; Rumshisky, A. A primer in BERTology: What we know about how BERT works. In Transactions of the Association for Computational Linguistics; Association for Computational Linguistics: Stroudsburg, PA, USA, 2020; Volume 8, pp. 842–866. [Google Scholar] [CrossRef]
  46. Liu, S. Sentiment Analysis of Yelp Reviews: A Comparison of Techniques and Models. arXiv 2020, arXiv:2004.13851. [Google Scholar] [CrossRef]
  47. He, H.; Garcia, E.A. Learning from imbalanced data. IEEE Trans. Knowl. Data Eng. 2009, 21, 1263–1284. [Google Scholar]
Figure 1. A Long Short-Term Memory network.
Figure 1. A Long Short-Term Memory network.
Electronics 14 02753 g001
Figure 2. A hybrid LSTM and Sentiment Analysis System for predicting the direction of the future closing prices. Note: the hybrid system is activated only when both subsystems generate the same directional signal (XNOR logical operator).
Figure 2. A hybrid LSTM and Sentiment Analysis System for predicting the direction of the future closing prices. Note: the hybrid system is activated only when both subsystems generate the same directional signal (XNOR logical operator).
Electronics 14 02753 g002
Figure 3. Confusion matrix.
Figure 3. Confusion matrix.
Electronics 14 02753 g003
Figure 4. Fluctuations of the AstraZeneca’s closing prices over the examined period.
Figure 4. Fluctuations of the AstraZeneca’s closing prices over the examined period.
Electronics 14 02753 g004
Figure 5. Fluctuations of the Rio Tinto’s closing prices over the examined period.
Figure 5. Fluctuations of the Rio Tinto’s closing prices over the examined period.
Electronics 14 02753 g005
Figure 6. AstraZeneca’s directional accuracy of the competing models.
Figure 6. AstraZeneca’s directional accuracy of the competing models.
Electronics 14 02753 g006
Figure 7. AstraZeneca’s confusion matrices for the 1st iteration of the standalone models.
Figure 7. AstraZeneca’s confusion matrices for the 1st iteration of the standalone models.
Electronics 14 02753 g007
Figure 8. AstraZeneca’s and Rio Tinto’s Confusion matrices for the first iteration of the hybrid system.
Figure 8. AstraZeneca’s and Rio Tinto’s Confusion matrices for the first iteration of the hybrid system.
Electronics 14 02753 g008
Table 1. Related work on hybrid models for stock market prediction.
Table 1. Related work on hybrid models for stock market prediction.
ReferencesDataTime PeriodSource of NewsHybrid ModelModel’s Output
Jing et al. [29]Shanghai Stock Exchange1 January 2017 to 31 July 2019stock forumSentiment Analysis + CNN + LSTMPredicting stock’s closing price
Huang et al. [30]Taiwan Semiconductor Manufacturing Company1 January 2019 to 29 April 2021social mediaSentiment Analysis + Genetic Algorithm + LSTMTwo classes (Up, Down)
John and Latha [31]NASDAQMarch 2013 to November 2019financial newsSentiment Analysis + Bi-LSTM + LSTM + GRUPredicting stock’s closing price
Bogle and Potter [32]Jamaica Stock ExchangeJanuary and February 2015social media—TwitterSentiment Analysis + decision trees or ANN or SVMMovement prediction of the JSE index
Ko and Chang [33]Taiwan Stock Exchange1 January 2015 to 31 March 2020news, online forum postsSentiment Analysis (BERT) + LSTMPredicting stock’s opening price
Jin [34]Shanghai Stock Exchange1 August 2022 to 1 August 2023sentiment in banking sectorSentiment Analysis + LSTMTwo classes (Up, Down)
Sreyash et al. [35]New York Stock Exchange (NYSE)from 2010 to 2020social media—TwitterSentiment Analysis + LSTMPredicting normalised stock’s prices
Ouf et al. [36]S&P 500June 2015 to September 2020social media—TwitterSentiment Analysis + LSTMTwo classes (Up, Down)
Table 2. Stages of text pre-processing.
Table 2. Stages of text pre-processing.
StagesText Pre-Processing
1.Convert to lowercase
2.Removing punctuation marks
3.Tokenization: split the text into individual words
4.Removing stop words
5.Stemming: reduce words to their base
6.Removing numbers
7.Remove html tags
Table 3. Extracting features using bag of words.
Table 3. Extracting features using bag of words.
RNAsTotalVotingRightsQ4ProductionReportChangesLeadership
total voting rights report11100100
q4 production report00011100
leadership changes00000011
Table 4. Building a predictive model for sentiment analysis.
Table 4. Building a predictive model for sentiment analysis.
StagesA Predictive Model for Sentiment Analysis
1.Train-Test Split: divide the dataset into training and testing sets
2.Model Selection: use a classification algorithm such as Naive Bayes, Logistic Regression, or SVM
3.Model Training
4.Model Evaluation using performance metrics
5.Make predictions using the trained model to classify new, unseen text
Table 5. The two datasets under examination.
Table 5. The two datasets under examination.
Analytical Overview of the Dataset
1.Historical stock prices and RNAs for AstraZeneca and Rio Tinto, which are traded on the FTSE 100
2.Time Period: 2 January 2019–28 May 2021
3.During the selected period, there were 609 trading days
4.During the selected period there were 290 Regulatory News Announcements (RNAs) for AstraZeneca, distributed over 212 trading days.
5.During the selected period there were 575 Regulatory News Announcements (RNAs) for Rio Tinto, distributed over 325 trading days.
6.On some trading days there are multiple RNAs, while on others, there are none.
7.We randomly split the data into training (70%) and testing (30%) and report the metrics per iteration
Table 6. AstraZeneca’s experimental results of standalone models.
Table 6. AstraZeneca’s experimental results of standalone models.
LSTM Network
Iteration
AccuracyPrecision (Up)Recall (Up)F1-Score (Up)
10.560.570.270.31
20.540.510.250.34
30.550.560.180.27
40.530.500.180.26
50.560.570.270.31
Mean ± sd0.55 ± 0.010.54 ± 0.030.23 ± 0.040.30 ± 0.03
Logistic Regr.
Iteration
AccuracyPrecision (Up)Recall (Up)F1-Score (Up)
10.530.550.600.57
20.540.540.710.62
30.520.560.580.57
40.500.590.400.47
50.490.520.480.50
Mean ± sd0.52 ± 0.010.55 ± 0.020.55 ± 0.100.54 ± 0.05
SVM
Iteration
AccuracyPrecision (Up)Recall (Up)F1-Score (Up)
10.520.540.670.60
20.520.530.510.52
30.520.610.360.45
40.500.530.720.61
50.490.490.990.66
Mean ± sd0.51 ± 0.010.54 ± 0.030.65 ± 0.210.57 ± 0.07
Simple RNN
Iteration
AccuracyPrecision (Up)Recall (Up)F1-Score (Up)
10.520.500.640.56
20.510.470.420.44
30.510.480.760.59
40.480.460.520.49
50.510.480.410.44
Mean ± sd0.51 ± 0.010.48 ± 0.010.55 ± 0.130.50 ± 0.06
Table 7. AstraZeneca’s experimental results of the proposed hybrid system.
Table 7. AstraZeneca’s experimental results of the proposed hybrid system.
Hybrid System
Iteration
AccuracyPrecision (Up)Recall (Up)F1-Score (Up)
10.650.750.300.43
20.610.600.300.40
30.650.670.400.50
40.650.750.300.43
50.610.670.200.31
Mean ± sd0.63 ± 0.020.69 ± 0.050.30 ± 0.060.41 ± 0.06
Table 8. Rio Tinto’s experimental results of standalone models.
Table 8. Rio Tinto’s experimental results of standalone models.
LSTM Network
Iteration
AccuracyPrecision (Up)Recall (Up)F1-Score (Up)
10.520.570.750.65
20.560.610.810.70
30.530.560.790.66
40.530.500.180.26
50.550.540.930.68
Mean ± sd0.54 ± 0.010.56 ± 0.030.69 ± 0.260.59 ± 0.16
Logistic Regr.
Iteration
AccuracyPrecision (Up)Recall (Up)F1-score (Up)
10.530.540.910.67
20.520.540.820.65
30.510.530.560.65
40.500.540.750.62
50.490.490.760.59
Mean ± sd0.51 ± 0.010.53 ± 0.020.76 ± 0.110.64 ± 0.03
SVM
Iteration
AccuracyPrecision (Up)Recall (Up)F1-score (Up)
10.480.481.000.65
20.540.540.840.66
30.480.481.000.64
40.490.510.820.63
50.520.520.910.66
Mean ± sd0.50 ± 0.020.51 ± 0.020.91 ± 0.070.65 ± 0.01
Simple RNN
Iteration
AccuracyPrecision (Up)Recall (Up)F1-score (Up)
10.480.480.950.64
20.520.510.840.63
30.490.490.990.65
40.510.500.520.51
50.490.480.560.52
Mean ± sd0.50 ± 0.010.49 ± 0.010.77 ± 0.190.59 ± 0.06
Table 9. Rio Tinto’s experimental results of the proposed hybrid system.
Table 9. Rio Tinto’s experimental results of the proposed hybrid system.
Hybrid Model
Iteration
AccuracyPrecision (Up)Recall (Up)F1-Score (Up)
10.620.500.720.59
20.640.520.780.62
30.600.500.740.60
40.620.520.740.61
50.640.540.740.62
Mean ± sd0.62 ± 0.010.52 ± 0.010.74 ± 0.020.61 ± 0.01
Table 10. AstraZeneca’s experimental results for sentiment analysis using competing configurations.
Table 10. AstraZeneca’s experimental results for sentiment analysis using competing configurations.
Sentiment AnalyserAccuracyPrecision (Up)Recall (Up)F1-Score (Up)
BoW + Naïve Bayes0.55 ± 0.020.56 ± 0.020.54 ± 0.020.55 ± 0.02
DeBERTa v30.53 ± 0.020.57 ± 0.020.47 ± 0.020.50 ± 0.02
Weighted Fusion Ensemble0.54 ± 0.020.55 ± 0.020.51 ± 0.020.53 ± 0.02
DistilBERT0.50 ± 0.020.50 ± 0.020.83 ± 0.020.62 ± 0.02
Table 11. Rio Tinto’s experimental results for sentiment analysis using competing configurations.
Table 11. Rio Tinto’s experimental results for sentiment analysis using competing configurations.
Sentiment AnalyserAccuracyPrecision (Up)Recall (Up)F1-Score (Up)
BoW + Naïve Bayes0.57 ± 0.020.59 ± 0.020.56 ± 0.020.57 ± 0.02
DeBERTa v30.54 ± 0.020.59 ± 0.020.48 ± 0.020.54 ± 0.02
Weighted Fusion Ensemble0.55 ± 0.020.57 ± 0.020.76 ± 0.020.64 ± 0.02
DistilBERT0.54 ± 0.020.57 ± 0.020.53 ± 0.020.54 ± 0.02
Table 12. AstraZeneca’s rectified results after applying random oversampling.
Table 12. AstraZeneca’s rectified results after applying random oversampling.
Sentiment AnalyserAccuracyPrecision (Up)Recall (Up)F1-Score (Up)
DistilBERT0.50 ± 0.020.59 ± 0.020.84 ± 0.020.70 ± 0.02
Table 13. Rio Tinto’s rectified results after applying random oversampling.
Table 13. Rio Tinto’s rectified results after applying random oversampling.
Sentiment AnalyserAccuracyPrecision (Up)Recall (Up)F1-Score (Up)
Weighted Fusion Ensemble0.54 ± 0.020.64 ± 0.020.79 ± 0.020.72 ± 0.02
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Liagkouras, K.; Metaxiotis, K. A Hybrid Long Short-Term Memory with a Sentiment Analysis System for Stock Market Forecasting. Electronics 2025, 14, 2753. https://doi.org/10.3390/electronics14142753

AMA Style

Liagkouras K, Metaxiotis K. A Hybrid Long Short-Term Memory with a Sentiment Analysis System for Stock Market Forecasting. Electronics. 2025; 14(14):2753. https://doi.org/10.3390/electronics14142753

Chicago/Turabian Style

Liagkouras, Konstantinos, and Konstantinos Metaxiotis. 2025. "A Hybrid Long Short-Term Memory with a Sentiment Analysis System for Stock Market Forecasting" Electronics 14, no. 14: 2753. https://doi.org/10.3390/electronics14142753

APA Style

Liagkouras, K., & Metaxiotis, K. (2025). A Hybrid Long Short-Term Memory with a Sentiment Analysis System for Stock Market Forecasting. Electronics, 14(14), 2753. https://doi.org/10.3390/electronics14142753

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop