code wiki / (root) / nx_qa_score_lib.nx

nx_qa_score_lib.nx

buildroot/runtime/nx_qa_score_lib.nx

4344 B111 linesdepth 2pulls 2 transitivereach 26 importersview sourcekind library
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_qa_score_lib.nx nx_qa_score.nx nx_qabench_engine.nx nx_qwen_reader_bench_gate.nx nx_reader_ruler_adversary_gate.nx

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

9func qs_norm(src: *u8, dst: *u8) -> i64
25func qs_is_article(buf: *u8, off: i64, len: i64) -> i64
called by 1: qs_tok
33func qs_tok(buf: *u8, blen: i64, toff: *i64, tlen: *i64, maxn: i64) -> i64
56func qs_tok_eq2(pbuf: *u8, po: i64, pl: i64, gbuf: *u8, go: i64, gl: i64) -> i64
64func qs_common(pbuf: *u8, ptoff: *i64, ptlen: *i64, np: i64, gbuf: *u8, gtoff: *i64, gtlen: *i64, ng: i64, used: *i64) -> i64
called by 2: qs_f1rd_f1 calls 1: qs_tok_eq2
83func qs_f1(pred: *u8, gold: *u8) -> i64
100func qs_em(pred: *u8, gold: *u8) -> i64