Financial Market Sentiment Classification
A deep-learning NLP system that classifies the dominant sentiment of financial news. Custom embedding implementation with NumPy and neural-network training using PyTorch/CUDA, with MLP and self-attention components.
- Context
- Personal project
- Role
- Design & implementation
- Timeline
- 2026/05/01
- Stack
- Python · NumPy · PyTorch · CUDA
01 — Overview
Overview
A neural NLP classifier that reads financial news and predicts its dominant sentiment. The embedding layer is a custom implementation written with NumPy; the neural network is trained with PyTorch on GPU through CUDA.
02 — Problem
Problem
Financial news is a high-volume input for market analysis. Classifying its dominant sentiment is a first step towards using text as a structured signal.
the Sentiments classes are Positive , negative , neutral . I choosed to implement some tools from scratch to understand deeply the underlying mechanisms
03 — Architecture
Architecture
- Financial news text
- Tokenization
- EmbeddingsCustom implementation · NumPy
- Self-attention
- MLP · hidden layers
- Softmax classification
- Dominant sentiment
Conceptual pipeline .
04 — Data / Inputs
Data / Inputs
Dataset source was Bloomberg news articles from hugging-face , size : 144000 articles , classes in the training corpus was clearly balanced 37% positive , 40% negative , 23% neutral
05 — Methodology
Methodology
- 01TokenizationRaw news text is split into tokens and mapped to vocabulary indices.
- 02EmbeddingsCustom embedding implementation with NumPy.
- 03Self-attentionLets each token representation weigh the rest of the sequence.
- 04MLPHidden layers transform the attended representation.
- 05SoftmaxProduces a probability distribution over sentiment classes.
Training uses backpropagation with the Adam optimizer and mini-batch updates, accelerated on GPU with PyTorch and CUDA.
- Backpropagation
- Adam optimizer
- Mini-batch training
- Softmax
- Self-attention
- MLP
06 — Engineering Implementation
Engineering Implementation
- NumPy for the custom embedding implementation.
- PyTorch for the neural network and training loop.
- CUDA for GPU-accelerated training.
07 — Evaluation / Results
Evaluation / Results
08 — Challenges & Trade-offs
Challenges & Trade-offs
Challenges faced are transformation of all articles into numerical representations and handling class imbalance.
09 — Resources
Resources
https://github.com/charfx/NLP_financial_sentiment

