nx_depparse_gate.nx
buildroot/runtime/nx_depparse_gate.nx
about
nx_depparse_gate.nx -- GATE for the dependency parser (nx_depparse), driven IN-PROCESS on a planted CoNLL-U
mini-treebank under /tmp/nx_depparse_gate. Proves: the shared reader's HEAD and DEPREL columns (root head 0, a
subtype's base name kept), the label table (first-seen interning, unknown reads -1), that the parser LEARNS (a
train of one grammar is parsed perfectly at test, UAS and LAS 1000), converges, is deterministic, SKIPS a planted
non-projective sentence and counts it, parses an arbitrary tagged token stream through dp_parse_stream with the
same answers, and that an untrained parser is not a learned one (its right-branching chain scores far below).
Every fixture asserts its own condition first. No network. license_tier: ORIGINAL No hw writes (Rule 26).
dependencies 6 imports · 0 importers
imports: nx_syscalls.nxnx_gatekit_lib.nxnx_reviewmine_lib.nxnx_postag.nxnx_depparse.nxnx_gate_verdict.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 15 | const G_ROOT: *u8 = "/tmp/nx_depparse_gate" |
| 16 | const G_TRAIN: *u8 = "/tmp/nx_depparse_gate/train.conllu" |
| 17 | const G_TEST: *u8 = "/tmp/nx_depparse_gate/test.conllu" |
| 18 | const G_SUBTYPE: *u8 = "/tmp/nx_depparse_gate/subtype.conllu" |
| 19 | const G_I64: i64 = 8 |
| 22 | const G_TRAIN_ROWS: *u8 = "1\tThe\tthe\tDET\tDT\t_\t2\tdet\t_\t_\n2\tdog\tdog\tNOUN\tNN\t_\t3\tnsubj\t_\t_\n3\truns\trun\tVERB\tVBZ\t_\t0\troot\t_\t_\n4\t.\t.\tPUNCT\t.\t_\t3\tpunct\t_\t_\n\n1\tA\ta\tDET\tDT\t_\t2\tdet\t_\t_\n2\tcat\tcat\tNOUN\tNN\t_\t3\tnsubj\t_\t_\n3\tsleeps\tsleep\tVERB\tVBZ\t_\t0\troot\t_\t_\n4\t.\t.\tPUNCT\t.\t_\t3\tpunct\t_\t_\n\n1\tThe\tthe\tDET\tDT\t_\t3\tdet\t_\t_\n2\tbig\tbig\tADJ\tJJ\t_\t3\tamod\t_\t_\n3\tdog\tdog\tNOUN\tNN\t_\t4\tnsubj\t_\t_\n4\tsleeps\tsleep\tVERB\tVBZ\t_\t0\troot\t_\t_\n5\t.\t.\tPUNCT\t.\t_\t4\tpunct\t_\t_\n\n1\tA\ta\tDET\tDT\t_\t3\tdet\t_\t_\n2\tsmall\tsmall\tADJ\tJJ\t_\t3\tamod\t_\t_\n3\tcat\tcat\tNOUN\tNN\t_\t4\tnsubj\t_\t_\n4\truns\trun\tVERB\tVBZ\t_\t0\troot\t_\t_\n5\t.\t.\tPUNCT\t.\t_\t4\tpunct\t_\t_\n\n1\tThe\tthe\tDET\tDT\t_\t2\tdet\t_\t_\n2\tcat\tcat\tNOUN\tNN\t_\t3\tnsubj\t_\t_\n3\truns\trun\tVERB\tVBZ\t_\t0\troot\t_\t_\n\n1\tw1\tw1\tNOUN\tNN\t_\t3\tobl\t_\t_\n2\tw2\tw2\tNOUN\tNN\t_\t4\tobl\t_\t_\n3\tw3\tw3\tVERB\tVBZ\t_\t0\troot\t_\t_\n4\tw4\tw4\tVERB\tVBZ\t_\t3\tconj\t_\t_\n" |
| 23 | const G_TRAIN_SENTS: i64 = 6 |
| 24 | const G_TRAIN_TOKS: i64 = 26 // 4+4+5+5+3+5? no: 4+4+5+5+3+4 = 25 tokens plus the reader counts the range-free rows only |
| 25 | const G_NONPROJ: i64 = 1 |
| 26 | const G_NREL: i64 = 7 // det nsubj root punct amod obl conj, in first-seen order |
| 27 | const G_REL_ROOT: i64 = 2 |
| 28 | const G_TEST_ROWS: *u8 = "1\tThe\tthe\tDET\tDT\t_\t3\tdet\t_\t_\n2\tsmall\tsmall\tADJ\tJJ\t_\t3\tamod\t_\t_\n3\tdog\tdog\tNOUN\tNN\t_\t4\tnsubj\t_\t_\n4\tsleeps\tsleep\tVERB\tVBZ\t_\t0\troot\t_\t_\n5\t.\t.\tPUNCT\t.\t_\t4\tpunct\t_\t_\n\n1\tA\ta\tDET\tDT\t_\t3\tdet\t_\t_\n2\tbig\tbig\tADJ\tJJ\t_\t3\tamod\t_\t_\n3\tcat\tcat\tNOUN\tNN\t_\t4\tnsubj\t_\t_\n4\truns\trun\tVERB\tVBZ\t_\t0\troot\t_\t_\n5\t.\t.\tPUNCT\t.\t_\t4\tpunct\t_\t_\n" |
| 29 | const G_TEST_TOKS: i64 = 10 |
| 30 | const G_TEST_SENTS: i64 = 2 |
| 32 | const G_SUBTYPE_ROWS: *u8 = "1\tits\tits\tPRON\tPRP$\t_\t2\tnmod:poss\t_\t_\n2\ttoy\ttoy\tNOUN\tNN\t_\t0\troot\t_\t_\n" |
| 33 | const G_STREAM_TOKS: i64 = 3 |
| 34 | const G_UNTRAINED_MAX: i64 = 500 |
functions
| 36 | func main() -> i64 |