1. Introduction
In a nutshell, it would not be wrong to state that forecasting this understood as both one of the hardest as well as most terrifying activities has remained a very arduous task with the uncertainty of different events in the global financial market. Currently, the forums in which people's sentiments become the center of discourse and research revolve around the social media, news texts, and various sources of online platforms [1] A contemporary sector of financial economics, sentiment analysis, reaches a promising line, especially in the consideration of market belief in the bid to change strategies according to massive data samples derived from different sources such as social media and news articles [2].
Generally, the economic news and technical indicators used in inherited financial instruments reflect historical statistical data to a large extent, ignoring the current mood of the market. Nevertheless, it can be said that there has been a growing tendency of artificial intelligence (AI) usage in financial trading, and one of the fields of AI, natural language processing (NLP), has made it much easier for traders to analyze market behavior interpreting sentiment. Through deeper neural networks like Long Short-Term Memory (LSTM), combined with natural language processing models such as Word2vec, stock price has gained a good outlook in sentiment analysis due to improved trustworthy analysis [3].
Deeply rooted in AI technology, firms are able to extract insights from the humongous volumes of unstructured data which is the core to determining the interrelation among varying key factors and indexes. Certainly, financial market trading where multiple sources, for instance, social media sentiment and financial news, are used is a prodigious area still to be explored, whereas in more traditional financial instruments this is already common [4]. The present stage of the proposal is to deliver a fully-skilled market sentiment analyzer based on NLP technologies through research on investor sentiment, which causes fluctuations of stock market prices.
Therefore, to substantiate its finding, this research is based on different data resources, which could provide the identification of investor sentiment role at the numerical analysis stage.
2. Literature review
A huge amount of contemporary research considers the influence of market sentiment as one of the major determinants of market prices movement. This study assumes that social media, along with public emotions, can provide adequate forecasts of stock market movements during crisis time, as well as during COVID-19, for instance [1]. This leads us to concluding how sentiment analysis can be considered a useful tool to observe market trends in times when markets are unstable.
Furthermore, news mix was shown to be one of the main problems that journalists face in churns in market sentiments. As mentioned before, machine intelligence for sentiment analysis has been developed by various organizations, such as the FinBERT-LSTM model, which is a news article emotion analysis and can be used to forecast the stock prices [2]. The model involves sentimental analysis combined with stochastic emission, which enhances forecasting accuracy as well as the impact of cognitive process of indicators.
Nevertheless, the role of market sentiment in forecasting practices seems to be still far from its zenith. Some of the findings published so far put emphasis on one single source of sentiment data, but if multiple sources of sentiment data flow, then the issue should be fully studied by considering every data source. Anticipated is the finding that working in the domain of collective sentiment data to apply some methods seems premature as the final conclusions regarding its efficacy in different market conditions have not yet been arrived at [3]. One that stands to gain significantly from this is the area of sentiment modeling, which during its development has encountered issues such as the dynamic and unpredictable nature of the financial markets.
Thus, the study has sectoral goal of filling up these gaps by increasing the complexity from that of the data obtained from different sources by integrating them in evolving market universe where weather seems much uncertain. Another purpose of sentiment indices development is their processing and refining to improve precision in predictions, and thus, extending research field of sentiment analysis in financial markets.
In this paper, random wiring neural networks (RW-GNNs) are used in natural neural networks. [5] Named Entity Recognition (NER) is a critical task in natural language processing (NLP) that involves identifying entities such as names, locations, organizations, and others within text. For Chinese NER, challenges such as lack of word boundaries, homophones, and diverse contextual dependencies make the task more complex compared to languages like English. In recent years, Graph Neural Networks (GNNs) have emerged as a promising approach for NER tasks due to their ability to capture complex relationships in structured data.
3. Methodology
3.1. Research objective and approach
The aiming of this research is the performance test concerning the influence of sentiment indicators on the market forecasting models, particularly for QQQ ETF. We are in our preliminary research, and we expect that sentiment analysis from financial news can increase the predictive ability of traditional models at a critical level. For testing this hypothesis, we invented a strategy that encompasses sentiment and the classical market features in an LSTM-based prediction model.
3.2. Data collection and preprocessing
3.2.1. Financial news data
We collected financial news data related to the QQQ ETF and its component stocks from [source name, e.g., Reuters, Bloomberg]. The dataset spans from January 1, 2015, to December 31, 2023, and includes headlines and summaries of articles relevant to QQQ and its key components. This news data serves as the primary source for our sentiment analysis.
3.2.2. Market data
We gathered market data for the QQQ ETF to establish a baseline and ensure temporal alignment with the news data:
Daily Price Data: Including open, high, low, and close prices.
Trading Volume: Daily volume data of the ETF.
Options Market Data: Information about implied volatility, volume, and open interest.
The market data spans the same period as the news dataset to ensure consistency during the analysis. Both the news and market datasets were preprocessed to handle missing data, align time indices, and filter out any non-informative elements.
3.2.3. Data preprocessing
News Data Preprocessing: We first cleaned the collected news text by removing punctuation, stopwords, and non-ASCII characters. We also tokenized the text and converted it into a standard lowercase format.
Market Data Preprocessing: Market data was cleaned by removing missing values, outliers, and standardizing all numerical features.
Data Alignment: Daily aggregation was used to align news sentiment data with market data, ensuring that features from both data sources were synchronized.
3.3. Sentiment analysis
3.3.1. FinBERT model implementation
The sentiment analysis relied on the FinBERT model, which is a BERT-based transformer model fine-tuned for financial texts. We chose the pre-trained FinBERT model (yiyanghkust/finbert-tone) due to its proven effectiveness in capturing nuanced sentiments in financial contexts.
from transformers import AutoTokenizer, AutoModelForSequenceClassification
from transformers import pipeline
# Load the pre-trained FinBERT model for sentiment analysis
tokenizer = AutoTokenizer.from_pretrained('yiyanghkust/finbert-tone')
model = AutoModelForSequenceClassification.from_pretrained('yiyanghkust/finbert-tone')
nlp = pipeline("sentiment-analysis", model=model, tokenizer=tokenizer)
# Perform sentiment analysis on the financial news data
news_data['sentiment'] = news_data['headline'].apply(lambda x: nlp(x))
Input: The preprocessed news headlines and summaries.
Output: Sentiment classification (positive, negative, neutral) and associated sentiment scores.
3.3.2. Sentiment feature extraction
We extracted several sentiment features from the FinBERT output to enrich our dataset:
Daily Sentiment Ratios: Ratios of positive, negative, and neutral sentiment within each day's news.
Sentiment Intensity Score: Calculated as the difference between positive and negative scores, providing a measure of sentiment strength.
Net Sentiment Score: A net measure of the overall sentiment for each day.
5-Day Moving Averages: Calculated for each sentiment indicator to capture trends over time.
news_data['positive_ratio'] = news_data['sentiment'].apply(lambda x: x['positive']).rolling(window=5).mean()
news_data['negative_ratio'] = news_data['sentiment'].apply(lambda x: x['negative']).rolling(window=5).mean()
news_data['sentiment_intensity'] = news_data['positive_ratio'] - news_data['negative_ratio']
These features were aggregated daily and then aligned with the corresponding market data to generate a comprehensive dataset for model training.
3.4. Model development
3.4.1. Baseline model
To establish a benchmark, we developed a baseline LSTM model using traditional market features:
Input Features: Technical indicators (e.g., RSI, Moving Averages), price data, volume, and options market indicators.
Architecture: LSTM layers were used to capture sequential dependencies in the time-series data.
3.4.2. Sentiment-enhanced model
Next, we created an enhanced LSTM model incorporating both market data and sentiment indicators.
def build_model(input_shape):
model = Sequential([
LSTM(64, input_shape=input_shape, return_sequences=True),
Dropout(0.2),
LSTM(32),
Dropout(0.2),
Dense(1, activation='sigmoid')
])
model.compile(optimizer=Adam(learning_rate=1e-3),
loss='binary_crossentropy',
metrics=['accuracy'])
return model
Model Architecture:
Input Layer: Combined market data and sentiment features.
LSTM Layers: Capturing temporal relationships between both market and sentiment data.
Output Layer: Providing either binary classification (market up/down) or regression for price movement prediction.
We experimented with various hyperparameters, including the number of LSTM layers, hidden units, and optimization algorithms (such as Adam and RMSprop), and selected the best-performing model based on cross-validation results.
3.5. Comparative analysis
To evaluate the impact of sentiment indicators, we conducted a comparative analysis between the baseline and sentiment-enhanced models.
Performance Metrics: Accuracy, F1-score, and RMSE (for regression tasks) were used to evaluate model performance.
Cross-Validation: 10-fold time series cross-validation was used to ensure robustness.
Feature Importance Analysis: We employed SHAP values to quantify the contribution of sentiment features compared to traditional market features.
def plot_feature_importance(model, feature_names):
importance = np.abs(model.layers[0].get_weights()[0].sum(axis=1))
plt.figure(figsize=(10, 6))
sns.barplot(x=importance, y=feature_names)
plt.title('Feature Importance')
plt.xlabel('Absolute Importance')
plt.tight_layout()
plt.show()

(Figure 1 illustrates the feature importance values for a predictive model, with each bar representing the absolute importance of a feature. Features such as trend_mass_index and trend_psar_down have the highest importance, indicating their significant impact on the model's predictions, while others contribute less to the outcome. This analysis aids in identifying key variables for optimization and understanding model behavior)

(Figure 2 displays the absolute importance of various features in a predictive model, highlighting their relative contributions to the model's performance. Features like trend_mass_index, trend_psar_down, and ARSI exhibit high importance, indicating their significant role in the predictions, while others show lower influence, offering insights for feature selection and model refinement)
Feature Importance Graph:
As can be seen from the Figure 1 and Figure 2, sentiment_intensity and positive_ratio contribute the most to the model's predictions, indicating that changes in market sentiment play a key role in market trends. I believe that the possible mechanism is the sensitivity of sentiment features to market fluctuations, especially during periods of large market fluctuations (such as during COVID-19 in 2020). During the model testing process, we observed that sentiment intensity significantly improved the model's predictive ability when predicting large market fluctuations.
4. Experimental results and discussion
4.1. Experiment design
We designed several experiments to evaluate the impact of incorporating sentiment features into the LSTM model:
Baseline Model Performance: Evaluated using only traditional market features.
Sentiment-Enhanced Model Performance: Evaluated with both market and sentiment features.
Ablation Studies: We removed specific sentiment features to observe their impact on model performance, which helped determine the most critical
4.2. Key findings
The experimental results are summarized as follows:
Baseline Model: The average training accuracy was 54.92%, with an F1 score of 0.5808, while the validation accuracy was 54.77%, with an F1 score of 0.5345. The performance metrics indicated that the baseline model had moderate predictive capability but lacked the robustness needed for practical application.
Sentiment-Enhanced Model: Consequently, by integrating sentiment variables, we noticed that the average training accuracy was raised by 56.15%, and the validation accuracy was 55.68%. Besides, the validation F1 score rose to 0.6002, which shows a drastic growth in the model's classification performance. The ablation experiments showed an improvement of 13% in the F1 score due to the presence of the sentiment intensity score.
Effectiveness of Sentiment Features: The developed model showed the biggest improvement during the high market turbulence periods, experiencing situations when the emotions of the investors can determine the dynamics of the market strongly indicate the high role of the sentiment factors in these conditions.
6.3 Performance Stability: The sentiment-augmented model reduced the differences in the F1 scores between the various folds employed in cross-validation in comparison with the baseline model. This indicates that the additional sentiment data offered better modeling of the market behavior under different conditions, which made the model more stable.
4.3. Discussion
4.3.1. Impact of sentiment analysis
It is evident from the sentiment features being introduced that they greatly helped in enhancing the model's predictive accuracy and stability. Furthermore, sentiment indicators were a primary factor in model predictions being precisely right at times of turbulent market, signaling that the emotions of the investors are in fact also influential to the market activities during troubled periods. Among all, sentiment intensity and net sentiment are found to be the most significant features which enabled the model not only a sophisticated trading sentiment but also the ability to express beyond existing market trading. It points to the idea of constructing the combined model of financial sentiments with the market data to produce more accurate market predictions.
4.3.2. Model limitations and future directions
Limitations in the model: Nevertheless, more work is to be done to improve the accuracy of the sentiment-based model. Daily aggregation sentiment method may, for instance, have missed some of the finer details that the minute-by-minute sentiment data could forward. In addition to that, there was a significant deviation in model performance every time there was a market event of extreme nature, thus indicating that more advanced or different model features could further enhance the model's robustness.
Future Research: Future work could focus on exploring additional sources of sentiment data, such as social media or earnings calls, to further enrich the sentiment indicators. Another potential direction is to incorporate a hybrid model that combines LSTM with attention mechanisms to enable the model to focus on key periods where sentiment may have the highest impact on market movement.
5. Conclusion
This study demonstrates that integrating sentiment analysis with market data can significantly enhance stock price prediction models. The LSTM model, enriched with sentiment features, offers better predictive power, especially during turbulent markets. However, further refinements are needed, including parameter optimization and the inclusion of additional data sources, to improve the model's robustness in real-world applications. Our model still needs refinement, and future work will focus on advanced parameter optimization, expanded sentiment data sources, practical applications in live trading, stress testing, and cross-market analysis to broaden the model’s applicability and reliability across various asset classes and market conditions.
References
[1]. Jena, P. R., & Majhi, R. (2023). Are Twitter sentiments during COVID-19 pandemic a critical determinant to predict stock market movements? A machine learning approach. Scientific African, 19, e01480. https: //doi.org/10.1016/j.sciaf.2022.e01480
[2]. Li, H., & Hu, J. (2024). A hybrid deep learning framework for stock price prediction considering the investor sentiment of online forum enhanced by popularity. arXiv Preprint, arXiv: 2405.10584. https: //doi.org/10.48550/arXiv.2405.10584
[3]. Chandola, D., Mehta, A., Singh, S., Tikkiwal, V. A., & Agrawal, H. (2023). Forecasting directional movement of stock prices using deep learning. Annals of Data Science, 10(5), 1361-1378. https: //doi.org/10.1007/s40745-022-00432-6
[4]. Gu, W., Zhong, Y., Li, S., Wei, C., Dong, L., Wang, Z., & Yan, C. (2024). Predicting stock prices with FinBERT-LSTM: Integrating news sentiment analysis. ACM Transactions on Asian and Low-Resource Language Information Processing. https: //doi.org/10.1145/3605210
[5]. Zhang, X., Zhang, Y., Wang, S., Yao, Y., Fang, B., & Yu, P. S. (2023). Multimodal sentiment analysis in financial markets: A deep learning approach integrating text, price patterns, and market indicators. Expert Systems with Applications, 228, 120245. https: //doi.org/10.1016/j.eswa.2023.120245
Cite this article
Chen,Y.;Liu,J.;Gao,P. (2025). Enhancing Stock Price Prediction Through Sentiment Analysis A FinBERT-LSTM Approach to Market Sentiment Integration. Advances in Economics, Management and Political Sciences,204,1-8.
Data availability
The datasets used and/or analyzed during the current study will be available from the authors upon reasonable request.
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 EWA Publishing and/or the editor(s). EWA Publishing 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.
About volume
Volume title: Proceedings of the 4th International Conference on Business and Policy Studies
© 2024 by the author(s). Licensee EWA Publishing, Oxford, UK. This article is an open access article distributed under the terms and
conditions of the Creative Commons Attribution (CC BY) license. Authors who
publish this series agree to the following terms:
1. Authors retain copyright and grant the series right of first publication with the work simultaneously licensed under a Creative Commons
Attribution License that allows others to share the work with an acknowledgment of the work's authorship and initial publication in this
series.
2. Authors are able to enter into separate, additional contractual arrangements for the non-exclusive distribution of the series's published
version of the work (e.g., post it to an institutional repository or publish it in a book), with an acknowledgment of its initial
publication in this series.
3. Authors are permitted and encouraged to post their work online (e.g., in institutional repositories or on their website) prior to and
during the submission process, as it can lead to productive exchanges, as well as earlier and greater citation of published work (See
Open access policy for details).
References
[1]. Jena, P. R., & Majhi, R. (2023). Are Twitter sentiments during COVID-19 pandemic a critical determinant to predict stock market movements? A machine learning approach. Scientific African, 19, e01480. https: //doi.org/10.1016/j.sciaf.2022.e01480
[2]. Li, H., & Hu, J. (2024). A hybrid deep learning framework for stock price prediction considering the investor sentiment of online forum enhanced by popularity. arXiv Preprint, arXiv: 2405.10584. https: //doi.org/10.48550/arXiv.2405.10584
[3]. Chandola, D., Mehta, A., Singh, S., Tikkiwal, V. A., & Agrawal, H. (2023). Forecasting directional movement of stock prices using deep learning. Annals of Data Science, 10(5), 1361-1378. https: //doi.org/10.1007/s40745-022-00432-6
[4]. Gu, W., Zhong, Y., Li, S., Wei, C., Dong, L., Wang, Z., & Yan, C. (2024). Predicting stock prices with FinBERT-LSTM: Integrating news sentiment analysis. ACM Transactions on Asian and Low-Resource Language Information Processing. https: //doi.org/10.1145/3605210
[5]. Zhang, X., Zhang, Y., Wang, S., Yao, Y., Fang, B., & Yu, P. S. (2023). Multimodal sentiment analysis in financial markets: A deep learning approach integrating text, price patterns, and market indicators. Expert Systems with Applications, 228, 120245. https: //doi.org/10.1016/j.eswa.2023.120245