Source-linked AI summary
Predicting Stock Prices with FinBERT-LSTM: Integrating News Sentiment Analysis
Wenjun Gu, Yihao Zhong, Shizun Li, Changsong Wei, Liting Dong, Zhuoyue Wang, Chao Yan
TL;DR
Stock prices fluctuate with many influences, and extracting useful insights from financial news remains challenging despite its relevance to stock movements. The paper combines Fin-BERT sentiment analysis of stock-related headlines with historical closing prices in an LSTM model to forecast prices. The reported method achieved Testing loss of 0.00083, MAE of 173.67, MAPE of 0.045, and Accuracy of 0.955 at 77 epochs; LSTM Architecture performed second and DNN Architecture worst.
Problem
Stock prices fluctuate with many influences, and extracting useful insights from financial news remains challenging despite its relevance to stock movements.
Source: §1 · p. 2Method
The paper combines Fin-BERT sentiment analysis of stock-related headlines with historical closing prices in an LSTM model to forecast prices.
Source: §3.2 · p. 5, §5 · p. 9Results
The reported method achieved Testing loss of 0.00083, MAE of 173.67, MAPE of 0.045, and Accuracy of 0.955 at 77 epochs; LSTM Architecture performed second and DNN Architecture worst.
Source: §5 · p. 9Takeaways & Limitations
The reported comparison favors combining news-derived sentiment with historical prices, although performance differed little between Fin-BERT Embedding LSTM and LSTM.
Source: §5 · p. 9The authors leave validation across other sectors and market conditions, including precious metals, energy, and real estate, for future work.
Source: §5 · p. 9
Abstract
from arXiv · showhide
The stock market's ascent typically mirrors the flourishing state of the economy, whereas its decline is often an indicator of an economic downturn. Therefore, for a long time, significant correlation elements for predicting trends in financial stock markets have been widely discussed, and people are becoming increasingly interested in the task of financial text mining. The inherent instability of stock prices makes them acutely responsive to fluctuations within the financial markets. In this article, we use deep learning networks, based on the history of stock prices and articles of financial, business, technical news that introduce market information to predict stock prices. We illustrate the enhancement of predictive precision by integrating weighted news categories into the forecasting model. We developed a pre-trained NLP model known as FinBERT, designed to discern the sentiments within financial texts. Subsequently, we advanced this model by incorporating the sophisticated Long Short Term Memory (LSTM) architecture, thus constructing the innovative FinBERT-LSTM model. This model utilizes news categories related to the stock market structure hierarchy, namely market, industry, and stock related news categories, combined with the stock market's stock price situation in the previous week for prediction. We selected NASDAQ-100 index stock data and trained the model on Benzinga news articles, and utilized Mean Absolute Error (MAE), Mean Absolute Percentage Error (MAPE), and Accuracy as the key metrics for the assessment and comparative analysis of the model's performance. The results indicate that FinBERT-LSTM performs the best, followed by LSTM, and DNN model ranks third in terms of effectiveness.
1 INTRODUCTION
Stock-price prediction is difficult because prices fluctuate with many influences, while financial news can reflect company performance and market sentiment. The introduction motivates combining news sentiment analysis with price-based forecasting.
1 INTRODUCTION
- Stock prices fluctuate with many influences, including inflation and international tensions, making prediction inherently challenging.The introduction notes that identifying trends can still support reasonably precise short-term forecasts.Source: §1 · p. 2
- News pertinent to finance carries market information, and analyzing it may improve the accuracy of stock-trend forecasts.The text relates negative articles to poor company performance and positive articles to good performance.Source: §1 · p. 2
- Sentiment analysis categorizes text as positive or negative, helping capture emotional responses that may inform predictions of stock trajectories.Reports of profits or acquisitions may evoke positive sentiment, while reports of layoffs or bankruptcy may evoke negative reactions.Source: §1 · p. 2
- Technical analysis uses stock-price and trading-volume dynamics, while prior research has also framed prediction as sequential analysis over time.Earlier studies often used time t to predict the immediately following time t+1.Source: §1 · p. 2
2 STATE OF THE ART
Prior work has explored machine-learning approaches to stock prediction, including methods that combine numerical data with news and sentiment. This paper positions its hybrid Fin-BERT–LSTM model within that line of work.
2 STATE OF THE ART
- Stock forecasting research has increasingly used machine learning and deep learning, including RNNs, LSTMs, and attention-based methods.The text describes LSTM variants and attention mechanisms as prominent developments in deep learning.Source: §2 · pp. 2–3
- News-sensitive forecasting commonly combines stock-price data and news articles, sometimes alongside technical indicators and multifaceted data.Prior studies also explored sentiment analysis of news and social-media activity for stock-price prediction.Source: §2 · p. 3
- The paper introduces a hybrid model combining financial-news sentiment analysis with stock-price trend data using Fin-BERT and LSTM networks.Its evaluation compares this approach with price-only LSTM and DNN models.Source: §2 · p. 3
3 METHODOLOGY
The methodology uses historical financial news and stock-price data to compare a Fin-BERT–LSTM model with price-only LSTM and DNN alternatives. The models use past observations to forecast closing prices.
3.1 Dataset
- The dataset comprises 843,062 news items, including articles published from February 15, 2009, to June 12, 2020, with stock-related information and codes.The study also uses US stock codes and pricing data sourced from Yahoo Finance alongside Benzinga news.Source: §3.1 · pp. 3–4, §3 · p. 3
3.2 Fin-BERT Embedding LSTM Architecture
- The Fin-BERT–LSTM architecture processes news-derived sentiment and historical stock-price features together to forecast closing prices.Its sequence model uses observations from the past eight time points and a final dense layer for prediction.Source: §3.2 · pp. 4–5
- Fin-BERT classifies stock-related headlines as neutral, positive, or negative, and the model combines daily sentiment indicators with closing prices from the preceding eight trading sessions.The resulting sequence is used to predict the next trading day's closing price.Source: §3.2 · p. 5
3.3 LSTM Architecture
- The price-only LSTM baseline uses closing prices from the past eight days as input and predicts a future closing value.The model normalizes the data and uses a sequence of LSTM layers followed by a single-neuron output layer.Source: §3.3 · pp. 5–6
3.4 DNN Architecture
- The DNN baseline uses the past eight days of closing prices, followed by three fully connected layers with 256, 128, and 64 neurons.The architecture ends with a single-neuron linear output for regression.Source: §3.4 · p. 6
4 RESULTS
The results compare three architectures using loss, MAE, MAPE, and accuracy, and report Fin-BERT Embedding LSTM as best overall. Individual architecture results include validation and test losses and eBay price forecasts.
4.1 Performance Indicator
- The evaluation uses MAE for mean absolute forecast error, MAPE for average proportional discrepancy, and defines accuracy as one minus MAPE.The experiments used identical hardware, ran for 100 epochs, and selected checkpoint parameters by validation loss.Source: §4 · p. 6, §4.1 · p. 7
4.2 Fin-BERT Embedding LSTM Architecture
- The model’s Figure 1 loss was 0.00083, and its predictions had MAE 173.67, MAPE 0.045, and accuracy 0.955; it was applied to forecast eBay stock prices for 100 days.Source: §4.2 · p. 7
4.3 LSTM Architecture
- LSTM recorded a test loss of 0.00092, MAE of 183.36, MAPE of 0.072, and accuracy of 0.928.Its validation loss was 0.00085, and it was used to forecast eBay price movements over 100 days.Source: §4.3 · pp. 7–8
4.4 DNN Architecture
- DNN recorded a test loss of 21.77, MAE of 489.32, MAPE of 0.22, and accuracy of 0.78.Its validation loss was 0.458; the model was projected over 100 trading days.Source: §4.4 · p. 8
- Fin-BERT Embedding LSTM performed best, LSTM second, and DNN worst across testing loss, MAE, MAPE, and accuracy.Table 2 compares the approaches on these performance measures.Source: §4.4 · p. 8, Table 2 · p. 9
5 CONCLUSION
The paper proposes three stock-price forecasting models, with Fin-BERT Embedding LSTM combining news sentiment and historical prices. It performs best, while the authors identify larger-scale validation and broader market coverage as future directions.
5 CONCLUSION
- Fin-BERT Embedding LSTM analyzes news sentiment and combines it with historical stock closing-price trends; LSTM and DNN use only historical closing prices.The stated aim is to extract features from numerical and news data to improve closing-price forecasts and reduce predictive error.Source: §5 · p. 9
- The best-performing method achieved testing loss 0.00083, MAE 173.67, MAPE 0.045, and accuracy 0.955 at 77 epochs, with better performance and less computation time.LSTM Architecture ranked second and DNN Architecture worst; the performance difference between Fin-BERT Embedding LSTM Architecture and LSTM Architecture was small.Source: §5 · p. 9
- The authors propose expanding experiments to larger datasets and testing the models within current state-of-the-art frameworks.They also plan to deepen news-emotion analysis and add a mechanism to identify fake financial news, which they expect to improve prediction stability, reliability, and robustness.Source: §5 · p. 9
- The authors aim to test the model beyond stocks, including precious metals, energy, and real estate, across varied market conditions.Source: §5 · p. 9