nx_doc_classify.nx
buildroot/runtime/nx_doc_classify.nx
about
nx_doc_classify.nx -- R3 of THE NISHI DOCUMENT-INTELLIGENCE arc: CLASSIFY a document by TYPE (medical
bill / bank statement / EOB / letter / ...) so the pipeline ROUTES it to the right extractor before R1.
The "organizing" leg. DATA-DRIVEN BY CONSTRUCTION (#6/#11/#25): each type is a PACK of (keyword, weight)
signals passed as DATA (grounded on the doc_cls_* research corpus + a sovereign rule-pack store in R6
style). Classification = score each type by summing the weights of its signals present in the text; the
highest-scoring type above a threshold wins, else "unknown" (-1). Deterministic, exact integer scores,
no ML dependency, no hardware writes. Adding a type or tuning a weight is DATA, never a code change.
(v1 substring match is case-sensitive; case-folding is the noted refinement.) license_tier: ORIGINAL
dependencies 1 imports · 1 importers
imports: nx_syscalls.nx
imported by: nx_doc_classify_gate.nx
structs
| none |
consts
| none |
functions
| 12 | func dcl_find(text: *u8, n: i64, needle: *u8) -> i64 called by 1: dcl_score |
| 29 | func dcl_score(text: *u8, n: i64, kws: *i64, wts: *i64, nk: i64) -> i64 |
| 43 | func dcl_classify(text: *u8, n: i64, type_kws: *i64, type_wts: *i64, type_nk: *i64, ntypes: i64, thresh: i64, out_conf: *i64) -> i64 |