code wiki / (root) / nx_absa_seq_gate.nx

nx_absa_seq_gate.nx

buildroot/runtime/nx_absa_seq_gate.nx

24186 B287 linesdepth 7pulls 19 transitivereach 0 importersview sourcekind gate/prooftopic absa
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_gatekit_lib.nx nx_reviewmine_lib.nx nx_absa_lib.nx nx_absa_seq.nx nx_gate_verdict.nx nx_absa_seq_gate.nx

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

main gv_head gv_puts sys_write gv_ctr sys_mmap nxa_die sys_write ↻ sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ gk_mkdir sys_mkdir gk_write sys_openat_wr gk_len gk_write_all sys_write ↻ sys_close gv_check gv_puts ↻ gk_exists sys_openat_rd sys_close ↻ sp_set_treebank sys_mmap ↻ sp_eval ab_gold_load ab_set_reset sys_mmap ↻ sys_mmap ↻

structs

none

consts

15const G_ROOT: *u8 = "/tmp/nx_absa_seq_gate"
16const G_TRAIN: *u8 = "/tmp/nx_absa_seq_gate/train.seg"
17const G_TEST: *u8 = "/tmp/nx_absa_seq_gate/test.seg"
18const G_EMPTYTRAIN: *u8 = "/tmp/nx_absa_seq_gate/emptytrain.seg"
19const G_I64: i64 = 8
20const G_TRAINREC: i64 = 6 // battery x3, screen x3, all found
21const G_NG: i64 = 2 // test gold: battery, screen
23const 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"
24const G_TEST_ROWS: *u8 = "The $T$ is great .\nbattery\n1\nThe $T$ is dim .\nscreen\n-1\n"
27const G_EMPTYTRAIN_ROWS: *u8 = "The car is fast .\nbattery\n1\nThe road is long .\nscreen\n-1\n"
31const G_MERGETRAIN: *u8 = "/tmp/nx_absa_seq_gate/mergetrain.seg"
32const G_MERGETEST: *u8 = "/tmp/nx_absa_seq_gate/mergetest.seg"
33const G_MERGETRAIN_ROWS: *u8 = "The $T$ and screen are great .\nbattery\n1\nThe battery and $T$ are great .\nscreen\n1\n"
34const G_MERGETEST_ROWS: *u8 = "The $T$ is good .\nbattery\n1\nThe $T$ is good .\nscreen\n1\n"
35const G_MERGE_RECORDS: i64 = 2
36const G_MERGE_SENTENCES: i64 = 1
38const G_OCCTEST: *u8 = "/tmp/nx_absa_seq_gate/occtest.seg"
39const G_OCCTEST_ROWS: *u8 = "The $T$ is great .\nbattery\n1\nMy $T$ died today .\nbattery\n-1\n"
40const G_OCC_DISTINCT: i64 = 1
41const G_OCC_OCCURRENCES: i64 = 2
44const G_LOWPREC: *u8 = "/tmp/nx_absa_seq_gate/lowprec.seg"
45const 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"
46const G_LOWPREC_DICT: i64 = 2
47const G_LOWPREC_MAJ: i64 = 1
50const G_TREEBANK: *u8 = "/tmp/nx_absa_seq_gate/mini.conllu"
51const 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"
52const G_TREEBANK_TOKS: i64 = 8
53const G_TREEBANK_SENTS: i64 = 2 // both planted trees are projective, so the parser trains on both
55const G_CLUST_MODEL: *u8 = "/tmp/nx_absa_seq_gate/mini.ppmi"
56const G_CLUST_WORDS: i64 = 4
58const G_CRF_MARG_TOL: i64 = 4
60const G_EMB_MODEL: *u8 = "/tmp/nx_absa_seq_gate/mini.emb"
61const G_EMB_DIMS: i64 = 24
62const G_EMB_FILL_A: i64 = 97 // a deterministic fill: ((w+1)(d+1)97 mod 2048) - 1024, distinct per word
63const G_EMB_FILL_MOD: i64 = 2048
64const G_EMB_FILL_OFF: i64 = 1024
66const G_DUPTEST: *u8 = "/tmp/nx_absa_seq_gate/duptest.seg"
67const G_DUPTEST_ROWS: *u8 = "The $T$ is great .\nbattery\n1\nThe $T$ is great .\nbattery\n1\n"

functions

69func main() -> i64