đ DeBERTa-v3-small-ft-news-sentiment-analisys
This model is a fine - tuned version of microsoft/deberta-v3-small. It is designed for financial news sentiment analysis, offering high - precision results in sentiment classification.
đ Quick Start
Installation
If you haven't installed the necessary libraries, use the following command:
pip install transformers sentencepiece
Usage Example
from transformers import pipeline
task = "text-classification"
model_id = "mrm8488/deberta-v3-ft-financial-news-sentiment-analysis"
classifier = pipeline(task, model_id)
text = "Tesla cars are not as good as expected"
result = classifier(text)
print(result)
⨠Features
- High Performance: Achieves excellent results on evaluation metrics such as F1, accuracy, precision, and recall.
- Fine - Tuned Model: Based on the DeBERTa - v3 - small architecture, fine - tuned for financial news sentiment analysis.
đĻ Installation
pip install transformers sentencepiece
đģ Usage Examples
Basic Usage
from transformers import pipeline
task = "text-classification"
model_id = "mrm8488/deberta-v3-ft-financial-news-sentiment-analysis"
classifier = pipeline(task, model_id)
text = "Tesla cars are not as good as expected"
result = classifier(text)
print(result)
đ Documentation
Model description
DeBERTa improves the BERT and RoBERTa models using disentangled attention and enhanced mask decoder. With those two improvements, DeBERTa performs better than RoBERTa on a majority of NLU tasks with 80GB of training data.
In DeBERTa V3, we further improved the efficiency of DeBERTa using ELECTRA - Style pre - training with Gradient Disentangled Embedding Sharing. Compared to DeBERTa, our V3 version significantly improves the model performance on downstream tasks. You can find more technique details about the new model from our paper.
Please check the official repository for more implementation details and updates.
The DeBERTa V3 small model comes with six layers and a hidden size of 768. It has 44M backbone parameters with a vocabulary containing 128K tokens which introduces 98M parameters in the Embedding layer. This model was trained using the 160GB data as DeBERTa V2.
Training and evaluation data
The model is trained on a polar sentiment dataset of sentences from financial news. The dataset consists of 4840 sentences from English - language financial news categorized by sentiment. The dataset is divided by an agreement rate of 5 - 8 annotators.
Training procedure
Training hyperparameters
The following hyperparameters were used during training:
- learning_rate: 2e - 05
- train_batch_size: 64
- eval_batch_size: 64
- seed: 42
- optimizer: Adam with betas=(0.9,0.999) and epsilon = 1e - 08
- lr_scheduler_type: linear
- num_epochs: 5
Training results
Training Loss |
Epoch |
Step |
Validation Loss |
Precision |
Recall |
Accuracy |
F1 |
No log |
1.0 |
214 |
0.1865 |
0.9323 |
0.9323 |
0.9323 |
0.9323 |
No log |
2.0 |
428 |
0.0742 |
0.9771 |
0.9771 |
0.9771 |
0.9771 |
0.2737 |
3.0 |
642 |
0.0479 |
0.9855 |
0.9855 |
0.9855 |
0.9855 |
0.2737 |
4.0 |
856 |
0.0284 |
0.9923 |
0.9923 |
0.9923 |
0.9923 |
0.0586 |
5.0 |
1070 |
0.0233 |
0.9940 |
0.9940 |
0.9940 |
0.9940 |
Framework versions
- Transformers 4.35.2
- Pytorch 2.1.0+cu121
- Datasets 2.16.1
- Tokenizers 0.15.0
đ§ Technical Details
The model is based on the DeBERTa - v3 - small architecture. DeBERTa improves upon BERT and RoBERTa with disentangled attention and an enhanced mask decoder. DeBERTa V3 further enhances efficiency through ELECTRA - Style pre - training with Gradient Disentangled Embedding Sharing.
đ License
This project is licensed under the MIT license.
đ Citation
@misc {manuel_romero_2024,
author = { {Manuel Romero} },
title = { deberta-v3-ft-financial-news-sentiment-analysis (Revision 7430ace) },
year = 2024,
url = { https://huggingface.co/mrm8488/deberta-v3-ft-financial-news-sentiment-analysis },
doi = { 10.57967/hf/1666 },
publisher = { Hugging Face }
}
Model Evaluation Results
Metric |
Value |
F1 |
0.9940 |
Accuracy |
0.9940 |
Precision |
0.9940 |
Recall |
0.9940 |
Loss |
0.0233 |