CoolFace
Modelpublic

mrm8488/deberta-v3-ft-financial-news-sentiment-analysis

sourceHugging Facemitupdated 3y agoView on Hugging Face
32likes12kdownloads
Model Card

<!-- This model card has been generated automatically according to the information the Trainer had access to. You should probably proofread and complete it, then remove this comment. -->

<div style="text-align:center;width:250px;height:250px;"> <img src="https://huggingface.co/mrm8488/deberta-v3-ft-financial-news-sentiment-analysis/resolve/main/logoft2.png" alt="logo"> </div>

DeBERTa-v3-small-ft-news-sentiment-analisys

This model is a fine-tuned version of microsoft/deberta-v3-small on the None dataset. It achieves the following results on the evaluation set:

MetricValue
F10.9940
Accuracy0.9940
Precision0.9940
Recall0.9940
Loss0.0233

Model description

DeBERTa improves the BERT and RoBERTa models using disentangled attention and enhanced mask decoder. With those two improvements, DeBERTa performs 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

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
  • trainbatchsize: 64
  • evalbatchsize: 64
  • seed: 42
  • optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
  • lrschedulertype: linear
  • num_epochs: 5

Training results

Training LossEpochStepValidation LossPrecisionRecallAccuracyF1
No log1.02140.18650.93230.93230.93230.9323
No log2.04280.07420.97710.97710.97710.9771
0.27373.06420.04790.98550.98550.98550.9855
0.27374.08560.02840.99230.99230.99230.9923
0.05865.010700.02330.99400.99400.99400.9940

Example of usage

In case you did not installed it:

sh
pip install transformers sentencepiece
py
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)

Framework versions

  • Transformers 4.35.2
  • Pytorch 2.1.0+cu121
  • Datasets 2.16.1
  • Tokenizers 0.15.0

Citation

BibText
@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 }
}