Directional Stock Prediction with Temporal Sentiment

Nabil Benjaa, Amir Ben Khalifa, Faisal Tareque Shohan, Bessam Abdulrazak, Amine Trabelsi, Shengrui Wang
Proceedings of the The 39th Canadian Conference on Artificial Intelligence, PMLR 318:564-574, 2026.

Abstract

Financial market forecasting is increasingly incorporating textual sentiment cues from news and financial reports alongside traditional market indicators. While prior work has frequently incorporated aggregated daily sentiment indicators, the temporal structure through which sentiment propagates into market move- ments remains underexplored. Sentiment influence on index price dynamics may continue beyond a single observation period, thereby limiting the ability of point-in-time sentiment measures. Moreover, predictive performance is often evaluated using regression metrics such as Mean Absolute Error and Mean Absolute Percentage Error. Although these metrics provide valuable insights into prediction error, they fall short of capturing the effectiveness required in financial settings, where accurately predicting the direction of price movements is crucial. To address these limitations, we introduce temporally sentiment features that capture the persistence and evolution of market perception over time rather than relying on the last-day sentiment. In addition, we propose a Transformer-based forecasting architecture specifically designed to model temporal dependencies between sentiment and index returns. Our approach also prioritizes directional evaluation and incorporates an asymmetric custom objective function to better address the risks associated with negative market movements. Findings indicate that, while conventional error metrics are comparable to baseline models, the integration of temporal sentiment significantly enhances overall directional prediction. Fur- thermore, employing an asymmetric custom objective function especially in the context of the Transformer based model improves the identification of downward trends while ensuring a more effective balance between positive and negative market fluctuations.

Cite this Paper


BibTeX
@InProceedings{pmlr-v318-benjaa26a, title = {Directional Stock Prediction with Temporal Sentiment}, author = {Benjaa, Nabil and Khalifa, Amir Ben and Shohan, Faisal Tareque and Abdulrazak, Bessam and Trabelsi, Amine and Wang, Shengrui}, booktitle = {Proceedings of the The 39th Canadian Conference on Artificial Intelligence}, pages = {564--574}, year = {2026}, editor = {Bouzar-Benlabiod, Lydia and Leung, Carson}, volume = {318}, series = {Proceedings of Machine Learning Research}, month = {25--29 May}, publisher = {PMLR}, pdf = {https://raw.githubusercontent.com/mlresearch/v318/main/assets/benjaa26a/benjaa26a.pdf}, url = {https://proceedings.mlr.press/v318/benjaa26a.html}, abstract = {Financial market forecasting is increasingly incorporating textual sentiment cues from news and financial reports alongside traditional market indicators. While prior work has frequently incorporated aggregated daily sentiment indicators, the temporal structure through which sentiment propagates into market move- ments remains underexplored. Sentiment influence on index price dynamics may continue beyond a single observation period, thereby limiting the ability of point-in-time sentiment measures. Moreover, predictive performance is often evaluated using regression metrics such as Mean Absolute Error and Mean Absolute Percentage Error. Although these metrics provide valuable insights into prediction error, they fall short of capturing the effectiveness required in financial settings, where accurately predicting the direction of price movements is crucial. To address these limitations, we introduce temporally sentiment features that capture the persistence and evolution of market perception over time rather than relying on the last-day sentiment. In addition, we propose a Transformer-based forecasting architecture specifically designed to model temporal dependencies between sentiment and index returns. Our approach also prioritizes directional evaluation and incorporates an asymmetric custom objective function to better address the risks associated with negative market movements. Findings indicate that, while conventional error metrics are comparable to baseline models, the integration of temporal sentiment significantly enhances overall directional prediction. Fur- thermore, employing an asymmetric custom objective function especially in the context of the Transformer based model improves the identification of downward trends while ensuring a more effective balance between positive and negative market fluctuations.} }
Endnote
%0 Conference Paper %T Directional Stock Prediction with Temporal Sentiment %A Nabil Benjaa %A Amir Ben Khalifa %A Faisal Tareque Shohan %A Bessam Abdulrazak %A Amine Trabelsi %A Shengrui Wang %B Proceedings of the The 39th Canadian Conference on Artificial Intelligence %C Proceedings of Machine Learning Research %D 2026 %E Lydia Bouzar-Benlabiod %E Carson Leung %F pmlr-v318-benjaa26a %I PMLR %P 564--574 %U https://proceedings.mlr.press/v318/benjaa26a.html %V 318 %X Financial market forecasting is increasingly incorporating textual sentiment cues from news and financial reports alongside traditional market indicators. While prior work has frequently incorporated aggregated daily sentiment indicators, the temporal structure through which sentiment propagates into market move- ments remains underexplored. Sentiment influence on index price dynamics may continue beyond a single observation period, thereby limiting the ability of point-in-time sentiment measures. Moreover, predictive performance is often evaluated using regression metrics such as Mean Absolute Error and Mean Absolute Percentage Error. Although these metrics provide valuable insights into prediction error, they fall short of capturing the effectiveness required in financial settings, where accurately predicting the direction of price movements is crucial. To address these limitations, we introduce temporally sentiment features that capture the persistence and evolution of market perception over time rather than relying on the last-day sentiment. In addition, we propose a Transformer-based forecasting architecture specifically designed to model temporal dependencies between sentiment and index returns. Our approach also prioritizes directional evaluation and incorporates an asymmetric custom objective function to better address the risks associated with negative market movements. Findings indicate that, while conventional error metrics are comparable to baseline models, the integration of temporal sentiment significantly enhances overall directional prediction. Fur- thermore, employing an asymmetric custom objective function especially in the context of the Transformer based model improves the identification of downward trends while ensuring a more effective balance between positive and negative market fluctuations.
APA
Benjaa, N., Khalifa, A.B., Shohan, F.T., Abdulrazak, B., Trabelsi, A. & Wang, S.. (2026). Directional Stock Prediction with Temporal Sentiment. Proceedings of the The 39th Canadian Conference on Artificial Intelligence, in Proceedings of Machine Learning Research 318:564-574 Available from https://proceedings.mlr.press/v318/benjaa26a.html.

Related Material