Instructions to use sbasu2512/financial_sentiment_model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use sbasu2512/financial_sentiment_model with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="sbasu2512/financial_sentiment_model")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("sbasu2512/financial_sentiment_model") model = AutoModelForSequenceClassification.from_pretrained("sbasu2512/financial_sentiment_model") - Notebooks
- Google Colab
- Kaggle
π§Ύ Model Card β financial_sentiment_model
π§ Model Overview
financial_sentiment_model is a highly optimized financial sentiment analysis model fine-tuned for financial news, market headlines, and economic reports.
Built on top of the robust ProsusAI/finbert architecture, this model classifies text into three distinct sentiment categories with high precision:
- π’ Positive β Market gains, optimism, positive growth indicators
- βͺ Neutral β Factual reports, regulatory updates, mixed signals
- π΄ Negative β Market declines, losses, macroeconomic risks
It is tailored to assist quantitative trading pipelines, risk management engines, and financial analysts in extracting crisp sentiment signals from volatile financial text.
ποΈ Training Details
- Base Model: ProsusAI/finbert
- Framework: Hugging Face Transformers & PyTorch
- Training Depth: 3 full epochs with validation checkpoints
- Total Evaluation Samples: 156 samples
π Evaluation Metrics
The following performance metrics were captured during the final validation run (as recorded in Accuracy_after_last.png):
Global Performance
- Overall Accuracy: 89.74% (0.8974358974358975)
- Macro Average F1-Score: 89.00%
- Weighted Average F1-Score: 90.00%
Class-by-Class Breakdown
| Class | Precision | Recall | F1-Score | Support |
|---|---|---|---|---|
| π΄ Negative | 0.86 | 0.86 | 0.86 | 44 |
| βͺ Neutral | 0.91 | 0.86 | 0.88 | 56 |
| π’ Positive | 0.92 | 0.96 | 0.94 | 56 |
Confusion Matrix
Actual \ Predicted Negative Neutral Positive
Negative [44] 38 5 1
Neutral [56] 4 48 4
Positive [56] 2 0 54
The model shows exceptional robustness in identifying Positive sentiments, capturing a 96% Recall rate (54 out of 56 true positives).
π¬ Example Usage
Using Hugging Face Pipeline (High-Level)
from transformers import pipeline
pipe = pipeline("text-classification", model="sbasu2512/financial_sentiment_model")
texts = [
"Sensex surges 500 points as IT and banking stocks rally.",
"Rupee falls sharply against the dollar amid global uncertainty.",
"TCS announces leadership reshuffle; markets await further clarity.",
]
for t in texts:
print(pipe(t))
Loading the Model Directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained(
"sbasu2512/financial_sentiment_model"
)
model = AutoModelForSequenceClassification.from_pretrained(
"sbasu2512/financial_sentiment_model"
)
π§© Intended Use
- Real-time sentiment analysis for Indian and global stock market news.
- Generation of features and sentiment signals for algorithmic trading models.
- Parsing and tone classification of corporate earnings reports or press releases.
π Licensing & Commercial Use
This model is published under the Creative Commons Attribution-NonCommercial 4.0 International (CC BY-NC 4.0) license.
- Personal, Academic, and Research Use: Completely free.
- Commercial Use: If you wish to use this model, its weights, or derivatives for commercial purposes, enterprise applications, or monetary gain, you must obtain a commercial license.
π§ Contact for Commercial Licensing
π§βπ» Developer Info
- Author: Sayantan Basu
- Website: sayantan-basu.vercel.app
- Downloads last month
- 251