Upload FinBERT-Pro
Browse files- README.md +65 -0
- config.json +40 -0
- model.safetensors +3 -0
- tokenizer.json +0 -0
- tokenizer_config.json +14 -0
README.md
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
+
license: apache-2.0
|
| 5 |
+
library_name: transformers
|
| 6 |
+
tags:
|
| 7 |
+
- text-classification
|
| 8 |
+
- bert
|
| 9 |
+
- finbert
|
| 10 |
+
- finance
|
| 11 |
+
- sentiment
|
| 12 |
+
- sentiment-analysis
|
| 13 |
+
- financial-sentiment
|
| 14 |
+
datasets:
|
| 15 |
+
- FinanceInc/auditor_sentiment
|
| 16 |
+
- nickmuchi/financial-classification
|
| 17 |
+
- warwickai/financial_phrasebank_mirror
|
| 18 |
+
pipeline_tag: text-classification
|
| 19 |
+
---
|
| 20 |
+
|
| 21 |
+
# 🎯 FinBERT-Pro
|
| 22 |
+
|
| 23 |
+
An improved financial sentiment model built on [ProsusAI/finbert](https://huggingface.co/ProsusAI/finbert). Fine-tuned on 3 expert-annotated financial datasets for more robust sentiment classification.
|
| 24 |
+
|
| 25 |
+
The model provides softmax outputs for three sentiment classes: **Positive**, **Negative**, **Neutral**.
|
| 26 |
+
|
| 27 |
+
## 🚀 Usage
|
| 28 |
+
|
| 29 |
+
```python
|
| 30 |
+
from transformers import pipeline
|
| 31 |
+
|
| 32 |
+
classifier = pipeline("text-classification", model="ENTUM-AI/FinBERT-Pro")
|
| 33 |
+
|
| 34 |
+
classifier("Stock price soars on record-breaking earnings report")
|
| 35 |
+
# [{'label': 'Positive', 'score': 0.99}]
|
| 36 |
+
|
| 37 |
+
classifier("Company announces quarterly earnings results")
|
| 38 |
+
# [{'label': 'Neutral', 'score': 0.98}]
|
| 39 |
+
|
| 40 |
+
classifier("Revenue decline signals weakening market position")
|
| 41 |
+
# [{'label': 'Negative', 'score': 0.98}]
|
| 42 |
+
```
|
| 43 |
+
|
| 44 |
+
## 📊 Training Data
|
| 45 |
+
|
| 46 |
+
Fine-tuned on 3 expert-annotated public datasets:
|
| 47 |
+
|
| 48 |
+
| Dataset | Samples |
|
| 49 |
+
|---------|---------|
|
| 50 |
+
| [FinanceInc/auditor_sentiment](https://huggingface.co/datasets/FinanceInc/auditor_sentiment) | ~4.8K |
|
| 51 |
+
| [nickmuchi/financial-classification](https://huggingface.co/datasets/nickmuchi/financial-classification) | ~5K |
|
| 52 |
+
| [warwickai/financial_phrasebank_mirror](https://huggingface.co/datasets/warwickai/financial_phrasebank_mirror) | ~4.8K |
|
| 53 |
+
|
| 54 |
+
Unlike the original FinBERT (trained on a single dataset), FinBERT-Pro combines multiple expert-annotated sources for better generalization across different financial text styles.
|
| 55 |
+
|
| 56 |
+
## 🔍 What's Different from FinBERT?
|
| 57 |
+
|
| 58 |
+
- **Multiple data sources** — trained on 3 expert-annotated datasets instead of 1
|
| 59 |
+
- **Class-weighted training** — handles imbalanced label distributions
|
| 60 |
+
- **Better generalization** — diverse training data improves robustness on unseen financial texts
|
| 61 |
+
|
| 62 |
+
## ⚠️ Limitations
|
| 63 |
+
|
| 64 |
+
- English only
|
| 65 |
+
- Designed for short financial texts (headlines, news, reports)
|
config.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_cross_attention": false,
|
| 3 |
+
"architectures": [
|
| 4 |
+
"BertForSequenceClassification"
|
| 5 |
+
],
|
| 6 |
+
"attention_probs_dropout_prob": 0.1,
|
| 7 |
+
"bos_token_id": null,
|
| 8 |
+
"classifier_dropout": null,
|
| 9 |
+
"dtype": "float32",
|
| 10 |
+
"eos_token_id": null,
|
| 11 |
+
"gradient_checkpointing": false,
|
| 12 |
+
"hidden_act": "gelu",
|
| 13 |
+
"hidden_dropout_prob": 0.1,
|
| 14 |
+
"hidden_size": 768,
|
| 15 |
+
"id2label": {
|
| 16 |
+
"0": "Negative",
|
| 17 |
+
"1": "Neutral",
|
| 18 |
+
"2": "Positive"
|
| 19 |
+
},
|
| 20 |
+
"initializer_range": 0.02,
|
| 21 |
+
"intermediate_size": 3072,
|
| 22 |
+
"is_decoder": false,
|
| 23 |
+
"label2id": {
|
| 24 |
+
"Negative": 0,
|
| 25 |
+
"Neutral": 1,
|
| 26 |
+
"Positive": 2
|
| 27 |
+
},
|
| 28 |
+
"layer_norm_eps": 1e-12,
|
| 29 |
+
"max_position_embeddings": 512,
|
| 30 |
+
"model_type": "bert",
|
| 31 |
+
"num_attention_heads": 12,
|
| 32 |
+
"num_hidden_layers": 12,
|
| 33 |
+
"pad_token_id": 0,
|
| 34 |
+
"position_embedding_type": "absolute",
|
| 35 |
+
"tie_word_embeddings": true,
|
| 36 |
+
"transformers_version": "5.1.0",
|
| 37 |
+
"type_vocab_size": 2,
|
| 38 |
+
"use_cache": false,
|
| 39 |
+
"vocab_size": 30522
|
| 40 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:eb7830bd4035c8bb5c7b4aed55b9bf3cf290cb21adcd3c34feab7f269d0c9618
|
| 3 |
+
size 437961700
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"backend": "tokenizers",
|
| 3 |
+
"cls_token": "[CLS]",
|
| 4 |
+
"do_lower_case": true,
|
| 5 |
+
"is_local": false,
|
| 6 |
+
"mask_token": "[MASK]",
|
| 7 |
+
"model_max_length": 512,
|
| 8 |
+
"pad_token": "[PAD]",
|
| 9 |
+
"sep_token": "[SEP]",
|
| 10 |
+
"strip_accents": null,
|
| 11 |
+
"tokenize_chinese_chars": true,
|
| 12 |
+
"tokenizer_class": "BertTokenizer",
|
| 13 |
+
"unk_token": "[UNK]"
|
| 14 |
+
}
|