-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathec.py
77 lines (69 loc) · 2.4 KB
/
ec.py
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
import os
import subprocess
import sys
DUMMY = len(sys.argv) > 1 and sys.argv[1] == "DUMMY"
def system(command):
global DUMMY
if DUMMY:
print "Would now execute:"
print command
else:
print "Will now execute:"
print command
os.system(command)
training = [
"Odden_105_Bukusu",
"Odden_81_Koasati",
"Halle_125_Indonesian",
"Odden_85_Samoan",
"Odden_2.4_Tibetan",
"Odden_1.3_Korean",
"Odden_1.12_English",
"Odden_2.1_Hungarian",
"Odden_2.2_Kikuria",
"Odden_2.5_Makonde",
"Odden_3.1_Kerewe",
"Odden_116_Armenian",
"Odden_4.1_Serbo_Croatian",
"Odden_4.4_Latin",
"Odden_3.5_Catalan",
"Odden_4.3_Somali",
"Odden_3.3_Ancient_Greek",
"Odden_68_69_Russian",
"Odden_76_77_Kerewe",
"Odden_77_78_English",
"Odden_79_Jita",
"Odden_81_Korean",
"Roca_25_Zoque",
"Roca_16_German",
"Roca_89_Lumasaaba",
"Roca_104_Tunica",
"Halle_85_Turkish",
"Halle_109_Russian",
"Halle_149_Russian",
"Odden_114_Lithuanian"
]
### Produce UG1
command = "pypy UG.py --export experimentOutputs/ug0.p"
for t in training:
command += " experimentOutputs/%s_incremental_disableClean=False_features=sophisticated_geometry=True.p"%t
system(command)
print "expanding frontiers with new universal grammar!"
promises = []
for t in training:
oldPath = "experimentOutputs/%s_incremental_disableClean=False_features=sophisticated_geometry=True.p"%t
newPath = "experimentOutputs/%s_incremental_disableClean=False_features=sophisticated_geometry=True_expanded.p"%t
command = "python driver.py %s frontier --geometry -t 100 --mergeFrontiers --restore %s --save %s -u experimentOutputs/ug0.p"%(t,
oldPath,
newPath)
print "Will execute:",command
promises.append(command)
if not DUMMY:
promises = [subprocess.Popen(p, shell=True)
for p in promises]
for p in promises: p.wait()
print "Reestimate universal grammar!"
command = "pypy UG.py --export experimentOutputs/ug1.p"
for t in training:
command += " experimentOutputs/%s_incremental_disableClean=False_features=sophisticated_geometry=True_expanded.p"%t
system(command)