Sync with GitHub, license metadata from LICENSE files, commercial license notice
Browse filesmetadata license: None -> other (snapkitty-tri-license)
README: License section appended
README: GitHub source link added
README.md
CHANGED
|
@@ -1,126 +1,148 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
#
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
#
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
#
|
| 85 |
-
#
|
| 86 |
-
# Induced:
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
#
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
|
| 104 |
-
|
|
| 105 |
-
| `
|
| 106 |
-
| `
|
| 107 |
-
|
| 108 |
-
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
| |
|
| 113 |
-
|
|
| 114 |
-
|
|
| 115 |
-
|
|
| 116 |
-
|
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: other
|
| 3 |
+
license_name: snapkitty-tri-license
|
| 4 |
+
license_link: https://huggingface.co/Snapkitty/pocketlearn/blob/main/LICENSE.tri
|
| 5 |
+
tags:
|
| 6 |
+
- snapkitty
|
| 7 |
+
---
|
| 8 |
+
|
| 9 |
+
> Source: [github.com/SNAPKITTYWEST/pocketlearn](https://github.com/SNAPKITTYWEST/pocketlearn)
|
| 10 |
+
|
| 11 |
+
# PocketLearn
|
| 12 |
+
|
| 13 |
+
**Symbolic cognitive architecture: XML + XSLT + ILP + ASP + FORTH. Zero Python.**
|
| 14 |
+
|
| 15 |
+
Learn = build a visible theory.
|
| 16 |
+
|
| 17 |
+
Neural net: `learn = adjust W -= lr * grad`. Knowledge disappears into numbers you can't read.
|
| 18 |
+
|
| 19 |
+
This: `learn = build a visible theory.`
|
| 20 |
+
|
| 21 |
+
---
|
| 22 |
+
|
| 23 |
+
## What it does
|
| 24 |
+
|
| 25 |
+
```
|
| 26 |
+
sample_corpus.txt
|
| 27 |
+
|
|
| 28 |
+
v
|
| 29 |
+
corpus_tokens.xml (tokenizer β 69 tokens, 52 vocab)
|
| 30 |
+
|
|
| 31 |
+
v
|
| 32 |
+
ontology.xml (seed concepts: stack_op, compiler_word, meta_word...)
|
| 33 |
+
|
|
| 34 |
+
+--[XSLT]----------> background.pl (Prolog co-occurrence facts)
|
| 35 |
+
|
|
| 36 |
+
+--[XSLT]----------> ontology_induction_generated.pl (ILP engine, GENERATED by XSLT)
|
| 37 |
+
|
|
| 38 |
+
v
|
| 39 |
+
swipl learns rules:
|
| 40 |
+
Induced: is_a(W, stack_op) :- cooccur(W, 'drop'). F1=0.60
|
| 41 |
+
Propose: include should be is_a(stack_op) cnt=1
|
| 42 |
+
|
|
| 43 |
+
v
|
| 44 |
+
ontology_induced.xml (updated ontology with induced members)
|
| 45 |
+
|
|
| 46 |
+
+------[XSLT]-+------[XSLT]--+
|
| 47 |
+
| |
|
| 48 |
+
v v
|
| 49 |
+
ASP validation generated_corpus_induced.fth
|
| 50 |
+
clingo rejects gforth runs the learned dictionary
|
| 51 |
+
contradictions
|
| 52 |
+
(dup = stack_op AND
|
| 53 |
+
compiler_word -> UNSAT)
|
| 54 |
+
```
|
| 55 |
+
|
| 56 |
+
**The meta-trick:** `ontology_to_induction.xslt` generates the Prolog ILP engine from `ontology.xml`. So the whole system is self-describing β XSLT generates Prolog that learns rules from XML co-occurrence stats.
|
| 57 |
+
|
| 58 |
+
---
|
| 59 |
+
|
| 60 |
+
## Run
|
| 61 |
+
|
| 62 |
+
```bash
|
| 63 |
+
# Install (Mac)
|
| 64 |
+
brew install libxslt swi-prolog clingo gforth
|
| 65 |
+
|
| 66 |
+
# Install (Linux)
|
| 67 |
+
sudo apt install -y xsltproc swi-prolog gringo gforth
|
| 68 |
+
|
| 69 |
+
# Build β full pipeline
|
| 70 |
+
make
|
| 71 |
+
|
| 72 |
+
# Run the FORTH (pre-built, no deps needed)
|
| 73 |
+
make demo-prebuilt
|
| 74 |
+
```
|
| 75 |
+
|
| 76 |
+
---
|
| 77 |
+
|
| 78 |
+
## What you get
|
| 79 |
+
|
| 80 |
+
```bash
|
| 81 |
+
make
|
| 82 |
+
# [3/7] ILP engine via XSLT
|
| 83 |
+
# [4/7] ILP Induction
|
| 84 |
+
# Induced: is_a(W, stack_op) :- cooccur(W, 'drop'). F1=0.60
|
| 85 |
+
# Induced: is_a(W, compiler_word) :- cooccur(W, 'semicolon'). F1=0.75
|
| 86 |
+
# Induced: is_a(W, learning_word) :- cooccur(W, 'statistical'). F1=0.80
|
| 87 |
+
# Proposing: include should be is_a(stack_op) (cooccurs with 'drop')
|
| 88 |
+
# Proposing: defined should be is_a(compiler_word) (cooccurs with 'semicolon')
|
| 89 |
+
# Proposing: similarity should be is_a(learning_word)
|
| 90 |
+
# [5/7] ASP: SATISFIABLE
|
| 91 |
+
# [6/7] FORTH written
|
| 92 |
+
|
| 93 |
+
make demo
|
| 94 |
+
# PocketLearn FORTH β seed + ILP-induced vocab
|
| 95 |
+
# vocab size: 18
|
| 96 |
+
# Induced: include (by drop), defined (by semicolon), similarity (by statistical)
|
| 97 |
+
```
|
| 98 |
+
|
| 99 |
+
---
|
| 100 |
+
|
| 101 |
+
## Files
|
| 102 |
+
|
| 103 |
+
| File | Role |
|
| 104 |
+
|------|------|
|
| 105 |
+
| `sample_corpus.txt` | Input text |
|
| 106 |
+
| `corpus_tokens.xml` | Tokenized corpus (XML) |
|
| 107 |
+
| `ontology.xml` | Seed concepts with members + co-occurrence strengths |
|
| 108 |
+
| `ontology_induced.xml` | Output ontology with ILP-induced members |
|
| 109 |
+
| `corpus_to_background.xslt` | XML β Prolog co-occurrence facts |
|
| 110 |
+
| `ontology_to_induction.xslt` | **Generates** the Prolog ILP engine from ontology.xml |
|
| 111 |
+
| `ontology_to_asp.xslt` | XML β ASP validation facts |
|
| 112 |
+
| `corpus_to_forth.xslt` | XML β FORTH dictionary |
|
| 113 |
+
| `ontology_induction_generated.pl` | ILP engine (XSLT output) β run with swipl |
|
| 114 |
+
| `generated_corpus_induced.fth` | Final FORTH (seed + induced) β run with gforth |
|
| 115 |
+
| `ontology.asp` | ASP contradiction rules |
|
| 116 |
+
| `Makefile` | Full pipeline |
|
| 117 |
+
|
| 118 |
+
---
|
| 119 |
+
|
| 120 |
+
## Why this instead of a transformer
|
| 121 |
+
|
| 122 |
+
| | Transformer | PocketLearn |
|
| 123 |
+
|--|--|--|
|
| 124 |
+
| Inspectable | No β weights are numbers | Yes β open `ontology_induced.xml` |
|
| 125 |
+
| Reproducible | No β depends on random seed | Yes β same XML = same FORTH, bit-for-bit |
|
| 126 |
+
| Debuggable | No | Yes β stack blow β trace to corpus_tokens.xml line β XSLT template |
|
| 127 |
+
| Hallucinates | Yes β `dup = delete` possible | No β ASP kills contradictions |
|
| 128 |
+
| Learns deep semantics | Yes | No |
|
| 129 |
+
|
| 130 |
+
It won't discover deep semantics. It will never hallucinate `dup = delete` because ASP kills it.
|
| 131 |
+
|
| 132 |
+
---
|
| 133 |
+
|
| 134 |
+
**Ahmad Ali Parr Β· Bel Esprit D'Accord Irrevocable Trust Β· EIN 42-697643**
|
| 135 |
+
|
| 136 |
+
`Omega = TRUST AND CODE`
|
| 137 |
+
|
| 138 |
+
---
|
| 139 |
+
|
| 140 |
+
## License
|
| 141 |
+
|
| 142 |
+
Licensed under **SnapKitty Tri-License**. Full text: [LICENSE.tri](LICENSE.tri).
|
| 143 |
+
|
| 144 |
+
### πΌ Commercial License
|
| 145 |
+
|
| 146 |
+
Snapkitty code is free and open under **AGPL-3.0** for open-source use. Building a commercial product or service? A **proprietary commercial license** from Snapkitty Collective LLC lets you ship this code without the AGPL's source-sharing and network-use obligations.
|
| 147 |
+
|
| 148 |
+
**[β Get a commercial license](mailto:A.parr@belespritdaccord.uk?subject=Commercial%20license:%20pocketlearn)** Β· A.parr@belespritdaccord.uk
|