code wiki / (root) / nx_doc_classify.nx

nx_doc_classify.nx

buildroot/runtime/nx_doc_classify.nx

2635 B58 linesdepth 2pulls 2 transitivereach 1 importersview sourcekind librarytopic doc
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_doc_classify.nx nx_doc_classify_gate.nx

imports: nx_syscalls.nx

imported by: nx_doc_classify_gate.nx

structs

none

consts

none

functions

12func dcl_find(text: *u8, n: i64, needle: *u8) -> i64
called by 1: dcl_score
29func dcl_score(text: *u8, n: i64, kws: *i64, wts: *i64, nk: i64) -> i64
called by 1: dcl_classify calls 1: dcl_find
43func dcl_classify(text: *u8, n: i64, type_kws: *i64, type_wts: *i64, type_nk: *i64, ntypes: i64, thresh: i64, out_conf: *i64) -> i64
called by 1: main calls 1: dcl_score