| … | … | @@ -0,0 +1,75 @@ |
| 1 | Generating output |
| 2 | ================= |
| 3 | Design notes for generating output text. Two ideas: use LG and use dorky |
| 4 | pairs. |
| 5 | |
| 6 | ## LG generation |
| 7 | Generate text with Link Grammar. This is the correct long-term solution, |
| 8 | but requires some fair amount of work on the LG side and on the |
| 9 | `lg-atomese` modules, and here. So for proof-of-concept, just skip this |
| 10 | for now. |
| 11 | ``` |
| 12 | link-generator -c 4 -k 4 -l en |
| 13 | link-generator -l en -s 0 |
| 14 | This is * test |
| 15 | echo 'This \* a te\* of \*.a sentence generation' | time link-generator -l en -s 0 --verbosity=2 |
| 16 | echo 'This is a \*' | time link-generator -l en -s 0 --verbosity=2 |
| 17 | ``` |
| 18 | Early versions would take prior string and just add one more star. |
| 19 | Or maybe two stars. Keep it short. |
| 20 | |
| 21 | General issues: |
| 22 | * Allow link-parser app to special case wild-cards for generation. |
| 23 | * Loading of entire dict is unfeasible, so... |
| 24 | Load only possible links? |
| 25 | |
| 26 | Ideas: |
| 27 | * Parse given word seq containing blanks, use unknown word for |
| 28 | blanks, then lookup all words with matching disjuncts. This |
| 29 | requires: |
| 30 | * Allow dict lookup of words according to desired disjuncts. |
| 31 | |
| 32 | |
| 33 | OK, screw that. The diary part ten is exploring this, here are the best |
| 34 | ideas in summary form: |
| 35 | |
| 36 | 1) Starting with a word A, use incoming set to randomly select some |
| 37 | subset of all possible edges. This will be called the "focus set" or the |
| 38 | "attentional focus". Because it is small, it can be exhaustively |
| 39 | iterated and sorted into high-to-low MI order. This provides a weighted |
| 40 | distribution, from which a rescaled uniform-random choice can be made. |
| 41 | |
| 42 | 2) Random sample N out of full incoming set. |
| 43 | |
| 44 | Lets steam-process this: Query returns list of edges |
| 45 | (Query (Variable "next") ; vardecl |
| 46 | (EdgeLink (Predicate "ANY") |
| 47 | (List (Word "start") (Variable "next")))) |
| 48 | |
| 49 | This returns a list (a short list? where do we plug in N to cap the size?) |
| 50 | The list is actually a QueueValue. |
| 51 | |
| 52 | 3) Out of this queue Value, select one, with the proper weighting. |
| 53 | Treating this as a collection of priors requires a sum over all elts |
| 54 | in the queue, to obtain a total norm, and then making a second pass |
| 55 | to choose one for this weighted distribution. This requires a |
| 56 | "non-local" RAM-walking sum. |
| 57 | |
| 58 | A local way of doing this is to pick a min-MI cutoff, and selecting the |
| 59 | first elt that is above the cutoff. |
| 60 | |
| 61 | A quasi-local way is to take the average of the first three elts, |
| 62 | the first K elts, and then accept the first that is above this average. |
| 63 | So the first K are always discarded, until the moving average is arrived |
| 64 | at. |
| 65 | |
| 66 | This needs: |
| 67 | 4) Atomese to fish out/Filter the MI from the correct location |
| 68 | and or compute it on the fly. |
| 69 | |
| 70 | Atomese to compute a moving average. |
| 71 | |
| 72 | What is the minimal way to do this? |
| 73 | Can it be done so that MOSES can be applied to tune it? |
| 74 | |
| 75 | Ugh. |