nx_absa_seq_gate.nx
buildroot/runtime/nx_absa_seq_gate.nx
about
nx_absa_seq_gate.nx -- GATE for the averaged structured perceptron (nx_absa_seq, rung IM28), driven IN-PROCESS on
a planted train and test under /tmp/nx_absa_seq_gate. The load-bearing proof is that the model LEARNS: a train
where battery and screen are always the aspect term teaches the model to tag them, and on a test carrying
both it predicts both (a learning algorithm that did nothing would predict nothing). Controls: a model trained
on NOTHING (every record skipped, zero weights) predicts nothing, so the predictions came from the training; and
a second run gives the identical F1 (the perceptron is deterministic -- no randomness). 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_absa_lib.nxnx_absa_seq.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_absa_seq_gate" |
| 16 | const G_TRAIN: *u8 = "/tmp/nx_absa_seq_gate/train.seg" |
| 17 | const G_TEST: *u8 = "/tmp/nx_absa_seq_gate/test.seg" |
| 18 | const G_EMPTYTRAIN: *u8 = "/tmp/nx_absa_seq_gate/emptytrain.seg" |
| 19 | const G_I64: i64 = 8 |
| 20 | const G_TRAINREC: i64 = 6 // battery x3, screen x3, all found |
| 21 | const G_NG: i64 = 2 // test gold: battery, screen |
| 23 | const G_TRAIN_ROWS: *u8 = "The $T$ lasts long .\nbattery\n1\nI love the $T$ here .\nbattery\n1\nThis $T$ is weak .\nbattery\n-1\nThe $T$ is bright .\nscreen\n1\nI hate the $T$ today .\nscreen\n-1\nThis $T$ cracked badly .\nscreen\n-1\n" |
| 24 | const G_TEST_ROWS: *u8 = "The $T$ is great .\nbattery\n1\nThe $T$ is dim .\nscreen\n-1\n" |
| 27 | const G_EMPTYTRAIN_ROWS: *u8 = "The car is fast .\nbattery\n1\nThe road is long .\nscreen\n-1\n" |
| 31 | const G_MERGETRAIN: *u8 = "/tmp/nx_absa_seq_gate/mergetrain.seg" |
| 32 | const G_MERGETEST: *u8 = "/tmp/nx_absa_seq_gate/mergetest.seg" |
| 33 | const G_MERGETRAIN_ROWS: *u8 = "The $T$ and screen are great .\nbattery\n1\nThe battery and $T$ are great .\nscreen\n1\n" |
| 34 | const G_MERGETEST_ROWS: *u8 = "The $T$ is good .\nbattery\n1\nThe $T$ is good .\nscreen\n1\n" |
| 35 | const G_MERGE_RECORDS: i64 = 2 |
| 36 | const G_MERGE_SENTENCES: i64 = 1 |
| 38 | const G_OCCTEST: *u8 = "/tmp/nx_absa_seq_gate/occtest.seg" |
| 39 | const G_OCCTEST_ROWS: *u8 = "The $T$ is great .\nbattery\n1\nMy $T$ died today .\nbattery\n-1\n" |
| 40 | const G_OCC_DISTINCT: i64 = 1 |
| 41 | const G_OCC_OCCURRENCES: i64 = 2 |
| 44 | const G_LOWPREC: *u8 = "/tmp/nx_absa_seq_gate/lowprec.seg" |
| 45 | const G_LOWPREC_ROWS: *u8 = "The battery and $T$ are fine .\nscreen\n1\nMy battery and $T$ look good .\nscreen\n1\nThis battery and $T$ work well .\nscreen\n1\nThe $T$ is great .\nbattery\n1\n" |
| 46 | const G_LOWPREC_DICT: i64 = 2 |
| 47 | const G_LOWPREC_MAJ: i64 = 1 |
| 50 | const G_TREEBANK: *u8 = "/tmp/nx_absa_seq_gate/mini.conllu" |
| 51 | const G_TREEBANK_ROWS: *u8 = "1\tThe\tthe\tDET\tDT\t_\t2\tdet\t_\t_\n2\tbattery\tbattery\tNOUN\tNN\t_\t3\tnsubj\t_\t_\n3\tlasts\tlast\tVERB\tVBZ\t_\t0\troot\t_\t_\n4\tlong\tlong\tADV\tRB\t_\t3\tadvmod\t_\t_\n\n1\tThe\tthe\tDET\tDT\t_\t2\tdet\t_\t_\n2\tscreen\tscreen\tNOUN\tNN\t_\t3\tnsubj\t_\t_\n3\tis\tbe\tAUX\tVBZ\t_\t4\tcop\t_\t_\n4\tbright\tbright\tADJ\tJJ\t_\t0\troot\t_\t_\n" |
| 52 | const G_TREEBANK_TOKS: i64 = 8 |
| 53 | const G_TREEBANK_SENTS: i64 = 2 // both planted trees are projective, so the parser trains on both |
| 55 | const G_CLUST_MODEL: *u8 = "/tmp/nx_absa_seq_gate/mini.ppmi" |
| 56 | const G_CLUST_WORDS: i64 = 4 |
| 58 | const G_CRF_MARG_TOL: i64 = 4 |
| 60 | const G_EMB_MODEL: *u8 = "/tmp/nx_absa_seq_gate/mini.emb" |
| 61 | const G_EMB_DIMS: i64 = 24 |
| 62 | const G_EMB_FILL_A: i64 = 97 // a deterministic fill: ((w+1)(d+1)97 mod 2048) - 1024, distinct per word |
| 63 | const G_EMB_FILL_MOD: i64 = 2048 |
| 64 | const G_EMB_FILL_OFF: i64 = 1024 |
| 66 | const G_DUPTEST: *u8 = "/tmp/nx_absa_seq_gate/duptest.seg" |
| 67 | const G_DUPTEST_ROWS: *u8 = "The $T$ is great .\nbattery\n1\nThe $T$ is great .\nbattery\n1\n" |
functions
| 69 | func main() -> i64 |