harshprasad03 commited on
Commit
dc12df6
·
verified ·
1 Parent(s): 5f746c0

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +144 -3
README.md CHANGED
@@ -1,3 +1,144 @@
1
- ---
2
- license: mit
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ## FinBERT–AdaptiveFedAvg: Adaptive Federated Aggregation for Financial Sentiment Analysis
2
+
3
+ ---
4
+
5
+ ### 📌 Model Summary
6
+
7
+ This model is a **federated version of FinBERT** fine-tuned for
8
+ **financial sentiment classification (Positive / Negative / Neutral)**.
9
+
10
+ Training is performed across **three clients**:
11
+
12
+ * Financial Twitter posts
13
+ * Financial news headlines
14
+ * Financial reports & statements
15
+
16
+ Unlike standard FedAvg, this model uses an **Adaptive Aggregation strategy**,
17
+ where client contributions are **weighted dynamically based on validation performance**,
18
+ allowing stronger clients to influence the global model more.
19
+
20
+ This model is part of a research project comparing:
21
+
22
+ * FedAvg
23
+ * FedProx
24
+ * Adaptive Aggregation
25
+
26
+ for federated financial NLP.
27
+
28
+ ---
29
+
30
+ ### 🧠 Intended Use
31
+
32
+ Designed for:
33
+
34
+ * Financial sentiment research
35
+ * Risk & market analytics
36
+ * Academic exploration of federated learning
37
+
38
+ Not intended for automated trading without expert oversight.
39
+
40
+ ---
41
+
42
+ ### 🏗 Model Architecture
43
+
44
+ Base Model:
45
+
46
+ ```
47
+ ProsusAI/finbert
48
+ ```
49
+
50
+ Task:
51
+
52
+ ```
53
+ Sequence classification — 3 classes
54
+ ```
55
+
56
+ Training Setup:
57
+
58
+ ```
59
+ 3 federation clients
60
+ 10 global rounds
61
+ 3 local epochs
62
+ Adaptive weighted aggregation
63
+ ```
64
+
65
+ ---
66
+
67
+ ### 📊 Client Data Sources
68
+
69
+ | Client | Data Type |
70
+ | -------- | ----------------- |
71
+ | Client-1 | Financial Twitter |
72
+ | Client-2 | Financial News |
73
+ | Client-3 | Financial Reports |
74
+
75
+ No raw data is shared between clients.
76
+
77
+ ---
78
+
79
+ ### 🔐 Privacy Advantage
80
+
81
+ Only model updates are exchanged — not text data.
82
+ This supports data governance and privacy-aware ML.
83
+
84
+ ---
85
+
86
+ ### 📈 Performance (Validation)
87
+
88
+ | Method | Final Avg F1-Score |
89
+ | --------------- | ------------------ |
90
+ | Adaptive FedAvg | **0.823** |
91
+
92
+ Adaptive aggregation showed **smooth convergence and stable performance**
93
+ while preserving privacy.
94
+
95
+ ---
96
+
97
+ ### 🚀 Example Usage
98
+
99
+ ```python
100
+ from transformers import AutoTokenizer, AutoModelForSequenceClassification
101
+ import torch
102
+
103
+ model = AutoModelForSequenceClassification.from_pretrained(
104
+ "harshprasad03/FinBERT-Adaptive"
105
+ )
106
+ tokenizer = AutoTokenizer.from_pretrained(
107
+ "harshprasad03/FinBERT-Adaptive"
108
+ )
109
+
110
+ text = "Global markets improved after positive earnings reports."
111
+
112
+ inputs = tokenizer(text, return_tensors="pt")
113
+ outputs = model(**inputs)
114
+
115
+ prob = torch.softmax(outputs.logits, dim=1)
116
+ print(prob)
117
+ ```
118
+
119
+ ---
120
+
121
+ ### ⚠️ Limitations
122
+
123
+ * Trained only on finance-domain text
124
+ * Sentiment ≠ market prediction
125
+ * Model may inherit dataset biases
126
+ * Designed for research use
127
+
128
+ ---
129
+
130
+ ### 📚 Citation
131
+
132
+ ```
133
+ Harsh Prasad (2025).
134
+ Adaptive Federated FinBERT for Financial Sentiment Analysis.
135
+ ```
136
+
137
+ ---
138
+
139
+ ### 👨‍💻 Author
140
+
141
+ **Harsh Prasad**
142
+ Federated Learning & NLP Research
143
+
144
+ ---