| … | … | @@ -1,3 +1,19 @@ |
| 1 | ; |
| 2 | ; count-agent.scm |
| 3 | ; |
| 4 | ; Prototype hand-built agent capable of counting things observed |
| 5 | ; in the external environment. |
| 6 | ; |
| 7 | ; Currently, this demos counting of word-pairs observed by looking at |
| 8 | ; a text file. (The Sensory API should allow easy generalization to |
| 9 | ; other text sources.) |
| 10 | ; |
| 11 | ; The dataflow pipeline is hand-crafted. (The sensory API is supposed |
| 12 | ; to eventually auto-build these pipelines, but that code is not working |
| 13 | ; yet.) You'll notice that the pipeline below is ... complicated. |
| 14 | ; |
| 15 | ; The "rest of the demo", where we do something with the word pairs, |
| 16 | ; is in "generate.scm". |
| 1 | 17 | |
| 2 | 18 | (use-modules (opencog) (opencog exec) (opencog persist)) |
| 3 | 19 | (use-modules (opencog nlp) (opencog nlp lg-parse)) |
| … | … | @@ -5,11 +21,12 @@ |
| 5 | 21 | (use-modules (srfi srfi-1)) |
| 6 | 22 | |
| 7 | 23 | ; Here's the design we want: |
| 8 | | ; 1) Some source of text strings; actually a source of PhraseNode's |
| 9 | | ; This source blocks if there's nothing to be read; else it |
| 10 | | ; returns the next PhraseNode. The SRFI's call this a generator. |
| 11 | | ; For now, see `sensory.scm` module and example. |
| 12 | | ; It uses a FileReadNode to loop over a text file. |
| 24 | ; 1) Some source of text strings. This source blocks if there's |
| 25 | ; nothing to be read; else it returns the next string. The SRFI's |
| 26 | ; call this a generator. The `OpenLink` provided by `sensory.scm` |
| 27 | ; is a suitable source. |
| 28 | ; 1a) TODO... Parser wants strings as Nodes; it would be nice to |
| 29 | ; be able to work with StringValue. |
| 13 | 30 | ; 2) (Optional) Some way to split one source into multiple sources. |
| 14 | 31 | ; Maybe this: |
| 15 | 32 | ; https://wiki.opencog.org/w/PromiseLink#Multiplex_Example |