| | --- |
| | 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 |
| | ``` |