File size: 2,598 Bytes
25cec9d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
---

language: en
license: apache-2.0
tags:
- financial-sentiment
- sentiment-analysis
- finance
- nlp
- transformers
datasets:
- zeroshot/twitter-financial-news-sentiment
metrics:
- accuracy
- f1
model-index:
- name: financial-sentiment-bert-large
  results:
  - task:
      type: text-classification
      name: Financial Sentiment Analysis
    dataset:
      name: Twitter Financial News Sentiment
      type: zeroshot/twitter-financial-news-sentiment
    metrics:
    - type: accuracy
      value: 0.843
      name: Accuracy
---


# financial-sentiment-bert-large

## Model Description

BERT-Large financial sentiment analysis model with high accuracy

This model is fine-tuned from `bert-large-uncased` for financial sentiment analysis, capable of classifying financial text into three categories:
- **Bearish** (0): Negative financial sentiment
- **Neutral** (1): Neutral financial sentiment  
- **Bullish** (2): Positive financial sentiment

## Model Performance

- **Accuracy**: 0.843
- **Dataset**: Twitter Financial News Sentiment
- **Base Model**: bert-large-uncased

## Usage

```python

from transformers import AutoTokenizer, AutoModelForSequenceClassification

import torch



# Load model and tokenizer

tokenizer = AutoTokenizer.from_pretrained("codealchemist01/financial-sentiment-bert-large")

model = AutoModelForSequenceClassification.from_pretrained("codealchemist01/financial-sentiment-bert-large")



# Example usage

text = "Apple stock is showing strong growth potential"

inputs = tokenizer(text, return_tensors="pt", truncation=True, padding=True)



with torch.no_grad():

    outputs = model(**inputs)

    predictions = torch.nn.functional.softmax(outputs.logits, dim=-1)

    predicted_class = torch.argmax(predictions, dim=-1).item()



# Labels: 0=Bearish, 1=Neutral, 2=Bullish

labels = ["Bearish", "Neutral", "Bullish"]

print(f"Prediction: {labels[predicted_class]}")

```

## Training Details

- **Training Dataset**: Twitter Financial News Sentiment
- **Training Framework**: Transformers
- **Optimization**: AdamW
- **Hardware**: RTX GPU

## Limitations

This model is specifically trained for financial sentiment analysis and may not perform well on general sentiment analysis tasks.

## Citation

If you use this model, please cite:

```bibtex

@misc{financial-sentiment-large,

  author = {CodeAlchemist01},

  title = {financial-sentiment-bert-large},

  year = {2024},

  publisher = {Hugging Face},

  url = {https://huggingface.co/codealchemist01/financial-sentiment-bert-large}

}

```