-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathlearn-lang-diary-part-two.lyx
42987 lines (33234 loc) · 847 KB
/
learn-lang-diary-part-two.lyx
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
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#LyX 2.3 created this file. For more info see http://www.lyx.org/
\lyxformat 544
\begin_document
\begin_header
\save_transient_properties true
\origin unavailable
\textclass article
\begin_preamble
\usepackage{url}
\usepackage{slashed}
\end_preamble
\use_default_options false
\maintain_unincluded_children false
\language english
\language_package default
\inputencoding utf8
\fontencoding global
\font_roman "times" "default"
\font_sans "helvet" "default"
\font_typewriter "cmtt" "default"
\font_math "auto" "auto"
\font_default_family default
\use_non_tex_fonts false
\font_sc false
\font_osf false
\font_sf_scale 100 100
\font_tt_scale 100 100
\use_microtype false
\use_dash_ligatures false
\graphics default
\default_output_format default
\output_sync 0
\bibtex_command default
\index_command default
\paperfontsize default
\spacing single
\use_hyperref true
\pdf_bookmarks true
\pdf_bookmarksnumbered false
\pdf_bookmarksopen false
\pdf_bookmarksopenlevel 1
\pdf_breaklinks true
\pdf_pdfborder true
\pdf_colorlinks true
\pdf_backref false
\pdf_pdfusetitle true
\papersize default
\use_geometry false
\use_package amsmath 2
\use_package amssymb 2
\use_package cancel 1
\use_package esint 0
\use_package mathdots 1
\use_package mathtools 1
\use_package mhchem 0
\use_package stackrel 1
\use_package stmaryrd 1
\use_package undertilde 1
\cite_engine basic
\cite_engine_type default
\biblio_style plain
\use_bibtopic false
\use_indices false
\paperorientation portrait
\suppress_date false
\justification true
\use_refstyle 0
\use_minted 0
\index Index
\shortcut idx
\color #008000
\end_index
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
\paragraph_indentation default
\is_math_indent 0
\math_numbering_side default
\quotes_style english
\dynamic_quotes 0
\papercolumns 1
\papersides 1
\paperpagestyle default
\listings_params "basicstyle={\ttfamily},basewidth={0.45em}"
\tracking_changes false
\output_changes false
\html_math_output 0
\html_css_as_file 0
\html_be_strict false
\end_header
\begin_body
\begin_layout Title
Language Learning Diary - Part Two
\end_layout
\begin_layout Date
February-August 2021
\end_layout
\begin_layout Author
Linas Vepstas
\end_layout
\begin_layout Abstract
The language-learning effort involves research and software development
to implement the ideas concerning unsupervised learning of grammar, syntax
and semantics from corpora.
This document contains supplementary notes and a loosely-organized semi-chronol
ogical diary of results.
The notes here might not always makes sense; they are a short-hand for
my own benefit, rather than aimed at you, dear reader!
\end_layout
\begin_layout Section*
Introduction
\end_layout
\begin_layout Standard
Part two of the diary on the language-learning effort has three major sections.
These are summarized here.
This part has been closed, and part three has been started (there will
be no further updates here.)
\end_layout
\begin_layout Subsubsection*
Experiments with random grammars.
Feb-May 2021.
\end_layout
\begin_layout Standard
Attempt to run the full learning calibration pipeline on a randomly-generated
grammar.
This pipeline creates a random grammar, creates a random corpus with this
grammar, runs the learning pipeline, learns a grammar, and then compares
the learned grammar to the original one.
\end_layout
\begin_layout Standard
The goal of doing this is to be able to perform
\begin_inset Quotes eld
\end_inset
calibration
\begin_inset Quotes erd
\end_inset
: by comparing the input and output grammars for fidelity, we could explore
the parameter space, and find the best tuning for the learning pipeline.
This sounds good in principle, it failed in practice.
\end_layout
\begin_layout Standard
Doing this entailed numerous bug fixes and some new code to get everything
working (so that's a good thing).
A bit of interesting mathematics popped up: merging is a non-commutative
operation.
When merging words into a word class, one must also merge connectors into
connector classes.
The initial idea was that merges can be done as (quasi-)linear operations:
Attached to each word is a vector, and creating a word-class is as simple
as summing vectors.
Or possibly intersecting the basis elements, and then summing only those
parts where the basis overlap (thus, the quasi-linear merge.
This is needed, because non-overlapping vectors correspond to different
word senses, and we need for factor those out.
\end_layout
\begin_layout Standard
One might imagine that merging connectors is as simple as creating vectors
for those, the so-called
\begin_inset Quotes eld
\end_inset
shape
\begin_inset Quotes erd
\end_inset
vectors, and summing those.
Because of how shapes are created, one might think that one could merge
words, then shapes, or first shapes and only then words, and get the same
thing.
Not so: the merge operation is non-commutative.
The result depends on the order it's done in.
This is interesting, but troublesome.
\end_layout
\begin_layout Standard
The goal of merging is to find two things that are similar, and then place
them in a common class.
Since the
\begin_inset Quotes eld
\end_inset
things
\begin_inset Quotes erd
\end_inset
are word-disjunct pairs, one wishes to find some unambiguous, unique way
of merging them.
This seems not to be the case: there is some kind of
\begin_inset Quotes eld
\end_inset
torsion
\begin_inset Quotes erd
\end_inset
or
\begin_inset Quotes eld
\end_inset
curvature
\begin_inset Quotes erd
\end_inset
in the system.
It's not clear how to even characterize this concept clearly.
An unambiguous merge seems to be asking for some kind of flattening or
abelianization of the merge procedure.
It's not clear how to do this.
\end_layout
\begin_layout Standard
Mathematically, the formalities are still opaque.
The notation for word-disjunct pairs is awkward.
The notation for the linearizations are awkward.
When I think about linearization, it feels very geometric: as if one is
working with some tangent space to some manifold.
But there's no manifold, and the analogies quickly falter.
Progress requires a much clearer, a much more concrete description of what's
going on with this network.
\end_layout
\begin_layout Standard
The experiments ended with confusion.
Besides the above non-commutative aspect to merging, it became clear that
many different initial grammars are effectively equivalent, in that they
generate similar, if not identical corpora.
Thus, the naive idea of calibration fails: one can't just learn the input
grammar; at best one can learn the class of that grammar.
But, as of now, we don't have any clear way of defining a
\begin_inset Quotes eld
\end_inset
class of equivalent grammars
\begin_inset Quotes erd
\end_inset
, or more broadly,
\begin_inset Quotes eld
\end_inset
a class of very similar grammars
\begin_inset Quotes erd
\end_inset
.
\end_layout
\begin_layout Standard
A secondary problem was that the random grammar didn't resemble a natural
language grammar.
That was not the intent.
It was hoped that by picking a Zipfian distribution of vocabulary words,
a Zipf distribution of disjuncts, throwing in some synonyms into the mix,
the result would resemble a natural language.
This was not the case.
Despite having done a lot of distributional studies of English, it seems
that I still don't know how to characterize a natural language very well.
I don't know how to measure the complexity of a grammar, or the complexity
of a corpus.
There are formal questions: how can one tell when two grammars are isomorphic?
Almost isomorphic? There are practical questions: what is the best way
to factor the word-disjunct matrix?
\end_layout
\begin_layout Standard
In the end, it all got muddy, with now easy, obvious way of moving forward.
\end_layout
\begin_layout Subsubsection*
Back to English.
July 2021
\end_layout
\begin_layout Standard
The advantage of working with English is that one can develop a gut-feel
as to whether one is making progress.
It's hard to look at a random grammar, and decide
\begin_inset Quotes eld
\end_inset
does that make sense?
\begin_inset Quotes erd
\end_inset
So, back to English.
Earlier English experiments went so swimmingly well, that surely moving
forward should be easy!
\end_layout
\begin_layout Standard
An embarrassing problem was immediately encountered: Setting the merge threshold
at some apparently innocuous value, that would result in similar words
getting merged immediately resulted in chaos and failure.
This is very unlike the earlier experiments, where things went quite very
well.
Something went wrong.
What is it?
\end_layout
\begin_layout Standard
Well, several things.
\end_layout
\begin_layout Itemize
Merging requires a merge threshold.
Earlier experiments searched for this threshold carefully, and then applied
it.
Here, we complacently picked one, based on past experience and gut-sense,
and it was set too low.
\end_layout
\begin_layout Itemize
Earlier merges used an overlap strategy, of assuming that similar words
might have different disjunct sets just because some words were just too
thinly sampled, to have seen such disjuncts.
This seems like a good idea, but is perhaps naive.
If one word-disjunct pair has been observed 100 times, and given another,
similar word, that word-disjunct pair has been observed zero times, well,
that might not be due to under-sampling.
100 is really different than zero, and assigning a fraction of the 100
to the merge cluster is perhaps a bad idea.
There is a semi-formal proof that merging in this way will
\emph on
always
\emph default
reduce the MI.
So if the goal is entropy maximization, the overlap merge strategy is a
bad idea.
\end_layout
\begin_layout Itemize
Some confusion regarding the above ensues.
The MI between words is explored, and compared to the MI between merged
classes.
After a lot of work, it really does become clear that overlap merging always
makes grammatical class MI's worse, and that a pure intersection merge
always maximizes MI.
\end_layout
\begin_layout Itemize
It was expected that using Shapes would improve similarity scores.
After some work, it seems that this is not the case - they mostly seem
to make things worse.
It's not at all clear which this is so.
Shapes should have helped, but they don't!
\end_layout
\begin_layout Itemize
To keep calculations relatively fast, trimmed datasets were used.
It now seems that trimming damages the data.
This is still a problem.
Trimming seems like it should help learning, but again, it seems like it
doesn't.
The causes of this are still not intuitively clear.
\end_layout
\begin_layout Standard
The biggest thing that went wrong was that, when using MI as a measure of
similarity, some rather dis-similar words had a high MI.
How can that be? Turns out that if one compares a very large vector (a
word with lots of disjuncts, i.e.
a word with a large support) to another word with a very short vector (a
word with only one disjunct, for example), the result can be a very high
MI.
Yet this is obviously not what we want: short vectors should not be similar
to long vectors.
This prompts an exploration of other kinds of similarity measures.
\end_layout
\begin_layout Subsubsection*
Similarity Smackdown, July-August 2021
\end_layout
\begin_layout Standard
The poor merge results prompted a step back, to judge different similarity
measures (metrics).
Twelve
\emph on
ad hoc
\emph default
\begin_inset Quotes eld
\end_inset
part of speech
\begin_inset Quotes erd
\end_inset
clusters were defined.
They were
\emph on
ad hoc
\emph default
in the sense of being hand-picked out of the first few thousand words with
the highest observation counts.
The various similarity measures were used to computer the inter-cluster
and intra-cluster similarity.
The quality of the metrics was assessed based on their ability to discriminate
between clusters, by taking the ratio of the RMS sizes of the clusters
to the RMS cluster separations.
Higher discrimination is judged as being better.
\end_layout
\begin_layout Standard
Nine different similarity measures were evaluated:
\end_layout
\begin_layout Itemize
Mutual information
\end_layout
\begin_layout Itemize
Joint probability
\end_layout
\begin_layout Itemize
Variation of information
\end_layout
\begin_layout Itemize
Normalized variation of information
\end_layout
\begin_layout Itemize
Cosine distance
\end_layout
\begin_layout Itemize
Log cosine distance
\end_layout
\begin_layout Itemize
Vector overlap (plain Jaccard)
\end_layout
\begin_layout Itemize
Conditional Jaccard distance
\end_layout
\begin_layout Itemize
Probability Jaccard distance.
\end_layout
\begin_layout Standard
These were compared one datasets with and without shapes, at seven different
levels of trimming (so, 14 datasets total).
The results were as follows:
\end_layout
\begin_layout Itemize
Trimming is consistently deleterious to results.
However, using the full dataset blows up both RAM and compute time.
The best compromise, for the given datasets, appear to be to discard all
words that have a small number of observation counts, and to discard sections
with an observation count of less than two.
\end_layout
\begin_layout Itemize
Shapes mostly fail to improve similarity measurements, for any of the similarity
measures.
Using shapes makes all vectors more similar (smaller RMS intra-cluster,
but also smaller RMS inter-cluster).
The overall effect of shapes is mixed: they seem to improve things only
for highly-trimmed datasets.
Given that shapes add a large computational burden, they seem to offer
no benefit.
(They sharply increase the amount of time needed to compute similarity,
and can triple the RAM usage.)
\end_layout
\begin_layout Itemize
The best overall similarity measure was vector overlap.
Second place overall goes to Conditional Jaccard (which uses probabilities
in the Jaccard min/max formula) Third place goes to Probability Jaccard.
MI is consistently in fifth place.
\end_layout
\begin_layout Standard
A few comments.
Although the motivation for these experiments was the large MI between
short and long vectors, the experiments actually eliminated short vectors.
That is, the hand-picked clusters consisted of words with relatively high
counts, and thus relatively long vectors.
\end_layout
\begin_layout Standard
The failure of Probability Jaccard to dominate is also surprising.
The Wikipedia article explains that it is in some sense optimal: it provides
\begin_inset Quotes eld
\end_inset
maximally consistent sampling
\begin_inset Quotes erd
\end_inset
.
This appears not to help us.
It is also very computationally intensive; its the slowest similarity measure
of all.
\end_layout
\begin_layout Section*
February 2021 - Closed Loop Calibration
\end_layout
\begin_layout Standard
Part two of the diary on the language-learning effort starts with the new
task of of closed loop learning.
The idea of closed loop learning is that the accuracy of the learned grammars
can be very closely monitored and measured, thus allowing the learning
algorithms to be tuned for speed and measured for accuracy.
The closed loop is a basic five-step process:
\end_layout
\begin_layout Enumerate
Generating random but controlled grammars
\end_layout
\begin_layout Enumerate
Generate a text corpus from these grammars
\end_layout
\begin_layout Enumerate
Learn a new grammar from the corpus
\end_layout
\begin_layout Enumerate
Compare the controlled-grammar to the learned-grammar
\end_layout
\begin_layout Enumerate
Tune algorithms and procedures, and repeat.
\end_layout
\begin_layout Standard
The step-by-step instructions can be found in the file
\begin_inset Quotes eld
\end_inset
README-Calibration.md
\begin_inset Quotes erd
\end_inset
.
\end_layout
\begin_layout Section*
February 2021
\end_layout
\begin_layout Standard
Restart the project, finally making some headway.
ToDo items:
\end_layout
\begin_layout Itemize
Describe how the
\begin_inset Quotes eld
\end_inset
uniform random sampling of sentences
\begin_inset Quotes erd
\end_inset
is performed.
\end_layout
\begin_layout Itemize
Enable weighted random sampling of sentences.
\end_layout
\begin_layout Itemize
Fix multi-sense bug in gen-dict.scm circa line 85
\end_layout
\begin_layout Standard
First run.
Instructions in
\begin_inset Quotes eld
\end_inset
README-Calibration.md
\begin_inset Quotes erd
\end_inset
.
Lots and lots of bugs fixed and lots of pipeline was automated.
\end_layout
\begin_layout Section*
March 2021
\end_layout
\begin_layout Standard
First real experiment, in expt-7/expt-8/expt-9.
The dict in expt-7 fails to generate the correct corpus, because the generator
does not expand synonyms (this is a combinatorial explosion and it just
doesn't do that.) Expanded by hand in expt-8.
Same data, new scripts and config in expt-9.
\end_layout
\begin_layout Standard
Issues:
\end_layout
\begin_layout Itemize
After MST parsing, the grammar is correct, in that (I think) it will produce
exactly the same corpus.
However, the rules are different (and more verbose).
TODO: check that the same corpus is actually produced.
How? Answer: generate the corpus, and compare...
\end_layout
\begin_layout Itemize
After MST (MPG) parsing, the verbs link to obj-determiner instead of object.
Why? Was there a cutoff that was missed? The corpus is just ..
tiny.
\end_layout
\begin_layout Itemize
After (gram-classify-greedy-discrim 0.5 4) the right clusters are produced,
but the connectors are not clustered; they need to be.
TBD.
\end_layout
\begin_layout Itemize
Result: the correct corpus is produced (via manual checking), however, extra
sentences are produced, which are missing the verb.
This is because the wall links to the two determiners, and the wall can
be skipped.
However, the sentence with the verb has a higher MI.
(11.51 instead of 8.92.
See below.) This is due to a bug.
See below.
\end_layout
\begin_layout Standard
Here's the result:
\begin_inset VSpace defskip
\end_inset
\begin_inset listings
inline false
status open
\begin_layout Plain Layout
linkparser> the squirrel a dog
\end_layout
\begin_layout Plain Layout
Found 1 linkage (1 had no P.P.
violations)
\end_layout
\begin_layout Plain Layout
Unique linkage, cost vector = (UNUSED=0 DIS=-8.92 LEN=2)
\end_layout
\begin_layout Plain Layout
\end_layout
\begin_layout Plain Layout
+-----------TB-----------+
\end_layout
\begin_layout Plain Layout
+---TB---+---TE---+ +-TE-+
\end_layout
\begin_layout Plain Layout
| | | | |
\end_layout
\begin_layout Plain Layout
LEFT-WALL.2 the.1 squirrel.3 a.1 dog.3
\end_layout
\begin_layout Plain Layout
\end_layout
\begin_layout Plain Layout
linkparser> the squirrel saw a dog
\end_layout
\begin_layout Plain Layout
Found 1 linkage (1 had no P.P.
violations)
\end_layout
\begin_layout Plain Layout
Unique linkage, cost vector = (UNUSED=0 DIS=-11.51 LEN=4)
\end_layout
\begin_layout Plain Layout
\end_layout
\begin_layout Plain Layout
+--------------TB--------------+
\end_layout
\begin_layout Plain Layout
| +-----TC-----+
\end_layout
\begin_layout Plain Layout
+---TB---+---TE---+---TF--+-TD-+-TE-+
\end_layout
\begin_layout Plain Layout
| | | | | |
\end_layout
\begin_layout Plain Layout
LEFT-WALL.2 the.1 squirrel.3 saw.4 a.1 dog.3
\end_layout
\begin_layout Plain Layout
\end_layout
\end_inset
\begin_inset VSpace defskip
\end_inset
\end_layout
\begin_layout Standard
Hypothesis: The MI of wall-verb is lower than the MI of wall-determiner.
Thus, the planar parser always picks the wall-determiner.
Lets find out.
\end_layout
\begin_layout Standard
Heh.
There is no MI wall-verb! Ouch.
This was due to bad sampling; fixed github.com/opencog/opencog commit 895226228
Mar 16 2021.
Sheesh.
\end_layout
\begin_layout Subsection*
Expt-10
\end_layout
\begin_layout Standard
expt-10, this is fixed.
The parse trees are now very rich.
Generated sentences:
\end_layout
\begin_layout Itemize
length 4 - none
\end_layout
\begin_layout Itemize
length 5 - the expected ones.
\end_layout
\begin_layout Itemize
6 - LEFT-WALL LEFT-WALL plus valid sentence
\end_layout
\begin_layout Itemize
7 - none
\end_layout
\begin_layout Itemize
8 - LEFT-WALL the mouse saw the dog chased a bird
\end_layout
\begin_layout Itemize
9 - double left wall
\end_layout
\begin_layout Itemize
10 - the LEFT-WALL a cat saw the dog chased a squirrel – and also a triple-left-
wall.
\end_layout
\begin_layout Standard
WTF.
what's with the crazy multi-left-wall!? Heh.
Here we go:
\begin_inset VSpace defskip
\end_inset
\end_layout
\begin_layout Standard
\begin_inset listings
inline false
status open
\begin_layout Plain Layout
+---------------------TI-------------------+
\end_layout
\begin_layout Plain Layout
+------------------TB-----------------+ |
\end_layout
\begin_layout Plain Layout
| +------TI-----+ | |
\end_layout
\begin_layout Plain Layout
| +---TB--+--TC-+--TO--+-TE-+-TC-+
\end_layout
\begin_layout Plain Layout
| | | | | | |
\end_layout
\begin_layout Plain Layout
LEFT-WALL.2 LEFT-WALL.2 a.1 mouse.5 saw.3 a.1 cat.5
\end_layout
\end_inset
\end_layout
\begin_layout Subsection*
Expt-11
\end_layout
\begin_layout Standard
So...
expt-11 places a period at the end of every sentence.
That terminates the infinite-recursive lengths being generated to only
finite-length sentences.
There is a total of three different parses.
All have exactly the same cost.
These are as follows:
\begin_inset VSpace defskip
\end_inset
\end_layout
\begin_layout Standard
\begin_inset listings
inline false
status open
\begin_layout Plain Layout
Found 3 linkages (3 had no P.P.
violations) Linkage
1, cost vector = (UNUSED=0 DIS=-15.67 LEN=10)
\end_layout
\begin_layout Plain Layout
\end_layout
\begin_layout Plain Layout
+-------------------TH-------------------+
\end_layout
\begin_layout Plain Layout
| +------------TJ-----------+
\end_layout
\begin_layout Plain Layout
+------TG------+ +----TE----+
\end_layout
\begin_layout Plain Layout
+---TF---+--TD-+---TI--+--TC--+--TD-+-TJ-+
\end_layout
\begin_layout Plain Layout
| | | | | | |
\end_layout
\begin_layout Plain Layout
LEFT-WALL.2 the.1 dog.3 chased.4 the.1 cat.3 ..5
\end_layout
\begin_layout Plain Layout
\end_layout
\begin_layout Plain Layout
Linkage 2, cost vector = (UNUSED=0 DIS=-15.67 LEN=11)
\end_layout
\begin_layout Plain Layout
+-------------------TH-------------------+
\end_layout
\begin_layout Plain Layout
| +------------TJ-----------+
\end_layout
\begin_layout Plain Layout
+------TG------+------TB------+----TE----+
\end_layout
\begin_layout Plain Layout
+---TF---+--TD-+---TI--+--TC--+--TD-+-TJ-+
\end_layout
\begin_layout Plain Layout
| | | | | | |
\end_layout
\begin_layout Plain Layout
LEFT-WALL.2 the.1 dog.3 chased.4 the.1 cat.3 ..5
\end_layout
\begin_layout Plain Layout
\end_layout
\begin_layout Plain Layout
Linkage 3, cost vector = (UNUSED=0 DIS=-15.67 LEN=12)
\end_layout
\begin_layout Plain Layout
\end_layout
\begin_layout Plain Layout
+-------------------TH-------------------+
\end_layout
\begin_layout Plain Layout
| +------------TJ-----------+
\end_layout
\begin_layout Plain Layout
| | +--------TK-------+
\end_layout
\begin_layout Plain Layout
+------TG------+ | +----TE----+