code wiki / (root) / nx_qabench_fetch.nx

nx_qabench_fetch.nx source

↩ module page · 25 lines · 1710 B

1// nx_qabench_fetch.nx -- broaden the researcher's public-benchmark ladder beyond HotpotQA (operator 2026-07-07: 2// "use others like beerqa.github.io, climb the ladder to the top"). Banks, sovereignly (TLS-1.3 + CA store): 3// 1) SQuAD v1.1 validation (HF datasets-server rows API) -- SINGLE context paragraph per Q = isolates the 4// EXTRACTION quality from retrieval (the 1-hop floor rung; should score HIGHEST mechanically). 5// 2) BeerQA dev v1.0 (Stanford, direct JSON) -- UNIFIES SQuAD(1-hop)+HotpotQA(2-hop)+new 3-hop in ONE format 6// tagged by source = the whole difficulty ladder in one dataset. 16MB file; big cap, truncation-tolerant 7// (the harness parses complete records + stops at the cut, like the HotpotQA path). 8// Raw JSON -> knowledge/fetched/<name>.raw for nx_qabench to parse. Run SOLO. expect_exit: 0 license_tier: ORIGINAL 9import "nx_research_engine.nx" 10const K_MAGIC_8388608: i64 = 8388608 11 12func main() -> i64 { 13 let store: *TrustStore = rf_init() 14 if (store as i64) == 0 { rf_puts("qab: trust store load failed\n" as *u8); return 1 } 15 rf_puts("CA roots="); rf_putn(trust_store_count(store)); rf_puts(" -- SQuAD v1.1 (single-context 1-hop = extraction-only) -> fetched\n" as *u8) 16 let cap: i64 = K_MAGIC_8388608 17 let out: *u8 = sys_mmap(cap) 18 var ok: i64 = 0 19 20 rf_section("SQuAD v1.1 validation rows 0..99 (single-context = extraction-only 1-hop floor)" as *u8) 21 ok = ok + rf_fetch_bank("https://datasets-server.huggingface.co/rows?dataset=rajpurkar/squad&config=plain_text&split=validation&offset=0&length=100" as *u8, "qab_squad_p0" as *u8, store, out, cap) 22 23 rf_puts("QAB BANKED: "); rf_putn(ok); rf_puts(" / 1\n" as *u8) 24 return 0 25}