Downloads · 30 days
17
32% of all-time downloads
harshprasad03/FinBERT-FedAvg
FinBERT-FedAvg is a text classification model from harshprasad03. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as mit.
Downloads · 30 days
17
32% of all-time downloads
All-time downloads
53
Public
Parameters
109M
438 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors438 MB · 100%
From the Hugging Face model README
This model is a federated version of FinBERT fine-tuned for financial sentiment classification (Positive / Negative / Neutral).
Training is performed across three clients:
This model is trained using the Federated Averaging (FedAvg) algorithm, where each client trains locally on its own data and only model weights are shared. No raw data is exchanged, supporting privacy-preserving learning.
This model is part of a research project comparing:
for federated financial NLP.
Designed for:
Not intended for automated trading without expert oversight.
Base Model:
ProsusAI/finbert
Task:
Sequence classification — 3 classes
Training Setup:
3 federation clients
10 global rounds
3 local epochs
FedAvg aggregation
| Client | Data Type |
|---|---|
| Client-1 | Financial Twitter |
| Client-2 | Financial News |
| Client-3 | Financial Reports |
No raw data is shared between clients.
Only model updates are exchanged — not text data.
This supports data governance and privacy-aware ML.
| Method | Final Avg F1-Score |
|---|---|
| FedAvg | 0.846 |
FedAvg provided strong and stable global performance across heterogeneous financial text sources.
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
model = AutoModelForSequenceClassification.from_pretrained(
"harshprasad03/FinBERT-FedAvg"
)
tokenizer = AutoTokenizer.from_pretrained(
"harshprasad03/FinBERT-FedAvg"
)
text = "Tech stocks fell after negative earnings guidance."
inputs = tokenizer(text, return_tensors="pt")
outputs = model(**inputs)
prob = torch.softmax(outputs.logits, dim=1)
print(prob)
Harsh Prasad, Sai Dhole (2025).
FedAvg-based Federated FinBERT for Financial Sentiment Analysis.
Harsh Prasad AI and ML Research
Sai Dhole AI and ML Research