NeoSapian commited on
Commit
c2a57fe
·
verified ·
1 Parent(s): c379be3

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +117 -264
README.md CHANGED
@@ -1,281 +1,134 @@
 
1
  ---
2
  license: other
3
- base_model: Qwen/Qwen3.5-0.8B-Base
4
- tags: [finance, classification, calibrated-probabilities, system-one, typed-decisions]
 
 
 
 
5
  ---
6
- # jev-fin-0.8b: a Jev-style typed decision model for finance
7
 
8
- > Trained partly on FOMC data (CC BY-NC 4.0): **non-commercial use only**.
 
 
 
 
 
 
 
 
 
 
9
 
10
- Full fine-tune of `Qwen/Qwen3.5-0.8B-Base`. It does **not generate text**: given a *state* (text or JSON) and typed questions
11
- (`choice`, `score`, `noul`), a single forward pass reads next-token logits over option letters only, giving a
12
- probability distribution per question. Probabilities are temperature-calibrated on a held-out split.
13
 
14
- Trained on: FinGPT headline yes/no, FinGPT sentiment (FPB/FiQA/tweets/news), Twitter financial news sentiment + topic,
15
- FOMC hawkish/dovish, extra tweet/text sentiment sets (if they passed the label audit), and *synthetic* portfolio questions whose labels come from exact formulas (concentration, drift, risk bucket, HHI).
 
 
 
 
 
 
 
 
16
 
17
  ## Use
 
18
  ```python
19
- from huggingface_hub import hf_hub_download; import importlib.util, sys
20
- p = hf_hub_download("siyah1/jev-fin-0.8b", "jev_common.py"); s = importlib.util.spec_from_file_location("jev_common", p)
21
- m = importlib.util.module_from_spec(s); sys.modules["jev_common"] = m; s.loader.exec_module(m)
22
- clf = m.JevClassifier("siyah1/jev-fin-0.8b")
23
- print(clf.decide("Company X cuts full-year guidance and CFO resigns.", {
24
- "bearish": {"type": "noul", "instructions": "Is this news negative for the stock?"},
25
- "topic": {"type": "choice", "instructions": "Which topic?", "criteria": {"earnings": "results/guidance", "personnel": "executive changes", "m&a": "deals"}},
26
- "severity": {"type": "score", "instructions": "How negative is this?", "levels": ["mild", "moderate", "severe"]}}))
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
  ```
28
 
29
  ## Limits (read this)
30
- * It classifies **text/state**; it does **not predict returns**. Headline labels say what a headline *talks about*, not what the price will do.
 
 
31
  * Portfolio questions are learned from synthetic, rule-labelled data; check arithmetic-heavy answers with real code.
32
  * Calibration is measured in-distribution; expect worse calibration on questions unlike the training tasks.
33
  * Not financial advice.
34
 
35
  ## Held-out test metrics
36
- ```json
37
- [
38
- {
39
- "slice":"ALL",
40
- "n":7290,
41
- "acc":0.8963,
42
- "ece_raw":0.0505,
43
- "ece_cal":0.0112,
44
- "brier_raw":0.1534,
45
- "brier_cal":0.1431,
46
- "nll_raw":0.304,
47
- "nll_cal":0.2624
48
- },
49
- {
50
- "slice":"type:choice",
51
- "n":1424,
52
- "acc":0.8954,
53
- "ece_raw":0.057,
54
- "ece_cal":0.0266,
55
- "brier_raw":0.1521,
56
- "brier_cal":0.1416,
57
- "nll_raw":0.3135,
58
- "nll_cal":0.2748
59
- },
60
- {
61
- "slice":"type:score",
62
- "n":2043,
63
- "acc":0.7915,
64
- "ece_raw":0.0898,
65
- "ece_cal":0.0326,
66
- "brier_raw":0.3022,
67
- "brier_cal":0.2827,
68
- "nll_raw":0.5894,
69
- "nll_cal":0.5208
70
- },
71
- {
72
- "slice":"type:noul",
73
- "n":3823,
74
- "acc":0.9527,
75
- "ece_raw":0.0278,
76
- "ece_cal":0.0077,
77
- "brier_raw":0.0744,
78
- "brier_cal":0.069,
79
- "nll_raw":0.1478,
80
- "nll_cal":0.1196
81
- },
82
- {
83
- "slice":"src:climate",
84
- "n":41,
85
- "acc":0.8293,
86
- "ece_raw":0.1386,
87
- "ece_cal":0.0943,
88
- "brier_raw":0.2745,
89
- "brier_cal":0.246,
90
- "nll_raw":0.4514,
91
- "nll_cal":0.3913
92
- },
93
- {
94
- "slice":"src:esg_environmental",
95
- "n":61,
96
- "acc":0.9508,
97
- "ece_raw":0.0403,
98
- "ece_cal":0.0205,
99
- "brier_raw":0.0869,
100
- "brier_cal":0.077,
101
- "nll_raw":0.2006,
102
- "nll_cal":0.1489
103
- },
104
- {
105
- "slice":"src:esg_governance",
106
- "n":58,
107
- "acc":0.931,
108
- "ece_raw":0.0709,
109
- "ece_cal":0.0726,
110
- "brier_raw":0.1147,
111
- "brier_cal":0.1095,
112
- "nll_raw":0.2294,
113
- "nll_cal":0.1961
114
- },
115
- {
116
- "slice":"src:esg_social",
117
- "n":72,
118
- "acc":0.9583,
119
- "ece_raw":0.03,
120
- "ece_cal":0.0464,
121
- "brier_raw":0.0492,
122
- "brier_cal":0.052,
123
- "nll_raw":0.0801,
124
- "nll_cal":0.1018
125
- },
126
- {
127
- "slice":"src:fin_cls",
128
- "n":60,
129
- "acc":0.8833,
130
- "ece_raw":0.1039,
131
- "ece_cal":0.093,
132
- "brier_raw":0.2087,
133
- "brier_cal":0.1921,
134
- "nll_raw":0.4029,
135
- "nll_cal":0.3198
136
- },
137
- {
138
- "slice":"src:fomc",
139
- "n":112,
140
- "acc":0.6786,
141
- "ece_raw":0.1843,
142
- "ece_cal":0.1045,
143
- "brier_raw":0.462,
144
- "brier_cal":0.4127,
145
- "nll_raw":0.8413,
146
- "nll_cal":0.6986
147
- },
148
- {
149
- "slice":"src:headline",
150
- "n":1788,
151
- "acc":0.9771,
152
- "ece_raw":0.0132,
153
- "ece_cal":0.0108,
154
- "brier_raw":0.0378,
155
- "brier_cal":0.0354,
156
- "nll_raw":0.0723,
157
- "nll_cal":0.0645
158
- },
159
- {
160
- "slice":"src:sentiment",
161
- "n":1383,
162
- "acc":0.7628,
163
- "ece_raw":0.0985,
164
- "ece_cal":0.0398,
165
- "brier_raw":0.3381,
166
- "brier_cal":0.3171,
167
- "nll_raw":0.6822,
168
- "nll_cal":0.591
169
- },
170
- {
171
- "slice":"src:synth_company",
172
- "n":435,
173
- "acc":0.9862,
174
- "ece_raw":0.0076,
175
- "ece_cal":0.0134,
176
- "brier_raw":0.0198,
177
- "brier_cal":0.0198,
178
- "nll_raw":0.0337,
179
- "nll_cal":0.0378
180
- },
181
- {
182
- "slice":"src:synth_loan",
183
- "n":264,
184
- "acc":0.9811,
185
- "ece_raw":0.0186,
186
- "ece_cal":0.0252,
187
- "brier_raw":0.0322,
188
- "brier_cal":0.0301,
189
- "nll_raw":0.0482,
190
- "nll_cal":0.051
191
- },
192
- {
193
- "slice":"src:synth_macro",
194
- "n":279,
195
- "acc":1.0,
196
- "ece_raw":0.0,
197
- "ece_cal":0.0015,
198
- "brier_raw":0.0,
199
- "brier_cal":0.0,
200
- "nll_raw":0.0,
201
- "nll_cal":0.0015
202
- },
203
- {
204
- "slice":"src:synth_portfolio",
205
- "n":940,
206
- "acc":0.9734,
207
- "ece_raw":0.0104,
208
- "ece_cal":0.0204,
209
- "brier_raw":0.0402,
210
- "brier_cal":0.0402,
211
- "nll_raw":0.0671,
212
- "nll_cal":0.0742
213
- },
214
- {
215
- "slice":"src:tfns",
216
- "n":136,
217
- "acc":0.9118,
218
- "ece_raw":0.0533,
219
- "ece_cal":0.0289,
220
- "brier_raw":0.1389,
221
- "brier_cal":0.1281,
222
- "nll_raw":0.2646,
223
- "nll_cal":0.2215
224
- },
225
- {
226
- "slice":"src:topic",
227
- "n":650,
228
- "acc":0.9123,
229
- "ece_raw":0.0617,
230
- "ece_cal":0.0305,
231
- "brier_raw":0.1366,
232
- "brier_cal":0.1265,
233
- "nll_raw":0.3376,
234
- "nll_cal":0.2793
235
- },
236
- {
237
- "slice":"src:tweets2",
238
- "n":536,
239
- "acc":0.7948,
240
- "ece_raw":0.1405,
241
- "ece_cal":0.0803,
242
- "brier_raw":0.3332,
243
- "brier_cal":0.2984,
244
- "nll_raw":0.6789,
245
- "nll_cal":0.514
246
- },
247
- {
248
- "slice":"src:wcb",
249
- "n":231,
250
- "acc":0.6667,
251
- "ece_raw":0.1579,
252
- "ece_cal":0.1003,
253
- "brier_raw":0.457,
254
- "brier_cal":0.4266,
255
- "nll_raw":0.834,
256
- "nll_cal":0.7591
257
- },
258
- {
259
- "slice":"src:wcb_time",
260
- "n":117,
261
- "acc":0.8632,
262
- "ece_raw":0.0392,
263
- "ece_cal":0.0595,
264
- "brier_raw":0.1891,
265
- "brier_cal":0.1942,
266
- "nll_raw":0.3138,
267
- "nll_cal":0.3237
268
- },
269
- {
270
- "slice":"src:wcb_uncertain",
271
- "n":127,
272
- "acc":0.8504,
273
- "ece_raw":0.0815,
274
- "ece_cal":0.0959,
275
- "brier_raw":0.1847,
276
- "brier_cal":0.1835,
277
- "nll_raw":0.2823,
278
- "nll_cal":0.3037
279
- }
280
- ]
281
- ```
 
1
+
2
  ---
3
  license: other
4
+ tags:
5
+ - finance
6
+ - classification
7
+ - calibrated-probabilities
8
+ - system-one
9
+ - typed-decisions
10
  ---
 
11
 
12
+ # Nirnay: a typed decision model for finance
13
+
14
+ **Nirnay** is a 0.8B-parameter finance-oriented typed decision model developed by Sociodynamics AI.
15
+
16
+ Full fine-tune of `Qwen/Qwen3.5-0.8B-Base`.
17
+
18
+ It does **not generate text**: given a *state* (text or JSON) and typed questions (`choice`, `score`, `noul`), a single forward pass reads next-token logits over option letters only, giving a probability distribution per question.
19
+
20
+ Probabilities are temperature-calibrated on a held-out split.
21
+
22
+ Trained on: FinGPT headline yes/no, FinGPT sentiment (FPB/FiQA/tweets/news), Twitter financial news sentiment + topic, FOMC hawkish/dovish, extra tweet/text sentiment sets (if they passed the label audit), and *synthetic* portfolio questions whose labels come from exact formulas (concentration, drift, risk bucket, HHI).
23
 
24
+ ## Model
 
 
25
 
26
+ | Property | Value |
27
+ |---|---|
28
+ | Model name | Nirnay |
29
+ | Parameters | 0.8B |
30
+ | Base model | Qwen/Qwen3.5-0.8B-Base |
31
+ | Architecture | Typed decision classifier |
32
+ | Output | Choice, score, and yes/no probabilities |
33
+ | Inference | Single forward pass |
34
+ | Calibration | Temperature-calibrated |
35
+ | Developer | Sociodynamics AI |
36
 
37
  ## Use
38
+
39
  ```python
40
+ from huggingface_hub import hf_hub_download
41
+ import importlib.util
42
+ import sys
43
+
44
+ p = hf_hub_download("NeoSapian/nirnay", "jev_common.py")
45
+
46
+ s = importlib.util.spec_from_file_location("jev_common", p)
47
+ m = importlib.util.module_from_spec(s)
48
+ sys.modules["jev_common"] = m
49
+ s.loader.exec_module(m)
50
+
51
+ clf = m.JevClassifier("NeoSapian/nirnay")
52
+
53
+ print(clf.decide(
54
+ "Company X cuts full-year guidance and CFO resigns.",
55
+ {
56
+ "bearish": {
57
+ "type": "noul",
58
+ "instructions": "Is this news negative for the stock?"
59
+ },
60
+ "topic": {
61
+ "type": "choice",
62
+ "instructions": "Which topic?",
63
+ "criteria": {
64
+ "earnings": "results/guidance",
65
+ "personnel": "executive changes",
66
+ "m&a": "deals"
67
+ }
68
+ },
69
+ "severity": {
70
+ "type": "score",
71
+ "instructions": "How negative is this?",
72
+ "levels": ["mild", "moderate", "severe"]
73
+ }
74
+ }
75
+ ))
76
  ```
77
 
78
  ## Limits (read this)
79
+
80
+ * Nirnay classifies **text/state**; it does **not predict returns**.
81
+ * Headline labels say what a headline talks about, not what the price will do.
82
  * Portfolio questions are learned from synthetic, rule-labelled data; check arithmetic-heavy answers with real code.
83
  * Calibration is measured in-distribution; expect worse calibration on questions unlike the training tasks.
84
  * Not financial advice.
85
 
86
  ## Held-out test metrics
87
+
88
+ | Slice | N | Accuracy | ECE (calibrated) | Brier (calibrated) | NLL (calibrated) |
89
+ |---|---:|---:|---:|---:|---:|
90
+ | ALL | 7290 | 89.63% | 0.0112 | 0.1431 | 0.2624 |
91
+ | Choice | 1424 | 89.54% | 0.0266 | 0.1416 | 0.2748 |
92
+ | Score | 2043 | 79.15% | 0.0326 | 0.2827 | 0.5208 |
93
+ | Noul | 3823 | 95.27% | 0.0077 | 0.0690 | 0.1196 |
94
+
95
+ ## Dataset-wise evaluation
96
+
97
+ | Dataset | N | Accuracy |
98
+ |---|---:|---:|
99
+ | Climate | 41 | 82.93% |
100
+ | ESG Environmental | 61 | 95.08% |
101
+ | ESG Governance | 58 | 93.10% |
102
+ | ESG Social | 72 | 95.83% |
103
+ | Financial Classification | 60 | 88.33% |
104
+ | FOMC | 112 | 67.86% |
105
+ | Headline | 1788 | 97.71% |
106
+ | Sentiment | 1383 | 76.28% |
107
+ | Synthetic Company | 435 | 98.62% |
108
+ | Synthetic Loan | 264 | 98.11% |
109
+ | Synthetic Macro | 279 | 100.00% |
110
+ | Synthetic Portfolio | 940 | 97.34% |
111
+ | TFNS | 136 | 91.18% |
112
+ | Topic | 650 | 91.23% |
113
+ | Tweets2 | 536 | 79.48% |
114
+ | WCB | 231 | 66.67% |
115
+ | WCB Time | 117 | 86.32% |
116
+ | WCB Uncertain | 127 | 85.04% |
117
+
118
+ ## Probability calibration
119
+
120
+ | Metric | Raw | Calibrated |
121
+ |---|---:|---:|
122
+ | ECE | 0.0505 | 0.0112 |
123
+ | Brier Score | 0.1534 | 0.1431 |
124
+ | NLL | 0.3040 | 0.2624 |
125
+
126
+ Lower ECE, Brier score, and NLL indicate better calibration and probabilistic performance.
127
+
128
+ ## Developer
129
+
130
+ **Nirnay is developed by Sociodynamics AI.**
131
+
132
+ Hugging Face: https://huggingface.co/NeoSapian/nirnay
133
+
134
+ ---