nx_qa_score_lib.nx
buildroot/runtime/nx_qa_score_lib.nx
about
nx_qa_score_lib.nx -- IMPORTABLE sovereign word-level F1 + Exact-Match (SQuAD/HotpotQA/DeepResearcher metric).
Split out of nx_qa_score.nx (which keeps the KAT main + neg-control) so benchmark harnesses can import
qs_f1/qs_em without a duplicate main. Integer/no-float: F1 in PERMILLE (0..1000). Normalization = SQuAD:
lowercase, punctuation->space, drop articles (a/an/the), collapse ws. Proven by the nx_qa_score KAT gate.
license_tier: ORIGINAL
dependencies 1 imports · 4 importers
imports: nx_syscalls.nx
imported by: nx_qa_score.nxnx_qabench_engine.nxnx_qwen_reader_bench_gate.nxnx_reader_ruler_adversary_gate.nx
structs
| none |
consts
| none |
functions
| 9 | func qs_norm(src: *u8, dst: *u8) -> i64 |
| 25 | func qs_is_article(buf: *u8, off: i64, len: i64) -> i64 called by 1: qs_tok |
| 33 | func qs_tok(buf: *u8, blen: i64, toff: *i64, tlen: *i64, maxn: i64) -> i64 |
| 56 | func qs_tok_eq2(pbuf: *u8, po: i64, pl: i64, gbuf: *u8, go: i64, gl: i64) -> i64 |
| 64 | func qs_common(pbuf: *u8, ptoff: *i64, ptlen: *i64, np: i64, gbuf: *u8, gtoff: *i64, gtlen: *i64, ng: i64, used: *i64) -> i64 |
| 83 | func qs_f1(pred: *u8, gold: *u8) -> i64 |
| 100 | func qs_em(pred: *u8, gold: *u8) -> i64 |