File size: 1,932 Bytes
9e936cb
 
 
 
 
 
 
 
 
dbfb759
 
9e936cb
 
 
 
 
 
 
 
 
 
 
 
 
 
f3630e1
9e936cb
 
 
 
 
 
 
 
f3630e1
 
 
 
 
 
 
 
 
9e936cb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
license: apache-2.0
datasets:
- harixn/indian_news_sentiment
language:
- en
base_model:
- google-bert/bert-base-uncased
pipeline_tag: text-classification
tags:
- finance
---
# FinBERT Model Card

## Model Details

* **Model Name:** FinBERT
* **Model Type:** BERT (bert-base-uncased)
* **Task:** Sentiment Analysis (Stock Market)
* **Number of Labels:** 3 (positive, negative, neutral)
* **Intended Use:** Predict sentiment of financial news and social media posts related to the Indian stock market.

## How to Use

```python
import torch
from transformers import AutoTokenizer, AutoModelForSequenceClassification

tokenizer = AutoTokenizer.from_pretrained("harixn/IN-finbert")
model = AutoModelForSequenceClassification.from_pretrained("harixn/IN-finbert")

text = "The stock price of XYZ surged today."
inputs = tokenizer(text, return_tensors="pt")
outputs = model(**inputs)

# Get probabilities
probs = torch.softmax(outputs.logits, dim=1)
print("Probabilities:", probs)

# Get predicted class
pred_class = torch.argmax(probs, dim=1).item()
classes = ["negative", "neutral", "positive"]
print("Predicted class:", classes[pred_class])
```

## Training Data

* Fine-tuned on labeled Indian stock market news and social media datasets.
* Labels: positive, negative, neutral.

## Limitations and Risks

* Trained specifically for Indian stock market context.
* May not generalize well to other financial markets.
* Predictions should not be used as financial advice.

## Evaluation

* Evaluated on held-out validation set of Indian stock market texts.
* Metrics: Accuracy, F1-score per class.

## Model Files

* `pytorch_model.bin`: Trained model weights
* `config.json`: Model configuration
* `vocab.txt`, `tokenizer_config.json`, `special_tokens_map.json`, `tokenizer.json`: Tokenizer files

## Citation

If you use this model, please cite it as:

```
FinBERT: Sentiment Analysis Model for Indian Stock Market, harixn, 2025
```