CoolFace
Modelpublic

joyjitroy/Stock_Market_News_Sentiment_Analysis

sourceHugging Facemitupdated 9mo agoView on Hugging Face
3likes
Model Card

<p align="left"> <a href="https://github.com/joyjitroy/MachineLearning/tree/main/NLPStockSentimentAnalysis"> <img src="https://img.shields.io/badge/GitHub-Repo-blue?logo=github" /> </a> <a href="https://doi.org/10.5281/zenodo.17510735"> <img src="https://img.shields.io/badge/Zenodo-DOI-1877f2?logo=zenodo" /> </a> <a href="https://huggingface.co/joyjitroy/StockMarketNewsSentimentAnalysis"> <img src="https://img.shields.io/badge/HuggingFace-Model-yellow?logo=huggingface" /> </a> <a href="https://ssrn.com/abstract=5784922"> <img src="https://img.shields.io/badge/SSRN-Preprint-red" /> </a> <img src="https://img.shields.io/badge/License-MIT-green" /> </a> </p>

πŸ“° NLP Stock Sentiment Analysis β€” Embedding-Based Models for Market Signals

Model3_Thumbnail

This model card documents the resources and workflow described in the paper:

β€œNLP Stock Sentiment Analysis: A Comparative Embedding-Based Model Report” Joyjit Roy SSRN, August 2024 Available at: https://ssrn.com/abstract=5784922 DOI: http://dx.doi.org/10.2139/ssrn.5784922

πŸ‘₯ Authors

NameEmailGitHubORCIDGoogle ScholarResearchGate
[Joyjit Roy](https://www.linkedin.com/in/royjoyjit/)joyjit.roy.tech@gmail.comGitHubORCIDGoogle ScholarResearchGate
[Samaresh Kumar Singh](https://www.linkedin.com/in/samaresh-singh-9772ba23/)ssam3003@gmail.comGitHubORCIDGoogle Scholarβ€”

Zenodo DOI: https://doi.org/10.5281/zenodo.17510735 GitHub: https://github.com/joyjitroy/MachineLearning/tree/main/NLPStockSentimentAnalysis

This project provides a complete NLP workflow for classifying the sentiment of headline-level financial news and aggregating weekly sentiment indicators. It serves as a reproducible reference for embedding-based sentiment analysis using classical machine learning models.


πŸ” Project Overview

The goal is to transform unstructured financial news into structured sentiment scores that can support market commentary and trend evaluation. Three embedding-based approaches were explored:

1. Word2Vec (300D)

  • β€”Trained locally on the news corpus
  • β€”Mean pooled per headline

2. GloVe (100D)

  • β€”Pretrained vectors
  • β€”Mean pooled per headline

3. SentenceTransformer Embeddings (384D)

  • β€”Model: all-MiniLM-L6-v2
  • β€”Direct sentence embeddings without fine-tuning

For each embedding approach, a Gradient Boosting classifier is trained and evaluated on the same dataset. Weekly sentiment summaries are generated to demonstrate applied use cases for financial analysis.

Note: These models are scikit learn models and are not directly deployed as Hugging Face inference endpoints.

πŸ’½ Dataset Summary

The dataset contains 349 financial news headlines, each paired with OHLCV market indicators and a sentiment label: 1 = positive, 0 = neutral, -1 = negative.

The dataset is available on Hugging Face and also archived on Zenodo for citation and long-term access: πŸ‘‰ https://doi.org/10.5281/zenodo.17510735

πŸ“Š Data Dictionary

ColumnDescription
DateDate the news item was released
NewsHeadline or snippet text
OpenOpening price (USD)
HighHighest price (USD) of the day
LowLowest price (USD) of the day
CloseAdjusted closing price (USD)
VolumeTotal shares traded
LabelSentiment (1=positive, 0=neutral, -1=negative)

πŸ“Š Model Performance (Validation)

Across all embedding variants, the tuned GloVe + Gradient Boosting model achieved the strongest validation results:

  • β€”Accuracy: 0.714
  • β€”Precision: 0.758
  • β€”Recall: 0.714
  • β€”F1 Score: 0.694
  • β€”Error Rate: 0.286

Training accuracy is perfect for all models due to dataset size; validation metrics are therefore used for fair comparison. Full results appear in the associated paper (Table 3).


🧠 Weekly Sentiment Summaries

To show how sentiment predictions can support market interpretation:

  1. 1.Daily predictions are aggregated by week
  2. 2.Sentiment ratios (positive / neutral / negative) are computed
  3. 3.Weekly summaries are generated using Mistral-7B-Instruct
  4. 4.These summaries provide narrative insight into market mood

This illustrates a practical workflow where classical NLP models feed into downstream financial analysis.


🌟 Intended Use

This repository is intended for:

  • β€”Research on embedding-based sentiment classification
  • β€”Educational exploration of Word2Vec, GloVe, and Sentence Transformer embeddings
  • β€”Demonstrating weekly sentiment aggregation
  • β€”Benchmarking classical ML approaches for small financial text datasets

⚠️ Limitations

  • β€”Small dataset (349 samples)
  • β€”Potential overfitting of classical models
  • β€”Not designed for automated trading or real-time systems
  • β€”Weekly summaries rely on LLM outputs and may include stylistic bias
  • β€”No direct price prediction or financial forecasting

This model is best used for experimentation and learning. ---

πŸ“„ Related Publication

The full experimental design, results, and limitations are documented in the following model report:

Roy, Joyjit. NLP Stock Sentiment Analysis: A Comparative Embedding-Based Model Report. SSRN, 2024. https://ssrn.com/abstract=5784922 DOI: http://dx.doi.org/10.2139/ssrn.5784922

πŸ“˜ Citation

If you use this model, dataset, or workflow, please cite:

Model Report

Roy, Joyjit. NLP Stock Sentiment Analysis: A Comparative Embedding-Based Model Report. SSRN, August 2024. https://ssrn.com/abstract=5784922 DOI: http://dx.doi.org/10.2139/ssrn.5784922

Dataset

Roy, Joyjit. Stock Market News Sentiment Analysis – Supplementary Materials. Zenodo, 2025. https://doi.org/10.5281/zenodo.17510735