Text Classification
Transformers
ONNX
Safetensors
English
bert
political-discourse
media-bias
wording
contextual-review
text-embeddings-inference
Instructions to use Giuliocc/doxa-wording-encoder with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Giuliocc/doxa-wording-encoder with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="Giuliocc/doxa-wording-encoder")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("Giuliocc/doxa-wording-encoder") model = AutoModelForSequenceClassification.from_pretrained("Giuliocc/doxa-wording-encoder", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Release CPU-trained contextual wording encoder with heldout and runtime audits
Browse files- BROWSER_PARITY.json +1170 -0
- EVALUATION.json +250 -0
- EVALUATION.md +90 -0
- EVALUATION_AMENDMENT_1.md +28 -0
- EVALUATION_REGISTRATION.md +69 -0
- EXPORT_ATTEMPTS.json +54 -0
- EXPORT_PLAN.md +17 -0
- EXPORT_REPAIR.md +31 -0
- EXPORT_VALIDATION.json +122 -0
- INDEPENDENT_GATE.json +55 -0
- LICENSE +202 -0
- NOTICE +17 -0
- README.md +100 -0
- REPRODUCE.md +53 -0
- SHA256SUMS +36 -0
- calibration.json +54 -0
- config.json +33 -0
- errors.json +486 -0
- illustrations.json +74 -0
- inference.py +55 -0
- model.safetensors +3 -0
- onnx/model_quantized.onnx +3 -0
- political_consistency_predictions.json +0 -0
- requirements.txt +10 -0
- runtime_manifest.json +23 -0
- special_tokens_map.json +37 -0
- test_predictions.jsonl +0 -0
- tokenizer.json +0 -0
- tokenizer_config.json +65 -0
- training/browser_parity.mjs +72 -0
- training/finalize_export.py +87 -0
- training/package_model.py +261 -0
- training/repair_export.py +75 -0
- training/train.py +461 -0
- training_history.json +92 -0
- validation_controls.json +18 -0
- vocab.txt +0 -0
BROWSER_PARITY.json
ADDED
|
@@ -0,0 +1,1170 @@
|
|
|
|
|
|
|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 9 |
+
"id": "babe-sg2-00004",
|
| 10 |
+
"expected": 1,
|
| 11 |
+
"actual": 1,
|
| 12 |
+
"model_score": 0.8536160232888809,
|
| 13 |
+
"token_count": 32,
|
| 14 |
+
"decision": "wording_flag",
|
| 15 |
+
"reason": null
|
| 16 |
+
},
|
| 17 |
+
{
|
| 18 |
+
"id": "babe-sg2-00016",
|
| 19 |
+
"expected": 0,
|
| 20 |
+
"actual": 0,
|
| 21 |
+
"model_score": 0.13130024299115245,
|
| 22 |
+
"token_count": 29,
|
| 23 |
+
"decision": "no_wording_flag",
|
| 24 |
+
"reason": null
|
| 25 |
+
},
|
| 26 |
+
{
|
| 27 |
+
"id": "babe-sg2-00019",
|
| 28 |
+
"expected": 0,
|
| 29 |
+
"actual": 0,
|
| 30 |
+
"model_score": 0.2434595566943359,
|
| 31 |
+
"token_count": 34,
|
| 32 |
+
"decision": "no_wording_flag",
|
| 33 |
+
"reason": null
|
| 34 |
+
},
|
| 35 |
+
{
|
| 36 |
+
"id": "babe-sg2-00026",
|
| 37 |
+
"expected": 0,
|
| 38 |
+
"actual": 0,
|
| 39 |
+
"model_score": 0.40140562678453484,
|
| 40 |
+
"token_count": 49,
|
| 41 |
+
"decision": "unresolved",
|
| 42 |
+
"reason": "below_resolution_threshold"
|
| 43 |
+
},
|
| 44 |
+
{
|
| 45 |
+
"id": "babe-sg2-00033",
|
| 46 |
+
"expected": 0,
|
| 47 |
+
"actual": 0,
|
| 48 |
+
"model_score": 0.04825453998750875,
|
| 49 |
+
"token_count": 56,
|
| 50 |
+
"decision": "no_wording_flag",
|
| 51 |
+
"reason": null
|
| 52 |
+
},
|
| 53 |
+
{
|
| 54 |
+
"id": "babe-sg2-00037",
|
| 55 |
+
"expected": 1,
|
| 56 |
+
"actual": 1,
|
| 57 |
+
"model_score": 0.9049855129633448,
|
| 58 |
+
"token_count": 41,
|
| 59 |
+
"decision": "wording_flag",
|
| 60 |
+
"reason": null
|
| 61 |
+
},
|
| 62 |
+
{
|
| 63 |
+
"id": "babe-sg2-00040",
|
| 64 |
+
"expected": 0,
|
| 65 |
+
"actual": 0,
|
| 66 |
+
"model_score": 0.10477707721929225,
|
| 67 |
+
"token_count": 26,
|
| 68 |
+
"decision": "no_wording_flag",
|
| 69 |
+
"reason": null
|
| 70 |
+
},
|
| 71 |
+
{
|
| 72 |
+
"id": "babe-sg2-00042",
|
| 73 |
+
"expected": 0,
|
| 74 |
+
"actual": 0,
|
| 75 |
+
"model_score": 0.2761477993633633,
|
| 76 |
+
"token_count": 34,
|
| 77 |
+
"decision": "no_wording_flag",
|
| 78 |
+
"reason": null
|
| 79 |
+
},
|
| 80 |
+
{
|
| 81 |
+
"id": "babe-sg2-00060",
|
| 82 |
+
"expected": 0,
|
| 83 |
+
"actual": 0,
|
| 84 |
+
"model_score": 0.18701201616797722,
|
| 85 |
+
"token_count": 52,
|
| 86 |
+
"decision": "no_wording_flag",
|
| 87 |
+
"reason": null
|
| 88 |
+
},
|
| 89 |
+
{
|
| 90 |
+
"id": "babe-sg2-00072",
|
| 91 |
+
"expected": 0,
|
| 92 |
+
"actual": 0,
|
| 93 |
+
"model_score": 0.13283118864222035,
|
| 94 |
+
"token_count": 55,
|
| 95 |
+
"decision": "no_wording_flag",
|
| 96 |
+
"reason": null
|
| 97 |
+
},
|
| 98 |
+
{
|
| 99 |
+
"id": "babe-sg2-00076",
|
| 100 |
+
"expected": 0,
|
| 101 |
+
"actual": 0,
|
| 102 |
+
"model_score": 0.07497314345136857,
|
| 103 |
+
"token_count": 46,
|
| 104 |
+
"decision": "no_wording_flag",
|
| 105 |
+
"reason": null
|
| 106 |
+
},
|
| 107 |
+
{
|
| 108 |
+
"id": "babe-sg2-00077",
|
| 109 |
+
"expected": 0,
|
| 110 |
+
"actual": 0,
|
| 111 |
+
"model_score": 0.11186566159432572,
|
| 112 |
+
"token_count": 36,
|
| 113 |
+
"decision": "no_wording_flag",
|
| 114 |
+
"reason": null
|
| 115 |
+
},
|
| 116 |
+
{
|
| 117 |
+
"id": "babe-sg2-00079",
|
| 118 |
+
"expected": 0,
|
| 119 |
+
"actual": 0,
|
| 120 |
+
"model_score": 0.08475059624200033,
|
| 121 |
+
"token_count": 57,
|
| 122 |
+
"decision": "no_wording_flag",
|
| 123 |
+
"reason": null
|
| 124 |
+
},
|
| 125 |
+
{
|
| 126 |
+
"id": "babe-sg2-00094",
|
| 127 |
+
"expected": 0,
|
| 128 |
+
"actual": 0,
|
| 129 |
+
"model_score": 0.10606724392588747,
|
| 130 |
+
"token_count": 46,
|
| 131 |
+
"decision": "no_wording_flag",
|
| 132 |
+
"reason": null
|
| 133 |
+
},
|
| 134 |
+
{
|
| 135 |
+
"id": "babe-sg2-00119",
|
| 136 |
+
"expected": 1,
|
| 137 |
+
"actual": 1,
|
| 138 |
+
"model_score": 0.9279073984549722,
|
| 139 |
+
"token_count": 42,
|
| 140 |
+
"decision": "wording_flag",
|
| 141 |
+
"reason": null
|
| 142 |
+
},
|
| 143 |
+
{
|
| 144 |
+
"id": "babe-sg2-00121",
|
| 145 |
+
"expected": 1,
|
| 146 |
+
"actual": 1,
|
| 147 |
+
"model_score": 0.7347190081592256,
|
| 148 |
+
"token_count": 44,
|
| 149 |
+
"decision": "wording_flag",
|
| 150 |
+
"reason": null
|
| 151 |
+
},
|
| 152 |
+
{
|
| 153 |
+
"id": "babe-sg2-00128",
|
| 154 |
+
"expected": 0,
|
| 155 |
+
"actual": 0,
|
| 156 |
+
"model_score": 0.05048383019853845,
|
| 157 |
+
"token_count": 49,
|
| 158 |
+
"decision": "no_wording_flag",
|
| 159 |
+
"reason": null
|
| 160 |
+
},
|
| 161 |
+
{
|
| 162 |
+
"id": "babe-sg2-00136",
|
| 163 |
+
"expected": 0,
|
| 164 |
+
"actual": 0,
|
| 165 |
+
"model_score": 0.05291765392412409,
|
| 166 |
+
"token_count": 45,
|
| 167 |
+
"decision": "no_wording_flag",
|
| 168 |
+
"reason": null
|
| 169 |
+
},
|
| 170 |
+
{
|
| 171 |
+
"id": "babe-sg2-00141",
|
| 172 |
+
"expected": 1,
|
| 173 |
+
"actual": 1,
|
| 174 |
+
"model_score": 0.9333874720809865,
|
| 175 |
+
"token_count": 67,
|
| 176 |
+
"decision": "wording_flag",
|
| 177 |
+
"reason": null
|
| 178 |
+
},
|
| 179 |
+
{
|
| 180 |
+
"id": "babe-sg2-00143",
|
| 181 |
+
"expected": 0,
|
| 182 |
+
"actual": 0,
|
| 183 |
+
"model_score": 0.05925830624892734,
|
| 184 |
+
"token_count": 44,
|
| 185 |
+
"decision": "no_wording_flag",
|
| 186 |
+
"reason": null
|
| 187 |
+
},
|
| 188 |
+
{
|
| 189 |
+
"id": "babe-sg2-00154",
|
| 190 |
+
"expected": 0,
|
| 191 |
+
"actual": 0,
|
| 192 |
+
"model_score": 0.07440129946754435,
|
| 193 |
+
"token_count": 37,
|
| 194 |
+
"decision": "no_wording_flag",
|
| 195 |
+
"reason": null
|
| 196 |
+
},
|
| 197 |
+
{
|
| 198 |
+
"id": "babe-sg2-00165",
|
| 199 |
+
"expected": 0,
|
| 200 |
+
"actual": 0,
|
| 201 |
+
"model_score": 0.12919919106597616,
|
| 202 |
+
"token_count": 26,
|
| 203 |
+
"decision": "no_wording_flag",
|
| 204 |
+
"reason": null
|
| 205 |
+
},
|
| 206 |
+
{
|
| 207 |
+
"id": "babe-sg2-00171",
|
| 208 |
+
"expected": 0,
|
| 209 |
+
"actual": 0,
|
| 210 |
+
"model_score": 0.12188997292590643,
|
| 211 |
+
"token_count": 44,
|
| 212 |
+
"decision": "no_wording_flag",
|
| 213 |
+
"reason": null
|
| 214 |
+
},
|
| 215 |
+
{
|
| 216 |
+
"id": "babe-sg2-00178",
|
| 217 |
+
"expected": 0,
|
| 218 |
+
"actual": 0,
|
| 219 |
+
"model_score": 0.1039316163651011,
|
| 220 |
+
"token_count": 36,
|
| 221 |
+
"decision": "no_wording_flag",
|
| 222 |
+
"reason": null
|
| 223 |
+
},
|
| 224 |
+
{
|
| 225 |
+
"id": "babe-sg2-00183",
|
| 226 |
+
"expected": 1,
|
| 227 |
+
"actual": 1,
|
| 228 |
+
"model_score": 0.9491290836580328,
|
| 229 |
+
"token_count": 68,
|
| 230 |
+
"decision": "wording_flag",
|
| 231 |
+
"reason": null
|
| 232 |
+
},
|
| 233 |
+
{
|
| 234 |
+
"id": "babe-sg2-00193",
|
| 235 |
+
"expected": 0,
|
| 236 |
+
"actual": 0,
|
| 237 |
+
"model_score": 0.05141595327158375,
|
| 238 |
+
"token_count": 36,
|
| 239 |
+
"decision": "no_wording_flag",
|
| 240 |
+
"reason": null
|
| 241 |
+
},
|
| 242 |
+
{
|
| 243 |
+
"id": "babe-sg2-00218",
|
| 244 |
+
"expected": 0,
|
| 245 |
+
"actual": 0,
|
| 246 |
+
"model_score": 0.05158418869207257,
|
| 247 |
+
"token_count": 45,
|
| 248 |
+
"decision": "no_wording_flag",
|
| 249 |
+
"reason": null
|
| 250 |
+
},
|
| 251 |
+
{
|
| 252 |
+
"id": "babe-sg2-00222",
|
| 253 |
+
"expected": 0,
|
| 254 |
+
"actual": 0,
|
| 255 |
+
"model_score": 0.059578137462459074,
|
| 256 |
+
"token_count": 46,
|
| 257 |
+
"decision": "no_wording_flag",
|
| 258 |
+
"reason": null
|
| 259 |
+
},
|
| 260 |
+
{
|
| 261 |
+
"id": "babe-sg2-00227",
|
| 262 |
+
"expected": 1,
|
| 263 |
+
"actual": 1,
|
| 264 |
+
"model_score": 0.8141192639894297,
|
| 265 |
+
"token_count": 36,
|
| 266 |
+
"decision": "wording_flag",
|
| 267 |
+
"reason": null
|
| 268 |
+
},
|
| 269 |
+
{
|
| 270 |
+
"id": "babe-sg2-00231",
|
| 271 |
+
"expected": 0,
|
| 272 |
+
"actual": 0,
|
| 273 |
+
"model_score": 0.23248371573784177,
|
| 274 |
+
"token_count": 48,
|
| 275 |
+
"decision": "no_wording_flag",
|
| 276 |
+
"reason": null
|
| 277 |
+
},
|
| 278 |
+
{
|
| 279 |
+
"id": "babe-sg2-00258",
|
| 280 |
+
"expected": 1,
|
| 281 |
+
"actual": 1,
|
| 282 |
+
"model_score": 0.9434710052294938,
|
| 283 |
+
"token_count": 16,
|
| 284 |
+
"decision": "wording_flag",
|
| 285 |
+
"reason": null
|
| 286 |
+
},
|
| 287 |
+
{
|
| 288 |
+
"id": "babe-sg2-00275",
|
| 289 |
+
"expected": 0,
|
| 290 |
+
"actual": 0,
|
| 291 |
+
"model_score": 0.04995165571266002,
|
| 292 |
+
"token_count": 47,
|
| 293 |
+
"decision": "no_wording_flag",
|
| 294 |
+
"reason": null
|
| 295 |
+
},
|
| 296 |
+
{
|
| 297 |
+
"id": "babe-sg2-00282",
|
| 298 |
+
"expected": 1,
|
| 299 |
+
"actual": 1,
|
| 300 |
+
"model_score": 0.7068659241473576,
|
| 301 |
+
"token_count": 52,
|
| 302 |
+
"decision": "wording_flag",
|
| 303 |
+
"reason": null
|
| 304 |
+
},
|
| 305 |
+
{
|
| 306 |
+
"id": "babe-sg2-00292",
|
| 307 |
+
"expected": 1,
|
| 308 |
+
"actual": 1,
|
| 309 |
+
"model_score": 0.9240893128996647,
|
| 310 |
+
"token_count": 43,
|
| 311 |
+
"decision": "wording_flag",
|
| 312 |
+
"reason": null
|
| 313 |
+
},
|
| 314 |
+
{
|
| 315 |
+
"id": "babe-sg2-00293",
|
| 316 |
+
"expected": 1,
|
| 317 |
+
"actual": 1,
|
| 318 |
+
"model_score": 0.9049074068163022,
|
| 319 |
+
"token_count": 35,
|
| 320 |
+
"decision": "wording_flag",
|
| 321 |
+
"reason": null
|
| 322 |
+
},
|
| 323 |
+
{
|
| 324 |
+
"id": "babe-sg2-00297",
|
| 325 |
+
"expected": 1,
|
| 326 |
+
"actual": 1,
|
| 327 |
+
"model_score": 0.9283635688003279,
|
| 328 |
+
"token_count": 34,
|
| 329 |
+
"decision": "wording_flag",
|
| 330 |
+
"reason": null
|
| 331 |
+
},
|
| 332 |
+
{
|
| 333 |
+
"id": "babe-sg2-00329",
|
| 334 |
+
"expected": 1,
|
| 335 |
+
"actual": 1,
|
| 336 |
+
"model_score": 0.922660428681087,
|
| 337 |
+
"token_count": 25,
|
| 338 |
+
"decision": "wording_flag",
|
| 339 |
+
"reason": null
|
| 340 |
+
},
|
| 341 |
+
{
|
| 342 |
+
"id": "babe-sg2-00335",
|
| 343 |
+
"expected": 1,
|
| 344 |
+
"actual": 1,
|
| 345 |
+
"model_score": 0.9215531939858171,
|
| 346 |
+
"token_count": 44,
|
| 347 |
+
"decision": "wording_flag",
|
| 348 |
+
"reason": null
|
| 349 |
+
},
|
| 350 |
+
{
|
| 351 |
+
"id": "babe-sg2-00341",
|
| 352 |
+
"expected": 1,
|
| 353 |
+
"actual": 1,
|
| 354 |
+
"model_score": 0.8663255356017562,
|
| 355 |
+
"token_count": 14,
|
| 356 |
+
"decision": "wording_flag",
|
| 357 |
+
"reason": null
|
| 358 |
+
},
|
| 359 |
+
{
|
| 360 |
+
"id": "babe-sg2-00344",
|
| 361 |
+
"expected": 1,
|
| 362 |
+
"actual": 1,
|
| 363 |
+
"model_score": 0.8912836662776421,
|
| 364 |
+
"token_count": 41,
|
| 365 |
+
"decision": "wording_flag",
|
| 366 |
+
"reason": null
|
| 367 |
+
},
|
| 368 |
+
{
|
| 369 |
+
"id": "babe-sg2-00356",
|
| 370 |
+
"expected": 0,
|
| 371 |
+
"actual": 0,
|
| 372 |
+
"model_score": 0.05677489619513097,
|
| 373 |
+
"token_count": 37,
|
| 374 |
+
"decision": "no_wording_flag",
|
| 375 |
+
"reason": null
|
| 376 |
+
},
|
| 377 |
+
{
|
| 378 |
+
"id": "babe-sg2-00365",
|
| 379 |
+
"expected": 1,
|
| 380 |
+
"actual": 1,
|
| 381 |
+
"model_score": 0.9377490538307731,
|
| 382 |
+
"token_count": 31,
|
| 383 |
+
"decision": "wording_flag",
|
| 384 |
+
"reason": null
|
| 385 |
+
},
|
| 386 |
+
{
|
| 387 |
+
"id": "babe-sg2-00372",
|
| 388 |
+
"expected": 1,
|
| 389 |
+
"actual": 1,
|
| 390 |
+
"model_score": 0.8658565655464927,
|
| 391 |
+
"token_count": 46,
|
| 392 |
+
"decision": "wording_flag",
|
| 393 |
+
"reason": null
|
| 394 |
+
},
|
| 395 |
+
{
|
| 396 |
+
"id": "babe-sg2-00389",
|
| 397 |
+
"expected": 1,
|
| 398 |
+
"actual": 1,
|
| 399 |
+
"model_score": 0.7052057281505449,
|
| 400 |
+
"token_count": 27,
|
| 401 |
+
"decision": "wording_flag",
|
| 402 |
+
"reason": null
|
| 403 |
+
},
|
| 404 |
+
{
|
| 405 |
+
"id": "babe-sg2-00422",
|
| 406 |
+
"expected": 1,
|
| 407 |
+
"actual": 1,
|
| 408 |
+
"model_score": 0.8929885177022191,
|
| 409 |
+
"token_count": 37,
|
| 410 |
+
"decision": "wording_flag",
|
| 411 |
+
"reason": null
|
| 412 |
+
},
|
| 413 |
+
{
|
| 414 |
+
"id": "babe-sg2-00425",
|
| 415 |
+
"expected": 0,
|
| 416 |
+
"actual": 0,
|
| 417 |
+
"model_score": 0.08188386934663003,
|
| 418 |
+
"token_count": 50,
|
| 419 |
+
"decision": "no_wording_flag",
|
| 420 |
+
"reason": null
|
| 421 |
+
},
|
| 422 |
+
{
|
| 423 |
+
"id": "babe-sg2-00428",
|
| 424 |
+
"expected": 0,
|
| 425 |
+
"actual": 0,
|
| 426 |
+
"model_score": 0.05636467869021947,
|
| 427 |
+
"token_count": 46,
|
| 428 |
+
"decision": "no_wording_flag",
|
| 429 |
+
"reason": null
|
| 430 |
+
},
|
| 431 |
+
{
|
| 432 |
+
"id": "babe-sg2-00445",
|
| 433 |
+
"expected": 1,
|
| 434 |
+
"actual": 1,
|
| 435 |
+
"model_score": 0.9501305592207069,
|
| 436 |
+
"token_count": 25,
|
| 437 |
+
"decision": "wording_flag",
|
| 438 |
+
"reason": null
|
| 439 |
+
},
|
| 440 |
+
{
|
| 441 |
+
"id": "babe-sg2-00450",
|
| 442 |
+
"expected": 0,
|
| 443 |
+
"actual": 0,
|
| 444 |
+
"model_score": 0.06436518094128374,
|
| 445 |
+
"token_count": 51,
|
| 446 |
+
"decision": "no_wording_flag",
|
| 447 |
+
"reason": null
|
| 448 |
+
},
|
| 449 |
+
{
|
| 450 |
+
"id": "babe-sg2-00463",
|
| 451 |
+
"expected": 1,
|
| 452 |
+
"actual": 1,
|
| 453 |
+
"model_score": 0.8980680648341451,
|
| 454 |
+
"token_count": 38,
|
| 455 |
+
"decision": "wording_flag",
|
| 456 |
+
"reason": null
|
| 457 |
+
},
|
| 458 |
+
{
|
| 459 |
+
"id": "babe-sg2-00475",
|
| 460 |
+
"expected": 1,
|
| 461 |
+
"actual": 1,
|
| 462 |
+
"model_score": 0.7106333952819255,
|
| 463 |
+
"token_count": 30,
|
| 464 |
+
"decision": "wording_flag",
|
| 465 |
+
"reason": null
|
| 466 |
+
},
|
| 467 |
+
{
|
| 468 |
+
"id": "babe-sg2-00490",
|
| 469 |
+
"expected": 0,
|
| 470 |
+
"actual": 0,
|
| 471 |
+
"model_score": 0.09058580093893784,
|
| 472 |
+
"token_count": 51,
|
| 473 |
+
"decision": "no_wording_flag",
|
| 474 |
+
"reason": null
|
| 475 |
+
},
|
| 476 |
+
{
|
| 477 |
+
"id": "babe-sg2-00497",
|
| 478 |
+
"expected": 0,
|
| 479 |
+
"actual": 0,
|
| 480 |
+
"model_score": 0.44279076035748693,
|
| 481 |
+
"token_count": 30,
|
| 482 |
+
"decision": "unresolved",
|
| 483 |
+
"reason": "below_resolution_threshold"
|
| 484 |
+
},
|
| 485 |
+
{
|
| 486 |
+
"id": "babe-sg2-00505",
|
| 487 |
+
"expected": 0,
|
| 488 |
+
"actual": 0,
|
| 489 |
+
"model_score": 0.04671205222495248,
|
| 490 |
+
"token_count": 32,
|
| 491 |
+
"decision": "no_wording_flag",
|
| 492 |
+
"reason": null
|
| 493 |
+
},
|
| 494 |
+
{
|
| 495 |
+
"id": "babe-sg2-00526",
|
| 496 |
+
"expected": 0,
|
| 497 |
+
"actual": 0,
|
| 498 |
+
"model_score": 0.1489503858583886,
|
| 499 |
+
"token_count": 58,
|
| 500 |
+
"decision": "no_wording_flag",
|
| 501 |
+
"reason": null
|
| 502 |
+
},
|
| 503 |
+
{
|
| 504 |
+
"id": "babe-sg2-00528",
|
| 505 |
+
"expected": 0,
|
| 506 |
+
"actual": 0,
|
| 507 |
+
"model_score": 0.4346255439541322,
|
| 508 |
+
"token_count": 38,
|
| 509 |
+
"decision": "unresolved",
|
| 510 |
+
"reason": "below_resolution_threshold"
|
| 511 |
+
},
|
| 512 |
+
{
|
| 513 |
+
"id": "babe-sg2-00535",
|
| 514 |
+
"expected": 0,
|
| 515 |
+
"actual": 0,
|
| 516 |
+
"model_score": 0.055718988853431496,
|
| 517 |
+
"token_count": 47,
|
| 518 |
+
"decision": "no_wording_flag",
|
| 519 |
+
"reason": null
|
| 520 |
+
},
|
| 521 |
+
{
|
| 522 |
+
"id": "babe-sg2-00543",
|
| 523 |
+
"expected": 0,
|
| 524 |
+
"actual": 0,
|
| 525 |
+
"model_score": 0.09483625907058132,
|
| 526 |
+
"token_count": 34,
|
| 527 |
+
"decision": "no_wording_flag",
|
| 528 |
+
"reason": null
|
| 529 |
+
},
|
| 530 |
+
{
|
| 531 |
+
"id": "babe-sg2-00568",
|
| 532 |
+
"expected": 0,
|
| 533 |
+
"actual": 0,
|
| 534 |
+
"model_score": 0.05945631345111946,
|
| 535 |
+
"token_count": 41,
|
| 536 |
+
"decision": "no_wording_flag",
|
| 537 |
+
"reason": null
|
| 538 |
+
},
|
| 539 |
+
{
|
| 540 |
+
"id": "babe-sg2-00571",
|
| 541 |
+
"expected": 0,
|
| 542 |
+
"actual": 0,
|
| 543 |
+
"model_score": 0.06148491090799401,
|
| 544 |
+
"token_count": 35,
|
| 545 |
+
"decision": "no_wording_flag",
|
| 546 |
+
"reason": null
|
| 547 |
+
},
|
| 548 |
+
{
|
| 549 |
+
"id": "babe-sg2-00596",
|
| 550 |
+
"expected": 1,
|
| 551 |
+
"actual": 1,
|
| 552 |
+
"model_score": 0.9469195930914892,
|
| 553 |
+
"token_count": 87,
|
| 554 |
+
"decision": "wording_flag",
|
| 555 |
+
"reason": null
|
| 556 |
+
},
|
| 557 |
+
{
|
| 558 |
+
"id": "babe-sg2-00608",
|
| 559 |
+
"expected": 1,
|
| 560 |
+
"actual": 1,
|
| 561 |
+
"model_score": 0.9493214022971216,
|
| 562 |
+
"token_count": 59,
|
| 563 |
+
"decision": "wording_flag",
|
| 564 |
+
"reason": null
|
| 565 |
+
},
|
| 566 |
+
{
|
| 567 |
+
"id": "babe-sg2-00611",
|
| 568 |
+
"expected": 0,
|
| 569 |
+
"actual": 0,
|
| 570 |
+
"model_score": 0.10878698266360667,
|
| 571 |
+
"token_count": 40,
|
| 572 |
+
"decision": "no_wording_flag",
|
| 573 |
+
"reason": null
|
| 574 |
+
},
|
| 575 |
+
{
|
| 576 |
+
"id": "babe-sg2-00623",
|
| 577 |
+
"expected": 1,
|
| 578 |
+
"actual": 1,
|
| 579 |
+
"model_score": 0.9178716644566286,
|
| 580 |
+
"token_count": 36,
|
| 581 |
+
"decision": "wording_flag",
|
| 582 |
+
"reason": null
|
| 583 |
+
},
|
| 584 |
+
{
|
| 585 |
+
"id": "babe-sg2-00635",
|
| 586 |
+
"expected": 0,
|
| 587 |
+
"actual": 0,
|
| 588 |
+
"model_score": 0.49969036136055506,
|
| 589 |
+
"token_count": 51,
|
| 590 |
+
"decision": "unresolved",
|
| 591 |
+
"reason": "below_resolution_threshold"
|
| 592 |
+
},
|
| 593 |
+
{
|
| 594 |
+
"id": "babe-sg2-00646",
|
| 595 |
+
"expected": 1,
|
| 596 |
+
"actual": 1,
|
| 597 |
+
"model_score": 0.9429855555004746,
|
| 598 |
+
"token_count": 45,
|
| 599 |
+
"decision": "wording_flag",
|
| 600 |
+
"reason": null
|
| 601 |
+
},
|
| 602 |
+
{
|
| 603 |
+
"id": "babe-sg2-00647",
|
| 604 |
+
"expected": 0,
|
| 605 |
+
"actual": 0,
|
| 606 |
+
"model_score": 0.09239265101127658,
|
| 607 |
+
"token_count": 26,
|
| 608 |
+
"decision": "no_wording_flag",
|
| 609 |
+
"reason": null
|
| 610 |
+
},
|
| 611 |
+
{
|
| 612 |
+
"id": "babe-sg2-00652",
|
| 613 |
+
"expected": 1,
|
| 614 |
+
"actual": 1,
|
| 615 |
+
"model_score": 0.7806210252139192,
|
| 616 |
+
"token_count": 39,
|
| 617 |
+
"decision": "wording_flag",
|
| 618 |
+
"reason": null
|
| 619 |
+
},
|
| 620 |
+
{
|
| 621 |
+
"id": "babe-sg2-00656",
|
| 622 |
+
"expected": 0,
|
| 623 |
+
"actual": 0,
|
| 624 |
+
"model_score": 0.40956138938879216,
|
| 625 |
+
"token_count": 39,
|
| 626 |
+
"decision": "unresolved",
|
| 627 |
+
"reason": "below_resolution_threshold"
|
| 628 |
+
},
|
| 629 |
+
{
|
| 630 |
+
"id": "babe-sg2-00677",
|
| 631 |
+
"expected": 0,
|
| 632 |
+
"actual": 0,
|
| 633 |
+
"model_score": 0.05334309387097041,
|
| 634 |
+
"token_count": 48,
|
| 635 |
+
"decision": "no_wording_flag",
|
| 636 |
+
"reason": null
|
| 637 |
+
},
|
| 638 |
+
{
|
| 639 |
+
"id": "babe-sg2-00679",
|
| 640 |
+
"expected": 0,
|
| 641 |
+
"actual": 0,
|
| 642 |
+
"model_score": 0.07001340303384072,
|
| 643 |
+
"token_count": 49,
|
| 644 |
+
"decision": "no_wording_flag",
|
| 645 |
+
"reason": null
|
| 646 |
+
},
|
| 647 |
+
{
|
| 648 |
+
"id": "babe-sg2-00681",
|
| 649 |
+
"expected": 0,
|
| 650 |
+
"actual": 0,
|
| 651 |
+
"model_score": 0.45557303819027034,
|
| 652 |
+
"token_count": 72,
|
| 653 |
+
"decision": "unresolved",
|
| 654 |
+
"reason": "below_resolution_threshold"
|
| 655 |
+
},
|
| 656 |
+
{
|
| 657 |
+
"id": "babe-sg2-00705",
|
| 658 |
+
"expected": 1,
|
| 659 |
+
"actual": 1,
|
| 660 |
+
"model_score": 0.836975564511903,
|
| 661 |
+
"token_count": 28,
|
| 662 |
+
"decision": "wording_flag",
|
| 663 |
+
"reason": null
|
| 664 |
+
},
|
| 665 |
+
{
|
| 666 |
+
"id": "babe-sg2-00732",
|
| 667 |
+
"expected": 1,
|
| 668 |
+
"actual": 1,
|
| 669 |
+
"model_score": 0.5169106194568577,
|
| 670 |
+
"token_count": 53,
|
| 671 |
+
"decision": "unresolved",
|
| 672 |
+
"reason": "below_resolution_threshold"
|
| 673 |
+
},
|
| 674 |
+
{
|
| 675 |
+
"id": "babe-sg2-00741",
|
| 676 |
+
"expected": 0,
|
| 677 |
+
"actual": 0,
|
| 678 |
+
"model_score": 0.11629945625990862,
|
| 679 |
+
"token_count": 47,
|
| 680 |
+
"decision": "no_wording_flag",
|
| 681 |
+
"reason": null
|
| 682 |
+
},
|
| 683 |
+
{
|
| 684 |
+
"id": "babe-sg2-00763",
|
| 685 |
+
"expected": 1,
|
| 686 |
+
"actual": 1,
|
| 687 |
+
"model_score": 0.7567534049832096,
|
| 688 |
+
"token_count": 30,
|
| 689 |
+
"decision": "wording_flag",
|
| 690 |
+
"reason": null
|
| 691 |
+
},
|
| 692 |
+
{
|
| 693 |
+
"id": "babe-sg2-00784",
|
| 694 |
+
"expected": 0,
|
| 695 |
+
"actual": 0,
|
| 696 |
+
"model_score": 0.15084087969429202,
|
| 697 |
+
"token_count": 55,
|
| 698 |
+
"decision": "no_wording_flag",
|
| 699 |
+
"reason": null
|
| 700 |
+
},
|
| 701 |
+
{
|
| 702 |
+
"id": "babe-sg2-00797",
|
| 703 |
+
"expected": 1,
|
| 704 |
+
"actual": 1,
|
| 705 |
+
"model_score": 0.8665376465942952,
|
| 706 |
+
"token_count": 27,
|
| 707 |
+
"decision": "wording_flag",
|
| 708 |
+
"reason": null
|
| 709 |
+
},
|
| 710 |
+
{
|
| 711 |
+
"id": "babe-sg2-00798",
|
| 712 |
+
"expected": 1,
|
| 713 |
+
"actual": 1,
|
| 714 |
+
"model_score": 0.9487957614077946,
|
| 715 |
+
"token_count": 47,
|
| 716 |
+
"decision": "wording_flag",
|
| 717 |
+
"reason": null
|
| 718 |
+
},
|
| 719 |
+
{
|
| 720 |
+
"id": "babe-sg2-00808",
|
| 721 |
+
"expected": 0,
|
| 722 |
+
"actual": 0,
|
| 723 |
+
"model_score": 0.06522606592221215,
|
| 724 |
+
"token_count": 51,
|
| 725 |
+
"decision": "no_wording_flag",
|
| 726 |
+
"reason": null
|
| 727 |
+
},
|
| 728 |
+
{
|
| 729 |
+
"id": "babe-sg2-00811",
|
| 730 |
+
"expected": 0,
|
| 731 |
+
"actual": 0,
|
| 732 |
+
"model_score": 0.18176677210957592,
|
| 733 |
+
"token_count": 56,
|
| 734 |
+
"decision": "no_wording_flag",
|
| 735 |
+
"reason": null
|
| 736 |
+
},
|
| 737 |
+
{
|
| 738 |
+
"id": "babe-sg2-00814",
|
| 739 |
+
"expected": 0,
|
| 740 |
+
"actual": 0,
|
| 741 |
+
"model_score": 0.26855830709648243,
|
| 742 |
+
"token_count": 42,
|
| 743 |
+
"decision": "no_wording_flag",
|
| 744 |
+
"reason": null
|
| 745 |
+
},
|
| 746 |
+
{
|
| 747 |
+
"id": "babe-sg2-00820",
|
| 748 |
+
"expected": 0,
|
| 749 |
+
"actual": 0,
|
| 750 |
+
"model_score": 0.08079796222100295,
|
| 751 |
+
"token_count": 51,
|
| 752 |
+
"decision": "no_wording_flag",
|
| 753 |
+
"reason": null
|
| 754 |
+
},
|
| 755 |
+
{
|
| 756 |
+
"id": "babe-sg2-00824",
|
| 757 |
+
"expected": 1,
|
| 758 |
+
"actual": 1,
|
| 759 |
+
"model_score": 0.5807091659325537,
|
| 760 |
+
"token_count": 13,
|
| 761 |
+
"decision": "unresolved",
|
| 762 |
+
"reason": "below_resolution_threshold"
|
| 763 |
+
},
|
| 764 |
+
{
|
| 765 |
+
"id": "babe-sg2-00840",
|
| 766 |
+
"expected": 1,
|
| 767 |
+
"actual": 1,
|
| 768 |
+
"model_score": 0.7550397356780106,
|
| 769 |
+
"token_count": 30,
|
| 770 |
+
"decision": "wording_flag",
|
| 771 |
+
"reason": null
|
| 772 |
+
},
|
| 773 |
+
{
|
| 774 |
+
"id": "babe-sg2-00841",
|
| 775 |
+
"expected": 0,
|
| 776 |
+
"actual": 0,
|
| 777 |
+
"model_score": 0.2463752963769827,
|
| 778 |
+
"token_count": 19,
|
| 779 |
+
"decision": "no_wording_flag",
|
| 780 |
+
"reason": null
|
| 781 |
+
},
|
| 782 |
+
{
|
| 783 |
+
"id": "babe-sg2-00855",
|
| 784 |
+
"expected": 0,
|
| 785 |
+
"actual": 0,
|
| 786 |
+
"model_score": 0.3957036180323135,
|
| 787 |
+
"token_count": 35,
|
| 788 |
+
"decision": "unresolved",
|
| 789 |
+
"reason": "below_resolution_threshold"
|
| 790 |
+
},
|
| 791 |
+
{
|
| 792 |
+
"id": "babe-sg2-00859",
|
| 793 |
+
"expected": 1,
|
| 794 |
+
"actual": 1,
|
| 795 |
+
"model_score": 0.7493019307576434,
|
| 796 |
+
"token_count": 17,
|
| 797 |
+
"decision": "wording_flag",
|
| 798 |
+
"reason": null
|
| 799 |
+
},
|
| 800 |
+
{
|
| 801 |
+
"id": "babe-sg2-00880",
|
| 802 |
+
"expected": 1,
|
| 803 |
+
"actual": 1,
|
| 804 |
+
"model_score": 0.9571794082478314,
|
| 805 |
+
"token_count": 27,
|
| 806 |
+
"decision": "wording_flag",
|
| 807 |
+
"reason": null
|
| 808 |
+
},
|
| 809 |
+
{
|
| 810 |
+
"id": "babe-sg2-00887",
|
| 811 |
+
"expected": 0,
|
| 812 |
+
"actual": 0,
|
| 813 |
+
"model_score": 0.0850634950787702,
|
| 814 |
+
"token_count": 47,
|
| 815 |
+
"decision": "no_wording_flag",
|
| 816 |
+
"reason": null
|
| 817 |
+
},
|
| 818 |
+
{
|
| 819 |
+
"id": "babe-sg2-00888",
|
| 820 |
+
"expected": 1,
|
| 821 |
+
"actual": 1,
|
| 822 |
+
"model_score": 0.8283451515245593,
|
| 823 |
+
"token_count": 36,
|
| 824 |
+
"decision": "wording_flag",
|
| 825 |
+
"reason": null
|
| 826 |
+
},
|
| 827 |
+
{
|
| 828 |
+
"id": "babe-sg2-00900",
|
| 829 |
+
"expected": 0,
|
| 830 |
+
"actual": 0,
|
| 831 |
+
"model_score": 0.1015824066998982,
|
| 832 |
+
"token_count": 51,
|
| 833 |
+
"decision": "no_wording_flag",
|
| 834 |
+
"reason": null
|
| 835 |
+
},
|
| 836 |
+
{
|
| 837 |
+
"id": "babe-sg2-00903",
|
| 838 |
+
"expected": 1,
|
| 839 |
+
"actual": 1,
|
| 840 |
+
"model_score": 0.6009107966812129,
|
| 841 |
+
"token_count": 52,
|
| 842 |
+
"decision": "unresolved",
|
| 843 |
+
"reason": "below_resolution_threshold"
|
| 844 |
+
},
|
| 845 |
+
{
|
| 846 |
+
"id": "babe-sg2-00907",
|
| 847 |
+
"expected": 0,
|
| 848 |
+
"actual": 0,
|
| 849 |
+
"model_score": 0.19098439802328562,
|
| 850 |
+
"token_count": 50,
|
| 851 |
+
"decision": "no_wording_flag",
|
| 852 |
+
"reason": null
|
| 853 |
+
},
|
| 854 |
+
{
|
| 855 |
+
"id": "babe-sg2-00913",
|
| 856 |
+
"expected": 0,
|
| 857 |
+
"actual": 0,
|
| 858 |
+
"model_score": 0.10551676516743085,
|
| 859 |
+
"token_count": 41,
|
| 860 |
+
"decision": "no_wording_flag",
|
| 861 |
+
"reason": null
|
| 862 |
+
},
|
| 863 |
+
{
|
| 864 |
+
"id": "babe-sg2-00928",
|
| 865 |
+
"expected": 0,
|
| 866 |
+
"actual": 0,
|
| 867 |
+
"model_score": 0.05652688400308911,
|
| 868 |
+
"token_count": 43,
|
| 869 |
+
"decision": "no_wording_flag",
|
| 870 |
+
"reason": null
|
| 871 |
+
},
|
| 872 |
+
{
|
| 873 |
+
"id": "babe-sg2-00935",
|
| 874 |
+
"expected": 0,
|
| 875 |
+
"actual": 0,
|
| 876 |
+
"model_score": 0.1349004021471647,
|
| 877 |
+
"token_count": 45,
|
| 878 |
+
"decision": "no_wording_flag",
|
| 879 |
+
"reason": null
|
| 880 |
+
},
|
| 881 |
+
{
|
| 882 |
+
"id": "babe-sg2-00939",
|
| 883 |
+
"expected": 1,
|
| 884 |
+
"actual": 1,
|
| 885 |
+
"model_score": 0.5094169174119301,
|
| 886 |
+
"token_count": 21,
|
| 887 |
+
"decision": "unresolved",
|
| 888 |
+
"reason": "below_resolution_threshold"
|
| 889 |
+
},
|
| 890 |
+
{
|
| 891 |
+
"id": "babe-sg2-00944",
|
| 892 |
+
"expected": 1,
|
| 893 |
+
"actual": 1,
|
| 894 |
+
"model_score": 0.8949406244395416,
|
| 895 |
+
"token_count": 31,
|
| 896 |
+
"decision": "wording_flag",
|
| 897 |
+
"reason": null
|
| 898 |
+
},
|
| 899 |
+
{
|
| 900 |
+
"id": "babe-sg2-00967",
|
| 901 |
+
"expected": 1,
|
| 902 |
+
"actual": 1,
|
| 903 |
+
"model_score": 0.9285758664997227,
|
| 904 |
+
"token_count": 14,
|
| 905 |
+
"decision": "wording_flag",
|
| 906 |
+
"reason": null
|
| 907 |
+
},
|
| 908 |
+
{
|
| 909 |
+
"id": "babe-sg2-00974",
|
| 910 |
+
"expected": 0,
|
| 911 |
+
"actual": 0,
|
| 912 |
+
"model_score": 0.06586665005238847,
|
| 913 |
+
"token_count": 34,
|
| 914 |
+
"decision": "no_wording_flag",
|
| 915 |
+
"reason": null
|
| 916 |
+
},
|
| 917 |
+
{
|
| 918 |
+
"id": "babe-sg2-00975",
|
| 919 |
+
"expected": 0,
|
| 920 |
+
"actual": 0,
|
| 921 |
+
"model_score": 0.08722900866998999,
|
| 922 |
+
"token_count": 24,
|
| 923 |
+
"decision": "no_wording_flag",
|
| 924 |
+
"reason": null
|
| 925 |
+
},
|
| 926 |
+
{
|
| 927 |
+
"id": "babe-sg2-00979",
|
| 928 |
+
"expected": 0,
|
| 929 |
+
"actual": 0,
|
| 930 |
+
"model_score": 0.12722797678022707,
|
| 931 |
+
"token_count": 51,
|
| 932 |
+
"decision": "no_wording_flag",
|
| 933 |
+
"reason": null
|
| 934 |
+
},
|
| 935 |
+
{
|
| 936 |
+
"id": "babe-sg2-00984",
|
| 937 |
+
"expected": 1,
|
| 938 |
+
"actual": 1,
|
| 939 |
+
"model_score": 0.9290564215549262,
|
| 940 |
+
"token_count": 78,
|
| 941 |
+
"decision": "wording_flag",
|
| 942 |
+
"reason": null
|
| 943 |
+
},
|
| 944 |
+
{
|
| 945 |
+
"id": "babe-sg2-00999",
|
| 946 |
+
"expected": 1,
|
| 947 |
+
"actual": 1,
|
| 948 |
+
"model_score": 0.8859360979588797,
|
| 949 |
+
"token_count": 53,
|
| 950 |
+
"decision": "wording_flag",
|
| 951 |
+
"reason": null
|
| 952 |
+
},
|
| 953 |
+
{
|
| 954 |
+
"id": "babe-sg2-01004",
|
| 955 |
+
"expected": 0,
|
| 956 |
+
"actual": 0,
|
| 957 |
+
"model_score": 0.06574542265227686,
|
| 958 |
+
"token_count": 38,
|
| 959 |
+
"decision": "no_wording_flag",
|
| 960 |
+
"reason": null
|
| 961 |
+
},
|
| 962 |
+
{
|
| 963 |
+
"id": "babe-sg2-01028",
|
| 964 |
+
"expected": 1,
|
| 965 |
+
"actual": 1,
|
| 966 |
+
"model_score": 0.5285754848910359,
|
| 967 |
+
"token_count": 53,
|
| 968 |
+
"decision": "unresolved",
|
| 969 |
+
"reason": "below_resolution_threshold"
|
| 970 |
+
},
|
| 971 |
+
{
|
| 972 |
+
"id": "babe-sg2-01029",
|
| 973 |
+
"expected": 1,
|
| 974 |
+
"actual": 1,
|
| 975 |
+
"model_score": 0.9354946568051664,
|
| 976 |
+
"token_count": 38,
|
| 977 |
+
"decision": "wording_flag",
|
| 978 |
+
"reason": null
|
| 979 |
+
},
|
| 980 |
+
{
|
| 981 |
+
"id": "babe-sg2-01033",
|
| 982 |
+
"expected": 1,
|
| 983 |
+
"actual": 1,
|
| 984 |
+
"model_score": 0.8491965643643697,
|
| 985 |
+
"token_count": 34,
|
| 986 |
+
"decision": "wording_flag",
|
| 987 |
+
"reason": null
|
| 988 |
+
},
|
| 989 |
+
{
|
| 990 |
+
"id": "babe-sg2-01051",
|
| 991 |
+
"expected": 1,
|
| 992 |
+
"actual": 1,
|
| 993 |
+
"model_score": 0.8859021344835966,
|
| 994 |
+
"token_count": 41,
|
| 995 |
+
"decision": "wording_flag",
|
| 996 |
+
"reason": null
|
| 997 |
+
},
|
| 998 |
+
{
|
| 999 |
+
"id": "babe-sg2-01056",
|
| 1000 |
+
"expected": 1,
|
| 1001 |
+
"actual": 1,
|
| 1002 |
+
"model_score": 0.9345746722401901,
|
| 1003 |
+
"token_count": 51,
|
| 1004 |
+
"decision": "wording_flag",
|
| 1005 |
+
"reason": null
|
| 1006 |
+
},
|
| 1007 |
+
{
|
| 1008 |
+
"id": "babe-sg2-01075",
|
| 1009 |
+
"expected": 0,
|
| 1010 |
+
"actual": 0,
|
| 1011 |
+
"model_score": 0.0482148466930728,
|
| 1012 |
+
"token_count": 41,
|
| 1013 |
+
"decision": "no_wording_flag",
|
| 1014 |
+
"reason": null
|
| 1015 |
+
},
|
| 1016 |
+
{
|
| 1017 |
+
"id": "babe-sg2-01081",
|
| 1018 |
+
"expected": 1,
|
| 1019 |
+
"actual": 1,
|
| 1020 |
+
"model_score": 0.9206091174833315,
|
| 1021 |
+
"token_count": 25,
|
| 1022 |
+
"decision": "wording_flag",
|
| 1023 |
+
"reason": null
|
| 1024 |
+
},
|
| 1025 |
+
{
|
| 1026 |
+
"id": "babe-sg2-01088",
|
| 1027 |
+
"expected": 1,
|
| 1028 |
+
"actual": 1,
|
| 1029 |
+
"model_score": 0.7839877082486039,
|
| 1030 |
+
"token_count": 40,
|
| 1031 |
+
"decision": "wording_flag",
|
| 1032 |
+
"reason": null
|
| 1033 |
+
},
|
| 1034 |
+
{
|
| 1035 |
+
"id": "babe-sg2-01094",
|
| 1036 |
+
"expected": 0,
|
| 1037 |
+
"actual": 0,
|
| 1038 |
+
"model_score": 0.15762831518037682,
|
| 1039 |
+
"token_count": 40,
|
| 1040 |
+
"decision": "no_wording_flag",
|
| 1041 |
+
"reason": null
|
| 1042 |
+
},
|
| 1043 |
+
{
|
| 1044 |
+
"id": "babe-sg2-01110",
|
| 1045 |
+
"expected": 1,
|
| 1046 |
+
"actual": 1,
|
| 1047 |
+
"model_score": 0.9397634579305271,
|
| 1048 |
+
"token_count": 26,
|
| 1049 |
+
"decision": "wording_flag",
|
| 1050 |
+
"reason": null
|
| 1051 |
+
},
|
| 1052 |
+
{
|
| 1053 |
+
"id": "babe-sg2-01117",
|
| 1054 |
+
"expected": 0,
|
| 1055 |
+
"actual": 0,
|
| 1056 |
+
"model_score": 0.04690582347855333,
|
| 1057 |
+
"token_count": 41,
|
| 1058 |
+
"decision": "no_wording_flag",
|
| 1059 |
+
"reason": null
|
| 1060 |
+
},
|
| 1061 |
+
{
|
| 1062 |
+
"id": "babe-sg2-01134",
|
| 1063 |
+
"expected": 1,
|
| 1064 |
+
"actual": 1,
|
| 1065 |
+
"model_score": 0.9498105160596131,
|
| 1066 |
+
"token_count": 32,
|
| 1067 |
+
"decision": "wording_flag",
|
| 1068 |
+
"reason": null
|
| 1069 |
+
},
|
| 1070 |
+
{
|
| 1071 |
+
"id": "babe-sg2-01153",
|
| 1072 |
+
"expected": 0,
|
| 1073 |
+
"actual": 0,
|
| 1074 |
+
"model_score": 0.4512206365061092,
|
| 1075 |
+
"token_count": 18,
|
| 1076 |
+
"decision": "unresolved",
|
| 1077 |
+
"reason": "below_resolution_threshold"
|
| 1078 |
+
},
|
| 1079 |
+
{
|
| 1080 |
+
"id": "babe-sg2-01168",
|
| 1081 |
+
"expected": 1,
|
| 1082 |
+
"actual": 1,
|
| 1083 |
+
"model_score": 0.9458817848330462,
|
| 1084 |
+
"token_count": 18,
|
| 1085 |
+
"decision": "wording_flag",
|
| 1086 |
+
"reason": null
|
| 1087 |
+
},
|
| 1088 |
+
{
|
| 1089 |
+
"id": "babe-sg2-01170",
|
| 1090 |
+
"expected": 1,
|
| 1091 |
+
"actual": 1,
|
| 1092 |
+
"model_score": 0.6962894618728036,
|
| 1093 |
+
"token_count": 38,
|
| 1094 |
+
"decision": "unresolved",
|
| 1095 |
+
"reason": "below_resolution_threshold"
|
| 1096 |
+
},
|
| 1097 |
+
{
|
| 1098 |
+
"id": "babe-sg2-01171",
|
| 1099 |
+
"expected": 0,
|
| 1100 |
+
"actual": 0,
|
| 1101 |
+
"model_score": 0.295516917061168,
|
| 1102 |
+
"token_count": 34,
|
| 1103 |
+
"decision": "no_wording_flag",
|
| 1104 |
+
"reason": null
|
| 1105 |
+
},
|
| 1106 |
+
{
|
| 1107 |
+
"id": "babe-sg2-01179",
|
| 1108 |
+
"expected": 1,
|
| 1109 |
+
"actual": 1,
|
| 1110 |
+
"model_score": 0.5049665315098095,
|
| 1111 |
+
"token_count": 49,
|
| 1112 |
+
"decision": "unresolved",
|
| 1113 |
+
"reason": "below_resolution_threshold"
|
| 1114 |
+
},
|
| 1115 |
+
{
|
| 1116 |
+
"id": "babe-sg2-01180",
|
| 1117 |
+
"expected": 0,
|
| 1118 |
+
"actual": 0,
|
| 1119 |
+
"model_score": 0.04873692168556563,
|
| 1120 |
+
"token_count": 52,
|
| 1121 |
+
"decision": "no_wording_flag",
|
| 1122 |
+
"reason": null
|
| 1123 |
+
},
|
| 1124 |
+
{
|
| 1125 |
+
"id": "babe-sg2-01185",
|
| 1126 |
+
"expected": 1,
|
| 1127 |
+
"actual": 1,
|
| 1128 |
+
"model_score": 0.8776390715848041,
|
| 1129 |
+
"token_count": 34,
|
| 1130 |
+
"decision": "wording_flag",
|
| 1131 |
+
"reason": null
|
| 1132 |
+
},
|
| 1133 |
+
{
|
| 1134 |
+
"id": "babe-sg2-01194",
|
| 1135 |
+
"expected": 0,
|
| 1136 |
+
"actual": 0,
|
| 1137 |
+
"model_score": 0.32850984206495987,
|
| 1138 |
+
"token_count": 35,
|
| 1139 |
+
"decision": "unresolved",
|
| 1140 |
+
"reason": "below_resolution_threshold"
|
| 1141 |
+
},
|
| 1142 |
+
{
|
| 1143 |
+
"id": "babe-sg2-01208",
|
| 1144 |
+
"expected": 0,
|
| 1145 |
+
"actual": 0,
|
| 1146 |
+
"model_score": 0.06498660460401713,
|
| 1147 |
+
"token_count": 29,
|
| 1148 |
+
"decision": "no_wording_flag",
|
| 1149 |
+
"reason": null
|
| 1150 |
+
},
|
| 1151 |
+
{
|
| 1152 |
+
"id": "babe-sg2-01217",
|
| 1153 |
+
"expected": 0,
|
| 1154 |
+
"actual": 0,
|
| 1155 |
+
"model_score": 0.12273946646360612,
|
| 1156 |
+
"token_count": 70,
|
| 1157 |
+
"decision": "no_wording_flag",
|
| 1158 |
+
"reason": null
|
| 1159 |
+
},
|
| 1160 |
+
{
|
| 1161 |
+
"id": "authored_long_input_control",
|
| 1162 |
+
"expected": null,
|
| 1163 |
+
"actual": null,
|
| 1164 |
+
"model_score": null,
|
| 1165 |
+
"token_count": 408,
|
| 1166 |
+
"decision": "unresolved",
|
| 1167 |
+
"reason": "input_too_long"
|
| 1168 |
+
}
|
| 1169 |
+
]
|
| 1170 |
+
}
|
EVALUATION.json
ADDED
|
@@ -0,0 +1,250 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"method": "doxa-wording-minilm-v1",
|
| 3 |
+
"base_model": "sentence-transformers/all-MiniLM-L6-v2",
|
| 4 |
+
"base_revision": "1110a243fdf4706b3f48f1d95db1a4f5529b4d41",
|
| 5 |
+
"data_lock": {
|
| 6 |
+
"train": {
|
| 7 |
+
"sha256": "1f05fb713ae688050d19e0bc8a51425d4557a675e6a81e601f65e21edfd70a1a",
|
| 8 |
+
"rows": 2950
|
| 9 |
+
},
|
| 10 |
+
"validation": {
|
| 11 |
+
"sha256": "a2e9c240e3c35e6e80a8ff137d2b51b5c25abb2ecd221cc000492443dd7d7867",
|
| 12 |
+
"rows": 305
|
| 13 |
+
},
|
| 14 |
+
"test": {
|
| 15 |
+
"sha256": "2414ce46d8bcc89bcecd3ae1b62a9f123efb958e1d29e29304904266cf044503",
|
| 16 |
+
"rows": 384
|
| 17 |
+
},
|
| 18 |
+
"registration_sha256": "45fd0d26b7c78ec5963e396bfe3b9a42b087e90eaeaeb7855fa9c26db70412b2",
|
| 19 |
+
"amendment_1_sha256": "2d42761f95fce054a9b8d855daf8d0d6536c8fc8426b9e779782d02d57cb3d65",
|
| 20 |
+
"export_plan_sha256": "01f6c4e3cc7e65fcb0075bbeb8a2c75949aece7e3a688fc99126cd7d1817fc81"
|
| 21 |
+
},
|
| 22 |
+
"selected": {
|
| 23 |
+
"learning_rate": 5e-05,
|
| 24 |
+
"epoch": 2,
|
| 25 |
+
"training_loss": 0.41341936366783605,
|
| 26 |
+
"validation": {
|
| 27 |
+
"rows": 305,
|
| 28 |
+
"macro_f1": 0.8229336888277285,
|
| 29 |
+
"accuracy": 0.8229508196721311,
|
| 30 |
+
"per_class_f1": {
|
| 31 |
+
"no_biased_wording": 0.8211920529801324,
|
| 32 |
+
"biased_wording": 0.8246753246753247
|
| 33 |
+
}
|
| 34 |
+
},
|
| 35 |
+
"seconds": 137.1762949979966
|
| 36 |
+
},
|
| 37 |
+
"task": "BABE expert-majority biased wording",
|
| 38 |
+
"controls": {
|
| 39 |
+
"word_tfidf": {
|
| 40 |
+
"rows": 384,
|
| 41 |
+
"macro_f1": 0.7159898218829517,
|
| 42 |
+
"accuracy": 0.7161458333333334,
|
| 43 |
+
"per_class_f1": {
|
| 44 |
+
"no_biased_wording": 0.72264631043257,
|
| 45 |
+
"biased_wording": 0.7093333333333334
|
| 46 |
+
},
|
| 47 |
+
"brier": 0.19246645928220488,
|
| 48 |
+
"negative_log_likelihood": 0.5697521581666226,
|
| 49 |
+
"ece_10_bins": 0.0814620590407955
|
| 50 |
+
},
|
| 51 |
+
"character_tfidf": {
|
| 52 |
+
"rows": 384,
|
| 53 |
+
"macro_f1": 0.7419757695048699,
|
| 54 |
+
"accuracy": 0.7421875,
|
| 55 |
+
"per_class_f1": {
|
| 56 |
+
"no_biased_wording": 0.7493670886075949,
|
| 57 |
+
"biased_wording": 0.7345844504021448
|
| 58 |
+
},
|
| 59 |
+
"brier": 0.18585864126645837,
|
| 60 |
+
"negative_log_likelihood": 0.5550111947496307,
|
| 61 |
+
"ece_10_bins": 0.09102536020312302
|
| 62 |
+
},
|
| 63 |
+
"word_character_tfidf": {
|
| 64 |
+
"rows": 384,
|
| 65 |
+
"macro_f1": 0.7238384715588363,
|
| 66 |
+
"accuracy": 0.7239583333333334,
|
| 67 |
+
"per_class_f1": {
|
| 68 |
+
"no_biased_wording": 0.7295918367346939,
|
| 69 |
+
"biased_wording": 0.7180851063829787
|
| 70 |
+
},
|
| 71 |
+
"brier": 0.21733227446387757,
|
| 72 |
+
"negative_log_likelihood": 0.6267828220542433,
|
| 73 |
+
"ece_10_bins": 0.16465610375061493
|
| 74 |
+
},
|
| 75 |
+
"frozen_encoder_logistic": {
|
| 76 |
+
"rows": 384,
|
| 77 |
+
"macro_f1": 0.7445421961550993,
|
| 78 |
+
"accuracy": 0.7447916666666666,
|
| 79 |
+
"per_class_f1": {
|
| 80 |
+
"no_biased_wording": 0.7525252525252525,
|
| 81 |
+
"biased_wording": 0.7365591397849462
|
| 82 |
+
},
|
| 83 |
+
"brier": 0.16402433400378166,
|
| 84 |
+
"negative_log_likelihood": 0.4974819584565702,
|
| 85 |
+
"ece_10_bins": 0.05917165347978995
|
| 86 |
+
},
|
| 87 |
+
"doxa_framing_control": {
|
| 88 |
+
"rows": 384,
|
| 89 |
+
"macro_f1": 0.4977164278354659,
|
| 90 |
+
"accuracy": 0.5338541666666666,
|
| 91 |
+
"per_class_f1": {
|
| 92 |
+
"no_biased_wording": 0.6324435318275154,
|
| 93 |
+
"biased_wording": 0.36298932384341637
|
| 94 |
+
},
|
| 95 |
+
"brier": 0.24987336185987877,
|
| 96 |
+
"negative_log_likelihood": 0.6928939034259424,
|
| 97 |
+
"ece_10_bins": 0.03207113093768732,
|
| 98 |
+
"original_decisions": {
|
| 99 |
+
"absent": 245,
|
| 100 |
+
"insufficient_context": 73,
|
| 101 |
+
"present": 66
|
| 102 |
+
}
|
| 103 |
+
}
|
| 104 |
+
},
|
| 105 |
+
"candidate": {
|
| 106 |
+
"rows": 384,
|
| 107 |
+
"macro_f1": 0.7886482703323435,
|
| 108 |
+
"accuracy": 0.7890625,
|
| 109 |
+
"per_class_f1": {
|
| 110 |
+
"no_biased_wording": 0.7980049875311721,
|
| 111 |
+
"biased_wording": 0.779291553133515
|
| 112 |
+
},
|
| 113 |
+
"brier": 0.16015382667000752,
|
| 114 |
+
"negative_log_likelihood": 0.49328099639482326,
|
| 115 |
+
"ece_10_bins": 0.07816794825096926,
|
| 116 |
+
"resolved_coverage": 0.828125,
|
| 117 |
+
"resolved_macro_f1": 0.82696017808558
|
| 118 |
+
},
|
| 119 |
+
"selected_pipeline": "fine_tuned_encoder",
|
| 120 |
+
"contextual_validation": {
|
| 121 |
+
"fine_tuned_encoder": {
|
| 122 |
+
"rows": 305,
|
| 123 |
+
"macro_f1": 0.8229336888277285,
|
| 124 |
+
"accuracy": 0.8229508196721311,
|
| 125 |
+
"per_class_f1": {
|
| 126 |
+
"no_biased_wording": 0.8211920529801324,
|
| 127 |
+
"biased_wording": 0.8246753246753247
|
| 128 |
+
}
|
| 129 |
+
},
|
| 130 |
+
"frozen_encoder_logistic": {
|
| 131 |
+
"rows": 305,
|
| 132 |
+
"macro_f1": 0.7867385247576941,
|
| 133 |
+
"accuracy": 0.7868852459016393,
|
| 134 |
+
"per_class_f1": {
|
| 135 |
+
"no_biased_wording": 0.7811447811447811,
|
| 136 |
+
"biased_wording": 0.792332268370607
|
| 137 |
+
}
|
| 138 |
+
}
|
| 139 |
+
},
|
| 140 |
+
"test_input_limits": {
|
| 141 |
+
"maximum_tokens": 256,
|
| 142 |
+
"within_limit": 384,
|
| 143 |
+
"exceeds_limit": 0,
|
| 144 |
+
"maximum_observed_tokens": 103
|
| 145 |
+
},
|
| 146 |
+
"strongest_control": "character_tfidf",
|
| 147 |
+
"macro_f1_gain": 0.04667250082747365,
|
| 148 |
+
"bootstrap": {
|
| 149 |
+
"unit": "article_group",
|
| 150 |
+
"groups": 227,
|
| 151 |
+
"draws": 2000,
|
| 152 |
+
"gain_interval_95": [
|
| 153 |
+
0.0027218200550942345,
|
| 154 |
+
0.09238916178767137
|
| 155 |
+
]
|
| 156 |
+
},
|
| 157 |
+
"quantized": {
|
| 158 |
+
"rows": 384,
|
| 159 |
+
"macro_f1": 0.7835238502760967,
|
| 160 |
+
"accuracy": 0.7838541666666666,
|
| 161 |
+
"per_class_f1": {
|
| 162 |
+
"no_biased_wording": 0.7919799498746867,
|
| 163 |
+
"biased_wording": 0.7750677506775068
|
| 164 |
+
},
|
| 165 |
+
"brier": 0.16296000575569328,
|
| 166 |
+
"negative_log_likelihood": 0.5014788136309872,
|
| 167 |
+
"ece_10_bins": 0.07855109777301551,
|
| 168 |
+
"resolved_coverage": 0.84375,
|
| 169 |
+
"resolved_macro_f1": 0.8178161960219963
|
| 170 |
+
},
|
| 171 |
+
"native_quantized_agreement": 0.9895833333333334,
|
| 172 |
+
"quantized_bytes": 23157564,
|
| 173 |
+
"release_gate": {
|
| 174 |
+
"native": true,
|
| 175 |
+
"quantized": true,
|
| 176 |
+
"size": true,
|
| 177 |
+
"passed": true
|
| 178 |
+
},
|
| 179 |
+
"new_spend_usd": 0,
|
| 180 |
+
"contextual_test": {
|
| 181 |
+
"fine_tuned_encoder": {
|
| 182 |
+
"rows": 384,
|
| 183 |
+
"macro_f1": 0.7886482703323435,
|
| 184 |
+
"accuracy": 0.7890625,
|
| 185 |
+
"per_class_f1": {
|
| 186 |
+
"no_biased_wording": 0.7980049875311721,
|
| 187 |
+
"biased_wording": 0.779291553133515
|
| 188 |
+
},
|
| 189 |
+
"brier": 0.16015382667000752,
|
| 190 |
+
"negative_log_likelihood": 0.49328099639482326,
|
| 191 |
+
"ece_10_bins": 0.07816794825096926,
|
| 192 |
+
"resolved_coverage": 0.828125,
|
| 193 |
+
"resolved_macro_f1": 0.82696017808558
|
| 194 |
+
},
|
| 195 |
+
"frozen_encoder_logistic": {
|
| 196 |
+
"rows": 384,
|
| 197 |
+
"macro_f1": 0.7445421961550993,
|
| 198 |
+
"accuracy": 0.7447916666666666,
|
| 199 |
+
"per_class_f1": {
|
| 200 |
+
"no_biased_wording": 0.7525252525252525,
|
| 201 |
+
"biased_wording": 0.7365591397849462
|
| 202 |
+
},
|
| 203 |
+
"brier": 0.16402433505727124,
|
| 204 |
+
"negative_log_likelihood": 0.497481964507352,
|
| 205 |
+
"ece_10_bins": 0.059171638141075775
|
| 206 |
+
}
|
| 207 |
+
},
|
| 208 |
+
"fine_tuning_gain_over_frozen": 0.044106074177244214,
|
| 209 |
+
"quantized_batch_size": 1,
|
| 210 |
+
"quantized_macro_f1_gain": 0.04154808077122685,
|
| 211 |
+
"quantized_bootstrap": {
|
| 212 |
+
"unit": "article_group",
|
| 213 |
+
"groups": 227,
|
| 214 |
+
"draws": 2000,
|
| 215 |
+
"gain_interval_95": [
|
| 216 |
+
-0.0043714321046402155,
|
| 217 |
+
0.08853098281291114
|
| 218 |
+
]
|
| 219 |
+
},
|
| 220 |
+
"export_repair": {
|
| 221 |
+
"plan_sha256": "c750910939855b368a842e2ea980110b70cffbecadfc5ba227d53864bedde168",
|
| 222 |
+
"selected_settings": {
|
| 223 |
+
"name": "per_channel_1-reduce_range_1",
|
| 224 |
+
"per_channel": true,
|
| 225 |
+
"reduce_range": true,
|
| 226 |
+
"validation": {
|
| 227 |
+
"rows": 305,
|
| 228 |
+
"macro_f1": 0.8131067178379077,
|
| 229 |
+
"accuracy": 0.8131147540983606,
|
| 230 |
+
"per_class_f1": {
|
| 231 |
+
"no_biased_wording": 0.8118811881188119,
|
| 232 |
+
"biased_wording": 0.8143322475570033
|
| 233 |
+
}
|
| 234 |
+
},
|
| 235 |
+
"native_agreement": 0.9836065573770492,
|
| 236 |
+
"probability_mae": 0.014533568173646927,
|
| 237 |
+
"batch_16_native_agreement": 0.9836065573770492,
|
| 238 |
+
"singleton_batch16_agreement": 0.9868852459016394,
|
| 239 |
+
"bytes": 23157564,
|
| 240 |
+
"sha256": "cb6dd5d63b6ed2f28c142141c263e3a29deb88289ad4dab50f7584a7c7b27d48",
|
| 241 |
+
"eligible": true
|
| 242 |
+
},
|
| 243 |
+
"selection_used_test": false,
|
| 244 |
+
"timing": "Export engineering followed initial held-out native/export measurement; learned weights and calibration stayed locked."
|
| 245 |
+
},
|
| 246 |
+
"benchmark_release": {
|
| 247 |
+
"id": "Giuliocc/doxa-wording-benchmark",
|
| 248 |
+
"revision": "bea9a3f2d53b03069b0d814094ea860d75f1c322"
|
| 249 |
+
}
|
| 250 |
+
}
|
EVALUATION.md
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Contextual wording evaluation
|
| 2 |
+
|
| 3 |
+
The selected pipeline uses full encoder and classification head fine-tuning. Selection used validation macro-F1 after
|
| 4 |
+
the fixed search. The held-out cohort contains 384 upstream expert-majority
|
| 5 |
+
judgments in 227 article/source components.
|
| 6 |
+
|
| 7 |
+
| Pipeline | Test macro-F1 | Accuracy |
|
| 8 |
+
|---|---:|---:|
|
| 9 |
+
| word_tfidf | 0.716 | 0.716 |
|
| 10 |
+
| character_tfidf | 0.742 | 0.742 |
|
| 11 |
+
| word_character_tfidf | 0.724 | 0.724 |
|
| 12 |
+
| frozen_encoder_logistic | 0.745 | 0.745 |
|
| 13 |
+
| doxa_framing_control | 0.498 | 0.534 |
|
| 14 |
+
| Selected contextual pipeline | 0.789 | 0.789 |
|
| 15 |
+
| Quantized browser model | 0.784 | 0.784 |
|
| 16 |
+
|
| 17 |
+
The existing DOXA framing head is a task-mismatch proxy: its binary control
|
| 18 |
+
uses present/(present+absent), with original abstention states retained in
|
| 19 |
+
the JSON receipt. It was trained for the broader evaluative-framing review
|
| 20 |
+
criterion. The strongest control here was the character TF-IDF wording
|
| 21 |
+
classifier, so the reported improvement does not depend on that proxy.
|
| 22 |
+
|
| 23 |
+
The selected pipeline's gain over the strongest lexical/current-model control
|
| 24 |
+
was 0.0467. Its paired 95% source-group bootstrap
|
| 25 |
+
interval was [0.0027, 0.0924], using 2,000 draws.
|
| 26 |
+
The registered minimum gain was 0.02 with a positive lower bound.
|
| 27 |
+
|
| 28 |
+
The deployed quantized model's point gain over that control was
|
| 29 |
+
0.0415. Its separately reported 95%
|
| 30 |
+
group-bootstrap interval was
|
| 31 |
+
[-0.0044, 0.0885].
|
| 32 |
+
That interval includes zero. The native model's positive interval and the
|
| 33 |
+
registered quantization-parity gate support this provisional release;
|
| 34 |
+
standalone superiority of the browser export at 95% is not established.
|
| 35 |
+
|
| 36 |
+
Fine-tuning's observed macro-F1 difference from the frozen contextual pipeline
|
| 37 |
+
was 0.0441. Both contextual pipelines
|
| 38 |
+
were evaluated after validation selection. That comparison remains distinct
|
| 39 |
+
from the product promotion gate. The original gate and its pre-test amendment
|
| 40 |
+
are published alongside the export plan.
|
| 41 |
+
|
| 42 |
+
The initial matrix-only and default matrix-plus-embedding quantized exports
|
| 43 |
+
failed parity. After those held-out measurements, a bounded four-setting
|
| 44 |
+
exporter comparison used validation passages to select per-channel,
|
| 45 |
+
reduced-range QInt8. The final graph uses singleton inference matching the
|
| 46 |
+
browser. Learned weights, calibration and registered release thresholds
|
| 47 |
+
stayed fixed. EXPORT_REPAIR.md, EXPORT_VALIDATION.json and
|
| 48 |
+
EXPORT_ATTEMPTS.json preserve the process and failures. The export repair
|
| 49 |
+
occurred after initial held-out measurement; it is not a second untouched
|
| 50 |
+
model-selection experiment.
|
| 51 |
+
|
| 52 |
+
Quantized/native class agreement was 98.958%.
|
| 53 |
+
The quantized graph is 23,157,564 bytes. Browser/native
|
| 54 |
+
agreement was 100.000% over 128 deterministic cases.
|
| 55 |
+
Input above 256 tokens returns unresolved in the browser. Test input-limit
|
| 56 |
+
counts are recorded in EVALUATION.json. Scores were temperature-scaled on
|
| 57 |
+
validation and the uncertainty threshold was selected there. These model
|
| 58 |
+
scores need validation for additional populations and genres.
|
| 59 |
+
The temperature grid was fitted on the native validation outputs and chose
|
| 60 |
+
1.0, which leaves logits unchanged. The native validation outputs also chose
|
| 61 |
+
the 0.70 resolution threshold. The exported graph uses those same locked
|
| 62 |
+
settings; it has no separately fitted calibration. Its held-out Brier score
|
| 63 |
+
was 0.163, negative log likelihood
|
| 64 |
+
0.501 and 10-bin ECE
|
| 65 |
+
0.079. Its resolved coverage was
|
| 66 |
+
84.4%, with resolved macro-F1
|
| 67 |
+
0.818. These coverage figures are distinct from
|
| 68 |
+
full-cohort quality and are not model confidence guarantees.
|
| 69 |
+
|
| 70 |
+
## Data and interpretation
|
| 71 |
+
|
| 72 |
+
The benchmark contains human wording judgments from BABE. DOXA added no new
|
| 73 |
+
human annotations. It uses article URLs and exact/near-duplicate components
|
| 74 |
+
to separate roles. The same outlets can occur across roles. Source metadata
|
| 75 |
+
has known imperfections, including an upstream topic/link mismatch for case
|
| 76 |
+
`babe-sg2-00611`. This is an article-group evaluation within the collected
|
| 77 |
+
outlets, with those source limitations retained.
|
| 78 |
+
|
| 79 |
+
The input is the supplied sentence/passage text. Outlet, topic, source IDs,
|
| 80 |
+
annotators, reference labels and rationales stay outside the model input.
|
| 81 |
+
Additional document context has no supervised BABE wording label here.
|
| 82 |
+
English news is the evaluated genre. Academic papers, historical speech,
|
| 83 |
+
translation, other languages and different political settings require
|
| 84 |
+
separate validation. A wording flag can describe advocacy, criticism,
|
| 85 |
+
quotation or an allegation that is warranted in context.
|
| 86 |
+
|
| 87 |
+
No author ideology, prejudice category, factual-truth score or political
|
| 88 |
+
neutrality certification follows from this binary wording screen. Use the
|
| 89 |
+
other DOXA criteria and the original sources for their declared tasks.
|
| 90 |
+
Review disagreements and the ID-only error records before drawing a finding.
|
EVALUATION_AMENDMENT_1.md
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Contextual pipeline promotion gate
|
| 2 |
+
|
| 3 |
+
Amended before held-out evaluation on 28 November 2026 UTC. The first run
|
| 4 |
+
had reached frozen-encoder embedding preparation and was interrupted before
|
| 5 |
+
candidate fitting or test predictions. The original registration is retained.
|
| 6 |
+
|
| 7 |
+
The product question is whether a contextual classifier improves on the
|
| 8 |
+
deployed wording screen and lexical controls. A learned logistic head over
|
| 9 |
+
a frozen contextual encoder is itself a trained contextual classifier.
|
| 10 |
+
Requiring full encoder fine-tuning to outperform that classifier would
|
| 11 |
+
answer an additional research question and could prevent a useful model
|
| 12 |
+
upgrade from qualifying.
|
| 13 |
+
|
| 14 |
+
Select the best contextual pipeline using validation macro-F1 after the
|
| 15 |
+
registered searches. The choices are the frozen MiniLM mean-pooling plus
|
| 16 |
+
trained logistic head and the fully fine-tuned compact BERT classifier.
|
| 17 |
+
The promotion gate compares that selected pipeline with the strongest
|
| 18 |
+
noncontextual control, including all registered TF-IDF controls and the
|
| 19 |
+
current DOXA framing control. The minimum gain remains 0.02 macro-F1 with
|
| 20 |
+
a positive paired 95% article-group bootstrap interval. Quantized parity,
|
| 21 |
+
agreement and file-size gates are unchanged.
|
| 22 |
+
|
| 23 |
+
Report both contextual pipelines on the frozen test after selection.
|
| 24 |
+
Report fine-tuning's gain over the frozen encoder separately and state
|
| 25 |
+
which pipeline was selected. A frozen-encoder result carries an explicit
|
| 26 |
+
description of its trained head. It supplies no claim that full encoder
|
| 27 |
+
fine-tuning improved the result. Calibration and abstention remain fixed
|
| 28 |
+
by validation, and all failures remain in the evaluation record.
|
EVALUATION_REGISTRATION.md
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DOXA contextual wording experiment
|
| 2 |
+
|
| 3 |
+
Registered before fitting or evaluating the held-out test on 28 November 2026
|
| 4 |
+
UTC. Compute uses the local CPU with zero new spend. Training text stays in
|
| 5 |
+
the local benchmark cache. Published evaluation records use source IDs,
|
| 6 |
+
labels, scores and hashes where article-text redistribution is unresolved.
|
| 7 |
+
|
| 8 |
+
## Task and sources
|
| 9 |
+
|
| 10 |
+
The task is the BABE expert-majority biased-wording judgment. It concerns
|
| 11 |
+
sentence wording under the upstream annotation protocol. It establishes no
|
| 12 |
+
author ideology, group-prejudice diagnosis or political-neutrality finding.
|
| 13 |
+
Preserve the upstream source, revision, annotation provenance and ambiguous
|
| 14 |
+
labels according to the benchmark builder's documented admission rule.
|
| 15 |
+
|
| 16 |
+
The benchmark builder freezes article/source groups, exact repeated text and
|
| 17 |
+
train/validation/test assignments before model fitting. The model experiment
|
| 18 |
+
uses text only. Outlet, author, query, source identity, labels, split and
|
| 19 |
+
annotation rationale are excluded from inputs. The training code will log
|
| 20 |
+
the frozen benchmark fingerprints before fitting.
|
| 21 |
+
|
| 22 |
+
## Fixed candidates
|
| 23 |
+
|
| 24 |
+
- The current DOXA evaluative-framing head is a task-mismatch control.
|
| 25 |
+
Its present-versus-absent scores produce a binary comparison. Report its
|
| 26 |
+
original insufficient-context and abstention coverage separately.
|
| 27 |
+
- Word and character TF-IDF logistic controls choose C from 0.1, 1 and 10 on
|
| 28 |
+
the validation set. Fit all vocabulary and IDF values on training text.
|
| 29 |
+
- Frozen MiniLM mean-pooled embeddings plus a logistic head choose C from
|
| 30 |
+
0.1, 1 and 10 on validation. The base checkpoint is
|
| 31 |
+
`sentence-transformers/all-MiniLM-L6-v2` at
|
| 32 |
+
`1110a243fdf4706b3f48f1d95db1a4f5529b4d41`, licensed Apache-2.0.
|
| 33 |
+
- Fine-tune the same compact BERT encoder and classification head with
|
| 34 |
+
learning rates 0.00002 and 0.00005, up to three epochs each, AdamW,
|
| 35 |
+
batch size 16, maximum 256 tokens and seed 1729. Select the epoch and
|
| 36 |
+
learning rate using validation macro-F1. Temperature calibration and any
|
| 37 |
+
displayed uncertainty threshold use validation only.
|
| 38 |
+
|
| 39 |
+
Temperature is chosen from 0.5, 0.75, 1, 1.5, 2, 3 and 4 by validation
|
| 40 |
+
negative log likelihood. The uncertainty threshold is chosen from maximum
|
| 41 |
+
class scores 0.55, 0.60, 0.65, 0.70, 0.75, 0.80 and 0.85. Prefer the greatest
|
| 42 |
+
validation coverage among thresholds with at least 60% coverage and a
|
| 43 |
+
resolved macro-F1 gain of at least 0.03 over full-coverage macro-F1. If none
|
| 44 |
+
meets both conditions, use 0.65 and report its observed tradeoff. Displayed
|
| 45 |
+
numbers remain model scores, with the calibration method and errors visible.
|
| 46 |
+
|
| 47 |
+
The model task uses token context within the supplied sentence or passage.
|
| 48 |
+
Additional document context remains source material for reviewer reading.
|
| 49 |
+
The experiment makes no claim that arbitrary Methods and Results context
|
| 50 |
+
has supervised wording labels in BABE.
|
| 51 |
+
|
| 52 |
+
## Release gate
|
| 53 |
+
|
| 54 |
+
Evaluate the frozen selected candidate once on the test set and report all
|
| 55 |
+
controls. Publish a qualified wording candidate only if its macro-F1 exceeds
|
| 56 |
+
the strongest control by at least 0.02 and the paired 95% article-group
|
| 57 |
+
bootstrap interval for the gain is above zero. Use 2,000 bootstrap draws
|
| 58 |
+
with seed 1729. Preserve per-case ID predictions and observed errors.
|
| 59 |
+
|
| 60 |
+
Export the candidate as native Transformers weights and quantized ONNX.
|
| 61 |
+
Quantized held-out macro-F1 must stay within 0.01 of the native candidate,
|
| 62 |
+
and native-versus-quantized class agreement must be at least 98%. Record
|
| 63 |
+
browser/native parity checks and the file sizes. The browser weights target
|
| 64 |
+
is below 40 MB. A failed gate remains a documented local experiment.
|
| 65 |
+
|
| 66 |
+
Matched political-name/viewpoint fixtures, legitimate-criticism controls and
|
| 67 |
+
mitigation tests are separate diagnostics with their actual annotation
|
| 68 |
+
provenance. Report symmetry differences and false alarms without converting
|
| 69 |
+
those engineered cases into an independent human benchmark.
|
EXPORT_ATTEMPTS.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"failed_initial_exports": [
|
| 3 |
+
{
|
| 4 |
+
"name": "matrix_only_default",
|
| 5 |
+
"quantized": {
|
| 6 |
+
"rows": 384,
|
| 7 |
+
"macro_f1": 0.757810857549761,
|
| 8 |
+
"accuracy": 0.7578125,
|
| 9 |
+
"per_class_f1": {
|
| 10 |
+
"no_biased_wording": 0.7584415584415585,
|
| 11 |
+
"biased_wording": 0.7571801566579635
|
| 12 |
+
},
|
| 13 |
+
"brier": 0.16673652657150886,
|
| 14 |
+
"negative_log_likelihood": 0.5064179299554743,
|
| 15 |
+
"ece_10_bins": 0.06994695107763012
|
| 16 |
+
},
|
| 17 |
+
"native_quantized_agreement": 0.9427083333333334,
|
| 18 |
+
"bytes": 58803630,
|
| 19 |
+
"sha256": "c9778d97fdfeb5b52660f1ff34cd5837af9041d82648a755d800143b9fb2ce45",
|
| 20 |
+
"release_gate": {
|
| 21 |
+
"native": true,
|
| 22 |
+
"quantized": false,
|
| 23 |
+
"size": false,
|
| 24 |
+
"passed": false
|
| 25 |
+
}
|
| 26 |
+
},
|
| 27 |
+
{
|
| 28 |
+
"name": "matrix_gather_default",
|
| 29 |
+
"quantized": {
|
| 30 |
+
"rows": 384,
|
| 31 |
+
"macro_f1": 0.765625,
|
| 32 |
+
"accuracy": 0.765625,
|
| 33 |
+
"per_class_f1": {
|
| 34 |
+
"no_biased_wording": 0.765625,
|
| 35 |
+
"biased_wording": 0.765625
|
| 36 |
+
},
|
| 37 |
+
"brier": 0.16431202011597804,
|
| 38 |
+
"negative_log_likelihood": 0.500860547963728,
|
| 39 |
+
"ece_10_bins": 0.06312208312253155
|
| 40 |
+
},
|
| 41 |
+
"native_quantized_agreement": 0.9505208333333334,
|
| 42 |
+
"bytes": 23051770,
|
| 43 |
+
"sha256": "d3a3f3fdfc2a9ea00cdf925e4d89b56026334bb9342947f988f701d1479cb4e8",
|
| 44 |
+
"release_gate": {
|
| 45 |
+
"native": true,
|
| 46 |
+
"quantized": false,
|
| 47 |
+
"size": true,
|
| 48 |
+
"passed": false
|
| 49 |
+
}
|
| 50 |
+
}
|
| 51 |
+
],
|
| 52 |
+
"final_selected_representation": "per_channel_1-reduce_range_1",
|
| 53 |
+
"training_or_checkpoint_changed": false
|
| 54 |
+
}
|
EXPORT_PLAN.md
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Quantized runtime export
|
| 2 |
+
|
| 3 |
+
Recorded before held-out evaluation while the fine-tuning grid is running.
|
| 4 |
+
The selected training pipeline and all quality thresholds remain governed
|
| 5 |
+
by the evaluation registration and its first amendment.
|
| 6 |
+
|
| 7 |
+
The compact encoder has 22,713,986 parameters. Its vocabulary embedding
|
| 8 |
+
table contains about 11.7 million float weights, so quantizing matrix
|
| 9 |
+
multiplications alone leaves roughly 47 MB in embeddings. Quantize the
|
| 10 |
+
embedding Gather weights together with MatMul and Gemm weights using ONNX
|
| 11 |
+
Runtime dynamic QInt8. The graph uses standard ONNX operators.
|
| 12 |
+
|
| 13 |
+
Check the resulting model against the selected native classifier on the
|
| 14 |
+
frozen test. Preserve its exact agreement, macro-F1, file hash and size.
|
| 15 |
+
The final browser export must satisfy the registered parity thresholds.
|
| 16 |
+
Report any initial export failure and retain it locally for diagnosis.
|
| 17 |
+
No training parameters or checkpoint selection use these export checks.
|
EXPORT_REPAIR.md
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Export fidelity repair
|
| 2 |
+
|
| 3 |
+
The locked native classifier passed the model-quality gate. The first
|
| 4 |
+
matrix-only QInt8 export failed size and native-decision parity. Adding the
|
| 5 |
+
embedding Gather quantization met size but still failed decision parity.
|
| 6 |
+
Both receipts and graph hashes are retained. Training, model selection,
|
| 7 |
+
temperature and uncertainty threshold remain locked.
|
| 8 |
+
|
| 9 |
+
The following bounded exporter comparison is recorded after those native
|
| 10 |
+
and initial-export held-out measurements and before its validation results.
|
| 11 |
+
It is runtime engineering, not a second unseen model-quality experiment.
|
| 12 |
+
Use validation passages only to select the exported representation:
|
| 13 |
+
|
| 14 |
+
- ONNX Runtime dynamic QInt8 MatMul/Gemm/Gather quantization, with each
|
| 15 |
+
combination of per_channel false/true and reduce_range false/true.
|
| 16 |
+
- Score each validation passage separately, matching the browser's single
|
| 17 |
+
passage input. Also retain the batch-of-16 result to detect batch-sensitive
|
| 18 |
+
activation quantization. Native float inference is the reference.
|
| 19 |
+
- An export is eligible only if native class agreement is at least 0.98,
|
| 20 |
+
macro-F1 differs by at most 0.01, and weights occupy fewer than 40,000,000
|
| 21 |
+
bytes. Among eligible exports, choose highest native agreement, then
|
| 22 |
+
lowest mean probability error, then smallest size.
|
| 23 |
+
- If no export qualifies, stop this comparison and retain the model as
|
| 24 |
+
withheld. The existing registered release gates remain unchanged.
|
| 25 |
+
|
| 26 |
+
After this validation-only selection, evaluate the chosen representation
|
| 27 |
+
once on the fixed held-out cohort using singleton inputs and check browser
|
| 28 |
+
parity. Retain every exporter setting and its validation result. Report that
|
| 29 |
+
export repair followed initial held-out measurement; do not describe its
|
| 30 |
+
engineering process as an untouched held-out model search. No training or
|
| 31 |
+
checkpoint choices use held-out errors.
|
EXPORT_VALIDATION.json
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"repair_plan_sha256": "c750910939855b368a842e2ea980110b70cffbecadfc5ba227d53864bedde168",
|
| 3 |
+
"validation_sha256": "a2e9c240e3c35e6e80a8ff137d2b51b5c25abb2ecd221cc000492443dd7d7867",
|
| 4 |
+
"native_validation": {
|
| 5 |
+
"rows": 305,
|
| 6 |
+
"macro_f1": 0.8229336888277285,
|
| 7 |
+
"accuracy": 0.8229508196721311,
|
| 8 |
+
"per_class_f1": {
|
| 9 |
+
"no_biased_wording": 0.8211920529801324,
|
| 10 |
+
"biased_wording": 0.8246753246753247
|
| 11 |
+
}
|
| 12 |
+
},
|
| 13 |
+
"results": [
|
| 14 |
+
{
|
| 15 |
+
"name": "per_channel_0-reduce_range_0",
|
| 16 |
+
"per_channel": false,
|
| 17 |
+
"reduce_range": false,
|
| 18 |
+
"validation": {
|
| 19 |
+
"rows": 305,
|
| 20 |
+
"macro_f1": 0.8029206513310934,
|
| 21 |
+
"accuracy": 0.8032786885245902,
|
| 22 |
+
"per_class_f1": {
|
| 23 |
+
"no_biased_wording": 0.7945205479452054,
|
| 24 |
+
"biased_wording": 0.8113207547169812
|
| 25 |
+
}
|
| 26 |
+
},
|
| 27 |
+
"native_agreement": 0.9475409836065574,
|
| 28 |
+
"probability_mae": 0.039659783244132996,
|
| 29 |
+
"batch_16_native_agreement": 0.9540983606557377,
|
| 30 |
+
"singleton_batch16_agreement": 0.980327868852459,
|
| 31 |
+
"bytes": 23051770,
|
| 32 |
+
"sha256": "d3a3f3fdfc2a9ea00cdf925e4d89b56026334bb9342947f988f701d1479cb4e8",
|
| 33 |
+
"eligible": false
|
| 34 |
+
},
|
| 35 |
+
{
|
| 36 |
+
"name": "per_channel_0-reduce_range_1",
|
| 37 |
+
"per_channel": false,
|
| 38 |
+
"reduce_range": true,
|
| 39 |
+
"validation": {
|
| 40 |
+
"rows": 305,
|
| 41 |
+
"macro_f1": 0.79992257148695,
|
| 42 |
+
"accuracy": 0.8,
|
| 43 |
+
"per_class_f1": {
|
| 44 |
+
"no_biased_wording": 0.7959866220735786,
|
| 45 |
+
"biased_wording": 0.8038585209003215
|
| 46 |
+
}
|
| 47 |
+
},
|
| 48 |
+
"native_agreement": 0.9049180327868852,
|
| 49 |
+
"probability_mae": 0.07955271005630493,
|
| 50 |
+
"batch_16_native_agreement": 0.8950819672131147,
|
| 51 |
+
"singleton_batch16_agreement": 0.9770491803278688,
|
| 52 |
+
"bytes": 23051770,
|
| 53 |
+
"sha256": "3e14c7b1d558aaee382e3196895eb7e68867025e3c1b1701b6d3a9f5e039c5f7",
|
| 54 |
+
"eligible": false
|
| 55 |
+
},
|
| 56 |
+
{
|
| 57 |
+
"name": "per_channel_1-reduce_range_0",
|
| 58 |
+
"per_channel": true,
|
| 59 |
+
"reduce_range": false,
|
| 60 |
+
"validation": {
|
| 61 |
+
"rows": 305,
|
| 62 |
+
"macro_f1": 0.8098340213278294,
|
| 63 |
+
"accuracy": 0.8098360655737705,
|
| 64 |
+
"per_class_f1": {
|
| 65 |
+
"no_biased_wording": 0.8104575163398693,
|
| 66 |
+
"biased_wording": 0.8092105263157895
|
| 67 |
+
}
|
| 68 |
+
},
|
| 69 |
+
"native_agreement": 0.980327868852459,
|
| 70 |
+
"probability_mae": 0.014535539783537388,
|
| 71 |
+
"batch_16_native_agreement": 0.9737704918032787,
|
| 72 |
+
"singleton_batch16_agreement": 0.9672131147540983,
|
| 73 |
+
"bytes": 23157564,
|
| 74 |
+
"sha256": "9d3835b9ef7d1fc0059c7365f7315f313690eb698e9fe86ddd02950145d30971",
|
| 75 |
+
"eligible": false
|
| 76 |
+
},
|
| 77 |
+
{
|
| 78 |
+
"name": "per_channel_1-reduce_range_1",
|
| 79 |
+
"per_channel": true,
|
| 80 |
+
"reduce_range": true,
|
| 81 |
+
"validation": {
|
| 82 |
+
"rows": 305,
|
| 83 |
+
"macro_f1": 0.8131067178379077,
|
| 84 |
+
"accuracy": 0.8131147540983606,
|
| 85 |
+
"per_class_f1": {
|
| 86 |
+
"no_biased_wording": 0.8118811881188119,
|
| 87 |
+
"biased_wording": 0.8143322475570033
|
| 88 |
+
}
|
| 89 |
+
},
|
| 90 |
+
"native_agreement": 0.9836065573770492,
|
| 91 |
+
"probability_mae": 0.014533568173646927,
|
| 92 |
+
"batch_16_native_agreement": 0.9836065573770492,
|
| 93 |
+
"singleton_batch16_agreement": 0.9868852459016394,
|
| 94 |
+
"bytes": 23157564,
|
| 95 |
+
"sha256": "cb6dd5d63b6ed2f28c142141c263e3a29deb88289ad4dab50f7584a7c7b27d48",
|
| 96 |
+
"eligible": true
|
| 97 |
+
}
|
| 98 |
+
],
|
| 99 |
+
"selected": {
|
| 100 |
+
"name": "per_channel_1-reduce_range_1",
|
| 101 |
+
"per_channel": true,
|
| 102 |
+
"reduce_range": true,
|
| 103 |
+
"validation": {
|
| 104 |
+
"rows": 305,
|
| 105 |
+
"macro_f1": 0.8131067178379077,
|
| 106 |
+
"accuracy": 0.8131147540983606,
|
| 107 |
+
"per_class_f1": {
|
| 108 |
+
"no_biased_wording": 0.8118811881188119,
|
| 109 |
+
"biased_wording": 0.8143322475570033
|
| 110 |
+
}
|
| 111 |
+
},
|
| 112 |
+
"native_agreement": 0.9836065573770492,
|
| 113 |
+
"probability_mae": 0.014533568173646927,
|
| 114 |
+
"batch_16_native_agreement": 0.9836065573770492,
|
| 115 |
+
"singleton_batch16_agreement": 0.9868852459016394,
|
| 116 |
+
"bytes": 23157564,
|
| 117 |
+
"sha256": "cb6dd5d63b6ed2f28c142141c263e3a29deb88289ad4dab50f7584a7c7b27d48",
|
| 118 |
+
"eligible": true
|
| 119 |
+
},
|
| 120 |
+
"test_used_for_export_selection": false,
|
| 121 |
+
"training_changed": false
|
| 122 |
+
}
|
INDEPENDENT_GATE.json
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"revision": "doxa-independent-wording-model-gate-v0.1.0",
|
| 3 |
+
"integrity_passed": true,
|
| 4 |
+
"qualification_gate": {
|
| 5 |
+
"native": true,
|
| 6 |
+
"quantized": true,
|
| 7 |
+
"size": true,
|
| 8 |
+
"passed": true
|
| 9 |
+
},
|
| 10 |
+
"test_cases": 384,
|
| 11 |
+
"provided_source_groups": 227,
|
| 12 |
+
"selected_pipeline": "fine_tuned_encoder",
|
| 13 |
+
"candidate_macro_f1": 0.7886482703323435,
|
| 14 |
+
"controls_macro_f1": {
|
| 15 |
+
"word_tfidf": 0.7159898218829517,
|
| 16 |
+
"character_tfidf": 0.7419757695048699,
|
| 17 |
+
"word_character_tfidf": 0.7238384715588363,
|
| 18 |
+
"frozen_encoder_logistic": 0.7445421961550993,
|
| 19 |
+
"doxa_framing_control": 0.4977164278354659
|
| 20 |
+
},
|
| 21 |
+
"contextual_pipelines_macro_f1": {
|
| 22 |
+
"fine_tuned_encoder": 0.7886482703323435,
|
| 23 |
+
"frozen_encoder_logistic": 0.7445421961550993
|
| 24 |
+
},
|
| 25 |
+
"fine_tuning_gain_over_frozen": 0.044106074177244214,
|
| 26 |
+
"strongest_amended_gate_control": "character_tfidf",
|
| 27 |
+
"macro_f1_gain": 0.04667250082747365,
|
| 28 |
+
"paired_group_bootstrap_interval_95": [
|
| 29 |
+
0.0027218200550942345,
|
| 30 |
+
0.09238916178767137
|
| 31 |
+
],
|
| 32 |
+
"bootstrap_draws": 2000,
|
| 33 |
+
"bootstrap_seed": 1729,
|
| 34 |
+
"quantized_macro_f1": 0.7835238502760967,
|
| 35 |
+
"native_quantized_agreement": 0.9895833333333334,
|
| 36 |
+
"quantized_macro_f1_gain": 0.04154808077122685,
|
| 37 |
+
"quantized_gain_interval_95": [
|
| 38 |
+
-0.0043714321046402155,
|
| 39 |
+
0.08853098281291114
|
| 40 |
+
],
|
| 41 |
+
"quantized_positive_gain_interval": false,
|
| 42 |
+
"quantized_bytes": 23157564,
|
| 43 |
+
"resolved_coverage": 0.828125,
|
| 44 |
+
"validation_selected_temperature": 1.0,
|
| 45 |
+
"validation_selected_threshold": 0.7,
|
| 46 |
+
"reference_label_counts": {
|
| 47 |
+
"1": 188,
|
| 48 |
+
"0": 196
|
| 49 |
+
},
|
| 50 |
+
"test_predictions_sha256": "7d93e95a031b67a588b7cb2a0bfd214754e6e11ff26e7a079d9ab5268b0b9a99",
|
| 51 |
+
"evaluation_sha256": "e298f9202485b61fdde484be745f0a8fd27a9b64d09c0356554fda05a8e42b56",
|
| 52 |
+
"independent_pretest_record_sha256": "0820c2175c9948044d4e02709adad182396bc8bcee15ab730fc3120bc1959a18",
|
| 53 |
+
"scope": "Frozen BABE human-majority sentence-wording task under the retained pre-test gate amendment. Canonical source URLs are upstream-provided identities with a known mismatch; article boundaries are not independently verified. No author-ideology, whole-document bias or political-neutrality qualification.",
|
| 54 |
+
"errors": []
|
| 55 |
+
}
|
LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
Apache License
|
| 3 |
+
Version 2.0, January 2004
|
| 4 |
+
http://www.apache.org/licenses/
|
| 5 |
+
|
| 6 |
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
| 7 |
+
|
| 8 |
+
1. Definitions.
|
| 9 |
+
|
| 10 |
+
"License" shall mean the terms and conditions for use, reproduction,
|
| 11 |
+
and distribution as defined by Sections 1 through 9 of this document.
|
| 12 |
+
|
| 13 |
+
"Licensor" shall mean the copyright owner or entity authorized by
|
| 14 |
+
the copyright owner that is granting the License.
|
| 15 |
+
|
| 16 |
+
"Legal Entity" shall mean the union of the acting entity and all
|
| 17 |
+
other entities that control, are controlled by, or are under common
|
| 18 |
+
control with that entity. For the purposes of this definition,
|
| 19 |
+
"control" means (i) the power, direct or indirect, to cause the
|
| 20 |
+
direction or management of such entity, whether by contract or
|
| 21 |
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
| 22 |
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
| 23 |
+
|
| 24 |
+
"You" (or "Your") shall mean an individual or Legal Entity
|
| 25 |
+
exercising permissions granted by this License.
|
| 26 |
+
|
| 27 |
+
"Source" form shall mean the preferred form for making modifications,
|
| 28 |
+
including but not limited to software source code, documentation
|
| 29 |
+
source, and configuration files.
|
| 30 |
+
|
| 31 |
+
"Object" form shall mean any form resulting from mechanical
|
| 32 |
+
transformation or translation of a Source form, including but
|
| 33 |
+
not limited to compiled object code, generated documentation,
|
| 34 |
+
and conversions to other media types.
|
| 35 |
+
|
| 36 |
+
"Work" shall mean the work of authorship, whether in Source or
|
| 37 |
+
Object form, made available under the License, as indicated by a
|
| 38 |
+
copyright notice that is included in or attached to the work
|
| 39 |
+
(an example is provided in the Appendix below).
|
| 40 |
+
|
| 41 |
+
"Derivative Works" shall mean any work, whether in Source or Object
|
| 42 |
+
form, that is based on (or derived from) the Work and for which the
|
| 43 |
+
editorial revisions, annotations, elaborations, or other modifications
|
| 44 |
+
represent, as a whole, an original work of authorship. For the purposes
|
| 45 |
+
of this License, Derivative Works shall not include works that remain
|
| 46 |
+
separable from, or merely link (or bind by name) to the interfaces of,
|
| 47 |
+
the Work and Derivative Works thereof.
|
| 48 |
+
|
| 49 |
+
"Contribution" shall mean any work of authorship, including
|
| 50 |
+
the original version of the Work and any modifications or additions
|
| 51 |
+
to that Work or Derivative Works thereof, that is intentionally
|
| 52 |
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
| 53 |
+
or by an individual or Legal Entity authorized to submit on behalf of
|
| 54 |
+
the copyright owner. For the purposes of this definition, "submitted"
|
| 55 |
+
means any form of electronic, verbal, or written communication sent
|
| 56 |
+
to the Licensor or its representatives, including but not limited to
|
| 57 |
+
communication on electronic mailing lists, source code control systems,
|
| 58 |
+
and issue tracking systems that are managed by, or on behalf of, the
|
| 59 |
+
Licensor for the purpose of discussing and improving the Work, but
|
| 60 |
+
excluding communication that is conspicuously marked or otherwise
|
| 61 |
+
designated in writing by the copyright owner as "Not a Contribution."
|
| 62 |
+
|
| 63 |
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
| 64 |
+
on behalf of whom a Contribution has been received by Licensor and
|
| 65 |
+
subsequently incorporated within the Work.
|
| 66 |
+
|
| 67 |
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
| 68 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 69 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 70 |
+
copyright license to reproduce, prepare Derivative Works of,
|
| 71 |
+
publicly display, publicly perform, sublicense, and distribute the
|
| 72 |
+
Work and such Derivative Works in Source or Object form.
|
| 73 |
+
|
| 74 |
+
3. Grant of Patent License. Subject to the terms and conditions of
|
| 75 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 76 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 77 |
+
(except as stated in this section) patent license to make, have made,
|
| 78 |
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
| 79 |
+
where such license applies only to those patent claims licensable
|
| 80 |
+
by such Contributor that are necessarily infringed by their
|
| 81 |
+
Contribution(s) alone or by combination of their Contribution(s)
|
| 82 |
+
with the Work to which such Contribution(s) was submitted. If You
|
| 83 |
+
institute patent litigation against any entity (including a
|
| 84 |
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
| 85 |
+
or a Contribution incorporated within the Work constitutes direct
|
| 86 |
+
or contributory patent infringement, then any patent licenses
|
| 87 |
+
granted to You under this License for that Work shall terminate
|
| 88 |
+
as of the date such litigation is filed.
|
| 89 |
+
|
| 90 |
+
4. Redistribution. You may reproduce and distribute copies of the
|
| 91 |
+
Work or Derivative Works thereof in any medium, with or without
|
| 92 |
+
modifications, and in Source or Object form, provided that You
|
| 93 |
+
meet the following conditions:
|
| 94 |
+
|
| 95 |
+
(a) You must give any other recipients of the Work or
|
| 96 |
+
Derivative Works a copy of this License; and
|
| 97 |
+
|
| 98 |
+
(b) You must cause any modified files to carry prominent notices
|
| 99 |
+
stating that You changed the files; and
|
| 100 |
+
|
| 101 |
+
(c) You must retain, in the Source form of any Derivative Works
|
| 102 |
+
that You distribute, all copyright, patent, trademark, and
|
| 103 |
+
attribution notices from the Source form of the Work,
|
| 104 |
+
excluding those notices that do not pertain to any part of
|
| 105 |
+
the Derivative Works; and
|
| 106 |
+
|
| 107 |
+
(d) If the Work includes a "NOTICE" text file as part of its
|
| 108 |
+
distribution, then any Derivative Works that You distribute must
|
| 109 |
+
include a readable copy of the attribution notices contained
|
| 110 |
+
within such NOTICE file, excluding those notices that do not
|
| 111 |
+
pertain to any part of the Derivative Works, in at least one
|
| 112 |
+
of the following places: within a NOTICE text file distributed
|
| 113 |
+
as part of the Derivative Works; within the Source form or
|
| 114 |
+
documentation, if provided along with the Derivative Works; or,
|
| 115 |
+
within a display generated by the Derivative Works, if and
|
| 116 |
+
wherever such third-party notices normally appear. The contents
|
| 117 |
+
of the NOTICE file are for informational purposes only and
|
| 118 |
+
do not modify the License. You may add Your own attribution
|
| 119 |
+
notices within Derivative Works that You distribute, alongside
|
| 120 |
+
or as an addendum to the NOTICE text from the Work, provided
|
| 121 |
+
that such additional attribution notices cannot be construed
|
| 122 |
+
as modifying the License.
|
| 123 |
+
|
| 124 |
+
You may add Your own copyright statement to Your modifications and
|
| 125 |
+
may provide additional or different license terms and conditions
|
| 126 |
+
for use, reproduction, or distribution of Your modifications, or
|
| 127 |
+
for any such Derivative Works as a whole, provided Your use,
|
| 128 |
+
reproduction, and distribution of the Work otherwise complies with
|
| 129 |
+
the conditions stated in this License.
|
| 130 |
+
|
| 131 |
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
| 132 |
+
any Contribution intentionally submitted for inclusion in the Work
|
| 133 |
+
by You to the Licensor shall be under the terms and conditions of
|
| 134 |
+
this License, without any additional terms or conditions.
|
| 135 |
+
Notwithstanding the above, nothing herein shall supersede or modify
|
| 136 |
+
the terms of any separate license agreement you may have executed
|
| 137 |
+
with Licensor regarding such Contributions.
|
| 138 |
+
|
| 139 |
+
6. Trademarks. This License does not grant permission to use the trade
|
| 140 |
+
names, trademarks, service marks, or product names of the Licensor,
|
| 141 |
+
except as required for reasonable and customary use in describing the
|
| 142 |
+
origin of the Work and reproducing the content of the NOTICE file.
|
| 143 |
+
|
| 144 |
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
| 145 |
+
agreed to in writing, Licensor provides the Work (and each
|
| 146 |
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
| 147 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
| 148 |
+
implied, including, without limitation, any warranties or conditions
|
| 149 |
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
| 150 |
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
| 151 |
+
appropriateness of using or redistributing the Work and assume any
|
| 152 |
+
risks associated with Your exercise of permissions under this License.
|
| 153 |
+
|
| 154 |
+
8. Limitation of Liability. In no event and under no legal theory,
|
| 155 |
+
whether in tort (including negligence), contract, or otherwise,
|
| 156 |
+
unless required by applicable law (such as deliberate and grossly
|
| 157 |
+
negligent acts) or agreed to in writing, shall any Contributor be
|
| 158 |
+
liable to You for damages, including any direct, indirect, special,
|
| 159 |
+
incidental, or consequential damages of any character arising as a
|
| 160 |
+
result of this License or out of the use or inability to use the
|
| 161 |
+
Work (including but not limited to damages for loss of goodwill,
|
| 162 |
+
work stoppage, computer failure or malfunction, or any and all
|
| 163 |
+
other commercial damages or losses), even if such Contributor
|
| 164 |
+
has been advised of the possibility of such damages.
|
| 165 |
+
|
| 166 |
+
9. Accepting Warranty or Additional Liability. While redistributing
|
| 167 |
+
the Work or Derivative Works thereof, You may choose to offer,
|
| 168 |
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
| 169 |
+
or other liability obligations and/or rights consistent with this
|
| 170 |
+
License. However, in accepting such obligations, You may act only
|
| 171 |
+
on Your own behalf and on Your sole responsibility, not on behalf
|
| 172 |
+
of any other Contributor, and only if You agree to indemnify,
|
| 173 |
+
defend, and hold each Contributor harmless for any liability
|
| 174 |
+
incurred by, or claims asserted against, such Contributor by reason
|
| 175 |
+
of your accepting any such warranty or additional liability.
|
| 176 |
+
|
| 177 |
+
END OF TERMS AND CONDITIONS
|
| 178 |
+
|
| 179 |
+
APPENDIX: How to apply the Apache License to your work.
|
| 180 |
+
|
| 181 |
+
To apply the Apache License to your work, attach the following
|
| 182 |
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
| 183 |
+
replaced with your own identifying information. (Don't include
|
| 184 |
+
the brackets!) The text should be enclosed in the appropriate
|
| 185 |
+
comment syntax for the file format. We also recommend that a
|
| 186 |
+
file or class name and description of purpose be included on the
|
| 187 |
+
same "printed page" as the copyright notice for easier
|
| 188 |
+
identification within third-party archives.
|
| 189 |
+
|
| 190 |
+
Copyright [yyyy] [name of copyright owner]
|
| 191 |
+
|
| 192 |
+
Licensed under the Apache License, Version 2.0 (the "License");
|
| 193 |
+
you may not use this file except in compliance with the License.
|
| 194 |
+
You may obtain a copy of the License at
|
| 195 |
+
|
| 196 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
| 197 |
+
|
| 198 |
+
Unless required by applicable law or agreed to in writing, software
|
| 199 |
+
distributed under the License is distributed on an "AS IS" BASIS,
|
| 200 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 201 |
+
See the License for the specific language governing permissions and
|
| 202 |
+
limitations under the License.
|
NOTICE
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
DOXA contextual wording experiment
|
| 2 |
+
|
| 3 |
+
The encoder and tokenizer derive from sentence-transformers/all-MiniLM-L6-v2
|
| 4 |
+
at revision 1110a243fdf4706b3f48f1d95db1a4f5529b4d41. The source model card
|
| 5 |
+
declares Apache License 2.0. Original MiniLM and sentence-transformers
|
| 6 |
+
attribution remains applicable.
|
| 7 |
+
|
| 8 |
+
The learning task uses BABE expert-majority wording annotations from
|
| 9 |
+
Media-Bias-Group/Neural-Media-Bias-Detection-Using-Distant-Supervision-With-BABE
|
| 10 |
+
at revision fb79f646dcabf1746f5ebedc06ed8dd61ba78188.
|
| 11 |
+
The source repository's license and the underlying news text's rights are
|
| 12 |
+
recorded in the linked benchmark. Article text is absent from the public
|
| 13 |
+
model package. Public predictions identify benchmark IDs and source groups.
|
| 14 |
+
|
| 15 |
+
The training, evaluation and browser integration code written for this
|
| 16 |
+
experiment is original DOXA project code. Model cards must retain the task
|
| 17 |
+
scope, data provenance, uncertainty and evaluation limitations.
|
README.md
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language: en
|
| 3 |
+
license: apache-2.0
|
| 4 |
+
library_name: transformers
|
| 5 |
+
pipeline_tag: text-classification
|
| 6 |
+
base_model: sentence-transformers/all-MiniLM-L6-v2
|
| 7 |
+
datasets:
|
| 8 |
+
- Giuliocc/doxa-wording-benchmark
|
| 9 |
+
tags:
|
| 10 |
+
- political-discourse
|
| 11 |
+
- media-bias
|
| 12 |
+
- wording
|
| 13 |
+
- onnx
|
| 14 |
+
- contextual-review
|
| 15 |
+
---
|
| 16 |
+
|
| 17 |
+
# DOXA contextual wording encoder
|
| 18 |
+
|
| 19 |
+
Check wording in a supplied English passage with a compact contextual model,
|
| 20 |
+
then read the speaker, evidence and surrounding context. The selected model
|
| 21 |
+
uses full encoder and classification head fine-tuning. Its original source task is BABE's expert-majority word-choice
|
| 22 |
+
bias judgment. It returns a wording flag, no wording flag or an unresolved
|
| 23 |
+
result under the published uncertainty threshold.
|
| 24 |
+
|
| 25 |
+
[Use DOXA](https://doxa.tacitus.me/) · [TACITUS](https://tacitus.me/doxa/)
|
| 26 |
+
· [GitHub](https://github.com/sargonxg/DOXA-by-TACITUS)
|
| 27 |
+
· [Benchmark](https://huggingface.co/datasets/Giuliocc/doxa-wording-benchmark)
|
| 28 |
+
· [Evaluation and limits](EVALUATION.md)
|
| 29 |
+
|
| 30 |
+
The selected native pipeline reached **0.789 macro-F1**
|
| 31 |
+
on 384 judgments from held-out source groups. Its gain over the strongest lexical
|
| 32 |
+
or current DOXA control was 0.047, with paired
|
| 33 |
+
95% group-bootstrap interval [0.003, 0.092]. The
|
| 34 |
+
quantized model reached 0.784. Inspect the complete
|
| 35 |
+
control table, failures and coverage in the evaluation report.
|
| 36 |
+
The quantized export's own 95% gain interval includes zero; its point gain
|
| 37 |
+
and native-model parity support a provisional wording screen, with further
|
| 38 |
+
independent evaluation needed.
|
| 39 |
+
|
| 40 |
+
## Local inference
|
| 41 |
+
|
| 42 |
+
The browser uses the checked quantized ONNX graph and tokenizer, totaling
|
| 43 |
+
about 23.2 MB of model weights.
|
| 44 |
+
Inference runs locally after the public asset download. The Python
|
| 45 |
+
`inference.py` helper uses ONNX Runtime and the published runtime manifest.
|
| 46 |
+
The native Transformer head returns two class logits. The helper and browser
|
| 47 |
+
apply the validation temperature and uncertainty threshold, and retain input
|
| 48 |
+
limits in their structured result.
|
| 49 |
+
|
| 50 |
+
```python
|
| 51 |
+
from inference import WordingModel
|
| 52 |
+
model = WordingModel("path/to/downloaded/model")
|
| 53 |
+
result = model.check("The committee voted six to four to approve the policy.")
|
| 54 |
+
print(result)
|
| 55 |
+
```
|
| 56 |
+
|
| 57 |
+
`model_score` is the positive wording class's score after validation
|
| 58 |
+
temperature scaling. The output records that calibration method, resolution
|
| 59 |
+
threshold and actual token count. Input longer than 256 tokens is unresolved.
|
| 60 |
+
Long documents require passage selection and source context, as in DOXA Lab.
|
| 61 |
+
The [fictional illustrations](illustrations.json) contain actual outputs and
|
| 62 |
+
retain their authored provenance.
|
| 63 |
+
|
| 64 |
+
## Training and source provenance
|
| 65 |
+
|
| 66 |
+
The benchmark's 3,639 admitted judgments retain original expert votes,
|
| 67 |
+
strict majority admission and source-group roles. Article text was restored
|
| 68 |
+
locally from the pinned upstream source for training. Public model artifacts
|
| 69 |
+
contain IDs and predictions in place of article excerpts. The original
|
| 70 |
+
source's licenses and article rights are documented by the benchmark.
|
| 71 |
+
|
| 72 |
+
The base encoder is pinned at
|
| 73 |
+
`1110a243fdf4706b3f48f1d95db1a4f5529b4d41` under Apache-2.0. Training used
|
| 74 |
+
local CPU compute, seed 1729 and zero new spend. The registration, amendment,
|
| 75 |
+
export plan, training history and code are included. Reproduction needs the
|
| 76 |
+
DOXA project source, the benchmark restoration recipe and the pinned Python
|
| 77 |
+
dependencies. Keep restored article text in the local benchmark workspace.
|
| 78 |
+
See [REPRODUCE.md](REPRODUCE.md) for the complete experiment and export steps.
|
| 79 |
+
The public benchmark release is pinned at
|
| 80 |
+
`bea9a3f2d53b03069b0d814094ea860d75f1c322` (tag `v0.1.0`).
|
| 81 |
+
|
| 82 |
+
The admitted split contains 2,950 training, 305 validation and 384 held-out
|
| 83 |
+
judgments. Fixed search used learning rates 2e-5 and 5e-5, three epochs
|
| 84 |
+
each, AdamW, balanced cross entropy and 256-token input. Validation selected
|
| 85 |
+
learning rate 5e-5 at epoch 2. Candidate and frozen controls use the passage
|
| 86 |
+
text alone; annotator votes, source, outlet and topic stay outside features.
|
| 87 |
+
|
| 88 |
+
## Scope
|
| 89 |
+
|
| 90 |
+
This is a provisional wording screen for contextual review. Its evaluated
|
| 91 |
+
genre is sampled English news. Academic papers and other domains need
|
| 92 |
+
separate validation. A positive wording judgment can occur in legitimate
|
| 93 |
+
criticism, declared advocacy or attributed speech. Read the original source
|
| 94 |
+
and preserve supported political meaning when considering a revision.
|
| 95 |
+
|
| 96 |
+
The current dataset supports a binary wording task. Other prejudice,
|
| 97 |
+
research-validity and comparative-bias questions need their own evidence
|
| 98 |
+
and labels. The same news outlets can occur in training and test roles, and
|
| 99 |
+
known source-URL imperfections remain documented. Additional independent
|
| 100 |
+
evaluation is needed before broad service-quality claims.
|
REPRODUCE.md
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Reproduce the wording release
|
| 2 |
+
|
| 3 |
+
Use the complete [DOXA project](https://github.com/sargonxg/DOXA-by-TACITUS),
|
| 4 |
+
Python 3.12 and CPU compute. The release was built locally with three CPU
|
| 5 |
+
threads. It launched no paid service or training job.
|
| 6 |
+
|
| 7 |
+
Restore the pinned BABE inputs using the public benchmark recipe at
|
| 8 |
+
`Giuliocc/doxa-wording-benchmark` revision
|
| 9 |
+
`bea9a3f2d53b03069b0d814094ea860d75f1c322`. Keep restored article passages in
|
| 10 |
+
`improvement_release/benchmark/local/frozen/` and verify the public split
|
| 11 |
+
manifest's hashes. Public benchmark metadata contains source IDs and labels
|
| 12 |
+
rather than the article passages.
|
| 13 |
+
|
| 14 |
+
The scripts in this model package's `training/` directory are also in the
|
| 15 |
+
DOXA project's `improvement_release/model/` directory. Run them from the
|
| 16 |
+
project so their frozen benchmark and existing DOXA control paths resolve.
|
| 17 |
+
The existing framing control uses `release_staging/model/` and the original
|
| 18 |
+
DOXA Python package. The input and original registration hashes are recorded
|
| 19 |
+
in `EVALUATION.json`; check those before fitting.
|
| 20 |
+
|
| 21 |
+
```bash
|
| 22 |
+
python3 -m venv improvement_release/model/.venv
|
| 23 |
+
improvement_release/model/.venv/bin/pip install torch==2.7.1 --index-url https://download.pytorch.org/whl/cpu
|
| 24 |
+
improvement_release/model/.venv/bin/pip install -r improvement_release/model/requirements.txt
|
| 25 |
+
OMP_NUM_THREADS=3 MKL_NUM_THREADS=3 improvement_release/model/.venv/bin/python improvement_release/model/train.py
|
| 26 |
+
```
|
| 27 |
+
|
| 28 |
+
The fixed experiment trains the lexical controls, frozen-encoder classifier
|
| 29 |
+
and six fine-tuning epochs. Checkpoint and pipeline selection use validation
|
| 30 |
+
macro-F1. Its first export receipts are retained even when export parity
|
| 31 |
+
fails. The registered model and runtime quality thresholds remain unchanged.
|
| 32 |
+
The bounded validation-only exporter repair is specified in
|
| 33 |
+
`EXPORT_REPAIR.md`, which records its timing after initial held-out model
|
| 34 |
+
measurement. Run `repair_export.py`, then `finalize_export.py` to reproduce
|
| 35 |
+
the release representation and its deployment-shaped singleton evaluation.
|
| 36 |
+
These steps reuse locked learned weights and calibration.
|
| 37 |
+
|
| 38 |
+
`training_history.json`, `validation_controls.json`,
|
| 39 |
+
`EXPORT_VALIDATION.json`, `EXPORT_ATTEMPTS.json`, and `EVALUATION.json` expose
|
| 40 |
+
the measured choices and failures. The public test predictions include
|
| 41 |
+
source-group IDs, both contextual pipelines, controls and model scores.
|
| 42 |
+
They contain no article passages.
|
| 43 |
+
|
| 44 |
+
For the browser check, install the DOXA web project's locked dependencies
|
| 45 |
+
and Chromium, then use `browser_parity.mjs` with deterministic local fixtures.
|
| 46 |
+
That check covers the same tokenizer, pinned assets, WebAssembly runtime,
|
| 47 |
+
source-payload privacy and long-input abstention used by DOXA Lab. Its public
|
| 48 |
+
receipt stores IDs and outputs while local fixture text stays private.
|
| 49 |
+
|
| 50 |
+
For inference alone, download the public model repository, install
|
| 51 |
+
`numpy==2.5.5`, `onnxruntime==1.22.0`, and `tokenizers==0.21.4`, then use
|
| 52 |
+
`inference.py`. It verifies both asset hashes and applies the published
|
| 53 |
+
temperature, uncertainty threshold and token limit.
|
SHA256SUMS
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
6d12a71bf69b1cb7098ebe44a9210c3b8522c16d5e08703e3bea4096dd8ca245 BROWSER_PARITY.json
|
| 2 |
+
e298f9202485b61fdde484be745f0a8fd27a9b64d09c0356554fda05a8e42b56 EVALUATION.json
|
| 3 |
+
e9d2f8ed07be1ff893fca7c5b7e6fc94f449d5154f779577851d48fc911693cd EVALUATION.md
|
| 4 |
+
2d42761f95fce054a9b8d855daf8d0d6536c8fc8426b9e779782d02d57cb3d65 EVALUATION_AMENDMENT_1.md
|
| 5 |
+
45fd0d26b7c78ec5963e396bfe3b9a42b087e90eaeaeb7855fa9c26db70412b2 EVALUATION_REGISTRATION.md
|
| 6 |
+
31fc3d9b7c6df27e565ddaf2699559657b1b5e589c7e39302879785a5a7eb46b EXPORT_ATTEMPTS.json
|
| 7 |
+
01f6c4e3cc7e65fcb0075bbeb8a2c75949aece7e3a688fc99126cd7d1817fc81 EXPORT_PLAN.md
|
| 8 |
+
c750910939855b368a842e2ea980110b70cffbecadfc5ba227d53864bedde168 EXPORT_REPAIR.md
|
| 9 |
+
ad30110089dd6c383018c49d773e39c44fd877df26fb97153d2f618cae47101e EXPORT_VALIDATION.json
|
| 10 |
+
9f7d90f371b824c9839f42bd9c6a41f7dee3f94471e0e46e2a24b82834a2b681 INDEPENDENT_GATE.json
|
| 11 |
+
cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30 LICENSE
|
| 12 |
+
69dbbaf5de5faed3503ea6a56fec0395b400323bba60def5bd9eac2860a6bdc7 NOTICE
|
| 13 |
+
ca811a805c7d23904c2942c1084be21bf1fb663c39664d2a1ad8ed654bf2854a README.md
|
| 14 |
+
94dcbf331a205df0019bc0293befc4b8f96c440a98d777b9b73a3067862fd800 REPRODUCE.md
|
| 15 |
+
541dfafe727935e67c913d3a5496f70fd74541dcae22d8b0dc79cef46a260644 calibration.json
|
| 16 |
+
39d20dd17922da1c8cd2a09a0dd4aa5984c3c8d31b46635c841ee64c1579233e config.json
|
| 17 |
+
404a492d3842e035b5f6d7658391be8707574d66276821a15a8ba145457d35cc errors.json
|
| 18 |
+
a910bf7b387cf6d0ac56b08b7f53325f13485cff4042e3a1e49ced3bb3adbf03 illustrations.json
|
| 19 |
+
1d42024cda004709af572fd5a47180594ea95eef89ae4b4b63cff3d589ccdd8e inference.py
|
| 20 |
+
224ccb559be77307594d4b520abe33edbee3fd1130f77e16f31196e0f47f3754 model.safetensors
|
| 21 |
+
cb6dd5d63b6ed2f28c142141c263e3a29deb88289ad4dab50f7584a7c7b27d48 onnx/model_quantized.onnx
|
| 22 |
+
6bbe65acb427ee1dba69f3b2a008f8b92728c0a7d43c36c90352048671b8600c political_consistency_predictions.json
|
| 23 |
+
45d1943a7a7e3e7ae18e1b2ca381d900ba7806ca85043f7abc466685eaf8e988 requirements.txt
|
| 24 |
+
41d062afe08867983f40a4be89db9f16ad47f973aa6e29526759cad4295f835a runtime_manifest.json
|
| 25 |
+
5d5b662e421ea9fac075174bb0688ee0d9431699900b90662acd44b2a350503a special_tokens_map.json
|
| 26 |
+
7d93e95a031b67a588b7cb2a0bfd214754e6e11ff26e7a079d9ab5268b0b9a99 test_predictions.jsonl
|
| 27 |
+
d241a60d5e8f04cc1b2b3e9ef7a4921b27bf526d9f6050ab90f9267a1f9e5c66 tokenizer.json
|
| 28 |
+
ccb4eb21a03e1442ee5c3f85431b9c307960a04579942537d74778dc8080a48c tokenizer_config.json
|
| 29 |
+
67c0d1e6ca6e29100b153f72e29f83f1dd7a773b94da624b225607661041b097 training/browser_parity.mjs
|
| 30 |
+
55505241377ec18a9a1837aa74d886605e523dcc5b8f3c248f3c981742a913e5 training/finalize_export.py
|
| 31 |
+
e581c26fdd805edb09d0b903ef51149b09c02769fcef5334184779b0e7b510eb training/package_model.py
|
| 32 |
+
223ee08a340b9f0f7007fe96fae187b148de5eee24188ed103e5df91cce10a2e training/repair_export.py
|
| 33 |
+
fd0f13a799c79558de04767f6e35c5362d7353b1a3eab85841bd3f252e96778e training/train.py
|
| 34 |
+
ee1d041606ba9e9dfe4e14aa7fdde703e016ca2ef33091c6fc13f9b00700d7fc training_history.json
|
| 35 |
+
64bdbe8b2dcfd71a74b7e2470c1866eb6c2bdf232606254d09e9e378ac291d3c validation_controls.json
|
| 36 |
+
07eced375cec144d27c900241f3e339478dec958f92fddbc551f295c992038a3 vocab.txt
|
calibration.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"temperature": 1.0,
|
| 3 |
+
"threshold": 0.7,
|
| 4 |
+
"validation": {
|
| 5 |
+
"rows": 305,
|
| 6 |
+
"macro_f1": 0.8229336888277285,
|
| 7 |
+
"accuracy": 0.8229508196721311,
|
| 8 |
+
"per_class_f1": {
|
| 9 |
+
"no_biased_wording": 0.8211920529801324,
|
| 10 |
+
"biased_wording": 0.8246753246753247
|
| 11 |
+
},
|
| 12 |
+
"brier": 0.13717932768405094,
|
| 13 |
+
"negative_log_likelihood": 0.4269832933515886,
|
| 14 |
+
"ece_10_bins": 0.07166403453858174
|
| 15 |
+
},
|
| 16 |
+
"validation_tradeoffs": [
|
| 17 |
+
{
|
| 18 |
+
"threshold": 0.55,
|
| 19 |
+
"coverage": 0.9508196721311475,
|
| 20 |
+
"resolved_macro_f1": 0.8275862068965517
|
| 21 |
+
},
|
| 22 |
+
{
|
| 23 |
+
"threshold": 0.6,
|
| 24 |
+
"coverage": 0.9016393442622951,
|
| 25 |
+
"resolved_macro_f1": 0.8290818687930601
|
| 26 |
+
},
|
| 27 |
+
{
|
| 28 |
+
"threshold": 0.65,
|
| 29 |
+
"coverage": 0.8590163934426229,
|
| 30 |
+
"resolved_macro_f1": 0.8358563415167188
|
| 31 |
+
},
|
| 32 |
+
{
|
| 33 |
+
"threshold": 0.7,
|
| 34 |
+
"coverage": 0.7672131147540984,
|
| 35 |
+
"resolved_macro_f1": 0.8674608539949937
|
| 36 |
+
},
|
| 37 |
+
{
|
| 38 |
+
"threshold": 0.75,
|
| 39 |
+
"coverage": 0.7344262295081967,
|
| 40 |
+
"resolved_macro_f1": 0.8703263798782314
|
| 41 |
+
},
|
| 42 |
+
{
|
| 43 |
+
"threshold": 0.8,
|
| 44 |
+
"coverage": 0.6754098360655738,
|
| 45 |
+
"resolved_macro_f1": 0.8879030922469066
|
| 46 |
+
},
|
| 47 |
+
{
|
| 48 |
+
"threshold": 0.85,
|
| 49 |
+
"coverage": 0.5901639344262295,
|
| 50 |
+
"resolved_macro_f1": 0.9164578111946533
|
| 51 |
+
}
|
| 52 |
+
],
|
| 53 |
+
"method": "temperature_scaled_on_validation"
|
| 54 |
+
}
|
config.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"BertForSequenceClassification"
|
| 4 |
+
],
|
| 5 |
+
"attention_probs_dropout_prob": 0.1,
|
| 6 |
+
"classifier_dropout": null,
|
| 7 |
+
"gradient_checkpointing": false,
|
| 8 |
+
"hidden_act": "gelu",
|
| 9 |
+
"hidden_dropout_prob": 0.1,
|
| 10 |
+
"hidden_size": 384,
|
| 11 |
+
"id2label": {
|
| 12 |
+
"0": "no_biased_wording",
|
| 13 |
+
"1": "biased_wording"
|
| 14 |
+
},
|
| 15 |
+
"initializer_range": 0.02,
|
| 16 |
+
"intermediate_size": 1536,
|
| 17 |
+
"label2id": {
|
| 18 |
+
"biased_wording": 1,
|
| 19 |
+
"no_biased_wording": 0
|
| 20 |
+
},
|
| 21 |
+
"layer_norm_eps": 1e-12,
|
| 22 |
+
"max_position_embeddings": 512,
|
| 23 |
+
"model_type": "bert",
|
| 24 |
+
"num_attention_heads": 12,
|
| 25 |
+
"num_hidden_layers": 6,
|
| 26 |
+
"pad_token_id": 0,
|
| 27 |
+
"position_embedding_type": "absolute",
|
| 28 |
+
"torch_dtype": "float32",
|
| 29 |
+
"transformers_version": "4.52.4",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ident_errors": [
|
| 4 |
+
{
|
| 5 |
+
"id": "babe-sg2-01438",
|
| 6 |
+
"group_id": "babe-source-group-65d5569875a828829cf57771",
|
| 7 |
+
"reference_label": 0,
|
| 8 |
+
"candidate_label": 1,
|
| 9 |
+
"quantized_label": 1,
|
| 10 |
+
"model_score": 0.956721842288971,
|
| 11 |
+
"resolved": true,
|
| 12 |
+
"quantized_model_score": 0.9567834138870239,
|
| 13 |
+
"token_count": 41,
|
| 14 |
+
"within_deployment_limit": true,
|
| 15 |
+
"contextual_labels": {
|
| 16 |
+
"fine_tuned_encoder": 1,
|
| 17 |
+
"frozen_encoder_logistic": 1
|
| 18 |
+
},
|
| 19 |
+
"controls": {
|
| 20 |
+
"word_tfidf": 1,
|
| 21 |
+
"character_tfidf": 1,
|
| 22 |
+
"word_character_tfidf": 1,
|
| 23 |
+
"frozen_encoder_logistic": 1,
|
| 24 |
+
"doxa_framing_control": 1
|
| 25 |
+
},
|
| 26 |
+
"quantized_resolved": true
|
| 27 |
+
},
|
| 28 |
+
{
|
| 29 |
+
"id": "babe-sg2-01134",
|
| 30 |
+
"group_id": "babe-source-group-58c52945297913ef4fdedee1",
|
| 31 |
+
"reference_label": 0,
|
| 32 |
+
"candidate_label": 1,
|
| 33 |
+
"quantized_label": 1,
|
| 34 |
+
"model_score": 0.9497824907302856,
|
| 35 |
+
"resolved": true,
|
| 36 |
+
"quantized_model_score": 0.9498104453086853,
|
| 37 |
+
"token_count": 32,
|
| 38 |
+
"within_deployment_limit": true,
|
| 39 |
+
"contextual_labels": {
|
| 40 |
+
"fine_tuned_encoder": 1,
|
| 41 |
+
"frozen_encoder_logistic": 1
|
| 42 |
+
},
|
| 43 |
+
"controls": {
|
| 44 |
+
"word_tfidf": 1,
|
| 45 |
+
"character_tfidf": 1,
|
| 46 |
+
"word_character_tfidf": 1,
|
| 47 |
+
"frozen_encoder_logistic": 1,
|
| 48 |
+
"doxa_framing_control": 0
|
| 49 |
+
},
|
| 50 |
+
"quantized_resolved": true
|
| 51 |
+
},
|
| 52 |
+
{
|
| 53 |
+
"id": "babe-sg2-02303",
|
| 54 |
+
"group_id": "babe-source-group-7a745c098b306bd732f289d2",
|
| 55 |
+
"reference_label": 1,
|
| 56 |
+
"candidate_label": 0,
|
| 57 |
+
"quantized_label": 0,
|
| 58 |
+
"model_score": 0.051509808748960495,
|
| 59 |
+
"resolved": true,
|
| 60 |
+
"quantized_model_score": 0.05219626426696777,
|
| 61 |
+
"token_count": 43,
|
| 62 |
+
"within_deployment_limit": true,
|
| 63 |
+
"contextual_labels": {
|
| 64 |
+
"fine_tuned_encoder": 0,
|
| 65 |
+
"frozen_encoder_logistic": 0
|
| 66 |
+
},
|
| 67 |
+
"controls": {
|
| 68 |
+
"word_tfidf": 0,
|
| 69 |
+
"character_tfidf": 0,
|
| 70 |
+
"word_character_tfidf": 0,
|
| 71 |
+
"frozen_encoder_logistic": 0,
|
| 72 |
+
"doxa_framing_control": 0
|
| 73 |
+
},
|
| 74 |
+
"quantized_resolved": true
|
| 75 |
+
},
|
| 76 |
+
{
|
| 77 |
+
"id": "babe-sg2-01644",
|
| 78 |
+
"group_id": "babe-source-group-fe65585d4cd6a894dfb6c237",
|
| 79 |
+
"reference_label": 1,
|
| 80 |
+
"candidate_label": 0,
|
| 81 |
+
"quantized_label": 0,
|
| 82 |
+
"model_score": 0.05242214724421501,
|
| 83 |
+
"resolved": true,
|
| 84 |
+
"quantized_model_score": 0.052663229405879974,
|
| 85 |
+
"token_count": 47,
|
| 86 |
+
"within_deployment_limit": true,
|
| 87 |
+
"contextual_labels": {
|
| 88 |
+
"fine_tuned_encoder": 0,
|
| 89 |
+
"frozen_encoder_logistic": 0
|
| 90 |
+
},
|
| 91 |
+
"controls": {
|
| 92 |
+
"word_tfidf": 0,
|
| 93 |
+
"character_tfidf": 0,
|
| 94 |
+
"word_character_tfidf": 0,
|
| 95 |
+
"frozen_encoder_logistic": 0,
|
| 96 |
+
"doxa_framing_control": 0
|
| 97 |
+
},
|
| 98 |
+
"quantized_resolved": true
|
| 99 |
+
},
|
| 100 |
+
{
|
| 101 |
+
"id": "babe-sg2-01168",
|
| 102 |
+
"group_id": "babe-source-group-5d6fd9623767b7e56dc94c16",
|
| 103 |
+
"reference_label": 0,
|
| 104 |
+
"candidate_label": 1,
|
| 105 |
+
"quantized_label": 1,
|
| 106 |
+
"model_score": 0.9443440437316895,
|
| 107 |
+
"resolved": true,
|
| 108 |
+
"quantized_model_score": 0.9458421468734741,
|
| 109 |
+
"token_count": 18,
|
| 110 |
+
"within_deployment_limit": true,
|
| 111 |
+
"contextual_labels": {
|
| 112 |
+
"fine_tuned_encoder": 1,
|
| 113 |
+
"frozen_encoder_logistic": 1
|
| 114 |
+
},
|
| 115 |
+
"controls": {
|
| 116 |
+
"word_tfidf": 1,
|
| 117 |
+
"character_tfidf": 1,
|
| 118 |
+
"word_character_tfidf": 1,
|
| 119 |
+
"frozen_encoder_logistic": 1,
|
| 120 |
+
"doxa_framing_control": 1
|
| 121 |
+
},
|
| 122 |
+
"quantized_resolved": true
|
| 123 |
+
},
|
| 124 |
+
{
|
| 125 |
+
"id": "babe-sg2-01321",
|
| 126 |
+
"group_id": "babe-source-group-9192c45743ae6a2f92a8de9d",
|
| 127 |
+
"reference_label": 1,
|
| 128 |
+
"candidate_label": 0,
|
| 129 |
+
"quantized_label": 0,
|
| 130 |
+
"model_score": 0.06275331228971481,
|
| 131 |
+
"resolved": true,
|
| 132 |
+
"quantized_model_score": 0.06356186419725418,
|
| 133 |
+
"token_count": 31,
|
| 134 |
+
"within_deployment_limit": true,
|
| 135 |
+
"contextual_labels": {
|
| 136 |
+
"fine_tuned_encoder": 0,
|
| 137 |
+
"frozen_encoder_logistic": 0
|
| 138 |
+
},
|
| 139 |
+
"controls": {
|
| 140 |
+
"word_tfidf": 0,
|
| 141 |
+
"character_tfidf": 0,
|
| 142 |
+
"word_character_tfidf": 0,
|
| 143 |
+
"frozen_encoder_logistic": 0,
|
| 144 |
+
"doxa_framing_control": 1
|
| 145 |
+
},
|
| 146 |
+
"quantized_resolved": true
|
| 147 |
+
},
|
| 148 |
+
{
|
| 149 |
+
"id": "babe-sg2-01208",
|
| 150 |
+
"group_id": "babe-source-group-db9cda912d806beb92975cc1",
|
| 151 |
+
"reference_label": 1,
|
| 152 |
+
"candidate_label": 0,
|
| 153 |
+
"quantized_label": 0,
|
| 154 |
+
"model_score": 0.06363456696271896,
|
| 155 |
+
"resolved": true,
|
| 156 |
+
"quantized_model_score": 0.06412237882614136,
|
| 157 |
+
"token_count": 29,
|
| 158 |
+
"within_deployment_limit": true,
|
| 159 |
+
"contextual_labels": {
|
| 160 |
+
"fine_tuned_encoder": 0,
|
| 161 |
+
"frozen_encoder_logistic": 0
|
| 162 |
+
},
|
| 163 |
+
"controls": {
|
| 164 |
+
"word_tfidf": 0,
|
| 165 |
+
"character_tfidf": 0,
|
| 166 |
+
"word_character_tfidf": 0,
|
| 167 |
+
"frozen_encoder_logistic": 0,
|
| 168 |
+
"doxa_framing_control": 0
|
| 169 |
+
},
|
| 170 |
+
"quantized_resolved": true
|
| 171 |
+
},
|
| 172 |
+
{
|
| 173 |
+
"id": "babe-sg2-01585",
|
| 174 |
+
"group_id": "babe-source-group-6755ddd95e062c06fd79c0c3",
|
| 175 |
+
"reference_label": 1,
|
| 176 |
+
"candidate_label": 0,
|
| 177 |
+
"quantized_label": 0,
|
| 178 |
+
"model_score": 0.06712871789932251,
|
| 179 |
+
"resolved": true,
|
| 180 |
+
"quantized_model_score": 0.072640560567379,
|
| 181 |
+
"token_count": 43,
|
| 182 |
+
"within_deployment_limit": true,
|
| 183 |
+
"contextual_labels": {
|
| 184 |
+
"fine_tuned_encoder": 0,
|
| 185 |
+
"frozen_encoder_logistic": 0
|
| 186 |
+
},
|
| 187 |
+
"controls": {
|
| 188 |
+
"word_tfidf": 0,
|
| 189 |
+
"character_tfidf": 0,
|
| 190 |
+
"word_character_tfidf": 0,
|
| 191 |
+
"frozen_encoder_logistic": 0,
|
| 192 |
+
"doxa_framing_control": 0
|
| 193 |
+
},
|
| 194 |
+
"quantized_resolved": true
|
| 195 |
+
},
|
| 196 |
+
{
|
| 197 |
+
"id": "babe-sg2-00292",
|
| 198 |
+
"group_id": "babe-source-group-daa26c6160618842e267d224",
|
| 199 |
+
"reference_label": 0,
|
| 200 |
+
"candidate_label": 1,
|
| 201 |
+
"quantized_label": 1,
|
| 202 |
+
"model_score": 0.9262084364891052,
|
| 203 |
+
"resolved": true,
|
| 204 |
+
"quantized_model_score": 0.924089252948761,
|
| 205 |
+
"token_count": 43,
|
| 206 |
+
"within_deployment_limit": true,
|
| 207 |
+
"contextual_labels": {
|
| 208 |
+
"fine_tuned_encoder": 1,
|
| 209 |
+
"frozen_encoder_logistic": 1
|
| 210 |
+
},
|
| 211 |
+
"controls": {
|
| 212 |
+
"word_tfidf": 1,
|
| 213 |
+
"character_tfidf": 1,
|
| 214 |
+
"word_character_tfidf": 1,
|
| 215 |
+
"frozen_encoder_logistic": 1,
|
| 216 |
+
"doxa_framing_control": 0
|
| 217 |
+
},
|
| 218 |
+
"quantized_resolved": true
|
| 219 |
+
},
|
| 220 |
+
{
|
| 221 |
+
"id": "babe-sg2-00425",
|
| 222 |
+
"group_id": "babe-source-group-efd21c9e5afb2a8e0d6bdb4e",
|
| 223 |
+
"reference_label": 1,
|
| 224 |
+
"candidate_label": 0,
|
| 225 |
+
"quantized_label": 0,
|
| 226 |
+
"model_score": 0.07711523771286011,
|
| 227 |
+
"resolved": true,
|
| 228 |
+
"quantized_model_score": 0.08215918391942978,
|
| 229 |
+
"token_count": 50,
|
| 230 |
+
"within_deployment_limit": true,
|
| 231 |
+
"contextual_labels": {
|
| 232 |
+
"fine_tuned_encoder": 0,
|
| 233 |
+
"frozen_encoder_logistic": 0
|
| 234 |
+
},
|
| 235 |
+
"controls": {
|
| 236 |
+
"word_tfidf": 0,
|
| 237 |
+
"character_tfidf": 0,
|
| 238 |
+
"word_character_tfidf": 0,
|
| 239 |
+
"frozen_encoder_logistic": 0,
|
| 240 |
+
"doxa_framing_control": 1
|
| 241 |
+
},
|
| 242 |
+
"quantized_resolved": true
|
| 243 |
+
},
|
| 244 |
+
{
|
| 245 |
+
"id": "babe-sg2-02403",
|
| 246 |
+
"group_id": "babe-source-group-f1255ec90461172693884980",
|
| 247 |
+
"reference_label": 1,
|
| 248 |
+
"candidate_label": 0,
|
| 249 |
+
"quantized_label": 0,
|
| 250 |
+
"model_score": 0.07855964452028275,
|
| 251 |
+
"resolved": true,
|
| 252 |
+
"quantized_model_score": 0.07952717691659927,
|
| 253 |
+
"token_count": 39,
|
| 254 |
+
"within_deployment_limit": true,
|
| 255 |
+
"contextual_labels": {
|
| 256 |
+
"fine_tuned_encoder": 0,
|
| 257 |
+
"frozen_encoder_logistic": 0
|
| 258 |
+
},
|
| 259 |
+
"controls": {
|
| 260 |
+
"word_tfidf": 0,
|
| 261 |
+
"character_tfidf": 0,
|
| 262 |
+
"word_character_tfidf": 0,
|
| 263 |
+
"frozen_encoder_logistic": 0,
|
| 264 |
+
"doxa_framing_control": 0
|
| 265 |
+
},
|
| 266 |
+
"quantized_resolved": true
|
| 267 |
+
},
|
| 268 |
+
{
|
| 269 |
+
"id": "babe-sg2-01230",
|
| 270 |
+
"group_id": "babe-source-group-2d8163ba3165653678c6b741",
|
| 271 |
+
"reference_label": 0,
|
| 272 |
+
"candidate_label": 1,
|
| 273 |
+
"quantized_label": 1,
|
| 274 |
+
"model_score": 0.9181568622589111,
|
| 275 |
+
"resolved": true,
|
| 276 |
+
"quantized_model_score": 0.900957465171814,
|
| 277 |
+
"token_count": 39,
|
| 278 |
+
"within_deployment_limit": true,
|
| 279 |
+
"contextual_labels": {
|
| 280 |
+
"fine_tuned_encoder": 1,
|
| 281 |
+
"frozen_encoder_logistic": 1
|
| 282 |
+
},
|
| 283 |
+
"controls": {
|
| 284 |
+
"word_tfidf": 1,
|
| 285 |
+
"character_tfidf": 1,
|
| 286 |
+
"word_character_tfidf": 1,
|
| 287 |
+
"frozen_encoder_logistic": 1,
|
| 288 |
+
"doxa_framing_control": 0
|
| 289 |
+
},
|
| 290 |
+
"quantized_resolved": true
|
| 291 |
+
},
|
| 292 |
+
{
|
| 293 |
+
"id": "babe-sg2-02848",
|
| 294 |
+
"group_id": "babe-source-group-c4cd48b3ced8a546a22ed94f",
|
| 295 |
+
"reference_label": 1,
|
| 296 |
+
"candidate_label": 0,
|
| 297 |
+
"quantized_label": 0,
|
| 298 |
+
"model_score": 0.08746875077486038,
|
| 299 |
+
"resolved": true,
|
| 300 |
+
"quantized_model_score": 0.07563119381666183,
|
| 301 |
+
"token_count": 22,
|
| 302 |
+
"within_deployment_limit": true,
|
| 303 |
+
"contextual_labels": {
|
| 304 |
+
"fine_tuned_encoder": 0,
|
| 305 |
+
"frozen_encoder_logistic": 0
|
| 306 |
+
},
|
| 307 |
+
"controls": {
|
| 308 |
+
"word_tfidf": 0,
|
| 309 |
+
"character_tfidf": 0,
|
| 310 |
+
"word_character_tfidf": 0,
|
| 311 |
+
"frozen_encoder_logistic": 0,
|
| 312 |
+
"doxa_framing_control": 0
|
| 313 |
+
},
|
| 314 |
+
"quantized_resolved": true
|
| 315 |
+
},
|
| 316 |
+
{
|
| 317 |
+
"id": "babe-sg2-00094",
|
| 318 |
+
"group_id": "babe-source-group-365ae7d0a51bf0c95b7b0ca8",
|
| 319 |
+
"reference_label": 1,
|
| 320 |
+
"candidate_label": 0,
|
| 321 |
+
"quantized_label": 0,
|
| 322 |
+
"model_score": 0.09663162380456924,
|
| 323 |
+
"resolved": true,
|
| 324 |
+
"quantized_model_score": 0.10989619046449661,
|
| 325 |
+
"token_count": 46,
|
| 326 |
+
"within_deployment_limit": true,
|
| 327 |
+
"contextual_labels": {
|
| 328 |
+
"fine_tuned_encoder": 0,
|
| 329 |
+
"frozen_encoder_logistic": 0
|
| 330 |
+
},
|
| 331 |
+
"controls": {
|
| 332 |
+
"word_tfidf": 0,
|
| 333 |
+
"character_tfidf": 0,
|
| 334 |
+
"word_character_tfidf": 0,
|
| 335 |
+
"frozen_encoder_logistic": 0,
|
| 336 |
+
"doxa_framing_control": 0
|
| 337 |
+
},
|
| 338 |
+
"quantized_resolved": true
|
| 339 |
+
},
|
| 340 |
+
{
|
| 341 |
+
"id": "babe-sg2-00422",
|
| 342 |
+
"group_id": "babe-source-group-cd08e49f8e434f976cd7e658",
|
| 343 |
+
"reference_label": 0,
|
| 344 |
+
"candidate_label": 1,
|
| 345 |
+
"quantized_label": 1,
|
| 346 |
+
"model_score": 0.8978663086891174,
|
| 347 |
+
"resolved": true,
|
| 348 |
+
"quantized_model_score": 0.8928729295730591,
|
| 349 |
+
"token_count": 37,
|
| 350 |
+
"within_deployment_limit": true,
|
| 351 |
+
"contextual_labels": {
|
| 352 |
+
"fine_tuned_encoder": 1,
|
| 353 |
+
"frozen_encoder_logistic": 1
|
| 354 |
+
},
|
| 355 |
+
"controls": {
|
| 356 |
+
"word_tfidf": 0,
|
| 357 |
+
"character_tfidf": 1,
|
| 358 |
+
"word_character_tfidf": 1,
|
| 359 |
+
"frozen_encoder_logistic": 1,
|
| 360 |
+
"doxa_framing_control": 0
|
| 361 |
+
},
|
| 362 |
+
"quantized_resolved": true
|
| 363 |
+
},
|
| 364 |
+
{
|
| 365 |
+
"id": "babe-sg2-00344",
|
| 366 |
+
"group_id": "babe-source-group-4aefbb0ba7327b8b3c44b817",
|
| 367 |
+
"reference_label": 0,
|
| 368 |
+
"candidate_label": 1,
|
| 369 |
+
"quantized_label": 1,
|
| 370 |
+
"model_score": 0.8978435397148132,
|
| 371 |
+
"resolved": true,
|
| 372 |
+
"quantized_model_score": 0.8912836909294128,
|
| 373 |
+
"token_count": 41,
|
| 374 |
+
"within_deployment_limit": true,
|
| 375 |
+
"contextual_labels": {
|
| 376 |
+
"fine_tuned_encoder": 1,
|
| 377 |
+
"frozen_encoder_logistic": 1
|
| 378 |
+
},
|
| 379 |
+
"controls": {
|
| 380 |
+
"word_tfidf": 1,
|
| 381 |
+
"character_tfidf": 1,
|
| 382 |
+
"word_character_tfidf": 1,
|
| 383 |
+
"frozen_encoder_logistic": 1,
|
| 384 |
+
"doxa_framing_control": 1
|
| 385 |
+
},
|
| 386 |
+
"quantized_resolved": true
|
| 387 |
+
},
|
| 388 |
+
{
|
| 389 |
+
"id": "babe-sg2-00040",
|
| 390 |
+
"group_id": "babe-source-group-f423741f2d1061cf41ac01a8",
|
| 391 |
+
"reference_label": 1,
|
| 392 |
+
"candidate_label": 0,
|
| 393 |
+
"quantized_label": 0,
|
| 394 |
+
"model_score": 0.10261595994234085,
|
| 395 |
+
"resolved": true,
|
| 396 |
+
"quantized_model_score": 0.10477709025144577,
|
| 397 |
+
"token_count": 26,
|
| 398 |
+
"within_deployment_limit": true,
|
| 399 |
+
"contextual_labels": {
|
| 400 |
+
"fine_tuned_encoder": 0,
|
| 401 |
+
"frozen_encoder_logistic": 0
|
| 402 |
+
},
|
| 403 |
+
"controls": {
|
| 404 |
+
"word_tfidf": 1,
|
| 405 |
+
"character_tfidf": 0,
|
| 406 |
+
"word_character_tfidf": 1,
|
| 407 |
+
"frozen_encoder_logistic": 0,
|
| 408 |
+
"doxa_framing_control": 1
|
| 409 |
+
},
|
| 410 |
+
"quantized_resolved": true
|
| 411 |
+
},
|
| 412 |
+
{
|
| 413 |
+
"id": "babe-sg2-02951",
|
| 414 |
+
"group_id": "babe-source-group-868144e709ea6f7caf8c4a7c",
|
| 415 |
+
"reference_label": 1,
|
| 416 |
+
"candidate_label": 0,
|
| 417 |
+
"quantized_label": 0,
|
| 418 |
+
"model_score": 0.10318008810281754,
|
| 419 |
+
"resolved": true,
|
| 420 |
+
"quantized_model_score": 0.11108656972646713,
|
| 421 |
+
"token_count": 26,
|
| 422 |
+
"within_deployment_limit": true,
|
| 423 |
+
"contextual_labels": {
|
| 424 |
+
"fine_tuned_encoder": 0,
|
| 425 |
+
"frozen_encoder_logistic": 0
|
| 426 |
+
},
|
| 427 |
+
"controls": {
|
| 428 |
+
"word_tfidf": 0,
|
| 429 |
+
"character_tfidf": 0,
|
| 430 |
+
"word_character_tfidf": 0,
|
| 431 |
+
"frozen_encoder_logistic": 0,
|
| 432 |
+
"doxa_framing_control": 1
|
| 433 |
+
},
|
| 434 |
+
"quantized_resolved": true
|
| 435 |
+
},
|
| 436 |
+
{
|
| 437 |
+
"id": "babe-sg2-02501",
|
| 438 |
+
"group_id": "babe-source-group-dc48bfe32514aa1a3953959d",
|
| 439 |
+
"reference_label": 1,
|
| 440 |
+
"candidate_label": 0,
|
| 441 |
+
"quantized_label": 0,
|
| 442 |
+
"model_score": 0.10358769446611404,
|
| 443 |
+
"resolved": true,
|
| 444 |
+
"quantized_model_score": 0.10344065725803375,
|
| 445 |
+
"token_count": 55,
|
| 446 |
+
"within_deployment_limit": true,
|
| 447 |
+
"contextual_labels": {
|
| 448 |
+
"fine_tuned_encoder": 0,
|
| 449 |
+
"frozen_encoder_logistic": 0
|
| 450 |
+
},
|
| 451 |
+
"controls": {
|
| 452 |
+
"word_tfidf": 1,
|
| 453 |
+
"character_tfidf": 0,
|
| 454 |
+
"word_character_tfidf": 0,
|
| 455 |
+
"frozen_encoder_logistic": 0,
|
| 456 |
+
"doxa_framing_control": 0
|
| 457 |
+
},
|
| 458 |
+
"quantized_resolved": true
|
| 459 |
+
},
|
| 460 |
+
{
|
| 461 |
+
"id": "babe-sg2-00077",
|
| 462 |
+
"group_id": "babe-source-group-0f79765bb6449a5118276484",
|
| 463 |
+
"reference_label": 1,
|
| 464 |
+
"candidate_label": 0,
|
| 465 |
+
"quantized_label": 0,
|
| 466 |
+
"model_score": 0.1122221052646637,
|
| 467 |
+
"resolved": true,
|
| 468 |
+
"quantized_model_score": 0.11186566203832626,
|
| 469 |
+
"token_count": 36,
|
| 470 |
+
"within_deployment_limit": true,
|
| 471 |
+
"contextual_labels": {
|
| 472 |
+
"fine_tuned_encoder": 0,
|
| 473 |
+
"frozen_encoder_logistic": 0
|
| 474 |
+
},
|
| 475 |
+
"controls": {
|
| 476 |
+
"word_tfidf": 0,
|
| 477 |
+
"character_tfidf": 1,
|
| 478 |
+
"word_character_tfidf": 0,
|
| 479 |
+
"frozen_encoder_logistic": 0,
|
| 480 |
+
"doxa_framing_control": 0
|
| 481 |
+
},
|
| 482 |
+
"quantized_resolved": true
|
| 483 |
+
}
|
| 484 |
+
],
|
| 485 |
+
"text_policy": "Review source IDs through the linked benchmark; article text is excluded from this package."
|
| 486 |
+
}
|
illustrations.json
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[
|
| 2 |
+
{
|
| 3 |
+
"id": "factual_statement",
|
| 4 |
+
"origin": "original_fictional_illustration",
|
| 5 |
+
"text": "The committee voted six to four to approve the policy.",
|
| 6 |
+
"result": {
|
| 7 |
+
"method": "doxa-wording-minilm-v1",
|
| 8 |
+
"task": "biased_wording",
|
| 9 |
+
"decision": "no_wording_flag",
|
| 10 |
+
"model_score": 0.10063666850328445,
|
| 11 |
+
"class_scores": {
|
| 12 |
+
"no_biased_wording": 0.8993633314967155,
|
| 13 |
+
"biased_wording": 0.10063666850328445
|
| 14 |
+
},
|
| 15 |
+
"score_calibration": "temperature_scaled_on_validation",
|
| 16 |
+
"decision_threshold": 0.7,
|
| 17 |
+
"token_count": 13,
|
| 18 |
+
"maximum_tokens": 256,
|
| 19 |
+
"model_id": "Giuliocc/doxa-wording-encoder",
|
| 20 |
+
"model_revision": "v0.1.0",
|
| 21 |
+
"context_used": false,
|
| 22 |
+
"reason": null,
|
| 23 |
+
"scope": "A provisional screen trained on English news sentences labeled for wording bias. Academic and other genres require separate validation. Read the surrounding context."
|
| 24 |
+
}
|
| 25 |
+
},
|
| 26 |
+
{
|
| 27 |
+
"id": "evaluative_wording",
|
| 28 |
+
"origin": "original_fictional_illustration",
|
| 29 |
+
"text": "The committee's reckless and disgraceful policy betrayed every resident.",
|
| 30 |
+
"result": {
|
| 31 |
+
"method": "doxa-wording-minilm-v1",
|
| 32 |
+
"task": "biased_wording",
|
| 33 |
+
"decision": "wording_flag",
|
| 34 |
+
"model_score": 0.9246758222579956,
|
| 35 |
+
"class_scores": {
|
| 36 |
+
"no_biased_wording": 0.0753241777420044,
|
| 37 |
+
"biased_wording": 0.9246758222579956
|
| 38 |
+
},
|
| 39 |
+
"score_calibration": "temperature_scaled_on_validation",
|
| 40 |
+
"decision_threshold": 0.7,
|
| 41 |
+
"token_count": 15,
|
| 42 |
+
"maximum_tokens": 256,
|
| 43 |
+
"model_id": "Giuliocc/doxa-wording-encoder",
|
| 44 |
+
"model_revision": "v0.1.0",
|
| 45 |
+
"context_used": false,
|
| 46 |
+
"reason": null,
|
| 47 |
+
"scope": "A provisional screen trained on English news sentences labeled for wording bias. Academic and other genres require separate validation. Read the surrounding context."
|
| 48 |
+
}
|
| 49 |
+
},
|
| 50 |
+
{
|
| 51 |
+
"id": "attributed_judgment",
|
| 52 |
+
"origin": "original_fictional_illustration",
|
| 53 |
+
"text": "The minister called the policy reckless; the report attributed that judgment to her.",
|
| 54 |
+
"result": {
|
| 55 |
+
"method": "doxa-wording-minilm-v1",
|
| 56 |
+
"task": "biased_wording",
|
| 57 |
+
"decision": "no_wording_flag",
|
| 58 |
+
"model_score": 0.22543752193450928,
|
| 59 |
+
"class_scores": {
|
| 60 |
+
"no_biased_wording": 0.7745624780654907,
|
| 61 |
+
"biased_wording": 0.22543752193450928
|
| 62 |
+
},
|
| 63 |
+
"score_calibration": "temperature_scaled_on_validation",
|
| 64 |
+
"decision_threshold": 0.7,
|
| 65 |
+
"token_count": 17,
|
| 66 |
+
"maximum_tokens": 256,
|
| 67 |
+
"model_id": "Giuliocc/doxa-wording-encoder",
|
| 68 |
+
"model_revision": "v0.1.0",
|
| 69 |
+
"context_used": false,
|
| 70 |
+
"reason": null,
|
| 71 |
+
"scope": "A provisional screen trained on English news sentences labeled for wording bias. Academic and other genres require separate validation. Read the surrounding context."
|
| 72 |
+
}
|
| 73 |
+
}
|
| 74 |
+
]
|
inference.py
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Run the checked wording model locally with ONNX Runtime."""
|
| 2 |
+
import hashlib
|
| 3 |
+
import json
|
| 4 |
+
from pathlib import Path
|
| 5 |
+
|
| 6 |
+
import numpy as np
|
| 7 |
+
import onnxruntime as ort
|
| 8 |
+
from tokenizers import Tokenizer
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
class WordingModel:
|
| 12 |
+
def __init__(self, folder, threads=1):
|
| 13 |
+
folder = Path(folder)
|
| 14 |
+
self.manifest = json.loads((folder / "runtime_manifest.json").read_text())
|
| 15 |
+
for asset in self.manifest["files"].values():
|
| 16 |
+
if hashlib.sha256((folder / asset["path"]).read_bytes()).hexdigest() != asset["sha256"]:
|
| 17 |
+
raise ValueError("A model asset does not match the published manifest")
|
| 18 |
+
self.tokenizer = Tokenizer.from_file(str(folder / "tokenizer.json"))
|
| 19 |
+
if json.loads((folder / "tokenizer.json").read_text()).get("truncation"):
|
| 20 |
+
raise ValueError("The tokenizer must preserve full input length")
|
| 21 |
+
options = ort.SessionOptions()
|
| 22 |
+
options.intra_op_num_threads = threads
|
| 23 |
+
options.inter_op_num_threads = 1
|
| 24 |
+
self.session = ort.InferenceSession(str(folder / "onnx/model_quantized.onnx"),
|
| 25 |
+
sess_options=options, providers=["CPUExecutionProvider"])
|
| 26 |
+
|
| 27 |
+
def check(self, text):
|
| 28 |
+
if not isinstance(text, str) or not text.strip():
|
| 29 |
+
raise ValueError("Choose a non-empty passage")
|
| 30 |
+
manifest = self.manifest
|
| 31 |
+
encoded = self.tokenizer.encode(text)
|
| 32 |
+
length = len(encoded.ids)
|
| 33 |
+
result = {
|
| 34 |
+
"method": manifest["method"], "task": manifest["task"], "decision": "unresolved",
|
| 35 |
+
"model_score": None, "class_scores": None, "score_calibration": manifest["score_calibration"],
|
| 36 |
+
"decision_threshold": manifest["threshold"], "token_count": length,
|
| 37 |
+
"maximum_tokens": manifest["maximum_tokens"], "model_id": manifest["model_id"],
|
| 38 |
+
"model_revision": manifest["revision"], "context_used": False, "reason": None,
|
| 39 |
+
"scope": manifest["scope"],
|
| 40 |
+
}
|
| 41 |
+
if length > manifest["maximum_tokens"]:
|
| 42 |
+
return result | {"reason": "input_too_long"}
|
| 43 |
+
values = {"input_ids": encoded.ids, "attention_mask": encoded.attention_mask, "token_type_ids": encoded.type_ids}
|
| 44 |
+
inputs = {item.name: np.array([values[item.name]], dtype=np.int64) for item in self.session.get_inputs()}
|
| 45 |
+
logits = self.session.run(None, inputs)[0][0] / manifest["temperature"]
|
| 46 |
+
probabilities = np.exp(logits - logits.max())
|
| 47 |
+
probabilities /= probabilities.sum()
|
| 48 |
+
positive = float(probabilities[1])
|
| 49 |
+
result["model_score"] = positive
|
| 50 |
+
result["class_scores"] = {"no_biased_wording": 1 - positive, "biased_wording": positive}
|
| 51 |
+
if max(positive, 1 - positive) < manifest["threshold"]:
|
| 52 |
+
result["reason"] = "below_resolution_threshold"
|
| 53 |
+
else:
|
| 54 |
+
result["decision"] = "wording_flag" if positive >= .5 else "no_wording_flag"
|
| 55 |
+
return result
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:224ccb559be77307594d4b520abe33edbee3fd1130f77e16f31196e0f47f3754
|
| 3 |
+
size 90867952
|
onnx/model_quantized.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:cb6dd5d63b6ed2f28c142141c263e3a29deb88289ad4dab50f7584a7c7b27d48
|
| 3 |
+
size 23157564
|
political_consistency_predictions.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
requirements.txt
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Install torch==2.7.1 from https://download.pytorch.org/whl/cpu first.
|
| 2 |
+
transformers==4.52.4
|
| 3 |
+
onnx==1.18.0
|
| 4 |
+
onnxruntime==1.22.0
|
| 5 |
+
scikit-learn==1.6.1
|
| 6 |
+
huggingface_hub==0.32.4
|
| 7 |
+
safetensors==0.5.3
|
| 8 |
+
numpy==2.5.5
|
| 9 |
+
scipy==1.18.1
|
| 10 |
+
tokenizers==0.21.4
|
runtime_manifest.json
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"method": "doxa-wording-minilm-v1",
|
| 3 |
+
"task": "biased_wording",
|
| 4 |
+
"model_id": "Giuliocc/doxa-wording-encoder",
|
| 5 |
+
"revision": "v0.1.0",
|
| 6 |
+
"maximum_tokens": 256,
|
| 7 |
+
"selected_pipeline": "fine_tuned_encoder",
|
| 8 |
+
"temperature": 1.0,
|
| 9 |
+
"threshold": 0.7,
|
| 10 |
+
"score_calibration": "temperature_scaled_on_validation",
|
| 11 |
+
"files": {
|
| 12 |
+
"tokenizer": {
|
| 13 |
+
"path": "tokenizer.json",
|
| 14 |
+
"sha256": "d241a60d5e8f04cc1b2b3e9ef7a4921b27bf526d9f6050ab90f9267a1f9e5c66"
|
| 15 |
+
},
|
| 16 |
+
"weights": {
|
| 17 |
+
"path": "onnx/model_quantized.onnx",
|
| 18 |
+
"sha256": "cb6dd5d63b6ed2f28c142141c263e3a29deb88289ad4dab50f7584a7c7b27d48",
|
| 19 |
+
"bytes": 23157564
|
| 20 |
+
}
|
| 21 |
+
},
|
| 22 |
+
"scope": "A provisional screen trained on English news sentences labeled for wording bias. Academic and other genres require separate validation. Read the surrounding context."
|
| 23 |
+
}
|
special_tokens_map.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"cls_token": {
|
| 3 |
+
"content": "[CLS]",
|
| 4 |
+
"lstrip": false,
|
| 5 |
+
"normalized": false,
|
| 6 |
+
"rstrip": false,
|
| 7 |
+
"single_word": false
|
| 8 |
+
},
|
| 9 |
+
"mask_token": {
|
| 10 |
+
"content": "[MASK]",
|
| 11 |
+
"lstrip": false,
|
| 12 |
+
"normalized": false,
|
| 13 |
+
"rstrip": false,
|
| 14 |
+
"single_word": false
|
| 15 |
+
},
|
| 16 |
+
"pad_token": {
|
| 17 |
+
"content": "[PAD]",
|
| 18 |
+
"lstrip": false,
|
| 19 |
+
"normalized": false,
|
| 20 |
+
"rstrip": false,
|
| 21 |
+
"single_word": false
|
| 22 |
+
},
|
| 23 |
+
"sep_token": {
|
| 24 |
+
"content": "[SEP]",
|
| 25 |
+
"lstrip": false,
|
| 26 |
+
"normalized": false,
|
| 27 |
+
"rstrip": false,
|
| 28 |
+
"single_word": false
|
| 29 |
+
},
|
| 30 |
+
"unk_token": {
|
| 31 |
+
"content": "[UNK]",
|
| 32 |
+
"lstrip": false,
|
| 33 |
+
"normalized": false,
|
| 34 |
+
"rstrip": false,
|
| 35 |
+
"single_word": false
|
| 36 |
+
}
|
| 37 |
+
}
|
test_predictions.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"added_tokens_decoder": {
|
| 3 |
+
"0": {
|
| 4 |
+
"content": "[PAD]",
|
| 5 |
+
"lstrip": false,
|
| 6 |
+
"normalized": false,
|
| 7 |
+
"rstrip": false,
|
| 8 |
+
"single_word": false,
|
| 9 |
+
"special": true
|
| 10 |
+
},
|
| 11 |
+
"100": {
|
| 12 |
+
"content": "[UNK]",
|
| 13 |
+
"lstrip": false,
|
| 14 |
+
"normalized": false,
|
| 15 |
+
"rstrip": false,
|
| 16 |
+
"single_word": false,
|
| 17 |
+
"special": true
|
| 18 |
+
},
|
| 19 |
+
"101": {
|
| 20 |
+
"content": "[CLS]",
|
| 21 |
+
"lstrip": false,
|
| 22 |
+
"normalized": false,
|
| 23 |
+
"rstrip": false,
|
| 24 |
+
"single_word": false,
|
| 25 |
+
"special": true
|
| 26 |
+
},
|
| 27 |
+
"102": {
|
| 28 |
+
"content": "[SEP]",
|
| 29 |
+
"lstrip": false,
|
| 30 |
+
"normalized": false,
|
| 31 |
+
"rstrip": false,
|
| 32 |
+
"single_word": false,
|
| 33 |
+
"special": true
|
| 34 |
+
},
|
| 35 |
+
"103": {
|
| 36 |
+
"content": "[MASK]",
|
| 37 |
+
"lstrip": false,
|
| 38 |
+
"normalized": false,
|
| 39 |
+
"rstrip": false,
|
| 40 |
+
"single_word": false,
|
| 41 |
+
"special": true
|
| 42 |
+
}
|
| 43 |
+
},
|
| 44 |
+
"clean_up_tokenization_spaces": false,
|
| 45 |
+
"cls_token": "[CLS]",
|
| 46 |
+
"do_basic_tokenize": true,
|
| 47 |
+
"do_lower_case": true,
|
| 48 |
+
"extra_special_tokens": {},
|
| 49 |
+
"mask_token": "[MASK]",
|
| 50 |
+
"max_length": 128,
|
| 51 |
+
"model_max_length": 512,
|
| 52 |
+
"never_split": null,
|
| 53 |
+
"pad_to_multiple_of": null,
|
| 54 |
+
"pad_token": "[PAD]",
|
| 55 |
+
"pad_token_type_id": 0,
|
| 56 |
+
"padding_side": "right",
|
| 57 |
+
"sep_token": "[SEP]",
|
| 58 |
+
"stride": 0,
|
| 59 |
+
"strip_accents": null,
|
| 60 |
+
"tokenize_chinese_chars": true,
|
| 61 |
+
"tokenizer_class": "BertTokenizer",
|
| 62 |
+
"truncation_side": "right",
|
| 63 |
+
"truncation_strategy": "longest_first",
|
| 64 |
+
"unk_token": "[UNK]"
|
| 65 |
+
}
|
training/browser_parity.mjs
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import assert from 'node:assert/strict';
|
| 2 |
+
import { readFile, writeFile } from 'node:fs/promises';
|
| 3 |
+
import { resolve } from 'node:path';
|
| 4 |
+
import { chromium } from '../../web/node_modules/playwright/index.mjs';
|
| 5 |
+
import { createServer } from '../../web/node_modules/vite/dist/node/index.js';
|
| 6 |
+
|
| 7 |
+
const root = import.meta.dirname;
|
| 8 |
+
const stage = resolve(root, 'stage');
|
| 9 |
+
const manifest = JSON.parse(await readFile(resolve(stage, 'runtime_manifest.json'), 'utf8'));
|
| 10 |
+
const fixtures = JSON.parse(await readFile(resolve(root, 'work/browser-fixtures.json'), 'utf8'));
|
| 11 |
+
const server = await createServer({
|
| 12 |
+
root: resolve(root, '../../web'), logLevel: 'silent',
|
| 13 |
+
server: { host: '127.0.0.1', port: 0, strictPort: false },
|
| 14 |
+
});
|
| 15 |
+
await server.listen();
|
| 16 |
+
const origin = `http://127.0.0.1:${server.httpServer.address().port}`;
|
| 17 |
+
const browser = await chromium.launch({ executablePath: '/usr/bin/chromium' });
|
| 18 |
+
try {
|
| 19 |
+
const context = await browser.newContext();
|
| 20 |
+
const requests = [];
|
| 21 |
+
context.on('request', request => requests.push({ url: request.url(), method: request.method(), body: request.postData() }));
|
| 22 |
+
await context.route('**/wording-parity', route => route.fulfill({ contentType: 'text/html', body: '<!doctype html><title>Wording runtime check</title>' }));
|
| 23 |
+
await context.route('**/wording/manifest.json', route => route.fulfill({ json: manifest }));
|
| 24 |
+
await context.route(`https://huggingface.co/${manifest.model_id}/resolve/${manifest.revision}/**`, async route => {
|
| 25 |
+
const name = route.request().url().split(`/resolve/${manifest.revision}/`)[1];
|
| 26 |
+
assert(['tokenizer.json', 'onnx/model_quantized.onnx'].includes(name));
|
| 27 |
+
await route.fulfill({ path: resolve(stage, name), headers: { 'Access-Control-Allow-Origin': '*' } });
|
| 28 |
+
});
|
| 29 |
+
const page = await context.newPage();
|
| 30 |
+
await page.goto(origin + '/wording-parity');
|
| 31 |
+
const started = performance.now();
|
| 32 |
+
const results = await page.evaluate(async ({ fixtures, origin }) => {
|
| 33 |
+
const { createWordingWorker } = await import('/src/context-wording.ts');
|
| 34 |
+
const worker = createWordingWorker();
|
| 35 |
+
const output = [];
|
| 36 |
+
try {
|
| 37 |
+
for (const fixture of fixtures) {
|
| 38 |
+
const result = await new Promise((resolve, reject) => {
|
| 39 |
+
const timeout = setTimeout(() => reject(new Error('Wording runtime timed out')), 120000);
|
| 40 |
+
worker.onmessage = ({ data }) => {
|
| 41 |
+
if (data.kind === 'error') { clearTimeout(timeout); reject(new Error(data.text)); }
|
| 42 |
+
if (data.kind === 'result') { clearTimeout(timeout); resolve(data.result); }
|
| 43 |
+
};
|
| 44 |
+
worker.onerror = event => { clearTimeout(timeout); reject(new Error(event.message)); };
|
| 45 |
+
worker.postMessage({ kind: 'check', id: fixture.id, text: fixture.text,
|
| 46 |
+
base: origin + '/wording/', wasmBase: origin + '/verifier/' });
|
| 47 |
+
});
|
| 48 |
+
output.push({ id: fixture.id, result });
|
| 49 |
+
}
|
| 50 |
+
} finally { worker.terminate(); }
|
| 51 |
+
return output;
|
| 52 |
+
}, { fixtures, origin });
|
| 53 |
+
const comparisons = results.map((item, index) => ({
|
| 54 |
+
id: item.id, expected: fixtures[index].expected_label,
|
| 55 |
+
actual: item.result.model_score === null ? null : Number(item.result.model_score >= .5),
|
| 56 |
+
model_score: item.result.model_score, token_count: item.result.token_count,
|
| 57 |
+
decision: item.result.decision, reason: item.result.reason,
|
| 58 |
+
}));
|
| 59 |
+
const scored = comparisons.filter(item => item.expected !== null);
|
| 60 |
+
const agreement = scored.filter(item => item.actual === item.expected).length / scored.length;
|
| 61 |
+
assert(agreement >= .98, `Browser/native agreement ${agreement}`);
|
| 62 |
+
assert(comparisons.at(-1).reason === 'input_too_long');
|
| 63 |
+
assert(requests.every(item => item.method === 'GET' && item.body === null));
|
| 64 |
+
assert(requests.every(item => !item.url.includes('LOCAL-WORDING-PRIVATE')));
|
| 65 |
+
const summary = { cases: scored.length, agreement, seconds_with_local_downloads: (performance.now() - started) / 1000,
|
| 66 |
+
long_input_abstained: true, source_payloads_sent: false, results: comparisons };
|
| 67 |
+
await writeFile(resolve(root, 'stage/BROWSER_PARITY.json'), JSON.stringify(summary, null, 2) + '\n');
|
| 68 |
+
console.log(JSON.stringify({ cases: scored.length, agreement, seconds: summary.seconds_with_local_downloads }));
|
| 69 |
+
} finally {
|
| 70 |
+
await browser.close();
|
| 71 |
+
await server.close();
|
| 72 |
+
}
|
training/finalize_export.py
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Evaluate the validation-selected exporter with locked model predictions."""
|
| 2 |
+
import json
|
| 3 |
+
from pathlib import Path
|
| 4 |
+
from shutil import copy2
|
| 5 |
+
|
| 6 |
+
import numpy as np
|
| 7 |
+
from transformers import AutoTokenizer
|
| 8 |
+
|
| 9 |
+
import train
|
| 10 |
+
from repair_export import logits
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
def main():
|
| 14 |
+
root = Path(__file__).resolve().parent
|
| 15 |
+
stage, work = root / "stage", root / "work"
|
| 16 |
+
repair = work / "export-repair"
|
| 17 |
+
selection = json.loads((repair / "selection.json").read_text())
|
| 18 |
+
selected = selection["selected"]
|
| 19 |
+
if not selected or not selected["eligible"]:
|
| 20 |
+
raise RuntimeError("No validation-qualified export; leave the candidate withheld")
|
| 21 |
+
if selection["repair_plan_sha256"] != train.fingerprint(root / "EXPORT_REPAIR.md"):
|
| 22 |
+
raise RuntimeError("Export repair plan changed after validation selection")
|
| 23 |
+
source = repair / f"{selected['name']}.onnx"
|
| 24 |
+
if train.fingerprint(source) != selected["sha256"]:
|
| 25 |
+
raise RuntimeError("The validation-selected graph changed")
|
| 26 |
+
evaluation = json.loads((repair / "gather-default-EVALUATION.json").read_text())
|
| 27 |
+
predictions = [json.loads(line) for line in (repair / "gather-default-test_predictions.jsonl").read_text().splitlines()]
|
| 28 |
+
tokenizer = AutoTokenizer.from_pretrained(work / "selected-native", local_files_only=True)
|
| 29 |
+
test = train.rows("test")
|
| 30 |
+
if train.fingerprint(train.BENCHMARK / "test.jsonl") != evaluation["data_lock"]["test"]["sha256"]:
|
| 31 |
+
raise RuntimeError("Test data changed")
|
| 32 |
+
assert [row["id"] for row in test] == [row["id"] for row in predictions]
|
| 33 |
+
values = logits(test, tokenizer, source, batch=1)
|
| 34 |
+
labels = values.argmax(1)
|
| 35 |
+
y = train.labels(test)
|
| 36 |
+
native = np.array([row["candidate_label"] for row in predictions])
|
| 37 |
+
calibration = json.loads((stage / "calibration.json").read_text())
|
| 38 |
+
probability = train.probability(values, calibration["temperature"])
|
| 39 |
+
metrics = train.scores(y, labels, probability)
|
| 40 |
+
keep = np.maximum(probability, 1 - probability) >= calibration["threshold"]
|
| 41 |
+
metrics["resolved_coverage"] = float(keep.mean())
|
| 42 |
+
metrics["resolved_macro_f1"] = train.scores(y[keep], labels[keep])["macro_f1"] if keep.any() else None
|
| 43 |
+
agreement = float((labels == native).mean())
|
| 44 |
+
evaluation["quantized"] = metrics
|
| 45 |
+
evaluation["native_quantized_agreement"] = agreement
|
| 46 |
+
evaluation["quantized_bytes"] = source.stat().st_size
|
| 47 |
+
evaluation["quantized_batch_size"] = 1
|
| 48 |
+
evaluation["quantized_macro_f1_gain"] = metrics["macro_f1"] - evaluation["controls"][evaluation["strongest_control"]]["macro_f1"]
|
| 49 |
+
control = np.array([row["controls"][evaluation["strongest_control"]] for row in predictions])
|
| 50 |
+
evaluation["quantized_bootstrap"] = train.bootstrap(y, labels, control, [row["group_id"] for row in test])
|
| 51 |
+
evaluation["export_repair"] = {"plan_sha256": selection["repair_plan_sha256"], "selected_settings": selected,
|
| 52 |
+
"selection_used_test": False, "timing": "Export engineering followed initial held-out native/export measurement; learned weights and calibration stayed locked."}
|
| 53 |
+
evaluation["benchmark_release"] = {"id": "Giuliocc/doxa-wording-benchmark", "revision": "bea9a3f2d53b03069b0d814094ea860d75f1c322"}
|
| 54 |
+
gate = evaluation["release_gate"]
|
| 55 |
+
gate["quantized"] = agreement >= .98 and abs(metrics["macro_f1"] - evaluation["candidate"]["macro_f1"]) <= .01
|
| 56 |
+
gate["size"] = source.stat().st_size < 40_000_000
|
| 57 |
+
gate["passed"] = gate["native"] and gate["quantized"] and gate["size"]
|
| 58 |
+
for i, row in enumerate(predictions):
|
| 59 |
+
row["quantized_label"] = int(labels[i])
|
| 60 |
+
row["quantized_model_score"] = float(probability[i])
|
| 61 |
+
row["quantized_resolved"] = bool(keep[i])
|
| 62 |
+
copy2(source, stage / "onnx/model_quantized.onnx")
|
| 63 |
+
manifest = json.loads((stage / "runtime_manifest.json").read_text())
|
| 64 |
+
manifest["files"]["weights"].update({"sha256": train.fingerprint(source), "bytes": source.stat().st_size})
|
| 65 |
+
train.write_json(stage / "runtime_manifest.json", manifest)
|
| 66 |
+
train.write_json(stage / "EVALUATION.json", evaluation)
|
| 67 |
+
train.write_json(work / "results.json", evaluation)
|
| 68 |
+
(stage / "test_predictions.jsonl").write_text("".join(json.dumps(row) + "\n" for row in predictions))
|
| 69 |
+
attempts = []
|
| 70 |
+
for name, path, graph in (("matrix_only_default", work / "initial_export_results.json", work / "initial_matrix_quantized.onnx"),
|
| 71 |
+
("matrix_gather_default", repair / "gather-default-EVALUATION.json", repair / "gather-default.onnx")):
|
| 72 |
+
receipt = json.loads(path.read_text())
|
| 73 |
+
attempts.append({"name": name, "quantized": receipt["quantized"], "native_quantized_agreement": receipt["native_quantized_agreement"],
|
| 74 |
+
"bytes": receipt["quantized_bytes"], "sha256": train.fingerprint(graph), "release_gate": receipt["release_gate"]})
|
| 75 |
+
train.write_json(stage / "EXPORT_ATTEMPTS.json", {"failed_initial_exports": attempts,
|
| 76 |
+
"final_selected_representation": selected["name"], "training_or_checkpoint_changed": False})
|
| 77 |
+
copy2(repair / "selection.json", stage / "EXPORT_VALIDATION.json")
|
| 78 |
+
eligible = [(row, prediction) for row, prediction in zip(test, predictions) if prediction["within_deployment_limit"]]
|
| 79 |
+
fixtures = [{"id": row["id"], "text": row["text"], "expected_label": prediction["quantized_label"]} for row, prediction in eligible[:128]]
|
| 80 |
+
fixtures.append({"id": "authored_long_input_control", "text": "LOCAL-WORDING-PRIVATE " + "context " * 400, "expected_label": None})
|
| 81 |
+
train.write_json(work / "browser-fixtures.json", fixtures)
|
| 82 |
+
print(json.dumps({"quantized": metrics, "native_quantized_agreement": agreement, "bytes": source.stat().st_size,
|
| 83 |
+
"release_gate": gate, "quantized_gain": evaluation["quantized_macro_f1_gain"], "quantized_bootstrap": evaluation["quantized_bootstrap"]}, indent=2))
|
| 84 |
+
|
| 85 |
+
|
| 86 |
+
if __name__ == "__main__":
|
| 87 |
+
main()
|
training/package_model.py
ADDED
|
@@ -0,0 +1,261 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Prepare model documentation and an explicit public file manifest."""
|
| 2 |
+
import hashlib
|
| 3 |
+
import json
|
| 4 |
+
from pathlib import Path
|
| 5 |
+
from shutil import copy2
|
| 6 |
+
|
| 7 |
+
from inference import WordingModel
|
| 8 |
+
|
| 9 |
+
ROOT = Path(__file__).resolve().parent
|
| 10 |
+
STAGE = ROOT / "stage"
|
| 11 |
+
PROJECT = ROOT.parents[1]
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
def write_json(path, value):
|
| 15 |
+
path.write_text(json.dumps(value, ensure_ascii=False, indent=2) + "\n")
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
def main():
|
| 19 |
+
evaluation = json.loads((STAGE / "EVALUATION.json").read_text())
|
| 20 |
+
manifest = json.loads((STAGE / "runtime_manifest.json").read_text())
|
| 21 |
+
gate = evaluation["release_gate"]
|
| 22 |
+
if not gate["passed"]:
|
| 23 |
+
raise RuntimeError("The candidate failed the registered promotion gate")
|
| 24 |
+
if not (STAGE / "BROWSER_PARITY.json").exists():
|
| 25 |
+
raise RuntimeError("Browser parity is pending")
|
| 26 |
+
parity = json.loads((STAGE / "BROWSER_PARITY.json").read_text())
|
| 27 |
+
if parity["agreement"] < .98:
|
| 28 |
+
raise RuntimeError("Browser parity failed")
|
| 29 |
+
for name in ("EVALUATION_REGISTRATION.md", "EVALUATION_AMENDMENT_1.md", "EXPORT_PLAN.md", "EXPORT_REPAIR.md", "REPRODUCE.md", "requirements.txt", "NOTICE", "inference.py"):
|
| 30 |
+
copy2(ROOT / name, STAGE / name)
|
| 31 |
+
copy2(PROJECT / "LICENSE", STAGE / "LICENSE")
|
| 32 |
+
(STAGE / "training").mkdir(exist_ok=True)
|
| 33 |
+
for name in ("train.py", "repair_export.py", "finalize_export.py", "browser_parity.mjs", "package_model.py"):
|
| 34 |
+
copy2(ROOT / name, STAGE / "training" / name)
|
| 35 |
+
copy2(ROOT / "work/training_history.json", STAGE / "training_history.json")
|
| 36 |
+
copy2(ROOT / "work/validation_controls.json", STAGE / "validation_controls.json")
|
| 37 |
+
model = WordingModel(STAGE)
|
| 38 |
+
examples = [
|
| 39 |
+
("factual_statement", "The committee voted six to four to approve the policy."),
|
| 40 |
+
("evaluative_wording", "The committee's reckless and disgraceful policy betrayed every resident."),
|
| 41 |
+
("attributed_judgment", "The minister called the policy reckless; the report attributed that judgment to her."),
|
| 42 |
+
]
|
| 43 |
+
illustration = [{"id": key, "origin": "original_fictional_illustration", "text": text, "result": model.check(text)} for key, text in examples]
|
| 44 |
+
write_json(STAGE / "illustrations.json", illustration)
|
| 45 |
+
predictions = [json.loads(line) for line in (STAGE / "test_predictions.jsonl").read_text().splitlines()]
|
| 46 |
+
errors = sorted((row for row in predictions if row["candidate_label"] != row["reference_label"]),
|
| 47 |
+
key=lambda row: max(row["model_score"], 1 - row["model_score"]), reverse=True)
|
| 48 |
+
write_json(STAGE / "errors.json", {"errors": len(errors), "most_confident_errors": errors[:20],
|
| 49 |
+
"text_policy": "Review source IDs through the linked benchmark; article text is excluded from this package."})
|
| 50 |
+
candidate = evaluation["candidate"]
|
| 51 |
+
quantized = evaluation["quantized"]
|
| 52 |
+
interval = evaluation["bootstrap"]["gain_interval_95"]
|
| 53 |
+
selected = evaluation["selected_pipeline"]
|
| 54 |
+
role = "full encoder and classification head fine-tuning" if selected == "fine_tuned_encoder" else "a trained logistic head over a frozen mean-pooled MiniLM encoder"
|
| 55 |
+
table = "\n".join(f"| {name} | {row['macro_f1']:.3f} | {row['accuracy']:.3f} |" for name, row in evaluation["controls"].items())
|
| 56 |
+
table += f"\n| Selected contextual pipeline | {candidate['macro_f1']:.3f} | {candidate['accuracy']:.3f} |"
|
| 57 |
+
table += f"\n| Quantized browser model | {quantized['macro_f1']:.3f} | {quantized['accuracy']:.3f} |"
|
| 58 |
+
report = f"""# Contextual wording evaluation
|
| 59 |
+
|
| 60 |
+
The selected pipeline uses {role}. Selection used validation macro-F1 after
|
| 61 |
+
the fixed search. The held-out cohort contains 384 upstream expert-majority
|
| 62 |
+
judgments in {evaluation['bootstrap']['groups']} article/source components.
|
| 63 |
+
|
| 64 |
+
| Pipeline | Test macro-F1 | Accuracy |
|
| 65 |
+
|---|---:|---:|
|
| 66 |
+
{table}
|
| 67 |
+
|
| 68 |
+
The existing DOXA framing head is a task-mismatch proxy: its binary control
|
| 69 |
+
uses present/(present+absent), with original abstention states retained in
|
| 70 |
+
the JSON receipt. It was trained for the broader evaluative-framing review
|
| 71 |
+
criterion. The strongest control here was the character TF-IDF wording
|
| 72 |
+
classifier, so the reported improvement does not depend on that proxy.
|
| 73 |
+
|
| 74 |
+
The selected pipeline's gain over the strongest lexical/current-model control
|
| 75 |
+
was {evaluation['macro_f1_gain']:.4f}. Its paired 95% source-group bootstrap
|
| 76 |
+
interval was [{interval[0]:.4f}, {interval[1]:.4f}], using 2,000 draws.
|
| 77 |
+
The registered minimum gain was 0.02 with a positive lower bound.
|
| 78 |
+
|
| 79 |
+
The deployed quantized model's point gain over that control was
|
| 80 |
+
{evaluation['quantized_macro_f1_gain']:.4f}. Its separately reported 95%
|
| 81 |
+
group-bootstrap interval was
|
| 82 |
+
[{evaluation['quantized_bootstrap']['gain_interval_95'][0]:.4f}, {evaluation['quantized_bootstrap']['gain_interval_95'][1]:.4f}].
|
| 83 |
+
That interval includes zero. The native model's positive interval and the
|
| 84 |
+
registered quantization-parity gate support this provisional release;
|
| 85 |
+
standalone superiority of the browser export at 95% is not established.
|
| 86 |
+
|
| 87 |
+
Fine-tuning's observed macro-F1 difference from the frozen contextual pipeline
|
| 88 |
+
was {evaluation['fine_tuning_gain_over_frozen']:.4f}. Both contextual pipelines
|
| 89 |
+
were evaluated after validation selection. That comparison remains distinct
|
| 90 |
+
from the product promotion gate. The original gate and its pre-test amendment
|
| 91 |
+
are published alongside the export plan.
|
| 92 |
+
|
| 93 |
+
The initial matrix-only and default matrix-plus-embedding quantized exports
|
| 94 |
+
failed parity. After those held-out measurements, a bounded four-setting
|
| 95 |
+
exporter comparison used validation passages to select per-channel,
|
| 96 |
+
reduced-range QInt8. The final graph uses singleton inference matching the
|
| 97 |
+
browser. Learned weights, calibration and registered release thresholds
|
| 98 |
+
stayed fixed. EXPORT_REPAIR.md, EXPORT_VALIDATION.json and
|
| 99 |
+
EXPORT_ATTEMPTS.json preserve the process and failures. The export repair
|
| 100 |
+
occurred after initial held-out measurement; it is not a second untouched
|
| 101 |
+
model-selection experiment.
|
| 102 |
+
|
| 103 |
+
Quantized/native class agreement was {evaluation['native_quantized_agreement']:.3%}.
|
| 104 |
+
The quantized graph is {evaluation['quantized_bytes']:,} bytes. Browser/native
|
| 105 |
+
agreement was {parity['agreement']:.3%} over {parity['cases']} deterministic cases.
|
| 106 |
+
Input above 256 tokens returns unresolved in the browser. Test input-limit
|
| 107 |
+
counts are recorded in EVALUATION.json. Scores were temperature-scaled on
|
| 108 |
+
validation and the uncertainty threshold was selected there. These model
|
| 109 |
+
scores need validation for additional populations and genres.
|
| 110 |
+
The temperature grid was fitted on the native validation outputs and chose
|
| 111 |
+
1.0, which leaves logits unchanged. The native validation outputs also chose
|
| 112 |
+
the 0.70 resolution threshold. The exported graph uses those same locked
|
| 113 |
+
settings; it has no separately fitted calibration. Its held-out Brier score
|
| 114 |
+
was {quantized['brier']:.3f}, negative log likelihood
|
| 115 |
+
{quantized['negative_log_likelihood']:.3f} and 10-bin ECE
|
| 116 |
+
{quantized['ece_10_bins']:.3f}. Its resolved coverage was
|
| 117 |
+
{quantized['resolved_coverage']:.1%}, with resolved macro-F1
|
| 118 |
+
{quantized['resolved_macro_f1']:.3f}. These coverage figures are distinct from
|
| 119 |
+
full-cohort quality and are not model confidence guarantees.
|
| 120 |
+
|
| 121 |
+
## Data and interpretation
|
| 122 |
+
|
| 123 |
+
The benchmark contains human wording judgments from BABE. DOXA added no new
|
| 124 |
+
human annotations. It uses article URLs and exact/near-duplicate components
|
| 125 |
+
to separate roles. The same outlets can occur across roles. Source metadata
|
| 126 |
+
has known imperfections, including an upstream topic/link mismatch for case
|
| 127 |
+
`babe-sg2-00611`. This is an article-group evaluation within the collected
|
| 128 |
+
outlets, with those source limitations retained.
|
| 129 |
+
|
| 130 |
+
The input is the supplied sentence/passage text. Outlet, topic, source IDs,
|
| 131 |
+
annotators, reference labels and rationales stay outside the model input.
|
| 132 |
+
Additional document context has no supervised BABE wording label here.
|
| 133 |
+
English news is the evaluated genre. Academic papers, historical speech,
|
| 134 |
+
translation, other languages and different political settings require
|
| 135 |
+
separate validation. A wording flag can describe advocacy, criticism,
|
| 136 |
+
quotation or an allegation that is warranted in context.
|
| 137 |
+
|
| 138 |
+
No author ideology, prejudice category, factual-truth score or political
|
| 139 |
+
neutrality certification follows from this binary wording screen. Use the
|
| 140 |
+
other DOXA criteria and the original sources for their declared tasks.
|
| 141 |
+
Review disagreements and the ID-only error records before drawing a finding.
|
| 142 |
+
"""
|
| 143 |
+
(STAGE / "EVALUATION.md").write_text(report)
|
| 144 |
+
card = f"""---
|
| 145 |
+
language: en
|
| 146 |
+
license: apache-2.0
|
| 147 |
+
library_name: transformers
|
| 148 |
+
pipeline_tag: text-classification
|
| 149 |
+
base_model: sentence-transformers/all-MiniLM-L6-v2
|
| 150 |
+
datasets:
|
| 151 |
+
- Giuliocc/doxa-wording-benchmark
|
| 152 |
+
tags:
|
| 153 |
+
- political-discourse
|
| 154 |
+
- media-bias
|
| 155 |
+
- wording
|
| 156 |
+
- onnx
|
| 157 |
+
- contextual-review
|
| 158 |
+
---
|
| 159 |
+
|
| 160 |
+
# DOXA contextual wording encoder
|
| 161 |
+
|
| 162 |
+
Check wording in a supplied English passage with a compact contextual model,
|
| 163 |
+
then read the speaker, evidence and surrounding context. The selected model
|
| 164 |
+
uses {role}. Its original source task is BABE's expert-majority word-choice
|
| 165 |
+
bias judgment. It returns a wording flag, no wording flag or an unresolved
|
| 166 |
+
result under the published uncertainty threshold.
|
| 167 |
+
|
| 168 |
+
[Use DOXA](https://doxa.tacitus.me/) · [TACITUS](https://tacitus.me/doxa/)
|
| 169 |
+
· [GitHub](https://github.com/sargonxg/DOXA-by-TACITUS)
|
| 170 |
+
· [Benchmark](https://huggingface.co/datasets/Giuliocc/doxa-wording-benchmark)
|
| 171 |
+
· [Evaluation and limits](EVALUATION.md)
|
| 172 |
+
|
| 173 |
+
The selected native pipeline reached **{candidate['macro_f1']:.3f} macro-F1**
|
| 174 |
+
on 384 judgments from held-out source groups. Its gain over the strongest lexical
|
| 175 |
+
or current DOXA control was {evaluation['macro_f1_gain']:.3f}, with paired
|
| 176 |
+
95% group-bootstrap interval [{interval[0]:.3f}, {interval[1]:.3f}]. The
|
| 177 |
+
quantized model reached {quantized['macro_f1']:.3f}. Inspect the complete
|
| 178 |
+
control table, failures and coverage in the evaluation report.
|
| 179 |
+
The quantized export's own 95% gain interval includes zero; its point gain
|
| 180 |
+
and native-model parity support a provisional wording screen, with further
|
| 181 |
+
independent evaluation needed.
|
| 182 |
+
|
| 183 |
+
## Local inference
|
| 184 |
+
|
| 185 |
+
The browser uses the checked quantized ONNX graph and tokenizer, totaling
|
| 186 |
+
about {evaluation['quantized_bytes']/1_000_000:.1f} MB of model weights.
|
| 187 |
+
Inference runs locally after the public asset download. The Python
|
| 188 |
+
`inference.py` helper uses ONNX Runtime and the published runtime manifest.
|
| 189 |
+
The native Transformer head returns two class logits. The helper and browser
|
| 190 |
+
apply the validation temperature and uncertainty threshold, and retain input
|
| 191 |
+
limits in their structured result.
|
| 192 |
+
|
| 193 |
+
```python
|
| 194 |
+
from inference import WordingModel
|
| 195 |
+
model = WordingModel("path/to/downloaded/model")
|
| 196 |
+
result = model.check("The committee voted six to four to approve the policy.")
|
| 197 |
+
print(result)
|
| 198 |
+
```
|
| 199 |
+
|
| 200 |
+
`model_score` is the positive wording class's score after validation
|
| 201 |
+
temperature scaling. The output records that calibration method, resolution
|
| 202 |
+
threshold and actual token count. Input longer than 256 tokens is unresolved.
|
| 203 |
+
Long documents require passage selection and source context, as in DOXA Lab.
|
| 204 |
+
The [fictional illustrations](illustrations.json) contain actual outputs and
|
| 205 |
+
retain their authored provenance.
|
| 206 |
+
|
| 207 |
+
## Training and source provenance
|
| 208 |
+
|
| 209 |
+
The benchmark's 3,639 admitted judgments retain original expert votes,
|
| 210 |
+
strict majority admission and source-group roles. Article text was restored
|
| 211 |
+
locally from the pinned upstream source for training. Public model artifacts
|
| 212 |
+
contain IDs and predictions in place of article excerpts. The original
|
| 213 |
+
source's licenses and article rights are documented by the benchmark.
|
| 214 |
+
|
| 215 |
+
The base encoder is pinned at
|
| 216 |
+
`1110a243fdf4706b3f48f1d95db1a4f5529b4d41` under Apache-2.0. Training used
|
| 217 |
+
local CPU compute, seed 1729 and zero new spend. The registration, amendment,
|
| 218 |
+
export plan, training history and code are included. Reproduction needs the
|
| 219 |
+
DOXA project source, the benchmark restoration recipe and the pinned Python
|
| 220 |
+
dependencies. Keep restored article text in the local benchmark workspace.
|
| 221 |
+
See [REPRODUCE.md](REPRODUCE.md) for the complete experiment and export steps.
|
| 222 |
+
The public benchmark release is pinned at
|
| 223 |
+
`bea9a3f2d53b03069b0d814094ea860d75f1c322` (tag `v0.1.0`).
|
| 224 |
+
|
| 225 |
+
The admitted split contains 2,950 training, 305 validation and 384 held-out
|
| 226 |
+
judgments. Fixed search used learning rates 2e-5 and 5e-5, three epochs
|
| 227 |
+
each, AdamW, balanced cross entropy and 256-token input. Validation selected
|
| 228 |
+
learning rate 5e-5 at epoch 2. Candidate and frozen controls use the passage
|
| 229 |
+
text alone; annotator votes, source, outlet and topic stay outside features.
|
| 230 |
+
|
| 231 |
+
## Scope
|
| 232 |
+
|
| 233 |
+
This is a provisional wording screen for contextual review. Its evaluated
|
| 234 |
+
genre is sampled English news. Academic papers and other domains need
|
| 235 |
+
separate validation. A positive wording judgment can occur in legitimate
|
| 236 |
+
criticism, declared advocacy or attributed speech. Read the original source
|
| 237 |
+
and preserve supported political meaning when considering a revision.
|
| 238 |
+
|
| 239 |
+
The current dataset supports a binary wording task. Other prejudice,
|
| 240 |
+
research-validity and comparative-bias questions need their own evidence
|
| 241 |
+
and labels. The same news outlets can occur in training and test roles, and
|
| 242 |
+
known source-URL imperfections remain documented. Additional independent
|
| 243 |
+
evaluation is needed before broad service-quality claims.
|
| 244 |
+
"""
|
| 245 |
+
if selected != "fine_tuned_encoder":
|
| 246 |
+
card = card.replace("library_name: transformers", "library_name: onnxruntime")
|
| 247 |
+
(STAGE / "README.md").write_text(card)
|
| 248 |
+
scope = "A provisional screen trained on English news sentences labeled for wording bias. Academic and other genres require separate validation. Read the surrounding context."
|
| 249 |
+
manifest["scope"] = scope
|
| 250 |
+
write_json(STAGE / "runtime_manifest.json", manifest)
|
| 251 |
+
space = ROOT / "space"
|
| 252 |
+
space.mkdir(exist_ok=True)
|
| 253 |
+
write_json(space / "manifest.json", manifest)
|
| 254 |
+
public = sorted({path.relative_to(STAGE).as_posix() for path in STAGE.rglob("*") if path.is_file()} | {"SHA256SUMS"})
|
| 255 |
+
(ROOT / "PUBLIC_FILES.json").write_text(json.dumps(public, indent=2) + "\n")
|
| 256 |
+
(STAGE / "SHA256SUMS").write_text("".join(f"{hashlib.sha256((STAGE/name).read_bytes()).hexdigest()} {name}\n" for name in public if name != "SHA256SUMS"))
|
| 257 |
+
print(json.dumps({"selected_pipeline": selected, "files": len(public), "gate": gate, "new_spend_usd": 0}))
|
| 258 |
+
|
| 259 |
+
|
| 260 |
+
if __name__ == "__main__":
|
| 261 |
+
main()
|
training/repair_export.py
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Select a faithful ONNX representation using validation input only."""
|
| 2 |
+
import hashlib
|
| 3 |
+
import json
|
| 4 |
+
from pathlib import Path
|
| 5 |
+
from shutil import copy2
|
| 6 |
+
|
| 7 |
+
import numpy as np
|
| 8 |
+
import onnxruntime as ort
|
| 9 |
+
from onnxruntime.quantization import QuantType, quantize_dynamic
|
| 10 |
+
import torch
|
| 11 |
+
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
| 12 |
+
|
| 13 |
+
import train
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
def logits(data, tokenizer, path, batch):
|
| 17 |
+
options = ort.SessionOptions()
|
| 18 |
+
options.intra_op_num_threads = 3
|
| 19 |
+
options.inter_op_num_threads = 1
|
| 20 |
+
session = ort.InferenceSession(str(path), sess_options=options, providers=["CPUExecutionProvider"])
|
| 21 |
+
output = []
|
| 22 |
+
for _, tokens in train.token_batches(data, tokenizer, batch=batch):
|
| 23 |
+
output.append(session.run(None, {item.name: tokens[item.name].numpy() for item in session.get_inputs()})[0])
|
| 24 |
+
return np.concatenate(output)
|
| 25 |
+
|
| 26 |
+
|
| 27 |
+
def main():
|
| 28 |
+
root = Path(__file__).resolve().parent
|
| 29 |
+
work = root / "work"
|
| 30 |
+
export = work / "export-repair"
|
| 31 |
+
export.mkdir(exist_ok=True)
|
| 32 |
+
for name in ("EVALUATION.json", "test_predictions.jsonl", "runtime_manifest.json"):
|
| 33 |
+
copy2(root / "stage" / name, export / f"gather-default-{name}")
|
| 34 |
+
copy2(root / "stage/onnx/model_quantized.onnx", export / "gather-default.onnx")
|
| 35 |
+
torch.set_num_threads(3)
|
| 36 |
+
torch.set_num_interop_threads(1)
|
| 37 |
+
tokenizer = AutoTokenizer.from_pretrained(work / "selected-native", local_files_only=True)
|
| 38 |
+
model = AutoModelForSequenceClassification.from_pretrained(work / "selected-native", local_files_only=True,
|
| 39 |
+
attn_implementation="eager")
|
| 40 |
+
validation = train.rows("validation")
|
| 41 |
+
native = train.native_logits(validation, tokenizer, model)
|
| 42 |
+
reference = native.argmax(1)
|
| 43 |
+
y = train.labels(validation)
|
| 44 |
+
results = []
|
| 45 |
+
for per_channel in (False, True):
|
| 46 |
+
for reduce_range in (False, True):
|
| 47 |
+
name = f"per_channel_{int(per_channel)}-reduce_range_{int(reduce_range)}"
|
| 48 |
+
path = export / f"{name}.onnx"
|
| 49 |
+
quantize_dynamic(str(work / "model.onnx"), str(path), op_types_to_quantize=["MatMul", "Gemm", "Gather"],
|
| 50 |
+
weight_type=QuantType.QInt8, per_channel=per_channel, reduce_range=reduce_range)
|
| 51 |
+
singleton = logits(validation, tokenizer, path, batch=1)
|
| 52 |
+
batched = logits(validation, tokenizer, path, batch=16)
|
| 53 |
+
metrics = train.scores(y, singleton.argmax(1))
|
| 54 |
+
agreement = float((singleton.argmax(1) == reference).mean())
|
| 55 |
+
mae = float(np.abs(train.probability(singleton) - train.probability(native)).mean())
|
| 56 |
+
row = {"name": name, "per_channel": per_channel, "reduce_range": reduce_range,
|
| 57 |
+
"validation": metrics, "native_agreement": agreement, "probability_mae": mae,
|
| 58 |
+
"batch_16_native_agreement": float((batched.argmax(1) == reference).mean()),
|
| 59 |
+
"singleton_batch16_agreement": float((singleton.argmax(1) == batched.argmax(1)).mean()),
|
| 60 |
+
"bytes": path.stat().st_size, "sha256": train.fingerprint(path)}
|
| 61 |
+
row["eligible"] = agreement >= .98 and abs(metrics["macro_f1"] - train.scores(y, reference)["macro_f1"]) <= .01 and row["bytes"] < 40_000_000
|
| 62 |
+
results.append(row)
|
| 63 |
+
print(json.dumps(row), flush=True)
|
| 64 |
+
eligible = [row for row in results if row["eligible"]]
|
| 65 |
+
selected = max(eligible, key=lambda row: (row["native_agreement"], -row["probability_mae"], -row["bytes"])) if eligible else None
|
| 66 |
+
report = {"repair_plan_sha256": train.fingerprint(root / "EXPORT_REPAIR.md"),
|
| 67 |
+
"validation_sha256": train.fingerprint(train.BENCHMARK / "validation.jsonl"),
|
| 68 |
+
"native_validation": train.scores(y, reference), "results": results, "selected": selected,
|
| 69 |
+
"test_used_for_export_selection": False, "training_changed": False}
|
| 70 |
+
train.write_json(export / "selection.json", report)
|
| 71 |
+
print(json.dumps({"selected": selected}), flush=True)
|
| 72 |
+
|
| 73 |
+
|
| 74 |
+
if __name__ == "__main__":
|
| 75 |
+
main()
|
training/train.py
ADDED
|
@@ -0,0 +1,461 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Fit and evaluate the preregistered CPU contextual wording experiment."""
|
| 2 |
+
from __future__ import annotations
|
| 3 |
+
|
| 4 |
+
from argparse import ArgumentParser
|
| 5 |
+
import hashlib
|
| 6 |
+
import json
|
| 7 |
+
from pathlib import Path
|
| 8 |
+
import random
|
| 9 |
+
import shutil
|
| 10 |
+
import sys
|
| 11 |
+
import time
|
| 12 |
+
|
| 13 |
+
import joblib
|
| 14 |
+
import numpy as np
|
| 15 |
+
import onnxruntime as ort
|
| 16 |
+
from onnxruntime.quantization import QuantType, quantize_dynamic
|
| 17 |
+
from scipy.sparse import hstack
|
| 18 |
+
from sklearn.feature_extraction.text import TfidfVectorizer
|
| 19 |
+
from sklearn.linear_model import LogisticRegression
|
| 20 |
+
from sklearn.metrics import accuracy_score, brier_score_loss, f1_score, log_loss
|
| 21 |
+
from threadpoolctl import threadpool_limits
|
| 22 |
+
import torch
|
| 23 |
+
from torch.utils.data import DataLoader
|
| 24 |
+
from transformers import AutoModel, AutoModelForSequenceClassification, AutoTokenizer, get_linear_schedule_with_warmup
|
| 25 |
+
from huggingface_hub import snapshot_download
|
| 26 |
+
|
| 27 |
+
ROOT = Path(__file__).resolve().parent
|
| 28 |
+
PROJECT = ROOT.parents[1]
|
| 29 |
+
BENCHMARK = PROJECT / "improvement_release/benchmark/local/frozen"
|
| 30 |
+
BASE_ID = "sentence-transformers/all-MiniLM-L6-v2"
|
| 31 |
+
BASE_REVISION = "1110a243fdf4706b3f48f1d95db1a4f5529b4d41"
|
| 32 |
+
SEED = 1729
|
| 33 |
+
MAX_LENGTH = 256
|
| 34 |
+
BATCH_SIZE = 16
|
| 35 |
+
THREADS = 3
|
| 36 |
+
WORK = ROOT / "work"
|
| 37 |
+
STAGE = ROOT / "stage"
|
| 38 |
+
CLASSES = {0: "no_biased_wording", 1: "biased_wording"}
|
| 39 |
+
|
| 40 |
+
|
| 41 |
+
def write_json(path, value):
|
| 42 |
+
path.parent.mkdir(parents=True, exist_ok=True)
|
| 43 |
+
path.write_text(json.dumps(value, ensure_ascii=False, indent=2) + "\n")
|
| 44 |
+
|
| 45 |
+
|
| 46 |
+
def fingerprint(path):
|
| 47 |
+
return hashlib.sha256(path.read_bytes()).hexdigest()
|
| 48 |
+
|
| 49 |
+
|
| 50 |
+
def seed_all():
|
| 51 |
+
random.seed(SEED)
|
| 52 |
+
np.random.seed(SEED)
|
| 53 |
+
torch.manual_seed(SEED)
|
| 54 |
+
|
| 55 |
+
|
| 56 |
+
def rows(split):
|
| 57 |
+
return [json.loads(line) for line in (BENCHMARK / f"{split}.jsonl").read_text().splitlines() if line]
|
| 58 |
+
|
| 59 |
+
|
| 60 |
+
def labels(data):
|
| 61 |
+
return np.array([int(row["label"]) for row in data], dtype=np.int64)
|
| 62 |
+
|
| 63 |
+
|
| 64 |
+
def scores(y, prediction, probability=None):
|
| 65 |
+
result = {
|
| 66 |
+
"rows": len(y), "macro_f1": float(f1_score(y, prediction, average="macro", labels=[0, 1], zero_division=0)),
|
| 67 |
+
"accuracy": float(accuracy_score(y, prediction)),
|
| 68 |
+
"per_class_f1": {CLASSES[i]: float(value) for i, value in enumerate(f1_score(y, prediction, average=None, labels=[0, 1], zero_division=0))},
|
| 69 |
+
}
|
| 70 |
+
if probability is not None:
|
| 71 |
+
probability = np.clip(probability, 1e-7, 1 - 1e-7)
|
| 72 |
+
result["brier"] = float(brier_score_loss(y, probability))
|
| 73 |
+
result["negative_log_likelihood"] = float(log_loss(y, probability, labels=[0, 1]))
|
| 74 |
+
confidence = np.maximum(probability, 1 - probability)
|
| 75 |
+
correct = prediction == y
|
| 76 |
+
ece = 0.0
|
| 77 |
+
for lo in np.linspace(0, .9, 10):
|
| 78 |
+
mask = (confidence >= lo) & (confidence < lo + .1 + 1e-8)
|
| 79 |
+
if mask.any():
|
| 80 |
+
ece += mask.mean() * abs(correct[mask].mean() - confidence[mask].mean())
|
| 81 |
+
result["ece_10_bins"] = float(ece)
|
| 82 |
+
return result
|
| 83 |
+
|
| 84 |
+
|
| 85 |
+
def probability(logits, temperature=1.0):
|
| 86 |
+
values = logits / temperature
|
| 87 |
+
values = np.exp(values - values.max(axis=1, keepdims=True))
|
| 88 |
+
return (values / values.sum(axis=1, keepdims=True))[:, 1]
|
| 89 |
+
|
| 90 |
+
|
| 91 |
+
def token_batches(data, tokenizer, batch=32):
|
| 92 |
+
for start in range(0, len(data), batch):
|
| 93 |
+
selected = data[start:start + batch]
|
| 94 |
+
tokens = tokenizer([row["text"] for row in selected], padding=True, truncation=True,
|
| 95 |
+
max_length=MAX_LENGTH, return_tensors="pt")
|
| 96 |
+
yield selected, tokens
|
| 97 |
+
|
| 98 |
+
|
| 99 |
+
def embeddings(data, tokenizer, model):
|
| 100 |
+
model.eval()
|
| 101 |
+
output = []
|
| 102 |
+
with torch.inference_mode():
|
| 103 |
+
for _, tokens in token_batches(data, tokenizer):
|
| 104 |
+
hidden = model(**tokens).last_hidden_state
|
| 105 |
+
mask = tokens["attention_mask"].unsqueeze(-1)
|
| 106 |
+
pooled = (hidden * mask).sum(1) / mask.sum(1).clamp(min=1)
|
| 107 |
+
pooled = torch.nn.functional.normalize(pooled, dim=1)
|
| 108 |
+
output.append(pooled.numpy())
|
| 109 |
+
return np.concatenate(output)
|
| 110 |
+
|
| 111 |
+
|
| 112 |
+
def native_logits(data, tokenizer, model):
|
| 113 |
+
model.eval()
|
| 114 |
+
output = []
|
| 115 |
+
with torch.inference_mode():
|
| 116 |
+
for _, tokens in token_batches(data, tokenizer):
|
| 117 |
+
value = model(**tokens)
|
| 118 |
+
output.append((value if isinstance(value, torch.Tensor) else value.logits).numpy())
|
| 119 |
+
return np.concatenate(output)
|
| 120 |
+
|
| 121 |
+
|
| 122 |
+
def logistic(train_x, y_train, validation_x, y_validation):
|
| 123 |
+
best = None
|
| 124 |
+
for c in (.1, 1., 10.):
|
| 125 |
+
fit = LogisticRegression(C=c, max_iter=2000, class_weight="balanced", solver="liblinear", random_state=SEED)
|
| 126 |
+
with threadpool_limits(limits=1):
|
| 127 |
+
fit.fit(train_x, y_train)
|
| 128 |
+
metric = scores(y_validation, fit.predict(validation_x))["macro_f1"]
|
| 129 |
+
if best is None or metric > best["validation_macro_f1"]:
|
| 130 |
+
best = {"fit": fit, "C": c, "validation_macro_f1": metric}
|
| 131 |
+
return best
|
| 132 |
+
|
| 133 |
+
|
| 134 |
+
def fit_controls(train, validation, tokenizer, base_path):
|
| 135 |
+
cached = WORK / "controls.joblib"
|
| 136 |
+
expected = {split: fingerprint(BENCHMARK / f"{split}.jsonl") for split in ("train", "validation")}
|
| 137 |
+
if cached.exists():
|
| 138 |
+
value = joblib.load(cached)
|
| 139 |
+
if value.get("data_fingerprints") == expected:
|
| 140 |
+
return value["word"], value["char"], value["controls"]
|
| 141 |
+
y_train, y_validation = labels(train), labels(validation)
|
| 142 |
+
train_text, validation_text = [row["text"] for row in train], [row["text"] for row in validation]
|
| 143 |
+
word = TfidfVectorizer(ngram_range=(1, 2), min_df=2, max_df=.98, max_features=50000, sublinear_tf=True)
|
| 144 |
+
char = TfidfVectorizer(analyzer="char_wb", ngram_range=(3, 5), min_df=3, max_features=80000, sublinear_tf=True)
|
| 145 |
+
word_train, word_validation = word.fit_transform(train_text), word.transform(validation_text)
|
| 146 |
+
char_train, char_validation = char.fit_transform(train_text), char.transform(validation_text)
|
| 147 |
+
controls = {
|
| 148 |
+
"word_tfidf": logistic(word_train, y_train, word_validation, y_validation),
|
| 149 |
+
"character_tfidf": logistic(char_train, y_train, char_validation, y_validation),
|
| 150 |
+
"word_character_tfidf": logistic(hstack([word_train, char_train]), y_train,
|
| 151 |
+
hstack([word_validation, char_validation]), y_validation),
|
| 152 |
+
}
|
| 153 |
+
print("Encoding frozen MiniLM controls", flush=True)
|
| 154 |
+
encoder = AutoModel.from_pretrained(base_path, local_files_only=True, attn_implementation="eager")
|
| 155 |
+
train_embeddings = embeddings(train, tokenizer, encoder)
|
| 156 |
+
validation_embeddings = embeddings(validation, tokenizer, encoder)
|
| 157 |
+
controls["frozen_encoder_logistic"] = logistic(train_embeddings, y_train, validation_embeddings, y_validation)
|
| 158 |
+
del encoder
|
| 159 |
+
joblib.dump({"word": word, "char": char, "controls": controls, "data_fingerprints": expected}, cached)
|
| 160 |
+
write_json(WORK / "validation_controls.json", {key: {k: v for k, v in row.items() if k != "fit"} for key, row in controls.items()})
|
| 161 |
+
return word, char, controls
|
| 162 |
+
|
| 163 |
+
|
| 164 |
+
def fit_candidate(train, validation, tokenizer, base_path):
|
| 165 |
+
best = -1.0
|
| 166 |
+
history = []
|
| 167 |
+
best_dir = WORK / "selected-native"
|
| 168 |
+
y_validation = labels(validation)
|
| 169 |
+
counts = np.bincount(labels(train), minlength=2)
|
| 170 |
+
class_weights = torch.tensor(len(train) / (2 * counts), dtype=torch.float32)
|
| 171 |
+
|
| 172 |
+
def collate(batch):
|
| 173 |
+
tokens = tokenizer([row["text"] for row in batch], padding=True, truncation=True,
|
| 174 |
+
max_length=MAX_LENGTH, return_tensors="pt")
|
| 175 |
+
tokens["labels"] = torch.tensor([row["label"] for row in batch], dtype=torch.long)
|
| 176 |
+
return tokens
|
| 177 |
+
|
| 178 |
+
for learning_rate in (2e-5, 5e-5):
|
| 179 |
+
seed_all()
|
| 180 |
+
model = AutoModelForSequenceClassification.from_pretrained(base_path, num_labels=2, id2label=CLASSES,
|
| 181 |
+
label2id={value: key for key, value in CLASSES.items()}, local_files_only=True, attn_implementation="eager")
|
| 182 |
+
generator = torch.Generator().manual_seed(SEED)
|
| 183 |
+
loader = DataLoader(train, batch_size=BATCH_SIZE, shuffle=True, collate_fn=collate, generator=generator)
|
| 184 |
+
optimizer = torch.optim.AdamW(model.parameters(), lr=learning_rate, weight_decay=.01)
|
| 185 |
+
steps = 3 * len(loader)
|
| 186 |
+
scheduler = get_linear_schedule_with_warmup(optimizer, num_warmup_steps=int(.1 * steps), num_training_steps=steps)
|
| 187 |
+
for epoch in range(1, 4):
|
| 188 |
+
started = time.perf_counter()
|
| 189 |
+
model.train()
|
| 190 |
+
loss_sum = 0.0
|
| 191 |
+
for tokens in loader:
|
| 192 |
+
y = tokens.pop("labels")
|
| 193 |
+
optimizer.zero_grad(set_to_none=True)
|
| 194 |
+
logits = model(**tokens).logits
|
| 195 |
+
loss = torch.nn.functional.cross_entropy(logits, y, weight=class_weights)
|
| 196 |
+
loss.backward()
|
| 197 |
+
torch.nn.utils.clip_grad_norm_(model.parameters(), 1.0)
|
| 198 |
+
optimizer.step()
|
| 199 |
+
scheduler.step()
|
| 200 |
+
loss_sum += float(loss.detach())
|
| 201 |
+
logits = native_logits(validation, tokenizer, model)
|
| 202 |
+
metric = scores(y_validation, logits.argmax(1))
|
| 203 |
+
row = {"learning_rate": learning_rate, "epoch": epoch, "training_loss": loss_sum / len(loader),
|
| 204 |
+
"validation": metric, "seconds": time.perf_counter() - started}
|
| 205 |
+
history.append(row)
|
| 206 |
+
print(json.dumps(row), flush=True)
|
| 207 |
+
write_json(WORK / "training_history.json", history)
|
| 208 |
+
if metric["macro_f1"] > best:
|
| 209 |
+
best = metric["macro_f1"]
|
| 210 |
+
model.save_pretrained(best_dir, safe_serialization=True)
|
| 211 |
+
tokenizer.save_pretrained(best_dir)
|
| 212 |
+
write_json(best_dir / "selection.json", row)
|
| 213 |
+
del model, optimizer, scheduler
|
| 214 |
+
return best_dir
|
| 215 |
+
|
| 216 |
+
|
| 217 |
+
def calibrate(validation_logits, y):
|
| 218 |
+
choices = []
|
| 219 |
+
for temperature in (.5, .75, 1., 1.5, 2., 3., 4.):
|
| 220 |
+
p = probability(validation_logits, temperature)
|
| 221 |
+
choices.append((float(log_loss(y, p, labels=[0, 1])), temperature))
|
| 222 |
+
_, temperature = min(choices)
|
| 223 |
+
p = probability(validation_logits, temperature)
|
| 224 |
+
prediction = (p >= .5).astype(np.int64)
|
| 225 |
+
full_f1 = scores(y, prediction)["macro_f1"]
|
| 226 |
+
choices = []
|
| 227 |
+
tradeoffs = []
|
| 228 |
+
for threshold in (.55, .60, .65, .70, .75, .80, .85):
|
| 229 |
+
mask = np.maximum(p, 1 - p) >= threshold
|
| 230 |
+
metric = scores(y[mask], prediction[mask]) if mask.any() else {"macro_f1": 0.0}
|
| 231 |
+
tradeoffs.append({"threshold": threshold, "coverage": float(mask.mean()), "resolved_macro_f1": metric["macro_f1"]})
|
| 232 |
+
if mask.mean() >= .60 and metric["macro_f1"] >= full_f1 + .03:
|
| 233 |
+
choices.append((float(mask.mean()), -threshold, threshold))
|
| 234 |
+
threshold = max(choices)[2] if choices else .65
|
| 235 |
+
return {"temperature": temperature, "threshold": threshold, "validation": scores(y, prediction, p),
|
| 236 |
+
"validation_tradeoffs": tradeoffs, "method": "temperature_scaled_on_validation"}
|
| 237 |
+
|
| 238 |
+
|
| 239 |
+
def bootstrap(y, candidate, control, groups):
|
| 240 |
+
unique = sorted(set(groups))
|
| 241 |
+
indices = {group: np.flatnonzero(np.array(groups) == group) for group in unique}
|
| 242 |
+
matrices = []
|
| 243 |
+
for predictions in (candidate, control):
|
| 244 |
+
matrices.append(np.array([np.bincount(2 * y[indices[group]] + predictions[indices[group]], minlength=4)
|
| 245 |
+
for group in unique]))
|
| 246 |
+
|
| 247 |
+
def macro(matrix):
|
| 248 |
+
tn, fp, fn, tp = matrix
|
| 249 |
+
positive = 2 * tp / max(1, 2 * tp + fp + fn)
|
| 250 |
+
negative = 2 * tn / max(1, 2 * tn + fp + fn)
|
| 251 |
+
return (positive + negative) / 2
|
| 252 |
+
|
| 253 |
+
rng = np.random.default_rng(SEED)
|
| 254 |
+
gains = []
|
| 255 |
+
for _ in range(2000):
|
| 256 |
+
weights = np.bincount(rng.integers(0, len(unique), len(unique)), minlength=len(unique))
|
| 257 |
+
gains.append(macro(weights @ matrices[0]) - macro(weights @ matrices[1]))
|
| 258 |
+
return {"unit": "article_group", "groups": len(unique), "draws": 2000,
|
| 259 |
+
"gain_interval_95": [float(value) for value in np.quantile(gains, [.025, .975])]}
|
| 260 |
+
|
| 261 |
+
|
| 262 |
+
def old_control(data):
|
| 263 |
+
sys.path.insert(0, str(PROJECT / "src"))
|
| 264 |
+
from doxa.models import PortableModel
|
| 265 |
+
model = PortableModel(PROJECT / "release_staging/model")
|
| 266 |
+
predictions, probabilities, states = [], [], []
|
| 267 |
+
for row in data:
|
| 268 |
+
result = model.predict(row["text"], criterion_ids=["evaluative_framing"])["criteria"][0]
|
| 269 |
+
state = result["suggested_decision"] or result["prediction_status"]
|
| 270 |
+
states.append(state)
|
| 271 |
+
values = result["scores"]
|
| 272 |
+
p = values["present"] / (values["present"] + values["absent"]) if values else .5
|
| 273 |
+
probabilities.append(p)
|
| 274 |
+
predictions.append(int(p >= .5))
|
| 275 |
+
return np.array(predictions), np.array(probabilities), states
|
| 276 |
+
|
| 277 |
+
|
| 278 |
+
class FrozenClassifier(torch.nn.Module):
|
| 279 |
+
def __init__(self, base_path, fit):
|
| 280 |
+
super().__init__()
|
| 281 |
+
self.encoder = AutoModel.from_pretrained(base_path, local_files_only=True, attn_implementation="eager")
|
| 282 |
+
self.register_buffer("coefficient", torch.tensor(fit.coef_[0], dtype=torch.float32))
|
| 283 |
+
self.register_buffer("intercept", torch.tensor(fit.intercept_[0], dtype=torch.float32))
|
| 284 |
+
|
| 285 |
+
def forward(self, input_ids, attention_mask, token_type_ids):
|
| 286 |
+
hidden = self.encoder(input_ids=input_ids, attention_mask=attention_mask,
|
| 287 |
+
token_type_ids=token_type_ids).last_hidden_state
|
| 288 |
+
mask = attention_mask.unsqueeze(-1)
|
| 289 |
+
pooled = (hidden * mask).sum(1) / mask.sum(1).clamp(min=1)
|
| 290 |
+
normalized = torch.nn.functional.normalize(pooled, dim=1)
|
| 291 |
+
positive = normalized @ self.coefficient + self.intercept
|
| 292 |
+
return torch.stack([torch.zeros_like(positive), positive], dim=1)
|
| 293 |
+
|
| 294 |
+
|
| 295 |
+
def export_onnx(model, tokenizer):
|
| 296 |
+
folder = STAGE / "onnx"
|
| 297 |
+
folder.mkdir(parents=True, exist_ok=True)
|
| 298 |
+
|
| 299 |
+
class Logits(torch.nn.Module):
|
| 300 |
+
def __init__(self, classifier):
|
| 301 |
+
super().__init__()
|
| 302 |
+
self.classifier = classifier
|
| 303 |
+
|
| 304 |
+
def forward(self, input_ids, attention_mask, token_type_ids):
|
| 305 |
+
value = self.classifier(input_ids=input_ids, attention_mask=attention_mask, token_type_ids=token_type_ids)
|
| 306 |
+
return value if isinstance(value, torch.Tensor) else value.logits
|
| 307 |
+
|
| 308 |
+
tokens = tokenizer("This policy was introduced after the committee voted.", return_tensors="pt")
|
| 309 |
+
floating = WORK / "model.onnx"
|
| 310 |
+
torch.onnx.export(Logits(model).eval(), (tokens["input_ids"], tokens["attention_mask"], tokens["token_type_ids"]), floating,
|
| 311 |
+
input_names=["input_ids", "attention_mask", "token_type_ids"], output_names=["logits"],
|
| 312 |
+
dynamic_axes={name: {0: "batch", 1: "sequence"} for name in tokens} | {"logits": {0: "batch"}},
|
| 313 |
+
opset_version=17, dynamo=False)
|
| 314 |
+
quantized = folder / "model_quantized.onnx"
|
| 315 |
+
quantize_dynamic(str(floating), str(quantized), op_types_to_quantize=["MatMul", "Gemm", "Gather"], weight_type=QuantType.QInt8)
|
| 316 |
+
return quantized
|
| 317 |
+
|
| 318 |
+
|
| 319 |
+
def onnx_logits(data, tokenizer, path):
|
| 320 |
+
options = ort.SessionOptions()
|
| 321 |
+
options.intra_op_num_threads = THREADS
|
| 322 |
+
options.inter_op_num_threads = 1
|
| 323 |
+
session = ort.InferenceSession(str(path), sess_options=options, providers=["CPUExecutionProvider"])
|
| 324 |
+
output = []
|
| 325 |
+
for _, tokens in token_batches(data, tokenizer):
|
| 326 |
+
inputs = {item.name: tokens[item.name].numpy() for item in session.get_inputs()}
|
| 327 |
+
output.append(session.run(None, inputs)[0])
|
| 328 |
+
return np.concatenate(output)
|
| 329 |
+
|
| 330 |
+
|
| 331 |
+
def main():
|
| 332 |
+
parser = ArgumentParser(description=__doc__)
|
| 333 |
+
parser.add_argument("--evaluate-only", action="store_true", help="Reproduce export checks from the locked selected checkpoints")
|
| 334 |
+
args = parser.parse_args()
|
| 335 |
+
WORK.mkdir(parents=True, exist_ok=True)
|
| 336 |
+
STAGE.mkdir(parents=True, exist_ok=True)
|
| 337 |
+
torch.set_num_threads(THREADS)
|
| 338 |
+
torch.set_num_interop_threads(1)
|
| 339 |
+
seed_all()
|
| 340 |
+
lock = {split: {"sha256": fingerprint(BENCHMARK / f"{split}.jsonl"),
|
| 341 |
+
"rows": sum(bool(line.strip()) for line in (BENCHMARK / f"{split}.jsonl").read_text().splitlines())}
|
| 342 |
+
for split in ("train", "validation", "test")}
|
| 343 |
+
lock["registration_sha256"] = fingerprint(ROOT / "EVALUATION_REGISTRATION.md")
|
| 344 |
+
lock["amendment_1_sha256"] = fingerprint(ROOT / "EVALUATION_AMENDMENT_1.md")
|
| 345 |
+
lock["export_plan_sha256"] = fingerprint(ROOT / "EXPORT_PLAN.md")
|
| 346 |
+
write_json(WORK / "data_lock.json", lock)
|
| 347 |
+
print(json.dumps({"data_lock": lock}), flush=True)
|
| 348 |
+
base_path = snapshot_download(BASE_ID, revision=BASE_REVISION, token=False,
|
| 349 |
+
allow_patterns=["config.json", "model.safetensors", "tokenizer.json", "tokenizer_config.json", "special_tokens_map.json", "vocab.txt", "README.md"])
|
| 350 |
+
tokenizer = AutoTokenizer.from_pretrained(base_path, local_files_only=True)
|
| 351 |
+
train, validation = rows("train"), rows("validation")
|
| 352 |
+
word, char, controls = fit_controls(train, validation, tokenizer, base_path)
|
| 353 |
+
best_dir = WORK / "selected-native" if args.evaluate_only else fit_candidate(train, validation, tokenizer, base_path)
|
| 354 |
+
fine_tuned = AutoModelForSequenceClassification.from_pretrained(best_dir, local_files_only=True, attn_implementation="eager")
|
| 355 |
+
frozen = FrozenClassifier(base_path, controls["frozen_encoder_logistic"]["fit"])
|
| 356 |
+
validation_logits = {"fine_tuned_encoder": native_logits(validation, tokenizer, fine_tuned),
|
| 357 |
+
"frozen_encoder_logistic": native_logits(validation, tokenizer, frozen)}
|
| 358 |
+
validation_metrics = {name: scores(labels(validation), value.argmax(1)) for name, value in validation_logits.items()}
|
| 359 |
+
selected_pipeline = max(validation_metrics, key=lambda name: validation_metrics[name]["macro_f1"])
|
| 360 |
+
if args.evaluate_only:
|
| 361 |
+
locked = json.loads((WORK / "pipeline_selection.json").read_text())
|
| 362 |
+
if locked["selected"] != selected_pipeline:
|
| 363 |
+
raise RuntimeError("The validation-selected pipeline changed")
|
| 364 |
+
for name in validation_metrics:
|
| 365 |
+
if abs(locked["validation"][name]["macro_f1"] - validation_metrics[name]["macro_f1"]) > 1e-8:
|
| 366 |
+
raise RuntimeError("Locked validation metrics changed")
|
| 367 |
+
model = fine_tuned if selected_pipeline == "fine_tuned_encoder" else frozen
|
| 368 |
+
write_json(WORK / "pipeline_selection.json", {"selected": selected_pipeline, "validation": validation_metrics})
|
| 369 |
+
calibration = calibrate(validation_logits[selected_pipeline], labels(validation))
|
| 370 |
+
write_json(STAGE / "calibration.json", calibration)
|
| 371 |
+
# Test labels and model outputs enter the experiment only after selection.
|
| 372 |
+
test = rows("test")
|
| 373 |
+
y_test = labels(test)
|
| 374 |
+
test_logits = native_logits(test, tokenizer, model)
|
| 375 |
+
candidate_prediction = test_logits.argmax(1)
|
| 376 |
+
candidate_probability = probability(test_logits, calibration["temperature"])
|
| 377 |
+
word_test, char_test = word.transform([row["text"] for row in test]), char.transform([row["text"] for row in test])
|
| 378 |
+
encoder = AutoModel.from_pretrained(base_path, local_files_only=True, attn_implementation="eager")
|
| 379 |
+
test_embeddings = embeddings(test, tokenizer, encoder)
|
| 380 |
+
del encoder
|
| 381 |
+
inputs = {"word_tfidf": word_test, "character_tfidf": char_test,
|
| 382 |
+
"word_character_tfidf": hstack([word_test, char_test]), "frozen_encoder_logistic": test_embeddings}
|
| 383 |
+
predictions = {name: row["fit"].predict(inputs[name]) for name, row in controls.items()}
|
| 384 |
+
results = {name: scores(y_test, predictions[name], row["fit"].predict_proba(inputs[name])[:, 1]) for name, row in controls.items()}
|
| 385 |
+
old_prediction, old_probability, old_states = old_control(test)
|
| 386 |
+
predictions["doxa_framing_control"] = old_prediction
|
| 387 |
+
results["doxa_framing_control"] = scores(y_test, old_prediction, old_probability)
|
| 388 |
+
results["doxa_framing_control"]["original_decisions"] = {state: old_states.count(state) for state in sorted(set(old_states))}
|
| 389 |
+
noncontextual_controls = [name for name in results if name != "frozen_encoder_logistic"]
|
| 390 |
+
best_control = max(noncontextual_controls, key=lambda name: results[name]["macro_f1"])
|
| 391 |
+
candidate = scores(y_test, candidate_prediction, candidate_probability)
|
| 392 |
+
interval = bootstrap(y_test, candidate_prediction, predictions[best_control], [row["group_id"] for row in test])
|
| 393 |
+
gain = candidate["macro_f1"] - results[best_control]["macro_f1"]
|
| 394 |
+
native_pass = gain >= .02 and interval["gain_interval_95"][0] > 0
|
| 395 |
+
if selected_pipeline == "fine_tuned_encoder":
|
| 396 |
+
model.config._name_or_path = "Giuliocc/doxa-wording-encoder"
|
| 397 |
+
model.save_pretrained(STAGE, safe_serialization=True)
|
| 398 |
+
else:
|
| 399 |
+
model.encoder.save_pretrained(STAGE / "encoder", safe_serialization=True)
|
| 400 |
+
write_json(STAGE / "linear_head.json", {"coefficient": model.coefficient.tolist(), "intercept": float(model.intercept),
|
| 401 |
+
"pooling": "attention-masked mean, then L2 normalization", "logits": "[0, coefficient @ embedding + intercept]"})
|
| 402 |
+
tokenizer.backend_tokenizer.no_truncation()
|
| 403 |
+
tokenizer.backend_tokenizer.no_padding()
|
| 404 |
+
tokenizer.save_pretrained(STAGE)
|
| 405 |
+
if args.evaluate_only and (STAGE / "EVALUATION.json").exists():
|
| 406 |
+
shutil.copy2(STAGE / "EVALUATION.json", WORK / "initial_export_results.json")
|
| 407 |
+
if args.evaluate_only and (STAGE / "onnx/model_quantized.onnx").exists():
|
| 408 |
+
shutil.copy2(STAGE / "onnx/model_quantized.onnx", WORK / "initial_matrix_quantized.onnx")
|
| 409 |
+
quantized_path = export_onnx(model, tokenizer)
|
| 410 |
+
quantized_logits = onnx_logits(test, tokenizer, quantized_path)
|
| 411 |
+
quantized_prediction = quantized_logits.argmax(1)
|
| 412 |
+
quantized = scores(y_test, quantized_prediction, probability(quantized_logits, calibration["temperature"]))
|
| 413 |
+
agreement = float((quantized_prediction == candidate_prediction).mean())
|
| 414 |
+
quantized_pass = abs(quantized["macro_f1"] - candidate["macro_f1"]) <= .01 and agreement >= .98
|
| 415 |
+
token_counts = np.array([len(tokenizer.encode(row["text"], truncation=False)) for row in test])
|
| 416 |
+
within_limit = token_counts <= MAX_LENGTH
|
| 417 |
+
mask = (np.maximum(candidate_probability, 1 - candidate_probability) >= calibration["threshold"]) & within_limit
|
| 418 |
+
candidate["resolved_coverage"] = float(mask.mean())
|
| 419 |
+
candidate["resolved_macro_f1"] = scores(y_test[mask], candidate_prediction[mask])["macro_f1"] if mask.any() else None
|
| 420 |
+
result = {"method": "doxa-wording-minilm-v1", "base_model": BASE_ID, "base_revision": BASE_REVISION,
|
| 421 |
+
"data_lock": lock, "selected": json.loads((best_dir / "selection.json").read_text()),
|
| 422 |
+
"task": "BABE expert-majority biased wording", "controls": results, "candidate": candidate,
|
| 423 |
+
"selected_pipeline": selected_pipeline, "contextual_validation": validation_metrics,
|
| 424 |
+
"test_input_limits": {"maximum_tokens": MAX_LENGTH, "within_limit": int(within_limit.sum()),
|
| 425 |
+
"exceeds_limit": int((~within_limit).sum()), "maximum_observed_tokens": int(token_counts.max())},
|
| 426 |
+
"strongest_control": best_control, "macro_f1_gain": gain, "bootstrap": interval,
|
| 427 |
+
"quantized": quantized, "native_quantized_agreement": agreement, "quantized_bytes": quantized_path.stat().st_size,
|
| 428 |
+
"release_gate": {"native": native_pass, "quantized": quantized_pass, "size": quantized_path.stat().st_size < 40_000_000,
|
| 429 |
+
"passed": native_pass and quantized_pass and quantized_path.stat().st_size < 40_000_000},
|
| 430 |
+
"new_spend_usd": 0}
|
| 431 |
+
other_model = frozen if selected_pipeline == "fine_tuned_encoder" else fine_tuned
|
| 432 |
+
other_name = "frozen_encoder_logistic" if selected_pipeline == "fine_tuned_encoder" else "fine_tuned_encoder"
|
| 433 |
+
other_logits = native_logits(test, tokenizer, other_model)
|
| 434 |
+
result["contextual_test"] = {selected_pipeline: candidate,
|
| 435 |
+
other_name: scores(y_test, other_logits.argmax(1), probability(other_logits))}
|
| 436 |
+
result["fine_tuning_gain_over_frozen"] = result["contextual_test"]["fine_tuned_encoder"]["macro_f1"] - result["contextual_test"]["frozen_encoder_logistic"]["macro_f1"]
|
| 437 |
+
write_json(STAGE / "EVALUATION.json", result)
|
| 438 |
+
write_json(WORK / "results.json", result)
|
| 439 |
+
case_predictions = []
|
| 440 |
+
for i, row in enumerate(test):
|
| 441 |
+
case_predictions.append({"id": row["id"], "group_id": row["group_id"], "reference_label": int(y_test[i]),
|
| 442 |
+
"candidate_label": int(candidate_prediction[i]), "quantized_label": int(quantized_prediction[i]),
|
| 443 |
+
"model_score": float(candidate_probability[i]), "resolved": bool(mask[i]),
|
| 444 |
+
"quantized_model_score": float(probability(quantized_logits[i:i+1], calibration["temperature"])[0]),
|
| 445 |
+
"token_count": int(token_counts[i]), "within_deployment_limit": bool(within_limit[i]),
|
| 446 |
+
"contextual_labels": {selected_pipeline: int(candidate_prediction[i]), other_name: int(other_logits[i].argmax())},
|
| 447 |
+
"controls": {name: int(values[i]) for name, values in predictions.items()}})
|
| 448 |
+
(STAGE / "test_predictions.jsonl").write_text("".join(json.dumps(row) + "\n" for row in case_predictions))
|
| 449 |
+
write_json(STAGE / "runtime_manifest.json", {"method": "doxa-wording-minilm-v1", "task": "biased_wording",
|
| 450 |
+
"model_id": "Giuliocc/doxa-wording-encoder", "revision": "v0.1.0", "maximum_tokens": MAX_LENGTH,
|
| 451 |
+
"selected_pipeline": selected_pipeline,
|
| 452 |
+
"temperature": calibration["temperature"], "threshold": calibration["threshold"],
|
| 453 |
+
"score_calibration": calibration["method"], "files": {
|
| 454 |
+
"tokenizer": {"path": "tokenizer.json", "sha256": fingerprint(STAGE / "tokenizer.json")},
|
| 455 |
+
"weights": {"path": "onnx/model_quantized.onnx", "sha256": fingerprint(quantized_path), "bytes": quantized_path.stat().st_size}},
|
| 456 |
+
"scope": "A provisional screen trained on English news sentences labeled for wording bias. Academic and other genres require separate validation. Read the surrounding context."})
|
| 457 |
+
print(json.dumps(result, indent=2), flush=True)
|
| 458 |
+
|
| 459 |
+
|
| 460 |
+
if __name__ == "__main__":
|
| 461 |
+
main()
|
training_history.json
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[
|
| 2 |
+
{
|
| 3 |
+
"learning_rate": 2e-05,
|
| 4 |
+
"epoch": 1,
|
| 5 |
+
"training_loss": 0.6164465047217704,
|
| 6 |
+
"validation": {
|
| 7 |
+
"rows": 305,
|
| 8 |
+
"macro_f1": 0.7256953584276564,
|
| 9 |
+
"accuracy": 0.7311475409836066,
|
| 10 |
+
"per_class_f1": {
|
| 11 |
+
"no_biased_wording": 0.764367816091954,
|
| 12 |
+
"biased_wording": 0.6870229007633588
|
| 13 |
+
}
|
| 14 |
+
},
|
| 15 |
+
"seconds": 145.54617372099892
|
| 16 |
+
},
|
| 17 |
+
{
|
| 18 |
+
"learning_rate": 2e-05,
|
| 19 |
+
"epoch": 2,
|
| 20 |
+
"training_loss": 0.4784004299221812,
|
| 21 |
+
"validation": {
|
| 22 |
+
"rows": 305,
|
| 23 |
+
"macro_f1": 0.799991399791445,
|
| 24 |
+
"accuracy": 0.8,
|
| 25 |
+
"per_class_f1": {
|
| 26 |
+
"no_biased_wording": 0.7986798679867987,
|
| 27 |
+
"biased_wording": 0.8013029315960912
|
| 28 |
+
}
|
| 29 |
+
},
|
| 30 |
+
"seconds": 150.1003625259982
|
| 31 |
+
},
|
| 32 |
+
{
|
| 33 |
+
"learning_rate": 2e-05,
|
| 34 |
+
"epoch": 3,
|
| 35 |
+
"training_loss": 0.42352210734341594,
|
| 36 |
+
"validation": {
|
| 37 |
+
"rows": 305,
|
| 38 |
+
"macro_f1": 0.79992257148695,
|
| 39 |
+
"accuracy": 0.8,
|
| 40 |
+
"per_class_f1": {
|
| 41 |
+
"no_biased_wording": 0.8038585209003215,
|
| 42 |
+
"biased_wording": 0.7959866220735786
|
| 43 |
+
}
|
| 44 |
+
},
|
| 45 |
+
"seconds": 147.102629756002
|
| 46 |
+
},
|
| 47 |
+
{
|
| 48 |
+
"learning_rate": 5e-05,
|
| 49 |
+
"epoch": 1,
|
| 50 |
+
"training_loss": 0.5795937404439256,
|
| 51 |
+
"validation": {
|
| 52 |
+
"rows": 305,
|
| 53 |
+
"macro_f1": 0.8098340213278294,
|
| 54 |
+
"accuracy": 0.8098360655737705,
|
| 55 |
+
"per_class_f1": {
|
| 56 |
+
"no_biased_wording": 0.8092105263157895,
|
| 57 |
+
"biased_wording": 0.8104575163398693
|
| 58 |
+
}
|
| 59 |
+
},
|
| 60 |
+
"seconds": 141.1759580640064
|
| 61 |
+
},
|
| 62 |
+
{
|
| 63 |
+
"learning_rate": 5e-05,
|
| 64 |
+
"epoch": 2,
|
| 65 |
+
"training_loss": 0.41341936366783605,
|
| 66 |
+
"validation": {
|
| 67 |
+
"rows": 305,
|
| 68 |
+
"macro_f1": 0.8229336888277285,
|
| 69 |
+
"accuracy": 0.8229508196721311,
|
| 70 |
+
"per_class_f1": {
|
| 71 |
+
"no_biased_wording": 0.8211920529801324,
|
| 72 |
+
"biased_wording": 0.8246753246753247
|
| 73 |
+
}
|
| 74 |
+
},
|
| 75 |
+
"seconds": 137.1762949979966
|
| 76 |
+
},
|
| 77 |
+
{
|
| 78 |
+
"learning_rate": 5e-05,
|
| 79 |
+
"epoch": 3,
|
| 80 |
+
"training_loss": 0.306474254058825,
|
| 81 |
+
"validation": {
|
| 82 |
+
"rows": 305,
|
| 83 |
+
"macro_f1": 0.8065490588146762,
|
| 84 |
+
"accuracy": 0.8065573770491803,
|
| 85 |
+
"per_class_f1": {
|
| 86 |
+
"no_biased_wording": 0.8052805280528053,
|
| 87 |
+
"biased_wording": 0.8078175895765473
|
| 88 |
+
}
|
| 89 |
+
},
|
| 90 |
+
"seconds": 161.96802384700277
|
| 91 |
+
}
|
| 92 |
+
]
|
validation_controls.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"word_tfidf": {
|
| 3 |
+
"C": 1.0,
|
| 4 |
+
"validation_macro_f1": 0.7737704918032787
|
| 5 |
+
},
|
| 6 |
+
"character_tfidf": {
|
| 7 |
+
"C": 1.0,
|
| 8 |
+
"validation_macro_f1": 0.7866559052999731
|
| 9 |
+
},
|
| 10 |
+
"word_character_tfidf": {
|
| 11 |
+
"C": 0.1,
|
| 12 |
+
"validation_macro_f1": 0.7865548389875217
|
| 13 |
+
},
|
| 14 |
+
"frozen_encoder_logistic": {
|
| 15 |
+
"C": 1.0,
|
| 16 |
+
"validation_macro_f1": 0.7867385247576941
|
| 17 |
+
}
|
| 18 |
+
}
|
vocab.txt
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|