Spaces:
Running
Running
self-contained export rows
Browse files- review.html +16 -2
review.html
CHANGED
|
@@ -433,8 +433,22 @@ async function hubCommit(entry) {
|
|
| 433 |
} catch (e) { return 'this browser only (Hub sync failed)'; }
|
| 434 |
}
|
| 435 |
function exp() {
|
| 436 |
-
|
| 437 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 438 |
const a = document.createElement('a');
|
| 439 |
a.href = URL.createObjectURL(new Blob([rows.map(r => JSON.stringify(r)).join('\n')], {type: 'application/json'}));
|
| 440 |
a.download = `rulings-${who() || 'anon'}-${$('ds').value}.jsonl`; a.click();
|
|
|
|
| 433 |
} catch (e) { return 'this browser only (Hub sync failed)'; }
|
| 434 |
}
|
| 435 |
function exp() {
|
| 436 |
+
// rulings carry their own context so they survive queue changes:
|
| 437 |
+
// passage text, span offsets, origin, probe + luna fields.
|
| 438 |
+
const idx = {};
|
| 439 |
+
for (const o of ALL) for (const x of o.spans)
|
| 440 |
+
idx[x.key] = {o, x};
|
| 441 |
+
const rows = Object.entries(R).map(([key, ruling]) => {
|
| 442 |
+
const hit = idx[key];
|
| 443 |
+
const base = {key, ruling, queue: RQ[key] || $('ds').value, annotator: who(),
|
| 444 |
+
ts: new Date().toISOString().replace(/\.\d+Z$/, '+00:00')};
|
| 445 |
+
if (!hit) return base;
|
| 446 |
+
const {o, x} = hit;
|
| 447 |
+
return {...base, surface: x.surface, start: x.start, end: x.end,
|
| 448 |
+
text: o.text, origin: o.source,
|
| 449 |
+
probe_tag: x.probe_tag, probe_score: x.probe_score,
|
| 450 |
+
luna_label: x.luna_label, luna_reason: x.luna_reason || null};
|
| 451 |
+
});
|
| 452 |
const a = document.createElement('a');
|
| 453 |
a.href = URL.createObjectURL(new Blob([rows.map(r => JSON.stringify(r)).join('\n')], {type: 'application/json'}));
|
| 454 |
a.download = `rulings-${who() || 'anon'}-${$('ds').value}.jsonl`; a.click();
|