nx_postag_gate.nx
buildroot/runtime/nx_postag_gate.nx
about
nx_postag_gate.nx -- GATE for the POS tagger (nx_postag), driven IN-PROCESS on a planted CoNLL-U mini-treebank under
/tmp/nx_postag_gate. Proves: the CoNLL-U reader (comment lines skipped, a multiword range row skipped, a decimal
empty-node row skipped, CRLF tolerated, forms lowercased), the tag table (all 17 UPOS names round-trip to their ids
and an unknown tag reads -1), that the tagger LEARNS (a train where the same words carry the same tags is tagged
perfectly at test), is deterministic, tags an arbitrary token stream through pt_tag_stream with the same answers,
and that an untrained tagger is not a learned one (its accuracy on the same test is far below). Every fixture
asserts its own condition first. No network. license_tier: ORIGINAL No hw writes (Rule 26).
dependencies 5 imports · 0 importers
imports: nx_syscalls.nxnx_gatekit_lib.nxnx_reviewmine_lib.nxnx_postag.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
| 14 | const G_ROOT: *u8 = "/tmp/nx_postag_gate" |
| 15 | const G_TRAIN: *u8 = "/tmp/nx_postag_gate/train.conllu" |
| 16 | const G_TEST: *u8 = "/tmp/nx_postag_gate/test.conllu" |
| 17 | const G_I64: i64 = 8 |
| 19 | const G_TRAIN_ROWS: *u8 = "# sent_id = 1\n1\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\n# sent_id = 2\n1\tA\ta\tDET\tDT\t_\t2\tdet\t_\t_\r\n2\tcat\tcat\tNOUN\tNN\t_\t3\tnsubj\t_\t_\n3\tsleeps\tsleep\tVERB\tVBZ\t_\t0\troot\t_\t_\n3-4\tdoesn't\t_\t_\t_\t_\t_\t_\t_\t_\n4\t.\t.\tPUNCT\t.\t_\t3\tpunct\t_\t_\n\n1\tThe\tthe\tDET\tDT\t_\t2\tdet\t_\t_\n2\tbig\tbig\tADJ\tJJ\t_\t3\tamod\t_\t_\n2.1\tempty\t_\t_\t_\t_\t_\t_\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" |
| 23 | const G_TRAIN_SENTS: i64 = 5 |
| 24 | const G_TRAIN_TOKS: i64 = 21 // 4+4+5+5+3, the range row and the empty node excluded |
| 26 | 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" |
| 27 | const G_TEST_TOKS: i64 = 10 |
| 28 | const G_TEST_SENTS: i64 = 2 |
| 29 | const G_STREAM_TOKS: i64 = 3 |
functions
| 31 | func main() -> i64 |