Text Classification
Transformers
Safetensors
English
distilbert
financial-sentiment
text-embeddings-inference
Instructions to use vivekkopthsd/financial-sentiment-distilbert with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use vivekkopthsd/financial-sentiment-distilbert with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="vivekkopthsd/financial-sentiment-distilbert")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("vivekkopthsd/financial-sentiment-distilbert") model = AutoModelForSequenceClassification.from_pretrained("vivekkopthsd/financial-sentiment-distilbert", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Financial Sentiment Classification โ DistilBERT Fine-Tune
Fine-tuned distilbert-base-uncased for 3-class financial news sentiment
(positive / neutral / negative).
Model Details
| Base model | distilbert-base-uncased |
| Task | Financial sentiment classification (3 classes) |
| Language | English |
| Training data | FinancialPhraseBank (Sentences_50Agree.txt, ~4,840 sentences; Malo et al., 2014) |
| Hardware | NVIDIA Tesla T4 |
| Fine-tuning | 3 epochs, lr 2e-05, batch 32, max length 128, seed 42 |
Usage
from transformers import pipeline
clf = pipeline("text-classification", model="vivekkopthsd/financial-sentiment-distilbert")
clf("The company reported a significant increase in quarterly revenue.")
Evaluation (held-out test split)
Stratified 80/10/10 split (seed 42): train 3876 / validation 485 / test 485.
Test accuracy: 0.8144 ยท Weighted F1: 0.8153
| Class | Precision | Recall | F1 | Support |
|---|---|---|---|---|
| negative | 0.7391 | 0.8361 | 0.7846 | 61 |
| neutral | 0.8700 | 0.8368 | 0.8531 | 288 |
| positive | 0.7410 | 0.7574 | 0.7491 | 136 |
Limitations
- Trained on a small (~4,840 sentence) domain corpus; performance on out-of-domain financial text may degrade.
- English-only; sentiment of non-English financial news is out of scope.
- Fine-tuned from a pretrained checkpoint โ not a from-scratch model.
Data Attribution
FinancialPhraseBank: Malo, P., Sinha, A., Korhonen, P., Wallenius, J., & Takala, P. (2014). Good debt or bad debt: Detecting semantic orientations in economic texts. Journal of the Association for Information Science and Technology. Kaggle mirror: ankurzing/sentiment-analysis-for-financial-news.
- Downloads last month
- -