Issue 209 ALE "CDS LG-E-clean" 2019-04-24 400 clusters MWC=1

Issue 209 GL exception 'list index out of range'

"Child Directed Speech" corpus, "LG-E-clean" dataset,
trash filter off: min_word_count = 1, max_sentence_length off, Link Grammar 5.5.1
.
Server 94, fresh clone of singnet repository 2019-04-03, fresh ull environment ~ 2018-03-18

Basic settings

In [1]:
import os, sys, time
module_path = os.path.abspath(os.path.join('..'))
if module_path not in sys.path: sys.path.append(module_path)
from src.grammar_learner.utl import UTC, test_stats
from src.grammar_learner.read_files import check_dir, check_corpus
from src.grammar_learner.write_files import list2file
from src.grammar_learner.widgets import html_table
from src.grammar_learner.pqa_table import table_rows, params, wide_rows
tmpath = module_path + '/tmp/'
check_dir(tmpath, True, 'none')
start = time.time()
runs = (1,1)
print(UTC(), ':: module_path:', module_path)
2019-04-25 15:11:28 UTC :: module_path: /home/obaskov/94/ULL

Corpus test settings

In [2]:
corpus = 'CDS' # 'Child Directed Speech' 
dataset = 'LG-E-clean'
kwargs = {
    'max_sentence_length':  99      ,
    'max_unparsed_words' :  10      ,
    'left_wall'     :   ''          ,
    'period'        :   False       ,
    'context'       :   1           ,   # 1: connector-based word space
    'min_word_count':   1           ,   # 31,21,11,6,1
    'word_space'    :   'sparse'    ,
    'clustering'    :   ['agglomerative', 'ward'],
    'clustering_metric' : ['silhouette', 'cosine'],
    'cluster_range' :   [400]       ,
    'top_level'     :   0.01        ,
    'grammar_rules' :   2           ,   # disjunct-based grammar rules
    'max_disjuncts' :   1000000     ,   # off
    'stop_words'    :   []          ,
    'tmpath'        :   tmpath      ,
    'verbose'       :   '+'      ,
    'template_path' :   'poc-turtle',
    'linkage_limit' :   1000        }
rp = module_path + '/data/CDS/LG-E-clean'
cp = rp  # corpus path = reference_path
out_dir = module_path + '/output/' + '_issue_209_CDS-ALE-ILE-' + str(UTC())[:10] +'_'
print(UTC(), '\n', out_dir)
2019-04-25 15:11:28 UTC 
 /home/obaskov/94/ULL/output/_issue_209_CDS-ALE-ILE-2019-04-25_

Check IndexError

In [3]:
%%capture
table = []
line = [['', corpus, dataset, 0, 0, 'none']]
kwargs['min_word_count'] = 1 # 31
a, _, header, log, rules = wide_rows(line, out_dir, cp, rp, runs, **kwargs)
header[0] = ''
table.extend(a)
In [4]:
display(html_table([header] + a)); print(test_stats(log))
CorpusParsingSpaceLinkageAffinityG12nThresholdRulesMWCNNSIPAPQF1Top 5 cluster sizes
CDSLG-E-cleancALWEdwardeuclideannone---3011---0.0100%99%0.99[1, 0]
Cleaned dictionary: 301 words, grammar learn time: 00:00:05, grammar test time: 00:00:01